python-skills
CLAUDE.md4 starsChanged 7 months agoMITView on GitHub
Universal skills, rules and standards for AI-assisted Python development. Compatible with: Claude Code · Cursor · Kiro · Windsurf · Gemini Code Assist · GitHub Copilot · Amazon Q Target experience level: 18-20 years of professional Python development.
- Reads credentials
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/python-core.mdcCursor rule
- .cursor/rules/python-security.mdcCursor rule
- .cursor/rules/python-testing.mdcCursor rule
- llms.txtllms.txt
- python-standardsSkill
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Read this file entirely before writing any code.
- Very specific: line 12
Check [project] requires-python in pyproject.toml before using ANY version-specific syntax.
- Distinctive: line 17
Ask before assuming framework version, DB engine, auth mechanism, or Python version.
- Very specific: line 18
Never delete existing migrations, test files, or .env.example entries.
- Distinctive: line 19
When in doubt between two approaches, choose the one that is more explicit and testable.
- Distinctive: line 95
Add to your project's CLAUDE.md (or first message):
≈ “Common” is an estimate: at least 1 in 5 of the 28,633 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Python AI-SDLC Framework — Master Context
Universal skills, rules and standards for AI-assisted Python development. Compatible with: Claude Code · Cursor · Kiro · Windsurf · Gemini Code Assist · GitHub Copilot · Amazon Q Target experience level: 18-20 years of professional Python development.
AGENT CONTRACT — READ BEFORE EVERY CODING TASK
- Read this file entirely before writing any code.
- Check
[project] requires-pythoninpyproject.tomlbefore using ANY version-specific syntax. - Load
skills/common/code-style.mdfor every task — no exceptions. - Load the framework-specific
skills/{framework}/SKILL.mdfor the project's framework. - Load domain-specific skills (
skills/common/security.md,db-design.md, etc.) when relevant. - Cite the rule you are enforcing when you make a style or architectural decision.
- Ask before assuming framework version, DB engine, auth mechanism, or Python version.
- Never delete existing migrations, test files, or
.env.exampleentries. - When in doubt between two approaches, choose the one that is more explicit and testable.
NON-NEGOTIABLE RULES (always active — no exceptions)
| # | Rule | Source |
| 1 | Check requires-python before using version-specific syntax | code-style.md §1.3 |
| 2 | 4 spaces indentation. No tabs. | PEP 8, code-style.md §2.1 |
| 3 | All public functions/methods/classes must have docstrings | PEP 257, code-style.md §7 |
| 4 | Full type annotations on all function signatures | PEP 484, code-style.md §9 |
| 5 | No hardcoded secrets — all config via pydantic-settings | security.md §1 |
| 6 | All logging uses structlog — no print() in production code | logging.md |
| 7 | All DB access through ORM/repository — no raw SQL unless parameterised | db-design.md §6 |
| 8 | Tests mandatory for all business logic — 80% coverage minimum | testing.md |
| 9 | All API endpoints authenticated unless explicitly marked public | security.md §2 |
| 10 | Layer discipline enforced — API→Service→Repository→Model | folder-structure.md §3.2 |
| 11 | Never use mutable default arguments | code-style.md §10.7 |
| 12 | Always catch specific exceptions — never bare except: | error-handling.md §4.1 |
| 13 | Never compare to None with == — always use is / is not | code-style.md §10.1 |
| 14 | Exceptions derive from Exception, not BaseException | error-handling.md §1.1 |
| 15 | All monetary values use Decimal, never float | db-design.md §7 |
FILE STRUCTURE
CLAUDE.md ← you are here (master context)
.cursorrules ← Cursor / Kiro / Windsurf auto-load
skills/
common/
code-style.md ← PEP 8 full compliance + modern Python
code-style-index.md ← Section map for targeted loading
folder-structure.md ← 5 project archetypes + layer contract
error-handling.md ← exception hierarchy + HTTP mapping
logging.md ← structlog setup + field vocabulary
security.md ← OWASP + auth + input validation
api-auth.md ← OAuth2, JWT, RBAC/ABAC, service-to-service
testing.md ← pytest + factories + coverage rules
db-design.md ← SQLAlchemy 2.x + Alembic + indexing
data-migrations.md ← zero-downtime migrations, expand-contract
performance.md ← async, caching, N+1 prevention, pagination
llm-patterns.md ← prompt mgmt, LLM client abstraction, context
ci-cd.md ← GitHub Actions pipeline templates
deployment.md ← Docker, health checks, 12-factor, graceful shutdown
observability.md ← OpenTelemetry, metrics, tracing, log correlation
async-patterns.md ← Task queues, retries, DLQ, domain events
microservices.md ← Service boundaries, communication, contracts
feature-flags.md ← Gradual rollouts, flag lifecycle, cleanup
dependency-management.md ← Pinning, vulnerability scanning, updates
fastapi/SKILL.md
django/SKILL.md
drf/SKILL.md
flask/SKILL.md
rules/
api-design.md
git-workflow.md
code-review.md ← Review checklist, severity, feedback
agents/
qa-agent.md
docs/
onboarding.md
incident-response.md ← Severity, escalation, postmortems
tech-debt.md ← Tracking, prioritization, scheduling
adr/
ADR-template.md ← Architecture decision record template
examples/
fastapi-app/ ← reference implementationHOW TO PRIME AN AGENT FOR A PROJECT
Add to your project's CLAUDE.md (or first message):
This project uses [framework] with [database] on Python [version].
requires-python = ">=3.11"
Load skills/[framework]/SKILL.md as the primary framework skill.Or in Claude Code:
/load-skill fastapiMODERN CURSOR RULES (.cursor/rules/*.mdc)
For Cursor ≥0.45, the authoritative rules are in .cursor/rules/:
| File | Globs | alwaysApply |
python-core.mdc | **/*.py | true |
python-security.mdc | **/*.py | true |
python-fastapi.mdc | app/api/**, app/main.py | false (auto-attached by glob) |
python-django.mdc | **/models.py, **/views.py, etc. | false (auto-attached by glob) |
python-testing.mdc | tests/**/*.py | false (auto-attached by glob) |
The .cursorrules root file is kept for backward compatibility with older Cursor versions and other tools (Kiro, Windsurf).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

