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,117 +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."
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.
4
4
  ---
5
5
 
6
- # learn — Phase 3.6
6
+ # Capture a reusable skill
7
7
 
8
- Mine the current session for a reusable pattern and save it as a Speculation-
9
- grade skill under `~/.claude/skills/learned-<name>-unverified/SKILL.md`. User
10
- 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.
11
10
 
12
- ## Trigger conditions
11
+ ## Placement gate
13
12
 
14
- Run `/learn` after solving a non-trivial problem where the approach is
15
- generalizable (not a one-off typo or outage-specific fix).
13
+ Before drafting, decide whether the material belongs in a skill:
16
14
 
17
- ## 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.
18
19
 
19
- | Kind | Example |
20
- |------|---------|
21
- | **Error resolution** | Root cause + fix that applies to similar errors |
22
- | **Debugging technique** | Non-obvious steps, effective tool combos |
23
- | **Workaround** | Library quirk / API limitation / version-specific fix |
24
- | **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.
25
22
 
26
23
  ## Workflow
27
24
 
28
- ### Step 1 — Review session
29
-
30
- Scan recent messages / tool outputs for extractable patterns. Prefer
31
- patterns that saved meaningful time or would have, had they been known upfront.
32
-
33
- ### Step 2 — Identify the highest-value candidate
34
-
35
- Multiple candidates? Pick one. Keep skills focused — **one pattern per file**.
36
-
37
- ### Step 3 — Draft skill body
38
-
39
- Use the **learned-skill template** below. Mark confidence as `Speculation`
40
- and append `-unverified` to the skill directory name.
41
-
42
- ### Step 4 — User confirmation
43
-
44
- Present a concise summary (pattern name, one-sentence description, trigger,
45
- proposed filename) to the user and ask to approve the save. Options:
46
- - A: "Save it" → Step 5
47
- - B: "Edit first" → accept user revisions, re-confirm
48
- - C: "Don't save" → abort
49
-
50
- ### Step 5 — Write file
51
-
52
- Path: `~/.claude/skills/learned-<pattern-slug>-unverified/SKILL.md`.
53
- Never overwrite an existing learned skill directory — increment the slug
54
- (`learned-pattern-slug-2-unverified/`) if it already exists.
55
-
56
- ## Learned-skill template
57
-
58
- ```markdown
59
- ---
60
- name: learned-<pattern-slug>-unverified
61
- description: Use when <specific trigger for this reusable pattern>.
62
- ---
63
-
64
- # <Descriptive Pattern Name>
65
-
66
- **Extracted**: <YYYY-MM-DD>
67
- **Confidence**: Speculation (unverified)
68
- **Context**: <one-sentence applicability>
69
-
70
- ## Problem
71
- <what problem does this pattern solve — be specific>
72
-
73
- ## Solution
74
- <the pattern / technique / workaround>
75
-
76
- ## Example
77
- <code example if applicable — else a transcribed command sequence>
78
-
79
- ## Trigger Conditions
80
- <what situations should activate this skill>
81
-
82
- ## Verification Status
83
- - [ ] Human review passed
84
- - [ ] Multiple successful uses
85
- ```
86
-
87
- ## Verification upgrade path
88
-
89
- 1. **Speculation** (this skill writes this level) — freshly extracted, unverified
90
- 2. **Inference** — after human review passes, rename the directory to remove
91
- `-unverified` and update the frontmatter name
92
- 3. **Fact** — after multiple successful uses confirm the pattern
93
-
94
- ## What NOT to extract
95
-
96
- - Simple typo fixes
97
- - One-time issues (API outage, transient CI flake)
98
- - Patterns too project-specific to reuse (belongs in project docs, not a skill)
99
- - Anything already captured in CLAUDE.md or equivalent project instructions
100
-
101
- ## Approval boundary
102
-
103
- Ask the user directly before writing. No Ultra MCP or legacy interaction wrapper is involved.
104
-
105
- ## What this skill DOES NOT do
106
-
107
- - Does NOT modify state.db
108
- - Does NOT save without user approval
109
- - Does NOT extract more than one pattern per run
110
-
111
- ## Integration
112
-
113
- | | |
114
- |---|---|
115
- | **Input** | current session transcript / recent tool outputs |
116
- | **Output** | `~/.claude/skills/learned-<slug>-unverified/SKILL.md` |
117
- | **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,149 +1,65 @@
1
1
  ---
2
2
  name: ultra-change
3
- description: "Start or resume a continuous post-delivery change, compile bounded context, declare documentation impact, and route the change through implementation and convergence."
4
- runtime: all
5
- mcp_tools_required:
6
- - change.create
7
- - change.update
8
- - change.get
9
- - change.list
10
- - change.context
11
- - task.create
12
- - 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.
13
4
  ---
14
5
 
15
- # ultra-change — Continuous Change Entry
16
-
17
- Use this workflow for daily fixes, small features, redesigns, and incidents after
18
- the initial `init → research → plan → dev → test → deliver` baseline exists.
19
- Each piece of work becomes one durable change unit instead of an informal edit
20
- that drifts away from specifications and verification evidence.
21
-
22
- ## Authority and provider boundary
23
-
24
- - `.ultra/state.db` is authoritative for the change, its tasks, events, incidents,
25
- context snapshots, and projection status.
26
- - `.ultra/changes/active/<change-id>/` contains inspectable artifacts, not a
27
- second state authority.
28
- - Memory and code graph are external providers. Pass only metadata references:
29
- `provider`, `project`, `reference`, `revision`, `indexed_head`, and `status`.
30
- - Never paste recalled memories, graph nodes, embeddings, summaries, or provider
31
- payloads into `provider_refs`. If provider data is unavailable, record
32
- `status: unavailable` and continue with current-checkout evidence.
33
- - If any required change/task MCP operation is unavailable, stop. Do not edit
34
- `state.db`, `tasks.json`, or context projections directly.
35
-
36
- ## Arguments
37
-
38
- - `$1`: existing change id, or a short title for a new change.
39
- - Optional flags/concepts: `quick`, `standard`, `major`, `incident` and an
40
- explicit documentation impact.
41
-
42
- ## 1. Resume before creating
43
-
44
- Call `change.list` for `active` and `blocked` changes. If `$1` matches an
45
- existing id, call `change.get` and resume it. If the request clearly belongs to
46
- an active change, show the match and continue there rather than creating a
47
- duplicate.
48
-
49
- Do not resume `ready`, `archived`, or `cancelled` work as a new mutation. Create
50
- a follow-up change that links to the prior archive in its intent.
51
-
52
- ## 2. Classify the change
53
-
54
- Choose the smallest honest kind:
55
-
56
- | Kind | Use when | Required convergence evidence |
57
- |---|---|---|
58
- | `quick` | localized fix or tiny behavior change | diff, tests, spec |
59
- | `standard` | normal feature or cross-file change | diff, tests, spec, docs, review |
60
- | `major` | architecture, public contract, migration, or broad redesign | diff, tests, spec, docs, review |
61
- | `incident` | canonical debug lane for a production/runtime failure | diagnosis, diff, tests |
62
-
63
- When uncertain between two kinds, choose the higher-risk kind. Classification
64
- changes the proof required; it must not be used to bypass evidence.
65
-
66
- ## 3. Declare intent and documentation impact
67
-
68
- Before implementation, write a concise intent with:
69
-
70
- - observed problem or requested outcome;
71
- - acceptance behavior and non-goals;
72
- - affected contract/surface;
73
- - recovery or rollback concern when material.
74
-
75
- Documentation impact is mandatory:
76
-
77
- - `required`: list every baseline document expected to change;
78
- - `none`: provide a concrete rationale;
79
- - `unknown`: allowed only while investigating and blocks convergence.
80
-
81
- Create the change with `change.create`. Use a stable kebab-case id. External
82
- provider references are optional and metadata-only.
83
-
84
- ## 4. Build the delta packet
85
-
86
- The change directory is the bounded execution packet:
87
-
88
- ```text
89
- .ultra/changes/active/<change-id>/
90
- intent.md
91
- context-manifest.json
92
- delta/ # required for standard and major
93
- plan.md # required for standard and major
94
- diagnosis.md # created and structurally required for incident
95
- verification.md # generated by convergence
96
- ```
97
-
98
- For `standard` and `major`, write delta documents under `delta/` describing
99
- what changes relative to the current baseline. Do not copy the whole baseline.
100
- Write `plan.md` with live entry points, files/contracts, tests, documentation,
101
- and rollback. For `quick`, add only artifacts needed to make the decision and
102
- evidence inspectable. For `incident`, complete the generated `diagnosis.md` with
103
- non-empty `Reproduction`, `Hypotheses`, `Root cause`, `Regression test`, and
104
- `Recovery` sections. Free-form convergence evidence never substitutes for this
105
- durable diagnosis artifact.
106
-
107
- Create at least one task through `task.create` with `change_id` set. Split only
108
- when ownership, dependencies, or independent verification justify it. All task
109
- status changes remain MCP-authoritative.
110
-
111
- ## 5. Compile task context
112
-
113
- Call `change.context` before implementation and again whenever any of these
114
- changes: git HEAD, task set, relevant specs, allowed paths, or provider revision.
115
- Supply only the minimum task/spec/path references needed for the current slice.
116
-
117
- Inspect `context-manifest.json` before handing work to an agent. A stale git head
118
- or task set is a hard signal to recompile. Provider `status: stale` is visible
119
- context, not permission to silently refresh or mutate the external provider.
120
-
121
- ## 6. Route execution
122
-
123
- - For `incident`, diagnosis is the first execution slice. Route it to the bundled
124
- `debugger` agent when the Host exposes native subagents; otherwise the primary
125
- Host follows the same four-phase method. Supply only the compiled change/task
126
- context. The primary Host owns the fix, updates `diagnosis.md`, and reruns the
127
- discriminating regression test.
128
- - Implement one linked task with `/ultra-dev <task-id>`.
129
- - Run `/ultra-test` for project-level evidence.
130
- - Run `/ultra-review` when the change kind requires review.
131
- - Update baseline docs declared in `docs_impact` during the change, not after
132
- memory has gone cold.
133
- - Finish with `/ultra-deliver`; it runs deterministic change convergence and
134
- archive reconciliation before release actions.
135
-
136
- If work exposes a new requirement, update the change intent/delta and recompile
137
- context before continuing. Never let code become the only record of the change.
138
-
139
- ## 7. Report
140
-
141
- Return the change id, kind, artifact root, linked tasks, documentation impact,
142
- context freshness, provider-reference status, and exact next workflow. Separate
143
- provider unavailability from an Ultra runtime incident.
144
-
145
- ## What this skill does not do
146
-
147
- - It does not implement, test, review, release, or repair runtime state.
148
- - It does not own or synchronize Memory/code-graph content.
149
- - It does not bypass user approval for destructive or external release actions.
6
+ # Open or resume a continuous change
7
+
8
+ Keep post-delivery work aligned through a delta, implementation, learning, and
9
+ convergence loop.
10
+
11
+ ## Authority boundary
12
+
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.