python-dev

A guide to the project's Python backend conventions, including FastAPI for web endpoints, Pydantic for data validation, SQLAlchemy for database access, and pytest for tests.

In plain words
What is it for?
Use it when changing Python APIs, database models or migrations, services, schemas, or backend tests.
Why use it?
It gives backend changes consistent patterns for asynchronous code, validation, errors, database work, and testing.

Skill for Claude CodeCodex

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/jaansokk/cursor_tools/python-dev
Any agent
npx skills add jaansokk/cursor_tools --skill python-dev
Clone the repo
git clone --depth 1 https://github.com/jaansokk/cursor_tools

Made for: Claude Code, Codex.

Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 677 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 $0.00031 $0.00677
Opus 5 $0.00015 $0.00338
Sonnet 5 $0.00006 $0.00135
Haiku 4.5 $0.00003 $0.00068

Measured yesterday against content hash d2398063adf3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-dev 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 yesterday.

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.

.claude/skills/python-dev/SKILL.md · 57 lines

How it starts

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

Python Conventions

Stack choices

  • FastAPI — async endpoints, dependency injection via Depends(), lifespan events
  • Pydantic v2 — schemas at all boundaries, ConfigDict(from_attributes=True) for ORM models
  • SQLAlchemy 2.0select() style, Mapped[], mapped_column(). No legacy 1.x Query API
  • Alembic — async migrations, always review autogenerated output
  • pytest + pytest-asyncio + httpx AsyncClient for testing

Coding standards

  • Async-first — all I/O (DB, HTTP, LLM) must be async. No blocking calls in async paths
  • Type hints everywhere — modern Python syntax (PEP 604 unions, generics)
  • Pydantic at all boundaries — no raw dicts across module boundaries
  • Separate request and response models — don't reuse the same schema for both
  • Structured logging — use the project's logging setup, not bare print()
  • Meaningful errors — HTTPException with correct status codes and clear messages
  • Small, focused functions — single responsibility

Architecture

  • Business logic lives in service modules, not in endpoint functions
  • Endpoints: validate input, call services, return responses
  • Use Depends() for sessions, config, auth, services
  • Group by feature/domain when the project grows, not by layer
  • Use lazy="selectin" or explicit eager loading to avoid N+1 queries
  • One session per request via dependency injection

Testing

  • Test behavior: inputs, outputs, status codes, side effects
  • Use fixtures for shared setup — organize conftest.py by scope
  • Mock external dependencies (LLM calls, external HTTP). Never hit real services in tests
  • Cover: happy path, validation errors (422), auth failures (401/403), not-found (404)

Workflow

  • Orient before coding — read existing code in the area, match patterns and naming conventions
  • Small, focused changes — stay within scope, don't refactor unrelated code
  • Write tests alongside implementation — new endpoints and services should ship with tests
  • Validate after edits — run type checker and linter, run tests if they exist in the area
  • If you change database models, create a new Alembic migration revision

Read the full file on GitHub · 57 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. yesterday First seen · 57 lines · 31 tokens per session scan A d2398063adf3

Subscribe to this mod's changes

python-dev is a skill published in the GitHub repository jaansokk/cursor_tools (1 stars, last pushed 5mo ago), licensed MIT. It adds 31 tokens to every session and 677 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories

ab-testing-framework

Design, run, and analyze A/B tests (controlled experiments) using Ronny Kohavi's methodology and Gibson Biddle's DHM trade-off analysis. Use when the user needs to plan an experiment, choose metrics (OEC), evaluate statistical significance, assess sample size requirements, avoid common experimentation pitfalls, or…

luisabwk/kraken · 75 tokens

continuous-discovery

Guide teams through building sustainable customer interview habits and discovery practices. Use when setting up weekly customer interviews, preparing interview guides, coaching story-based interviewing technique, synthesizing user research findings, planning assumption tests, or helping teams that say they don't have…

luisabwk/kraken · 60 tokens

prd-writer

Guide users through writing Product Requirements Documents (PRDs) and decomposing them into executable technical tasks. Use when creating a PRD, product spec, product one-pager, feature brief, PRP, or when breaking requirements into tasks with estimates, sprint planning, or technical decomposition.

luisabwk/kraken · 61 tokens

product-led-growth-playbook

Evaluate growth strategy, growth team structure, and go-to-market motions using Elena Verna's PLG frameworks. Use when the user asks about product-led growth, PLG, growth team hiring, self-serve vs sales-led motions, product-led sales, PQA/PQL models, growth loops, when to hire a head of growth, earned vs rented…

luisabwk/kraken · 97 tokens

ai-evals-builder

Build AI evals using the Husain-Shankar framework (error analysis, open/axial coding, LLM-as-judge). Use when a user needs to create, improve, or debug evals for an AI product — including defining failure modes, building LLM judges, or setting up production monitoring for an LLM application.

luisabwk/kraken · 72 tokens

dhm-strategy-framework

Evaluate and strengthen product strategy using Gibson Biddle's DHM framework (Delight, Hard-to-copy, Margin-enhancing). Use when the user asks about product strategy, competitive advantage, feature prioritization trade-offs, or wants to stress-test whether a product idea is strategically sound.

luisabwk/kraken · 62 tokens