Agent skill
review-post-task
[Code Quality] Two-pass code review for task completion
Install this agent skill to your Project
npx add-skill https://github.com/duc01226/EasyPlatform/tree/main/.claude/skills/review-post-task
SKILL.md
[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI MUST ask user whether to skip.
Prerequisites: MUST READ before executing:
Understand Code First — Search codebase for 3+ similar implementations BEFORE writing any code. Read existing files, validate assumptions with grep evidence, map dependencies via graph trace. Never invent new patterns when existing ones work. MUST READ
.claude/skills/shared/understand-code-first-protocol.mdfor full protocol and checklists. Design Patterns Quality — Priority checks: (1) DRY via OOP — same-suffix classes MUST share base class, 3+ similar patterns → extract. (2) Right Responsibility — logic in LOWEST layer (Entity > Service > Component). (3) SOLID principles. MUST READ.claude/skills/shared/design-patterns-quality-checklist.mdfor full protocol and checklists. Double Round-Trip Review — Every review executes TWO full rounds: Round 1 builds understanding (normal review), Round 2 leverages accumulated context to catch what Round 1 missed. Round 2 is MANDATORY — never skip, never combine into single pass. MUST READ.claude/skills/shared/double-round-trip-review-protocol.mdfor full protocol and checklists. Graph Impact Analysis — Usetrace --direction downstreamon changed files to find all impacted consumers, bus message handlers, event subscribers. Verify each needs updating. MUST READ.claude/skills/shared/graph-impact-analysis-protocol.mdfor full protocol and checklists. Logic & Intention Review — Verify WHAT the code does matches WHY it was changed. Every changed line must serve stated purpose. Trace at least one happy path + one error path. Clean code can be wrong code. MUST READ.claude/skills/shared/logic-and-intention-review-protocol.mdfor full protocol and checklists. Bug Detection — Systematically hunt for potential bugs: null safety, boundary conditions (off-by-one, empty collections), error handling (silent failures, swallowed exceptions), resource leaks, concurrency issues (missing await, race conditions). Check categories 1-4 for EVERY review. MUST READ.claude/skills/shared/bug-detection-protocol.mdfor full protocol and checklists. Test Spec Verification — Cross-reference changes against TC-{FEAT}-{NNN} test specifications. Flag untested code paths, new functions without TCs, stale evidence in existing TCs. If no specs exist, recommend /tdd-spec. MUST READ.claude/skills/shared/test-spec-verification-protocol.mdfor full protocol and checklists.
Critical Purpose: Ensure quality — no flaws, no bugs, no missing updates, no stale content. Verify both code AND documentation.
MANDATORY IMPORTANT MUST Plan ToDo Task to READ the following project-specific reference docs:
docs/project-reference/code-review-rules.md— anti-patterns, review checklists, quality standards (READ FIRST) (content auto-injected by hook — check for [Injected: ...] header before reading)project-structure-reference.md— service list, directory tree, conventionsIf files not found, search for: project documentation, coding standards, architecture docs.
OOP & DRY Enforcement: MANDATORY IMPORTANT MUST — flag duplicated patterns that should be extracted to a base class, generic, or helper. Classes in the same group or suffix (ex *Entity, *Dto, *Service, etc...) MUST inherit a common base (even if empty now — enables future shared logic and child overrides). Verify project has code linting/analyzer configured for the stack.
Quick Summary
Goal: Two-pass code review after task completion to catch issues before commit.
Workflow:
- Pass 1: File-by-File — Review each changed file individually
- Pass 2: Holistic — Assess overall approach, architecture, consistency
- Report — Summarize critical issues and recommendations
Key Rules:
- Ensure quality: no flaws, no bugs, no missing updates, no stale content
- Check both code AND documentation for completeness
- Evidence-based findings with
file:linereferences
Execute mandatory two-pass review protocol after completing code changes. Focus: $ARGUMENTS
Activate code-review skill and follow its workflow with post-task two-pass protocol:
Review Mindset (NON-NEGOTIABLE)
Be skeptical. Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence percentages (Idea should be more than 80%).
- Do NOT accept code correctness at face value — verify by reading actual implementations
- Every finding must include
file:lineevidence (grep results, read confirmations) - If you cannot prove a claim with a code trace, do NOT include it in the report
- Question assumptions: "Does this actually work?" → trace the call path to confirm
- Challenge completeness: "Is this all?" → grep for related usages across services
- Verify side effects: "What else does this change break?" → check consumers and dependents
- No "looks fine" without proof — state what you verified and how
Core Principles (ENFORCE ALL)
YAGNI — Flag code solving hypothetical future problems (unused params, speculative interfaces, premature abstractions)
KISS — Flag unnecessarily complex solutions. Ask: "Is there a simpler way?"
DRY — Grep for similar/duplicate code across the codebase. If 3+ similar patterns exist, flag for extraction.
Clean Code — Readable > clever. Names reveal intent. Functions do one thing. No deep nesting (≤3 levels). Methods <30 lines.
Follow Convention — Before flagging ANY pattern violation, grep for 3+ existing examples. Codebase convention wins.
No Flaws/No Bugs — Trace logic paths. Verify edge cases (null, empty, boundary). Check error handling.
Proof Required — Every claim backed by file:line evidence or grep results. Speculation is forbidden.
Doc Staleness — Cross-reference changed files against related docs (feature docs, test specs, READMEs). Flag any doc that is stale or missing updates to reflect current code changes.
Readability Checklist (MUST evaluate)
Before approving, verify the code is easy to read, easy to maintain, easy to understand:
- Schema visibility — If a function computes a data structure (object, map, config), a comment should show the output shape so readers don't have to trace the code
- Non-obvious data flows — If data transforms through multiple steps (A → B → C), a brief comment should explain the pipeline
- Self-documenting signatures — Function params should explain their role; flag unused params
- Magic values — Unexplained numbers/strings should be named constants or have inline rationale
- Naming clarity — Variables/functions should reveal intent without reading the implementation
Protocol
Pass 1: Gather changes (git diff), apply project review checklist:
- Backend: platform repos, validation, events, DTOs
- Backend: seed data in data seeders (not migrations) — if data must exist after DB reset, it's a seeder
- Frontend: base classes, stores, untilDestroyed, BEM
- Architecture: layer placement, service boundaries
- Convention: grep for 3+ similar patterns to verify code follows codebase conventions
- Correctness: trace logic paths, check edge cases (null, empty, boundary values)
- DRY: grep for duplicate/similar code across codebase
- YAGNI/KISS: flag over-engineering, unnecessary abstractions, speculative features
- Doc staleness: cross-reference changed files against
docs/business-features/, test specs, READMEs — flag stale docs
[IMPORTANT] Database Performance Protocol (MANDATORY):
- Paging Required — ALL list/collection queries MUST use pagination. NEVER load all records into memory. Verify: no unbounded
GetAll(),ToList(), orFind()withoutSkip/Takeor cursor-based paging.- Index Required — ALL query filter fields, foreign keys, and sort columns MUST have database indexes configured. Verify: entity expressions match index field order, database collections have index management methods, migrations include indexes for WHERE/JOIN/ORDER BY columns.
Fix issues found.
Pass 2 (MANDATORY — Round 2): Re-review ALL changes (original + corrections) with fresh eyes. Do NOT skip even if Pass 1 made no changes. Focus on what Pass 1 missed: cross-cutting concerns, subtle edge cases, naming inconsistencies, missing pieces, convention drift, over-engineering. Update report with Round 2 findings. See .claude/skills/shared/double-round-trip-review-protocol.md.
Round 2 Additional Focus:
- Logic errors that Round 1 accepted at face value
- Bug patterns that only emerge when viewing cross-file interactions
- Test spec gaps visible only after seeing the full change set
Final Report: Task description, Pass 1/2 results, changes summary, issues fixed, remaining concerns.
Integration Notes
- Auto-triggered by workflow orchestration after
/cook,/fix,/code - Can be manually invoked with
/review-post-task - For PR reviews, use
/code-reviewinstead - Use
code-reviewersubagent for complex reviews
Systematic Review Protocol (for 10+ changed files)
When the changeset is large (10+ files), categorize files by concern, fire parallel
code-reviewersub-agents per category, then synchronize findings into a holistic report. Seereview-changes/SKILL.md§ "Systematic Review Protocol" for the full 4-step protocol (Categorize → Parallel Sub-Agents → Synchronize → Holistic Assessment).
AI Agent Integrity Gate (NON-NEGOTIABLE)
Completion ≠ Correctness. Before reporting ANY work done, prove it:
- Grep every removed name. Extraction/rename/delete touched N files? Grep confirms 0 dangling refs across ALL file types.
- Ask WHY before changing. Existing values are intentional until proven otherwise. No "fix" without traced rationale.
- Verify ALL outputs. One build passing ≠ all builds passing. Check every affected stack.
- Evaluate pattern fit. Copying nearby code? Verify preconditions match — same scope, lifetime, base class, constraints.
- New artifact = wired artifact. Created something? Prove it's registered, imported, and reachable by all consumers.
Closing Reminders
- MUST break work into small todo tasks using
TaskCreateBEFORE starting - MUST search codebase for 3+ similar patterns before creating new code
- MUST cite
file:lineevidence for every claim (confidence >80% to act) - MUST add a final review todo task to verify work quality
- MUST execute two review rounds (Round 1: understand, Round 2: catch missed issues) MANDATORY IMPORTANT MUST READ the following files before starting:
- MUST READ
.claude/skills/shared/understand-code-first-protocol.mdbefore starting - MUST READ
.claude/skills/shared/design-patterns-quality-checklist.mdbefore starting - MUST READ
.claude/skills/shared/double-round-trip-review-protocol.mdbefore starting - MUST READ
.claude/skills/shared/graph-impact-analysis-protocol.mdbefore starting - MUST READ
.claude/skills/shared/logic-and-intention-review-protocol.mdbefore starting - MUST READ
.claude/skills/shared/bug-detection-protocol.mdbefore starting - MUST READ
.claude/skills/shared/test-spec-verification-protocol.mdbefore starting
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
fix-parallel
[Implementation] Analyze & fix issues with parallel fullstack-developer agents
ask
[Utilities] Answer technical and architectural questions.
claude-code
[Utilities] Claude Code CLI setup, configuration, troubleshooting, and feature guidance. Triggers on claude code setup, hook not firing, MCP connection, context limit, skill creation, slash command setup.
workflow-deployment
[Workflow] Trigger Deployment & Infrastructure workflow — CI/CD pipelines, Docker, Kubernetes setup and deployment.
workflow-idea-to-pbi
[Workflow] Trigger Idea to PBI workflow — po/ba workflow: capture idea, refine to pbi, create stories, prioritize.
easy-claude-help
[Utilities] Configuration guide for the easy-claude framework — explain settings, guide users through configuring .ck.json.
Didn't find tool you were looking for?