pn-python-scaffolding

pn-python-scaffolding is a skill for Claude Code, Codex from perniemann/pnCore. It costs 51 tokens per session (1,253 once invoked), scanned A, original, MIT.

A starting structure for Python web APIs and routes using FastAPI, Flask, or Django. Python is a programming language, and an API lets other programs communicate with your service.

In plain words
What is it for?
Use it to start a Python API, add a route or module, or establish a project structure and environment settings.
Why use it?
It provides consistent places for routes, validation, configuration, database access, security helpers, and error handling.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/perniemann/pncore/pn-python-scaffolding
Any agent
npx skills add perniemann/pnCore --skill pn-python-scaffolding
Clone the repo
git clone --depth 1 https://github.com/perniemann/pnCore

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pn-python-scaffolding

README.md
[![agentmods](https://agentmods.dev/badge/skills/perniemann/pncore/pn-python-scaffolding.svg)](https://agentmods.dev/skills/perniemann/pncore/pn-python-scaffolding)
Your own site
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-python-scaffolding"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-python-scaffolding.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,253 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00051 $0.01253
Opus 5 $0.00026 $0.00626
Sonnet 5 $0.00010 $0.00251
Haiku 4.5 $0.00005 $0.00125

Measured 2d ago against content hash 1c733b7d25fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

pn-python-scaffolding scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/pn-core-mcp/content/skills/backend/pn-python-scaffolding/SKILL.md · 182 lines

How it starts

The opening of the file, as written. The whole thing — 182 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python backend scaffolding

When to use

  • Starting a new Python API project (FastAPI, Flask, Django).
  • Adding a new route, router, or domain module.
  • Establishing project structure and config patterns from scratch.

Project structure

# FastAPI — domain-driven layout (preferred)
src/
  users/
    router.py         # APIRouter with route definitions
    service.py        # Business logic
    schemas.py        # Pydantic request/response models
    models.py         # SQLAlchemy ORM models (if used)
  orders/
    router.py
    service.py
    schemas.py
  core/
    config.py         # Settings via pydantic-settings
    database.py       # Async DB engine + session factory
    errors.py         # AppError class and exception handlers
    security.py       # Auth helpers (JWT decode, password hash)
  main.py             # FastAPI app factory, router registration

pyproject.toml        # Dependencies + project metadata (preferred over requirements.txt)
.env.example          # Required environment variables with placeholders

FastAPI scaffold

# src/users/schemas.py
from pydantic import BaseModel, EmailStr, field_validator

class CreateUserRequest(BaseModel):
    email: EmailStr
    name: str
    role: str = "user"

    @field_validator("name")
    @classmethod
    def name_not_empty(cls, v: str) -> str:
        if not v.strip():
            raise ValueError("Name cannot be empty")
        return v.strip()

class UserResponse(BaseModel):
    id: int
    email: str
    name: str
    role: str

    model_config = {"from_attributes": True}  # allow ORM model input
# src/users/router.py
from fastapi import APIRouter, Depends, HTTPException, status
from .schemas import CreateUserRequest, UserResponse
from .service import create_user, get_user_by_id
from ..core.security import get_current_user

router = APIRouter(prefix="/users", tags=["users"])

@router.post("/", response_model=UserResponse, status_code=status.HTTP_201_CREATED)
async def create_user_route(
    body: CreateUserRequest,
    current_user=Depends(get_current_user),
) -> UserResponse:
    return await create_user(body)

@router.get("/{user_id}", response_model=UserResponse)
async def get_user_route(
    user_id: int,
    current_user=Depends(get_current_user),
) -> UserResponse:
    user = await get_user_by_id(user_id, requester_id=current_user.id)
    if not user:
        raise HTTPException(status_code=404, detail="User not found")
    return user

Read the full file on GitHub · 182 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 182 lines · 51 tokens per session scan A 1c733b7d25fe

Subscribe to this mod's changes

pn-python-scaffolding is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 2d ago), licensed MIT. It adds 51 tokens to every session and 1,253 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

implementation-strategy

Choose compatibility-aware scope for runtime and API changes in openai-agents-python. Use before initial implementation and each review-feedback batch to decide whether to patch, reset the design, preserve compatibility, or reject unsupported cases.

openai/openai-agents-python · 47 tokens

sensitive-logging-audit

Audit and fix sensitive-data exposure through Python runtime logging in openai-agents-python. Use when reviewing logging, print, warnings, stderr, traceback, MCP names, model or tool exceptions, redaction flags, or any diagnostic path that may retain user data.

openai/openai-agents-python · 59 tokens

maintainer-review

Assess an openai-agents-python GitHub issue or pull request as a maintainer. Use to verify the claimed need and practical impact, compare supported alternatives or competing approaches, separate code quality from repository readiness, recommend the maintainer action, and draft a copy-ready comment when evidence…

openai/openai-agents-python · 69 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

fastapi-templates

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

wshobson/agents · 37 tokens

code-change-verification

Run the mandatory verification stack when changes affect runtime code, tests, or build/test behavior in the OpenAI Agents Python repository.

openai/openai-agents-python · 30 tokens