agentleFS
atstaeffatstaeff/ai-agents/skills/languages/python-patterns/SKILL.md

python-patterns

Skill4 starsChanged 22 days agoMITView on GitHub

Write, review or debug Python and FastAPI code with typed boundaries, safe async/resource lifetimes and behavior-focused tests.

76 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use upstash-qstash, nuxt4-patterns and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • xfstudioSkill

    upstash-qstash

    Upstash QStash expert for serverless message queues, scheduled jobs, and reliable HTTP-based task delivery without managing infrastructure. Use when: qstash, upstash queue, serverless cron, scheduled http, message queue serverless.

    Also in 5 projects that use this

  • loulanyueSkill

    nuxt4-patterns

    Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.

    Also in 14 projects that use this

  • RojiosSkill

    dart-flutter-patterns

    Production-ready Dart and Flutter patterns covering null safety, immutable state, async composition, widget architecture, popular state management frameworks (BLoC, Riverpod, Provider), GoRouter navigation, Dio networking, Freezed code generation, and clean architecture.

    Also in 10 projects that use this

  • royaluniondesign-sysSkill

    content-hash-cache-pattern

    Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.

    Also in 23 projects that use this

  • TironFoxSkill

    agent-payment-x402

    Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.

    Also in 8 projects that use this

  • junimnjwSkill

    ralphinho-rfc-pipeline

    RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.

    Also in 17 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 73 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the established checks at the affected boundary.

    line 15

“Common” is measured: kept by at least 6 in 10 of the 73 edited versions of this file we could read. “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
SKILL.md

Python Patterns

Workflow

  1. Inspect the supported Python versions, pyproject, lockfile, entry points and current test commands. Reuse the project's environment manager; use uv for a new project when appropriate. Keep syntax and dependencies compatible with the declared minimum.
  2. Model rules with small functions and explicit types. Use dataclasses for suitable internal data and boundary validation where required. Add protocols or layers only for a real substitution or transaction boundary.
  3. For FastAPI, define request/response contracts and error semantics; enforce authorization for the resource and action. Keep transport schemas distinct where exposure or domain rules differ. Scope clients/sessions through dependencies and application lifespan.
  4. Match sync/async code to the libraries in use. Keep blocking I/O and CPU work out of the event loop; bound external calls with timeouts and handle cancellation. Close resources on success and failure.
  5. Make transaction ownership and commit points explicit. Preserve atomicity, uniqueness and stale-write behavior; retry only safe operations. Keep secrets and personal data out of error responses and logs.
  6. Run the established checks at the affected boundary. Exercise success, validation/authorization failure and relevant cleanup or rollback. Reset dependency overrides between tests; distinguish HTTP contract evidence from actual database/integration evidence.

Result

Deliver the focused diff and executed checks, including supported-version or integration limits.

Focused references

  • FastAPI boundaries: for routes, dependency lifetime and async behavior.
  • Persistence and refactoring: for transaction or design changes.

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.