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.
npx skills add MKToronto/python-clean-architecture --skill clean-architecturegit clone --depth 1 https://github.com/MKToronto/python-clean-architectureWrote 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.
[](https://agentmods.dev/skills/mktoronto/python-clean-architecture/clean-architecture)<a href="https://agentmods.dev/skills/mktoronto/python-clean-architecture/clean-architecture"><img src="https://agentmods.dev/badge/skills/mktoronto/python-clean-architecture/clean-architecture/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.
<a href="https://agentmods.dev/skills/mktoronto/python-clean-architecture/clean-architecture"><img src="https://agentmods.dev/badge/skills/mktoronto/python-clean-architecture/clean-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00112 | $0.04213 |
| Opus 5.5 | $0.00045 | $0.01685 |
| Sonnet 5.5 | $0.00022 | $0.00843 |
| Haiku 4.5 | $0.00011 | $0.00421 |
Grade A, and why
Python Clean Architecture 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.
How it starts
The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Clean Architecture
Provide Clean Architecture guidance for Python projects, specifically FastAPI APIs. Based on seven core design principles, Pythonic implementations of classic patterns, and a three-layer architecture (Routers → Operations → Database).
Attribution: The principles, patterns, and architectural approach in this skill are inspired by and synthesized from Arjan Codes' courses: The Software Designer Mindset, Pythonic Patterns, and Complete Extension. The specific Pythonic framing (Protocol-based DI, functional pattern progression, three-layer FastAPI architecture) originates from his teaching. This plugin distills those principles into actionable guidance for Claude Code — it is not a reproduction of course content. See also: github.com/arjancodes | youtube.com/arjancodes.
When to Apply
- Scaffolding new FastAPI projects with clean separation of concerns
- Refactoring existing Python code to reduce coupling and increase cohesion
- Adding new components (endpoints, operations, repositories, models)
- Reviewing code for design quality and Pythonic idiom adherence
- Making code testable through dependency injection and Protocol-based abstractions
Core Architecture: Three Layers
Every FastAPI project follows a strict three-layer dependency flow:
Routers (API layer) → Operations (business logic) → Database (persistence)
Each layer depends ONLY on the layer below it. Never skip layers.
Layer Responsibilities
Routers — HTTP interface. Accept requests, call operations, return responses. No business logic. Act as the composition root where concrete implementations are injected.
Operations — Business logic. Accept a DataInterface (Protocol) parameter for data access. Compute derived values, enforce rules, orchestrate workflows. Never import database modules directly.
Database — Persistence. Implement the DataInterface Protocol using SQLAlchemy, file storage, or any backend. Expose read_by_id, read_all, create, update, delete methods. Return DataObject = dict[str, Any] to decouple from ORM models.
What ships with it
60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/fastapi-hotel-api/db/__init__.py 0 B runs code
- examples/fastapi-hotel-api/db/database.py 593 B runs code
- examples/fastapi-hotel-api/db/db_interface.py 2.0 KB runs code
- examples/fastapi-hotel-api/db/models.py 1.3 KB runs code
- examples/fastapi-hotel-api/main.py 657 B runs code
- examples/fastapi-hotel-api/models/__init__.py 0 B runs code
- examples/fastapi-hotel-api/models/booking.py 638 B runs code
- examples/fastapi-hotel-api/models/customer.py 393 B runs code
- examples/fastapi-hotel-api/models/room.py 694 B runs code
- examples/fastapi-hotel-api/operations/__init__.py 0 B runs code
- examples/fastapi-hotel-api/operations/booking.py 1.5 KB runs code
- examples/fastapi-hotel-api/operations/customer.py 1.2 KB runs code
- examples/fastapi-hotel-api/operations/interface.py 1.6 KB runs code
- examples/fastapi-hotel-api/operations/room.py 1.3 KB runs code
- examples/fastapi-hotel-api/routers/__init__.py 0 B runs code
- examples/fastapi-hotel-api/routers/bookings.py 1.9 KB runs code
- examples/fastapi-hotel-api/routers/customers.py 1.7 KB runs code
- examples/fastapi-hotel-api/routers/rooms.py 2.3 KB runs code
- examples/fastapi-hotel-api/tests/__init__.py 0 B runs code
- examples/fastapi-hotel-api/tests/test_bookings.py 2.8 KB runs code
- examples/fastapi-hotel-api/tests/test_rooms.py 1.6 KB runs code
- references/async-patterns.md 12 KB
- references/classes-and-dataclasses.md 18 KB
- references/code-quality.md 9.9 KB
- references/code-smells.md 13 KB
- references/context-managers.md 6.6 KB
- references/data-structures.md 14 KB
- references/decorators.md 8.0 KB
- references/dependency-injection.md 7.5 KB
- references/design-principles.md 17 KB
- references/domain-driven-design.md 4.8 KB
- references/domain-modeling.md 863 B
- references/error-handling.md 11 KB
- references/function-design.md 20 KB
- references/grasp-principles.md 9.6 KB
- references/layered-architecture.md 16 KB
- references/monadic-error-handling.md 7.0 KB
- references/pattern-matching.md 7.4 KB
- references/patterns/abstract-factory.md 18 KB
- references/patterns/adapter.md 5.2 KB
- references/patterns/bridge.md 17 KB
- references/patterns/builder.md 6.5 KB
- references/patterns/command.md 13 KB
- references/patterns/cqrs.md 7.9 KB
- references/patterns/event-sourcing.md 5.8 KB
- references/patterns/facade.md 6.3 KB
- references/patterns/fluent-interface.md 4.8 KB
- references/patterns/functional.md 10 KB
- references/patterns/lazy-loading.md 6.0 KB
- references/patterns/notification.md 17 KB
- references/patterns/pipeline.md 8.6 KB
- references/patterns/plugin-architecture.md 6.9 KB
- references/patterns/registry.md 12 KB
- references/patterns/repository.md 6.7 KB
- references/patterns/retry.md 9.3 KB
- references/patterns/singleton.md 7.3 KB
- references/patterns/state.md 5.6 KB
- references/patterns/strategy.md 16 KB
- references/patterns/template-method.md 11 KB
- references/patterns/unit-of-work.md 5.4 KB
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.
- 1mo ago First seen · 270 lines · 112 tokens per session scan A 03fa5fe8f5ed
Python Clean Architecture is a skill published in the GitHub repository MKToronto/python-clean-architecture (9 stars, last pushed 4mo ago), licensed MIT. It adds 112 tokens to every session and 4,213 once invoked, about $0.0004 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-08-31.
Other skills, from other repositories
python-patterns
Python backend patterns: layered architecture, async I/O, dependency injection, repository/service separation. TRIGGER when: creating routes, models, schemas, or services in a Python backend. SKIP: REST contract design (use api-design); schema/index tuning (use database-optimization). (Examples: FastAPI + SQLAlchemy +…
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…
cloudflare-workers-multi-lang
Multi-language Workers development with Rust, Python, and WebAssembly. Use when building Workers in languages other than JavaScript/TypeScript, or when integrating WASM modules for performance-critical code.
functions-development
Build serverless Go or Python functions for Falcon Foundry apps. TRIGGER when user asks to "create a function", "write a serverless function", "build backend logic", runs foundry functions create, or needs help with FDK handler patterns, function testing, or collection integration from functions. Also TRIGGER when…
python-services
Python patterns for CLI tools, async parallelism, and backend services. Use when building CLI apps, async/parallel Python, FastAPI services, background jobs, or configuring Python project tooling (uv, ruff, ty).
litestar
Auto-activate for Litestar, Controller, Router, @get/@post, FromPath, MsgspecDTO, OpenAPIConfig, Provide, FromDishka, Guard, ASGIMiddleware, HTTPException, ChannelsPlugin, or WebSocket. Not for standalone libs.