From workflow-skills
Post-implementation code review — checks quality, patterns, tests, docs, and incremental cleanup opportunities on changed files. Lightweight alternative to full codebase-review.
How this skill is triggered — by the user, by Claude, or both
Slash command
/workflow-skills:code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Post-implementation code review for changed files. Checks code quality, project patterns, test completeness, documentation, and identifies incremental cleanup opportunities in touched files.
Post-implementation code review for changed files. Checks code quality, project patterns, test completeness, documentation, and identifies incremental cleanup opportunities in touched files.
This skill is repo-agnostic. It reads .claude/repo-conventions.yaml (schema: ~/.claude/repo-conventions-schema.md) before running. Pattern checks (repository_layer, service_layer, adapter_pattern, event_bus, etc.) fire only if declared and not false in the conventions file.
/code-review # review git diff (staged + unstaged)
/code-review <path1> <path2> ... # review specific files
/code-review --feature <feature-path> # review against a feature's tasks.md
Runs 4 phases sequentially. Fixes issues directly — does not just report them.
No args: Get changed files via git diff --name-only HEAD and git diff --name-only --cached. If no changes, fall back to the last commit: git diff --name-only HEAD~1..HEAD. If still nothing, tell the user and stop.
Paths provided: Review those specific files.
--feature <path>: Read <path>/tasks.md to get the task list. Derive the files from the tasks (file paths mentioned in task descriptions). Also get changed files from git diff for cross-reference.
Separate files into:
.py, .ts, .tsx, .yaml (not tests, not docs)tests/ or __tests__/ directories.md, .json, otherPrint the scope:
## Code Review Scope
- Implementation files: N
- Test files: N
- Doc/config files: N
For each implementation file, read the full file (or the changed sections if the file is large) and check:
Read CLAUDE.md first AND .claude/repo-conventions.yaml. Then verify (each check fires only if its pattern is declared and not false in conventions):
<backend.patterns.repository_layer>/<entity>_repo.py, not direct DB queries in routes/services (skip if not declared)<backend.patterns.service_layer>/<entity>_service.py, not in route handlers (skip if not declared)<backend.config_module>, not direct env reads (always check; substitute the actual import)<backend.patterns.adapter_pattern>/, not inline HTTP/SDK calls (skip if not declared)<backend.events_module> (skip if event_bus not declared)self._logger, standalone modules use structlog.get_logger())except Exception only in top-level handlers (middleware, agent event loops, async-runtime wrappers like Temporal)require_payload_field() in kristallklar)except Exception in business logic (not top-level handlers)ruff check on changed files and reportApply the deslop pattern catalog to the changed files — this plugin's deslop skill (Step 3) owns the pattern list, with IDs, certainty levels, and auto-fix guidance (C1–C6 comments, E1–E3 error handling, S1–S4 structure, L1–L2 language discipline, T1–T3 completeness). Cite pattern IDs in findings. Do not restate the catalog here; if it and the repo's CLAUDE.md Anti-Slop Rules conflict, CLAUDE.md wins.
For each touched file, scan the ENTIRE file (not just changed lines) for:
except Exception in non-top-level codeOnly flag if the fix is:
Do NOT flag:
For each implementation file, verify corresponding tests exist:
<test_dir>/unit/test_<module>.py or per the project's test convention<frontend.dirs>, check the project's frontend test convention (e.g., __tests__/, sibling .test.tsx, etc.)For API route changes:
For new endpoints:
For each test file in scope, assess whether the tests are well-structured, correctly placed, and non-redundant:
assertTrue(True), assert result is not None when the real contract is richer), or tests that only verify mock call counts without checking outcomes.@pytest.mark.parametrize, unnecessary service instantiation for testing a static/pure method.<docs.functional_spec> is declared, is it updated?<docs.technical_spec> is declared, is it updated?--feature flag)Read <feature-path>/tasks.md. For each task:
Also check post-implementation tasks:
status: done, start/end dates)depends-on); a _completed_ prefix is correct only when the repo opts in via backlog.feature_lifecycle.rename_folder_on_transition: trueFix all issues found in Phases 2-3 directly. Group fixes by type:
If a fix is ambiguous or carries risk, skip it and include in the report.
After all fixes, run ruff check on all changed .py files. Fix any new issues introduced.
## Code Review Report
### Scope
- Files reviewed: N
- Implementation: N | Tests: N | Docs: N
### Fixes Applied
| # | File | Issue | Fix |
|---|------|-------|-----|
| 1 | <file:line> | <issue> | <what was fixed> |
### Skipped (needs human input)
| # | File | Issue | Why skipped |
|---|------|-------|-------------|
| 1 | <file:line> | <issue> | <risk or ambiguity> |
### Incremental Cleanup Applied
| # | File | Pre-existing Issue | Fix |
|---|------|-------------------|-----|
| 1 | <file:line> | <issue> | <what was cleaned up> |
### Test Coverage
| Module | Unit | Integration | Error Paths | Edge Cases |
|--------|------|-------------|-------------|------------|
| <name> | ✓/✗ | ✓/✗/N/A | ✓/✗ | ✓/✗ |
### Test Quality
| # | File | Issue | Action |
|---|------|-------|--------|
| 1 | <file:line> | <value/correctness/level/efficiency/dedup issue> | <fixed/skipped — detail> |
### Feature Task Completion (if --feature)
| # | Task | Status |
|---|------|--------|
| 1 | <description> | DONE/NOT DONE |
**Completion:** N/M tasks done (N%)
### Verdict
- **CLEAN** — No issues found or all issues fixed
- **NEEDS_WORK** — Issues found that need human input (listed in Skipped)
If any code changes were made, stage and commit with message:
fix: code review — <summary of fixes>
Do NOT push — let the user review the commit first.
ruff check after making changes to catch regressions.npx claudepluginhub ajmaher2-dev/claude-skills --plugin workflow-skillsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.