@ulysses-ai/create-workspace 0.15.0-beta.2 → 0.16.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -89,7 +89,7 @@ Four things, in the order you'll touch them:
89
89
  A scaffolded workspace with:
90
90
 
91
91
  - **14 skills** covering the workflow lifecycle, releases, handoffs, and maintenance
92
- - **7 active rules** + **8 optional `.skip` rules** for behaviors you can opt into
92
+ - **8 active rules** + **8 optional `.skip` rules** for behaviors you can opt into
93
93
  - **10 hooks** for SessionStart, SubagentStart, PreCompact, WorktreeCreate, and the rest of the small set the conventions rely on
94
94
  - A **`shared-context/`** memory system with three visibility levels: locked (team truths), root (team-visible ephemerals), user-scoped (personal)
95
95
  - Conventions for **multi-repo work sessions** with isolated git worktrees, parallelizable from separate terminals
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulysses-ai/create-workspace",
3
- "version": "0.15.0-beta.2",
3
+ "version": "0.16.0-beta.1",
4
4
  "description": "A workspace convention for Claude Code: sessions, handoffs, and shared context as files in git",
5
5
  "keywords": [
6
6
  "claude",
@@ -0,0 +1,419 @@
1
+ # Goal-Driven Work
2
+
3
+ How to use Claude Code's built-in `/goal` command in a Ulysses workspace for multi-phase, agent-team-driven work. `/goal` is the autonomy loop; this rule is the convention layer that gives the main agent durable phase state and a consistent dispatch pattern across turns and resumes.
4
+
5
+ ## When to reach for `/goal`
6
+
7
+ Use `/goal` when the work meets all three:
8
+
9
+ 1. **Multi-phase.** It naturally decomposes into discrete phases (research, design, implementation, validation, etc.) and the phases produce intermediate artifacts before the work is done.
10
+ 2. **Verifiable end state.** "Done" can be demonstrated from the conversation transcript — a PR opened, a set of artifacts written, a test suite passing — rather than judged subjectively.
11
+ 3. **Spans more than one or two turns of natural conversation.** Single-skill invocations (one brainstorm, one plan, one fix) don't need `/goal`; the existing skills carry them.
12
+
13
+ If any of the three fails, prefer plain session work or a single skill invocation. `/goal` is overhead. Pay it only when the work is long enough to earn it.
14
+
15
+ ## File layout
16
+
17
+ - One `goal-{topic}.md` artifact at the top of the active worktree, alongside `session.md`. One goal per worktree.
18
+ - The artifact's frontmatter holds machine state; its body holds the human-readable goal statement, per-phase intent, and a mandatory `## Start command` section (see "Kicking off the goal") with the literal `/goal "..."` invocation the user runs to start the loop.
19
+ - Phase output artifacts live as siblings. `research-*.md` and `crossref-*.md` are goal-native (produced by `parallel-research` and `crossref` phase types). `design-*.md` and `plan-*.md` are pre-existing session-artifact patterns that `type: skill` phases reuse when the wrapped skill is `superpowers:brainstorming` or `superpowers:writing-plans`; they are not goal-specific.
20
+ - The artifact is tracked on the session branch and lives there until `/complete-work` runs. It is removed from the branch before the final PR alongside other session artifacts.
21
+
22
+ ## Frontmatter schema
23
+
24
+ ```yaml
25
+ ---
26
+ type: goal
27
+ topic: <kebab-case-topic>
28
+ status: active # pending | active | complete | cancelled
29
+ # pending: artifact written but /goal not yet invoked
30
+ # active: /goal loop is running
31
+ # complete: all phases complete and condition met
32
+ # cancelled: goal abandoned without completion
33
+ current_phase: <phase-name> # the phase currently in progress or next up
34
+ completion_condition: > # mirrored from the `/goal` text so it survives `/goal clear` and is auditable
35
+ <multi-line condition string>
36
+ turn_budget: <int> # backstop; the condition itself should reference it
37
+ phases:
38
+ - name: <phase-name>
39
+ type: parallel-research | crossref | skill
40
+ status: pending # pending | in_progress | complete | failed
41
+ artifact: <path or null> # output artifact path, relative to worktree top; null for phases that commit to repo
42
+ gate: review | auto # default: review
43
+
44
+ # for type: parallel-research
45
+ team:
46
+ agents:
47
+ - subagent_type: <type>
48
+ brief: |
49
+ <multi-line brief>
50
+ - subagent_type: <type>
51
+ brief: |
52
+ <multi-line brief>
53
+ synthesizer:
54
+ subagent_type: <type>
55
+ brief: |
56
+ <multi-line brief: reads sibling agent outputs, writes the phase artifact>
57
+
58
+ # for type: crossref
59
+ inputs:
60
+ independent: <path to the just-produced independent artifact>
61
+ against: <path or list of paths to compare against>
62
+ brief: |
63
+ <multi-line brief for the crossref agent>
64
+
65
+ # for type: skill
66
+ skill: <plugin:skill-name> # e.g. superpowers:brainstorming
67
+ ---
68
+ ```
69
+
70
+ Body of the file is human-readable: the goal statement, success criteria, and per-phase intent in prose. The frontmatter is the source of truth for machine state; the body explains it to a reader.
71
+
72
+ ## Phase types
73
+
74
+ Three types in v1. Prefer wrapping existing skills (`type: skill`) when a skill fits. Only invent a phase type when no skill covers the work.
75
+
76
+ - **`parallel-research`**: dispatch N researcher-style agents in parallel with independent briefs. Optionally run a synthesizer agent over their outputs to write one consolidated artifact. Use for tool surveys, option-space exploration, comparative research where work can be partitioned.
77
+ - **`crossref`**: given source A (the independent output the team just produced) and source B (existing material to validate against), dispatch an agent to produce a gap-and-overlap matrix plus a ranked list of validations and concerns. Use to compare independent work against prior research, canonical workspace context, or third-party material.
78
+ - **`skill`**: invoke an existing skill by name. The phase's `artifact:` path is the expected output location (or `null` for phases that commit to repo, like `executing-plans`). Use this for `brainstorming`, `writing-plans`, `executing-plans`, `test-driven-development`, or any other skill that fits the phase's intent.
79
+
80
+ If a new phase type appears to be needed, justify why no existing skill fits before adding it. New phase types are a maintenance cost. Prefer keeping `parallel-research` and `crossref` inline until cross-goal reuse pressure makes the extraction earn its keep.
81
+
82
+ ## Agent-team dispatch pattern (v1: stateless)
83
+
84
+ A "team" is just a list of `Agent`-tool dispatch configs (`subagent_type` + `brief`). Spawned fresh each phase. No persistent identity, no memory across phases except what's written into artifacts.
85
+
86
+ The main agent's responsibility per phase:
87
+
88
+ 1. Mark the phase `in_progress` in `goal-{topic}.md` frontmatter.
89
+ 2. Dispatch the team via the `Agent` tool, in parallel where independent. The brief for each agent is exactly the `brief:` field from the phase config, prefixed with any context the brief itself doesn't already carry (typically a pointer to relevant sibling artifacts).
90
+ 3. Collect agent outputs.
91
+ 4. If a `synthesizer` is declared, dispatch it with the sibling outputs and have it write the `artifact:` file.
92
+ 5. If no synthesizer, the main agent writes the `artifact:` file directly from the collected outputs.
93
+ 6. Mark the phase `complete`, update `current_phase` to the next pending phase.
94
+ 7. End the turn with a short status note (for the `/goal` evaluator) and, if `gate: review`, an explicit question to the user.
95
+
96
+ The artifact format supports adding a `persistent: true` flag on a phase team later if a future goal needs team continuity across phases. Don't add the field until something asks for it.
97
+
98
+ ## Gate convention
99
+
100
+ `gate: review` is the default for every phase. At the gate, the main agent ends its turn by asking the user to approve, reject with feedback, or pause.
101
+
102
+ - **approve** → phase stays `complete`, advance to next phase next turn.
103
+ - **reject with feedback** → flip phase back to `pending` and re-run it with the feedback prepended to the team brief.
104
+ - **pause** → state is durable in `goal-{topic}.md`; resume with `claude --resume`.
105
+
106
+ The evaluator's "no, awaiting review" response after a gated phase does not bypass the wait for user input. It just keeps the session running until the user replies.
107
+
108
+ `gate: auto` is allowed in the format but discouraged in v1. Earn it after the workflow has been exercised at least once on the work in question.
109
+
110
+ ## Integration branch and per-phase sub-PRs
111
+
112
+ While a `/goal`-driven session is running, the session branch (`feature/{session-name}`) acts as the goal's integration branch. Main is untouched until `/complete-work` opens the final session→main PR for human review. This is the key autonomy boundary: phase agents can merge their own work, repeatedly, throughout the goal — but only into the integration branch, never into main.
113
+
114
+ Two merge strategies, picked per phase:
115
+
116
+ - **Direct commit (default for artifact-only phases).** Phases of type `parallel-research` and `crossref`, and skill phases that wrap artifact-producing skills (`brainstorming`, `writing-plans`), commit their outputs directly to the session branch. These artifacts are stripped before the final PR anyway, so sub-PR ceremony adds nothing.
117
+ - **Sub-branch with self-merged PR (default for code phases).** Skill phases that wrap code-producing skills (`executing-plans`, `test-driven-development`, `subagent-driven-development`) work on a per-phase sub-branch and open a PR back to the session branch. After the phase's gate is satisfied, the main agent self-merges the sub-PR. Each sub-PR is a discrete reviewable unit — failures can be retried by rebuilding just the one sub-branch.
118
+
119
+ Sub-branch naming follows the existing `git-conventions.md` rule (kebab-case after prefix, no nesting): `feature/{session-name}-{phase-name}`. Examples for a session named `ulysses-goals`:
120
+
121
+ - `feature/ulysses-goals` — session/integration branch
122
+ - `feature/ulysses-goals-strategy-research` — phase sub-branch (if a research phase were promoted to sub-branch strategy)
123
+ - `feature/ulysses-goals-implement` — phase sub-branch for the implement phase
124
+
125
+ A phase declares its merge strategy in frontmatter via an optional `integration:` block:
126
+
127
+ ```yaml
128
+ phases:
129
+ - name: implement
130
+ type: skill
131
+ skill: superpowers:executing-plans
132
+ integration:
133
+ strategy: sub-branch # direct | sub-branch
134
+ branch: feature/{session-name}-implement # explicit, or derived if omitted
135
+ self_merge: true # main agent merges the sub-PR after gate is satisfied; default true
136
+ ```
137
+
138
+ If `integration:` is omitted, defaults are applied by phase type per the list above.
139
+
140
+ Multi-repo sessions: each project repo has its own session branch (same name across repos per existing convention). Phase sub-branches are created per-repo where the phase commits, with matching names. The sub-PR target in each repo is that repo's session branch.
141
+
142
+ `/complete-work` verifies before the final PR that every phase sub-branch has been merged into the session branch. If any are outstanding, it fails loudly with a list of unmerged sub-branches. The user resolves them (merge or close) before re-running.
143
+
144
+ ## Model tiering
145
+
146
+ `/goal`-driven work uses a three-tier model assignment, biased toward the right tool for each shape of work:
147
+
148
+ - **Opus** for the main orchestration thread. It reads the goal artifact, dispatches phase teams, holds the long-running session context, and makes the per-phase advance/retry decisions. Reasoning-heavy and context-heavy work.
149
+ - **Sonnet** for phase team agents (researchers, crossref agents, skill subagents) and for synthesizers. Heavy lifting that runs in parallel and writes substantial artifacts. The default model for any agent in a `team:` block.
150
+ - **Haiku** for quick checks: file-existence verification, frontmatter validation, status sweeps, tiny lookups. Use when the work is bounded and obvious, and speed matters more than reasoning depth.
151
+
152
+ Phase frontmatter sets the model per agent via the `model:` field, which maps to the `Agent` tool's `model` parameter:
153
+
154
+ ```yaml
155
+ team:
156
+ agents:
157
+ - subagent_type: researcher
158
+ model: sonnet # default for parallel-research; rarely overridden
159
+ brief: |
160
+ ...
161
+ synthesizer:
162
+ subagent_type: researcher
163
+ model: sonnet
164
+ brief: |
165
+ ...
166
+ ```
167
+
168
+ For artifact-only or tagging work where Haiku is enough, declare it explicitly:
169
+
170
+ ```yaml
171
+ - subagent_type: researcher
172
+ model: haiku
173
+ brief: |
174
+ Scan {paths} for files matching {pattern} and return a tagged list.
175
+ ```
176
+
177
+ The main agent's model is determined by the harness (the user's `claude` invocation), not the goal artifact. Goal artifacts assume the main agent runs on Opus.
178
+
179
+ ## Writing a good completion condition
180
+
181
+ The `/goal` evaluator runs after every turn against the conversation transcript. It does not call tools, so it can only judge what the main turn has surfaced. A good condition is:
182
+
183
+ - **Specific.** Names the artifacts that must exist (file paths, commit references, PR URLs) rather than vague outcomes.
184
+ - **Demonstrable from transcript.** The main agent's own output must be able to evidence completion. "The PR URL was reported in the transcript and `git status` showed clean" rather than "the work feels done."
185
+ - **Bounded.** Includes a turn budget as a backstop (e.g., "or stop after 60 turns") so the loop can't run away if something goes wrong.
186
+ - **Within the 4000-char limit.** Up to four kilobytes of condition text are accepted.
187
+
188
+ A reasonable template:
189
+
190
+ ```
191
+ All phases in goal-<topic>.md show status: complete. Phase artifacts exist at: <list paths>. The /complete-work skill has produced release notes and opened the final PR; the PR URL appeared in the transcript. Or stop after <N> turns.
192
+ ```
193
+
194
+ Fill in `<topic>`, paths, and `<N>` per goal. Anchor on artifacts and committed state, not on feelings.
195
+
196
+ ## Kicking off the goal
197
+
198
+ `/goal` is a Claude Code built-in that the **user** types — the agent cannot invoke it. So the moment the artifact is ready is the load-bearing hand-off, and the artifact itself carries the instruction rather than relying on an agent chat message that vanishes on the next compaction or resume.
199
+
200
+ Every `goal-{topic}.md` body MUST include a `## Start command` section containing the literal, copy-paste-ready invocation:
201
+
202
+ ````markdown
203
+ ## Start command
204
+
205
+ ```
206
+ /goal "All phases in goal-<topic>.md show status: complete. Phase artifacts exist at: <paths>. The /complete-work skill has produced release notes and opened the final PR; the PR URL appeared in the transcript. Or stop after <N> turns."
207
+ ```
208
+ ````
209
+
210
+ Rules for the `## Start command`:
211
+
212
+ - It is the `completion_condition` flattened to a **single line** and wrapped in `/goal "..."`. The frontmatter `completion_condition:` (a multi-line folded scalar) is the auditable source of truth; the start command is its runnable rendering. The two must express the same condition — if you edit one, re-derive the other.
213
+ - Flatten by collapsing the folded scalar's newlines to single spaces. Escape any embedded double quotes. Keep it within the 4000-character `/goal` limit.
214
+ - It lives in the body, not the frontmatter, because it is for a human to copy, not for machine parsing.
215
+
216
+ When the artifact is drafted and the user has reviewed it, the agent's hand-off is: point the user at the `## Start command` block and let them run it. Running it flips the goal from `status: pending` to `status: active` (the first `/goal` turn updates the frontmatter per the dispatch pattern). The agent never types `/goal` itself.
217
+
218
+ ## Lifecycle integration
219
+
220
+ - `/goal` runs inside an active work session. It does NOT replace `/start-work`. The session is created the normal way, the goal artifact is drafted at the worktree top (including its `## Start command` block), and the user runs that block's `/goal "..."` command to kick off the loop.
221
+ - The goal artifact lives on the session branch and travels with `git push`. It survives across machines and `--resume`.
222
+ - `session.md`'s `## Tasks` should mirror the phase list at coarse grain (one task per phase) so `TodoWrite` shows high-level progress. The main agent updates `## Tasks` at phase transitions via the helper specified by the `task-list-mirroring` rule, in addition to updating `goal-{topic}.md`.
223
+ - `/pause-work` works without special handling. The goal-evaluator state resets on resume per the Claude Code docs; phase state is durable in the artifact.
224
+ - `/complete-work` reads `goal-*.md`, `research-*.md`, and `crossref-*.md` for release-note synthesis and strips them from the branch before the final PR, alongside the existing `design-*.md` and `plan-*.md` handling. When a goal artifact is present, it also runs a pre-flight check that every declared sub-branch (from phases with `integration.strategy: sub-branch`) has been merged into the session branch. Unmerged sub-branches abort completion with a clear list to resolve.
225
+
226
+ If a research or crossref artifact deserves to outlive the branch, the user runs `/promote` on it before `/complete-work`. `/promote` accepts arbitrary paths and routes them into `workspace-context/`.
227
+
228
+ ## Tracker integration
229
+
230
+ Goals do not replace work items. A goal is execution shape; a work item is the unit the team tracks. See `work-item-tracking.md` for how `workItem:` in session frontmatter links a session to its tracker issue. A goal lives inside a session and therefore inherits the session's `workItem:`.
231
+
232
+ When the goal artifact is itself the deliverable for a future session to execute (i.e., this session's job was to *write* the goal, and another session will *run* it), the strip rule needs an escape hatch. The pattern: preserve the artifact in the tracker issue body (as a fenced code block) before `/complete-work` runs. The future session picks up the issue via `/start-work`, copies the artifact text into its worktree top, and runs `/goal`. The strip rule stays clean and consistent; the deliverable is preserved through the tracker.
233
+
234
+ ## Out of scope
235
+
236
+ - Nested or sub-goals. v1 is flat.
237
+ - DAG between phases. Sequential at the phase level; parallelism only inside a phase via the team agents.
238
+ - Persistent named teams (`TeamCreate`). v1 is stateless dispatch.
239
+ - Frontmatter linter for `goal-*.md`. Manual review is fine for v1; revisit if workspaces using the template hit consistent shape errors.
240
+ - `/start-work` seeding of a `goal-{slug}.md` skeleton. Manual drafting is the v1 path. The drafting itself is high-leverage thinking; a template skeleton would risk skipping that.
241
+
242
+ ## Appendix: worked example
243
+
244
+ A complete `goal-evaluate-rate-limiting.md` illustrating all three phase types. The topic is intentionally generic — the example is reference material, not prescriptive. (The appendix is fenced with four backticks so the example's own `## Start command` code block renders intact.)
245
+
246
+ ````yaml
247
+ ---
248
+ type: goal
249
+ topic: evaluate-rate-limiting
250
+ status: pending
251
+ current_phase: strategy-research
252
+ completion_condition: >
253
+ All 5 phases in goal-evaluate-rate-limiting.md show status: complete.
254
+ Phase artifacts exist at: research-rate-limiting-strategies.md,
255
+ crossref-existing-infrastructure.md, design-rate-limiting.md,
256
+ plan-rate-limiting.md, and the implementation commits land on the session
257
+ branch (visible in git log). The /complete-work skill has produced release
258
+ notes and opened the final PR; the PR URL appeared in the transcript.
259
+ Or stop after 60 turns.
260
+ turn_budget: 60
261
+ phases:
262
+ - name: strategy-research
263
+ type: parallel-research
264
+ status: pending
265
+ artifact: research-rate-limiting-strategies.md
266
+ gate: review
267
+ integration:
268
+ strategy: direct # artifact-only phase; commits straight to session branch
269
+ team:
270
+ agents:
271
+ - subagent_type: researcher
272
+ model: sonnet
273
+ brief: |
274
+ Research the token-bucket rate-limiting algorithm. Cover the
275
+ mechanics, parameter trade-offs (capacity, refill rate), edge
276
+ cases (burst behavior, clock skew), reference implementations in
277
+ popular libraries, and known production failure modes.
278
+
279
+ Output: a markdown report under 1,200 words. Return the content
280
+ in your response.
281
+ - subagent_type: researcher
282
+ model: sonnet
283
+ brief: |
284
+ Research the sliding-window rate-limiting algorithm. Cover both
285
+ the sliding log and sliding counter variants, accuracy
286
+ trade-offs, memory cost at scale, reference implementations, and
287
+ known production failure modes.
288
+
289
+ Output: a markdown report under 1,200 words. Return the content
290
+ in your response.
291
+ - subagent_type: researcher
292
+ model: sonnet
293
+ brief: |
294
+ Research the leaky-bucket rate-limiting algorithm. Cover the
295
+ queue-based and meter-based variants, smoothing behavior under
296
+ burst, comparison to token bucket, reference implementations,
297
+ and known production failure modes.
298
+
299
+ Output: a markdown report under 1,200 words. Return the content
300
+ in your response.
301
+ synthesizer:
302
+ subagent_type: researcher
303
+ model: sonnet
304
+ brief: |
305
+ Synthesize the three algorithm reports into a single
306
+ recommendation document at research-rate-limiting-strategies.md
307
+ (top of the active worktree).
308
+
309
+ Frontmatter: type: research, topic: rate-limiting-strategies,
310
+ state: ephemeral, lifecycle: active, confidence: medium,
311
+ updated: <today's date>.
312
+
313
+ Document structure:
314
+ - One-line recommendation up front
315
+ - Comparison table across criteria (accuracy, memory cost, burst
316
+ behavior, implementation complexity, operational debuggability)
317
+ - Per-algorithm summary with strengths and weaknesses
318
+ - Risks and unknowns
319
+ - References
320
+
321
+ Maximum 2,000 words.
322
+
323
+ - name: crossref-existing-infrastructure
324
+ type: crossref
325
+ status: pending
326
+ artifact: crossref-existing-infrastructure.md
327
+ inputs:
328
+ independent: research-rate-limiting-strategies.md
329
+ against:
330
+ - workspace-context/canonical.md
331
+ - repos/api-gateway/
332
+ gate: review
333
+ integration:
334
+ strategy: direct
335
+ agent:
336
+ subagent_type: researcher
337
+ model: sonnet
338
+ brief: |
339
+ Compare the rate-limiting strategy recommendation against the
340
+ existing infrastructure (the repos/api-gateway/ codebase and any
341
+ relevant canonical workspace context).
342
+
343
+ Produce a gap-and-overlap matrix: where does the recommended
344
+ strategy align with current patterns, where does it diverge, and
345
+ what migration friction is implied. Rank concerns by severity.
346
+
347
+ - name: spec
348
+ type: skill
349
+ status: pending
350
+ skill: superpowers:brainstorming
351
+ artifact: design-rate-limiting.md
352
+ gate: review
353
+ integration:
354
+ strategy: direct # spec lands as design-*.md at worktree top; stripped before final PR
355
+
356
+ - name: plan
357
+ type: skill
358
+ status: pending
359
+ skill: superpowers:writing-plans
360
+ artifact: plan-rate-limiting.md
361
+ gate: review
362
+ integration:
363
+ strategy: direct
364
+
365
+ - name: implement
366
+ type: skill
367
+ status: pending
368
+ skill: superpowers:executing-plans
369
+ artifact: null
370
+ gate: review
371
+ integration:
372
+ strategy: sub-branch # code phase: sub-branch + self-merged PR
373
+ branch: feature/{session-name}-implement
374
+ self_merge: true
375
+ ---
376
+
377
+ # Goal: Evaluate and ship a rate-limiting strategy
378
+
379
+ The api-gateway needs rate limiting before the next traffic step-up. This
380
+ goal runs the full arc from candidate-algorithm research through implementation
381
+ on the session branch.
382
+
383
+ ## Start command
384
+
385
+ ```
386
+ /goal "All 5 phases in goal-evaluate-rate-limiting.md show status: complete. Phase artifacts exist at: research-rate-limiting-strategies.md, crossref-existing-infrastructure.md, design-rate-limiting.md, plan-rate-limiting.md, and the implementation commits land on the session branch (visible in git log). The /complete-work skill has produced release notes and opened the final PR; the PR URL appeared in the transcript. Or stop after 60 turns."
387
+ ```
388
+
389
+ This is the frontmatter `completion_condition` flattened to one line. Run it after reviewing the artifact; it flips the goal to `status: active`.
390
+
391
+ ## Per-phase intent
392
+
393
+ 1. **strategy-research** runs three researchers in parallel, one per
394
+ candidate algorithm, plus a synthesizer that writes the comparative
395
+ recommendation.
396
+
397
+ 2. **crossref-existing-infrastructure** validates the recommendation
398
+ against the current api-gateway codebase and canonical workspace
399
+ context, surfacing migration friction and divergences.
400
+
401
+ 3. **spec** wraps `superpowers:brainstorming` to produce the design doc
402
+ from the validated recommendation.
403
+
404
+ 4. **plan** wraps `superpowers:writing-plans` to produce the
405
+ implementation checklist.
406
+
407
+ 5. **implement** wraps `superpowers:executing-plans` on a per-phase
408
+ sub-branch (`feature/{session-name}-implement`). The main agent opens
409
+ a PR from the sub-branch back into the session/integration branch and
410
+ self-merges once the gate is satisfied. Sub-branch is deleted post-merge.
411
+
412
+ Each gate is `review`: the user approves, rejects with feedback, or
413
+ pauses at the end of every phase. No auto-advance in v1.
414
+
415
+ All phase agents and synthesizers run on Sonnet (the default for team work).
416
+ The main agent reading and orchestrating this goal runs on Opus. Haiku is
417
+ unused in this example; it would be appropriate for a phase whose sole job
418
+ is, e.g., scanning a tree and returning a tagged file list.
419
+ ````
@@ -61,6 +61,7 @@ Trivial edits (renaming, reordering) do **not** trigger a flush — they ride on
61
61
  - Do not edit the `## Tasks` section by hand or with `Edit` — always go through the helper. Manual edits will be overwritten and may miss the bookend invariant.
62
62
  - Do not add nested checkboxes — `TodoWrite` is flat, and the round-trip ignores nesting.
63
63
  - Do not omit the bookends — the helper auto-inserts them, but explicit is better than implicit.
64
+ - Do not append new tasks after the `Complete work` bookend in `TodoWrite`. Always insert them between `Start work` and `Complete work`. The disk helper silently corrects misplacement on the next flush, but the live `TodoWrite` UI shows tasks in the order they were written — appending leaves `Complete work` stranded mid-list until something triggers a flush.
64
65
  - Do not flush every keystroke — that creates pointless file churn. Flush on meaningful change or lifecycle moment.
65
66
  - Do not flush from inside a subagent — subagents have ephemeral context; only the main agent maintains the canonical `TodoWrite` state for the session.
66
67
 
@@ -12,6 +12,9 @@ This workspace follows the claude-workspace convention. All paths are relative t
12
12
  | `work-sessions/{name}/workspace/session.md` | Unified session tracker at the top of the session branch (frontmatter = machine state, body = human content) | Yes — on the session branch |
13
13
  | `work-sessions/{name}/workspace/design-*.md` | Specs for this session — consumed into release notes by /complete-work | Yes — on the session branch |
14
14
  | `work-sessions/{name}/workspace/plan-*.md` | Plans for this session — consumed into release notes by /complete-work | Yes — on the session branch |
15
+ | `work-sessions/{name}/workspace/goal-*.md` | Goal artifacts for /goal-driven multi-phase work — consumed into release notes by /complete-work | Yes — on the session branch |
16
+ | `work-sessions/{name}/workspace/research-*.md` | Phase-output research artifacts produced by goal-driven sessions — consumed into release notes by /complete-work | Yes — on the session branch |
17
+ | `work-sessions/{name}/workspace/crossref-*.md` | Phase-output crossref artifacts produced by goal-driven sessions — consumed into release notes by /complete-work | Yes — on the session branch |
15
18
  | `work-sessions/{name}/workspace/repos/` | Real directory holding nested project worktrees for this session | No (gitignored) |
16
19
  | `work-sessions/{name}/workspace/repos/{repo}/` | Project worktree nested inside the workspace worktree | No (gitignored) |
17
20
  | `workspace-context/` | Team knowledge and per-user context | Yes |
@@ -46,18 +49,19 @@ Inflight session state lives inside the session worktree at `work-sessions/{name
46
49
 
47
50
  ## Spec and Plan Locations — MANDATORY OVERRIDE
48
51
 
49
- **Specs and plans MUST be written at the top of the active session's workspace worktree, not to `docs/superpowers/` or any other location.**
52
+ **Specs, plans, and goal artifacts MUST be written at the top of the active session's workspace worktree, not to `docs/superpowers/` or any other location.**
50
53
 
51
54
  - Specs: `design-{topic}.md` at the top of `work-sessions/{session-name}/workspace/`
52
55
  - Plans: `plan-{topic}.md` at the top of `work-sessions/{session-name}/workspace/`
56
+ - Goals: `goal-{topic}.md` at the top of `work-sessions/{session-name}/workspace/`, with goal-native phase outputs as `research-{topic}.md` and `crossref-{topic}.md` siblings. See `goal-driven-work.md` for the schema and when to reach for `/goal`.
53
57
 
54
- From inside the worktree, these are plain top-level files (`design-{topic}.md`, `plan-{topic}.md`) sitting alongside `CLAUDE.md` and `workspace.json`. They are tracked on the session branch and travel with the branch on `git push`.
58
+ From inside the worktree, these are plain top-level files (`design-{topic}.md`, `plan-{topic}.md`, `goal-{topic}.md`) sitting alongside `CLAUDE.md` and `workspace.json`. They are tracked on the session branch and travel with the branch on `git push`.
55
59
 
56
- This overrides any default paths specified by external skills (e.g., Superpowers brainstorming defaults to `docs/superpowers/specs/`). Those skills state that user preferences override their defaults — this rule IS that override. Do not create `docs/superpowers/` directories. Do not write specs or plans anywhere other than the top of the active worktree.
60
+ This overrides any default paths specified by external skills (e.g., Superpowers brainstorming defaults to `docs/superpowers/specs/`). Those skills state that user preferences override their defaults — this rule IS that override. Do not create `docs/superpowers/` directories. Do not write specs, plans, or goal artifacts anywhere other than the top of the active worktree.
57
61
 
58
- If a spec/plan already exists for the current session, version it: `design-{topic}-v2.md`, `design-{topic}-v3.md`.
62
+ If a spec/plan/goal already exists for the current session, version it: `design-{topic}-v2.md`, `design-{topic}-v3.md`.
59
63
 
60
- `/complete-work` reads specs and plans from the worktree to synthesize release notes, then removes them in a dedicated commit before the final PR so main's tree stays pristine.
64
+ `/complete-work` reads specs, plans, and goal artifacts (including `research-*.md` and `crossref-*.md` phase outputs) from the worktree to synthesize release notes, then removes them in a dedicated commit before the final PR so main's tree stays pristine.
61
65
 
62
66
  ## File Naming Conventions
63
67
 
@@ -67,6 +71,9 @@ If a spec/plan already exists for the current session, version it: `design-{topi
67
71
  - Session trackers: `work-sessions/{session-name}/workspace/session.md`
68
72
  - Specs: `design-{topic}.md` (top of worktree)
69
73
  - Plans: `plan-{topic}.md` (top of worktree)
74
+ - Goals: `goal-{topic}.md` (top of worktree)
75
+ - Goal-native research outputs: `research-{topic}.md` (top of worktree)
76
+ - Goal-native crossref outputs: `crossref-{topic}.md` (top of worktree)
70
77
 
71
78
  For ephemeral content under `shared/` and `team-member/{user}/`, the filename prefix signals the type:
72
79
 
@@ -21,6 +21,7 @@ Determine paths:
21
21
  - Workspace worktree: `work-sessions/{session-name}/workspace/`
22
22
  - Project worktrees: `work-sessions/{session-name}/workspace/repos/{repo}/` for each repo in the tracker's `repos:` list
23
23
  - Read each repo's default branch from workspace.json (`repos.{repo}.branch`)
24
+ - **Release-notes base directory.** Read `workspace.releaseNotesDir` from `workspace.json` (default `workspace-context/release-notes` if the field is absent). Throughout this skill `{releaseNotesDir}` refers to that resolved value; every branch-note path is `{releaseNotesDir}/unreleased/{repo}/…`. Never use a bare `release-notes/`.
24
25
 
25
26
  ### Step 2: Rebase project repos
26
27
 
@@ -55,9 +56,12 @@ Formally read ALL sources before synthesizing — do not write release notes fro
55
56
 
56
57
  1. **Session tracker** at `work-sessions/{session-name}/workspace/session.md` — read the full body (frontmatter is machine state, body is human content)
57
58
 
58
- 2. **Session-scoped specs/plans** at the top of the session worktree:
59
+ 2. **Session-scoped specs/plans/goal artifacts** at the top of the session worktree:
59
60
  - `work-sessions/{session-name}/workspace/design-*.md` files
60
61
  - `work-sessions/{session-name}/workspace/plan-*.md` files
62
+ - `work-sessions/{session-name}/workspace/goal-*.md` files
63
+ - `work-sessions/{session-name}/workspace/research-*.md` files
64
+ - `work-sessions/{session-name}/workspace/crossref-*.md` files
61
65
  - Read each one fully
62
66
 
63
67
  3. **Handoffs** — any workspace-context entries referencing this branch:
@@ -83,10 +87,10 @@ For each repo in the tracker's `repos:` list that has commits beyond the base br
83
87
  cd work-sessions/{session-name}/workspace/repos/{repo}
84
88
  COMMIT_ID=$(git rev-parse --short HEAD)
85
89
  cd ../.. # back to the workspace worktree
86
- mkdir -p release-notes/unreleased/{repo-name}
90
+ mkdir -p {releaseNotesDir}/unreleased/{repo-name}
87
91
  ```
88
92
 
89
- **File 1: `release-notes/unreleased/{repo-name}/branch-release-notes-{COMMIT_ID}.md`** (relative to the workspace worktree)
93
+ **File 1: `{releaseNotesDir}/unreleased/{repo-name}/branch-release-notes-{COMMIT_ID}.md`** (relative to the workspace worktree)
90
94
  ```markdown
91
95
  ---
92
96
  branch: {branch}
@@ -102,7 +106,7 @@ date: {YYYY-MM-DD}
102
106
  Written from scratch per coherent-revisions rule.}
103
107
  ```
104
108
 
105
- **File 2: `release-notes/unreleased/{repo-name}/branch-release-questions-{COMMIT_ID}.md`**
109
+ **File 2: `{releaseNotesDir}/unreleased/{repo-name}/branch-release-questions-{COMMIT_ID}.md`**
106
110
  ```markdown
107
111
  ---
108
112
  branch: {branch}
@@ -121,7 +125,7 @@ The `repo:` frontmatter field is what `/release` uses to know which project repo
121
125
  After all repos are processed, commit once on the workspace branch:
122
126
  ```bash
123
127
  cd work-sessions/{session-name}/workspace
124
- git add release-notes/unreleased/
128
+ git add {releaseNotesDir}/unreleased/
125
129
  git commit -m "docs: add release notes for {branch}"
126
130
  ```
127
131
 
@@ -129,19 +133,34 @@ If a repo has no commits beyond the base, skip release notes for it.
129
133
 
130
134
  ### Step 7: Remove session artifacts from the workspace branch
131
135
 
132
- The entire `work-sessions/{session-name}/` folder is removed by the cleanup script in Step 12. Before that happens, make sure everything worth preserving has landed in release notes (Step 6) — once Step 6 has run, the tracker, specs, and plans have served their purpose.
136
+ The entire `work-sessions/{session-name}/` folder is removed by the cleanup script in Step 12. Before that happens, make sure everything worth preserving has landed in release notes (Step 6) — once Step 6 has run, the tracker, specs, plans, and goal artifacts have served their purpose.
133
137
 
134
- Session content lives at the top of the workspace worktree on the session branch. Remove these files from the branch before the final push so main's top level stays free of session artifacts:
138
+ **Goal sub-branch pre-flight (only when a `goal-*.md` artifact is present).** A `/goal`-driven session can produce per-phase sub-branches for code phases (any phase declaring `integration.strategy: sub-branch` in the goal artifact). Those sub-branches must be merged into the session branch before completion, or their work is lost when the session folder is torn down. Before stripping anything, check each repo in the session — the workspace worktree itself and every `repos/{repo}/` project worktree:
139
+
140
+ ```bash
141
+ cd work-sessions/{session-name}/workspace/repos/{repo} # repeat for the workspace worktree too
142
+ session_branch=$(git rev-parse --abbrev-ref HEAD)
143
+ for sub in $(git branch --format='%(refname:short)' --list "${session_branch}-*"); do
144
+ git merge-base --is-ancestor "$sub" "$session_branch" || echo "UNMERGED: $sub"
145
+ done
146
+ ```
147
+
148
+ If any `UNMERGED:` lines print, abort completion and show the list. The user merges the intended sub-branches into the session branch, or closes abandoned ones, then re-runs `/complete-work`. When no `goal-*.md` artifact is present, this check is a no-op and completion proceeds normally.
149
+
150
+ Session content lives at the top of the workspace worktree on the session branch. Once the pre-flight passes, remove these files from the branch before the final push so main's top level stays free of session artifacts:
135
151
 
136
152
  ```bash
137
153
  cd work-sessions/{session-name}/workspace
138
154
  git rm -f session.md 2>/dev/null || true
139
155
  git rm -f design-*.md 2>/dev/null || true
140
156
  git rm -f plan-*.md 2>/dev/null || true
157
+ git rm -f goal-*.md 2>/dev/null || true
158
+ git rm -f research-*.md 2>/dev/null || true
159
+ git rm -f crossref-*.md 2>/dev/null || true
141
160
  git commit -m "chore: remove session artifacts before PR" 2>/dev/null || true
142
161
  ```
143
162
 
144
- The `|| true` guards keep this idempotent — if a file is already gone (e.g., a session without specs), the step is a no-op. The commit is skipped when there's nothing staged.
163
+ The `|| true` guards keep this idempotent — if a file is already gone (e.g., a session without specs or goals), the step is a no-op. The commit is skipped when there's nothing staged.
145
164
 
146
165
  This commit persists in the branch's history. On squash merge or rebase merge, branch history collapses to one clean commit on main with no session artifacts. On merge commits, branch history is reachable but the final tree on main shows no session content.
147
166
 
@@ -441,7 +460,7 @@ Ask: "These changes weren't part of a formal work session. What do you want to d
441
460
  - **Revert** — undo the changes (with confirmation)
442
461
 
443
462
  ## Notes
444
- - Branch release notes live in the WORKSPACE repo at `release-notes/unreleased/{repo-name}/` — never in project repos. Project repos only ever see code commits and (at release time) `CHANGELOG.md` entries written by `/release`.
463
+ - Branch release notes live in the WORKSPACE repo at `{releaseNotesDir}/unreleased/{repo-name}/` (resolved from `workspace.json` → `workspace.releaseNotesDir`, default `workspace-context/release-notes`) — never in project repos. Project repos only ever see code commits and (at release time) `CHANGELOG.md` entries written by `/release`.
445
464
  - The session tracker's body is the primary source for release note synthesis — it captures the full session history alongside specs and plans
446
465
  - All repos get PRed and merged together — one approval for all
447
466
  - Version bumps happen in `/release`, not `/complete-work` — this avoids version drift when multiple feature branches land between releases
@@ -27,10 +27,12 @@ Check `workspace.json` for `releaseMode`:
27
27
  - **workspace**: process all repos together
28
28
  - **ask**: "Process all repos together or individually?"
29
29
 
30
+ **Release-notes base directory.** Read `workspace.releaseNotesDir` from `workspace.json` (default `workspace-context/release-notes` if the field is absent). Throughout this skill `{releaseNotesDir}` refers to that resolved value; every branch-note path is `{releaseNotesDir}/unreleased/{repo}/…`. Never use a bare `release-notes/`.
31
+
30
32
  **Step 2: Read unreleased notes**
31
33
  Branch notes live in the **workspace** repo, written there by `/complete-work`. For each target repo, list the workspace's unreleased subdirectory for that project:
32
34
  ```bash
33
- ls release-notes/unreleased/{repo}/
35
+ ls {releaseNotesDir}/unreleased/{repo}/
34
36
  ```
35
37
  Read all `branch-release-notes-*.md` and `branch-release-questions-*.md` files.
36
38
 
@@ -71,9 +73,9 @@ The entry stays short. If a change needs more detail, reference the repo's docs
71
73
 
72
74
  **Step 6: Delete consumed branch notes from the workspace**
73
75
  ```bash
74
- rm release-notes/unreleased/{repo}/branch-release-*
76
+ rm {releaseNotesDir}/unreleased/{repo}/branch-release-*
75
77
  # If the directory is now empty, remove it too:
76
- rmdir release-notes/unreleased/{repo} 2>/dev/null || true
78
+ rmdir {releaseNotesDir}/unreleased/{repo} 2>/dev/null || true
77
79
  ```
78
80
  The branch notes were an intermediate capture; their content is now in the CHANGELOG entry and their raw form in git history. They do not survive into the project repo.
79
81
 
@@ -98,7 +100,7 @@ Skip this step if the repo has no package.json or no version field.
98
100
  **Step 7c: Commit the consumed-notes deletion in the workspace**
99
101
  ```bash
100
102
  # From the workspace root
101
- git add release-notes/unreleased/
103
+ git add {releaseNotesDir}/unreleased/
102
104
  git commit -m "release: consume {repo} branch notes for v{version}"
103
105
  ```
104
106
  Workspace and project repos have separate commits — they are separate git histories.
@@ -138,7 +140,7 @@ Process ephemeral workspace-context entries:
138
140
  ## Notes
139
141
 
140
142
  - Release entries live in `CHANGELOG.md` at the project repo root — one file, one concise entry per version. No `release-notes/v*.md`, no `release-notes/archive/`.
141
- - Branch notes live in the WORKSPACE at `release-notes/unreleased/{repo}/`. `/complete-work` writes them; `/release` consumes and deletes them. They never reach project repos.
143
+ - Branch notes live in the WORKSPACE at `{releaseNotesDir}/unreleased/{repo}/` (resolved from `workspace.json` → `workspace.releaseNotesDir`, default `workspace-context/release-notes`). `/complete-work` writes them; `/release` consumes and deletes them. They never reach project repos.
142
144
  - Versions are bumped here, not in `/complete-work`. This keeps the version semantics aligned with what actually shipped (accumulated changes since last release).
143
145
  - The public repo stays lean. Detailed per-branch retrospection exists in workspace git history (the consumed-notes commit) but is not surfaced as standalone files in either repo.
144
146
  - Context synthesis happens in the WORKSPACE repo — Step 7c (consumed-notes) and Step 9 (workspace-context synthesis) are separate workspace commits.