Best for
- Use when the user wants a thorough PR or branch review.
steph-dove/klaussy-agents/examples/fastapi/.agents/skills/fastapi-review/SKILL.md
Use when the user wants a thorough PR or branch review. Triages by diff size — small PRs get a single-pass review, large PRs fan out to parallel sub-agents (correctness, architecture, security, scope, and an Agentic & Evals lens that activates on AI/agent code) with a validation phase that drops false positives.
Decision brief
If master is missing or unset, default to dev if it exists, otherwise main.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/steph-dove/klaussy-agents --skill "examples/fastapi/.agents/skills/fastapi-review"Inspect the Agent Skill "fastapi-review" from https://github.com/steph-dove/klaussy-agents/blob/1d11386db786e8e5c492dc2a065c75271286e0fa/examples/fastapi/.agents/skills/fastapi-review/SKILL.md at commit 1d11386db786e8e5c492dc2a065c75271286e0fa. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
If master is missing or unset, default to dev if it exists, otherwise main.
Count the total reviewable lines changed (from Phase 1 step 3 — the trimmed-diff figure, not the raw --stat, which still counts the dropped lockfile/generated/vendored noise).
You are a senior/principal-level engineer reviewing a pull request. Treat this as a real production PR. Output ONLY PR-style review comments, as if leaving inline comments on GitHub/GitLab.
Be skeptical and precise.
Run these against the files this PR changed — not the whole repo. A repo-wide run buries the review in pre-existing violations from untouched files. Append the changed paths to each command (or use the tool's diff-aware mode); ignore findings outside this PR's diff: - PYTHONPATH…
Permission review
The documentation asks the agent to read local files, directories, or repositories.
**Read the full file (not just the diff hunks) for every *reviewable* changed file** — the files present in the trimmed diff, not the ones in the Excluded manifest. These are independent reads — issue them all in a single batch of parallel The documentation asks the agent to read local files, directories, or repositories.
**Read the full file** referenced in the finding (not just the diff hunk).Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 11 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Adapted for Cline.
- This skill orchestrates parallel sub-agents using Claude's
Agenttool /subagent_typesyntax. Most coding agents now have their own parallel sub-agent or task mechanism (e.g. Cursor'sTask, Codex'sspawn_agent, Gemini subagents, Copilot'stask) — use yours and translate the wording. If it truly has none, apply each lens or angle yourself, sequentially, and combine the findings.
You are conducting a thorough PR review. Follow these phases in order.
If master is missing or unset, default to dev if it exists, otherwise main.
The diff stat, full diff, commit log, and branch name below are pre-rendered as dynamic context — you do not need to fetch them yourself.
Run git diff --stat master...HEAD and use its output.
Run git log master..HEAD --oneline and use its output.
Run git branch --show-current and use its output.
Get the reviewable diff. Run klaussy review-prep --base master. It returns the diff trimmed to reviewable files — lockfiles, generated/vendored trees, minified/binary blobs, and pure renames are dropped — followed by an Excluded from review manifest listing what it dropped and why. Use this trimmed diff as the diff for the rest of the review. If the klaussy CLI isn't on PATH (the command errors), fall back to git diff master...HEAD for the full untrimmed diff and proceed as before. Kept as a tool call rather than injected — even trimmed, diffs can be large.
Read the full file (not just the diff hunks) for every reviewable changed file — the files present in the trimmed diff, not the ones in the Excluded manifest. These are independent reads — issue them all in a single batch of parallel tool calls, not sequentially. The excluded files are deliberately out of scope: don't read or comment on them unless a finding in a reviewable file points directly at one.
Count the total reviewable lines changed — use the N changed line(s) figure in the review-prep summary line (on the git diff fallback, take the --stat total but ignore any lockfile / generated / vendored / minified / binary files).
If the branch name contains a ticket reference (e.g. FEAT-1234), note it for context.
Detect Architecture Decision Records / design docs. Check the changed files for an ADR, RFC, or technical design doc using two signals:
docs/adr/, doc/adr/, adr/, docs/adrs/, docs/decisions/, docs/architecture/decisions/, rfcs/, docs/rfcs/, docs/design/, design-docs/, or filenames like NNNN-title.md, ADR-NNNN-*.md, *.adr.md, *.rfc.md, *.design.md.## Status, ## Context, ## Decision, ## Consequences; or MADR headings (## Context and Problem Statement, ## Considered Options, ## Decision Outcome); or Rust-RFC headings (## Motivation, ## Rationale and alternatives, ## Drawbacks); or YAML frontmatter with status: / deciders: keys.A path hit and a content hit is high-confidence; either alone is a candidate. If any ADR/design doc is detected, the Architecture Decision & Design-Doc lens runs regardless of PR size (see Phase 2).
Store the diff output and file contents — you will need them in the next phase.
Count the total reviewable lines changed (from Phase 1 step 3 — the trimmed-diff figure, not the raw --stat, which still counts the dropped lockfile/generated/vendored noise).
Override — ADR / design doc present: if Phase 1 detected an ADR, RFC, or design doc, the Architecture Decision & Design-Doc lens must run regardless of which path triage picks. In the parallel path it's Sub-agent 6 (see Phase 2 → Parallel Review). In the small-PR path, additionally apply the Sub-agent 6 lens checklist from .agents/skills/fastapi-review/sub-agents.md to the doc before writing your output. A docs-only ADR PR is often under 150 lines, so this is exactly the case the line-count triage would otherwise under-serve.
You are a senior/principal-level engineer reviewing a pull request. Treat this as a real production PR. Output ONLY PR-style review comments, as if leaving inline comments on GitHub/GitLab.
[Severity: Blocker | High | Medium | Low | Warn | Nit] [Location: file_path:line_number and code_snippet] Comment:
Suggested change: on its own line above the block. Mixing the two confuses readers about which is which.groupBy when structuredClone / crypto.randomUUID / Object.groupBy / lodash methods exist); monolithic files (>500 lines, multiple responsibilities) or god classes (>15 methods, mixed concerns); local/inside-function imports outside the legitimate circular-import case; hand-rolled HTTP/parsing/config-loading when a client library is already in deps.release-notes.md, __init__.py, routing.py.pydantic_settings for env config.import fastapi.fastapi/**/*.py: URL-based API versioning: Use URL path versioning (e.g., /v1/, /api/v2/).fastapi/**/*.py: Data class style: Pydantic for API + dataclasses for internal: Use Pydantic for API schemas (40) and dataclasses for internal DTOs (10). Good separation.fastapi/**/*.py: Background jobs with FastAPI BackgroundTasks: Use FastAPI BackgroundTasks for background task processing.fastapi/**/*.py: Data classes: Pydantic models: Use Pydantic models for structured data. 62/80 structured classes use this pattern.fastapi/**/*.py: lowercase constant naming: Name constants using lowercase style.fastapi/**/*.py: Enum usage: Enum: Use Python enums for categorical values. Found 4 enum class(es).fastapi/**/*.py: Custom decorator pattern: @deprecated: Use custom decorator @deprecated (4 usages). Also uses: @asynccontextmanager.fastapi/**/*.py: Limited exception chaining: Preserve exception context: use raise X from Y or raise X from None.fastapi/**/*.py: Mixed validation approaches: Validate inputs and parameters: Use multiple validation approaches: Pydantic validation, Manual validation (ValueError/TypeError), Decorator-based validation..scripts/**/*.py: Context manager usage: Manage resource lifecycles using context managers (e.g., Use context managers for resource management. 37 with statements (23 sync, 14 async). Types: file_io (4), threading (2).).scripts/**/*.py: Structured configuration with Pydantic Settings: Use Pydantic BaseSettings for configuration management.tests/**/*.py: FastAPI-style session dependency injection: Use get_db() dependency pattern with Depends() for session lifecycle.tests/**/*.py: HTTP errors raised in service layer: HTTPException is frequently raised outside the API layer.tests/**/*.py: Semi-centralized exception handling: Exception handlers are spread across 2 modules.tests/**/*.py: OAuth2 authentication: Use OAuth2 for authentication. OAuth2 usages: 13.tests/**/*.py: Mocking with pytest monkeypatch fixture: Use pytest monkeypatch fixture for test mocking. Also uses: unittest.mock / Mock, @patch decorator.tests/**/*.py: Test naming: Simple style (test_feature): Use Use Simple style (test_feature) naming. 2215/2274 test functions. naming style for all test functions.Run these against the files this PR changed — not the whole repo. A repo-wide run buries the review in pre-existing violations from untouched files. Append the changed paths to each command (or use the tool's diff-aware mode); ignore findings outside this PR's diff:
PYTHONPATH=./docs_src pytest -n auto --dist loadgroup testspytestbash scripts/test-cov.sh --cov-report=term-missingmypy fastapiruff check fastapi tests docs_src scriptsruff format fastapi tests --checkFlag if any of these are violated:
pre-commit.yml contains steps allowed to fail (continue-on-error: true).scripts/test.sh sets PYTHONPATH=./docs_src — running pytest directly without this env var will fail any test that imports a docs_src.* tutorial module. Prefer bash scripts/test.sh over bare pytest unless you're targeting a single non-docs test file.[tool.pytest] filterwarnings = ["error"] — any warning raised during tests (including from third-party libraries) becomes a hard failure. A new deprecation warning from a dependency bump can break the suite with no code changes.B008 ("do not perform function calls in argument defaults") repo-wide — this is required because FastAPI's whole API style is def endpoint(x: int = Query(...)), a call-in-default-argument pattern by design. Don't "fix" this pattern in application code.ruff also ignores E501 (line length, deferred to ruff format) and C901 (complexity) — routing.py and applications.py in particular have very large, intentionally complex functions.[tool.ty.src] exclude and per-file ruff ignore lists under docs_src/ are deliberate: many tutorial example files are intentionally partial/non-runnable snippets or cover deprecated patterns (e.g. Pydantic v1-in-v2 migration examples) and are not meant to fully type-check or lint clean. Don't assume a docs_src failure indicates a real bug without checking these exclude lists first.[tool.mypy] strict = true for fastapi/ itself, but relaxed via overrides for docs_src.* (disallow_incomplete_defs/untyped_defs/untyped_calls = false) and fastapi.tests.*. Contributions to core fastapi/ modules are held to strict typing even though examples aren't.scripts/docs.py: DYLD_FALLBACK_LIBRARY_PATH is set to /opt/homebrew/lib in the Typer @app.callback() to make cairosvg find its native Cairo lib on Apple Silicon Homebrew installs — if docs image generation fails locally on macOS, check this path matches your Homebrew prefix.zizmor (GitHub Actions security linter) is a dev dependency with its own CI workflow (zizmor.yml) — Actions-workflow changes should be checked against it, not just against pre-commit.yml.Keep the analysis rigorous and the bar high (staff/principal quality); the mode below changes only how findings are delivered.
Default to Collaborative. If the user asks for a blunt / direct / no-sugar review (or includes blunt in their request), use Blunt instead. The substance guardrail applies to both.
Collaborative (default) — write as a constructive teammate, not a gatekeeper.
Blunt (on request) — direct and terse. Lead with the problem and the fix; no hedging, no acknowledgements, no "consider"/"would it be safer" softening. Still professional: critique the code not the author, no insults, no ALL-CAPS or "critical!" melodrama. Brevity over warmth.
Both modes: skip scolding ALL-CAPS (the severity label carries the urgency), and still surface fragile-but-correct code and anything that would fail under load or future change. Tone is never a reason to go quiet on a real problem.
Whatever you output for the user (comments, descriptions, messages) must read as if a human engineer wrote it. These rules mirror klaussy's deterministic humanizer (klaussy-desktop humanize-comment.js):
— / –) in prose. Use a comma or rewrite. This is the single biggest AI tell.Same decision, half the words, dropping detail the reader can reconstruct:
Verbose: Good call, done. attachment.reason already embeds the decline reason for declined envelopes (built in checkEnvelopeStatus as {name} declined on {date} - {declinedReason}), so I dropped the new declinedReason signer field and reverted NotificationService to use the existing reason field. Pushed in 1e9e938404.
Human: Good call.
attachment.reasonalready carries the decline reason, so I dropped the new field and reverted NotificationService. Pushed in 1e9e938404.
Tone must not dilute substance. Every comment keeps its severity, its file:line + verbatim code quote, its concrete trigger / failure scenario, and its specific suggested fix. Phrase it per the chosen mode; report it fully. A note that hides a real Blocker, downgrades severity, or drops the detail has failed.
Before writing the final output, validate every finding you produced. For each one:
A shorter, accurate review is far more valuable than a long review with false positives.
After validation, add a final PR summary:
Overall verdict: Approve / Request Changes / Block
Highest-risk issues:
Test coverage assessment:
Write this output to REVIEW_OUTPUT.md.
This PR is large enough to benefit from focused, parallel review.
.agents/skills/fastapi-review/sub-agents.md. That file has the canonical list of sub-agent Lens sections plus a shared Common scaffold (intro, output format, ground rules). Some lenses are conditional — see step 3 for the detection-driven ones.[PASTE THE FULL DIFF HERE] and [PASTE THE COMMIT LOG HERE] replaced by the trimmed diff and commit log from Phase 1), then the sub-agent's Lens, then its Additional rules (if any). The "How to compose a sub-agent prompt" section at the top of sub-agents.md documents this exactly.**/skills/**, **/agents/**, **/.claude/**, MCP server files (mcp_*.{py,ts,js}, mcp-server*.*, .mcp.json), eval suites (**/evals/**, eval_*.{py,ts,js}, *.eval.*), or imports of anthropic / openai / langchain / langgraph / mcp / @anthropic-ai/sdk / inspect_ai / langsmith / promptfoo. If any signal is present, include sub-agent 5; otherwise skip it (it has nothing to review). The full detection list is at the top of sub-agent 5 in sub-agents.md.sub-agents.md.subagent_type: general-purpose and the composed body from step 2. Sub-agents return findings as text and must NOT write any files.Model tiering (optional, if your sub-agent tool accepts a per-call model). The lenses don't all need the same horsepower. Run the mechanical lens — Sub-agent 4: Scope & Conventions, which is mostly pattern-matching intent and checking conventions — on a fast, cheap model (e.g. haiku), and keep the reasoning-heavy lenses (correctness, architecture, security, agentic, ADR) on the default/inherited model where judgment earns its keep. Because the sub-agents run in parallel, this mainly saves cost rather than wall-clock (the cheap lens was never the slowest); the latency win comes from the parallel validation in Phase 3. If your tool has no per-call model control, run them all on the default model — tiering is an optimization, not a requirement.
After all sub-agents return, proceed to Phase 3.
Before synthesizing, validate every finding from the sub-agents. The rubric for a single finding is:
Validate in parallel when there are enough findings. Reading files and tracing paths one finding at a time is the slowest serial stretch of a large review — every other phase before it fanned out, but this one doesn't by default. So:
.agents/skills/fastapi-review/sub-agents.md → Validation sub-agent, passing it that batch of findings plus the trimmed diff; it reads whatever caller/callee files it needs and returns only the survivors (with the rubric applied and any severity downgrades). Collect all survivors, then go to Phase 4. Each validator must NOT write files.A shorter, accurate review is far more valuable than a long review with false positives.
After validation, synthesize the remaining findings:
Write the final output to REVIEW_OUTPUT.md in this format:
[Severity: Blocker | High | Medium | Low | Warn | Nit] [Location: file_path:line_number and code_snippet] [Category: Correctness | Concurrency | Design | Performance | Reliability | Security | Readability | Tests | Dependencies | Scope | Conventions | Agentic | Evals | Design Decision] Comment:
Phrase every comment in the delivery mode the user asked for (Collaborative by default, Blunt on request) and in a human voice — follow the Tone & standards guidance above, including the "Write like a person" rules — while preserving full detail (severity, location, trigger/failure scenario, concrete fix). Chosen-mode delivery, complete substance.
Overall verdict: Approve / Request Changes / Block
Highest-risk issues:
Test coverage assessment:
Review method: Parallel sub-agents (Agentic & Evals lens included only when the diff touches AI/agent/eval code)
Alternatives
steph-dove/klaussy-agents
Use when the user wants a thorough PR or branch review. Triages by diff size — small PRs get a single-pass review, large PRs fan out to parallel sub-agents (correctness, architecture, security, scope, and an Agentic & Evals lens that activates on AI/agent code) with a validation phase that drops false positives.
steph-dove/klaussy-agents
Use when the user wants a thorough PR or branch review. Triages by diff size — small PRs get a single-pass review, large PRs fan out to parallel sub-agents (correctness, architecture, security, scope, and an Agentic & Evals lens that activates on AI/agent code) with a validation phase that drops false positives.
steph-dove/klaussy-agents
Use when the user wants a thorough PR or branch review. Triages by diff size — small PRs get a single-pass review, large PRs fan out to parallel sub-agents (correctness, architecture, security, scope, and an Agentic & Evals lens that activates on AI/agent code) with a validation phase that drops false positives.
steph-dove/klaussy-agents
Use when the user wants a thorough PR or branch review. Triages by diff size — small PRs get a single-pass review, large PRs fan out to parallel sub-agents (correctness, architecture, security, scope, and an Agentic & Evals lens that activates on AI/agent code) with a validation phase that drops false positives.