@ulysses-ai/create-workspace 0.14.0-beta.3 → 0.15.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.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/template/.claude/agents/reviewer.md +1 -1
  3. package/template/.claude/hooks/pre-compact.mjs +1 -1
  4. package/template/.claude/hooks/repo-write-detection.mjs +2 -2
  5. package/template/.claude/hooks/session-start.mjs +10 -7
  6. package/template/.claude/hooks/subagent-start.mjs +3 -3
  7. package/template/.claude/recipes/migrate-from-notion.md +6 -6
  8. package/template/.claude/rules/coherent-revisions.md +2 -2
  9. package/template/.claude/rules/local-dev-environment.md.skip +2 -2
  10. package/template/.claude/rules/memory-guidance.md +20 -14
  11. package/template/.claude/rules/token-economics.md.skip +2 -2
  12. package/template/.claude/rules/work-item-tracking.md +1 -1
  13. package/template/.claude/rules/workspace-structure.md +36 -15
  14. package/template/.claude/scripts/build-workspace-context.mjs +365 -0
  15. package/template/.claude/scripts/build-workspace-context.test.mjs +633 -0
  16. package/template/.claude/scripts/capture-context.mjs +217 -0
  17. package/template/.claude/scripts/capture-context.test.mjs +383 -0
  18. package/template/.claude/scripts/generate-claude-local.mjs +104 -0
  19. package/template/.claude/scripts/generate-claude-local.test.mjs +184 -0
  20. package/template/.claude/scripts/migrate-open-work.mjs +1 -1
  21. package/template/.claude/scripts/migrate-to-workspace-context.mjs +520 -0
  22. package/template/.claude/scripts/migrate-to-workspace-context.test.mjs +325 -0
  23. package/template/.claude/scripts/sweep-references.mjs +177 -0
  24. package/template/.claude/scripts/sweep-references.test.mjs +184 -0
  25. package/template/.claude/skills/aside/SKILL.md +49 -44
  26. package/template/.claude/skills/braindump/SKILL.md +25 -19
  27. package/template/.claude/skills/build-docs-site/SKILL.md +1 -1
  28. package/template/.claude/skills/build-docs-site/checklists/framing.md +1 -1
  29. package/template/.claude/skills/complete-work/SKILL.md +3 -3
  30. package/template/.claude/skills/handoff/SKILL.md +31 -30
  31. package/template/.claude/skills/maintenance/SKILL.md +18 -18
  32. package/template/.claude/skills/pause-work/SKILL.md +1 -1
  33. package/template/.claude/skills/promote/SKILL.md +18 -8
  34. package/template/.claude/skills/release/SKILL.md +17 -13
  35. package/template/.claude/skills/start-work/SKILL.md +1 -1
  36. package/template/.claude/skills/workspace-init/SKILL.md +12 -12
  37. package/template/CLAUDE.md.tmpl +4 -3
  38. package/template/_gitignore +1 -0
  39. package/template/workspace.json.tmpl +2 -2
  40. package/template/.claude/scripts/build-shared-context-index.mjs +0 -212
  41. package/template/.claude/scripts/build-shared-context-index.test.mjs +0 -318
@@ -12,31 +12,34 @@ Capture a drive-by idea without interrupting the current conversation. By defaul
12
12
  - `/aside <thought>` — researched mode (default). Background subagent explores the idea.
13
13
  - `/aside --quick <thought>` — note only. No subagent, no research. Just park the thought.
14
14
 
15
- Everything after `/aside` (or `/aside --quick`) is the user's thought. No name parameter — the filename is generated from the content.
15
+ Everything after `/aside` (or `/aside --quick`) is the user's thought. No name parameter — the slug is generated from the content.
16
16
 
17
17
  ## Quick Mode (`--quick`)
18
18
 
19
19
  No subagent. Execute these steps directly:
20
20
 
21
- 1. Parse the user's thought from the arguments (everything after `--quick`)
22
- 2. Generate a kebab-case slug from the content (3-5 words that capture the core idea)
23
- 3. Check if `shared-context/{user}/local-only-{slug}.md` exists. If so, append `-2`, `-3`, etc.
24
- 4. Infer 2-3 threads worth exploring later for the Further Investigation section
25
- 5. Write the file using the Quick Mode template below
26
- 6. Report the file path to the user: "Noted: `shared-context/{user}/local-only-{slug}.md`"
21
+ 1. Parse the user's thought from the arguments (everything after `--quick`).
22
+ 2. Generate a kebab-case slug from the content (3-5 words that capture the core idea).
23
+ 3. Compose the body using the Quick Mode template below (verbatim user thought + a Further Investigation section with 2-3 inferred threads).
24
+ 4. Use the centralized helper to compute the path, apply the `braindump_` prefix, write the frontmatter (with `variant: aside`), and stay gitignored:
25
+
26
+ ```bash
27
+ echo "$BODY" | node .claude/scripts/capture-context.mjs \
28
+ --type braindump \
29
+ --topic {kebab-slug} \
30
+ --scope team-member \
31
+ --user {workspace.user} \
32
+ --variant aside \
33
+ --local-only
34
+ ```
27
35
 
28
- ### Quick Mode Template
36
+ 5. Report the printed path to the user: "Noted: `{path}`."
29
37
 
30
- ```yaml
31
- ---
32
- state: ephemeral
33
- lifecycle: active
34
- type: braindump
35
- variant: aside
36
- author: {user}
37
- updated: {YYYY-MM-DD}
38
- ---
38
+ The helper handles collisions automatically by appending `-2`, `-3`, etc.
39
+
40
+ ### Quick Mode Body Template
39
41
 
42
+ ```markdown
40
43
  ## User's Original Thought
41
44
  {Verbatim text from the user — copy exactly as provided}
42
45
 
@@ -47,37 +50,38 @@ related areas to check. Quick inference, not deep research.}
47
50
 
48
51
  ## Research Mode (default)
49
52
 
50
- Dispatch the `aside-researcher` agent in the background:
51
-
52
- 1. Parse the user's thought from the arguments (everything after `/aside`)
53
- 2. Generate a kebab-case slug from the content (3-5 words that capture the core idea)
54
- 3. Check if `shared-context/{user}/local-only-{slug}.md` exists. If so, append `-2`, `-3`, etc.
55
- 4. Determine the target file path: `shared-context/{user}/local-only-{slug}.md`
56
- 5. Dispatch the `aside-researcher` agent using the Agent tool:
53
+ Dispatch the `aside-researcher` agent in the background. The full mode uses `--type research` so the file is named `local-only-research_{slug}.md`, distinguishing it from quick asides.
54
+
55
+ 1. Parse the user's thought from the arguments (everything after `/aside`).
56
+ 2. Generate a kebab-case slug from the content.
57
+ 3. Compute the target path with `--print-only` so you can hand it to the subagent:
58
+ ```bash
59
+ node .claude/scripts/capture-context.mjs \
60
+ --type research \
61
+ --topic {kebab-slug} \
62
+ --scope team-member \
63
+ --user {workspace.user} \
64
+ --variant aside \
65
+ --local-only \
66
+ --print-only
67
+ ```
68
+ 4. Dispatch the `aside-researcher` agent using the Agent tool:
57
69
  - `subagent_type`: use the `aside-researcher` agent definition
58
70
  - `run_in_background: true`
59
71
  - Prompt must include:
60
72
  - The user's verbatim thought
61
- - The target file path
73
+ - The target file path (from step 3)
62
74
  - The workspace root path
63
- - The Research Mode template (below)
64
- 6. Confirm dispatch to the user: "Researching in the background. I'll let you know when it's done."
65
- 7. When the agent completes, report: file path and a one-line summary of what was found
75
+ - The Research Mode body template (below)
76
+ - Tell the agent to write the body via `capture-context.mjs --update` so the same path is reused, and to pipe the rendered body on stdin.
77
+ 5. Confirm dispatch to the user: "Researching in the background. I'll let you know when it's done."
78
+ 6. When the agent completes, report: file path and a one-line summary of what was found.
66
79
 
67
- ### Research Mode Template
80
+ ### Research Mode Body Template
68
81
 
69
82
  Include this template in the agent's prompt so it writes the correct format:
70
83
 
71
- ```yaml
72
- ---
73
- state: ephemeral
74
- lifecycle: active
75
- type: braindump
76
- variant: aside
77
- author: {user}
78
- updated: {YYYY-MM-DD}
79
- ---
80
-
84
+ ```markdown
81
85
  ## User's Original Thought
82
86
  {Verbatim text from the user — copy exactly as provided, never paraphrase}
83
87
 
@@ -98,15 +102,16 @@ Topics that would benefit from deeper exploration or user input.}
98
102
 
99
103
  ## File Naming
100
104
 
101
- - **Location:** `shared-context/{user}/local-only-{slug}.md`
102
- - **Slug:** Generated from the thought content. Kebab-case, 3-5 words. E.g., `refresh-token-caching`, `deploy-pipeline-idea`
103
- - **Collision handling:** If the file exists, append `-2`, `-3`, etc.
104
- - **Always `local-only-`** gitignored, never auto-committed
105
+ - **Quick mode:** `workspace-context/team-member/{user}/local-only-braindump_{slug}.md`
106
+ - **Research mode:** `workspace-context/team-member/{user}/local-only-research_{slug}.md`
107
+ - **Slug:** Kebab-case, 3-5 words. E.g., `refresh-token-caching`, `deploy-pipeline-idea`.
108
+ - **Collision handling:** Helper auto-appends `-2`, `-3`,
109
+ - **Always `local-only-`** — gitignored, never auto-committed.
105
110
 
106
111
  ## Session Behavior
107
112
 
108
113
  Asides are session-agnostic. Regardless of whether a work session is active:
109
- - Files always go to `shared-context/{user}/`
114
+ - Files always go to `workspace-context/team-member/{user}/`
110
115
  - No interaction with the session tracker
111
116
  - No interaction with `/complete-work` synthesis
112
117
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: braindump
3
- description: Capture discussion-heavy topics into shared context. Use when reasoning, exploration, or design rationale should be preserved. Accepts optional name parameter.
3
+ description: Capture discussion-heavy topics into workspace-context. Use when reasoning, exploration, or design rationale should be preserved. Accepts optional name parameter.
4
4
  ---
5
5
 
6
6
  # Braindump
7
7
 
8
- Capture discussion reasoning, exploration results, and design rationale into shared context. More freeform than /handoff — designed for "why we chose X" content. User-scoped by default.
8
+ Capture discussion reasoning, exploration results, and design rationale into workspace-context. More freeform than /handoff — designed for "why we chose X" content. Per-user (`team-member/{user}/`) is the default scope.
9
9
 
10
10
  ## Parameters
11
11
  - `/braindump {name}` — create or update a named braindump
@@ -27,25 +27,29 @@ When called within an active work session (the active-session pointer at `.claud
27
27
  ```
28
28
 
29
29
  When called from the workspace root (no active session):
30
- - Create a `local-only-{name}.md` file (root only allows local-only writes)
30
+ - Use `--local-only` so the captured file is gitignored (the root only allows local-only writes)
31
31
  - Suggest starting a work session if the braindump is about actionable work
32
32
 
33
33
  The flows below apply when NOT in an active work session, or when the user explicitly asks for a standalone braindump file.
34
34
 
35
35
  ## Flow: Named
36
36
 
37
- Follows the same naming, scoping (user/team/local-only), and commit flow as `/handoff` but with a different file format:
37
+ Use the centralized `capture-context.mjs` helper — it computes the path, applies the `braindump_` prefix, and writes the frontmatter so this skill doesn't have to:
38
38
 
39
- ```yaml
40
- ---
41
- state: ephemeral
42
- lifecycle: active
43
- type: braindump
44
- topic: {name}
45
- author: {user}
46
- updated: {YYYY-MM-DD}
47
- ---
39
+ ```bash
40
+ echo "$BODY" | node .claude/scripts/capture-context.mjs \
41
+ --type braindump \
42
+ --topic {kebab-case-name} \
43
+ --scope team-member \
44
+ --user {workspace.user} \
45
+ --description "{one-line summary}"
46
+ ```
48
47
 
48
+ Add `--scope shared` (and drop `--user`) to put the file in `workspace-context/shared/` for team visibility. Add `--local-only` to keep it gitignored. Add `--update` to overwrite an existing file with the same name; without it, the helper appends `-2`, `-3`, etc. on collision.
49
+
50
+ The body content sent on stdin should follow this template:
51
+
52
+ ```markdown
49
53
  ## Context
50
54
  {What prompted this discussion}
51
55
 
@@ -59,6 +63,8 @@ updated: {YYYY-MM-DD}
59
63
  {What this decision means for future work}
60
64
  ```
61
65
 
66
+ The helper writes the frontmatter (`state: ephemeral`, `lifecycle: active`, `type: braindump`, `topic`, `author`, `updated`) and prints the absolute path on stdout so the skill can `git add` and commit it.
67
+
62
68
  ## Flow: Side Braindump (deprecated)
63
69
 
64
70
  `/braindump side` has been replaced by the `/aside` skill. If invoked:
@@ -74,7 +80,7 @@ updated: {YYYY-MM-DD}
74
80
 
75
81
  ## Include task snapshot
76
82
 
77
- If an active session exists (detected via `.claude/.active-session.json`), include a `## Tasks at capture time` section in the braindump artifact with a snapshot of the current `TodoWrite` state:
83
+ If an active session exists (detected via `.claude/.active-session.json`), include a `## Tasks at capture time` section in the braindump body before piping it to `capture-context.mjs`:
78
84
 
79
85
  ```markdown
80
86
  ## Tasks at capture time
@@ -85,11 +91,11 @@ If an active session exists (detected via `.claude/.active-session.json`), inclu
85
91
  - [ ] Complete work
86
92
  ```
87
93
 
88
- Use the same GFM checkbox format as `session.md`'s `## Tasks` section (just `content` and `status` per task — no `activeForm` field, no blockquote line) and render it inline in the braindump. Do NOT call `sync-tasks.mjs --write` — braindumps are snapshots, not the canonical store.
94
+ Use the same GFM checkbox format as `session.md`'s `## Tasks` section (just `content` and `status` per task — no `activeForm` field, no blockquote line). Do NOT call `sync-tasks.mjs --write` — braindumps are snapshots, not the canonical store.
89
95
 
90
96
  ## Updating Existing Braindumps
91
97
 
92
- When updating, rewrite as a fresh snapshot (coherent-revisions rule). The updated braindump should read as if written in one pass.
98
+ When updating, rewrite as a fresh snapshot (coherent-revisions rule) and pass `--update` to `capture-context.mjs`. The updated braindump should read as if written in one pass.
93
99
 
94
100
  ## Key Differences from /handoff
95
101
  - `/handoff` is structured around work state (branch, status, next steps)
@@ -98,14 +104,14 @@ When updating, rewrite as a fresh snapshot (coherent-revisions rule). The update
98
104
  - Use `/braindump` when you're capturing a discussion or decision
99
105
 
100
106
  ## Auto-commit
101
- Same as `/handoff` commit the file alone:
107
+ Use the path that `capture-context.mjs` printed:
102
108
  ```bash
103
- git add shared-context/{path-to-file}
109
+ git add {printed-path}
104
110
  git commit -m "braindump: {name}"
105
111
  ```
106
112
 
107
113
  ## Notes
108
- - User-scoped is the default
114
+ - Per-user (`team-member/{user}/`) is the default scope
109
115
  - One topic, one file — don't mix unrelated ideas in one braindump
110
116
  - Drive-by ideas now use `/aside` instead of `/braindump side`
111
117
  - Auto-committing context files without user request is a workflow artifact — this intentionally bypasses the "do not commit unless asked" convention
@@ -96,7 +96,7 @@ For the codebase:
96
96
  - Read actual implementations, not just existing docs about them
97
97
 
98
98
  For shared context:
99
- - Walk `shared-context/` for handoffs, braindumps, locked team knowledge, release notes
99
+ - Walk `workspace-context/` for handoffs, braindumps, locked team knowledge, release notes
100
100
 
101
101
  For work-session history:
102
102
  - Walk `work-sessions/*/workspace/session.md` for any currently-active session trackers — their bodies may contain decisions not yet consumed into release notes
@@ -52,7 +52,7 @@ For each selected option, **ask for specific paths**.
52
52
 
53
53
  > What other sources should I pull from?
54
54
  >
55
- > - Shared context files in the workspace
55
+ > - Workspace-context files in the workspace
56
56
  > - Claude chat history from prior sessions on this project
57
57
  > - Notion export (zip)
58
58
  > - Confluence / wiki export
@@ -60,9 +60,9 @@ Formally read ALL sources before synthesizing — do not write release notes fro
60
60
  - `work-sessions/{session-name}/workspace/plan-*.md` files
61
61
  - Read each one fully
62
62
 
63
- 3. **Handoffs** — any shared-context entries referencing this branch:
63
+ 3. **Handoffs** — any workspace-context entries referencing this branch:
64
64
  ```bash
65
- grep -rl "branch: {branch}" shared-context/
65
+ grep -rl "branch: {branch}" workspace-context/
66
66
  ```
67
67
  Read each matching file.
68
68
 
@@ -349,7 +349,7 @@ If /complete-work is called but changes were made without a formal work session
349
349
  Ask: "These changes weren't part of a formal work session. What do you want to do?"
350
350
  - **Accept as work** — create a session retroactively, proceed with normal completion
351
351
  - **Stash for later** — create a user-scoped handoff describing what was done, stash the changes
352
- - **Hand off to someone** — create a team-visible handoff at root shared-context/ for another member to pick up
352
+ - **Hand off to someone** — create a team-visible handoff at root workspace-context/ for another member to pick up
353
353
  - **Revert** — undo the changes (with confirmation)
354
354
 
355
355
  ## Notes
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: handoff
3
- description: Save workstream state as shared context. Use anytime during work to capture progress, decisions, and next steps. Accepts optional name parameter.
3
+ description: Save workstream state as workspace-context. Use anytime during work to capture progress, decisions, and next steps. Accepts optional name parameter.
4
4
  ---
5
5
 
6
6
  # Handoff
7
7
 
8
- Save structured workstream state to shared context. Usable anytime, any number of times. User-scoped by default.
8
+ Save structured workstream state to workspace-context. Usable anytime, any number of times. Per-user (`team-member/{user}/`) is the default scope.
9
9
 
10
10
  ## Parameters
11
11
  - `/handoff {name}` — create or update a named handoff
@@ -28,34 +28,33 @@ When called within an active work session (the active-session pointer at `.claud
28
28
 
29
29
  When called from the workspace root (no active session):
30
30
  - Only `local-only-*` files are writable from the root
31
- - Suggest starting a work session first, or create a `local-only-{name}.md` file
31
+ - Suggest starting a work session first, or use the helper with `--local-only`
32
32
 
33
33
  The flows below apply when NOT in an active work session, or when the user explicitly asks for a standalone handoff file.
34
34
 
35
35
  ## Flow: Named
36
36
 
37
37
  1. Read workspace user identity from `.claude/settings.local.json` (`workspace.user`)
38
- 2. Check if handoff already exists in `shared-context/{user}/` or `shared-context/` root
39
- 3. If exists: read it, prepare to update with current session state
40
- 4. If new: prepare to create
41
- 5. Ask: "Should this be user-scoped (default), team-visible, or local-only?"
42
- - User-scoped (default): `shared-context/{user}/{name}.md`
43
- - Team-visible: `shared-context/{name}.md`
44
- - Local-only: `shared-context/local-only-{name}.md`
45
- 6. Write the handoff file:
46
-
47
- ```yaml
48
- ---
49
- state: ephemeral
50
- lifecycle: active
51
- type: handoff
52
- topic: {name}
53
- branch: {current-branch-if-any}
54
- repo: {current-repo-if-any}
55
- author: {user}
56
- updated: {YYYY-MM-DD}
57
- ---
38
+ 2. Ask: "Should this be user-scoped (default), team-visible, or local-only?"
39
+ - User-scoped (default): `--scope team-member --user {user}`
40
+ - Team-visible: `--scope shared`
41
+ - Local-only: add `--local-only` to either scope
42
+ 3. Use the centralized helper to compute the path, apply the `handoff_` prefix, and write the file with full frontmatter:
43
+
44
+ ```bash
45
+ echo "$BODY" | node .claude/scripts/capture-context.mjs \
46
+ --type handoff \
47
+ --topic {kebab-case-name} \
48
+ --scope team-member \
49
+ --user {workspace.user} \
50
+ --description "{one-line summary}"
51
+ ```
52
+
53
+ Pass `--update` to overwrite an existing handoff with the same name (otherwise the helper appends `-2`, `-3`, … to avoid clobbering). The helper prints the absolute path of the written file on stdout — use that path for the commit step.
58
54
 
55
+ The body content sent on stdin should follow this template:
56
+
57
+ ```markdown
59
58
  ## Status
60
59
  {What was accomplished in this session}
61
60
 
@@ -69,9 +68,11 @@ updated: {YYYY-MM-DD}
69
68
  {Unresolved questions, if any}
70
69
  ```
71
70
 
72
- 7. Auto-commit the handoff file alone:
71
+ The helper writes the frontmatter (`state: ephemeral`, `lifecycle: active`, `type: handoff`, `topic`, `author`, `updated`). If you need extra fields like `branch:` or `repo:`, append them to the frontmatter after the helper writes (or include them inline in the body).
72
+
73
+ 4. Auto-commit the handoff file alone:
73
74
  ```bash
74
- git add shared-context/{path-to-file}
75
+ git add {printed-path}
75
76
  git commit -m "handoff: {name}"
76
77
  ```
77
78
 
@@ -86,7 +87,7 @@ updated: {YYYY-MM-DD}
86
87
 
87
88
  ## Include task snapshot
88
89
 
89
- If an active session exists (detected via `.claude/.active-session.json`), include a `## Tasks at capture time` section in the handoff artifact with a snapshot of the current `TodoWrite` state:
90
+ If an active session exists (detected via `.claude/.active-session.json`), include a `## Tasks at capture time` section in the handoff body before piping it to `capture-context.mjs`:
90
91
 
91
92
  ```markdown
92
93
  ## Tasks at capture time
@@ -97,16 +98,16 @@ If an active session exists (detected via `.claude/.active-session.json`), inclu
97
98
  - [ ] Complete work
98
99
  ```
99
100
 
100
- Use the same GFM checkbox format as `session.md`'s `## Tasks` section (just `content` and `status` per task — no `activeForm` field, no blockquote line) and render it inline in the handoff. Do NOT call `sync-tasks.mjs --write` — handoffs are snapshots, not the canonical store.
101
+ Use the same GFM checkbox format as `session.md`'s `## Tasks` section (just `content` and `status` per task — no `activeForm` field, no blockquote line). Do NOT call `sync-tasks.mjs --write` — handoffs are snapshots, not the canonical store.
101
102
 
102
103
  ## Updating Existing Handoffs
103
104
 
104
- When updating an existing handoff, rewrite it as a fresh snapshot of current understanding (coherent-revisions rule). Don't append below the old content. The updated handoff should read as if written in one pass reflecting the current state.
105
+ When updating an existing handoff, rewrite it as a fresh snapshot of current understanding (coherent-revisions rule) and pass `--update` to `capture-context.mjs`. Don't append below the old content. The updated handoff should read as if written in one pass reflecting the current state.
105
106
 
106
- Update the `updated` date in frontmatter. Keep the `lifecycle` as-is unless the user indicates a change.
107
+ The helper updates the `updated` date in frontmatter automatically.
107
108
 
108
109
  ## Notes
109
- - User-scoped is the default — root is only for content deliberately made team-visible
110
+ - Per-user is the default — `--scope shared` is for content deliberately made team-visible
110
111
  - Handoffs are always committed individually — never bundled with code commits
111
112
  - One topic, one file — don't let handoffs become grab-bags
112
113
  - Name before writing — the name forces you to identify the single topic
@@ -17,13 +17,13 @@ Keep the workspace healthy. Combines integrity auditing with active cleanup reco
17
17
  Read-only integrity checks. Reports problems but never modifies files.
18
18
 
19
19
  ### 1. Cross-reference consistency
20
- Scan all shared-context files against each other:
20
+ Scan all workspace-context files against each other:
21
21
  - **Stale references** — file A mentions "2 mandatory rules" but there are now 4
22
22
  - **Path references** — file A mentions a file that was moved or deleted
23
23
  - **Contradictions** — file A says "user-scoped is default" but file B says "root is default"
24
24
 
25
25
  ### 2. Frontmatter integrity
26
- For each shared-context `.md` file and each `work-sessions/*/workspace/session.md`:
26
+ For each workspace-context `.md` file and each `work-sessions/*/workspace/session.md`:
27
27
  - Valid frontmatter? (state, lifecycle, type, topic, author, updated; plus name/status/branch/repos for session trackers)
28
28
  - `branch` field references a branch that still exists?
29
29
  - `repo`/`repos` field references repos that exist in workspace.json?
@@ -45,23 +45,23 @@ For each shared-context `.md` file and each `work-sessions/*/workspace/session.m
45
45
  - Workspace repo on expected branch?
46
46
  - Orphan worktree records in project repos — run `git -C repos/{repo} worktree list` for each repo and flag any `prunable` markers. These usually come from a workspace-first teardown (the unsafe order) leaving stale admin records behind. Suggest `git worktree prune` on the affected repo.
47
47
 
48
- ### 5. Shared-context index integrity
48
+ ### 5. Workspace-context auto-file integrity
49
49
 
50
- `shared-context/index.md` is auto-generated from frontmatter. Run the check:
50
+ `workspace-context/index.md`, `workspace-context/canonical.md`, and each `workspace-context/team-member/{user}/index.md` are auto-generated from frontmatter and locked content. Run the check:
51
51
 
52
52
  ```bash
53
- node .claude/scripts/build-shared-context-index.mjs --check --root .
53
+ node .claude/scripts/build-workspace-context.mjs --check --root .
54
54
  ```
55
55
 
56
- Three failure modes (script exits 1 with a JSON status):
56
+ The script exits 1 if any of the three artifact types is missing or stale, and reports per-file status as JSON:
57
57
 
58
- - `missing` — `shared-context/` exists but `index.md` does not. Run `--write` to create.
59
- - `stale` — `index.md` exists but its entries no longer match the filesystem. Causes: a file was added or deleted, a `description:` was changed, a `.indexignore` rule was added. Run `--write` to regenerate.
60
- - (no failure) — `current` with the entry count.
58
+ - `missing` — `workspace-context/` exists but the artifact does not. Run `--write` to create.
59
+ - `stale` — the artifact exists but no longer matches the filesystem. Causes: a file was added or deleted, a `description:` was changed, a `shared/locked/` file was edited, an `.indexignore` rule was added. Run `--write` to regenerate.
60
+ - `current` everything matches.
61
61
 
62
62
  Audit mode reports the status. Cleanup mode runs `--write` if stale or missing, then re-checks.
63
63
 
64
- While the index is being read, also flag entries with weak fallbacks: filename-slug-only descriptions (e.g., "project status" with no period) usually indicate the underlying file is missing a `description:` or has no usable opening sentence. Suggest adding `description:` to those source files — the index will pick it up on the next regeneration.
64
+ While the indexes are being read, also flag entries with weak fallbacks: filename-slug-only descriptions (e.g., "project status" with no period) usually indicate the underlying file is missing a `description:` or has no usable opening sentence. Suggest adding `description:` to those source files — the index will pick it up on the next regeneration.
65
65
 
66
66
  ### 6. Template freshness
67
67
 
@@ -96,13 +96,13 @@ Active recommendations. Flags problems and suggests fixes, but asks before actin
96
96
  - Handoffs referencing deleted branches — suggest resolve or remove
97
97
 
98
98
  ### 8. Context reconciliation
99
- - Read recent shared-context writes (last session or last N files by updated date)
100
- - For each, scan other shared-context files for references that are now stale
99
+ - Read recent workspace-context writes (last session or last N files by updated date)
100
+ - For each, scan other workspace-context files for references that are now stale
101
101
  - Surface: "{file} says X but {newer-file} now says Y. Update {file}?"
102
102
  - This is the capture-time cross-check, run retroactively instead of inline
103
103
 
104
104
  ### 9. Health metrics
105
- - Size of `shared-context/locked/` relative to the active model's context window — flag if over 5% (yellow) or 15% (red). Absolute byte count is a weak proxy; contradictions, stale references, and duplicated coverage across files matter more than total size.
105
+ - Size of `workspace-context/shared/locked/` relative to the active model's context window — flag if over 5% (yellow) or 15% (red). Absolute byte count is a weak proxy; contradictions, stale references, and duplicated coverage across files matter more than total size.
106
106
  - Number of ephemeral files — flag if accumulating without resolution
107
107
  - Session log stats (if `workspace-scratchpad/session-log.jsonl` exists):
108
108
  - Sessions without capture
@@ -115,13 +115,13 @@ Active recommendations. Flags problems and suggests fixes, but asks before actin
115
115
  /maintenance results:
116
116
 
117
117
  Issues (3):
118
- shared-context/alice/old-handoff.md references branch feature/old
118
+ workspace-context/team-member/alice/old-handoff.md references branch feature/old
119
119
  but that branch was deleted
120
120
  ✗ 2 inflight files exist but no active work session (orphaned?)
121
121
  ✗ Locked context is 18% of model context window (red threshold: 15%)
122
122
 
123
123
  Warnings (2):
124
- shared-context/alice/workspace-analytics.md not updated in 8 days
124
+ workspace-context/team-member/alice/workspace-analytics.md not updated in 8 days
125
125
  ⚠ Worktree work-sessions/old-feature/workspace has no commits in 5 days
126
126
 
127
127
  Cleanup suggestions (2):
@@ -140,14 +140,14 @@ OK (5):
140
140
 
141
141
  ## Flow
142
142
 
143
- 1. Scan shared-context/ recursively — read all `.md` files and their frontmatter
143
+ 1. Scan workspace-context/ recursively — read all `.md` files and their frontmatter
144
144
  2. Read CLAUDE.md — extract skill and rule references
145
145
  3. Read workspace.json — extract repo manifest
146
146
  4. Check `.claude/rules/`, `.claude/skills/`, `.claude/agents/` against references
147
147
  5. Check git state (worktrees, branches, remotes)
148
- 6. Run `node .claude/scripts/build-shared-context-index.mjs --check --root .` — capture status
148
+ 6. Run `node .claude/scripts/build-workspace-context.mjs --check --root .` — capture status
149
149
  7. Read session-log.jsonl if it exists
150
- 8. If cleanup mode: regenerate the shared-context index if stale; compare files pairwise for overlap; scan for stale cross-references
150
+ 8. If cleanup mode: regenerate the workspace-context auto-files if stale (index.md, canonical.md, per-user team-member indexes); compare files pairwise for overlap; scan for stale cross-references
151
151
  9. Compile and present findings grouped by severity
152
152
 
153
153
  ## Notes
@@ -113,7 +113,7 @@ If PRs already exist, update them to draft status if needed.
113
113
  No worktree cleanup — the session is meant to be resumed. The `work-sessions/{session-name}/` folder stays intact.
114
114
 
115
115
  ## Notes
116
- - Pause writes ONLY to `work-sessions/{session-name}/workspace/session.md` — never to ongoing or root shared-context
116
+ - Pause writes ONLY to `work-sessions/{session-name}/workspace/session.md` — never to ongoing or root workspace-context
117
117
  - The session tracker's frontmatter stays in the session folder — it's the resume mechanism
118
118
  - Draft PRs signal work-in-progress without implying merge readiness
119
119
  - Auto-committing the pause capture is a workflow artifact — this intentionally bypasses normal commit conventions
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  name: promote
3
- description: Move personal auto-memory or local-only files into shared context. Use when you've discovered something valuable that the team should know.
3
+ description: Move personal auto-memory or local-only files into workspace-context. Use when you've discovered something valuable that the team should know.
4
4
  ---
5
5
 
6
6
  # Promote
7
7
 
8
- Promote personal knowledge into shared context. Assess all candidates, recommend actions, let the user decide with coded references.
8
+ Promote personal knowledge into workspace-context. Assess all candidates, recommend actions, let the user decide with coded references.
9
9
 
10
10
  ## Sources
11
11
 
12
12
  This skill can promote from three sources:
13
13
  1. **Auto-memory (AM)** — files in `~/.claude/projects/*/memory/`
14
- 2. **Local-only context (LOC)** — `shared-context/local-only-*.md`
14
+ 2. **Local-only context (LOC)** — `workspace-context/team-member/{user}/local-only-*.md` (and any other `local-only-*.md` under `workspace-context/`)
15
15
  3. **Local-only rules (LOR)** — `.claude/rules/local-only-*.md`
16
16
 
17
17
  ## Flow
@@ -47,9 +47,19 @@ The user responds using codes:
47
47
  **Step 3: Execute decisions**
48
48
 
49
49
  For each **promote** action:
50
- - Ask: "Team-visible, user-scoped (default), or locked?"
51
- - Copy to destination, set `type: promoted` in frontmatter
52
- - Remove the local-only original
50
+ - Ask: "Team-visible (`workspace-context/shared/`), user-scoped (default, `workspace-context/team-member/{user}/`), or locked (`workspace-context/shared/locked/`)?"
51
+ - Use `capture-context.mjs --update` to write to the destination with the right frontmatter:
52
+ ```bash
53
+ cat {source-file} | node .claude/scripts/capture-context.mjs \
54
+ --type {braindump|handoff|research} \
55
+ --topic {kebab-name} \
56
+ --scope {team-member|shared} \
57
+ [--user {workspace.user}] \
58
+ --update
59
+ ```
60
+ When promoting *to locked*, write directly to `workspace-context/shared/locked/{bare-name}.md` instead — locked files use bare names (location signals the type) and don't take a prefix. Strip the `braindump_/handoff_/research_` prefix when locking.
61
+ - Set `type: promoted` in the destination frontmatter (the helper writes the standard fields; edit `type` afterward, or have the body's frontmatter override).
62
+ - Remove the `local-only-` original.
53
63
  - Commit individually: `git commit -m "promote: {name}"`
54
64
 
55
65
  For each **drop** action:
@@ -65,13 +75,13 @@ For each **keep** action:
65
75
 
66
76
  ## Rewrite on Promote
67
77
 
68
- Auto-memory files are terse notes written for Claude's internal use. When promoting to shared context, rewrite into proper format with:
78
+ Auto-memory files are terse notes written for Claude's internal use. When promoting to workspace-context, rewrite into proper format with:
69
79
  - Frontmatter (state, lifecycle, type: promoted, topic, author, updated)
70
80
  - Sections with enough context to be useful to someone who wasn't in the original session
71
81
  - Local-only files may already be well-formatted — copy as-is if so, just update frontmatter
72
82
 
73
83
  ## Notes
74
- - Promotion is one-way: shared context should not be demoted back to local-only
84
+ - Promotion is one-way: workspace-context should not be demoted back to local-only
75
85
  - Use this when you discover a pattern, convention, or decision that would benefit the team
76
86
  - The coded table makes bulk decisions fast — no need to type full filenames
77
87
  - Assess everything upfront so the user sees the full picture before deciding
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: release
3
- description: Prepend a new CHANGELOG.md entry per project repo by synthesizing unreleased branch notes. Deletes consumed branch notes and synthesizes workspace shared-context into locked entries. Use at release time.
3
+ description: Prepend a new CHANGELOG.md entry per project repo by synthesizing unreleased branch notes. Deletes consumed branch notes and synthesizes workspace-context into canonical (locked) entries. Use at release time.
4
4
  ---
5
5
 
6
6
  # Release
7
7
 
8
- Synthesize unreleased branch notes (in the **workspace** repo) into a concise, user-facing entry at the top of each project repo's `CHANGELOG.md`. Delete the consumed branch notes from the workspace. Bump the project repo's `package.json` version. In parallel, promote resolved workspace shared-context into locked team knowledge.
8
+ Synthesize unreleased branch notes (in the **workspace** repo) into a concise, user-facing entry at the top of each project repo's `CHANGELOG.md`. Delete the consumed branch notes from the workspace. Bump the project repo's `package.json` version. In parallel, promote resolved workspace-context into canonical (locked) team knowledge.
9
9
 
10
10
  ## Why this shape
11
11
 
@@ -104,28 +104,32 @@ git commit -m "release: consume {repo} branch notes for v{version}"
104
104
  Workspace and project repos have separate commits — they are separate git histories.
105
105
 
106
106
  **Step 8: Consume project-scoped specs**
107
- Project-scoped specs and plans in `shared-context/{user}/` (ongoing) that are fully covered by this release:
107
+ Project-scoped specs and plans in `workspace-context/team-member/{user}/` (ongoing) that are fully covered by this release:
108
108
  - Consume into the CHANGELOG entry (their content is now captured there)
109
109
  - Remove the source files
110
110
  - If partially covered: rewrite the spec to reflect only what remains unimplemented
111
111
 
112
- **Step 9: Synthesize workspace shared context**
113
- Process ephemeral shared-context entries:
112
+ **Step 9: Synthesize workspace-context for canonical promotion**
113
+ Process ephemeral workspace-context entries:
114
114
 
115
- 1. List all ephemeral entries with `lifecycle: resolved`
115
+ 1. List all ephemeral entries with `lifecycle: resolved` (across `shared/` and any `team-member/{user}/`).
116
116
  2. For each, determine:
117
117
  - Does an existing locked entry cover this topic? → Merge into it (enrich)
118
118
  - Are there related resolved entries? → Combine into a new locked entry
119
119
  - Is it stale/fully consumed by release notes? → Archive or delete
120
- - Is it unresolvable but still valuable? → Move to `{user}/` ongoing or keep as root ephemeral
120
+ - Is it unresolvable but still valuable? → Move to `team-member/{user}/` ongoing or keep at `shared/` root ephemeral
121
121
  3. For merged/new locked entries:
122
- - Set `state: locked`, `type: synthesized`
123
- - Move to `shared-context/locked/`
122
+ - Set `state: locked`, `type: synthesized` (or `type: reference` for clean truths)
123
+ - Write to `workspace-context/shared/locked/{bare-name}.md` — locked files use bare names (location signals the type), so strip any `braindump_/handoff_/research_` prefix when promoting
124
124
  - Write concise, focused content — team truths, not session history
125
- 4. Commit:
125
+ 4. Regenerate auto-files so `canonical.md` and `index.md` reflect the new locked content:
126
126
  ```bash
127
- git add shared-context/
128
- git commit -m "release: synthesize shared context for v{version}"
127
+ node .claude/scripts/build-workspace-context.mjs --write --root .
128
+ ```
129
+ 5. Commit:
130
+ ```bash
131
+ git add workspace-context/
132
+ git commit -m "release: synthesize workspace-context for v{version}"
129
133
  ```
130
134
 
131
135
  **Step 10: Report**
@@ -137,6 +141,6 @@ Process ephemeral shared-context entries:
137
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.
138
142
  - Versions are bumped here, not in `/complete-work`. This keeps the version semantics aligned with what actually shipped (accumulated changes since last release).
139
143
  - 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.
140
- - Context synthesis happens in the WORKSPACE repo — Step 7c (consumed-notes) and Step 9 (shared-context synthesis) are separate workspace commits.
144
+ - Context synthesis happens in the WORKSPACE repo — Step 7c (consumed-notes) and Step 9 (workspace-context synthesis) are separate workspace commits.
141
145
  - Per-repo is the default — each project repo has its own release cadence.
142
146
  - The coherent-revisions rule applies: write the CHANGELOG entry from scratch, don't concatenate branch notes.