一键导入
flow-code-code-review
Use when reviewing code changes — self-review in Worker Phase 6, impl-review, or PR review. Applies five-axis scoring with severity labels.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when reviewing code changes — self-review in Worker Phase 6, impl-review, or PR review. Applies five-axis scoring with severity labels.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Internal pipeline engine. Manages the entire pipeline (brainstorm, plan, plan-review, work, impl-review, close) via flowctl phase commands. Invoked by /flow-code:go.
Use when exploring requirements before planning. Pressure-tests ideas, generates approaches, and outputs a requirements doc for /flow-code:plan. Supports --auto mode for AI self-interview (no human input needed).
Use when exploring requirements before planning. Pressure-tests ideas, generates approaches, and outputs a requirements doc for /flow-code:plan.
Use when planning features or designing implementation. Triggers on /flow-code:plan with text descriptions or Flow IDs.
Use when implementing a plan or working through a spec. Triggers on /flow-code:work with Flow IDs.
Use when implementing authentication, authorization, OAuth, JWT, RBAC, or session management. Covers token lifecycle, permission models, and secure session handling.
| name | flow-code-code-review |
| description | Use when reviewing code changes — self-review in Worker Phase 6, impl-review, or PR review. Applies five-axis scoring with severity labels. |
| tier | 2 |
| user-invocable | true |
Startup: Follow Startup Sequence before proceeding.
FLOWCTL="$HOME/.flow/bin/flowctl"
Structured code review across five orthogonal axes. Every finding gets a severity label. Every review ends with a clear verdict. This replaces ad-hoc "looks good" reviews with systematic quality gates.
When NOT to use:
Review every diff across these five dimensions. Each axis is independent — a change can score well on correctness but poorly on security.
processData → validateUserInput)flow-code-security skill for full checklist.Every finding MUST have a severity label:
| Label | Meaning | Action Required |
|---|---|---|
| Critical | Blocks merge. Bug, security hole, data loss risk. | Must fix before proceeding. |
| Important | Should fix. Correctness concern or significant quality issue. | Fix unless strong justification. |
| Suggestion | Consider this. Improvement opportunity. | Author decides. |
| Nit | Minor style or naming preference. | Author may ignore. |
| FYI | Informational. No action needed. | For awareness only. |
| Lines Changed | Rating | Action |
|---|---|---|
| ~100 | Good | Easy to review thoroughly |
| ~300 | Acceptable | Review in one sitting |
| ~500 | Large | Consider splitting |
| ~1000+ | Too large | Split into smaller changes |
If a diff exceeds 500 lines, flag it: "This change is large (~N lines). Consider splitting into focused commits."
Before looking at code:
flowctl code-structure extract --path <changed-dir> --json to check impact scope (what symbols exist in affected directories)flowctl graph impact <changed-file> --json to understand what else might breakWalk through the diff with all five axes active:
Group findings by severity:
## Critical (must fix)
- [Correctness] Missing null check on user.email (line 42) — NPE in production
- [Security] SQL built with template literal (line 89) — injection risk
## Important (should fix)
- [Architecture] Direct DB access from handler — should go through service layer
- [Performance] Fetching all users to count them — use COUNT query
## Suggestions
- [Readability] Rename `processData` to `validateOrderInput` for clarity
- [Readability] Extract lines 120-145 into a named function
## Nits
- [Readability] Inconsistent spacing in object literal (line 67)
| Verdict | Criteria |
|---|---|
| SHIP | Zero Critical, zero Important, all Suggestions are minor |
| NEEDS_WORK | Has Critical or Important findings that need fixes |
| MAJOR_RETHINK | Fundamental approach is wrong — need to redesign |
For highest quality, use cross-model review:
This catches blind spots that same-model review misses.
For high-stakes reviews (impl-review, pre-merge) where broader coverage matters. Not needed for quick self-reviews in Worker Phase 6.
Always-on (every multi-persona review):
correctness-reviewer — logic errors, contract violations, edge casestesting-reviewer — coverage gaps, assertion quality, missing scenariosmaintainability-reviewer — readability, naming, dead code, complexityConditional (activate based on diff content):
| Persona | Activate when diff touches... |
|---|---|
security-reviewer | Auth, endpoints, input handling, permissions, secrets |
performance-reviewer | Queries, data transforms, caching, async, hot loops |
architecture-reviewer | Module boundaries, new dependencies, public API surface |
All persona agents live in agents/review/. Each returns a JSON array of findings conforming to the schema in docs/findings-schema.md.
Step 1: Analyze the diff to determine which conditional reviewers to activate.
Step 2: Spawn all selected reviewers in parallel using Agent tool.
Each reviewer receives: the diff, the file list, and its persona instructions.
Each returns: a JSON array of findings per docs/findings-schema.md.
Step 3: Collect all reviewer outputs into temporary JSON files (one per reviewer).
Step 4: Run: flowctl review merge --files "r1.json,r2.json,..." --json
Step 5: Present merged findings grouped by severity (P0 → P3).
Step 6: Apply safe_auto fixes from fixer_queue automatically.
Step 7: Present gated_auto and manual findings for human decision.
The merge pipeline applies these calibration rules before presenting findings:
autofix_class for the same finding, the merge keeps the most restrictive class (e.g. if one says safe_auto and another says gated_auto, the result is gated_auto).Merged output follows the canonical findings schema documented in docs/findings-schema.md. Each finding includes severity, category, description, confidence, autofix_class, owner, and the reviewer field indicating which persona produced it. When findings are boosted by cross-reviewer agreement, the evidence array includes entries from all agreeing reviewers.
The merge pipeline deduplicates using a three-part fingerprint (file + line bucket + normalized description). See the Fingerprinting section in docs/findings-schema.md for details.
Reviewers MUST produce at least 3 findings (any severity level). Zero findings is NOT an acceptable review output -- it indicates insufficient analysis, not perfect code.
If the first pass yields zero findings, halt and re-analyze from these angles:
If after re-analysis there are truly no Critical or Important issues, report at least 3 Suggestion or Nit improvements. Every codebase has room for improvement in naming, structure, documentation, or test coverage.
When performing impl_review or epic-level code review, spawn 3 independent review agents in parallel:
git diff main...HEAD)prompts/blind-hunter.mdprompts/edge-case-hunter.mdprompts/acceptance-auditor.mdDuring review, flag:
TODO comments older than 30 days without tickets| Rationalization | Reality |
|---|---|
| "It works, so it's fine" | Working code can still have security holes, performance issues, and maintenance debt. |
| "We'll clean it up later" | Later never comes. Fix it now or create a tracked ticket. |
| "It's just a nit" | Accumulated nits become a maintenance burden. Fix the pattern, not individual instances. |
| "The tests pass" | Tests only catch what they test for. Review the untested paths. |
| "I don't have context on this area" | Say so. Ask questions. Don't rubber-stamp code you don't understand. |
After completing a review:
When verdict is NEEDS_WORK, the orchestrator should capture each Critical/Important finding as a pitfall:
$FLOWCTL memory add pitfall "Review: <finding summary>"
This builds project memory from review failures, preventing the same mistakes in future tasks.