ultra-builder-pro-cli 0.10.0 → 0.12.1

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 (137) hide show
  1. package/.ultra-template/specs/architecture.md +54 -223
  2. package/.ultra-template/specs/discovery.md +34 -231
  3. package/.ultra-template/specs/product.md +44 -200
  4. package/.ultra-template/tasks/contexts/TEMPLATE.md +36 -0
  5. package/.ultra-template/tasks/tasks.json +6 -0
  6. package/CHANGELOG.md +86 -1
  7. package/README.md +21 -9
  8. package/adapters/_shared/codex-assets.cjs +24 -342
  9. package/adapters/_shared/handbook.cjs +4 -3
  10. package/adapters/_shared/runtime-assets.cjs +24 -0
  11. package/adapters/_shared/tests/handbook.test.cjs +4 -0
  12. package/adapters/_shared/tests/runtime-assets.test.cjs +11 -4
  13. package/adapters/claude.js +28 -5
  14. package/adapters/kimi.js +15 -138
  15. package/adapters/opencode.js +22 -49
  16. package/adapters/tests/claude.test.cjs +22 -8
  17. package/adapters/tests/codex.test.cjs +21 -8
  18. package/adapters/tests/kimi-hook.test.cjs +1 -1
  19. package/adapters/tests/kimi.test.cjs +11 -11
  20. package/adapters/tests/opencode.test.cjs +47 -8
  21. package/agents/code-reviewer.md +24 -85
  22. package/agents/debugger.md +30 -132
  23. package/agents/review-code.md +24 -104
  24. package/agents/review-comments.md +20 -83
  25. package/agents/review-coordinator.md +40 -137
  26. package/agents/review-design.md +21 -118
  27. package/agents/review-errors.md +22 -70
  28. package/agents/review-spec.md +36 -0
  29. package/agents/review-tests.md +20 -76
  30. package/agents/tdd-runner.md +26 -84
  31. package/commands/learn.md +5 -36
  32. package/commands/ultra-change.md +5 -43
  33. package/commands/ultra-deliver.md +4 -46
  34. package/commands/ultra-dev.md +4 -48
  35. package/commands/ultra-doctor.md +4 -30
  36. package/commands/ultra-init.md +5 -47
  37. package/commands/ultra-plan.md +5 -48
  38. package/commands/ultra-research.md +5 -54
  39. package/commands/ultra-status.md +5 -44
  40. package/commands/ultra-test.md +5 -45
  41. package/commands/ultra-think.md +5 -40
  42. package/docs/AGENT-CONTEXT.md +16 -8
  43. package/docs/ARCHITECTURE.md +32 -5
  44. package/docs/PLAN.zh-CN.md +8 -6
  45. package/docs/ROADMAP.md +5 -3
  46. package/docs/RUNTIME-COMPAT-MATRIX.md +8 -5
  47. package/docs/SKILL-AUTHORING.md +75 -0
  48. package/docs/STATE-DB-ACCESS-POLICY.md +17 -11
  49. package/docs/USER-HANDBOOK-CONTRACT.md +8 -5
  50. package/hooks/README.md +4 -3
  51. package/hooks/adapters/codex.py +1 -1
  52. package/hooks/adapters/kimi.py +1 -1
  53. package/hooks/context_spine.py +120 -16
  54. package/hooks/health_check.py +11 -0
  55. package/hooks/pre_stop_check.py +6 -5
  56. package/mcp-server/lib/baseline-workflow.cjs +415 -0
  57. package/mcp-server/lib/baseline-workflow.test.cjs +225 -0
  58. package/mcp-server/lib/change-workflow.cjs +24 -27
  59. package/mcp-server/lib/change-workflow.test.cjs +202 -6
  60. package/mcp-server/lib/context-spine.cjs +74 -9
  61. package/mcp-server/lib/context-spine.test.cjs +15 -0
  62. package/mcp-server/lib/doctor.cjs +14 -0
  63. package/mcp-server/lib/doctor.test.cjs +25 -1
  64. package/mcp-server/lib/init-project.cjs +49 -14
  65. package/mcp-server/lib/provider-refs.cjs +42 -0
  66. package/mcp-server/lib/spec-learning.test.cjs +5 -0
  67. package/mcp-server/lib/state-db.cjs +63 -4
  68. package/mcp-server/lib/state-db.test.cjs +8 -3
  69. package/mcp-server/server.cjs +48 -3
  70. package/mcp-server/tests/init-project.test.cjs +54 -8
  71. package/mcp-server/tests/server-contract.test.cjs +99 -2
  72. package/mcp-server/tests/state-db.test.cjs +11 -2
  73. package/package.json +3 -2
  74. package/skills/cc-collab/SKILL.md +16 -18
  75. package/skills/code-review-expert/SKILL.md +39 -114
  76. package/skills/code-review-expert/references/correctness-reliability.md +30 -0
  77. package/skills/code-review-expert/references/design-boundaries.md +26 -0
  78. package/skills/code-review-expert/references/removal-plan.md +17 -45
  79. package/skills/codex-collab/SKILL.md +23 -28
  80. package/skills/codex-collab/evals/evals.json +18 -23
  81. package/skills/integration-rules/SKILL.md +28 -67
  82. package/skills/learn/SKILL.md +46 -106
  83. package/skills/security-rules/SKILL.md +34 -56
  84. package/skills/testing-rules/SKILL.md +28 -52
  85. package/skills/ultra-change/SKILL.md +68 -114
  86. package/skills/ultra-deliver/SKILL.md +58 -86
  87. package/skills/ultra-dev/SKILL.md +46 -105
  88. package/skills/ultra-doctor/SKILL.md +45 -72
  89. package/skills/ultra-init/SKILL.md +62 -147
  90. package/skills/ultra-init/references/brownfield-adoption.md +65 -0
  91. package/skills/ultra-plan/SKILL.md +56 -89
  92. package/skills/ultra-research/SKILL.md +64 -152
  93. package/skills/ultra-research/references/architecture.md +38 -0
  94. package/skills/ultra-research/references/problem-product.md +39 -0
  95. package/skills/ultra-research/references/quality-delivery.md +34 -0
  96. package/skills/ultra-research/references/synthesis.md +38 -0
  97. package/skills/ultra-research/references/users-scope.md +40 -0
  98. package/skills/ultra-review/SKILL.md +54 -98
  99. package/skills/ultra-review/references/unified-schema.md +76 -101
  100. package/skills/ultra-review/scripts/review_wait.py +242 -77
  101. package/skills/ultra-status/SKILL.md +41 -56
  102. package/skills/ultra-test/SKILL.md +37 -72
  103. package/skills/ultra-think/SKILL.md +43 -102
  104. package/skills/ultra-verify/SKILL.md +44 -84
  105. package/skills/ultra-verify/evals/evals.json +24 -27
  106. package/spec/cli-protocol.md +4 -0
  107. package/spec/mcp-tools.yaml +223 -4
  108. package/spec/schemas/command-manifest.schema.json +7 -25
  109. package/spec/schemas/mcp-tools.schema.json +1 -1
  110. package/spec/schemas/skill-manifest.schema.json +9 -79
  111. package/spec/schemas/state-db.sql +33 -2
  112. package/ultra-tools/commands/status.cjs +20 -2
  113. package/ultra-tools/commands/task.cjs +4 -1
  114. package/ultra-tools/status-command.test.cjs +20 -0
  115. package/ultra-tools/system-command.test.cjs +5 -0
  116. package/skills/code-review-expert/references/code-quality-checklist.md +0 -112
  117. package/skills/code-review-expert/references/integration-checklist.md +0 -46
  118. package/skills/code-review-expert/references/security-checklist.md +0 -100
  119. package/skills/code-review-expert/references/solid-checklist.md +0 -65
  120. package/skills/ultra-research/steps/step-00-problem-validation.md +0 -154
  121. package/skills/ultra-research/steps/step-01-opportunity-discovery.md +0 -172
  122. package/skills/ultra-research/steps/step-02-market-assessment.md +0 -195
  123. package/skills/ultra-research/steps/step-03-competitive-landscape.md +0 -197
  124. package/skills/ultra-research/steps/step-04-product-strategy.md +0 -196
  125. package/skills/ultra-research/steps/step-05-assumptions-validation.md +0 -234
  126. package/skills/ultra-research/steps/step-10-user-personas.md +0 -169
  127. package/skills/ultra-research/steps/step-11-user-scenarios.md +0 -181
  128. package/skills/ultra-research/steps/step-20-user-stories.md +0 -156
  129. package/skills/ultra-research/steps/step-21-features-scope.md +0 -157
  130. package/skills/ultra-research/steps/step-22-success-metrics.md +0 -195
  131. package/skills/ultra-research/steps/step-30-architecture-context.md +0 -154
  132. package/skills/ultra-research/steps/step-31-solution-strategy.md +0 -172
  133. package/skills/ultra-research/steps/step-32-building-blocks.md +0 -188
  134. package/skills/ultra-research/steps/step-40-deployment.md +0 -123
  135. package/skills/ultra-research/steps/step-41-quality-risks.md +0 -135
  136. package/skills/ultra-research/steps/step-99-synthesis.md +0 -188
  137. package/skills/ultra-review/scripts/review_verdict_update.py +0 -99
@@ -8,7 +8,7 @@ const path = require('node:path');
8
8
 
9
9
  const stateDb = require('../lib/state-db.cjs');
10
10
 
11
- test('initStateDb upgrades a pre-10.0 database in place with Context Spine state', () => {
11
+ test('initStateDb upgrades a pre-10.0 database through Context Spine into baseline authority', () => {
12
12
  const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'ubp-db-upgrade-'));
13
13
  const file = path.join(dir, 'state.db');
14
14
  try {
@@ -59,7 +59,7 @@ test('initStateDb upgrades a pre-10.0 database in place with Context Spine state
59
59
  assert.ok(columns.includes('change_id'));
60
60
  const eventColumns = upgraded.db.prepare('PRAGMA table_info(events)').all().map((row) => row.name);
61
61
  assert.ok(eventColumns.includes('change_id'));
62
- assert.equal(upgraded.schema_version, '10.0');
62
+ assert.equal(upgraded.schema_version, '11.0');
63
63
  assert.ok(upgraded.db.prepare("SELECT 1 FROM schema_version WHERE version = '10.0'").get());
64
64
  const contextColumns = upgraded.db.prepare('PRAGMA table_info(context_snapshots)').all()
65
65
  .map((row) => row.name);
@@ -69,12 +69,21 @@ test('initStateDb upgrades a pre-10.0 database in place with Context Spine state
69
69
  assert.ok(upgraded.db.prepare(
70
70
  "SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = 'spec_learning_candidates'",
71
71
  ).get());
72
+ const baseline = upgraded.db.prepare(
73
+ "SELECT mode, status FROM baselines WHERE id = 'migrated-baseline'",
74
+ ).get();
75
+ assert.deepEqual(baseline, { mode: 'migrated', status: 'ready' });
72
76
  const contextMigration = upgraded.db.prepare(
73
77
  "SELECT from_version, to_version, notes FROM migration_history WHERE to_version = '10.0' ORDER BY id DESC LIMIT 1",
74
78
  ).get();
75
79
  assert.equal(contextMigration.from_version, '9.1');
76
80
  assert.equal(contextMigration.to_version, '10.0');
77
81
  assert.match(contextMigration.notes, /Context Spine/);
82
+ const baselineMigration = upgraded.db.prepare(
83
+ "SELECT from_version, to_version, notes FROM migration_history WHERE to_version = '11.0' ORDER BY id DESC LIMIT 1",
84
+ ).get();
85
+ assert.equal(baselineMigration.from_version, '10.0');
86
+ assert.match(baselineMigration.notes, /baseline adoption/i);
78
87
  assert.ok(upgraded.db.prepare(
79
88
  "SELECT 1 FROM migration_history WHERE from_version = '8A.1' AND to_version = '9.1' AND notes LIKE '%Kimi%'",
80
89
  ).get());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultra-builder-pro-cli",
3
- "version": "0.10.0",
3
+ "version": "0.12.1",
4
4
  "description": "Multi-runtime installer for the Ultra Builder Pro agent engineering system — deploys commands, agents, skills, hooks, and MCP server to Claude Code, OpenCode, Codex CLI, and Kimi Code.",
5
5
  "bin": {
6
6
  "ultra-builder-pro-cli": "bin/install.js",
@@ -50,6 +50,7 @@
50
50
  "docs/ROADMAP.md",
51
51
  "docs/ARCHITECTURE.md",
52
52
  "docs/AGENT-CONTEXT.md",
53
+ "docs/SKILL-AUTHORING.md",
53
54
  "docs/COMMIT-HASH-BACKFILL.md",
54
55
  "docs/PLAN.zh-CN.md",
55
56
  "docs/STATE-DB-ACCESS-POLICY.md",
@@ -87,7 +88,7 @@
87
88
  "test:state": "node --test 'mcp-server/**/*.test.cjs'",
88
89
  "test:orch": "node --test 'orchestrator/**/*.test.cjs'",
89
90
  "test:spec": "node spec/scripts/test-all.cjs",
90
- "test:rest": "node --test adapters/_shared/tests/*.test.cjs adapters/tests/*.test.cjs ultra-tools/*.test.cjs tests/conformance/**/*.test.cjs tests/install.test.cjs tests/package-smoke.test.cjs tests/retired-runtime.test.cjs",
91
+ "test:rest": "node --test adapters/_shared/tests/*.test.cjs adapters/tests/*.test.cjs ultra-tools/*.test.cjs tests/conformance/**/*.test.cjs tests/*.test.cjs",
91
92
  "test:all": "npm run test:state && npm run test:orch && npm run test:spec && npm run test:rest",
92
93
  "test:hooks": "pytest hooks/tests -q",
93
94
  "verify:release": "npm run test:all && npm run test:hooks && npm audit --omit=dev --audit-level=high",
@@ -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
  ]