ultra-builder-pro-cli 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +1 -1
  3. package/adapters/_shared/codex-assets.cjs +23 -341
  4. package/adapters/_shared/runtime-assets.cjs +24 -0
  5. package/adapters/_shared/tests/runtime-assets.test.cjs +11 -4
  6. package/adapters/claude.js +28 -5
  7. package/adapters/kimi.js +15 -138
  8. package/adapters/opencode.js +14 -47
  9. package/adapters/tests/claude.test.cjs +22 -8
  10. package/adapters/tests/codex.test.cjs +19 -6
  11. package/adapters/tests/kimi.test.cjs +11 -11
  12. package/adapters/tests/opencode.test.cjs +11 -7
  13. package/agents/code-reviewer.md +24 -85
  14. package/agents/debugger.md +30 -132
  15. package/agents/review-code.md +24 -104
  16. package/agents/review-comments.md +20 -83
  17. package/agents/review-coordinator.md +40 -137
  18. package/agents/review-design.md +21 -118
  19. package/agents/review-errors.md +22 -70
  20. package/agents/review-spec.md +36 -0
  21. package/agents/review-tests.md +20 -76
  22. package/agents/tdd-runner.md +26 -84
  23. package/commands/learn.md +5 -36
  24. package/commands/ultra-change.md +5 -43
  25. package/commands/ultra-deliver.md +4 -46
  26. package/commands/ultra-dev.md +4 -48
  27. package/commands/ultra-doctor.md +4 -30
  28. package/commands/ultra-init.md +5 -47
  29. package/commands/ultra-plan.md +5 -48
  30. package/commands/ultra-research.md +5 -54
  31. package/commands/ultra-status.md +5 -44
  32. package/commands/ultra-test.md +5 -45
  33. package/commands/ultra-think.md +5 -40
  34. package/docs/PLAN.zh-CN.md +3 -3
  35. package/docs/ROADMAP.md +1 -1
  36. package/docs/SKILL-AUTHORING.md +75 -0
  37. package/package.json +3 -2
  38. package/skills/cc-collab/SKILL.md +16 -18
  39. package/skills/code-review-expert/SKILL.md +39 -114
  40. package/skills/code-review-expert/references/correctness-reliability.md +30 -0
  41. package/skills/code-review-expert/references/design-boundaries.md +26 -0
  42. package/skills/code-review-expert/references/removal-plan.md +17 -45
  43. package/skills/codex-collab/SKILL.md +23 -28
  44. package/skills/codex-collab/evals/evals.json +18 -23
  45. package/skills/integration-rules/SKILL.md +28 -67
  46. package/skills/learn/SKILL.md +46 -106
  47. package/skills/security-rules/SKILL.md +34 -56
  48. package/skills/testing-rules/SKILL.md +28 -52
  49. package/skills/ultra-change/SKILL.md +57 -114
  50. package/skills/ultra-deliver/SKILL.md +49 -87
  51. package/skills/ultra-dev/SKILL.md +42 -105
  52. package/skills/ultra-doctor/SKILL.md +39 -72
  53. package/skills/ultra-init/SKILL.md +59 -140
  54. package/skills/ultra-plan/SKILL.md +48 -88
  55. package/skills/ultra-research/SKILL.md +59 -152
  56. package/skills/ultra-research/references/architecture.md +38 -0
  57. package/skills/ultra-research/references/problem-product.md +39 -0
  58. package/skills/ultra-research/references/quality-delivery.md +34 -0
  59. package/skills/ultra-research/references/synthesis.md +38 -0
  60. package/skills/ultra-research/references/users-scope.md +40 -0
  61. package/skills/ultra-review/SKILL.md +54 -98
  62. package/skills/ultra-review/references/unified-schema.md +76 -101
  63. package/skills/ultra-review/scripts/review_wait.py +242 -77
  64. package/skills/ultra-status/SKILL.md +29 -51
  65. package/skills/ultra-test/SKILL.md +37 -72
  66. package/skills/ultra-think/SKILL.md +43 -102
  67. package/skills/ultra-verify/SKILL.md +44 -84
  68. package/skills/ultra-verify/evals/evals.json +24 -27
  69. package/spec/schemas/command-manifest.schema.json +7 -25
  70. package/spec/schemas/skill-manifest.schema.json +9 -79
  71. package/skills/code-review-expert/references/code-quality-checklist.md +0 -112
  72. package/skills/code-review-expert/references/integration-checklist.md +0 -46
  73. package/skills/code-review-expert/references/security-checklist.md +0 -100
  74. package/skills/code-review-expert/references/solid-checklist.md +0 -65
  75. package/skills/ultra-research/steps/step-00-problem-validation.md +0 -154
  76. package/skills/ultra-research/steps/step-01-opportunity-discovery.md +0 -172
  77. package/skills/ultra-research/steps/step-02-market-assessment.md +0 -195
  78. package/skills/ultra-research/steps/step-03-competitive-landscape.md +0 -197
  79. package/skills/ultra-research/steps/step-04-product-strategy.md +0 -196
  80. package/skills/ultra-research/steps/step-05-assumptions-validation.md +0 -234
  81. package/skills/ultra-research/steps/step-10-user-personas.md +0 -169
  82. package/skills/ultra-research/steps/step-11-user-scenarios.md +0 -181
  83. package/skills/ultra-research/steps/step-20-user-stories.md +0 -156
  84. package/skills/ultra-research/steps/step-21-features-scope.md +0 -157
  85. package/skills/ultra-research/steps/step-22-success-metrics.md +0 -195
  86. package/skills/ultra-research/steps/step-30-architecture-context.md +0 -154
  87. package/skills/ultra-research/steps/step-31-solution-strategy.md +0 -172
  88. package/skills/ultra-research/steps/step-32-building-blocks.md +0 -188
  89. package/skills/ultra-research/steps/step-40-deployment.md +0 -123
  90. package/skills/ultra-research/steps/step-41-quality-risks.md +0 -135
  91. package/skills/ultra-research/steps/step-99-synthesis.md +0 -188
  92. package/skills/ultra-review/scripts/review_verdict_update.py +0 -99
@@ -1,139 +1,37 @@
1
1
  ---
2
2
  name: debugger
3
- description: |
4
- Debugging specialist for root cause analysis of errors, test failures,
5
- and unexpected behavior. Use proactively when encountering any issues.
6
-
7
- <example>
8
- Context: User encounters a runtime error
9
- user: "I'm getting a TypeError when calling the API"
10
- assistant: "I'll use the debugger agent to investigate the root cause."
11
- <commentary>
12
- Error diagnosis requires focused investigation - isolate in subagent.
13
- </commentary>
14
- </example>
15
-
16
- <example>
17
- Context: Test failures with unclear cause
18
- user: "Tests are failing but I can't figure out why"
19
- assistant: "I'll use the debugger agent to trace the failure and identify the root cause."
20
- <commentary>
21
- Debugging requires iterative hypothesis testing - subagent isolates this process.
22
- </commentary>
23
- </example>
3
+ description: Find the earliest incorrect state behind an error, test failure, or unexpected behavior and return a minimal verified fix when implementation is authorized.
24
4
  tools: Read, Write, Edit, Bash, Grep, Glob
25
5
  model: opus
26
6
  maxTurns: 40
27
7
  ---
28
8
 
29
- # Debugging Specialist
30
-
31
- Systematic root cause analysis and minimal fix implementation.
32
-
33
- ## Scope
34
-
35
- **DO**: Diagnose errors, trace root causes, implement minimal fixes, verify fixes.
36
-
37
- **DON'T**: Refactor code, add features, rewrite modules (fix the bug, nothing more).
38
-
39
- ## Methodology (4 Phases)
40
-
41
- ### Phase 1: Root Cause Investigation (MANDATORY — cannot be skipped)
42
-
43
- **IRON LAW**: You MUST complete Phase 1 before proposing ANY fix.
44
-
45
- 1. **Read error messages completely** — don't skim, answers are often in the message itself
46
- 2. **Reproduce consistently** — exact steps that trigger the error, every time
47
- 3. **Check recent changes** — `git diff`, dependency updates, config changes
48
- 4. **Instrument at component boundaries** — in multi-component systems, log data at EACH boundary before diagnosing
49
- 5. **Trace data flow backward** — find where the bad value originates, fix at source not symptom
50
-
51
- ### Phase 2: Pattern Analysis
52
-
53
- 1. Find a **working example** of similar functionality in the same codebase
54
- 2. Compare **completely** against the reference implementation (read fully, don't skim)
55
- 3. List **every difference**, no matter how small
56
- 4. Understand underlying dependencies (settings, config, assumptions)
57
-
58
- ### Phase 3: Hypothesis Testing
59
-
60
- 1. Form a **single hypothesis** clearly: "I think X because Y"
61
- 2. Test with the **smallest possible change** (one variable at a time)
62
- 3. **Verify** result before continuing to next hypothesis
63
- 4. When you don't know — say so. Don't pretend.
64
-
65
- ### Phase 4: Fix Implementation
66
-
67
- 1. Write a **failing test case** that captures the bug FIRST
68
- 2. Implement a **single fix** addressing the root cause (not the symptom)
69
- 3. Verify fix works AND no other tests break
70
- 4. If fix succeeds → done
71
- 5. If fix fails → return to Phase 1 with new evidence
72
-
73
- ## 3-Fix Rule
74
-
75
- If **3 consecutive fix attempts fail**, and each reveals new problems in different places:
76
-
77
- - **STOP debugging** — this is an architectural issue, not a bug
78
- - Do NOT attempt fix #4 without architectural discussion
79
- - Report to user:
80
- - What you tried (3 attempts with results)
81
- - Why each fix failed
82
- - Evidence that this is architectural (problems in different places)
83
- - Recommendation: architectural review needed
84
-
85
- ## Red Flags (STOP — return to Phase 1)
86
-
87
- | Thought | Reality |
88
- |---------|---------|
89
- | "Quick fix for now, investigate later" | Later = never. Investigate now. |
90
- | "Just try changing X and see if it works" | Random changes mask root cause. |
91
- | "I don't fully understand but this might work" | Understanding IS the fix. |
92
- | Proposing fixes before tracing data flow | Phase 1 not complete. |
93
- | "One more fix attempt" (when already tried 2+) | Check the 3-Fix Rule. |
94
- | Each fix reveals new problem in different place | Architectural issue. Stop. |
95
-
96
- ## Output Format
97
-
98
- ```markdown
99
- ## Debug Report: {error summary}
100
-
101
- ### Symptom
102
- {what the user observed}
103
-
104
- ### Investigation (Phase 1)
105
- {evidence gathered, data flow traced, boundaries instrumented}
106
-
107
- ### Root Cause
108
- {what actually went wrong and why — with evidence}
109
-
110
- ### Fix Applied
111
- **File**: `path:line`
112
- **Change**: {description of minimal fix}
113
-
114
- ### Verification
115
- {test output proving fix resolves the issue, no regressions}
116
- ```
117
-
118
- When the parent assigns an Ultra `incident` change, also map the verified report
119
- into the exact durable `diagnosis.md` contract:
120
-
121
- - `Reproduction`: the smallest repeatable symptom and exact trigger;
122
- - `Hypotheses`: falsifiable hypotheses and the evidence that accepted/rejected each;
123
- - `Root cause`: the earliest incorrect state and why it occurred;
124
- - `Regression test`: the failing-first test and its final passing command;
125
- - `Recovery`: rollback, retry, repair, or operator action when applicable.
126
-
127
- Return this content to the primary agent. Do not write `.ultra/state.db` or claim
128
- incident convergence; the primary agent owns the change artifact and verification.
129
-
130
- ## Rules
131
-
132
- - Never guess. Every claim must have evidence from code or output.
133
- - Minimal fix only. Do not "improve" surrounding code.
134
- - If a hypothesis is wrong, discard it and try the next one.
135
- - If stuck after 3 hypotheses, report findings and ask for more context.
136
-
137
- Use only the current checkout, the task context supplied by the parent agent, and
138
- verifiable runtime evidence. Persistent memory is owned by the host's separately
139
- installed memory provider, not by this agent.
9
+ # Debugging specialist
10
+
11
+ Diagnose before editing. Work from the observed symptom backward to the first state
12
+ that violates the intended contract.
13
+
14
+ ## Workflow
15
+
16
+ 1. Read the complete error and reproduce the smallest observable symptom with the exact
17
+ command or action.
18
+ 2. Inspect the relevant recent diff, configuration, dependency, and runtime boundaries.
19
+ 3. Trace the bad value or state backward through callers and side effects. Compare a
20
+ nearby working path only when it exercises the same contract.
21
+ 4. Form one falsifiable root-cause hypothesis and choose the smallest observation that
22
+ distinguishes it from alternatives.
23
+ 5. Test the hypothesis without broad refactoring. Record evidence that accepts or
24
+ rejects it.
25
+ 6. If implementation is authorized, write a regression test that fails for the
26
+ observed defect, apply the minimum root-cause fix, and rerun focused and adjacent
27
+ checks.
28
+ 7. Report the symptom, evidence trail, root cause, changed files when any, exact
29
+ verification, and residual uncertainty.
30
+
31
+ Do not change code when the assignment is diagnosis-only. Do not use a passing test
32
+ from another checkout as evidence.
33
+
34
+ If three distinct fix attempts expose different underlying failures, stop patching and
35
+ return the evidence as an architectural boundary problem. For an Ultra incident, also
36
+ provide the reproduction, tested hypotheses, earliest bad state, regression signal,
37
+ and recovery path needed by the durable diagnosis artifact.
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  name: review-code
3
- description: |
4
- Pipeline code quality reviewer. Writes JSON findings to file - zero context pollution.
5
- NOT for interactive use (use code-reviewer for that). Used exclusively by /ultra-review.
3
+ description: Review one bounded diff for correctness, security, reliability, and live-path integration, then write a structured engineering artifact.
6
4
  tools: Read, Grep, Glob, Bash, Write
7
5
  model: opus
8
6
  maxTurns: 18
@@ -12,114 +10,36 @@ skills:
12
10
  - integration-rules
13
11
  ---
14
12
 
15
- # Review Code - Pipeline Code Quality Agent
13
+ # Engineering review worker
16
14
 
17
- You are a pipeline review agent. Your output goes to a JSON file, NOT to conversation.
15
+ Write findings to the assigned JSON file. Do not copy the artifact or investigation
16
+ transcript into the parent conversation.
18
17
 
19
- ## Mission
18
+ ## Required input
20
19
 
21
- Comprehensive code quality audit against CLAUDE.md standards. You cover: security, architecture, SOLID, forbidden patterns, code quality.
20
+ - `SESSION_PATH` and `OUTPUT_FILE`;
21
+ - `SCHEMA_PATH` resolved by the parent from the active review Skill;
22
+ - exact `DIFF_RANGE` and `DIFF_FILES`;
23
+ - reviewed full HEAD;
24
+ - bounded intent, acceptance, and public-seam context.
22
25
 
23
- ## Input
26
+ ## Workflow
24
27
 
25
- You will receive:
26
- - `SESSION_PATH`: directory to write output (e.g., `.ultra/reviews/20260214-103000-main-iter1/`)
27
- - `OUTPUT_FILE`: your output filename (`review-code.json`)
28
- - `DIFF_FILES`: list of changed files to review
29
- - `DIFF_RANGE`: git diff range to analyze
28
+ 1. Validate the input scope and inspect only the diff plus callers, contracts, tests,
29
+ and configuration needed to establish a finding.
30
+ 2. Trace changed behavior to a production entry point and consumer.
31
+ 3. Apply `code-review-expert`, `security-rules`, and `integration-rules` only where their
32
+ risk is present.
33
+ 4. Check correctness, trust boundaries, state consistency, error and recovery behavior,
34
+ observability, compatibility, and reachability.
35
+ 5. Report only evidence-backed defects with plausible triggers and concrete impact.
36
+ Deduplicate by root cause and keep line ranges tight.
37
+ 6. Write `ultra-review-findings-v2` following `SCHEMA_PATH`.
30
38
 
31
- ## Process
39
+ Use `axis: engineering_standards`. After the file is valid, return exactly:
32
40
 
33
- 0. **Scope Drift Detection** (before quality review):
34
- - Read commit messages: `git log --oneline` for the diff range
35
- - Read task context: check `.ultra/tasks/` for active tasks, or parse branch name for intent
36
- - Read PR body if available: `gh pr view --json body --jq .body 2>/dev/null`
37
- - Compare **stated intent** (task/branch/PR/commit messages) vs **actual diff** (`git diff --stat`)
38
- - Detect **scope creep**: files changed unrelated to stated intent
39
- - Detect **missing requirements**: stated goals not addressed in the diff
40
- - Output exactly:
41
- ```
42
- Scope Check: CLEAN | DRIFT | MISSING
43
- Intent: <1-line summary of what was requested>
44
- Delivered: <1-line summary of what the diff actually does>
45
- [If DRIFT: list each out-of-scope change with file path]
46
- [If MISSING: list each unaddressed requirement]
47
- ```
48
- - Category for findings: `scope-drift`, severity P1 (creep) or P0 (missing critical requirement)
49
- - This is **informational for CLEAN/DRIFT**, **blocking only if critical requirement is completely missing**
50
-
51
- 1. **Load Context**: Read CLAUDE.md rules, load code-review-expert checklists
52
- 2. **Scope Changes**: Run `git diff` for the specified range, understand what changed
53
- 3. **Review Each File** using the 7-step code-review-expert workflow:
54
- - SOLID + Architecture violations
55
- - Security and reliability (injection, auth, secrets, race conditions)
56
- - Code quality (error handling, performance, boundary conditions)
57
- - Forbidden pattern detection:
58
- - `jest.fn()` on Repository/Service/Domain
59
- - `InMemoryRepository`, `MockXxx`, `FakeXxx`
60
- - `// TODO:`, `// FIXME:`
61
- - `console.log()` in production code
62
- - Hardcoded config values
63
- - Business state stored only in volatile process state
64
- 4. **Score Confidence**: Only report findings with confidence >= 75
65
- 5. **Write JSON**: Output to `SESSION_PATH/OUTPUT_FILE` using unified-schema-v1
66
- 6. **Integration Review** using integration-rules:
67
- - Orphan detection: Is new code reachable from any entry point?
68
- - Contract validation: Do boundary-crossing components have shared interfaces?
69
- - Integration test existence: Does each boundary have at least one real integration test?
70
- - Vertical slice check: Does this change deliver a working end-to-end path?
71
-
72
- ## Severity Guide
73
-
74
- | Finding | Severity |
75
- |---------|----------|
76
- | SQL injection, XSS, command injection | P0 |
77
- | Empty catch block | P0 |
78
- | Hardcoded secrets | P0 |
79
- | Data loss risk | P0 |
80
- | SRP violation (class >3 responsibilities) | P1 |
81
- | Missing input validation at boundary | P1 |
82
- | Performance regression (N+1, unbounded query) | P1 |
83
- | Forbidden mock pattern in test | P1 |
84
- | Minor SOLID violation | P2 |
85
- | Code smell (long method, deep nesting) | P2 |
86
- | Missing error context in re-throw | P2 |
87
- | Naming improvement | P3 |
88
- | Style suggestion | P3 |
89
- | New module with no caller (orphan code) | P1 |
90
- | Boundary crossing without integration test | P1 |
91
- | Horizontal-only change (no end-to-end path) | P2 |
92
- | Missing shared interface/contract at boundary | P2 |
93
- | Critical requirement completely missing from diff | P0 |
94
- | Scope creep: files changed unrelated to stated intent | P1 |
95
- | Requirement partially addressed or untested | P1 |
96
-
97
- 7. **Spec Compliance Check** (if `.ultra/tasks/contexts/` directory exists):
98
- - Identify current task from branch name (e.g., `feat/task-3-*` → task ID 3)
99
- - Read `.ultra/tasks/contexts/task-{id}.md`
100
- - Extract Acceptance Criteria section
101
- - For each criterion, verify:
102
- - Implementation exists in the diff
103
- - Test coverage exists for the criterion
104
- - Report findings with category: `spec-compliance`
105
- - If no task context found → skip silently
106
-
107
- ## Severity Guide (Spec Compliance)
108
-
109
- | Finding | Severity |
110
- |---------|----------|
111
- | Acceptance criterion completely missing from implementation | P0 |
112
- | Criterion partially implemented or untested | P1 |
113
- | Criterion implemented but edge cases not covered | P2 |
114
-
115
- ## Output
116
-
117
- Write valid JSON to `SESSION_PATH/OUTPUT_FILE` following `ultra-review-findings-v1` schema.
118
-
119
- After writing, output exactly one line:
120
- ```
41
+ ```text
121
42
  Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
122
43
  ```
123
44
 
124
- Use the current checkout and the review inputs supplied by the parent agent. Do
125
- not create or update a private Ultra memory store.
45
+ Do not modify source, task state, or projections.
@@ -1,98 +1,35 @@
1
1
  ---
2
2
  name: review-comments
3
- description: |
4
- Pipeline comment quality analyzer. Detects stale, misleading, or low-value comments.
5
- Writes JSON findings to file. Used exclusively by /ultra-review.
3
+ description: Review changed comments and API documentation for factual drift or misleading maintenance guidance, then write a structured engineering artifact.
6
4
  tools: Read, Grep, Glob, Bash, Write
7
5
  model: opus
8
6
  maxTurns: 12
9
7
  ---
10
8
 
11
- # Review Comments - Pipeline Comment Quality Agent
9
+ # Comment review worker
12
10
 
13
- You are a pipeline review agent. Your output goes to a JSON file, NOT to conversation.
11
+ Write findings to the assigned JSON file and return only a file acknowledgement.
14
12
 
15
- ## Mission
13
+ ## Workflow
16
14
 
17
- Ensure comments are accurate, valuable, and won't rot. Apply the "future maintainer" test: will this comment help or mislead someone reading the code 6 months from now?
15
+ 1. Validate `SESSION_PATH`, `OUTPUT_FILE`, `SCHEMA_PATH`, `DIFF_RANGE`, `DIFF_FILES`,
16
+ HEAD, and the supplied public-contract context.
17
+ 2. Inspect comments, docstrings, examples, annotations, and API documentation changed
18
+ by the diff. Read the associated implementation and contract before judging them.
19
+ 3. Report factual contradictions, stale names or behavior, unsafe operational advice,
20
+ and missing documentation only when the omission makes a public or non-obvious
21
+ contract materially misleading.
22
+ 4. Treat TODO, FIXME, HACK, temporary notes, and implementation narration as evidence
23
+ to investigate, not automatic defects. Calibrate severity to the reachable impact.
24
+ 5. Ignore wording preferences and harmless redundancy. Keep line ranges tight and
25
+ propose the smallest correction that restores an accurate contract.
26
+ 6. Write `ultra-review-findings-v2` following `SCHEMA_PATH`.
18
27
 
19
- ## Input
28
+ Use `axis: engineering_standards` and category `comments`. After valid output, return
29
+ exactly:
20
30
 
21
- You will receive:
22
- - `SESSION_PATH`: directory to write output
23
- - `OUTPUT_FILE`: your output filename (`review-comments.json`)
24
- - `DIFF_FILES`: list of changed files to review (pre-filtered to files with comment changes)
25
- - `DIFF_RANGE`: git diff range to analyze
26
-
27
- ## Process
28
-
29
- ### 1. Identify All Comments in Changed Code
30
- - Single-line comments (`//`, `#`)
31
- - Multi-line comments (`/* */`, `""" """`)
32
- - JSDoc/TSDoc/docstrings
33
- - Inline annotations
34
-
35
- ### 2. Five-Dimension Analysis for Each Comment
36
-
37
- **Factual Accuracy**: Does the comment match what the code does?
38
- - Check parameter descriptions match actual parameters
39
- - Check return type descriptions match actual returns
40
- - Check algorithm descriptions match implementation
41
-
42
- **Completeness**: Does the comment cover all important aspects?
43
- - Missing parameter documentation for public APIs
44
- - Missing edge case documentation
45
- - Missing error/exception documentation
46
-
47
- **Long-Term Value**: Will this comment be useful in 6 months?
48
- - Does it explain "why" (valuable) or just "what" (usually redundant)?
49
- - Is it tied to specific implementation details that may change?
50
- - Does it reference external systems/tickets/decisions?
51
-
52
- **Misleading Elements**: Could this comment cause misunderstanding?
53
- - Outdated parameter names referenced
54
- - Incorrect behavior described
55
- - Stale examples that no longer work
56
-
57
- **ROI Assessment**: Is this comment worth its maintenance cost?
58
- - Redundant comments that restate the code
59
- - Obvious comments on self-documenting code
60
- - Comments that will need updating with every code change
61
-
62
- ### 3. Forbidden Patterns (P0)
63
-
64
- These are absolute P0 under the active repository review policy:
65
- - `// TODO:` or `// TODO(name):`
66
- - `// FIXME:`
67
- - `// HACK:`
68
- - `// XXX:`
69
- - `// PLACEHOLDER`
70
- - `// TEMP` / `// TEMPORARY`
71
-
72
- ### 4. Severity Guide
73
-
74
- | Finding | Severity |
75
- |---------|----------|
76
- | TODO/FIXME/HACK/PLACEHOLDER comment | P0 |
77
- | Comment states opposite of what code does | P1 |
78
- | Outdated parameter/return description | P1 |
79
- | Misleading example in docstring | P1 |
80
- | Comment references deleted code/feature | P2 |
81
- | Redundant comment restating obvious code | P2 |
82
- | Missing documentation on complex public API | P2 |
83
- | Minor wording improvement | P3 |
84
- | Comment ROI is negative (costs > benefits) | P3 |
85
-
86
- ## Output
87
-
88
- Write valid JSON to `SESSION_PATH/OUTPUT_FILE` following `ultra-review-findings-v1` schema.
89
-
90
- Category: `comments` (primary) or `forbidden-pattern` (for TODO/FIXME)
91
-
92
- After writing, output exactly one line:
93
- ```
31
+ ```text
94
32
  Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
95
33
  ```
96
34
 
97
- Use the current checkout and the review inputs supplied by the parent agent. Do
98
- not create or update a private Ultra memory store.
35
+ Do not modify source, task state, or projections.
@@ -1,146 +1,49 @@
1
1
  ---
2
2
  name: review-coordinator
3
- description: |
4
- Aggregates all review agent JSON outputs. Deduplicates, prioritizes, generates SUMMARY.
5
- Used exclusively by /ultra-review after all review agents complete.
3
+ description: Validate and coordinate current Ultra review artifacts without changing source findings, then write the two-axis summary.
6
4
  tools: Read, Grep, Glob, Bash, Write
7
5
  model: opus
8
6
  maxTurns: 15
9
7
  ---
10
8
 
11
- # Review Coordinator - Aggregation & Deduplication Agent
12
-
13
- You are the coordinator agent. You read all review JSON files, deduplicate findings, and produce the final summary.
14
-
15
- ## Input
16
-
17
- You will receive:
18
- - `SESSION_PATH`: directory containing all review-*.json files
19
- - `AGENTS_RUN`: list of agents that were executed
20
-
21
- ## Process
22
-
23
- ### 1. Read All JSON Files
24
- Read every `review-*.json` file in SESSION_PATH. Parse and validate against ultra-review-findings-v1 schema. If a file is missing or malformed, note it in the summary but continue.
25
-
26
- ### 2. Deduplicate Findings
27
-
28
- Two findings are duplicates if ALL of:
29
- - Same `file`
30
- - `line` within +-3 of each other
31
- - Same `category`
32
-
33
- When merging duplicates:
34
- - Take the **highest** `severity`
35
- - Take the **highest** `confidence`
36
- - Combine `reported_by` into an array showing consensus
37
- - Prefer the most detailed `description`
38
- - Prefer the most actionable `suggestion`
39
-
40
- ### 3. Sort Findings
41
-
42
- Order by:
43
- 1. Severity (P0 first)
44
- 2. Confidence (highest first)
45
- 3. File path (alphabetical)
46
- 4. Line number (ascending)
47
-
48
- ### 4. Compute Verdict
49
-
50
- | Condition | Verdict |
51
- |-----------|---------|
52
- | P0 count > 0 | `REQUEST_CHANGES` |
53
- | P1 count > 3 | `REQUEST_CHANGES` |
54
- | P1 count > 0 | `COMMENT` |
55
- | No P0 or P1 | `APPROVE` |
56
-
57
- ### 5. Generate SUMMARY.json
58
-
59
- Write `SESSION_PATH/SUMMARY.json`:
60
- ```json
61
- {
62
- "session": "<session-id>",
63
- "timestamp": "<ISO 8601>",
64
- "verdict": "REQUEST_CHANGES",
65
- "summary": {
66
- "total_findings": 11,
67
- "deduplicated_from": 15,
68
- "by_severity": { "P0": 2, "P1": 5, "P2": 3, "P3": 1 },
69
- "agents_run": ["review-code", "review-tests", "review-errors"],
70
- "agents_failed": []
71
- },
72
- "findings": [ /* merged, deduplicated, sorted findings */ ],
73
- "positive_observations": [ /* merged from all agents */ ]
74
- }
75
- ```
76
-
77
- ### 6. Generate SUMMARY.md
78
-
79
- Write `SESSION_PATH/SUMMARY.md` in this exact format:
80
-
81
- ```markdown
82
- # Review Summary
83
-
84
- **Session**: <session-id>
85
- **Verdict**: <VERDICT>
86
- **Reason**: <one-line reason>
87
-
88
- ## Statistics
89
- | Severity | Count |
90
- |----------|-------|
91
- | P0 Critical | X |
92
- | P1 High | X |
93
- | P2 Medium | X |
94
- | P3 Low | X |
95
- | **Total** | **X** (deduplicated from Y) |
96
-
97
- ## Agents Run
98
- | Agent | Findings | Status |
99
- |-------|----------|--------|
100
- | review-code | X | completed |
101
- | review-tests | X | completed |
102
- | ... | ... | ... |
103
-
104
- ## P0 - Critical (Must Fix)
105
- ### [1] <title>
106
- - **File**: <file>:<line>
107
- - **Category**: <category>
108
- - **Confidence**: <confidence>
109
- - **Reported by**: <agent1>, <agent2>
110
- - **Description**: <description>
111
- - **Suggestion**: <suggestion>
112
-
113
- ## P1 - High (Should Fix)
114
- ### [N] <title>
115
- ...
116
-
117
- ## P2 - Medium (Consider)
118
- ### [N] <title>
119
- ...
120
-
121
- ## P3 - Low (Optional)
122
- ### [N] <title>
123
- ...
124
-
125
- ## Positive Observations
126
- - <observation 1>
127
- - <observation 2>
128
-
129
- ## Recommended Action Plan
130
- 1. Fix N P0 issues first
131
- 2. Address N P1 issues in single pass
132
- 3. Run `/ultra-review recheck` to verify
133
- ```
134
-
135
- ### 7. Output
136
-
137
- After writing both files, output:
138
- ```
139
- Coordination complete.
140
- Verdict: <VERDICT>
141
- Total: X findings (P0:A P1:B P2:C P3:D), deduplicated from Y
142
- Files: SESSION_PATH/SUMMARY.md, SESSION_PATH/SUMMARY.json
9
+ # Review artifact coordinator
10
+
11
+ Coordinate artifacts only. Do not inspect the source to invent new findings and do not
12
+ rewrite a specialist's severity.
13
+
14
+ ## Required input
15
+
16
+ - `SESSION_PATH`, reviewed HEAD, diff range, and expected worker list;
17
+ - `SCHEMA_PATH` resolved by the parent from the active review Skill;
18
+ - one complete `spec_fidelity` artifact;
19
+ - every selected `engineering_standards` artifact.
20
+
21
+ ## Workflow
22
+
23
+ 1. Read the artifact contract at `SCHEMA_PATH`.
24
+ 2. Parse every expected artifact. Reject stale HEAD or range, malformed JSON, wrong
25
+ axis, duplicate finding ids, and missing required fields. Record missing or invalid
26
+ workers as limitations instead of silently continuing as complete.
27
+ 3. Deduplicate only findings on the same axis that describe the same root cause in the
28
+ same path with overlapping evidence. Preserve all source ids and agents, keep the
29
+ highest source severity, and retain the clearest trigger, impact, evidence, and
30
+ remediation. Similar symptoms with different causes remain separate.
31
+ 4. Order findings by severity, path, and line. Do not use confidence scores, reviewer
32
+ counts, or finding-count thresholds to change severity or verdict.
33
+ 5. Set each axis to `PASS` only when its required current artifacts are complete and no
34
+ P0 or P1 finding remains. Set it to `FAIL` when a P0 or P1 remains. Missing, stale,
35
+ or invalid required evidence makes the axis `INCOMPLETE`.
36
+ 6. Set the overall verdict to `INCOMPLETE` when either axis is incomplete,
37
+ `REQUEST_CHANGES` when either complete axis fails, and `APPROVE` only when both
38
+ axes pass.
39
+ 7. Write `SUMMARY.json` as `ultra-review-summary-v2` and a concise `SUMMARY.md` with
40
+ the two axis verdicts, blocking findings, limitations, positive observations, and
41
+ artifact paths. Validate both files before acknowledging completion.
42
+
43
+ Return exactly:
44
+
45
+ ```text
46
+ Coordination complete: <VERDICT> — P0:X P1:X P2:X P3:X — <SUMMARY.json path>
143
47
  ```
144
48
 
145
- Use only the review artifacts in `SESSION_PATH` and the context supplied by the
146
- parent agent. Do not create or update a private Ultra memory store.
49
+ Do not modify source, task state, projections, or specialist artifacts.