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 agentmods add commands/mktoronto/python-clean-architecture/suggest-patternsgit clone --depth 1 https://github.com/MKToronto/python-clean-architectureWhat 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 | $0.00012 | $0.00966 |
| Opus 5 | $0.00006 | $0.00483 |
| Sonnet 5 | $0.00002 | $0.00193 |
| Haiku 4.5 | $0.00001 | $0.00097 |
Grade A, and why
suggest-patterns 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 2d 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 — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Scan the code at $ARGUMENTS (or the current working directory if no path given) and recommend which of the 25 Pythonic design patterns would improve it.
Process
-
Read the code — Find and read ALL Python files in the target path recursively.
-
Match code smells to patterns — Look for these specific smells:
Code Smell Pattern Pythonic Implementation Long if/elif switching behavior Strategy Callabletype alias, pass functions as argsNeed to create families of related objects Abstract Factory Tuples of functions + functools.partialTwo independent hierarchies that vary Bridge Callabletype alias replaces abstract referenceNeed undo/batch/queue operations Command Functions returning undo closures Side effects mixed with core logic Pub/Sub Dict-based subscribe(event, handler)/post_event()Object creation from config/JSON data Registry dict[str, Callable]mapping +**kwargsunpackingSame algorithm duplicated across classes Template Method Free function + Protocol parameter Sequential data transformations Pipeline functools.reducefor compositionNeed to react to events without coupling Callback Function passed as argument Reusing a function with a different interface Function Wrapper Wraps another function, translates args Separating configuration from usage Function Builder Higher-order function returns configured function Bare primitives for domain concepts (prices, emails) Value Objects Subclass built-in types with __new__validation, or frozen dataclassNeed audit trail, temporal queries, or event replay Event Sourcing Immutable Event[T], append-onlyEventStore[T], projection functionsRead/write patterns diverge; list views compute derived fields CQRS Separate write model + read projection, projector function after writes Complex object with many optional parts Builder Fluent API with Selfreturn type,.build()returns frozen productMultiple DB writes that must succeed or fail together Unit of Work Context manager wrapping transaction: commit on success, rollback on error Need exactly one instance of a shared resource Singleton Module-level instance (preferred), or metaclass with _instancesdictObject behaves differently depending on internal state State Protocol-based state objects, context delegates to current state Incompatible interface from external library Adapter Protocol interface + functools.partialfor single-method adaptationClient coupled to complex subsystem details Facade Simplified interface class, functools.partialto bind dependenciesTransient failures in external API/DB calls Retry @retrydecorator with exponential backoff, fallback strategiesSlow startup loading unused resources Lazy Loading functools.cache,cached_property, generators,__getattr__Data access logic mixed into domain classes Repository Protocol interface for CRUD, concrete implementations per backend Sequential operations on an object are verbose Fluent Interface Methods return selffor chaining, domain-specific verbsNeed extensibility without modifying core code Plugin Architecture Config-driven creation, importlibauto-discovery, self-registering modules -
Report suggestions — For each match, show:
- File and line — where the smell is
- Code smell — what makes this a candidate
- Pattern — which pattern applies and why
- Before — current code snippet
- After — refactored code using the Pythonic implementation
- Trade-off — is the refactoring worth it here? (sometimes the simple version is fine)
-
Prioritize — Order suggestions by impact. A pattern that simplifies 50 lines beats one that saves 3 lines. Note when the current code is simple enough that applying a pattern would be over-engineering.
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.
- 2d ago First seen · 54 lines · 12 tokens per session scan A 495688a78a77
suggest-patterns is a command published in the GitHub repository MKToronto/python-clean-architecture (8 stars, last pushed 2mo ago), licensed MIT. It adds 12 tokens to every session and 966 once invoked, about $0.0001 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.
Other commands, from other repositories
go-stack.project-update
Compare the current project against the latest go-stack scaffold template and propose or apply updates (tasks, linters, dependencies, skills, provider patterns, security tooling) while preserving project-specific business logic and module identity.
go-stack.bundb.setup
Instructions to setup the go-stack BunDB integration for database access, migration management, and the bundled DB CLI command.
go-stack.inertia.setup
Instructions to setup the go-stack Inertia.js integration for fullstack Go applications, including boot provider wiring and frontend workflow.
deploy
Build, test, deploy with staged rollout.
brand-setup
Configure a new brand profile with colors, fonts, logo, visual style, platforms, and compliance rules.
save
Save this conversation as a new or existing reusable context.