pn-python-scaffolding

pn-python-scaffolding is a skill for Cursor 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 Cursor

Written for Cursor: shipped in a Cursor plugin.

Part of the pn-core plugin — 133 skills, 19 commands, 9 agents, 1 MCP server shipped together

Good fit Use it to start a Python API, add a route or module, or establish a project structure and environment settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/perniemann/pncore/pn-python-scaffolding
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.

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: Cursor.

Or install pn-core, the plugin that ships this one along with the rest of its 133 skills, 19 commands, 9 agents, 1 MCP server.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pn-python-scaffolding

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.5 $0.00020 $0.00501
Sonnet 5.5 $0.00010 $0.00251
Haiku 4.5 $0.00005 $0.00125

Measured 1mo ago against content hash 1c733b7d25fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 yesterday), licensed MIT. It adds 51 tokens to every session and 1,253 once invoked, about $0.0002 per session on Opus 5.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

python-backend

Production Python async patterns including asyncio TaskGroup, FastAPI dependency injection and middleware, SQLAlchemy 2.0 async sessions, and database connection pool tuning. Python 3.11+ runtime concerns such as ExceptionGroup, cancellation semantics, and session rollback. Use when building async services, wiring…

yonatangross/orchestkit · 82 tokens

plugin-system

Generic plugin system for Python applications. Auto-discovery, validation, fault tolerance. Zero dependencies (Python stdlib only).

ellmos-ai/skills · 27 tokens

django-6-upgrade-guide

Plan, audit, or complete an upgrade from Django 5.x to Django 6. Verify runtime and dependency compatibility, deprecations, settings, databases, migrations, tests, and deployment. Do not use for general Django work, earlier upgrades, frontend styles, or unrelated maintenance.

btfranklin/skills · 64 tokens

async-python-patterns

Build high-performance Python applications with asyncio, concurrency patterns, and async/await. Use when the user needs async APIs, concurrent workflows, or non-blocking I/O-heavy systems.

LuizEduPP/Rememb · 41 tokens

migrating-pi-to-pydantic-ai

Migrate TypeScript Pi coding-agent applications, extensions, or packages to Python with Pydantic AI and Pydantic AI Harness. Use when source code imports @earendil-works/pi-, calls createAgentSession, registers Pi extensions, or relies on Pi tools, hooks, skills, sessions, compaction, providers, TUI, RPC, or packages.

pydantic/pydantic-ai · 88 tokens

cross-sdk-parity

Keep TypeScript and Python SDK behavior, generated client usage, public API naming, and docs examples aligned. Use when a change affects both SDKs, when generated client pins move, when comparing TS/Python behavior, or when a backend API contract changed. Do not use for single-language internal-only changes.

ComposioHQ/composio · 66 tokens