Disposable Autopsy — Phase 2: Analyze
Perform 10-axis analysis of a disposable prototype, combining quantitative metrics with qualitative AI review.
Prerequisites
- Completed spike:
.disposable/cycles/cycle_{N}/spike-complete.json must exist
- Spike branch
disposable/cycle_{N} must exist
- Codex MCP available for triangulated review (optional but recommended)
Procedure
Step 1: Load Spike Context
- Determine cycle: use
$ARGUMENTS if provided, otherwise read latest from .disposable/history.json
- Load metrics from
.disposable/cycles/cycle_{N}/spike-complete.json
- Checkout spike branch:
git checkout disposable/cycle_{N}
- Read generated source files for analysis
Step 2: Static Analysis (Quantitative)
Extract quantitative signals from metrics:
| Metric |
Maps to Axis |
| lint.error count |
correctness, readability |
| tests.failed |
correctness, error-handling |
| tests.passed / tests.total |
testability |
| coverage.line.pct |
testability, maintainability |
| coverage.branch.pct |
error-handling |
Step 3: Qualitative Analysis (10 Axes)
Analyze the prototype code against each axis. For each axis:
- correctness — Does the code do what was specified? Check requirements coverage, logic errors
- architecture — Module boundaries, dependency direction, separation of concerns
- security — Input validation, injection risks, auth boundaries, secret handling
- performance — Algorithmic complexity, unnecessary allocations, N+1 patterns
- testability — Test isolation, mock-ability, deterministic behavior
- readability — Naming, function length, cognitive complexity
- maintainability — DRY, coupling metrics, change amplification risk
- error-handling — Error propagation, recovery paths, fail-fast behavior
- dependency-hygiene — Minimal dependencies, version constraints, license compatibility
- documentation — API contracts, non-obvious behavior, setup instructions
For each axis, assign:
status: scored | na | insufficient-evidence
score: 1-5 (when scored)
- 1 = Critical issues, fundamentally broken
- 2 = Major issues, significant rework needed
- 3 = Acceptable, typical for rapid prototype
- 4 = Good, minor improvements only
- 5 = Excellent, production-ready quality
findings[]: Specific issues with severity and evidence reference
recommendations[]: Actionable improvements with priority
Step 4: Triangulated Review (Optional)
If Codex MCP is available, request independent review:
mcp__codex__codex(
prompt: "Review the following disposable prototype for {axis}.
Focus on: {axis-specific criteria}.
Report findings as JSON array with id, severity, description, evidenceRef fields.
Files: {file list}",
model: "gpt-5.4",
config: { "model_reasoning_effort": "xhigh" },
cwd: "{project_root}"
)
Merge Codex findings with Claude findings:
- Findings reported by both → increase confidence (severity stays or escalates)
- Findings reported by only one → keep but flag as single-source
- Contradictions → note in findings, use Claude's judgment for final score
Step 5: Determine Verdict
Apply quality gates from {plugin_root}/skills/disposable-cycle/references/quality-gates.md:
- Calculate
averageScore from all scored axes
- Check each gate condition against metrics and scores
- Assign verdict:
PASS | CALIBRATE | FAIL
Step 6: Generate Report
Construct autopsy report following {plugin_root}/skills/disposable-cycle/references/autopsy-schema.json:
{
"schemaVersion": "1.0.0",
"rubricVersion": "1.0.0",
"cycleId": "cycle_{N}",
"timestamp": "{ISO 8601}",
"metricsRef": "spike-complete.json",
"axes": { ... },
"summary": {
"verdict": "PASS|CALIBRATE|FAIL",
"strengths": [...],
"criticalIssues": [...],
"averageScore": N.N
}
}
Step 7: Save, Validate & Mask
- Save report to
.disposable/cycles/cycle_{N}/autopsy-report.json
- Validate report against schema:
node {plugin_root}/scripts/dist/validate-report.mjs \
.disposable/cycles/cycle_{N}/autopsy-report.json \
--schema {plugin_root}/skills/disposable-cycle/references/autopsy-schema.json
- If validation fails: fix report structure and re-validate (max 2 retries)
- Mask sensitive data:
node {plugin_root}/scripts/dist/mask-sensitive.mjs \
.disposable/cycles/cycle_{N}/autopsy-report.json --in-place
- Return to original branch:
git checkout -
Step 8: Report to User
Present summary:
- Verdict with confidence level
- Top 3 strengths
- Critical issues requiring attention
- Axis scores table
- Recommendation for next step:
/disposable-distill or /disposable-cycle to iterate
Output
.disposable/cycles/cycle_{N}/autopsy-report.json — validated autopsy report
- Ready for
/disposable-distill
Error Handling
- If metrics file is missing: check data completeness. If tests are unavailable, set verdict to FAIL per {plugin_root}/skills/disposable-cycle/references/quality-gates.md. For lint/coverage only, mark affected axes as
insufficient-evidence and continue
- If Codex MCP is unavailable: proceed with Claude-only analysis, note in report
- If schema validation fails: fix report structure, re-validate (max 2 retries)
1---2name: disposable-autopsy3description: Analyze a disposable prototype across 10 quality axes using static analysis, test results, and Codex MCP triangulation. Produces structured autopsy report with scored findings and recommendations. Part of H-DGM cycle. Use after disposable-spike completes.4---56# Disposable Autopsy — Phase 2: Analyze78Perform 10-axis analysis of a disposable prototype, combining quantitative metrics with qualitative AI review.910## Prerequisites1112- Completed spike: `.disposable/cycles/cycle_{N}/spike-complete.json` must exist13- Spike branch `disposable/cycle_{N}` must exist14- Codex MCP available for triangulated review (optional but recommended)1516## Procedure1718### Step 1: Load Spike Context19201. Determine cycle: use `$ARGUMENTS` if provided, otherwise read latest from `.disposable/history.json`212. Load metrics from `.disposable/cycles/cycle_{N}/spike-complete.json`223. Checkout spike branch: `git checkout disposable/cycle_{N}`234. Read generated source files for analysis2425### Step 2: Static Analysis (Quantitative)2627Extract quantitative signals from metrics:2829| Metric | Maps to Axis |30|--------|-------------|31| lint.error count | correctness, readability |32| tests.failed | correctness, error-handling |33| tests.passed / tests.total | testability |34| coverage.line.pct | testability, maintainability |35| coverage.branch.pct | error-handling |3637### Step 3: Qualitative Analysis (10 Axes)3839Analyze the prototype code against each axis. For each axis:40411. **correctness** — Does the code do what was specified? Check requirements coverage, logic errors422. **architecture** — Module boundaries, dependency direction, separation of concerns433. **security** — Input validation, injection risks, auth boundaries, secret handling444. **performance** — Algorithmic complexity, unnecessary allocations, N+1 patterns455. **testability** — Test isolation, mock-ability, deterministic behavior466. **readability** — Naming, function length, cognitive complexity477. **maintainability** — DRY, coupling metrics, change amplification risk488. **error-handling** — Error propagation, recovery paths, fail-fast behavior499. **dependency-hygiene** — Minimal dependencies, version constraints, license compatibility5010. **documentation** — API contracts, non-obvious behavior, setup instructions5152For each axis, assign:53- `status`: `scored` | `na` | `insufficient-evidence`54- `score`: 1-5 (when scored)55 - 1 = Critical issues, fundamentally broken56 - 2 = Major issues, significant rework needed57 - 3 = Acceptable, typical for rapid prototype58 - 4 = Good, minor improvements only59 - 5 = Excellent, production-ready quality60- `findings[]`: Specific issues with severity and evidence reference61- `recommendations[]`: Actionable improvements with priority6263### Step 4: Triangulated Review (Optional)6465If Codex MCP is available, request independent review:6667```68mcp__codex__codex(69 prompt: "Review the following disposable prototype for {axis}.70 Focus on: {axis-specific criteria}.71 Report findings as JSON array with id, severity, description, evidenceRef fields.72 Files: {file list}",73 model: "gpt-5.4",74 config: { "model_reasoning_effort": "xhigh" },75 cwd: "{project_root}"76)77```7879Merge Codex findings with Claude findings:80- Findings reported by both → increase confidence (severity stays or escalates)81- Findings reported by only one → keep but flag as single-source82- Contradictions → note in findings, use Claude's judgment for final score8384### Step 5: Determine Verdict8586Apply quality gates from {plugin_root}/skills/disposable-cycle/references/quality-gates.md:87881. Calculate `averageScore` from all `scored` axes892. Check each gate condition against metrics and scores903. Assign verdict: `PASS` | `CALIBRATE` | `FAIL`9192### Step 6: Generate Report9394Construct autopsy report following {plugin_root}/skills/disposable-cycle/references/autopsy-schema.json:9596```json97{98 "schemaVersion": "1.0.0",99 "rubricVersion": "1.0.0",100 "cycleId": "cycle_{N}",101 "timestamp": "{ISO 8601}",102 "metricsRef": "spike-complete.json",103 "axes": { ... },104 "summary": {105 "verdict": "PASS|CALIBRATE|FAIL",106 "strengths": [...],107 "criticalIssues": [...],108 "averageScore": N.N109 }110}111```112113### Step 7: Save, Validate & Mask1141151. Save report to `.disposable/cycles/cycle_{N}/autopsy-report.json`1162. Validate report against schema:117 ```bash118 node {plugin_root}/scripts/dist/validate-report.mjs \119 .disposable/cycles/cycle_{N}/autopsy-report.json \120 --schema {plugin_root}/skills/disposable-cycle/references/autopsy-schema.json121 ```1223. If validation fails: fix report structure and re-validate (max 2 retries)1234. Mask sensitive data:124 ```bash125 node {plugin_root}/scripts/dist/mask-sensitive.mjs \126 .disposable/cycles/cycle_{N}/autopsy-report.json --in-place127 ```1285. Return to original branch: `git checkout -`129130### Step 8: Report to User131132Present summary:133- Verdict with confidence level134- Top 3 strengths135- Critical issues requiring attention136- Axis scores table137- Recommendation for next step: `/disposable-distill` or `/disposable-cycle` to iterate138139## Output140141- `.disposable/cycles/cycle_{N}/autopsy-report.json` — validated autopsy report142- Ready for `/disposable-distill`143144## Error Handling145146- If metrics file is missing: check data completeness. If tests are unavailable, set verdict to FAIL per {plugin_root}/skills/disposable-cycle/references/quality-gates.md. For lint/coverage only, mark affected axes as `insufficient-evidence` and continue147- If Codex MCP is unavailable: proceed with Claude-only analysis, note in report148- If schema validation fails: fix report structure, re-validate (max 2 retries)