@ulysses-ai/create-workspace 0.15.0-beta.1 → 0.16.0-beta.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/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.1",
3
+ "version": "0.16.0-beta.0",
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,388 @@
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
+ - 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.
19
+ - 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.
20
+
21
+ ## Frontmatter schema
22
+
23
+ ```yaml
24
+ ---
25
+ type: goal
26
+ topic: <kebab-case-topic>
27
+ status: active # pending | active | complete | cancelled
28
+ # pending: artifact written but /goal not yet invoked
29
+ # active: /goal loop is running
30
+ # complete: all phases complete and condition met
31
+ # cancelled: goal abandoned without completion
32
+ current_phase: <phase-name> # the phase currently in progress or next up
33
+ completion_condition: > # mirrored from the `/goal` text so it survives `/goal clear` and is auditable
34
+ <multi-line condition string>
35
+ turn_budget: <int> # backstop; the condition itself should reference it
36
+ phases:
37
+ - name: <phase-name>
38
+ type: parallel-research | crossref | skill
39
+ status: pending # pending | in_progress | complete | failed
40
+ artifact: <path or null> # output artifact path, relative to worktree top; null for phases that commit to repo
41
+ gate: review | auto # default: review
42
+
43
+ # for type: parallel-research
44
+ team:
45
+ agents:
46
+ - subagent_type: <type>
47
+ brief: |
48
+ <multi-line brief>
49
+ - subagent_type: <type>
50
+ brief: |
51
+ <multi-line brief>
52
+ synthesizer:
53
+ subagent_type: <type>
54
+ brief: |
55
+ <multi-line brief: reads sibling agent outputs, writes the phase artifact>
56
+
57
+ # for type: crossref
58
+ inputs:
59
+ independent: <path to the just-produced independent artifact>
60
+ against: <path or list of paths to compare against>
61
+ brief: |
62
+ <multi-line brief for the crossref agent>
63
+
64
+ # for type: skill
65
+ skill: <plugin:skill-name> # e.g. superpowers:brainstorming
66
+ ---
67
+ ```
68
+
69
+ 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.
70
+
71
+ ## Phase types
72
+
73
+ 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.
74
+
75
+ - **`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.
76
+ - **`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.
77
+ - **`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.
78
+
79
+ 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.
80
+
81
+ ## Agent-team dispatch pattern (v1: stateless)
82
+
83
+ 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.
84
+
85
+ The main agent's responsibility per phase:
86
+
87
+ 1. Mark the phase `in_progress` in `goal-{topic}.md` frontmatter.
88
+ 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).
89
+ 3. Collect agent outputs.
90
+ 4. If a `synthesizer` is declared, dispatch it with the sibling outputs and have it write the `artifact:` file.
91
+ 5. If no synthesizer, the main agent writes the `artifact:` file directly from the collected outputs.
92
+ 6. Mark the phase `complete`, update `current_phase` to the next pending phase.
93
+ 7. End the turn with a short status note (for the `/goal` evaluator) and, if `gate: review`, an explicit question to the user.
94
+
95
+ 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.
96
+
97
+ ## Gate convention
98
+
99
+ `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.
100
+
101
+ - **approve** → phase stays `complete`, advance to next phase next turn.
102
+ - **reject with feedback** → flip phase back to `pending` and re-run it with the feedback prepended to the team brief.
103
+ - **pause** → state is durable in `goal-{topic}.md`; resume with `claude --resume`.
104
+
105
+ 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.
106
+
107
+ `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.
108
+
109
+ ## Integration branch and per-phase sub-PRs
110
+
111
+ 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.
112
+
113
+ Two merge strategies, picked per phase:
114
+
115
+ - **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.
116
+ - **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.
117
+
118
+ 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`:
119
+
120
+ - `feature/ulysses-goals` — session/integration branch
121
+ - `feature/ulysses-goals-strategy-research` — phase sub-branch (if a research phase were promoted to sub-branch strategy)
122
+ - `feature/ulysses-goals-implement` — phase sub-branch for the implement phase
123
+
124
+ A phase declares its merge strategy in frontmatter via an optional `integration:` block:
125
+
126
+ ```yaml
127
+ phases:
128
+ - name: implement
129
+ type: skill
130
+ skill: superpowers:executing-plans
131
+ integration:
132
+ strategy: sub-branch # direct | sub-branch
133
+ branch: feature/{session-name}-implement # explicit, or derived if omitted
134
+ self_merge: true # main agent merges the sub-PR after gate is satisfied; default true
135
+ ```
136
+
137
+ If `integration:` is omitted, defaults are applied by phase type per the list above.
138
+
139
+ 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.
140
+
141
+ `/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.
142
+
143
+ ## Model tiering
144
+
145
+ `/goal`-driven work uses a three-tier model assignment, biased toward the right tool for each shape of work:
146
+
147
+ - **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.
148
+ - **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.
149
+ - **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.
150
+
151
+ Phase frontmatter sets the model per agent via the `model:` field, which maps to the `Agent` tool's `model` parameter:
152
+
153
+ ```yaml
154
+ team:
155
+ agents:
156
+ - subagent_type: researcher
157
+ model: sonnet # default for parallel-research; rarely overridden
158
+ brief: |
159
+ ...
160
+ synthesizer:
161
+ subagent_type: researcher
162
+ model: sonnet
163
+ brief: |
164
+ ...
165
+ ```
166
+
167
+ For artifact-only or tagging work where Haiku is enough, declare it explicitly:
168
+
169
+ ```yaml
170
+ - subagent_type: researcher
171
+ model: haiku
172
+ brief: |
173
+ Scan {paths} for files matching {pattern} and return a tagged list.
174
+ ```
175
+
176
+ 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.
177
+
178
+ ## Writing a good completion condition
179
+
180
+ 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:
181
+
182
+ - **Specific.** Names the artifacts that must exist (file paths, commit references, PR URLs) rather than vague outcomes.
183
+ - **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."
184
+ - **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.
185
+ - **Within the 4000-char limit.** Up to four kilobytes of condition text are accepted.
186
+
187
+ A reasonable template:
188
+
189
+ ```
190
+ 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.
191
+ ```
192
+
193
+ Fill in `<topic>`, paths, and `<N>` per goal. Anchor on artifacts and committed state, not on feelings.
194
+
195
+ ## Lifecycle integration
196
+
197
+ - `/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, then `/goal "<condition>"` kicks off the loop.
198
+ - The goal artifact lives on the session branch and travels with `git push`. It survives across machines and `--resume`.
199
+ - `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`.
200
+ - `/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.
201
+ - `/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.
202
+
203
+ 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/`.
204
+
205
+ ## Tracker integration
206
+
207
+ 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:`.
208
+
209
+ 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.
210
+
211
+ ## Out of scope
212
+
213
+ - Nested or sub-goals. v1 is flat.
214
+ - DAG between phases. Sequential at the phase level; parallelism only inside a phase via the team agents.
215
+ - Persistent named teams (`TeamCreate`). v1 is stateless dispatch.
216
+ - Frontmatter linter for `goal-*.md`. Manual review is fine for v1; revisit if workspaces using the template hit consistent shape errors.
217
+ - `/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.
218
+
219
+ ## Appendix: worked example
220
+
221
+ A complete `goal-evaluate-rate-limiting.md` illustrating all three phase types. The topic is intentionally generic — the example is reference material, not prescriptive.
222
+
223
+ ```yaml
224
+ ---
225
+ type: goal
226
+ topic: evaluate-rate-limiting
227
+ status: pending
228
+ current_phase: strategy-research
229
+ completion_condition: >
230
+ All 5 phases in goal-evaluate-rate-limiting.md show status: complete.
231
+ Phase artifacts exist at: research-rate-limiting-strategies.md,
232
+ crossref-existing-infrastructure.md, design-rate-limiting.md,
233
+ plan-rate-limiting.md, and the implementation commits land on the session
234
+ branch (visible in git log). The /complete-work skill has produced release
235
+ notes and opened the final PR; the PR URL appeared in the transcript.
236
+ Or stop after 60 turns.
237
+ turn_budget: 60
238
+ phases:
239
+ - name: strategy-research
240
+ type: parallel-research
241
+ status: pending
242
+ artifact: research-rate-limiting-strategies.md
243
+ gate: review
244
+ integration:
245
+ strategy: direct # artifact-only phase; commits straight to session branch
246
+ team:
247
+ agents:
248
+ - subagent_type: researcher
249
+ model: sonnet
250
+ brief: |
251
+ Research the token-bucket rate-limiting algorithm. Cover the
252
+ mechanics, parameter trade-offs (capacity, refill rate), edge
253
+ cases (burst behavior, clock skew), reference implementations in
254
+ popular libraries, and known production failure modes.
255
+
256
+ Output: a markdown report under 1,200 words. Return the content
257
+ in your response.
258
+ - subagent_type: researcher
259
+ model: sonnet
260
+ brief: |
261
+ Research the sliding-window rate-limiting algorithm. Cover both
262
+ the sliding log and sliding counter variants, accuracy
263
+ trade-offs, memory cost at scale, reference implementations, and
264
+ known production failure modes.
265
+
266
+ Output: a markdown report under 1,200 words. Return the content
267
+ in your response.
268
+ - subagent_type: researcher
269
+ model: sonnet
270
+ brief: |
271
+ Research the leaky-bucket rate-limiting algorithm. Cover the
272
+ queue-based and meter-based variants, smoothing behavior under
273
+ burst, comparison to token bucket, reference implementations,
274
+ and known production failure modes.
275
+
276
+ Output: a markdown report under 1,200 words. Return the content
277
+ in your response.
278
+ synthesizer:
279
+ subagent_type: researcher
280
+ model: sonnet
281
+ brief: |
282
+ Synthesize the three algorithm reports into a single
283
+ recommendation document at research-rate-limiting-strategies.md
284
+ (top of the active worktree).
285
+
286
+ Frontmatter: type: research, topic: rate-limiting-strategies,
287
+ state: ephemeral, lifecycle: active, confidence: medium,
288
+ updated: <today's date>.
289
+
290
+ Document structure:
291
+ - One-line recommendation up front
292
+ - Comparison table across criteria (accuracy, memory cost, burst
293
+ behavior, implementation complexity, operational debuggability)
294
+ - Per-algorithm summary with strengths and weaknesses
295
+ - Risks and unknowns
296
+ - References
297
+
298
+ Maximum 2,000 words.
299
+
300
+ - name: crossref-existing-infrastructure
301
+ type: crossref
302
+ status: pending
303
+ artifact: crossref-existing-infrastructure.md
304
+ inputs:
305
+ independent: research-rate-limiting-strategies.md
306
+ against:
307
+ - workspace-context/canonical.md
308
+ - repos/api-gateway/
309
+ gate: review
310
+ integration:
311
+ strategy: direct
312
+ agent:
313
+ subagent_type: researcher
314
+ model: sonnet
315
+ brief: |
316
+ Compare the rate-limiting strategy recommendation against the
317
+ existing infrastructure (the repos/api-gateway/ codebase and any
318
+ relevant canonical workspace context).
319
+
320
+ Produce a gap-and-overlap matrix: where does the recommended
321
+ strategy align with current patterns, where does it diverge, and
322
+ what migration friction is implied. Rank concerns by severity.
323
+
324
+ - name: spec
325
+ type: skill
326
+ status: pending
327
+ skill: superpowers:brainstorming
328
+ artifact: design-rate-limiting.md
329
+ gate: review
330
+ integration:
331
+ strategy: direct # spec lands as design-*.md at worktree top; stripped before final PR
332
+
333
+ - name: plan
334
+ type: skill
335
+ status: pending
336
+ skill: superpowers:writing-plans
337
+ artifact: plan-rate-limiting.md
338
+ gate: review
339
+ integration:
340
+ strategy: direct
341
+
342
+ - name: implement
343
+ type: skill
344
+ status: pending
345
+ skill: superpowers:executing-plans
346
+ artifact: null
347
+ gate: review
348
+ integration:
349
+ strategy: sub-branch # code phase: sub-branch + self-merged PR
350
+ branch: feature/{session-name}-implement
351
+ self_merge: true
352
+ ---
353
+
354
+ # Goal: Evaluate and ship a rate-limiting strategy
355
+
356
+ The api-gateway needs rate limiting before the next traffic step-up. This
357
+ goal runs the full arc from candidate-algorithm research through implementation
358
+ on the session branch.
359
+
360
+ ## Per-phase intent
361
+
362
+ 1. **strategy-research** runs three researchers in parallel, one per
363
+ candidate algorithm, plus a synthesizer that writes the comparative
364
+ recommendation.
365
+
366
+ 2. **crossref-existing-infrastructure** validates the recommendation
367
+ against the current api-gateway codebase and canonical workspace
368
+ context, surfacing migration friction and divergences.
369
+
370
+ 3. **spec** wraps `superpowers:brainstorming` to produce the design doc
371
+ from the validated recommendation.
372
+
373
+ 4. **plan** wraps `superpowers:writing-plans` to produce the
374
+ implementation checklist.
375
+
376
+ 5. **implement** wraps `superpowers:executing-plans` on a per-phase
377
+ sub-branch (`feature/{session-name}-implement`). The main agent opens
378
+ a PR from the sub-branch back into the session/integration branch and
379
+ self-merges once the gate is satisfied. Sub-branch is deleted post-merge.
380
+
381
+ Each gate is `review`: the user approves, rejects with feedback, or
382
+ pauses at the end of every phase. No auto-advance in v1.
383
+
384
+ All phase agents and synthesizers run on Sonnet (the default for team work).
385
+ The main agent reading and orchestrating this goal runs on Opus. Haiku is
386
+ unused in this example; it would be appropriate for a phase whose sole job
387
+ is, e.g., scanning a tree and returning a tagged file list.
388
+ ```
@@ -80,3 +80,30 @@ node .claude/scripts/build-workspace-context.mjs --write --root . # regenerate
80
80
  ```
81
81
 
82
82
  `/maintenance` checks staleness in audit mode and regenerates in cleanup mode. Hand edits to `index.md`, `canonical.md`, or any `team-member/{user}/index.md` are overwritten — update source files (or their `description:` frontmatter) instead.
83
+
84
+ ## What Belongs in Canonical
85
+
86
+ Canonical content is loaded verbatim into every session prompt. It frames how Claude reads the rest of the conversation, so the bar for what goes in is narrower than the bar for `shared/` (root) or `team-member/{user}/`. The principle: canonical should describe what *is* and what *to do*, not what *to think*.
87
+
88
+ **Belongs in canonical (`shared/locked/`):**
89
+
90
+ - **Facts about the system** — current architecture, supported targets, naming conventions, where things live, what's published.
91
+ - **Hard constraints** — "must work on Windows and macOS," "PRs only, no direct push to main," "this directory is gitignored." Constraints scope the solution space without prejudging which solution to pick.
92
+ - **Process rules** — workflow discipline that applies regardless of the task. Branch protection, release cadence, mandatory review gates.
93
+ - **Settled-rejection guardrails** — "we evaluated approach X, rejected because Y, do not propose this again." Saves Claude from spending tokens re-proposing already-evaluated options. The guardrail must include the *why*, so future-Claude can recognize when an edge case actually warrants revisiting the rejection.
94
+ - **Meta-principles for debiasing** — explicit reminders to widen evaluation, like the dogfood-bias risk doc. Anti-shading by design.
95
+
96
+ **Does NOT belong in canonical:**
97
+
98
+ - **Opinions on open technical questions** — "library X is better than Y for this kind of problem," "approach A is preferred over B." These shape Claude's reasoning starting point so it begins from the conclusion rather than reasoning toward it. If the team has a strong preference, write it as a constraint ("use X, not Y") with the reason — or keep it in `shared/` (root) where it is reference material but not always-loaded.
99
+ - **Conclusions Claude might be asked to question** — "we believe the architecture is correct," "feature Z is the right shape." If a topic is the subject of ongoing design work, locking a conclusion biases the discussion before it starts.
100
+ - **Personal preferences** — what one contributor finds elegant or annoying. Belongs in `team-member/{user}/`.
101
+ - **Status snapshots that age fast** — sprint-current priorities, "we're working on X this week." `project-status.md` is the bounded exception for high-level project status; finer-grained "what's in flight" lives in the tracker.
102
+
103
+ **The test before promoting to canonical:**
104
+
105
+ > If Claude read this for the first time during a session about an unrelated topic, would it (a) help frame the problem correctly, or (b) push Claude toward a particular answer to a question that hasn't been asked yet?
106
+
107
+ (a) is canonical. (b) is `shared/` (root) at most, more often `team-member/{user}/`.
108
+
109
+ The distinction matters because pre-loaded conclusions in always-loaded context don't read like opinions to Claude — they read like ground truth. A reference doc Claude *finds* during research is weighed against the question; a canonical doc loaded before the question is asked frames what Claude considers in the first place. `/release` and `/promote` should apply this test before locking content.
@@ -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
 
@@ -55,9 +55,12 @@ Formally read ALL sources before synthesizing — do not write release notes fro
55
55
 
56
56
  1. **Session tracker** at `work-sessions/{session-name}/workspace/session.md` — read the full body (frontmatter is machine state, body is human content)
57
57
 
58
- 2. **Session-scoped specs/plans** at the top of the session worktree:
58
+ 2. **Session-scoped specs/plans/goal artifacts** at the top of the session worktree:
59
59
  - `work-sessions/{session-name}/workspace/design-*.md` files
60
60
  - `work-sessions/{session-name}/workspace/plan-*.md` files
61
+ - `work-sessions/{session-name}/workspace/goal-*.md` files
62
+ - `work-sessions/{session-name}/workspace/research-*.md` files
63
+ - `work-sessions/{session-name}/workspace/crossref-*.md` files
61
64
  - Read each one fully
62
65
 
63
66
  3. **Handoffs** — any workspace-context entries referencing this branch:
@@ -129,19 +132,34 @@ If a repo has no commits beyond the base, skip release notes for it.
129
132
 
130
133
  ### Step 7: Remove session artifacts from the workspace branch
131
134
 
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.
135
+ 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
136
 
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:
137
+ **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:
138
+
139
+ ```bash
140
+ cd work-sessions/{session-name}/workspace/repos/{repo} # repeat for the workspace worktree too
141
+ session_branch=$(git rev-parse --abbrev-ref HEAD)
142
+ for sub in $(git branch --format='%(refname:short)' --list "${session_branch}-*"); do
143
+ git merge-base --is-ancestor "$sub" "$session_branch" || echo "UNMERGED: $sub"
144
+ done
145
+ ```
146
+
147
+ 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.
148
+
149
+ 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
150
 
136
151
  ```bash
137
152
  cd work-sessions/{session-name}/workspace
138
153
  git rm -f session.md 2>/dev/null || true
139
154
  git rm -f design-*.md 2>/dev/null || true
140
155
  git rm -f plan-*.md 2>/dev/null || true
156
+ git rm -f goal-*.md 2>/dev/null || true
157
+ git rm -f research-*.md 2>/dev/null || true
158
+ git rm -f crossref-*.md 2>/dev/null || true
141
159
  git commit -m "chore: remove session artifacts before PR" 2>/dev/null || true
142
160
  ```
143
161
 
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.
162
+ 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
163
 
146
164
  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
165