EasyPlatform workflow-review
[Workflow] Trigger Code Review workflow — review, fix, and re-review recursively until all issues resolved.
git clone https://github.com/duc01226/EasyPlatform
T=$(mktemp -d) && git clone --depth=1 https://github.com/duc01226/EasyPlatform "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/workflow-review" ~/.claude/skills/duc01226-easyplatform-workflow-review && rm -rf "$T"
.claude/skills/workflow-review/SKILL.md[WORKFLOW-IN-WORKFLOW: MUST RUN AS SUB-AGENT when inside another workflow] This skill activates the full
workflow (14 steps). When invoked as a step inside a parent workflow, it MUST execute viareviewtool (Agent) — NEVER as an inlinesubagent_type: "code-reviewer"tool call. Inline execution absorbs the entire nested workflow context into the parent session.SkillSub-agent prompt must include: target files or git diff context, task description, instruction to return SYNC:subagent-return-contract summary and write full findings to
.plans/reports/Standalone invocation (not inside a workflow): inline execution is fine — no sub-agent required.
<!-- SYNC:critical-thinking-mindset -->[BLOCKING] Each step MUST ATTENTION invoke its
tool — marking a taskSkillwithout skill invocation is a workflow violation. NEVER batch-complete validation gates. [FRESH SUB-AGENT RE-REVIEW] After fixes incompleted, spawn a fresh sub-agent per/cookfor unbiased re-review. Max 3 fresh rounds per conversation. [ITERATION CAP] Max 3 fresh-subagent re-review rounds per conversation (tracked in conversation context, not persistent files). PASS = zero Critical/High without fixes.SYNC:fresh-context-review
<!-- /SYNC:critical-thinking-mindset --> <!-- SYNC:ai-mistake-prevention -->Critical Thinking Mindset — Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act. Anti-hallucination: Never present guess as fact — cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence — certainty without evidence root of all hallucination.
<!-- /SYNC:ai-mistake-prevention -->AI Mistake Prevention — Failure modes to avoid on every task:
- Check downstream references before deleting. Deleting components causes documentation and code staleness cascades. Map all referencing files before removal.
- Verify AI-generated content against actual code. AI hallucinates APIs, class names, and method signatures. Always grep to confirm existence before documenting or referencing.
- Trace full dependency chain after edits. Changing a definition misses downstream variables and consumers derived from it. Always trace the full chain.
- Trace ALL code paths when verifying correctness. Confirming code exists is not confirming it executes. Always trace early exits, error branches, and conditional skips — not just happy path.
- When debugging, ask "whose responsibility?" before fixing. Trace whether bug is in caller (wrong data) or callee (wrong handling). Fix at responsible layer — never patch symptom site.
- Assume existing values are intentional — ask WHY before changing. Before changing any constant, limit, flag, or pattern: read comments, check git blame, examine surrounding code.
- Verify ALL affected outputs, not just the first. Changes touching multiple stacks require verifying EVERY output. One green check is not all green checks.
- Holistic-first debugging — resist nearest-attention trap. When investigating any failure, list EVERY precondition first (config, env vars, DB names, endpoints, DI registrations, data preconditions), then verify each against evidence before forming any code-layer hypothesis.
- Surgical changes — apply the diff test. Bug fix: every changed line must trace directly to the bug. Don't restyle or improve adjacent code. Enhancement task: implement improvements AND announce them explicitly.
- Surface ambiguity before coding — don't pick silently. If request has multiple interpretations, present each with effort estimate and ask. Never assume all-records, file-based, or more complex path.
Activate the
review workflow. Run /workflow-start review with the user's prompt as context.
Quick Summary
Goal: Review codebase or specific scope, fix issues found, then spawn a fresh code-reviewer sub-agent for unbiased re-review — repeat until clean.
Sequence: /review-architecture → /code-simplifier → /code-review → /performance → /integration-test-review → /integration-test-verify → /plan → /plan-validate → /why-review → /cook → fresh sub-agent re-review gate (/workflow-review WIW) → /docs-update → /watzup → /workflow-end
Key Rules:
- After
applies fixes → spawn fresh/cook
sub-agent percode-reviewer
→ integrate findings → fix → spawn NEW sub-agent → repeatSYNC:fresh-context-review - Main-agent re-review (with knowledge of its own fixes) is NOT sufficient — orchestrator-level confirmation bias
- PASS = a fresh sub-agent round finds ZERO Critical/High issues WITHOUT needing any fixes
- Max 3 fresh-subagent rounds per conversation (tracked in conversation context)
Mandatory Task Creation (ZERO TOLERANCE)
Create EXACTLY these 14 tasks (source:
workflows.json → review.sequence):
| # | Task Subject | Conditional? |
|---|---|---|
| 1 | | No |
| 2 | | No |
| 3 | | No |
| 4 | | No |
| 5 | | No |
| 6 | | No |
| 7 | | Skip if all reviews PASS |
| 8 | | Skip if all reviews PASS |
| 9 | | Skip if all reviews PASS |
| 10 | | Skip if all reviews PASS |
| 11 | | Skip if all reviews PASS |
| 12 | | Always run (fast-exits when no business code changed) |
| 13 | | No |
| 14 | | No |
NEVER consolidate, rename, or omit steps. If reviews PASS, mark conditional tasks
completed with note "Skipped — all reviews passed".
Fresh Sub-Agent Re-Review Protocol (CRITICAL)
<!-- SYNC:fresh-context-review --><!-- /SYNC:fresh-context-review --> <!-- SYNC:incremental-persistence -->Fresh Sub-Agent Review — Eliminate orchestrator confirmation bias via isolated sub-agents.
Why: The main agent knows what it (or
) just fixed and rationalizes findings accordingly. A fresh sub-agent has ZERO memory, re-reads from scratch, and catches what the main agent dismissed. Sub-agent bias is mitigated by (1) fresh context, (2) verbatim protocol injection, (3) main agent not filtering the report./cookWhen: Round 2 of ANY review AND every recursive re-review iteration after fixes. NOT needed when Round 1 already PASSes with zero issues.
How:
- Spawn a NEW
tool call — useAgentsubagent_type for code reviews,code-reviewerfor plan/doc/artifact reviewsgeneral-purpose- Inject ALL required review protocols VERBATIM into the prompt — see
for the full list and template. Never reference protocols by file path; AI compliance drops behind file-read indirection (seeSYNC:review-protocol-injection)SYNC:shared-protocol-duplication-policy- Sub-agent re-reads ALL target files from scratch via its own tool calls — never pass file contents inline in the prompt
- Sub-agent writes structured report to
plans/reports/{review-type}-round{N}-{date}.md- Main agent reads the report, integrates findings into its own report, DOES NOT override or filter
Rules:
- NEVER reuse a sub-agent across rounds — every iteration spawns a NEW
callAgent- NEVER skip fresh-subagent review because "last round was clean" — every fix triggers a fresh round
- Max 3 fresh-subagent rounds per review — escalate via
if still failing; do NOT silently loop or fall back to any prior protocolAskUserQuestion- Track iteration count in conversation context (session-scoped, no persistent files)
<!-- /SYNC:incremental-persistence --> <!-- SYNC:subagent-return-contract -->Incremental Result Persistence — MANDATORY for all sub-agents or heavy inline steps processing >3 files.
- Before starting: Create report file
plans/reports/{skill}-{date}-{slug}.md- After each file/section reviewed: Append findings to report immediately — never hold in memory
- Return to main agent: Summary only (per SYNC:subagent-return-contract) with
pathFull report:- Main agent: Reads report file only when resolving specific blockers
Why: Context cutoff mid-execution loses ALL in-memory findings. Each disk write survives compaction. Partial results are better than no results.
Report naming:
plans/reports/{skill-name}-{YYMMDD}-{HHmm}-{slug}.md
<!-- /SYNC:subagent-return-contract -->Sub-Agent Return Contract — When this skill spawns a sub-agent, the sub-agent MUST return ONLY this structure. Main agent reads only this summary — NEVER requests full sub-agent output inline.
## Sub-Agent Result: [skill-name] Status: ✅ PASS | ⚠️ PARTIAL | ❌ FAIL Confidence: [0-100]% ### Findings (Critical/High only — max 10 bullets) - [severity] [file:line] [finding] ### Actions Taken - [file changed] [what changed] ### Blockers (if any) - [blocker description] Full report: plans/reports/[skill-name]-[date]-[slug].mdMain agent reads
file ONLY when: (a) resolving a specific blocker, or (b) building a fix plan. Sub-agent writes full report incrementally (per SYNC:incremental-persistence) — not held in memory.Full report
Decision Logic
Reviews (steps 1-6) → ALL PASS? YES → skip steps 7-11, proceed to /docs-update → /watzup → /workflow-end → DONE NO → /plan → /plan-validate → /why-review → /cook → FRESH SUB-AGENT RE-REVIEW GATE (step 11)
Fresh Sub-Agent Re-Review Gate (Step 11) — After /cook
Applies Fixes
/cook- DO NOT attempt main-agent re-review (main agent has confirmation bias from its own fixes)
- DO spawn a NEW
tool call withAgent
using the canonical template fromsubagent_type: "code-reviewer"
inSYNC:review-protocol-injection
. Inject all 9 required SYNC protocol blocks verbatim (.claude/skills/shared/sync-inline-versions.md
,SYNC:evidence-based-reasoning
,SYNC:bug-detection
,SYNC:design-patterns-quality
,SYNC:logic-and-intention-review
,SYNC:test-spec-verification
,SYNC:fix-layer-accountability
,SYNC:rationalization-prevention
,SYNC:graph-assisted-investigation
). Target files =SYNC:understand-code-first
. Report path ="run git diff to see all uncommitted changes"
.plans/reports/workflow-review-round{N}-{date}.md - DO increment fresh-subagent round count in conversation context
- DO read the sub-agent's report and integrate findings — MUST NOT filter, reinterpret, or override
- IF fresh sub-agent returns PASS (zero Critical/High) → proceed through
→/docs-update
→/watzup
→ DONE/workflow-end - IF fresh sub-agent returns FAIL and round count < 3 → run
+/plan
again, then spawn a NEW Agent call (never reuse the previous sub-agent) for Round N+1/cook - IF round count >= 3 → STOP and escalate via
— do NOT silently loop or fall back to any prior protocolAskUserQuestion
Iteration Rules
- Max 3 fresh-subagent rounds — if fresh-subagent round count >= 3 and issues persist, STOP and use
to escalate (manual review required)AskUserQuestion - PASS = done — proceed to commit
- Issue count increasing — if round N finds MORE issues than round N-1, STOP and escalate via
AskUserQuestion
Flow Diagram
Main Session: Review → Issues? → Plan → Fix (/cook) → Spawn fresh sub-agent │ │ │ (no issues) ↓ ↓ Fresh sub-agent re-reads ALL /watzup files from scratch with /workflow-end verbatim protocol injection DONE ✓ │ ↓ Report → PASS? → DONE ✓ → FAIL? → Fix → spawn NEW sub-agent (max 3 rounds)
Closing Reminders
- IMPORTANT MUST ATTENTION break work into small todo tasks using
BEFORE starting — create ALL 14 tasks immediatelyTaskCreate - IMPORTANT MUST ATTENTION after fixes in
, spawn a NEW/cook
sub-agent via thecode-reviewer
tool perAgent
— NEVER re-review with the main agentSYNC:fresh-context-review - IMPORTANT MUST ATTENTION track fresh-subagent round count via conversation context (session-scoped) — max 3 rounds, escalate via
if exceededAskUserQuestion - IMPORTANT MUST ATTENTION PASS means a fresh sub-agent round finds ZERO Critical/High issues WITHOUT needing fixes — only then are changes ready to commit
- IMPORTANT MUST ATTENTION skip steps 7-11 when all reviews PASS (no fixes needed)
- IMPORTANT MUST ATTENTION each step MUST invoke its
tool — marking completed without invocation is a violation <!-- SYNC:critical-thinking-mindset:reminder -->Skill - MUST ATTENTION apply critical thinking — every claim needs traced proof, confidence >80% to act. Anti-hallucination: never present guess as fact. <!-- /SYNC:critical-thinking-mindset:reminder --> <!-- SYNC:ai-mistake-prevention:reminder -->
- MUST ATTENTION apply AI mistake prevention — holistic-first debugging, fix at responsible layer, surface ambiguity before coding, re-read files after compaction. <!-- /SYNC:ai-mistake-prevention:reminder -->