Borrowing it
Nothing to install: this file belongs to systemowiec/ai-agents-workspace-starter. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/systemowiec/ai-agents-workspace-starter/main/.agents/skills/backend-patterns/SKILL.mdgit clone --depth 1 https://github.com/systemowiec/ai-agents-workspace-starterWrote 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/systemowiec/ai-agents-workspace-starter/backend-patterns)<a href="https://agentmods.dev/skills/systemowiec/ai-agents-workspace-starter/backend-patterns"><img src="https://agentmods.dev/badge/skills/systemowiec/ai-agents-workspace-starter/backend-patterns/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/systemowiec/ai-agents-workspace-starter/backend-patterns"><img src="https://agentmods.dev/badge/skills/systemowiec/ai-agents-workspace-starter/backend-patterns.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.00022 | $0.00947 |
| Opus 5.5 | $0.00009 | $0.00379 |
| Sonnet 5.5 | $0.00004 | $0.00189 |
| Haiku 4.5 | $0.00002 | $0.00095 |
Grade A, and why
backend-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 2mo 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 — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Backend Patterns
Core guidelines and fundamental rules for implementing backend functionality in Python.
1. Architecture and Layers (Hexagonal)
- Domain: Contains entities (Pydantic/Dataclasses) independent of FastAPI/SQLAlchemy and Port definitions (interfaces via
ABC). - Application (Services): Contains the business logic (Use Cases). Services accept repositories (Ports) via Dependency Injection (DI). Ignorant of HTTP or the database.
- Infrastructure (Adapters): Repository implementations using
SQLAlchemy, 3rd party API clients, background workers. - Interfaces (API/Web): FastAPI routers. Always lightweight, devoid of business logic; they only decode requests and return HTTP responses.
Layer Prohibitions
| Layer | MUST NOT |
|---|---|
| Router/Endpoint | Business logic, direct DB access, HTTP client calls, object construction |
| Service | Import Request/Response from FastAPI, direct session.query(), return HTTP codes |
| Repository | Business logic, input validation, raise HTTPException |
| Client (external) | Business logic, DB access |
| Schema (Pydantic) | Business logic (e.g., "does user exist in DB"), DB access |
2. API and FastAPI Routers
- Inject services using FastAPI's
Depends(). - A router endpoint should invoke exactly ONE service method.
- Use explicit Pydantic models for requests (
*Create,*Update) and responses (*Response). Always defineresponse_modelin the decorator. - Use appropriate status codes (e.g.,
201 CREATEDfor POST,204 NO CONTENTfor DELETE). - Endpoint method: max 10-15 lines (ideal), 25 lines (absolute max). If longer, extract logic to service.
- One router per resource/domain (e.g.,
users.py,orders.py). Router file max 200 lines. - NEVER use
request.json()directly - always Pydantic schema as parameter. - NEVER create service instances in endpoint - use Dependency Injection.
- NEVER use try/except in endpoints - use centralized exception handlers.
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.
- 2mo ago First seen · 70 lines · 22 tokens per session scan A ea4e53b46653
backend-patterns is a skill published in the GitHub repository systemowiec/ai-agents-workspace-starter (2 stars, last pushed 7mo ago), licensed MIT. It adds 22 tokens to every session and 947 once invoked, about $0.0001 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.
backend-patterns compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| backend-patternssystemowiec/ai-agents-workspace-starter | Skill | 2 | 7mo ago | MIT | A | 22 | Claude Code, Codex |
| mem0-oss-to-platformmem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 217 | Claude Code, Codex |
| azure-mgmt-botservice-dotnetmicrosoft/skills | Skill | 3.2k | yesterday | MIT | A | 78 | Claude Code |
| fastapi-router-pymicrosoft/skills | Skill | 3.2k | yesterday | MIT | A | 46 | Claude Code |
| dev-runtimelangwatch/langwatch | Skill | 5.0k | today | Apache-2.0 | A | 172 | Claude Code |
| api-designericrisco/rsc-harness | Skill | 529 | 3d ago | MIT | A | 105 | Claude Code, Codex |
| migrate-segw-to-raparc-mcp/arc-1 | Skill | 253 | today | MIT | A | 106 | Claude Code |