bmad-module-ultracode-goal 0.3.0 → 0.5.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/README.md +40 -108
- package/docs/404.md +7 -7
- package/docs/_internal/RELEASING.md +10 -10
- package/docs/_internal/STABILITY.md +11 -11
- package/docs/architecture.md +34 -70
- package/docs/comparison.md +81 -0
- package/docs/cross-session-recall.md +24 -24
- package/docs/gate-model.md +11 -11
- package/docs/getting-started.md +11 -37
- package/docs/health-check.md +12 -12
- package/docs/how-it-works.md +28 -28
- package/docs/index.md +17 -16
- package/docs/parallel-mode.md +9 -9
- package/docs/troubleshooting.md +12 -31
- package/docs/why-ultracode-goal.md +8 -50
- package/package.json +1 -1
- package/skills/ultracode-goal/SKILL.md +18 -8
- package/skills/ultracode-goal/assets/execute-epic.workflow.js +6 -7
- package/skills/ultracode-goal/assets/module-help.csv +2 -1
- package/skills/ultracode-goal/assets/module-setup.md +1 -1
- package/skills/ultracode-goal/assets/ucg-awareness/bmad-architecture.toml +22 -0
- package/skills/ultracode-goal/assets/ucg-awareness/bmad-create-epics-and-stories.toml +24 -0
- package/skills/ultracode-goal/assets/ucg-awareness/bmad-create-story.toml +23 -0
- package/skills/ultracode-goal/assets/ucg-awareness/bmad-prd.toml +21 -0
- package/skills/ultracode-goal/assets/ucg-awareness/bmad-testarch-nfr.toml +20 -0
- package/skills/ultracode-goal/assets/ucg-awareness/bmad-testarch-test-design.toml +23 -0
- package/skills/ultracode-goal/customize.toml +2 -1
- package/skills/ultracode-goal/references/define-done.md +4 -2
- package/skills/ultracode-goal/references/execute.md +10 -8
- package/skills/ultracode-goal/references/finalize.md +7 -6
- package/skills/ultracode-goal/references/gate.md +48 -4
- package/skills/ultracode-goal/references/health-check.md +15 -57
- package/skills/ultracode-goal/references/ingest-and-scope.md +13 -6
- package/skills/ultracode-goal/references/preflight.md +33 -8
- package/skills/ultracode-goal/scripts/formalize_check.py +1163 -0
- package/skills/ultracode-goal/scripts/gate_eval.py +89 -8
- package/skills/ultracode-goal/scripts/headless_envelope.py +100 -0
- package/skills/ultracode-goal/scripts/hooks/guard_pretooluse.py +1 -1
- package/skills/ultracode-goal/scripts/lib/mem_common.py +1 -1
- package/skills/ultracode-goal/scripts/mem_observation.py +1 -1
- package/skills/ultracode-goal/scripts/mem_recall.py +1 -1
- package/skills/ultracode-goal/scripts/merge_customization.py +446 -0
- package/skills/ultracode-goal/scripts/merge_help_csv.py +9 -8
- package/skills/ultracode-goal/scripts/preflight_check.py +86 -10
- package/skills/ultracode-goal/skills/ucg-formalize/SKILL.md +210 -0
- package/tools/cli/lib/help-catalog.js +4 -3
- package/tools/cli/lib/ide-skills.js +4 -30
- package/tools/cli/lib/installer.js +157 -3
- package/tools/cli/lib/platform-codes.yaml +9 -206
- package/tools/cli/lib/ui.js +21 -54
- package/website/astro.config.mjs +1 -0
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"name": "bmad-module-ultracode-goal",
|
|
20
20
|
"source": "./",
|
|
21
21
|
"description": "Supercharges BMAD with Claude Code Goal Mode, Auto Mode, and Auto Memory: autonomous Epic execution to a machine-checked, TEA-gated Definition-of-Done. Execute Epics. Accumulate Knowledge. Deliver Outcomes.",
|
|
22
|
-
"version": "0.
|
|
22
|
+
"version": "0.5.0",
|
|
23
23
|
"author": {
|
|
24
24
|
"name": "Armel"
|
|
25
25
|
},
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
<img src="docs/assets/ucg-logo.svg" alt="UltraCode Goal
|
|
3
|
+
<img src="docs/assets/ucg-logo.svg" alt="UltraCode Goal: six stage nodes orbiting a deterministic gate whose verdict reads PASS" width="190"/>
|
|
4
4
|
|
|
5
5
|
# UltraCode Goal (UCG)
|
|
6
6
|
|
|
@@ -16,11 +16,9 @@
|
|
|
16
16
|
[](https://armelhbobdad.github.io/bmad-module-ultracode-goal/)
|
|
17
17
|
[](https://github.com/armelhbobdad/bmad-module-ultracode-goal/stargazers)
|
|
18
18
|
|
|
19
|
-
**Built for [Claude Code](https://www.anthropic.com/claude-code)
|
|
19
|
+
**Built for [Claude Code](https://www.anthropic.com/claude-code), and only Claude Code.** UCG composes `/goal`, Auto Mode, Auto Memory, and runtime hooks; the autonomous run itself requires Claude Code.
|
|
20
20
|
|
|
21
|
-
_UCG is a standalone [BMAD](https://github.com/bmad-code-org/BMAD-METHOD) module that delivers a BMAD Epic end to end without a babysitter. It preflights to a remediated green light, turns acceptance criteria into executable tests with the Test Architect (TEA), and advances a story only when a deterministic script reads `PASS` from TEA's gate artifact
|
|
22
|
-
|
|
23
|
-
**If UCG shipped an epic while you slept, give it a ⭐ — it helps others find this tool.**
|
|
21
|
+
_UCG is a standalone [BMAD](https://github.com/bmad-code-org/BMAD-METHOD) module that delivers a BMAD Epic end to end without a babysitter. It preflights to a remediated green light, turns acceptance criteria into executable tests with the Test Architect (TEA), and advances a story only when a deterministic script reads `PASS` from TEA's gate artifact, not when the model decides it feels done._
|
|
24
22
|
|
|
25
23
|
</div>
|
|
26
24
|
|
|
@@ -28,7 +26,7 @@ _UCG is a standalone [BMAD](https://github.com/bmad-code-org/BMAD-METHOD) module
|
|
|
28
26
|
|
|
29
27
|
## The Problem
|
|
30
28
|
|
|
31
|
-
You hand an agent an epic and tell it to "build until done." It runs, it commits, it declares victory. At review time you discover "done" meant "the model felt done."
|
|
29
|
+
You hand an agent an epic and tell it to "build until done." It runs, it commits, it declares victory. At review time you discover "done" meant "the model felt done." Four mechanics, not vibes, make that the default:
|
|
32
30
|
|
|
33
31
|
- **The `/goal` evaluator only sees the transcript.** It cannot open the gate artifact TEA wrote to disk. So the thing deciding completion is reading a story _about_ the work, not the verdict _on_ the work.
|
|
34
32
|
- **A model grading its own output is the fox auditing the henhouse.** Self-assessment is the weakest possible signal for a release gate, and it is exactly the signal you get by default.
|
|
@@ -37,13 +35,11 @@ You hand an agent an epic and tell it to "build until done." It runs, it commits
|
|
|
37
35
|
|
|
38
36
|
UCG exists because the documented mechanics make the intuitive shortcut wrong.
|
|
39
37
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
**Before** — you babysit an epic story-by-story, approving each step, or you let an agent run unattended and find out at review time that its definition of "done" was its own opinion of its own work.
|
|
38
|
+
## The Fix
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
UCG preflights the epic to a remediated green light before anything launches, turns each story's acceptance criteria into red-phase tests with TEA, and advances only when `gate_eval.py` reads `PASS` from TEA's deterministic `gate-decision.json`. Completion is a fact on disk, not a feeling in the transcript.
|
|
45
41
|
|
|
46
|
-
That verdict is a small, real JSON object
|
|
42
|
+
That verdict is a small, real JSON object; here is the actual output of `gate_eval.py` reading a passing gate file (`--profile light`):
|
|
47
43
|
|
|
48
44
|
```json
|
|
49
45
|
{
|
|
@@ -61,39 +57,31 @@ That verdict is a small, real JSON object. Here is the actual output of `gate_ev
|
|
|
61
57
|
}
|
|
62
58
|
```
|
|
63
59
|
|
|
64
|
-
The `gate_status` comes straight from TEA's artifact
|
|
60
|
+
The `gate_status` comes straight from TEA's artifact: `gate_eval.py` never re-derives the thresholds; it reads the status as given and maps it to a `verdict` (`PASS`/`WAIVED` → advance, `CONCERNS` → defer, `FAIL` → reloop, `NOT_EVALUATED` → escalate). Under `--profile production` the same run additionally ANDs two signals: `nfr_status` and `review_score` populate, and any failure downgrades an otherwise-`advance` verdict to `reloop`. The contract is fail-closed: a missing or unparseable signal counts as a _failing_ one, so prose drift degrades to a conservative re-loop, never a silent false-advance.
|
|
65
61
|
|
|
66
62
|
## Install
|
|
67
63
|
|
|
68
|
-
Requires [Claude Code](https://www.anthropic.com/claude-code) (the runtime UCG conducts
|
|
64
|
+
Requires [Claude Code](https://www.anthropic.com/claude-code) (the runtime UCG conducts), [Node.js](https://nodejs.org/) >= 22, [Python](https://www.python.org/) >= 3.10, [uv](https://docs.astral.sh/uv/), plus `git` and `gh` on PATH.
|
|
69
65
|
|
|
70
66
|
```bash
|
|
71
67
|
npx bmad-module-ultracode-goal install
|
|
72
68
|
```
|
|
73
69
|
|
|
74
|
-
You'll be prompted for a project name
|
|
75
|
-
|
|
76
|
-
> **Hook security:** UCG installs `PreToolUse`/`Stop` hooks into your machine-local, gitignored `.claude/settings.local.json` at preflight — never into a committed file. They run zero-dependency Python scripts shipped in the skill. See [SECURITY.md](SECURITY.md) for exactly what they execute and how to remove them.
|
|
70
|
+
You'll be prompted for a project name and whether to install the learning material; the skill installs for Claude Code. UCG is also available through the Claude plugin marketplace. See [Getting Started](./docs/getting-started.md) for that path.
|
|
77
71
|
|
|
78
|
-
UCG
|
|
72
|
+
> **Hook security:** UCG installs `PreToolUse`/`Stop` hooks into your machine-local, gitignored `.claude/settings.local.json` at preflight, never into a committed file. They run zero-dependency Python scripts shipped in the skill. See [SECURITY.md](SECURITY.md) for exactly what they execute and how to remove them.
|
|
79
73
|
|
|
80
74
|
## Quick Start
|
|
81
75
|
|
|
82
|
-
Invoke the skill in natural language
|
|
83
|
-
|
|
84
|
-
- `--light` — run the **trace gate only** (the production default runs the full TEA gate set).
|
|
85
|
-
- `--parallel` — opt into the **experimental** worktree fan-out instead of the sequential `/goal` spine.
|
|
86
|
-
- `--yes` — skip Stage 1's open-floor invite and the launch confirm. It **never** skips the hard preflight gate.
|
|
87
|
-
- `-H` — headless: run non-interactively and emit the five-key status JSON at every exit point.
|
|
88
|
-
- `--retro` — run the close-out retrospective (interactive runs offer it anyway; headless runs it only when this flag is passed).
|
|
89
|
-
|
|
90
|
-
See [How It Works](./docs/how-it-works.md) for the full stage-by-stage walkthrough and headless contract.
|
|
76
|
+
Invoke the skill in natural language: "run this epic autonomously," "execute this epic," or `ultracode goal`. The conductor ingests the epic, preflights, defines done with TEA, executes, gates, and finalizes. Flags shape the run:
|
|
91
77
|
|
|
92
|
-
|
|
78
|
+
- `--light`: run the **trace gate only** (the production default runs the full TEA gate set).
|
|
79
|
+
- `--parallel`: opt into the **experimental** worktree fan-out instead of the sequential `/goal` spine.
|
|
80
|
+
- `--yes`: skip Stage 1's open-floor invite and the launch confirm. It **never** skips the hard preflight gate.
|
|
81
|
+
- `-H`: headless: run non-interactively and emit the five-key status JSON at every exit point.
|
|
82
|
+
- `--retro`: run the close-out retrospective (interactive runs offer it anyway; headless runs it only when this flag is passed).
|
|
93
83
|
|
|
94
|
-
|
|
95
|
-
- **Anyone burned by "the agent said it was done"** and who wants completion decided by a file on disk they can read themselves.
|
|
96
|
-
- **Engineers who want rollback they can trust** — every green story is one git commit on an isolated epic branch, not a `/rewind` checkpoint that misses Bash changes.
|
|
84
|
+
See [How It Works](./docs/how-it-works.md) for the full six-stage walkthrough, routing conditions, and the headless contract.
|
|
97
85
|
|
|
98
86
|
## How UCG Compares
|
|
99
87
|
|
|
@@ -102,53 +90,20 @@ A skeptical reader is probably already running one of these. Here is the honest
|
|
|
102
90
|
| | **UltraCode Goal** | Hand-driven `/goal` per story | Plain Auto Mode | CI-only gating |
|
|
103
91
|
| -------------------------- | ---------------------------------------------------- | ------------------------------------ | -------------------------------- | ------------------------------------ |
|
|
104
92
|
| Completion authority | `gate_eval.py` reads TEA's `gate-decision.json` | you, story by story | the model's self-assessment | CI, but only after the agent stops |
|
|
105
|
-
| Preflight autonomy gate | hard-gate to remediated green (intervention budget 0)| ad hoc, per story | none | none
|
|
93
|
+
| Preflight autonomy gate | hard-gate to remediated green (intervention budget 0)| ad hoc, per story | none | none: CI runs post-hoc |
|
|
106
94
|
| Invariants enforcement | `PreToolUse` hooks in `settings.local.json` | your attention | prompt text (context, not a gate)| CI checks, after the fact |
|
|
107
95
|
| Rollback | git: epic branch, one commit per green story | manual | `/rewind` (misses Bash changes) | revert after merge |
|
|
108
96
|
| Knowledge capture | Auto Memory + CLAUDE.md split at Finalize | none structured | none structured | none |
|
|
109
97
|
|
|
110
|
-
The alternatives aren't bad
|
|
111
|
-
|
|
112
|
-
## How It Works
|
|
113
|
-
|
|
114
|
-
UCG runs six stages in order, each routing by the testable conditions stated in its reference file:
|
|
115
|
-
|
|
116
|
-
1. **Ingest & Scope** — resolve the epic and its artifacts; confirm the profile (production default / `--light`).
|
|
117
|
-
2. **Preflight** — auto-remediate ambers, then hard-gate on red; create the git branch, merge hooks, populate the allowlist.
|
|
118
|
-
3. **Define Done** — TEA test-design plus per-story ATDD turn acceptance criteria into executable, red-phase tests.
|
|
119
|
-
4. **Execute** — the sequential `/goal` spine (default) or the `--parallel` worktree fan-out.
|
|
120
|
-
5. **Gate** — `gate_eval.py` reads TEA's verdict and routes: advance / defer / reloop / escalate.
|
|
121
|
-
6. **Finalize** — Auto Memory capture, optional retrospective, decision-log audit, run report.
|
|
122
|
-
|
|
123
|
-
The run is a straight line until the gate, which branches — and a `reloop` sends the story back through Execute within budget, while an unresolved blocker stops the run rather than guessing:
|
|
124
|
-
|
|
125
|
-
```mermaid
|
|
126
|
-
flowchart TD
|
|
127
|
-
I["Stage 1 Ingest and Scope"] --> P{"Stage 2 Preflight hard gate"}
|
|
128
|
-
P -->|"red blocker"| STOP["STOP / blocked"]
|
|
129
|
-
P -->|"budget 0, green"| D["Stage 3 Define Done"]
|
|
130
|
-
D --> X["Stage 4 Execute"]
|
|
131
|
-
X --> G{"Stage 5 gate_eval.py reads TEA verdict"}
|
|
132
|
-
G -->|"advance, PASS or WAIVED"| F["Stage 6 Finalize"]
|
|
133
|
-
G -->|"defer, CONCERNS"| L["Ledger then advance"]
|
|
134
|
-
L --> F
|
|
135
|
-
G -->|"reloop, FAIL or signal downgrade"| X
|
|
136
|
-
G -->|"escalate, NOT_EVALUATED or budget out"| STOP
|
|
137
|
-
classDef gate fill:#6366F1,stroke:#4F46E5,color:#fff
|
|
138
|
-
class P,G gate
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
Three enforcement layers keep the autonomy honest:
|
|
98
|
+
The alternatives aren't bad; they solve different problems. **UCG solves exactly one: advancing an epic only when a deterministic script confirms the gate passed, and giving you the verdict JSON to check it yourself.**
|
|
142
99
|
|
|
143
|
-
-
|
|
144
|
-
- **`gate_eval.py` is the completion truth** — advancement is decided by reading TEA's gate file, never by the conductor's judgment and never by the `/goal` evaluator alone.
|
|
145
|
-
- **The Stop hook plus the turn cap are the budget** — the in-`/goal`-condition turn cap is the primary runaway guard; the `Stop` hook is a defensive third layer that records overruns against `max_turns_per_story` / `story_token_budget`.
|
|
100
|
+
UCG's closest peer is [bmad-auto](https://github.com/bmad-code-org/bmad-auto) (published under the bmad-code-org org), which makes the opposite architectural bet (a deterministic Python loop driving any CLI from outside the agent). For an honest, side-by-side look at where each one wins, see [UCG vs bmad-auto](https://armelhbobdad.github.io/bmad-module-ultracode-goal/comparison/).
|
|
146
101
|
|
|
147
102
|
## Verifying
|
|
148
103
|
|
|
149
104
|
You don't have to take the gate's word for it. The deterministic pieces ship with a test suite, and you can run the evaluator on a real artifact yourself.
|
|
150
105
|
|
|
151
|
-
Run the Python suite (
|
|
106
|
+
Run the Python suite (318 tests across the preflight, gate, hook, readiness, memory, and customization scripts):
|
|
152
107
|
|
|
153
108
|
```bash
|
|
154
109
|
uv run --with pytest pytest skills/ultracode-goal/scripts/tests/ -v
|
|
@@ -162,46 +117,29 @@ uv run skills/ultracode-goal/scripts/gate_eval.py \
|
|
|
162
117
|
--profile light
|
|
163
118
|
```
|
|
164
119
|
|
|
165
|
-
The JSON it prints is the same object UCG routes on
|
|
166
|
-
|
|
167
|
-
## Optional: Cross-Session Recall
|
|
168
|
-
|
|
169
|
-
If you run claude-mem, this executor consults your past runs in this codebase before it scopes a new Epic and before its preflight gate — so it surfaces what bit you here last time instead of starting amnesiac. You stay in the driver's seat; it informs, it doesn't auto-decide.
|
|
170
|
-
|
|
171
|
-
Optional. Powered by claude-mem if installed; a silent no-op if not. It is advisory only — never in the gate path — and off by default. Enable it in `_bmad/custom/ultracode-goal.toml`:
|
|
172
|
-
|
|
173
|
-
```toml
|
|
174
|
-
[workflow]
|
|
175
|
-
cross_session_recall = "on"
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
See [Cross-Session Recall](./docs/cross-session-recall.md) for the touchpoints, the trust model, and the OFF-coherence disclosure.
|
|
179
|
-
|
|
180
|
-
## Help UCG Improve
|
|
181
|
-
|
|
182
|
-
Every run that reaches Finalize ends with a self-improvement check. When it finds a defect in its own stage references, it can file a GitHub issue — deduplicated by a deterministic fingerprint so re-reporting is safe — with your approval. Headless runs queue findings to a machine-local cache instead of filing live. The fingerprint is install-mode-invariant, so the same defect maps to the same issue whether it surfaced in a dev checkout or an installed tree. **Please let runs finish through Finalize**, or [open an issue](https://github.com/armelhbobdad/bmad-module-ultracode-goal/issues/new/choose) directly. If UCG saved you an afternoon of babysitting, a ⭐ helps others find it.
|
|
120
|
+
The JSON it prints is the same object UCG routes on: `verdict`, `gate_status`, and the `reasons` trail that explains how it got there. Nothing is hidden behind the model.
|
|
183
121
|
|
|
184
122
|
## Learn More
|
|
185
123
|
|
|
186
|
-
The docs are organized into three buckets
|
|
124
|
+
The docs are organized into three buckets: **Why** (start here), **Try** (do stuff), and **Reference** (look things up):
|
|
187
125
|
|
|
188
|
-
**Why**
|
|
189
|
-
|
|
190
|
-
- **[Why UltraCode Goal](./docs/why-ultracode-goal.md)** — the problem, the three enforcement layers, and when not to use it.
|
|
126
|
+
**Why**: **[Why UltraCode Goal](./docs/why-ultracode-goal.md)**: the problem, the three enforcement layers, and when not to use it.
|
|
191
127
|
|
|
192
128
|
**Try**
|
|
193
129
|
|
|
194
|
-
- **[Getting Started](./docs/getting-started.md)
|
|
195
|
-
- **[How It Works](./docs/how-it-works.md)
|
|
196
|
-
- **[Parallel Mode](./docs/parallel-mode.md)
|
|
130
|
+
- **[Getting Started](./docs/getting-started.md)**: install, prerequisites, the flags, and your first autonomous run.
|
|
131
|
+
- **[How It Works](./docs/how-it-works.md)**: the six stages, their routing conditions, and the headless five-key emit.
|
|
132
|
+
- **[Parallel Mode](./docs/parallel-mode.md)**: the experimental worktree fan-out and its known limits.
|
|
197
133
|
|
|
198
134
|
**Reference**
|
|
199
135
|
|
|
200
|
-
- **[Architecture](./docs/architecture.md)
|
|
201
|
-
- **[Gate Model](./docs/gate-model.md)
|
|
202
|
-
- **[Health Check](./docs/health-check.md)
|
|
203
|
-
- **[Cross-Session Recall](./docs/cross-session-recall.md)
|
|
204
|
-
- **[Troubleshooting](./docs/troubleshooting.md)
|
|
136
|
+
- **[Architecture](./docs/architecture.md)**: the conductor model, enforcement layers in depth, and `customize.toml` resolution.
|
|
137
|
+
- **[Gate Model](./docs/gate-model.md)**: how `gate_eval.py` maps `gate_status` to a verdict, and the production AND-signals.
|
|
138
|
+
- **[Health Check](./docs/health-check.md)**: the terminal self-improvement loop: what it sends, privacy, and how to disable it.
|
|
139
|
+
- **[Cross-Session Recall](./docs/cross-session-recall.md)**: the optional claude-mem integration: touchpoints, trust model, and how to enable it.
|
|
140
|
+
- **[Troubleshooting](./docs/troubleshooting.md)**: real failure modes and their remediations.
|
|
141
|
+
|
|
142
|
+
Every run that reaches Finalize ends with a self-improvement check that can file a deduplicated GitHub issue with your approval, so **please let runs finish through Finalize**, or [open an issue](https://github.com/armelhbobdad/bmad-module-ultracode-goal/issues/new/choose) directly. If UCG shipped an epic while you slept, a ⭐ helps others find it.
|
|
205
143
|
|
|
206
144
|
## Acknowledgements
|
|
207
145
|
|
|
@@ -210,23 +148,17 @@ UCG is a conductor over primitives it does not replace. It builds on:
|
|
|
210
148
|
| Tool | Role in UCG |
|
|
211
149
|
| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
|
|
212
150
|
| [BMAD Method](https://github.com/bmad-code-org/BMAD-METHOD) | The epic toolbox UCG orchestrates (sprint planning, story creation, dev, review) |
|
|
213
|
-
| [TEA Test Architect](https://github.com/bmad-code-org/BMAD-METHOD) | Machine-checked quality gates
|
|
214
|
-
| [Claude Code](https://www.anthropic.com/claude-code) | `/goal`, Auto Mode, Auto Memory, hooks, and git worktrees
|
|
151
|
+
| [TEA Test Architect](https://github.com/bmad-code-org/BMAD-METHOD) | Machine-checked quality gates: test-design, ATDD, NFR, trace; the gate artifact |
|
|
152
|
+
| [Claude Code](https://www.anthropic.com/claude-code) | `/goal`, Auto Mode, Auto Memory, hooks, and git worktrees, the primitives UCG composes |
|
|
215
153
|
|
|
216
154
|
## Contributing
|
|
217
155
|
|
|
218
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
219
|
-
|
|
220
|
-
## Changelog
|
|
221
|
-
|
|
222
|
-
Past releases are documented in [CHANGELOG.md](CHANGELOG.md).
|
|
156
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. Past releases are documented in [CHANGELOG.md](CHANGELOG.md), and [CONTRIBUTORS.md](CONTRIBUTORS.md) lists contributors.
|
|
223
157
|
|
|
224
158
|
## License
|
|
225
159
|
|
|
226
|
-
MIT License
|
|
160
|
+
MIT License. See [LICENSE](LICENSE) for details.
|
|
227
161
|
|
|
228
162
|
---
|
|
229
163
|
|
|
230
|
-
**UltraCode Goal (UCG)
|
|
231
|
-
|
|
232
|
-
See [CONTRIBUTORS.md](CONTRIBUTORS.md) for contributor information.
|
|
164
|
+
**UltraCode Goal (UCG)**: A standalone [BMAD](https://github.com/bmad-code-org/BMAD-METHOD) module for autonomous epic delivery.
|
package/docs/404.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Page Not Found
|
|
3
|
-
description: That URL did not resolve. A path the docs cannot verify does not pass
|
|
3
|
+
description: That URL did not resolve. A path the docs cannot verify does not pass; use the search or the cited links below to continue.
|
|
4
4
|
template: splash
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
## 404
|
|
7
|
+
## 404: this URL does not pass
|
|
8
8
|
|
|
9
|
-
No page resolves to that address. In the spirit of the rest of this project, a claim that cannot be verified does not get to advance
|
|
9
|
+
No page resolves to that address. In the spirit of the rest of this project, a claim that cannot be verified does not get to advance, and that includes a URL the docs site made to itself.
|
|
10
10
|
|
|
11
11
|
Use the **search bar** at the top of the page, or jump to one of these pages that *do* resolve, grouped the way the sidebar groups them:
|
|
12
12
|
|
|
13
|
-
**Why
|
|
13
|
+
**Why**: [Why UltraCode Goal](./why-ultracode-goal.md)
|
|
14
14
|
|
|
15
|
-
**Try
|
|
15
|
+
**Try**: [Getting Started](./getting-started.md) · [How It Works](./how-it-works.md) · [Parallel Mode](./parallel-mode.md)
|
|
16
16
|
|
|
17
|
-
**Reference
|
|
17
|
+
**Reference**: [Architecture](./architecture.md) · [Gate Model](./gate-model.md) · [Health Check](./health-check.md) · [Troubleshooting](./troubleshooting.md)
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
### Think this page should exist?
|
|
22
22
|
|
|
23
|
-
A missing page is drift
|
|
23
|
+
A missing page is drift: a link the docs made to themselves that no longer reads green. [Open an issue](https://github.com/armelhbobdad/bmad-module-ultracode-goal/issues/new/choose) with the URL you tried. The same instinct that makes UltraCode Goal re-loop on a failing gate applies here: if a broken path slipped through, it is a defect worth reporting.
|
|
@@ -3,14 +3,14 @@ title: Releasing
|
|
|
3
3
|
description: Maintainer runbook for cutting an UltraCode Goal release via the manual-dispatch, OIDC trusted-publishing release.yaml workflow.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Maintainer runbook for cutting a release of `bmad-module-ultracode-goal`. The canonical release path is [`.github/workflows/release.yaml`](../../.github/workflows/release.yaml)
|
|
6
|
+
Maintainer runbook for cutting a release of `bmad-module-ultracode-goal`. The canonical release path is [`.github/workflows/release.yaml`](../../.github/workflows/release.yaml): manual dispatch, OIDC trusted publishing, no token secrets.
|
|
7
7
|
|
|
8
8
|
## How a release works
|
|
9
9
|
|
|
10
10
|
Dispatching `release.yaml` from `main` runs, in order:
|
|
11
11
|
|
|
12
12
|
1. Quality gate (`npm test`) on the release runner.
|
|
13
|
-
2. Version bump (`npm version
|
|
13
|
+
2. Version bump (`npm version`: `alpha`/`beta`/`rc` prerelease or `patch`/`minor`/`major`).
|
|
14
14
|
3. Sync `.claude-plugin/marketplace.json` `.plugins[0].version` to the new version (atomic jq edit).
|
|
15
15
|
4. CHANGELOG update via `conventional-changelog-cli`, preamble restored to Keep-a-Changelog shape.
|
|
16
16
|
5. Pre-publish `npm publish --dry-run` (catches package validation failures before anything is pushed).
|
|
@@ -83,10 +83,10 @@ Create an Environment named `release` with `armelhbobdad` as a required reviewer
|
|
|
83
83
|
On [npmjs.com](https://www.npmjs.com/) → package settings → Trusted Publisher, register:
|
|
84
84
|
|
|
85
85
|
- Repository: `armelhbobdad/bmad-module-ultracode-goal`
|
|
86
|
-
- Workflow filename: `release.yaml` (character-for-character
|
|
86
|
+
- Workflow filename: `release.yaml` (character-for-character: renaming the file breaks publishing)
|
|
87
87
|
- Environment: `release`
|
|
88
88
|
|
|
89
|
-
The workflow upgrades npm to ≥ 11.5.1 (the OIDC trusted-publishing floor) and pins `NPM_TOKEN: ""` on both publish steps so a stale runner-env token can never be picked up silently. Note: the very first publish of a brand-new package may need to be performed manually (`npm publish` with a granular token) before Trusted Publisher can be attached to the package
|
|
89
|
+
The workflow upgrades npm to ≥ 11.5.1 (the OIDC trusted-publishing floor) and pins `NPM_TOKEN: ""` on both publish steps so a stale runner-env token can never be picked up silently. Note: the very first publish of a brand-new package may need to be performed manually (`npm publish` with a granular token) before Trusted Publisher can be attached to the package. Check current npm rules when cutting `0.1.0`.
|
|
90
90
|
|
|
91
91
|
### 5. Repo settings: auto-merge + Actions PR creation
|
|
92
92
|
|
|
@@ -96,7 +96,7 @@ gh api --method PUT /repos/armelhbobdad/bmad-module-ultracode-goal/actions/permi
|
|
|
96
96
|
-f default_workflow_permissions=read -F can_approve_pull_request_reviews=true
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
Without `allow_auto_merge`, `gh pr merge --auto` in the workflow fails. Without `can_approve_pull_request_reviews` ("Allow GitHub Actions to create and approve pull requests" in Settings → Actions → General
|
|
99
|
+
Without `allow_auto_merge`, `gh pr merge --auto` in the workflow fails. Without `can_approve_pull_request_reviews` ("Allow GitHub Actions to create and approve pull requests" in Settings → Actions → General, **off by default**), the `Open bot PR` step fails with `GraphQL: GitHub Actions is not permitted to create or approve pull requests`. The workflow-level `permissions: pull-requests: write` declaration is necessary but NOT sufficient; this repo-level toggle gates it independently.
|
|
100
100
|
|
|
101
101
|
### 6. Health-check labels
|
|
102
102
|
|
|
@@ -110,21 +110,21 @@ done
|
|
|
110
110
|
|
|
111
111
|
## Version-coupling invariant
|
|
112
112
|
|
|
113
|
-
`package.json` `version` and `.claude-plugin/marketplace.json` `.plugins[0].version` must always be equal. The release workflow enforces this at release time (step 3); between releases, keep them equal by hand
|
|
113
|
+
`package.json` `version` and `.claude-plugin/marketplace.json` `.plugins[0].version` must always be equal. The release workflow enforces this at release time (step 3); between releases, keep them equal by hand. `npm run test:install` asserts the coupling and fails the quality gate on drift.
|
|
114
114
|
|
|
115
115
|
## Cutting a release
|
|
116
116
|
|
|
117
117
|
1. Confirm `main` is green and the working tree state you want to ship is merged.
|
|
118
|
-
2. Actions → Release → Run workflow → choose the bump type. Prefer an `alpha` for the first cut after any pipeline change
|
|
118
|
+
2. Actions → Release → Run workflow → choose the bump type. Prefer an `alpha` for the first cut after any pipeline change; it exercises the full path with a low-stakes version.
|
|
119
119
|
3. Approve the `release` environment run when prompted.
|
|
120
120
|
4. Approve (or admin-merge) the bot PR when checks are green.
|
|
121
|
-
5. After publish, dispatch `install-smoke.yaml` with the new version
|
|
121
|
+
5. After publish, dispatch `install-smoke.yaml` with the new version; it verifies `npx bmad-module-ultracode-goal@<version> --version` on ubuntu/windows/macos.
|
|
122
122
|
|
|
123
123
|
## Rollback playbook
|
|
124
124
|
|
|
125
125
|
npm unpublish is heavily restricted; prefer forward fixes.
|
|
126
126
|
|
|
127
|
-
- **Bad publish, caught quickly:** `npm deprecate bmad-module-ultracode-goal@X.Y.Z "broken
|
|
127
|
+
- **Bad publish, caught quickly:** `npm deprecate bmad-module-ultracode-goal@X.Y.Z "broken: use X.Y.Z+1"`, then cut a patch release.
|
|
128
128
|
- **Bad prerelease tag:** point the dist-tag back: `npm dist-tag add bmad-module-ultracode-goal@<good> alpha`.
|
|
129
129
|
- **Bad git tag (not yet published):** delete the tag (`git push origin :refs/tags/vX.Y.Z`) and the bot PR/branch, then re-dispatch.
|
|
130
|
-
- **Workflow died mid-flow:** the PR (if opened) is left open by design for inspection. Close it, delete the temp branch, fix the cause, re-dispatch
|
|
130
|
+
- **Workflow died mid-flow:** the PR (if opened) is left open by design for inspection. Close it, delete the temp branch, fix the cause, re-dispatch; the `run_id`-suffixed branch name prevents collisions on retry.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Stability and Public Contract
|
|
3
|
-
description: The 0.1.0 stability posture
|
|
3
|
+
description: "The 0.1.0 stability posture: which CLI, config, JSON, and gate surfaces are the supported public contract versus everything that is @internal and free to change."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
> **Status:** 0.x
|
|
6
|
+
> **Status:** 0.x, pre-1.0. The surfaces below are the intended public contract at `0.1.0`. Per [Semantic Versioning 2.0.0](https://semver.org/), a `0.x` series makes no stability guarantee across minor versions; this document records what we *try* to hold stable and what is explicitly `@internal`, so a consumer knows which surfaces to pin against and which to treat as free to change.
|
|
7
7
|
|
|
8
8
|
This is the stability posture for `bmad-module-ultracode-goal` at `0.1.0`. It enumerates the surfaces a downstream consumer or automator may reasonably depend on, versus everything else, which is `@internal`.
|
|
9
9
|
|
|
@@ -20,7 +20,7 @@ The installer CLI is invoked via `npx bmad-module-ultracode-goal <subcommand>`.
|
|
|
20
20
|
|
|
21
21
|
### The `[workflow]` customize.toml keys
|
|
22
22
|
|
|
23
|
-
The keys in the shipped `[workflow]` block of `customize.toml`
|
|
23
|
+
The keys in the shipped `[workflow]` block of `customize.toml` (including `persistent_facts`, `tea_config_path`, `trace_output_dir`, `implementation_artifacts`, `deferred_work_path`, `epic_branch_prefix`, `protected_branches`, `max_turns_per_story`, `story_token_budget`, `parallel_max_concurrency`, `allowlist_commands`, and `on_epic_complete`) are the supported override surface. Teams and users override them in `_bmad/custom/ultracode-goal.toml` (and `.user.toml`) with base → team → user resolution (scalars override, tables deep-merge, arrays append). Renaming or removing a key, or changing how it resolves, is a contract change. See [architecture](../architecture.md).
|
|
24
24
|
|
|
25
25
|
### The headless five-key JSON emit shape
|
|
26
26
|
|
|
@@ -39,7 +39,7 @@ An automator parses this one schema regardless of where the run stopped. Changin
|
|
|
39
39
|
|
|
40
40
|
### The skill name and invocation phrases
|
|
41
41
|
|
|
42
|
-
The skill name `ultracode-goal` and its documented invocation phrases
|
|
42
|
+
The skill name `ultracode-goal` and its documented invocation phrases ("run an epic autonomously", "execute this epic", "ultracode goal", "autonomously deliver the epic") are part of the contract. Removing or renaming the skill, or dropping a documented trigger phrase, is a contract change.
|
|
43
43
|
|
|
44
44
|
### gate_eval.py CLI and verdict vocabulary
|
|
45
45
|
|
|
@@ -63,16 +63,16 @@ flowchart LR
|
|
|
63
63
|
|
|
64
64
|
The printed JSON object's key set (`verdict`, `gate_status`, `p0_status`, `p1_status`, `overall_status`, `nfr_status`, `review_score`, `reasons`) is the consumable shape; the human-readable `reasons` strings are not contractual wording.
|
|
65
65
|
|
|
66
|
-
## @internal
|
|
66
|
+
## @internal: not covered
|
|
67
67
|
|
|
68
68
|
Everything not enumerated above is `@internal` and may change in any `0.x` release without a deprecation note. Do not pin against:
|
|
69
69
|
|
|
70
|
-
- **Installer library internals
|
|
71
|
-
- **Reference file structure
|
|
72
|
-
- **Script internals
|
|
73
|
-
- **The experimental `--parallel` workflow
|
|
74
|
-
- **`_bmad-output/` artifact layout
|
|
70
|
+
- **Installer library internals**: the implementation behind the CLI subcommands; what is covered is the observable subcommand surface, not how the files get placed.
|
|
71
|
+
- **Reference file structure**: the `references/*.md` stage files' internal structure, step ordering, prose, and section headings. The stage *names* are referenced by the health-check fingerprint (see below) but the file contents are an authoring surface.
|
|
72
|
+
- **Script internals**: the internal functions, regexes, and intermediate behavior of `preflight_check.py`, `gate_eval.py`, `health_check_fp.py`, and the hook scripts. The covered surface is `gate_eval.py`'s CLI and verdict vocabulary above; everything else (the `preflight_check.py` JSON shape, the fingerprint tuple format, the hook env-var names) is internal and may change.
|
|
73
|
+
- **The experimental `--parallel` workflow**: `assets/execute-epic.workflow.js`, the `/ultracode-goal-execute` registration, its args binding, its return shape, and `parallel_max_concurrency`'s runtime behavior are explicitly experimental and excluded from the contract. See [parallel mode](../parallel-mode.md).
|
|
74
|
+
- **`_bmad-output/` artifact layout**: run folders, the decision log, `run-report.md`, `run-status.json`, the deferred-work ledger, and the improvement queue are run outputs, not a downstream-consumable schema. The headless emit shape (covered above) is the supported way to locate these paths programmatically.
|
|
75
75
|
|
|
76
76
|
## SemVer note
|
|
77
77
|
|
|
78
|
-
This is a `0.x` module: **minor versions may break.** We try to hold the surfaces in [Public contract at 0.1.0](#public-contract-at-010) stable, and the two surfaces an automator is most likely to encode against
|
|
78
|
+
This is a `0.x` module: **minor versions may break.** We try to hold the surfaces in [Public contract at 0.1.0](#public-contract-at-010) stable, and the two surfaces an automator is most likely to encode against, the **headless five-key JSON emit shape** and the **`[workflow]` customize.toml keys**, get a deprecation note in `CHANGELOG.md` before changing. `@internal` surfaces change freely. Once the module reaches `1.0.0`, this document is superseded by a full SemVer contract.
|
package/docs/architecture.md
CHANGED
|
@@ -1,89 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Architecture
|
|
3
|
-
description: How UltraCode Goal works as a conductor over BMAD, TEA, and Claude Code primitives
|
|
3
|
+
description: "How UltraCode Goal works as a conductor over BMAD, TEA, and Claude Code primitives: the three enforcement layers, file layout, and customization resolution."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
UltraCode Goal is a conductor. It orchestrates the installed BMAD epic toolbox and the TEA gates, composing Claude Code primitives
|
|
6
|
+
UltraCode Goal is a conductor. It orchestrates the installed BMAD epic toolbox and the TEA gates, composing Claude Code primitives (`/goal`, Auto Mode, Auto Memory, hooks, git/worktree isolation) and replaces none of them. This page covers the conductor model, the three enforcement layers in depth, the file layout, customization resolution, and why the hooks live where they do.
|
|
7
7
|
|
|
8
8
|
## The conductor model
|
|
9
9
|
|
|
10
10
|
The skill owns no implementation logic of its own for building features or running tests. What it owns is the *order*, the *gates*, and the *enforcement*. It delegates:
|
|
11
11
|
|
|
12
|
-
- **Epic toolbox
|
|
13
|
-
- **TEA gates
|
|
14
|
-
- **Claude Code primitives
|
|
12
|
+
- **Epic toolbox**: `bmad-sprint-planning`, `bmad-create-story`, `bmad-check-implementation-readiness`, `bmad-dev-story`, `bmad-code-review`, `bmad-correct-course`, `bmad-sprint-status`, `bmad-retrospective`.
|
|
13
|
+
- **TEA gates**: `bmad-testarch-framework`, `-ci`, `-test-design`, `-atdd`, `-automate`, `-test-review`, `-nfr`, `-trace`.
|
|
14
|
+
- **Claude Code primitives**: the `/goal` loop drives execution; Auto Mode and ultracode session effort make the unattended run possible; Auto Memory carries learnings forward; hooks enforce invariants; git branches and worktrees provide isolation and rollback.
|
|
15
15
|
|
|
16
16
|
Because it is a conductor, the truth of "is this done" lives in the artifacts its delegates produce, not in the conductor's own reasoning. That is the whole design: the model arranges the work, but a script reads the verdict.
|
|
17
17
|
|
|
18
|
-
The conductor sits between three sets of things it does not own — the BMAD epic toolbox it orchestrates, the TEA gates it sequences, and the Claude Code primitives it composes:
|
|
19
|
-
|
|
20
|
-
```mermaid
|
|
21
|
-
flowchart TD
|
|
22
|
-
UCG["UltraCode Goal conductor - owns order, gates, enforcement"]
|
|
23
|
-
subgraph toolbox["BMAD epic toolbox"]
|
|
24
|
-
SP["sprint-planning"]
|
|
25
|
-
CS["create-story"]
|
|
26
|
-
DS["dev-story"]
|
|
27
|
-
CR["code-review"]
|
|
28
|
-
CC["correct-course"]
|
|
29
|
-
end
|
|
30
|
-
subgraph tea["TEA gates"]
|
|
31
|
-
TD["test-design"]
|
|
32
|
-
ATDD["atdd"]
|
|
33
|
-
TR["trace writes gate-decision.json"]
|
|
34
|
-
NFR["nfr"]
|
|
35
|
-
end
|
|
36
|
-
subgraph cc["Claude Code primitives"]
|
|
37
|
-
GOAL["/goal loop"]
|
|
38
|
-
AUTO["Auto Mode"]
|
|
39
|
-
MEM["Auto Memory"]
|
|
40
|
-
HOOKS["PreToolUse + Stop hooks"]
|
|
41
|
-
GIT["git branch + worktrees"]
|
|
42
|
-
end
|
|
43
|
-
UCG -->|"delegates building"| toolbox
|
|
44
|
-
UCG -->|"sequences"| tea
|
|
45
|
-
UCG -->|"composes"| cc
|
|
46
|
-
classDef accent fill:#6366F1,stroke:#4F46E5,color:#fff
|
|
47
|
-
class UCG accent
|
|
48
|
-
```
|
|
49
|
-
|
|
50
18
|
## The three enforcement layers
|
|
51
19
|
|
|
52
20
|
These are the module's non-negotiables. Each exists because the documented mechanics make the intuitive shortcut wrong (see [why](why-ultracode-goal.md)).
|
|
53
21
|
|
|
54
22
|
### 1. Deterministic gate truth
|
|
55
23
|
|
|
56
|
-
`scripts/gate_eval.py` reads TEA's `gate-decision.json` and maps its gate status to a routing verdict. It never re-derives TEA's thresholds and never reads the transcript. The `/goal` evaluator that drives execution can only see what the run surfaces
|
|
57
|
-
|
|
58
|
-
The mapping is fixed, and in production two extra signals can only downgrade an `advance`, never lift a lower verdict:
|
|
59
|
-
|
|
60
|
-
```mermaid
|
|
61
|
-
flowchart TD
|
|
62
|
-
READ["gate_eval.py reads gate-decision.json"]
|
|
63
|
-
READ --> ST{"gate_status"}
|
|
64
|
-
ST -->|"PASS or WAIVED"| ADV["advance"]
|
|
65
|
-
ST -->|"CONCERNS"| DEF["defer - park to ledger, keep moving"]
|
|
66
|
-
ST -->|"FAIL"| REL["reloop - correct-course, re-run in budget"]
|
|
67
|
-
ST -->|"NOT_EVALUATED"| ESC["escalate - stop"]
|
|
68
|
-
ADV --> PROD{"production profile"}
|
|
69
|
-
PROD -->|"nfr FAIL, review under 80, Block, or unreadable signal"| REL
|
|
70
|
-
PROD -->|"both signals read and pass"| ADVOK["advance confirmed"]
|
|
71
|
-
classDef verdict fill:#4F46E5,stroke:#3730A3,color:#fff
|
|
72
|
-
class ADV,DEF,REL,ESC,ADVOK verdict
|
|
73
|
-
```
|
|
24
|
+
`scripts/gate_eval.py` reads TEA's `gate-decision.json` and maps its gate status to a routing verdict (`PASS`/`WAIVED` → advance, `CONCERNS` → defer, `FAIL` → reloop, `NOT_EVALUATED` → escalate). It never re-derives TEA's thresholds and never reads the transcript. The `/goal` evaluator that drives execution can only see what the run surfaces, it cannot open the gate file, so it is structurally incapable of being the completion authority. The script is. In production, two extra signals can only downgrade an `advance`, never lift a lower verdict. See the [gate model](gate-model.md) for the full mapping diagram, thresholds, and the fail-closed contract.
|
|
74
25
|
|
|
75
26
|
### 2. Hooks as invariants
|
|
76
27
|
|
|
77
28
|
Two invariants must hold for every commit, and neither can live in memory, which is context the model may or may not weigh:
|
|
78
29
|
|
|
79
|
-
- **`scripts/hooks/guard_pretooluse.py`** (PreToolUse)
|
|
80
|
-
- **`scripts/hooks/budget_stop.py`** (Stop)
|
|
30
|
+
- **`scripts/hooks/guard_pretooluse.py`** (PreToolUse): inspects each `git commit`/`git push`. It denies the command on a protected branch, and denies a `git commit` when no tests-ran marker (`<impl-artifacts>/.tests-ran-<story_id>`) exists for the current story. It returns a `deny` decision in the hook JSON and also exits 2 with the reason on stderr so older clients that ignore the JSON still block.
|
|
31
|
+
- **`scripts/hooks/budget_stop.py`** (Stop): counts turns and accumulated tokens for the current story against `max_turns_per_story` / `story_token_budget`. On overrun it writes an escalation marker and surfaces a message, then **lets the stop proceed**. Its documented limitation: a Stop hook fires only when Claude is already trying to stop, so it cannot interrupt a `/goal` condition mid-turn. The in-condition "stop after N turns" clause and the gate's re-loop budget are the real bounds; this hook is the third, defensive layer.
|
|
81
32
|
|
|
82
|
-
Both hooks read their config from env first (so the conductor injects per-run values) and fall back to hardcoded defaults (`main`/`master`, `25`, `1_500_000`, `ultracode/epic-`). Because of that fallback, a `customize.toml` override **silently no-ops at the enforcement layer** unless the conductor passes it through the hook env
|
|
33
|
+
Both hooks read their config from env first (so the conductor injects per-run values) and fall back to hardcoded defaults (`main`/`master`, `25`, `1_500_000`, `ultracode/epic-`). Because of that fallback, a `customize.toml` override **silently no-ops at the enforcement layer** unless the conductor passes it through the hook env, so preflight injects `ULTRACODE_PROTECTED_BRANCHES`, `ULTRACODE_IMPL_ARTIFACTS`, `ULTRACODE_MAX_TURNS`, `ULTRACODE_TOKEN_BUDGET`, and `ULTRACODE_EPIC_BRANCH_PREFIX`.
|
|
83
34
|
|
|
84
35
|
### 3. Budget enforcement
|
|
85
36
|
|
|
86
|
-
A runaway story is bounded by three layers in order of authority: the **in-condition** "…or stop after N turns" clause inside the `/goal` condition (the real in-loop bound), the **gate re-loop budget** (a `reloop` that would exceed `max_turns_per_story` or `story_token_budget` becomes `escalate`), and the **Stop hook** as the defensive backstop described above. Rollback is git, not `/rewind`
|
|
37
|
+
A runaway story is bounded by three layers in order of authority: the **in-condition** "…or stop after N turns" clause inside the `/goal` condition (the real in-loop bound), the **gate re-loop budget** (a `reloop` that would exceed `max_turns_per_story` or `story_token_budget` becomes `escalate`), and the **Stop hook** as the defensive backstop described above. Rollback is git, not `/rewind` (an Epic branch off a protected branch, one commit per green story, worktree isolation under `--parallel`) because `/rewind` checkpoints miss the Bash-driven changes that make up the run.
|
|
87
38
|
|
|
88
39
|
## File layout
|
|
89
40
|
|
|
@@ -94,37 +45,50 @@ skills/ultracode-goal/
|
|
|
94
45
|
├── SKILL.md # Entry point: overview, conventions, run modes,
|
|
95
46
|
│ # non-negotiables, the 6-stage table, headless contract
|
|
96
47
|
├── customize.toml # Config base layer (the [workflow] block)
|
|
97
|
-
├── references/ #
|
|
48
|
+
├── references/ # Loaded just-in-time
|
|
98
49
|
│ ├── ingest-and-scope.md # Stage 1
|
|
99
50
|
│ ├── preflight.md # Stage 2 (the autonomy gate)
|
|
100
51
|
│ ├── define-done.md # Stage 3
|
|
101
52
|
│ ├── execute.md # Stage 4
|
|
102
53
|
│ ├── gate.md # Stage 5
|
|
103
|
-
│
|
|
54
|
+
│ ├── finalize.md # Stage 6
|
|
55
|
+
│ └── health-check.md # Finalize self-improvement reflection
|
|
104
56
|
├── scripts/ # Deterministic truth (run via `uv`)
|
|
105
57
|
│ ├── preflight_check.py # mechanical preflight facts + blocker budget
|
|
106
58
|
│ ├── gate_eval.py # gate status -> verdict (the completion authority)
|
|
59
|
+
│ ├── formalize_check.py # readiness kernel behind the /ucg-formalize gate
|
|
60
|
+
│ ├── headless_envelope.py # the one five-key headless-envelope adapter
|
|
107
61
|
│ ├── health_check_fp.py # health-check fingerprint + seen-cache plumbing
|
|
62
|
+
│ ├── mem_observation.py # Cross-Session Recall write path (build/spill/drain)
|
|
63
|
+
│ ├── mem_recall.py # Cross-Session Recall read path (latch + filter)
|
|
64
|
+
│ ├── merge_config.py # install-time config merge into shared _bmad
|
|
65
|
+
│ ├── merge_customization.py # install-time UCG-awareness fragment merge
|
|
66
|
+
│ ├── merge_help_csv.py # install-time help-CSV merge
|
|
67
|
+
│ ├── lib/mem_common.py # shared Cross-Session Recall primitives
|
|
108
68
|
│ └── hooks/
|
|
109
69
|
│ ├── guard_pretooluse.py # commit invariants (PreToolUse)
|
|
110
70
|
│ └── budget_stop.py # turn/token budget (Stop)
|
|
71
|
+
├── skills/
|
|
72
|
+
│ └── ucg-formalize/ # Standalone readiness gate
|
|
111
73
|
└── assets/
|
|
112
|
-
|
|
74
|
+
├── execute-epic.workflow.js # EXPERIMENTAL --parallel worktree fan-out
|
|
75
|
+
├── module.yaml · module-setup.md · module-help.csv # install metadata
|
|
76
|
+
└── ucg-awareness/ # shift-left planning customization fragments
|
|
113
77
|
```
|
|
114
78
|
|
|
115
|
-
`SKILL.md` carries the routing and the contract; the `references/*.md`
|
|
79
|
+
`SKILL.md` carries the routing and the contract; the `references/*.md` files carry each stage's procedure and testable routing conditions; the `scripts/*.py` files carry the deterministic facts the model cannot fudge (the gate, preflight, readiness kernel, hooks, and the install-time/recall plumbing); the `skills/ucg-formalize/` subskill is the standalone readiness gate; and the `assets/` hold the experimental `--parallel` workflow plus install metadata and the planning-customization fragments. See [how it works](how-it-works.md) for the stages and [parallel mode](parallel-mode.md) for the workflow asset.
|
|
116
80
|
|
|
117
81
|
## Customization resolution
|
|
118
82
|
|
|
119
83
|
Configuration resolves in three layers, base → team → user, via `resolve_customization.py`:
|
|
120
84
|
|
|
121
|
-
1. **Base
|
|
122
|
-
2. **Team
|
|
123
|
-
3. **User
|
|
85
|
+
1. **Base**: `customize.toml` in the skill root (the shipped `[workflow]` block).
|
|
86
|
+
2. **Team**: `{project-root}/_bmad/custom/ultracode-goal.toml`.
|
|
87
|
+
3. **User**: `{project-root}/_bmad/custom/ultracode-goal.user.toml`.
|
|
124
88
|
|
|
125
|
-
Merge semantics: **scalars override**, **tables deep-merge**, **arrays append**. At activation the skill runs `resolve_customization.py --skill {skill-root} --key workflow`; if that fails, it resolves the three files itself in the same order. The shipped base layer defines the run's knobs
|
|
89
|
+
Merge semantics: **scalars override**, **tables deep-merge**, **arrays append**. At activation the skill runs `resolve_customization.py --skill {skill-root} --key workflow`; if that fails, it resolves the three files itself in the same order. The shipped base layer defines the run's knobs: the TEA/artifact paths (`tea_config_path`, `trace_output_dir`, `implementation_artifacts`, `deferred_work_path`), the git guardrails (`epic_branch_prefix`, `protected_branches`), the budgets (`max_turns_per_story`, `story_token_budget`), the experimental `parallel_max_concurrency`, the `allowlist_commands`, and the `on_epic_complete` hook. Teams and users override without editing the shipped file. Remember that a budget or branch override only reaches the *enforcement* layer because preflight threads it into the hook env (see layer 2 above).
|
|
126
90
|
|
|
127
|
-
The three TOML layers merge once, but a branch or budget value then travels two ways
|
|
91
|
+
The three TOML layers merge once, but a branch or budget value then travels two ways: the conductor reads it directly, while the hooks only see it if preflight re-injects it as env:
|
|
128
92
|
|
|
129
93
|
```mermaid
|
|
130
94
|
flowchart LR
|
|
@@ -142,6 +106,6 @@ flowchart LR
|
|
|
142
106
|
class WF accent
|
|
143
107
|
```
|
|
144
108
|
|
|
145
|
-
## Why the hooks live in settings.local.json
|
|
109
|
+
## Why the hooks live in settings.local.json
|
|
146
110
|
|
|
147
|
-
The PreToolUse and Stop hooks are auto-merged into `{project-root}/.claude/settings.local.json`
|
|
111
|
+
The PreToolUse and Stop hooks are auto-merged into `{project-root}/.claude/settings.local.json` (machine-local, gitignored, honored after the workspace trust dialog), not into a committed settings file or memory. The reasoning: these hooks are **enforcement, not context**. A committed hook would impose this module's commit guard on every contributor and every unrelated session in the repo; a hook in memory would not block a commit at all. The machine-local file scopes enforcement to the machine actually running the unattended Epic, and the gitignore keeps it out of shared history. The skill re-merges them every run (idempotently) and asserts they are active before the run goes unattended; it does not assume a prior run left them in place. Because the file is machine-local and executes on your machine, review what is merged; see [SECURITY.md](../SECURITY.md).
|