agentleFS
rishapgandhirishapgandhi/python-skills/CLAUDE.md

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

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
  1. Distinctive:

    Read this file entirely before writing any code.

    line 11
  2. Very specific:

    Check [project] requires-python in pyproject.toml before using ANY version-specific syntax.

    line 12
  3. Distinctive:

    Ask before assuming framework version, DB engine, auth mechanism, or Python version.

    line 17
  4. Very specific:

    Never delete existing migrations, test files, or .env.example entries.

    line 18
  5. Distinctive:

    When in doubt between two approaches, choose the one that is more explicit and testable.

    line 19
  6. Distinctive:

    Add to your project's CLAUDE.md (or first message):

    line 95

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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

  1. Read this file entirely before writing any code.
  2. Check [project] requires-python in pyproject.toml before using ANY version-specific syntax.
  3. Load skills/common/code-style.md for every task — no exceptions.
  4. Load the framework-specific skills/{framework}/SKILL.md for the project's framework.
  5. Load domain-specific skills (skills/common/security.md, db-design.md, etc.) when relevant.
  6. Cite the rule you are enforcing when you make a style or architectural decision.
  7. Ask before assuming framework version, DB engine, auth mechanism, or Python version.
  8. Never delete existing migrations, test files, or .env.example entries.
  9. When in doubt between two approaches, choose the one that is more explicit and testable.

NON-NEGOTIABLE RULES (always active — no exceptions)

#RuleSource
1Check requires-python before using version-specific syntaxcode-style.md §1.3
24 spaces indentation. No tabs.PEP 8, code-style.md §2.1
3All public functions/methods/classes must have docstringsPEP 257, code-style.md §7
4Full type annotations on all function signaturesPEP 484, code-style.md §9
5No hardcoded secrets — all config via pydantic-settingssecurity.md §1
6All logging uses structlog — no print() in production codelogging.md
7All DB access through ORM/repository — no raw SQL unless parameteriseddb-design.md §6
8Tests mandatory for all business logic — 80% coverage minimumtesting.md
9All API endpoints authenticated unless explicitly marked publicsecurity.md §2
10Layer discipline enforced — API→Service→Repository→Modelfolder-structure.md §3.2
11Never use mutable default argumentscode-style.md §10.7
12Always catch specific exceptions — never bare except:error-handling.md §4.1
13Never compare to None with == — always use is / is notcode-style.md §10.1
14Exceptions derive from Exception, not BaseExceptionerror-handling.md §1.1
15All monetary values use Decimal, never floatdb-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 implementation

HOW 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 fastapi

MODERN CURSOR RULES (.cursor/rules/*.mdc)

For Cursor ≥0.45, the authoritative rules are in .cursor/rules/:

FileGlobsalwaysApply
python-core.mdc**/*.pytrue
python-security.mdc**/*.pytrue
python-fastapi.mdcapp/api/**, app/main.pyfalse (auto-attached by glob)
python-django.mdc**/models.py, **/views.py, etc.false (auto-attached by glob)
python-testing.mdctests/**/*.pyfalse (auto-attached by glob)

The .cursorrules root file is kept for backward compatibility with older Cursor versions and other tools (Kiro, Windsurf).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.