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,118 +1,58 @@
1
1
  ---
2
2
  name: learn
3
- description: "Extract one reusable pattern from the current session into a valid user skill, with explicit user approval before writing."
4
- user-invocable: true
3
+ description: Extract one verified reusable workflow from completed work into a portable user skill after explicit approval. Use when the user asks to preserve a repeatable method that does not belong in project guidance or ordinary documentation.
5
4
  ---
6
5
 
7
- # learn — Phase 3.6
6
+ # Capture a reusable skill
8
7
 
9
- Mine the current session for a reusable pattern and save it as a Speculation-
10
- grade skill under `~/.claude/skills/learned-<name>-unverified/SKILL.md`. User
11
- confirmation is mandatory before the write — never silently persist.
8
+ Create a focused workflow from evidence in the current task. Do not capture prompts,
9
+ transcripts, private memory, or one-off incident details.
12
10
 
13
- ## Trigger conditions
11
+ ## Placement gate
14
12
 
15
- Run `/learn` after solving a non-trivial problem where the approach is
16
- generalizable (not a one-off typo or outage-specific fix).
13
+ Before drafting, decide whether the material belongs in a skill:
17
14
 
18
- ## What to extract
15
+ - durable repository convention: update the nearest project guidance instead;
16
+ - product or architecture fact: update project documentation instead;
17
+ - external live data or action: use an MCP integration instead;
18
+ - repeatable procedure with non-obvious steps, references, or scripts: create a skill.
19
19
 
20
- | Kind | Example |
21
- |------|---------|
22
- | **Error resolution** | Root cause + fix that applies to similar errors |
23
- | **Debugging technique** | Non-obvious steps, effective tool combos |
24
- | **Workaround** | Library quirk / API limitation / version-specific fix |
25
- | **Project-specific pattern** | Codebase convention / integration pattern discovered this session |
20
+ Stop when the candidate is a typo fix, transient outage, generic advice, unsupported
21
+ hypothesis, or a duplicate of an existing skill.
26
22
 
27
23
  ## Workflow
28
24
 
29
- ### Step 1 — Review session
30
-
31
- Scan recent messages / tool outputs for extractable patterns. Prefer
32
- patterns that saved meaningful time or would have, had they been known upfront.
33
-
34
- ### Step 2 — Identify the highest-value candidate
35
-
36
- Multiple candidates? Pick one. Keep skills focused — **one pattern per file**.
37
-
38
- ### Step 3 — Draft skill body
39
-
40
- Use the **learned-skill template** below. Mark confidence as `Speculation`
41
- and append `-unverified` to the skill directory name.
42
-
43
- ### Step 4 — User confirmation
44
-
45
- Present a concise summary (pattern name, one-sentence description, trigger,
46
- proposed filename) to the user and ask to approve the save. Options:
47
- - A: "Save it" → Step 5
48
- - B: "Edit first" → accept user revisions, re-confirm
49
- - C: "Don't save" → abort
50
-
51
- ### Step 5 — Write file
52
-
53
- Path: `~/.claude/skills/learned-<pattern-slug>-unverified/SKILL.md`.
54
- Never overwrite an existing learned skill directory — increment the slug
55
- (`learned-pattern-slug-2-unverified/`) if it already exists.
56
-
57
- ## Learned-skill template
58
-
59
- ```markdown
60
- ---
61
- name: learned-<pattern-slug>-unverified
62
- description: Use when <specific trigger for this reusable pattern>.
63
- ---
64
-
65
- # <Descriptive Pattern Name>
66
-
67
- **Extracted**: <YYYY-MM-DD>
68
- **Confidence**: Speculation (unverified)
69
- **Context**: <one-sentence applicability>
70
-
71
- ## Problem
72
- <what problem does this pattern solve — be specific>
73
-
74
- ## Solution
75
- <the pattern / technique / workaround>
76
-
77
- ## Example
78
- <code example if applicable — else a transcribed command sequence>
79
-
80
- ## Trigger Conditions
81
- <what situations should activate this skill>
82
-
83
- ## Verification Status
84
- - [ ] Human review passed
85
- - [ ] Multiple successful uses
86
- ```
87
-
88
- ## Verification upgrade path
89
-
90
- 1. **Speculation** (this skill writes this level) — freshly extracted, unverified
91
- 2. **Inference** — after human review passes, rename the directory to remove
92
- `-unverified` and update the frontmatter name
93
- 3. **Fact** — after multiple successful uses confirm the pattern
94
-
95
- ## What NOT to extract
96
-
97
- - Simple typo fixes
98
- - One-time issues (API outage, transient CI flake)
99
- - Patterns too project-specific to reuse (belongs in project docs, not a skill)
100
- - Anything already captured in CLAUDE.md or equivalent project instructions
101
-
102
- ## Approval boundary
103
-
104
- Ask the user directly before writing. No Ultra MCP or legacy interaction wrapper is involved.
105
-
106
- ## What this skill DOES NOT do
107
-
108
- - Does NOT modify state.db
109
- - Does NOT save without user approval
110
- - Does NOT extract more than one pattern per run
111
-
112
- ## Integration
113
-
114
- | | |
115
- |---|---|
116
- | **Input** | current session transcript / recent tool outputs |
117
- | **Output** | `~/.claude/skills/learned-<slug>-unverified/SKILL.md` |
118
- | **Next** | user may promote after review; `/learn` again later when another pattern appears |
25
+ 1. Identify one coherent procedure that succeeded in the current work. Preserve the
26
+ trigger, decisive steps, non-obvious failure modes, inputs, outputs, and validation
27
+ command; remove task-specific names, dates, branches, and conclusions.
28
+ 2. Search the current host's user skill directory for overlap. Extend an existing
29
+ skill only when its job and trigger remain coherent.
30
+ 3. Draft a portable skill directory:
31
+
32
+ ```text
33
+ <skill-name>/
34
+ SKILL.md
35
+ scripts/ # only deterministic reusable helpers
36
+ references/ # only conditional detailed guidance
37
+ assets/ # only reusable templates or resources
38
+ ```
39
+
40
+ 4. Keep `SKILL.md` focused on the procedure. Its frontmatter contains only `name` and
41
+ `description`; the description states both what the skill does and when to use it.
42
+ Move detailed schemas, long examples, and optional branches into focused resources
43
+ and say exactly when to load them.
44
+ 5. Present the proposed name, trigger, file inventory, and concise draft to the user.
45
+ Write nothing until the user approves.
46
+ 6. Write to the current host's user skill directory without overwriting an unrelated
47
+ skill. Add host-specific UI or invocation metadata outside `SKILL.md` when the host
48
+ supports it.
49
+ 7. Run the available Agent Skills validator and at least one positive and one negative
50
+ trigger check. Report any behavior that remains unverified.
51
+
52
+ ## Quality gate
53
+
54
+ The captured skill must be reusable without the original conversation, grounded in
55
+ observed evidence, concise enough to compete safely for context, and explicit about
56
+ validation. Create one skill per coherent job, not one skill per fact.
57
+
58
+ This workflow never modifies Ultra state and never runs automatically at task close.
@@ -1,60 +1,38 @@
1
1
  ---
2
2
  name: security-rules
3
- description: Ultra Builder Pro security rules
4
- user-invocable: false
3
+ description: Evaluate changed trust boundaries for exploitable input, authorization, secret, data-exposure, and supply-chain failures. Use only when an assigned review scope contains a security-relevant boundary.
5
4
  ---
6
5
 
7
- # Security Rules
8
-
9
- These rules are mandatory for all code review and security-related work.
10
-
11
- ## Input Validation
12
-
13
- All external input MUST be validated:
14
- - **Syntactic**: correct format (email, date, UUID)
15
- - **Semantic**: valid in business context (start < end, price > 0)
16
- - Validate early, reject invalid input immediately
17
-
18
- ## Forbidden Patterns
19
-
20
- | Pattern | Risk | Alternative |
21
- |---------|------|-------------|
22
- | SQL string concatenation | SQL Injection | Parameterized queries (`$1`, `?`) |
23
- | User input → HTML directly | XSS | textContent, sanitizer library |
24
- | Hardcoded secrets/keys | Credential leak | Environment variables, secret manager |
25
- | Trust client-supplied role | Privilege escalation | Derive from session/token server-side |
26
- | Dynamic code evaluation with user input | Code injection | Use safe parsers (JSON.parse, etc.) |
27
- | Regex with user input | ReDoS | Validate/escape regex input |
28
-
29
- ## Required Practices
30
-
31
- | Area | Rule |
32
- |------|------|
33
- | SQL | Parameterized queries only |
34
- | Output | Escape/sanitize all user-derived content |
35
- | Auth | Use established auth libraries |
36
- | Secrets | Environment variables or secret manager |
37
- | Sessions | Secure, HttpOnly, SameSite cookies |
38
- | CORS | Explicit allowlist, never wildcard in production |
39
- | File upload | Validate type, size, sanitize filename |
40
-
41
- ## Error Handling Security
42
-
43
- - Never expose stack traces to end users
44
- - Never include sensitive data in error messages
45
- - Log security events with sufficient context for investigation
46
- - Use typed errors, not generic messages
47
-
48
- ## Review Checklist
49
-
50
- When reviewing code, check for:
51
- 1. SQL injection vectors (string concatenation in queries)
52
- 2. XSS vectors (unescaped user input in HTML/templates)
53
- 3. Hardcoded credentials, API keys, or secrets
54
- 4. Missing authentication/authorization checks
55
- 5. Missing input validation on external boundaries
56
- 6. Insecure direct object references (IDOR)
57
- 7. Missing rate limiting on sensitive endpoints
58
- 8. Sensitive data in logs or error messages
59
- 9. Missing CSRF protection on state-changing operations
60
- 10. Insecure deserialization
6
+ # Review security-relevant changes
7
+
8
+ Follow data from an attacker-controlled or less-trusted source to a protected action,
9
+ secret, identity, or output. Report plausible exploit paths, not isolated pattern
10
+ matches.
11
+
12
+ ## Review procedure
13
+
14
+ 1. Identify trust boundaries, protected assets, principals, and state-changing actions
15
+ in the diff.
16
+ 2. Trace input validation, canonicalization, authorization, and output handling through
17
+ the real call path.
18
+ 3. Verify authorization is derived from trusted server state and applies to the
19
+ requested resource, tenant, or object.
20
+ 4. Inspect persistence and command boundaries for injection, unsafe deserialization,
21
+ path traversal, and unbounded resource use.
22
+ 5. Inspect logs, errors, telemetry, and client responses for secret or sensitive-data
23
+ disclosure.
24
+ 6. Inspect changed authentication, cryptography, dependency, file-upload, webhook, and
25
+ cross-origin behavior when present.
26
+ 7. Check the failure path: rate limits, replay or idempotency, partial writes, rollback,
27
+ and audit evidence where the risk requires them.
28
+
29
+ ## Finding threshold
30
+
31
+ Report only when the current code supports a triggering input and a meaningful impact.
32
+ Include the source-to-sink path, affected asset, exploit preconditions, and a bounded
33
+ fix. Distinguish a missing defense from a defense implemented elsewhere in the live
34
+ path.
35
+
36
+ Treat confirmed secret exposure, authorization bypass, injection with material impact,
37
+ and destructive cross-tenant access as blocking. Calibrate other issues from their
38
+ actual reachability and blast radius rather than a fixed pattern-to-severity table.
@@ -1,56 +1,32 @@
1
1
  ---
2
2
  name: testing-rules
3
- description: Ultra Builder Pro testing discipline rules
4
- user-invocable: false
3
+ description: Review whether changed behavior has meaningful, trustworthy, and proportionate test evidence across its real boundaries. Use only when assigned to a test review or delivery verification scope.
5
4
  ---
6
5
 
7
- # Testing Rules
8
-
9
- These rules are mandatory for all test-related work.
10
-
11
- ## TDD Workflow
12
-
13
- RED → GREEN → REFACTOR (all new code).
14
-
15
- ## Test Strategy
16
-
17
- | Layer | Test Type | Mock Strategy |
18
- |-------|-----------|---------------|
19
- | Functional Core | Unit Test | No mocks needed (pure input→output) |
20
- | Imperative Shell | Integration | Testcontainers (real DB/services) |
21
- | External APIs | Test Double | With `// Test Double rationale: [reason]` |
22
-
23
- ## Forbidden Patterns
24
-
25
- These patterns are **never** acceptable:
26
-
27
- | Pattern | Why Forbidden | Alternative |
28
- |---------|---------------|-------------|
29
- | `jest.fn()` for Repository/Service/Domain | Invalid test — doesn't prove production works | Testcontainers |
30
- | `class InMemoryRepository` | Diverges from real DB behavior | Real DB container |
31
- | `class MockXxx` / `class FakeXxx` | Hides integration issues | Direct instantiation or Testcontainers |
32
- | `jest.mock('../services/X')` | Skips real collaboration | Test real collaboration |
33
- | `it.skip('...database...')` | "Too slow" is not valid | Testcontainers are fast enough |
34
-
35
- ## Coverage Requirements
36
-
37
- - 80% overall minimum
38
- - 100% Functional Core (pure logic must be fully tested)
39
- - Critical paths for Imperative Shell
40
-
41
- ## Dev/Prod Parity
42
-
43
- Tests must use real dependencies:
44
- - Real database via Testcontainers (not in-memory substitutes)
45
- - Config via environment variables
46
- - Mock tests passing ≠ production working
47
-
48
- ## Detection Checklist
49
-
50
- When analyzing test files, flag:
51
- 1. Any `jest.fn()` usage on Repository, Service, or Domain classes
52
- 2. Any `InMemory*` or `Mock*` or `Fake*` class definitions
53
- 3. Any `jest.mock()` calls on internal modules
54
- 4. Any skipped tests with database/slow excuses
55
- 5. Missing error case coverage
56
- 6. Missing edge case coverage
6
+ # Review test evidence
7
+
8
+ Evaluate what the tests prove about the accepted behavior. Line coverage and the mere
9
+ presence of a test file are supporting signals, not the contract.
10
+
11
+ ## Procedure
12
+
13
+ 1. Map each changed behavior and acceptance claim to a test or other executable check.
14
+ 2. Confirm the test can fail for the intended defect and observes a public or stable
15
+ contract rather than implementation trivia.
16
+ 3. Inspect happy, error, boundary, state-transition, and concurrency cases according to
17
+ the risk introduced by the diff.
18
+ 4. Verify integration seams with the most realistic practical boundary. Prefer real
19
+ persistence and protocol behavior when their semantics matter.
20
+ 5. Accept test doubles at costly, unavailable, or nondeterministic external boundaries
21
+ when the double preserves the documented contract and the reason is clear.
22
+ 6. Flag mocks or fakes only when they bypass the behavior under review, encode a false
23
+ contract, or make a passing test unrelated to production behavior.
24
+ 7. Detect skipped checks, tautological assertions, swallowed failures, non-determinism,
25
+ weakened expectations, and tests that never reach the changed code.
26
+
27
+ ## Finding contract
28
+
29
+ Name the unproven behavior, why current evidence is insufficient, the failure that can
30
+ escape, and the smallest test or boundary check that closes the gap. Calibrate severity
31
+ to product risk and reachability; do not impose a universal coverage percentage or a
32
+ single test technology on every repository.
@@ -1,122 +1,65 @@
1
1
  ---
2
2
  name: ultra-change
3
- description: "Open or resume a continuous change, capture its delta and decisions, compile bounded role context, and route one executable slice."
4
- user-invocable: true
5
- runtime: all
6
- mcp_tools_required:
7
- - change.create
8
- - change.update
9
- - change.get
10
- - change.list
11
- - change.context
12
- - change.breadcrumb
13
- - change.learning_propose
14
- - change.learning_resolve
15
- - task.create
16
- - task.list
3
+ description: Open or resume a bounded continuous change and connect its intent, delta, decisions, context, and executable tasks. Use when maintaining or extending an Ultra project after its baseline exists.
17
4
  ---
18
5
 
19
- # ultra-change — Delta Entry and Alignment Gate
6
+ # Open or resume a continuous change
20
7
 
21
- Use this after the first baseline delivery for fixes, small features, redesigns,
22
- incidents, and maintenance. It keeps specifications live through a delta → implement
23
- → learn → converge loop.
8
+ Keep post-delivery work aligned through a delta, implementation, learning, and
9
+ convergence loop.
24
10
 
25
11
  ## Authority boundary
26
12
 
27
- All change and task lifecycle writes use the live MCP tools. Do not write raw SQLite
28
- or mutate generated task/context projections. Provider payloads stay in their owning
29
- memory or graph system; Ultra stores metadata references only.
30
-
31
- ## 1. Establish the change
32
-
33
- Call `change.list` and `change.breadcrumb` first.
34
-
35
- - Resume the single matching active/blocked change.
36
- - If several may match, require an explicit id.
37
- - Otherwise auto-discover repository facts, then ask only the highest-value unresolved
38
- question. Do not ask the user for branch, stack, paths, or behavior already visible.
39
-
40
- Capture:
41
-
42
- - observable problem or requested outcome;
43
- - acceptance and explicit non-goals;
44
- - affected public seam or integration boundary;
45
- - documentation impact: `required` paths, `none` with rationale, or blocking `unknown`;
46
- - kind: `quick`, `standard`, `major`, or `incident`;
47
- - decision inventory: accepted decisions, rejected alternatives, and unresolved choices.
48
-
49
- Create with `change.create` using a stable kebab-case id. Update an existing packet
50
- with `change.update`; never create a parallel packet for the same outcome.
51
-
52
- ## 2. Write only the delta
53
-
54
- The bounded packet is:
55
-
56
- ```text
57
- .ultra/changes/active/<change-id>/
58
- intent.md
59
- delta/ # standard and major
60
- plan.md # standard and major
61
- diagnosis.md # incident
62
- context-manifest.json # MCP projection
63
- spec-learning.json # MCP projection
64
- verification.md # convergence projection
65
- ```
66
-
67
- `intent.md` records outcome, acceptance, non-goals, docs impact, and decisions.
68
- Delta files describe only differences from the baseline. An incident diagnosis must
69
- record symptom, earliest bad state, root-cause hypothesis, discriminating evidence,
70
- and recovery boundary.
71
-
72
- ## 3. Create an executable slice
73
-
74
- Prefer the smallest vertical `tracer_bullet` that crosses a live public seam. Split
75
- only when ownership or verification is genuinely independent. Each task must declare:
76
-
77
- - one observable outcome and linked `change_id`;
78
- - bounded files/contracts and dependencies;
79
- - `public_seam` that proves reachability;
80
- - exact `verification_command`;
81
- - expected red signal for a bug/incident;
82
- - documentation impact.
83
-
84
- Persist tasks with `task.create`. Generated `tasks.json` is never an input authority.
85
-
86
- ## 4. Compile Context Manifest v2
87
-
88
- Call `change.context` for the next task with:
89
-
90
- ```json
91
- {
92
- "id": "<change-id>",
93
- "task_id": "<task-id>",
94
- "role": "plan",
95
- "gate": "planning",
96
- "context_refs": [{"ref":"<path>","kind":"spec","reason":"defines acceptance","required":true}],
97
- "budget": {"max_tokens":12000,"max_files":12},
98
- "execution_contract": {
99
- "slice_kind":"tracer_bullet",
100
- "public_seam":"<reachable boundary>",
101
- "verification_command":"<exact command>",
102
- "context_budget_percent":40
103
- }
104
- }
105
- ```
106
-
107
- Include only files needed for the current role and gate. Missing required references,
108
- digest drift, file-count overflow, or a fresh-context budget over 40% blocks readiness.
109
- Use `expand_contract` only for an explicitly approved wider slice.
110
-
111
- ## 5. Handle discoveries without silent spec drift
112
-
113
- When implementation reveals a stable requirement, invariant, or public behavior not
114
- in the baseline, call `change.learning_propose` with evidence and target document.
115
- It is a candidate, not an automatic edit. A human/primary-agent decision must approve
116
- or reject it; approved learning is marked applied only after the baseline was updated.
117
-
118
- ## Exit contract
119
-
120
- Call `change.breadcrumb` and report the compiled task, readiness, blockers, and its
121
- single next action. Do not claim alignment while documentation impact is unknown,
122
- context is stale, or a material decision remains unresolved.
13
+ Use Ultra MCP tools for change and task lifecycle writes. Do not write raw SQLite or
14
+ mutate generated task and context projections. External memory or code-graph systems
15
+ own their payloads; Ultra stores only provider references supplied by the user or host.
16
+
17
+ ## Workflow
18
+
19
+ 1. Call `change.list` and `change.breadcrumb`.
20
+ - Resume the single change that matches the requested outcome.
21
+ - Require an explicit id when several changes could match.
22
+ - Create a new change only when no existing packet represents the same outcome.
23
+ 2. Capture the observable outcome, acceptance, non-goals, affected public seam,
24
+ documentation impact, and unresolved decisions.
25
+ 3. Classify the change as `quick`, `standard`, `major`, or `incident`. Ask only for a
26
+ material product, risk, or recovery decision that repository evidence cannot answer.
27
+ 4. Call `change.create` with a stable kebab-case id, or `change.update` when resuming.
28
+ 5. Write the minimum artifact set required by the classification:
29
+
30
+ ```text
31
+ .ultra/changes/active/<change-id>/
32
+ intent.md
33
+ delta/ # standard and major
34
+ plan.md # standard and major
35
+ diagnosis.md # incident
36
+ context-manifest.json # generated projection
37
+ spec-learning.json # generated projection
38
+ verification.md # generated projection
39
+ ```
40
+
41
+ Delta files describe differences from the baseline, not a second copy of it.
42
+ Incident diagnosis records the symptom, earliest bad state, falsifiable
43
+ hypotheses, evidence, root cause, and recovery boundary.
44
+ 6. Create the smallest executable vertical slice with `task.create`. Each task needs
45
+ one outcome, bounded ownership, dependencies, a live public seam, an exact
46
+ verification command, and documentation impact.
47
+ 7. Compile `change.context` for the next role and gate. Include only required
48
+ references and the task execution contract. Treat missing references, digest or
49
+ HEAD drift, an exceeded context budget, and unknown documentation impact as
50
+ blockers.
51
+ 8. Call `change.breadcrumb` and return its single next action.
52
+
53
+ ## Specification learning
54
+
55
+ When implementation uncovers a stable requirement, invariant, or public behavior
56
+ missing from the baseline, call `change.learning_propose` with evidence and a target
57
+ document. The proposal does not edit the baseline. It must be approved or rejected,
58
+ and an approved item is marked applied only after the target document is updated and
59
+ verified.
60
+
61
+ ## Completion gate
62
+
63
+ Do not claim alignment while a material decision is unresolved, documentation impact
64
+ is unknown, context is stale, or the next task is not executable from a bounded fresh
65
+ context.