code-review
A detailed code review agent for Python FastAPI and SvelteKit projects.
Install
mkdir -p .claude/skills/code-review-hhagely && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19126" && unzip -o skill.zip -d .claude/skills/code-review-hhagely && rm skill.zipInstalls to .claude/skills/code-review-hhagely
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Perform a full code review of the currently checked out branch against main. Analyzes best practices, unit tests, DRY code, architecture, error handling, correctness & caller-impact, documentation, DB migration safety, and SvelteKit conventions across the diff for this Python (FastAPI/SQLModel) + SvelteKit project. Use when the user asks to review the branch, review a PR, or do a code review.Key capabilities
- →Identify changes between the current branch and `main` using `git diff`
- →Spawn parallel review agents for specific review categories
- →Check test quality and coverage for changed source files
- →Identify and flag DRY (Don't Repeat Yourself) code violations
- →Review architecture, error handling, and correctness of changes
- →Ensure documentation is updated and DB migrations are safe
How it works
The skill identifies changes between branches, then launches parallel agents to review specific categories like test quality, DRY code, architecture, and documentation. Each agent provides a structured report.
Inputs & outputs
When to use code-review
- →Reviewing pull requests
- →Checking code quality before merge
- →Analyzing architectural changes
About this skill
code-review
Perform a comprehensive code review of all changes on the currently checked out branch compared to main. Scope is limited to the branch diff — for a whole-codebase audit, use /codebase-audit instead.
This is a mixed-stack repo: a Python 3.12 backend (FastAPI, SQLModel over SQLite, a typer CLI exposed as job-applier) under src/job_applier/, and a SvelteKit frontend (Svelte 5 runes, TypeScript) under web/src/. Reviews must cover whichever side(s) the diff touches.
When to Use
- User asks to review the current branch or an open PR
- User asks for a code review before merging
- User invokes
/code-review
Instructions
Step 1: Identify Changes
Determine the diff between the current branch and main:
git diff main...HEAD --name-only
git diff main...HEAD --stat
If there are no changes vs main, inform the user and stop.
Collect the full diff for context:
git diff main...HEAD
Step 2: Spawn Parallel Review Agents
Launch nine agents in parallel using the Agent tool (subagent_type: general-purpose). Each agent receives the list of changed files and the full diff, and is responsible for one review category.
Critical preamble — include in every agent prompt:
You are performing an exhaustive code review of a Python (FastAPI / SQLModel / typer) + SvelteKit (TypeScript, Svelte 5 runes) project. You must check EVERY item in the checklist below — do not skip items or stop early. For each item, read the relevant code and report either a finding or "PASS". When an item asks you to grep or search, you MUST actually run the search and report the results — do not assume. Your review must be deterministic: given the same code, you should always find the same issues.
Each agent returns a structured report with:
- Severity:
critical,warning, orsuggestion - File path and line number (or range)
- Clear description of the issue
- Suggested fix or code snippet when appropriate
Agent 1: Test Quality & Coverage
-
Read CLAUDE.md — backend tests are
pytestintests/test_<name>.py, use fixtures fromtests/conftest.py(e.g. themake_rawRawJobfactory) and@pytest.mark.parametrizefor table-driven cases; frontend tests arevitestinweb/src/lib/*.test.tsorweb/src/lib/__tests__/*.test.tsusing@testing-library/svelte. Test command:make test(make test-api= pytest,make test-web= vitest). -
List all changed source files under
src/job_applier/(.py) andweb/src/(.ts,.svelte, excluding*.test.ts). For EACH: a. Search for a corresponding test (tests/test_<module>.pyfor backend; colocated*.test.tsfor frontend helpers). Report whether one exists. b. If a test exists, read it. Verify every new/changed public function, API endpoint, filter rule, source adapter, or exported helper has at least one test. c. If NO test file exists, flag per user preference ("always write tests"): new modules / new filter rules / new API routes / new source adapters =critical; new public functions on existing modules =warning; cosmetic-only =suggestion. -
Read every changed test file. For each test: a. Assertions must test outcomes (returned
FilterResult.status, persisted rows, response bodies, store state), not implementation details. b. Flag tests that only assert "is not None" / "does not raise" without checking behavior. c. Prefer fixture reuse: flag backend tests that hand-roll aRawJobinstead of using themake_rawfactory when the factory would do. d. For filter-rule changes, flag missing parametrized cases — the existing suite pins both pass and drop directions per rule; new rules should follow suit. e. Frontend: flag component/store tests that don't exercise the runes-driven state transition they claim to cover. -
For every new
if/match/ early-return branch added in the diff: check that at least one test exercises it. Untested filter outcomes (passed/manual/dropped) or error branches →warning. -
For every new API endpoint, CLI command, or source adapter: check that a test covers the success path AND at least one failure/validation/empty-result path.
Agent 2: DRY Code
-
Read every changed source file (not tests) under
src/job_applier/andweb/src/. For each: a. Any code block (3+ lines) repeated more than once in the same file →warning. b. Any block nearly identical to code in another changed file →warning. -
For each pattern found: grep the full repo (
src/job_applier/,web/src/) for ALL occurrences. Only flag if it appears 3+ times OR extracting it meaningfully reduces maintenance burden. -
Repeated string/integer literals used as source names, filter reasons, status strings, API paths, or DB column names across changed files — flag magic values appearing 3+ times (they belong in a constant, enum, or the shared types in
web/src/lib/api.ts). -
Source-adapter duplication: the per-company adapters (
greenhouse,lever,ashby,workday,workable,smartrecruiters) share shape via theSourceAdapterprotocol insrc/job_applier/sources/base.py. If the diff adds a new adapter or copies fetch/parse boilerplate that base helpers already provide, suggest consolidation. -
Do NOT flag: test verbosity, trivial property/getter repetition, or two-site patterns in clearly different contexts.
Agent 3: Architecture
User is a senior engineer who values cohesive boundaries and dislikes god objects and shared-state desync. Weight findings accordingly.
-
Read CLAUDE.md — layering: FastAPI app + Pydantic schemas in
src/job_applier/api/; the frontend talks to it only throughweb/src/lib/api.ts; source adapters implement theSourceAdapterprotocol and register insrc/job_applier/sources/__init__.py; the hard filter lives insrc/job_applier/filters/rules.py; schema + migrations insrc/job_applier/models/db.py. -
For every changed module: a. God object check: lines of code, number of public functions, number of distinct responsibilities. Flag any module growing past ~400 lines or mixing clearly distinct concerns (e.g. HTTP fetching + parsing + persistence in one function). b. Shared-state desync: does the change introduce a new source of truth that duplicates state the DB already owns (scores, dedupe hashes, application status)? Flag as
criticalif two places now own the same data. Score writes must go through the activeMatchScore+MatchScoreHistorysnapshot path — flag direct mutations that skip history. c. Layer coupling: does new frontend code reach the backend by rawfetchinstead of the typedapiclient inweb/src/lib/api.ts? Flag aswarning. (api.tsbrowser-safety is covered by Agent 9.) d. LLM boundary: the LLM is NEVER called server-side — scoring/drafting happen via slash commands in.claude/commands/. Grep the diff foranthropic,ANTHROPIC_API_KEY, or any server-side model call. Flag ascritical. -
For new source adapters: confirm they implement the
SourceAdapterprotocol and are registered insources/__init__.py; per-company sources must read slugs from theSourceSlugtable at runtime, not hardcode them (companies.pyis seed-only). Flag deviations. -
Right shape for data: backend —
SQLModeltable vs Pydantic schema vs plain dataclass (RawJob). Frontend — Svelte 5 rune store (*.svelte.ts) vs+page.server.tsloader data vs component-local state. Flag mismatches (e.g. cross-route state stuffed into a component instead of a rune store likedraftCart.svelte.ts). -
Feature cohesion: does the change place new files in the correct package (
api/,sources/,filters/,models/) or route folder? Flag files that cut across boundaries without justification.
Agent 4: Python / TypeScript Best Practices
-
Read CLAUDE.md for project conventions. Lint is
make lint(ruff check src/); frontend typecheck iscd web && npm run check. -
For every changed
.pyfile: a. Type hints: public functions have typed parameters and return types; modules start withfrom __future__ import annotations(established style acrosssrc/job_applier/andtests/). Flag missing aswarning. b. No bareexcept:and noexcept Exceptionthat silently swallows. (Error semantics in depth are Agent 5's job; here just flag the syntactic violation.) c. No strayprint()in library code. Grep forprint(insrc/job_applier/; in CLI code usetyper.echo, elsewhere use logging.warning. d. f-strings over%-formatting or.format()in new code.suggestion. e. Ruff cleanliness: flag unused imports, unsorted imports, unused variables thatmake lintwould catch. -
For every changed
.ts/.sveltefile: a. Explicit types on exported functions; noanyleaking into the typedapisurface. Flaganyaswarning. b.import typefor type-only imports. c. Noconsole.logleft in committed code. Grepweb/src/forconsole.log(.warning. d. Code should passnpm run check(svelte-check). Flag obvious type errors. -
Repo-specific hard rules (carry verbatim — these catch more than "follow conventions"): a. No
anthropicSDK / API-key handling server-side — grep new.pyfiles forimport anthropic,from anthropic,ANTHROPIC_API_KEY. Flag ascritical. (See also Agent 3.) b. No LinkedIn / Indeed scraping — grep new source code (especially undersrc/job_applier/sources/) forlinkedin.com/indeed.comendpoints or scraping logic. ToS violation and explicit project rule.critical. c. Generated-draft purity — if the diff touches.claude/commands/draft.mdor draft-rendering code, confirm no em dashes (—), en dashes (–), or smart quotes (""'') a
Content truncated.
When not to use it
- →When a whole-codebase audit is required instead of a branch diff review
- →When the user does not want a complete code review
- →When the user wants to skip specific review categories
Limitations
- →Scope is limited to the branch diff
- →Requires `git` to identify changes
- →Relies on parallel agents for review categories
How it compares
This workflow uses multiple specialized agents to perform a complete and structured code review across different aspects of a mixed-stack project, which is more thorough than a single manual review.
Compared to similar skills
code-review side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| code-review (this skill) | 0 | 15d | Review | Advanced |
| mcp-developer | 1 | 2mo | No flags | Intermediate |
| puttokei-project | 0 | 3mo | No flags | Intermediate |
| deepwiki-rs | 25 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
mcp-developer
Jeffallan
Use when building MCP servers or clients that connect AI systems with external tools and data sources. Invoke for MCP protocol compliance, TypeScript/Python SDKs, resource providers, tool functions.
puttokei-project
TUT-StudyClub
Puttokei リポジトリで作業するときの前提をまとめた skill。docs/requirements/requirements.md を基準に、backend の FastAPI/Python、mobile の Expo/TypeScript、infra の Terraform、空ディレクトリの初期実装や構成整理を行うときに使う。
deepwiki-rs
sopaco
AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.
ast-grep-find
parcadei
AST-based code search and refactoring via ast-grep MCP
lint-and-validate
davila7
Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Triggers onKeywords: lint, format, check, validate, types, static analysis.
naming-analyzer
davila7
Suggest better variable, function, and class names based on context and conventions.