@webpresso/plugin-antigravity 0.0.0-stage → 0.0.17

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 (43) hide show
  1. package/LICENSE +104 -0
  2. package/bin/wp +276 -0
  3. package/hooks.json +54 -0
  4. package/mcp_config.json +11 -0
  5. package/package.json +37 -3
  6. package/plugin-skill-ownership.json +105 -0
  7. package/plugin.json +11 -0
  8. package/skills/ai-deslop/SKILL.md +96 -0
  9. package/skills/antigravity/SKILL.md +52 -0
  10. package/skills/autopilot/SKILL.md +82 -0
  11. package/skills/autoresearch/SKILL.md +49 -0
  12. package/skills/best-practice-research/SKILL.md +102 -0
  13. package/skills/browse/SKILL.md +25 -0
  14. package/skills/claude/SKILL.md +52 -0
  15. package/skills/codex/SKILL.md +52 -0
  16. package/skills/deep-interview/LICENSE.txt +28 -0
  17. package/skills/deep-interview/SKILL.md +270 -0
  18. package/skills/deep-research/SKILL.md +259 -0
  19. package/skills/delivery-program/SKILL.md +62 -0
  20. package/skills/design-review/SKILL.md +26 -0
  21. package/skills/devex-review/SKILL.md +28 -0
  22. package/skills/fix/SKILL.md +218 -0
  23. package/skills/handoff/SKILL.md +99 -0
  24. package/skills/hooks-doctor/SKILL.md +153 -0
  25. package/skills/investigate/SKILL.md +83 -0
  26. package/skills/lore-protocol/SKILL.md +84 -0
  27. package/skills/opencode-go/SKILL.md +52 -0
  28. package/skills/plan-ceo-review/SKILL.md +27 -0
  29. package/skills/plan-design-review/SKILL.md +27 -0
  30. package/skills/plan-devex-review/SKILL.md +19 -0
  31. package/skills/plan-eng-review/SKILL.md +24 -0
  32. package/skills/plan-refine/SKILL.md +122 -0
  33. package/skills/plan-refine/references/full-methodology.md +654 -0
  34. package/skills/ralplan/SKILL.md +196 -0
  35. package/skills/team/SKILL.md +121 -0
  36. package/skills/tech-debt/SKILL.md +95 -0
  37. package/skills/testing-philosophy/SKILL.md +53 -0
  38. package/skills/testing-philosophy/references/full-testing-philosophy.md +519 -0
  39. package/skills/tooling-friction/SKILL.md +234 -0
  40. package/skills/tph/SKILL.md +35 -0
  41. package/skills/ultragoal/SKILL.md +304 -0
  42. package/skills/verify/SKILL.md +399 -0
  43. package/README.md +0 -3
@@ -0,0 +1,234 @@
1
+ ---
2
+ type: skill
3
+ slug: tooling-friction
4
+ title: Tooling Friction
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [verify, ultragoal, tech-debt, devex-review, land-policy]
9
+ created: "2026-08-03"
10
+ last_reviewed: "2026-08-11"
11
+ name: tooling-friction
12
+ description: "After land, capture MCP/CLI friction tips (optional; never blocks.)"
13
+ argument-hint: "[--promote] [blueprint-slug|pr-number|session]"
14
+ ---
15
+
16
+ # Tooling Friction
17
+
18
+ Optional post-land **product signal** for MCP/CLI/hooks/CI pain so Webpresso tooling can improve. Not a land gate. Not a full session debrief.
19
+
20
+ ## Boundary
21
+
22
+ | Owns | Does not own |
23
+ | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
24
+ | Structured friction tips after land-ish success | Code bugs (`/investigate` → `/fix`) |
25
+ | Optional promote to a blueprint task or draft blueprint (tech-debt only where `committed-state-paths` permits `tech-debt/`) | Blueprint claim corrections (`blueprints/errata/`) |
26
+ | Repo-scoped desktop-state JSON (outside worktrees) | Human DX audits (`/devex-review`) |
27
+ | Soft bookend from `/verify` Phase 7 | Required PR section, finalize/merge blockers |
28
+
29
+ ## When
30
+
31
+ - After `/verify` Phase 7 (esp. green or `--merge-ready`) **and** medium+ tooling waste is already recalled
32
+ - Explicit `/tooling-friction` or user asks for tooling papercuts / agent tax feedback
33
+ - Blueprint completed or PR merged **and** gates burned meaningful tokens
34
+
35
+ ## When not
36
+
37
+ - Work still in-flight (stay in fix/verify)
38
+ - Smooth session with no tooling pain → **silence** (do not invent tips)
39
+ - Product-code root cause unknown → investigate first
40
+ - One-off transient network blips without a product fix
41
+
42
+ ## Workflow
43
+
44
+ 1. **Recall only** — do not re-ingest full CI logs or transcripts.
45
+ 2. If zero medium+ findings → stop: `skipped: no tooling friction`.
46
+ 3. Emit **1–3** findings (hard cap 8 for schema headroom; prefer ≤3).
47
+ 4. Write the capture with the validating verb — it is the only writer, and it
48
+ puts the document at the central, repo-scoped desktop state surface:
49
+
50
+ First write the capture JSON to a scratch file with the host's file-write
51
+ tool, under the scratch directory `$TMPDIR/webpresso/scratch/` (outside every
52
+ worktree, per the agent scratch write policy; never the repo root, and never
53
+ committed). Resolve that directory to an **absolute path** yourself and use
54
+ the literal path below — hosts refuse a command that carries a shell
55
+ variable expansion. Then hand the file to the verb with `--from-file`; no
56
+ pipe, redirect or shell variable is involved:
57
+
58
+ ```bash
59
+ wp tooling-friction write --file YYYY-MM-DD-<slug|pr|session>.json --from-file <absolute-scratch-dir>/tooling-friction-capture.json
60
+ ```
61
+
62
+ If your `wp` predates `--from-file`, **redirect** the same file to stdin
63
+ instead:
64
+
65
+ ```bash
66
+ wp tooling-friction write --file YYYY-MM-DD-<slug|pr|session>.json < <absolute-scratch-dir>/tooling-friction-capture.json
67
+ ```
68
+
69
+ Do not pipe a shell variable into the verb (`printf '%s' "$CAPTURE_JSON" | …`):
70
+ hosts refuse the unresolvable expansion, and the fallback — writing the JSON
71
+ straight into the store — skips validation, which is how a capture with ten
72
+ schema issues reached disk. Never write the capture into the store yourself.
73
+
74
+ The verb parses the document through the shared schema helper **before** it
75
+ touches disk, so a capture that violates v1 is refused (non-zero exit,
76
+ naming every failing field path) and nothing is written. It prints the
77
+ absolute path it wrote, creates parent dirs, and refuses to overwrite an
78
+ existing capture — pick a unique session/HHMM suffix instead.
79
+
80
+ **Path SSOT (required):** that target is the same location the read-only MCP
81
+ resolver reports, so call the resolver and **copy the absolute path from its
82
+ summary text** (hosts often omit structured details), then confirm the
83
+ verb's printed path matches:
84
+
85
+ ```text
86
+ tooling_friction_path({"file":"YYYY-MM-DD-<slug|pr|session>.json"})
87
+ → summary: tooling-friction path: <absolute-path>
88
+ ```
89
+
90
+ Never write the capture to a hand-constructed path — not to a fleet folder
91
+ slug (`github.com-org-repo-*`), not to worktree-keyed desktop-state, not
92
+ under `Application Support` or `~/.webpresso`.
93
+
94
+ - `repo-key` is a **16-hex** `repoIdentityV1(git-common-dir)` segment from
95
+ `repoIdentityV1` under the pure preferred state root — **not** a fleet worktree folder slug such
96
+ as `github.com-org-repo-<hash>` under `~/.webpresso/worktrees/repos/`.
97
+ - Scope is always **repo** (shared by every worktree of that git common
98
+ dir). Never use a worktree-keyed desktop-state surface for captures.
99
+ - Human CLI surface: `wp tooling-friction path --file <file>` prints that
100
+ absolute path; `wp tooling-friction write --file <file>` writes it.
101
+
102
+ If the surface cannot be resolved or written, report
103
+ `tooling-friction: skipped: no state surface` and stop; never fall back to a
104
+ worktree or `.agent/` path.
105
+
106
+ 5. Optional `--promote` or severity `high`/`critical`: record the follow-up as
107
+ a blueprint task (MCP `blueprint_put`) or a draft blueprint
108
+ (`wp blueprint new`), and set `promoted_to` to that blueprint path. Do not
109
+ use `wp tech-debt new` here: it refuses this repository's `tech-debt/` root,
110
+ which `wp audit committed-state-paths` forbids adding to.
111
+ 6. Optional one-line `session_capture` pointer to the JSON path — no paste-back walls.
112
+
113
+ **Rate limit:** at most **one** capture per verify bookend.
114
+
115
+ ## Store path (SSOT)
116
+
117
+ `tooling_friction_path({"file":"<file>"})` (or the human CLI projection
118
+ `wp tooling-friction path --file <file>`) — a read-only projection of the pure
119
+ preferred state root (WP_STATE_ROOT or env-paths data; no writability fallback)
120
+ plus `repoIdentityV1(git-common-dir)` under `tooling-friction/<file>`. This
121
+ intentionally does **not** follow `getStateRoot()`'s temporary fallback when the
122
+ preferred root is unwritable — always copy the resolver output.
123
+
124
+ The MCP summary embeds the absolute path (`tooling-friction path: …`). Details
125
+ also include `path`, `repoKey` (16-hex), `stateRoot`, `scope: "repo"`, and
126
+ `projectRoot`. Copy the path; never invent one.
127
+
128
+ **Not** a path inside `planning/`, a checkout, or
129
+ `desktop-state/repos/github.com-…` (fleet worktree layout ≠ desktop-state key).
130
+
131
+ ## Schema v1
132
+
133
+ ```json
134
+ {
135
+ "schema_version": 1,
136
+ "captured_at": "2026-08-03T15:00:00Z",
137
+ "session": {
138
+ "host": "claude",
139
+ "session_id": "optional-max-128",
140
+ "blueprint_slug": "optional",
141
+ "pr_number": 1239,
142
+ "branch": "optional-max-200"
143
+ },
144
+ "findings": [
145
+ {
146
+ "id": "tf-status-ci-skew",
147
+ "severity": "high",
148
+ "surface": "pr",
149
+ "tool": "pr_status",
150
+ "kind": "friction",
151
+ "signal": "status_ci_skew",
152
+ "symptom": "pr_merge blocked while GitHub CLEAN and PR Policy green.",
153
+ "token_waste": "high",
154
+ "time_waste_minutes": 25,
155
+ "recurrence": "session",
156
+ "suggested_fix": "Align land readiness evidence with PR Policy (body+trailers; git-diff subject).",
157
+ "evidence_refs": ["pr:1239"],
158
+ "promoted_to": null
159
+ }
160
+ ],
161
+ "notes": "optional ≤400 chars theme"
162
+ }
163
+ ```
164
+
165
+ ### Closed enums
166
+
167
+ | Field | Values |
168
+ | ----------- | -------------------------------------------------------------------------------------------------------------------- |
169
+ | severity | `low` `medium` `high` `critical` |
170
+ | surface | `mcp` `cli` `hook` `pr` `ci` `review-gate` `session-memory` `host` `docs` |
171
+ | kind | `friction` `missing` `docs` `workaround` `incident` |
172
+ | signal | `retry_loop` `schema_confuse` `timeout` `wrong_facade` `missing_capability` `docs_mismatch` `status_ci_skew` `other` |
173
+ | token_waste | `none` `low` `medium` `high` |
174
+ | host | `claude` `codex` `opencode` `other` |
175
+ | recurrence | `once` `session` `chronic` |
176
+
177
+ ### Limits
178
+
179
+ - findings: prefer ≤3 (schema max 8)
180
+ - finding `id`: `tf-` followed by 4–40 lowercase letters, digits, or hyphens
181
+ - finding `tool`: ≤80 characters
182
+ - `symptom` / `suggested_fix`: ≤280 chars
183
+ - `notes`: ≤400 chars
184
+ - `evidence_refs`: ≤5 items × ≤200 chars (run ids, receipt names, `pr:N` — **not** log bodies)
185
+ - `token_waste` bands: `none` <1k · `low` 1–5k · `medium` 5–20k · `high` >20k or multi-retry (estimate only)
186
+
187
+ ## Few-shot tips
188
+
189
+ **Good**
190
+
191
+ - `pr_merge: land readiness disagrees with GitHub CLEAN / PR Policy (status_ci_skew, high)`
192
+ - `review_gate: re-approve after ledger-only commits; subject binding unclear (retry_loop, medium)`
193
+ - `pr_upsert: bare Review model "Kimi" fails provider regex; needs "kimi reviewer" (schema_confuse, low)`
194
+
195
+ **Bad**
196
+
197
+ - Full CI log paste
198
+ - "Tools are confusing sometimes"
199
+ - `suggested_fix: raise the timeout` (forbidden; see no-timeout-as-fix)
200
+
201
+ ## Anti-patterns (iron)
202
+
203
+ 1. No secrets, tokens, `.env`, auth headers
204
+ 2. No full logs/transcripts
205
+ 3. **Never block land** — missing capture ≠ incomplete
206
+ 4. No inventing tips on smooth runs
207
+ 5. No timeout-as-fix suggestions
208
+ 6. No blueprint errata misuse
209
+ 7. No committing desktop-state captures
210
+ 8. No auto-open GitHub issues per tip
211
+ 9. **Never invent the capture path** — no fleet folder slugs
212
+ (`github.com-org-repo-*`), no worktree-keyed desktop-state, no guessing
213
+ under `Application Support` or `~/.webpresso`. Always call
214
+ `tooling_friction_path` / `wp tooling-friction path` and write to the
215
+ absolute path it returns
216
+
217
+ ## Integration
218
+
219
+ - **Canonical soft bookend:** `/verify` Phase 7 — if medium+ tooling waste recalled, run once.
220
+ - Other surfaces (ultragoal/delivery): optional cross-link only — do not multi-prompt.
221
+ - Land policy, finalize, and merge tools must not require this skill.
222
+
223
+ ## Output (agent reply)
224
+
225
+ ```text
226
+ tooling-friction: wrote desktop state <absolute-path-from-tooling_friction_path>
227
+ findings: 2 (high=1, medium=1)
228
+ promoted: none | blueprints/<lifecycle>/<slug> | tech-debt/...
229
+ ```
230
+
231
+ `tech-debt/...` applies only where `wp audit committed-state-paths` permits
232
+ that root.
233
+
234
+ Or: `tooling-friction: skipped: no tooling friction`
@@ -0,0 +1,35 @@
1
+ ---
2
+ type: skill
3
+ slug: tph
4
+ title: TPH (Testing Philosophy Helper)
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [testing-philosophy]
9
+ created: "2026-06-13"
10
+ last_reviewed: "2026-07-08"
11
+ name: tph
12
+ description: "/tph — testing-philosophy review: integration-first tests, real-boundary mocks, behavior-proving assertions."
13
+ ---
14
+
15
+ # TPH (Testing Philosophy Helper)
16
+
17
+ This is the short-name alias for the canonical `testing-philosophy` skill.
18
+
19
+ Use the full testing-philosophy workflow in `../testing-philosophy/SKILL.md` before any mechanical smell scan. The `tph` name means the review workflow: integration-first tests, real-boundary mocks only, and assertions that prove behavior.
20
+
21
+ After the judgment review is complete, run the repo's static smell audit as the final mechanical backstop when available:
22
+
23
+ ```bash
24
+ wp audit test-smells
25
+ ```
26
+
27
+ That audit is deliberately narrower than the skill. It can catch over-mocking and smell violations, but it does not replace the testing-philosophy review.
28
+
29
+ Focus on:
30
+
31
+ - integration-first tests over brittle implementation mocks;
32
+ - E2E tests that go through real user/browser or HTTP boundaries;
33
+ - weak assertions, tautologies, and over-mocking;
34
+ - correct test naming and suite placement;
35
+ - mutation-test-worthy coverage for new logic.
@@ -0,0 +1,304 @@
1
+ ---
2
+ type: skill
3
+ slug: ultragoal
4
+ title: Ultragoal
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [autopilot, plan-refine, verify, fix, opencode-go]
9
+ created: "2026-07-10"
10
+ last_reviewed: "2026-08-03"
11
+ name: ultragoal
12
+ description: "Multi-blueprint ultragoal with budgets. Use for overnight, parallel execute, sleep with stop."
13
+ argument-hint: "<new|status|handoff|run|cancel> [brief]"
14
+ ---
15
+
16
+ # Ultragoal
17
+
18
+ ## Use when (freeform)
19
+
20
+ - "ultragoal", "overnight", "go to sleep", "full autopilot" **with** named budgets/stop
21
+ - "spawn many in parallel", multi-blueprint ready-set execution
22
+ - Reject unbound "complete everything while I sleep" without stop condition / budgets
23
+
24
+ Use `wp ultragoal` / MCP `ultragoal_*` as the durable controller for work spanning
25
+ one or more blueprints. Prefer this spine over host-local mega-sessions or ad-hoc
26
+ multi-agent swarms.
27
+
28
+ ## Creating an ultragoal does NOT set a host stop-condition
29
+
30
+ `ultragoal_new` records a durable brief, budgets, and phase. It does **not**
31
+ install the session Stop hook that keeps a host working until a condition holds
32
+ — that hook belongs to the host's own goal surface (Claude Code's `/goal`), which
33
+ this skill cannot reach. The two are independent: an ultragoal can sit in `plan`
34
+ indefinitely with no host pressure to advance it, and a host goal can be set with
35
+ no ultragoal behind it.
36
+
37
+ So do not assume invoking this skill armed a stop condition. Either:
38
+
39
+ - state the stop condition explicitly in the reply and drive the loop yourself, or
40
+ - tell the operator to pair the run with their host's goal command when they want
41
+ the session held open until the ultragoal completes.
42
+
43
+ Recording the brief and recording the stop condition are two separate acts;
44
+ conflating them silently drops the one the operator was counting on.
45
+
46
+ ## Default budgets (override only when the user sets them)
47
+
48
+ | Budget | Default | Meaning |
49
+ | --------------- | -------------------------------- | -------------------------------------------------- |
50
+ | `concurrency` | 4 (max 8) | Parallel ready tasks / implementer lanes |
51
+ | `fix_budget` | 1 | Pre-existing issues fixable via `/fix` this phase |
52
+ | `review_budget` | see `workflow-skills-routing.md` | Outside-voice reviewer paths, local vs merge-ready |
53
+ | `loop` | off | Do not run `/loop` or unbounded stop-hooks |
54
+
55
+ Reject unbudgeted sleep-mode briefs (“complete all”, “full autopilot”, “go to sleep”)
56
+ unless they name a blueprint/slug, budgets, and a stop condition. Route vague briefs
57
+ through `plan-refine` first (or require `force:` only when the user explicitly opts out).
58
+
59
+ ## Executor preflight
60
+
61
+ `wp ultragoal start` validates every requested host before it persists a durable run or
62
+ permits supervisor worktree allocation. Built-in hosts validate both the executable and the
63
+ CLI grammar Ultragoal invokes; the generic `process` host validates executable availability
64
+ only. An incompatible wrapper fails with `UG_HOST_UNAVAILABLE`, the configured invocation
65
+ path, the missing surface, and its remediation variable. Diagnostics mention the canonical
66
+ target as secondary context only when the invocation path is a symlink.
67
+
68
+ | Host | Override variable |
69
+ | -------- | ------------------------------- |
70
+ | Claude | `WP_ULTRAGOAL_CLAUDE_COMMAND` |
71
+ | Codex | `WP_ULTRAGOAL_CODEX_COMMAND` |
72
+ | OpenCode | `WP_ULTRAGOAL_OPENCODE_COMMAND` |
73
+ | Process | `WP_ULTRAGOAL_PROCESS_COMMAND` |
74
+
75
+ Upgrade the installed CLI or point the named variable at a compatible executable. Then
76
+ restart the process that owns the adapter: probe successes and failures are cached by
77
+ canonical executable for that adapter's lifetime. Missing paths are rechecked and symlink
78
+ retargeting is re-probed, but an in-place executable repair still requires an adapter-owner
79
+ restart.
80
+
81
+ Existing `WP_ULTRAGOAL_<HOST>_COMMAND` configurations remain supported; no environment
82
+ variable migration is required. Their executables must satisfy the current semantic probe
83
+ and invocation contract after an upgrade. The generic process host is additive: integrations
84
+ that opt into it configure `WP_ULTRAGOAL_PROCESS_COMMAND` and, when needed, the JSON argument
85
+ array described below.
86
+
87
+ Start probes each unique requested host concurrently, then reports the first failure in
88
+ requested-host order. A failed preflight occurs before durable run creation, ledger writes,
89
+ supervisor launch, or attempt/worktree allocation. Built-in probes validate the grammar they
90
+ invoke: Codex `exec --json --sandbox workspace-write`, Claude prompt/streaming output/bypass
91
+ permission flags, and OpenCode `run --format json --auto`.
92
+
93
+ Preflight does **not** validate authentication, provider quota or billing, network
94
+ reachability, or secrets isolation. Those failures remain runtime/provider concerns.
95
+
96
+ ### Host normalization and recovery
97
+
98
+ Ultragoal trims and normalizes the default host and per-task `taskHosts` values once when it
99
+ resolves the plan, then persists that normalized mapping. Task IDs are never normalized: a
100
+ per-task entry must use the exact executable task ID. Blank host values, missing task IDs,
101
+ and overrides for controller-only tasks fail with `UG_HOST_CONFIG_INVALID`; an unrecognized
102
+ normalized host fails with `UG_HOST_UNKNOWN`.
103
+
104
+ An initial host failure still occurs before owner-head lookup, durable run or ledger creation,
105
+ supervisor launch, and worktree allocation. Once a run already exists, the supervisor fills
106
+ only the ready executable tasks that fit the currently free concurrency slots. If one host is
107
+ unavailable, available siblings in that ready slice start and are durably attached to the run;
108
+ the unavailable task gets no attempt or worktree. The supervisor then records its exit and
109
+ reports the first host failure in task order. The `supervisor-exited` record leaves the run
110
+ nonterminal and the attached handles/worktrees recoverable.
111
+
112
+ After upgrading or overriding the unavailable host, adopt the run. Adoption creates a fresh
113
+ host registry and probe cache, recovers the already attached work, and schedules the task that
114
+ could not start. Do not convert a cached availability failure into a retry attempt or mark an
115
+ otherwise recoverable run terminal.
116
+
117
+ ### Generic process contract
118
+
119
+ Set `WP_ULTRAGOAL_PROCESS_COMMAND` to an executable. Optional
120
+ `WP_ULTRAGOAL_PROCESS_ARGS_JSON` must be a JSON array of string arguments. Ultragoal appends
121
+ these fixed arguments after the configured arguments; process integrations must accept them:
122
+
123
+ ```text
124
+ --task <task.json> --events <events.jsonl> --responses <responses.jsonl>
125
+ ```
126
+
127
+ The same absolute paths are available as `UG_TASK_PATH`, `UG_EVENTS_PATH`, and
128
+ `UG_RESPONSES_PATH`; `UG_ATTEMPT_ID` and `UG_WORKTREE` identify the attempt and its working
129
+ tree. The executable runs with that worktree as its current directory. It writes one JSON
130
+ object per line to the events file using one of these shapes:
131
+
132
+ ```json
133
+ {"type":"attention","attentionId":"question-1","prompt":"Proceed?"}
134
+ {"type":"response-ack","attentionId":"question-1"}
135
+ {"type":"completed"}
136
+ {"type":"failed","reason":"optional explanation"}
137
+ ```
138
+
139
+ Ultragoal appends responses as JSONL objects with `type: "response"`, the matching
140
+ `attentionId`, `response`, and `createdAt`. The process must emit `response-ack` with that
141
+ identifier after consuming a response. The protocol paths and `UG_*` variables are fixed;
142
+ the configured JSON arguments may add process-specific flags but cannot replace them.
143
+
144
+ ### Execution authority and isolation
145
+
146
+ Ultragoal worktrees protect git integration boundaries; they are **not** operating-system
147
+ sandboxes. Codex uses its `workspace-write` sandbox; Claude `bypassPermissions`, OpenCode `--auto` mode, and custom
148
+ `process` executables retain substantial user authority. OpenCode disables automatic updates
149
+ and sharing and denies external-directory access, but those policy settings do not make it an
150
+ OS sandbox. Run Ultragoal only with providers, configuration, and task content you trust.
151
+
152
+ ## Tooling map (use these; do not reimplement with Bash)
153
+
154
+ | Phase | Prefer MCP / CLI | Purpose |
155
+ | ---------------------- | -------------------------------------------------------------------------- | --------------------------------------------------- |
156
+ | Create / resume | `ultragoal_new`, `ultragoal_status` | Durable controller state |
157
+ | Isolation | `worktree` | Owner / lane worktrees; never primary as controller |
158
+ | Blueprint read | `blueprint_list`, `blueprint_get`, `blueprint_context` | Ready-set and deps |
159
+ | Blueprint write | `blueprint_put`, `blueprint_transition` | Spec edits (MCP-only for blueprints) |
160
+ | Task done | `blueprint_task_verify` only | Evidence-gated completion |
161
+ | Parallel execute | `/goal` (autopilot) or ready-queue + host subagents | Max parallel when deps allow |
162
+ | Context-light delegate | `session_context` | Manifest for subagents (no history paste) |
163
+ | Continuity | `session_capture`, `session_search`, `session_restore`, `session_snapshot` | Decisions / resume |
164
+ | Large command / file | `session_execute`, `session_batch_execute`, `session_execute_file` | Bounded output + index |
165
+ | QA | `qa` (or `lint` + `typecheck` + `test`) | Affected quality gates |
166
+ | PR / land | `pr_upsert`, `pr_status`, `pr_wait`, `pr_merge` | Open early; exact-head merge only |
167
+ | Delivery programs | `delivery_status` | Derive one dispatch/integration action |
168
+ | Fleet / workers | `fleet_status`, `worker_tail` | Multi-session visibility |
169
+ | Token gain | `gain` | Optional efficiency check after heavy execute |
170
+ | Advance loop | `ultragoal_run`, `ultragoal_handoff`, `ultragoal_cancel` | Controller steps only |
171
+
172
+ Fallback to `wp …` CLI only when the matching MCP tool is unavailable. Prefer `wp` >
173
+ `vp` > raw package managers. Never raise timeouts to hide hangs.
174
+
175
+ ## Protocol
176
+
177
+ 1. Create or resume the ultragoal in a **managed blueprint owner worktree**
178
+ (`worktree` / `blueprint_put`). Never use `main` or the primary checkout
179
+ as controller.
180
+ 2. Print the **ready-set**: tasks whose dependencies are satisfied (from blueprint tools).
181
+ 3. Launch up to `concurrency` independent ready tasks in parallel (worktree-isolated).
182
+ Serialize only when file ownership overlaps or deps require it.
183
+ 4. Execute only the current phase handoff; call `ultragoal_run` again after evidence.
184
+ 5. Mark tasks done **only** via `blueprint_task_verify` with passing evidence.
185
+ 6. **Opportunistic `/fix`:** at most `fix_budget` pre-existing issues per phase, each with
186
+ named invariant + failing proof. Excess → handoff backlog (do not expand epic).
187
+ 7. **Validate / land:** local proof with `qa` / targeted tools; outside review only when
188
+ merge-ready and within `review_budget` — **exactly one sequential** outside voice unless
189
+ the user sets N (the default value lives in `workflow-skills-routing.md`).
190
+ Controller validation evidence is **machine-qa (prior QA phase) + N outside voices**
191
+ (default N=1), not two outside model reviewers at budget 1.
192
+ `review_gate` has one mode: purpose plan for exact-version draft plan
193
+ approval (then `blueprint_promote`), purpose delivery for implementation/phase outside
194
+ voice. Each new provider verdict is a formal round of the slug's budget and
195
+ an approval is authority immediately. A CLI delivery gate is explicit MCP-unavailable
196
+ compatibility only, not this MCP contract. Use `pr_*` for PR babysit — no
197
+ multi-sleep poll loops; no parallel multi-reviewer stampede.
198
+ 8. Stop on `complete`, `cancelled`, blocked guard exhaustion, or `WP_ULTRAGOAL_DISABLE=1`.
199
+
200
+ The blueprint engine owns task status and approval gates. The ultragoal controller must
201
+ never self-approve, directly mark a task done, bypass review provenance, or mutate the
202
+ primary checkout.
203
+
204
+ ## Failure / cascade
205
+
206
+ - Hard fail on a task → mark blocked with reason; **cascade-skip** dependents that cannot
207
+ proceed; continue independent ready work.
208
+ - Lifecycle mutation failure → stop (do not continue on stale plan state).
209
+ - On block: call `ultragoal_handoff` and emit a **≤40-line handoff**: goal, done, blockers,
210
+ evidence refs (`session_*` ids if any), next 3 commands. Do not paste full transcripts.
211
+
212
+ ## Outside-voice review (required for autopilot)
213
+
214
+ Autopilot and agent-driven ultragoal loops **must** request an outside-voice review after each **goal/phase milestone**. Use **`review_gate`** purpose plan for exact-version draft plan approval (then promote with `blueprint_promote`) and one single-shot **`review_gate`** purpose delivery call for implementation/phase outside voice. The gate has one mode: each newly executed provider review that reaches a verdict is a formal round of the slug's budget, an approval is authority immediately, and an identical-subject call replays the recorded verdict without a new round. CLI delivery gates are explicit MCP-unavailable compatibility only, not this MCP contract.
215
+
216
+ Count each milestone review against `review_budget` for merge-ready claims: **exactly one sequential** reviewer path unless the user sets N; the default value is owned by `workflow-skills-routing.md`. Do not fan out multi-host review swarms.
217
+
218
+ ### Milestones that require a review
219
+
220
+ Run `review_gate` purpose plan for the plan approval milestone below and one
221
+ single-shot `review_gate` purpose delivery call for implementation/phase
222
+ milestones. Each new provider verdict is one formal round of the slug's budget.
223
+
224
+ | Milestone | When |
225
+ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
226
+ | Plan gate | Before `draft` → `planned`, using the exact version returned by `blueprint_put`; then `blueprint_promote` the approved version |
227
+ | Phase advance | After ultragoal advances `plan` → `execute`, `execute` → `qa`, `qa` → `validate`, `validate` → `land`, or lands `complete` |
228
+ | Task batch handoff | After a meaningful execute batch when the phase remains `execute` (at least once per blueprint before claiming execute-complete) |
229
+
230
+ Do **not** invent ledger approvals. If the review provider is unavailable or hits a provider-wide usage limit, capture the failure evidence and end outside review for the window; do not hop reviewer families, substitute another host, or substitute a forged approval.
231
+
232
+ ### Reviewer selection (the gate chooses, not the caller)
233
+
234
+ Pass `caller_model` with your own model id and omit `provider`, `model`, and
235
+ `effort`. The gate selects the reviewer route itself — a cross-family reviewer
236
+ chosen for capability, current provider limits, and measured daily cost — and
237
+ reports the choice in `policy_selection`. Never resolve models from a live
238
+ catalog at invocation time, never probe a provider CLI for its model list, and
239
+ never read a credential store to discover models; provider catalog discovery
240
+ belongs to the snapshot drift workflow. A human operator may still name an
241
+ explicit `provider`/`model` as an override; agents must not.
242
+
243
+ Treat a provider-wide usage limit as terminal for the current review window; do not hop reviewer families to evade a usage block. There is no substitute host: the window ends with the captured failure evidence.
244
+
245
+ ### Plan gate invocation shape
246
+
247
+ ```text
248
+ review_gate({
249
+ "project_id": "<project-id>",
250
+ "slug": "<blueprint-slug>",
251
+ "expected_version": "bpv1:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
252
+ "repository_access": "read-only",
253
+ "auto_promote": true,
254
+ "caller_model": "<your own model id>"
255
+ })
256
+ ```
257
+
258
+ The plan gate has no `purpose` or `target` field. Pass the exact `bpv1:` token
259
+ returned by `blueprint_put`, never a commit hash or `HEAD`. An explicitly
260
+ requested CLI delivery gate is an MCP-unavailable compatibility fallback only.
261
+ If the MCP host returns before a terminal result, poll the same invocation with
262
+ `review_gate_wait`; treat in-progress, not-found, contention, waiter timeout,
263
+ waiter abort, and cancellation as non-verdict observation states. `not_found`
264
+ means no active or terminal gate exists for that subject; refresh state and
265
+ start the gate again instead of spinning a wait loop.
266
+
267
+ ### Honesty rules (non-negotiable)
268
+
269
+ - Never self-approve or hand-edit `reviews.md` / `review-events.jsonl` / frontmatter approvals to fake outside-review authority.
270
+ - Never mark blueprint tasks done except through `blueprint_task_verify` with real evidence.
271
+ - Never run ultragoal mutations on `main` or a primary checkout; use the managed blueprint owner worktree.
272
+ - Keep every loop bounded and never increase timeouts.
273
+ - When the controller returns `waiting` (`blueprint-promotion`, `approval-gate`, `blueprint-tasks`, …), fix the named gap; do not spin `wp ultragoal run` without progress.
274
+
275
+ ## Tooling-aligned evidence (QA / land)
276
+
277
+ - **QA phase** prefers **GitHub required checks** for the worktree PR (`pr_status` /
278
+ `pr_wait` or `gh pr checks --required`) when PR is `OPEN`/`MERGED`, checks green, and
279
+ PR head matches clean worktree HEAD.
280
+ - If no PR-bound green CI is available, fall back to local **`qa`**.
281
+ - Open a PR early so CI can satisfy QA. Do **not** raise timeouts.
282
+ - **Land** still requires a **MERGED** PR with green required checks bound to the projected
283
+ source snapshot. Use `/verify --merge-ready` (merge-ready `review_budget`, per
284
+ `workflow-skills-routing.md`), not default local verify.
285
+
286
+ ## Snapshot / dirty worktree
287
+
288
+ - **Never edit primary.** Ultragoal and locked blueprint mutations refuse
289
+ primary-like checkouts; planning SSOT lives only in managed owner worktrees.
290
+ - On a **linked managed worktree**, uncommitted `blueprints/**` dirt (review
291
+ ledgers, `_overview.md` lifecycle, promote/finalize renames) is
292
+ controller-owned and must not fail `createCleanSourceSnapshot` / block
293
+ `wp ultragoal run` after task_verify or promotion.
294
+ - On a **primary-like checkout**, only review ledgers/artifacts are ignored;
295
+ dirty `_overview.md` still fails closed so primary never silently absorbs
296
+ planning pollution. Product source outside blueprints always fails closed.
297
+ - Committed blueprint documents still participate in the HEAD source snapshot
298
+ hash (QA/land identity). Commit blueprint + product changes when claiming
299
+ merge-ready.
300
+
301
+ ## After land (optional)
302
+
303
+ If MCP/CLI/hooks/CI gates burned medium+ tokens this program, consider
304
+ `/tooling-friction` once. Never required for land complete.