Review and finalize (REVIEWER + DOCUMENTER phases) - runs adversarial code review, commits changes, completes task, and records reflection to capture pattern outcomes.
Combines REVIEWER (adversarial code review) and DOCUMENTER (commit, complete, reflect).
YOU CANNOT SKIP ANY OF THESE for APPROVE or CONDITIONAL outcomes.
If REJECT, stop after review, set frontmatter to phase: rework, and return to /apex:implement.
You can find active tasks in ./.apex/tasks/ or run with:
/apex:ship [identifier]
Contract rules:
Review for security vulnerabilities. Return YAML with id, severity, confidence, location, issue, evidence, mitigations_found.
Review for performance issues. Return YAML findings.
Review for architecture violations and pattern consistency. Return YAML findings.
Review for test coverage gaps. Return YAML findings.
Review for maintainability and code quality. Return YAML findings.
Challenge EVERY finding for:
Return: challenge_result (UPHELD|DOWNGRADED|DISMISSED), evidence_quality, recommended_confidence, roi_analysis
Use git history to find justifications for seemingly problematic patterns. Return: Context justifications for historical code choices.
If task modified API or CLI:
If task modified data structures:
Search strategy:
# Find docs that might reference changed files
for file in [modified_files]; do
grep -r "$(basename $file .ts)" docs/ README.md CLAUDE.md
done
š¤ Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com" git log -1 --oneline # Capture commit SHA
</commands>
<checkpoint>Commit SHA captured for evidence.</checkpoint>
<compound-prompt>
After successful commit, display:
Committed: [SHA]
Run /apex:compound [identifier] to capture learnings for future agents.
</compound-prompt>
</step>
<step id="7" title="Reflection and completion">
<critical>
You MUST record a final reflection. This is NOT optional.
Without reflection:
- Learnings aren't captured
- Pattern outcomes aren't recorded
- Future tasks don't benefit
</critical>
<reflection-format>
```markdown
### Reflection
- **Outcome**: success | partial | failure
- **Key Learning**: [Main lesson from this task]
- **Patterns Used**: [PAT:ID from plan] with outcome notes
- **New Patterns / Anti-patterns**: [If discovered]
- **Evidence**: [Commit SHA, files, tests]
<ship>
<metadata>
<timestamp>[ISO]</timestamp>
<outcome>success|partial|failure</outcome>
<commit-sha>[SHA]</commit-sha>
</metadata>
<review-summary>
<phase1-findings count="X">
<by-severity critical="N" high="N" medium="N" low="N"/>
<by-agent security="N" performance="N" architecture="N" testing="N" quality="N"/>
</phase1-findings>
<phase2-challenges>
<upheld>N</upheld>
<downgraded>N</downgraded>
<dismissed>N</dismissed>
</phase2-challenges>
<false-positive-rate>[X%]</false-positive-rate>
</review-summary>
<contract-verification>
<contract-version>[N]</contract-version>
<amendments-audited>[List amendments or "none"]</amendments-audited>
<acceptance-criteria-verification>
<criterion id="AC-1" status="met|not-met">[Evidence or exception]</criterion>
</acceptance-criteria-verification>
<out-of-scope-check>[Confirm no out-of-scope work slipped in]</out-of-scope-check>
</contract-verification>
<action-items>
<fix-now>
<item id="[ID]" severity="[S]" confidence="[C]" location="[file:line]">
[Issue and fix]
</item>
</fix-now>
<should-fix>[Deferred items]</should-fix>
<accepted>[Accepted risks with justification]</accepted>
<dismissed>[False positives with reasons]</dismissed>
</action-items>
<commit>
<sha>[Full SHA]</sha>
<message>[Commit message]</message>
<files>[List of files]</files>
</commit>
<reflection>
<patterns-reported>
<pattern id="PAT:X:Y" outcome="[outcome]"/>
</patterns-reported>
<key-learning>[Main lesson]</key-learning>
<reflection-status>recorded|missing</reflection-status>
</reflection>
<final-summary>
<what-was-built>[Concise description]</what-was-built>
<patterns-applied count="N">[List]</patterns-applied>
<test-status passed="X" failed="Y"/>
<documentation-updated>[What docs changed]</documentation-updated>
</final-summary>
</ship>
š Metrics:
š¬ Summary: [Concise description of what was built]
š Patterns:
ā Acceptance Criteria:
š Review:
āļø Next: Task complete. No further action required.
<ship><reflection>?If ANY unchecked ā GO BACK AND COMPLETE IT.