ultra-builder-pro-cli 0.9.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 (119) hide show
  1. package/CHANGELOG.md +92 -1
  2. package/README.md +11 -6
  3. package/adapters/_shared/codex-assets.cjs +23 -331
  4. package/adapters/_shared/handbook.cjs +2 -0
  5. package/adapters/_shared/runtime-assets.cjs +25 -0
  6. package/adapters/_shared/tests/handbook.test.cjs +3 -0
  7. package/adapters/_shared/tests/runtime-assets.test.cjs +12 -4
  8. package/adapters/claude.js +28 -5
  9. package/adapters/kimi.js +15 -138
  10. package/adapters/opencode.js +59 -63
  11. package/adapters/tests/claude.test.cjs +26 -9
  12. package/adapters/tests/codex.test.cjs +23 -9
  13. package/adapters/tests/kimi.test.cjs +15 -11
  14. package/adapters/tests/opencode.test.cjs +57 -10
  15. package/agents/code-reviewer.md +24 -85
  16. package/agents/debugger.md +30 -132
  17. package/agents/review-code.md +24 -104
  18. package/agents/review-comments.md +20 -83
  19. package/agents/review-coordinator.md +40 -137
  20. package/agents/review-design.md +21 -118
  21. package/agents/review-errors.md +22 -70
  22. package/agents/review-spec.md +36 -0
  23. package/agents/review-tests.md +20 -76
  24. package/agents/tdd-runner.md +26 -84
  25. package/commands/learn.md +5 -36
  26. package/commands/ultra-change.md +5 -43
  27. package/commands/ultra-deliver.md +4 -46
  28. package/commands/ultra-dev.md +4 -48
  29. package/commands/ultra-doctor.md +4 -30
  30. package/commands/ultra-init.md +5 -47
  31. package/commands/ultra-plan.md +5 -48
  32. package/commands/ultra-research.md +5 -54
  33. package/commands/ultra-status.md +5 -44
  34. package/commands/ultra-test.md +5 -45
  35. package/commands/ultra-think.md +5 -40
  36. package/docs/AGENT-CONTEXT.md +34 -12
  37. package/docs/ARCHITECTURE.md +31 -5
  38. package/docs/PLAN.zh-CN.md +3 -2
  39. package/docs/ROADMAP.md +5 -4
  40. package/docs/RUNTIME-COMPAT-MATRIX.md +7 -5
  41. package/docs/SKILL-AUTHORING.md +75 -0
  42. package/docs/USER-HANDBOOK-CONTRACT.md +9 -2
  43. package/hooks/README.md +6 -4
  44. package/hooks/active_task_context.py +14 -0
  45. package/hooks/context_spine.py +218 -0
  46. package/hooks/health_check.py +1 -1
  47. package/hooks/workflow_context.py +16 -123
  48. package/hooks/workflow_resume.py +21 -0
  49. package/mcp-server/lib/change-workflow.cjs +89 -11
  50. package/mcp-server/lib/change-workflow.test.cjs +202 -7
  51. package/mcp-server/lib/context-spine.cjs +331 -0
  52. package/mcp-server/lib/context-spine.test.cjs +73 -0
  53. package/mcp-server/lib/spec-learning.cjs +191 -0
  54. package/mcp-server/lib/spec-learning.test.cjs +62 -0
  55. package/mcp-server/lib/state-db.cjs +72 -10
  56. package/mcp-server/lib/state-db.test.cjs +7 -2
  57. package/mcp-server/server.cjs +31 -1
  58. package/mcp-server/tests/db-ops.test.cjs +3 -3
  59. package/mcp-server/tests/server-contract.test.cjs +74 -0
  60. package/mcp-server/tests/state-db.test.cjs +20 -3
  61. package/package.json +3 -2
  62. package/skills/cc-collab/SKILL.md +16 -18
  63. package/skills/code-review-expert/SKILL.md +39 -114
  64. package/skills/code-review-expert/references/correctness-reliability.md +30 -0
  65. package/skills/code-review-expert/references/design-boundaries.md +26 -0
  66. package/skills/code-review-expert/references/removal-plan.md +17 -45
  67. package/skills/codex-collab/SKILL.md +23 -28
  68. package/skills/codex-collab/evals/evals.json +18 -23
  69. package/skills/integration-rules/SKILL.md +28 -67
  70. package/skills/learn/SKILL.md +46 -105
  71. package/skills/security-rules/SKILL.md +34 -56
  72. package/skills/testing-rules/SKILL.md +28 -52
  73. package/skills/ultra-change/SKILL.md +61 -145
  74. package/skills/ultra-deliver/SKILL.md +63 -229
  75. package/skills/ultra-dev/SKILL.md +46 -338
  76. package/skills/ultra-doctor/SKILL.md +39 -71
  77. package/skills/ultra-init/SKILL.md +59 -139
  78. package/skills/ultra-plan/SKILL.md +50 -310
  79. package/skills/ultra-research/SKILL.md +59 -152
  80. package/skills/ultra-research/references/architecture.md +38 -0
  81. package/skills/ultra-research/references/problem-product.md +39 -0
  82. package/skills/ultra-research/references/quality-delivery.md +34 -0
  83. package/skills/ultra-research/references/synthesis.md +38 -0
  84. package/skills/ultra-research/references/users-scope.md +40 -0
  85. package/skills/ultra-review/SKILL.md +55 -427
  86. package/skills/ultra-review/references/unified-schema.md +76 -101
  87. package/skills/ultra-review/scripts/review_wait.py +242 -77
  88. package/skills/ultra-status/SKILL.md +38 -173
  89. package/skills/ultra-test/SKILL.md +41 -195
  90. package/skills/ultra-think/SKILL.md +43 -101
  91. package/skills/ultra-verify/SKILL.md +44 -84
  92. package/skills/ultra-verify/evals/evals.json +24 -27
  93. package/spec/cli-protocol.md +3 -0
  94. package/spec/mcp-tools.yaml +133 -4
  95. package/spec/schemas/command-manifest.schema.json +7 -25
  96. package/spec/schemas/skill-manifest.schema.json +9 -79
  97. package/spec/schemas/state-db.sql +31 -0
  98. package/skills/code-review-expert/references/code-quality-checklist.md +0 -112
  99. package/skills/code-review-expert/references/integration-checklist.md +0 -46
  100. package/skills/code-review-expert/references/security-checklist.md +0 -100
  101. package/skills/code-review-expert/references/solid-checklist.md +0 -65
  102. package/skills/ultra-research/steps/step-00-problem-validation.md +0 -154
  103. package/skills/ultra-research/steps/step-01-opportunity-discovery.md +0 -172
  104. package/skills/ultra-research/steps/step-02-market-assessment.md +0 -195
  105. package/skills/ultra-research/steps/step-03-competitive-landscape.md +0 -197
  106. package/skills/ultra-research/steps/step-04-product-strategy.md +0 -196
  107. package/skills/ultra-research/steps/step-05-assumptions-validation.md +0 -234
  108. package/skills/ultra-research/steps/step-10-user-personas.md +0 -169
  109. package/skills/ultra-research/steps/step-11-user-scenarios.md +0 -181
  110. package/skills/ultra-research/steps/step-20-user-stories.md +0 -156
  111. package/skills/ultra-research/steps/step-21-features-scope.md +0 -157
  112. package/skills/ultra-research/steps/step-22-success-metrics.md +0 -195
  113. package/skills/ultra-research/steps/step-30-architecture-context.md +0 -154
  114. package/skills/ultra-research/steps/step-31-solution-strategy.md +0 -172
  115. package/skills/ultra-research/steps/step-32-building-blocks.md +0 -188
  116. package/skills/ultra-research/steps/step-40-deployment.md +0 -123
  117. package/skills/ultra-research/steps/step-41-quality-risks.md +0 -135
  118. package/skills/ultra-research/steps/step-99-synthesis.md +0 -188
  119. package/skills/ultra-review/scripts/review_verdict_update.py +0 -99
@@ -1,26 +1,23 @@
1
1
  ---
2
2
  name: cc-collab
3
- description: "Use Claude Code as an explicitly requested, read-only advisor for bounded architecture, diagnosis, or review questions. The current host remains primary and verifies all claims."
4
- argument-hint: "review|understand|opinion|compare|free [target]"
5
- user-invocable: true
3
+ description: Ask Claude Code for an independent read-only analysis of a bounded architecture, diagnosis, or review question. Use only when the user explicitly requests Claude Code or CC collaboration and the current host remains primary.
6
4
  ---
7
5
 
8
- # Claude Code Collaboration
6
+ # Consult Claude Code read-only
9
7
 
10
- Use Claude Code only when the user explicitly requests a Claude/CC perspective. The current host
11
- owns scope, evidence, decisions, edits, and final verification. Claude Code is an untrusted,
12
- read-only advisor.
8
+ Treat Claude Code as an untrusted advisor. The current host owns scope, evidence,
9
+ decisions, edits, and final verification.
13
10
 
14
11
  ## Preconditions
15
12
 
16
- 1. Confirm `claude --version` and authentication.
17
- 2. Bound the workspace, files or diff, question, and expected response shape.
18
- 3. Write the primary host's independent analysis first when independence matters.
19
- 4. Do not pass credentials, unrelated files, or an unbounded home directory.
13
+ 1. Confirm the `claude` CLI and authentication.
14
+ 2. Bound the workspace, files or diff, question, evidence standard, and response shape.
15
+ 3. Write the primary host's analysis first when independence matters.
16
+ 4. Exclude credentials, unrelated files, and unbounded home-directory access.
20
17
 
21
18
  ## Invocation
22
19
 
23
- Run Claude Code without mutation or session persistence:
20
+ Run without mutation or session persistence:
24
21
 
25
22
  ```bash
26
23
  claude --safe-mode -p "<bounded prompt>" \
@@ -30,12 +27,13 @@ claude --safe-mode -p "<bounded prompt>" \
30
27
  --no-session-persistence
31
28
  ```
32
29
 
33
- Store large output under `.ultra/collab/<session-id>/claude-output.md`. A missing CLI, failed auth,
34
- timeout, or empty response degrades to host-only analysis; it never blocks the task.
30
+ Store large output under `.ultra/collab/<session-id>/claude-output.md`. A missing CLI,
31
+ failed authentication, timeout, or empty response degrades to host-only analysis and
32
+ never blocks the underlying task.
35
33
 
36
34
  ## Synthesis
37
35
 
38
- - Verify consequential claims against the current checkout, runtime, tests, or primary docs.
39
- - Separate agreement, useful dissent, and unsupported assertions.
40
- - Explain scope or version mismatches before comparing conclusions.
41
- - Return one host-owned conclusion, not a transcript or a model vote.
36
+ Verify consequential claims against the current checkout, runtime, tests, or primary
37
+ documentation. Separate verified agreement, useful dissent, and unsupported claims.
38
+ Explain scope or version differences and return one host-owned conclusion rather than
39
+ a transcript or model vote.
@@ -1,118 +1,43 @@
1
1
  ---
2
2
  name: code-review-expert
3
- description: "Structured code review checklists: SOLID, security, performance, boundary conditions, removal planning. Injected into code-reviewer agent."
4
- user-invocable: false
3
+ description: Review a bounded diff for consequential correctness, security, integration, and maintainability defects with evidence and precise locations. Use only when assigned to an Ultra review worker or an explicitly requested read-only code review.
5
4
  ---
6
5
 
7
- # Code Review Expert Checklists
8
-
9
- Provides structured review workflow and reference checklists for the code-reviewer agent.
10
-
11
- ## Severity Levels
12
-
13
- | Level | Name | Description | Action |
14
- |-------|------|-------------|--------|
15
- | **P0** | Critical | Security vulnerability, data loss risk, correctness bug | Must block merge |
16
- | **P1** | High | Logic error, significant SOLID violation, performance regression | Should fix before merge |
17
- | **P2** | Medium | Code smell, maintainability concern, minor SOLID violation | Fix in this PR or create follow-up |
18
- | **P3** | Low | Style, naming, minor suggestion | Optional improvement |
19
-
20
- ## Review Workflow
21
-
22
- ### Step 1: Preflight Context
23
-
24
- - Run `git status -sb`, `git diff --stat`, and `git diff` to scope changes
25
- - Use `git diff --cached` to include staged changes
26
- - If needed, use Grep to find related modules, usages, and contracts
27
-
28
- **Edge cases:**
29
- - **No changes**: Inform user, ask if they want to review staged changes or a specific commit range
30
- - **Large diff (>500 lines)**: Summarize by file first, then review in batches by module/feature area
31
- - **Mixed concerns**: Group findings by logical feature, not just file order
32
-
33
- ### Step 2: SOLID + Architecture Smells
34
-
35
- Load `references/solid-checklist.md` for detailed prompts.
36
-
37
- Look for SRP/OCP/LSP/ISP/DIP violations and common code smells. When proposing refactor, explain *why* it improves cohesion/coupling. Non-trivial refactors get incremental plans, not large rewrites.
38
-
39
- ### Step 3: Removal Candidates
40
-
41
- Load `references/removal-plan.md` for template.
42
-
43
- Identify unused, redundant, or feature-flagged-off code. Distinguish **safe delete now** vs **defer with plan**. Provide follow-up steps with concrete checkpoints.
44
-
45
- ### Step 4: Security and Reliability
46
-
47
- Load `references/security-checklist.md` for coverage.
48
-
49
- Check injection, auth gaps, secrets, race conditions, crypto, supply chain. Call out both **exploitability** and **impact**.
50
-
51
- ### Step 5: Code Quality
52
-
53
- Load `references/code-quality-checklist.md` for coverage.
54
-
55
- Check error handling, performance/caching, boundary conditions. Flag issues that may cause silent failures or production incidents.
56
-
57
- ### Step 5.5: Integration & Connectivity
58
-
59
- Load `references/integration-checklist.md` for detailed prompts.
60
-
61
- Check entry point tracing, contract validation, vertical slice assessment, integration test coverage, and data flow continuity. Flag orphan code, missing contracts, and horizontal-only changes.
62
-
63
- ### Step 6: Output Format
64
-
65
- ```markdown
66
- ## Code Review Summary
67
-
68
- **Files reviewed**: X files, Y lines changed
69
- **Overall assessment**: [APPROVE / REQUEST_CHANGES / COMMENT]
70
-
71
- ---
72
-
73
- ## Findings
74
-
75
- ### P0 - Critical
76
- (none or list)
77
-
78
- ### P1 - High
79
- - **[file:line]** Brief title
80
- - Description of issue
81
- - Suggested fix
82
-
83
- ### P2 - Medium
84
- ...
85
-
86
- ### P3 - Low
87
- ...
88
-
89
- ---
90
-
91
- ## Removal/Iteration Plan
92
- (if applicable)
93
-
94
- ## Additional Suggestions
95
- (optional improvements, not blocking)
96
- ```
97
-
98
- ### Step 7: Next Steps Confirmation
99
-
100
- After presenting findings, ask how to proceed:
101
-
102
- 1. **Fix all** - Implement all suggested fixes
103
- 2. **Fix P0/P1 only** - Address critical and high priority issues
104
- 3. **Fix specific items** - User specifies which issues to fix
105
- 4. **No changes** - Review complete, no implementation needed
106
-
107
- **Important**: Do NOT implement any changes until user explicitly confirms.
108
-
109
- ## Additional Resources
110
-
111
- ### Reference Files
112
-
113
- For detailed patterns and checklists, consult:
114
- - **`references/solid-checklist.md`** - SOLID violation detection and refactor heuristics
115
- - **`references/security-checklist.md`** - Security, reliability, and race condition checks
116
- - **`references/code-quality-checklist.md`** - Error handling, performance, boundary conditions
117
- - **`references/removal-plan.md`** - Deletion candidates and iteration planning template
118
- - **`references/integration-checklist.md`** - Entry point tracing, contract validation, data flow continuity
6
+ # Review a bounded code change
7
+
8
+ Prioritize defects that can change behavior, safety, operability, or delivery. Do not
9
+ fill the report with style preferences or generic best-practice commentary.
10
+
11
+ ## Workflow
12
+
13
+ 1. Establish the exact diff, stated intent, acceptance evidence, current checkout, and
14
+ relevant repository guidance. If the scope is empty or ambiguous, report that
15
+ boundary instead of reviewing unrelated history.
16
+ 2. Trace changed behavior from a live entry point through state and side effects to a
17
+ consumer. Read callers, contracts, tests, and error paths needed to prove or refute
18
+ a finding.
19
+ 3. Load focused references only when their scope is present:
20
+ - `security-rules` for trust or authorization boundaries;
21
+ - `integration-rules` for cross-component behavior;
22
+ - `references/correctness-reliability.md` for a concrete behavioral risk;
23
+ - `references/design-boundaries.md` for a concrete ownership or coupling problem;
24
+ - `references/removal-plan.md` for code proposed for deletion.
25
+ 4. For every candidate finding, state the violated contract, triggering condition,
26
+ user or system impact, and evidence in the current source. Discard speculative
27
+ concerns that lack a plausible execution path.
28
+ 5. Assign severity from impact and likelihood:
29
+ - P0: exploitable security issue, data loss, or deterministic critical failure;
30
+ - P1: material correctness, authorization, reliability, or delivery failure;
31
+ - P2: bounded maintainability or edge-case defect with concrete future cost;
32
+ - P3: optional improvement that does not block the accepted outcome.
33
+ 6. Deduplicate findings by root cause and order them by severity, path, and line.
34
+
35
+ ## Finding contract
36
+
37
+ Each finding includes a concise title, severity, tight file and line range,
38
+ trigger, impact, evidence, and smallest complete remediation. Do not request a broad
39
+ rewrite when a local fix satisfies the contract.
40
+
41
+ If no actionable defect is supported, say so and name the remaining verification or
42
+ coverage gap. Review is read-only unless a separate implementation request explicitly
43
+ authorizes changes.
@@ -0,0 +1,30 @@
1
+ # Correctness and reliability evidence
2
+
3
+ Read this reference only when the diff changes behavior, state transitions, resource
4
+ use, concurrency, caching, parsing, or failure handling.
5
+
6
+ ## Establish the contract
7
+
8
+ Identify the input domain, preconditions, observable result, authoritative state, and
9
+ caller-visible failure behavior. Repository code, tests, schemas, runtime configuration,
10
+ and accepted specifications outrank generic conventions.
11
+
12
+ ## Trace material risks
13
+
14
+ Inspect only risks supported by the changed path:
15
+
16
+ - boundary values, empty or optional inputs, numeric range, encoding, and ordering;
17
+ - partial writes, lost updates, duplicate execution, retry, idempotency, and rollback;
18
+ - stale caches, key scope, invalidation, and cross-user or cross-tenant isolation;
19
+ - unbounded work, repeated I/O, resource lifetime, timeout, and cancellation;
20
+ - swallowed failures, false success, ambiguous fallback, and missing recovery signals;
21
+ - deployment-time compatibility between readers, writers, clients, and stored data.
22
+
23
+ A surface pattern is not a finding. Confirm the triggering condition, follow it to an
24
+ observable impact, and check whether a guard or recovery path exists elsewhere.
25
+
26
+ ## Report
27
+
28
+ State the violated contract, trigger, impact, current source evidence, and smallest
29
+ complete remediation. If scale or concurrency is required to trigger the issue, name
30
+ the evidence-backed operating condition instead of inventing a multiplier.
@@ -0,0 +1,26 @@
1
+ # Design boundary evidence
2
+
3
+ Read this reference only when the diff changes ownership, invariants, public contracts,
4
+ module boundaries, or a recurring variation point.
5
+
6
+ ## Questions grounded in the live path
7
+
8
+ - Which module owns the invariant and can callers bypass it?
9
+ - Does one authoritative representation exist, or can state diverge across layers?
10
+ - Is the dependency direction compatible with the repository's established boundary?
11
+ - Does a public contract expose implementation details that block a required consumer?
12
+ - Does the change duplicate a domain rule or scatter one accepted change across
13
+ unrelated owners?
14
+ - Is an abstraction justified by current callers and variants, or only hypothetical
15
+ future work?
16
+ - Can the behavior be tested and recovered at its public seam?
17
+
18
+ File size, method length, inheritance, primitive values, data-only types, and branch
19
+ counts are investigation signals. Report them only when they produce a concrete
20
+ correctness, compatibility, testing, recovery, or maintenance cost in this change.
21
+
22
+ ## Remediation
23
+
24
+ Prefer the smallest boundary correction that restores ownership and the accepted
25
+ contract. Do not prescribe a design pattern, framework, or broad rewrite without
26
+ showing why the existing repository structure cannot satisfy the requirement.
@@ -1,52 +1,24 @@
1
- # Removal and Iteration Plan Template
1
+ # Removal evidence
2
2
 
3
- ## Priority Levels
3
+ Read this reference only when the proposed change deletes or retires code, a contract,
4
+ configuration, data, or a dependency.
4
5
 
5
- - **P0**: Immediate removal needed (security risk, significant cost, blocking other work)
6
- - **P1**: Remove in current sprint
7
- - **P2**: Backlog / next iteration
6
+ ## Prove reachability and ownership
8
7
 
9
- ---
8
+ Search static references, registrations, dynamic loading, reflection, generated code,
9
+ configuration, feature flags, scripts, documentation, and external interfaces that may
10
+ consume the item. Distinguish no evidence of use from evidence of no use.
10
11
 
11
- ## Safe to Remove Now
12
+ ## Determine the safe action
12
13
 
13
- ### Item: [Name/Description]
14
+ Record:
14
15
 
15
- | Field | Details |
16
- |-------|---------|
17
- | **Location** | `path/to/file.ts:line` |
18
- | **Rationale** | Why this should be removed |
19
- | **Evidence** | Unused (no references), dead feature flag, deprecated API |
20
- | **Impact** | None / Low - no active consumers |
21
- | **Deletion steps** | 1. Remove code 2. Remove tests 3. Remove config |
22
- | **Verification** | Run tests, check no runtime errors, monitor logs |
16
+ - exact item and owner;
17
+ - current consumers and supporting evidence;
18
+ - compatibility, data, deployment, and operator impact;
19
+ - prerequisites for removal when a consumer or migration remains;
20
+ - focused deletion steps, verification, monitoring, and rollback.
23
21
 
24
- ---
25
-
26
- ## Defer Removal (Plan Required)
27
-
28
- ### Item: [Name/Description]
29
-
30
- | Field | Details |
31
- |-------|---------|
32
- | **Location** | `path/to/file.ts:line` |
33
- | **Why defer** | Active consumers, needs migration, stakeholder sign-off |
34
- | **Preconditions** | Feature flag off for 2 weeks, telemetry shows 0 usage |
35
- | **Breaking changes** | List any API/contract changes |
36
- | **Migration plan** | Steps for consumers to migrate |
37
- | **Timeline** | Target date or sprint |
38
- | **Owner** | Person/team responsible |
39
- | **Validation** | Metrics to confirm safe removal (error rates, usage counts) |
40
- | **Rollback plan** | How to restore if issues found |
41
-
42
- ---
43
-
44
- ## Checklist Before Removal
45
-
46
- - [ ] Searched codebase for all references (Grep)
47
- - [ ] Checked for dynamic/reflection-based usage
48
- - [ ] Verified no external consumers (APIs, SDKs, docs)
49
- - [ ] Feature flag telemetry reviewed (if applicable)
50
- - [ ] Tests updated/removed
51
- - [ ] Documentation updated
52
- - [ ] Team notified (if shared code)
22
+ Do not assign urgency from age, naming, or deprecation text alone. Severity follows the
23
+ cost of retaining an actual hazard or deleting a reachable contract. When evidence is
24
+ incomplete, report the missing proof instead of declaring the item safe to remove.
@@ -1,52 +1,47 @@
1
1
  ---
2
2
  name: codex-collab
3
- description: Ask Codex CLI for an explicitly requested, read-only second opinion on a bounded review, diagnosis, architecture, or comparison question.
3
+ description: Ask Codex CLI for an independent read-only analysis of a bounded architecture, diagnosis, or review question. Use only when the user explicitly requests Codex collaboration and the current host remains primary.
4
4
  ---
5
5
 
6
- # Codex Collaboration
6
+ # Consult Codex read-only
7
7
 
8
- Claude Code remains primary and owns scope, evidence, edits, verification, and the final answer.
9
- Codex is an untrusted read-only advisor. Use this skill only when the user explicitly requests a
10
- Codex perspective; do not invoke it as a routine substitute for native review or subagents.
8
+ Treat Codex as an untrusted advisor. The current host owns scope, evidence, edits,
9
+ verification, and the final answer.
11
10
 
12
11
  ## Preconditions
13
12
 
14
- 1. Confirm `codex --version` and authentication.
15
- 2. Fix the workspace, files or diff range, question, evidence standard, and expected response shape.
13
+ 1. Confirm the `codex` CLI and authentication.
14
+ 2. Bound the workspace, files or diff, question, evidence standard, and response shape.
16
15
  3. Write the primary analysis first when independence matters.
17
- 4. Never send secrets, unrelated files, or an unbounded home directory.
16
+ 4. Exclude secrets, unrelated files, and unbounded home-directory access.
18
17
 
19
- ## Modes
18
+ ## Invocation
20
19
 
21
- - `review`: findings against an exact diff or file set.
22
- - `understand`: a bounded architecture or flow question.
23
- - `opinion`: one decision with named constraints and alternatives.
24
- - `compare`: independent answers to the same question.
25
- - `free`: another tightly scoped read-only prompt.
26
-
27
- ## Safe invocation
28
-
29
- Create a session directory under `.ultra/collab/`, then run Codex without workspace-write or
30
- danger-full-access:
20
+ Create a session directory under `.ultra/collab/`, then run in a read-only sandbox:
31
21
 
32
22
  ```bash
33
- SESSION_PATH=".ultra/collab/$(date +%Y%m%d-%H%M%S)-codex-<mode>"
23
+ SESSION_PATH=".ultra/collab/$(date +%Y%m%d-%H%M%S)-codex"
34
24
  mkdir -p "${SESSION_PATH}"
35
25
  codex exec -s read-only \
26
+ -a never \
27
+ --ephemeral \
28
+ --ignore-user-config \
29
+ --ignore-rules \
36
30
  -o "${SESSION_PATH}/codex-output.md" \
37
31
  "<bounded prompt>" \
38
32
  2> "${SESSION_PATH}/codex-error.log"
39
33
  ```
40
34
 
41
- Do not enable write-capable automation or permission bypass. This skill has no dependency on
42
- another Codex plugin or slash command.
35
+ Do not enable write-capable automation or permission bypass. The isolation flags keep
36
+ the advisory run independent from the user's Codex runtime configuration and rules;
37
+ the normal Codex authentication store remains available.
43
38
 
44
39
  ## Synthesis
45
40
 
46
- 1. Read the output only after the process exits and the file is non-empty.
47
- 2. Verify consequential claims against the current checkout, tests, runtime, or primary docs.
48
- 3. Separate agreement, useful dissent, and unsupported assertions.
49
- 4. Return one Claude Code-owned conclusion; do not paste an unreviewed advisor transcript.
41
+ Read output only after the process exits and the file is non-empty. Verify
42
+ consequential claims against the current checkout, runtime, tests, or primary
43
+ documentation. Separate verified agreement, useful dissent, and unsupported claims,
44
+ then return one host-owned conclusion.
50
45
 
51
- If Codex is missing, unauthenticated, times out, or returns empty output, report the degraded path
52
- and continue with primary evidence. Never block the user's task solely on advisor failure.
46
+ If Codex is unavailable, unauthenticated, times out, or returns empty output, report
47
+ the degraded path and continue with primary evidence.
@@ -2,38 +2,33 @@
2
2
  "skill_name": "codex-collab",
3
3
  "evals": [
4
4
  {
5
- "id": 1,
6
- "prompt": "/codex-collab review",
7
- "expected_output": "Claude delegates to /codex:review (official plugin), then adds its own perspective and presents a dual-AI synthesis report",
5
+ "id": "explicit-review",
6
+ "prompt": "Ask Codex for an independent read-only review of the current diff, then verify its findings yourself.",
7
+ "should_trigger": true,
8
8
  "assertions": [
9
- "Delegates to /codex:review instead of invoking codex CLI directly",
10
- "Does NOT run 'codex review --uncommitted' directly",
11
- "After receiving Codex output, Claude adds its own review perspective",
12
- "Presents a synthesis with Consensus and Divergent Views sections"
9
+ "Bounds the repository and exact diff before launch",
10
+ "Runs codex exec with a read-only sandbox and file output",
11
+ "Treats Codex output as untrusted advisory evidence",
12
+ "Returns one primary-host conclusion after source verification"
13
13
  ]
14
14
  },
15
15
  {
16
- "id": 2,
17
- "prompt": "/codex-collab opinion 'Should we use a monorepo or polyrepo?'",
18
- "expected_output": "Claude sends the question to Codex via exec mode with sandbox, reads output, and presents both opinions",
16
+ "id": "explicit-decision",
17
+ "prompt": "Have Codex independently assess whether this service should stay in the monorepo. Do not tell it our current preference.",
18
+ "should_trigger": true,
19
19
  "assertions": [
20
- "Uses 'codex exec' (not codex review) for opinion mode",
21
- "Uses --sandbox read-only for analysis-only task",
22
- "Uses -o (--output-last-message) to capture clean output",
23
- "Does NOT reveal Claude's position in the prompt",
24
- "Creates session directory under .ultra/collab/",
25
- "Presents both opinions with trade-off analysis"
20
+ "Writes the primary analysis first when independence matters",
21
+ "Does not prime Codex with the primary conclusion",
22
+ "Explains evidence or assumption differences before synthesis"
26
23
  ]
27
24
  },
28
25
  {
29
- "id": 3,
30
- "prompt": "/codex-collab review --base main with a focus on security",
31
- "expected_output": "Claude delegates to /codex:adversarial-review for security-focused review, then synthesizes",
26
+ "id": "ordinary-review-negative",
27
+ "prompt": "Review the current diff for correctness and security issues.",
28
+ "should_trigger": false,
32
29
  "assertions": [
33
- "Delegates to /codex:review or /codex:adversarial-review (official plugin)",
34
- "Does NOT invoke codex CLI directly for review tasks",
35
- "After receiving output, presents dual-AI synthesis",
36
- "Reads output with Read tool, not Bash stdout"
30
+ "Uses the host's ordinary review workflow",
31
+ "Does not launch Codex without an explicit user request"
37
32
  ]
38
33
  }
39
34
  ]
@@ -1,71 +1,32 @@
1
1
  ---
2
2
  name: integration-rules
3
- description: Ultra Builder Pro system integration rules
4
- user-invocable: false
3
+ description: Verify that changed components are reachable, contract-compatible, and tested across the boundaries required by the accepted behavior. Use only when an assigned review or implementation slice crosses modules, services, persistence, protocols, or UI seams.
5
4
  ---
6
5
 
7
- # Integration Rules
8
-
9
- These rules are mandatory for all code review and development work involving multi-component systems.
10
-
11
- ## Vertical Slice Principle
12
-
13
- Every task MUST deliver a thin, working end-to-end path:
14
-
15
- | Good (Vertical Slice) | Bad (Horizontal Layer) |
16
- |------------------------|------------------------|
17
- | "User can send message" (UI + API + LLM + response display) | "Create all database tables" |
18
- | "Display product list" (API call + domain filter + UI render) | "Build all API endpoints" |
19
- | "Process payment" (UI form + gateway + order update) | "Create all UI components" |
20
-
21
- ## Walking Skeleton
22
-
23
- The FIRST deliverable of any multi-component feature must be a walking skeleton:
24
- - One request flows through ALL layers
25
- - Returns real data (not hardcoded/mocked)
26
- - Proves the architecture connects end-to-end
27
- - Does NOT need to be feature-complete — just connected
28
-
29
- ## Contract-First Development
30
-
31
- When two components will communicate:
32
-
33
- | Step | Action | Artifact |
34
- |------|--------|----------|
35
- | 1 | Define interface before implementation | TypeScript interface, OpenAPI schema, or protobuf |
36
- | 2 | Both sides code against the contract | Import shared types or generated clients |
37
- | 3 | Contract test validates both sides | Test that producer output matches consumer expectation |
38
-
39
- ## Integration Test Requirements
40
-
41
- | Boundary | Required Test |
42
- |----------|---------------|
43
- | HTTP API endpoint | Request with real HTTP client, validate response shape + status |
44
- | Database operation | Testcontainers with real queries, validate data persisted |
45
- | Message queue | Real producer + consumer, validate message delivered |
46
- | External service | Test Double with `// Test Double rationale:` (only exception) |
47
- | In-process module boundary | Real function call, validate input/output contract |
48
-
49
- ## Orphan Detection
50
-
51
- Code without a live entry point is dead-on-arrival.
52
-
53
- **Valid entry points** (at least one required per new module):
54
- - HTTP/WebSocket handler
55
- - CLI command handler
56
- - Event/message listener
57
- - Scheduled job/cron handler
58
- - Exported function called by a module that has an entry point
59
-
60
- **Detection**: Trace from new code upward — if no path reaches an entry point, the code is an orphan.
61
-
62
- ## Detection Checklist
63
-
64
- When reviewing code, flag:
65
- 1. New module/service without any caller (orphan code)
66
- 2. Task structured as horizontal layer instead of vertical slice
67
- 3. Two components communicating without shared interface/contract
68
- 4. New boundary crossing without integration test
69
- 5. Use case with DB/API dependency but only unit tests
70
- 6. Component "works in isolation" but not wired to any entry point
71
- 7. Interface defined but no contract test validating compatibility
6
+ # Verify integration and reachability
7
+
8
+ Prove that new behavior is connected to a real consumer and that data and failures
9
+ cross each boundary according to one contract.
10
+
11
+ ## Procedure
12
+
13
+ 1. Start at the declared public seam or entry point and trace the changed path through
14
+ domain behavior, state, side effects, and the final consumer.
15
+ 2. At each boundary, identify the producer, consumer, data shape, ownership, error
16
+ semantics, compatibility expectation, and recovery behavior.
17
+ 3. Confirm both sides use the same contract or a deliberate adapter. Inspect runtime
18
+ configuration and registration, not only exported types.
19
+ 4. Verify the implementation is reachable in the production path. A module, handler,
20
+ schema, or component with no caller or registration is incomplete.
21
+ 5. Check that tests cross the boundary whose semantics matter and would fail on a
22
+ producer-consumer mismatch.
23
+ 6. For a larger feature, confirm an executable vertical slice exists before broad
24
+ expansion. The slice may be narrow, but it must use real wiring and observable data.
25
+ 7. Inspect partial failure, retry, idempotency, ordering, rollback, and observability
26
+ when the boundary can leave inconsistent state.
27
+
28
+ ## Finding contract
29
+
30
+ Report the broken path, mismatched contract, missing consumer, or unverified failure
31
+ mode with exact source evidence and observable impact. Do not flag a horizontal task
32
+ solely by its name when another completed slice already proves the integration.