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 skills/ocbunknown/fastapi-claude-template/testsnpx skills add ocbunknown/fastapi-claude-template --skill testsgit clone --depth 1 https://github.com/ocbunknown/fastapi-claude-templateWhat 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.00115 | $0.05687 |
| Opus 5 | $0.00057 | $0.02844 |
| Sonnet 5 | $0.00023 | $0.01137 |
| Haiku 4.5 | $0.00012 | $0.00569 |
Grade A, and why
tests 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 3d 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 — 430 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Writing tests (tests/unit/, tests/integration/, tests/e2e/)
Tests without rules drift into ceremony — "test exists, test passed, shipping". Real bugs this repo shipped because nobody had a test that exercised the exact scenario:
UserResult.model_validate(orm_user)inupdate.py/create.py/permission.py— crashed withMissingGreenleton PATCH/POST. Not caught because the e2e tests only hit GET.UpdateUserRequesthad onlypasswordfield whileAdminUpdateUsercontract hadpassword + active + role_uuid— PATCH silently droppedactiveandrole_uuid(Pydanticextra="ignore"), returned 200, and did nothing. Not caught because no test verified that the mutation persisted via a follow-up GET.select_manywithoutloads=roletriggeredMissingGreenlet. Caught only because an explicittest_select_users_omits_role_by_defaulttest existed. Other endpoints had no such test.
Every "why didn't the tests catch this" answer has the same root: the scenario was never tested. This skill lists the scenarios that must exist.
Pick the right layer — don't cross them
| Layer | What it tests | What it uses | Typical runtime |
|---|---|---|---|
tests/unit/ |
Pure logic: use cases, validators, helpers, contracts | MagicMock/AsyncMock DBGateway, FakeHasher, FakeJWT, FakeStrCache from tests/fakes.py |
< 2s for the whole folder |
tests/integration/ |
Real I/O: repositories against Postgres, Redis adapters, NATS brokers | Session-scoped testcontainers (Postgres/Redis/NATS), per-test outer-transaction rollback |
3–10s |
tests/e2e/ |
Full HTTP stack: endpoint → contract → request bus → use case → repo → DB | Real app wired via Dishka, httpx.AsyncClient + ASGITransport |
5–15s |
Hard rules:
- Unit tests never touch I/O. No
await database.X.create(...)against a real DB — that's integration. - Integration tests never go through HTTP. If you want to test the endpoint wiring, that's e2e.
- E2E tests never replace unit tests. Unit tests cover branches fast; e2e tests cover a few happy/sad paths against the real stack. Don't try to cover every validation edge case in e2e — that belongs in unit (for Pydantic contracts) and integration (for DB constraints).
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.
- 3d ago First seen · 430 lines · 115 tokens per session scan A 0d616946bfe6
tests is a skill published in the GitHub repository ocbunknown/fastapi-claude-template (32 stars, last pushed 4mo ago), licensed MIT. It adds 115 tokens to every session and 5,687 once invoked, about $0.0006 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-30.
Other skills, from other repositories
testing-patterns
Testing patterns and principles. Unit, integration, mocking strategies.
testing
Writing or debugging tests, choosing unit vs integration style, Postgres/ClickHouse tests, regenerating ClickHouse test schema, or exporting test helpers from packages without pulling test code into production bundles.
detect-flaky-tests
Detects flaky Go tests by analyzing GitHub Actions workflow runs across the last 7 days and all PRs — covering both the run-tests job (unit/integration) and the e2e-test job (gVisor and microVM lanes). For each newly-detected flaky test or infra issue, opens a GitHub issue with full evidence and a draft fix PR. Does…
designing-tests
Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.
test-flutter
Flutter App のテスト実行・静的解析・フォーマット・テスト記述ガイド.
test
Run tests. Use after code changes to validate. Arguments: unit (default, no GPU), e2e (with models), filter name, or all.