@ulysses-ai/create-workspace 0.18.0-beta.0 → 0.19.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 (103) hide show
  1. package/lib/init.mjs +4 -1
  2. package/lib/payload.mjs +18 -1
  3. package/lib/payload.test.mjs +55 -0
  4. package/lib/scaffold.mjs +23 -6
  5. package/lib/scaffold.test.mjs +59 -0
  6. package/package.json +1 -1
  7. package/template/{.claude → _claude}/rules/forge-operations.md +6 -0
  8. package/template/{.claude → _claude}/rules/memory-guidance.md +4 -0
  9. package/template/{.claude → _claude}/rules/task-list-mirroring.md +6 -0
  10. package/template/{.claude → _claude}/scripts/build-workspace-context.mjs +25 -14
  11. package/template/{.claude → _claude}/scripts/chat-record.mjs +37 -4
  12. package/template/{.claude → _claude}/scripts/context-footprint.mjs +139 -30
  13. package/template/{.claude → _claude}/scripts/forges/github.mjs +2 -1
  14. package/template/{.claude → _claude}/scripts/forges/interface.mjs +5 -4
  15. package/template/_claude/scripts/task-pr.mjs +447 -0
  16. package/template/{.claude → _claude}/scripts/trackers/github-issues.mjs +11 -0
  17. package/template/{.claude → _claude}/scripts/trackers/interface.mjs +8 -0
  18. package/template/{.claude → _claude}/skills/braindump/SKILL.md +1 -0
  19. package/template/{.claude → _claude}/skills/complete-work/SKILL.md +13 -69
  20. package/template/{.claude → _claude}/skills/context-placement/SKILL.md +8 -5
  21. package/template/{.claude → _claude}/skills/goal-driven-work/SKILL.md +1 -1
  22. package/template/{.claude → _claude}/skills/handoff/SKILL.md +1 -0
  23. package/template/{.claude → _claude}/skills/maintenance/SKILL.md +49 -17
  24. package/template/{.claude → _claude}/skills/release/SKILL.md +6 -2
  25. package/template/{.claude → _claude}/skills/start-work/SKILL.md +2 -2
  26. package/template/workspace.json.tmpl +1 -1
  27. /package/template/{.claude → _claude}/agents/aside-researcher.md +0 -0
  28. /package/template/{.claude → _claude}/agents/implementer.md +0 -0
  29. /package/template/{.claude → _claude}/agents/researcher.md +0 -0
  30. /package/template/{.claude → _claude}/agents/reviewer.md +0 -0
  31. /package/template/{.claude → _claude}/hooks/_utils.mjs +0 -0
  32. /package/template/{.claude → _claude}/hooks/bash-output-advisory.mjs +0 -0
  33. /package/template/{.claude → _claude}/hooks/post-compact.mjs +0 -0
  34. /package/template/{.claude → _claude}/hooks/pre-compact.mjs +0 -0
  35. /package/template/{.claude → _claude}/hooks/repo-write-detection.mjs +0 -0
  36. /package/template/{.claude → _claude}/hooks/session-end.mjs +0 -0
  37. /package/template/{.claude → _claude}/hooks/session-start.mjs +0 -0
  38. /package/template/{.claude → _claude}/hooks/subagent-start.mjs +0 -0
  39. /package/template/{.claude → _claude}/hooks/version-freshness-check.mjs +0 -0
  40. /package/template/{.claude → _claude}/hooks/workspace-update-check.mjs +0 -0
  41. /package/template/{.claude → _claude}/lib/freshness.mjs +0 -0
  42. /package/template/{.claude → _claude}/lib/registry-check.mjs +0 -0
  43. /package/template/{.claude → _claude}/lib/require-node.mjs +0 -0
  44. /package/template/{.claude → _claude}/lib/session-frontmatter.mjs +0 -0
  45. /package/template/{.claude → _claude}/recipes/migrate-from-notion.md +0 -0
  46. /package/template/{.claude → _claude}/rules/agent-rules.md.skip +0 -0
  47. /package/template/{.claude → _claude}/rules/cloud-infrastructure.md.skip +0 -0
  48. /package/template/{.claude → _claude}/rules/coherent-revisions.md +0 -0
  49. /package/template/{.claude → _claude}/rules/config-review.md.skip +0 -0
  50. /package/template/{.claude → _claude}/rules/documentation.md.skip +0 -0
  51. /package/template/{.claude → _claude}/rules/git-conventions.md +0 -0
  52. /package/template/{.claude → _claude}/rules/goal-driven-work.md +0 -0
  53. /package/template/{.claude → _claude}/rules/honest-pushback.md +0 -0
  54. /package/template/{.claude → _claude}/rules/local-dev-environment.md.skip +0 -0
  55. /package/template/{.claude → _claude}/rules/product-integrity.md.skip +0 -0
  56. /package/template/{.claude → _claude}/rules/scope-guard.md.skip +0 -0
  57. /package/template/{.claude → _claude}/rules/superpowers-workflow.md.skip +0 -0
  58. /package/template/{.claude → _claude}/rules/token-economics.md.skip +0 -0
  59. /package/template/{.claude → _claude}/rules/work-item-tracking.md +0 -0
  60. /package/template/{.claude → _claude}/rules/workspace-structure.md +0 -0
  61. /package/template/{.claude → _claude}/scripts/add-repo-to-session.mjs +0 -0
  62. /package/template/{.claude → _claude}/scripts/capture-context.mjs +0 -0
  63. /package/template/{.claude → _claude}/scripts/cleanup-work-session.mjs +0 -0
  64. /package/template/{.claude → _claude}/scripts/create-work-session.mjs +0 -0
  65. /package/template/{.claude → _claude}/scripts/forges/gitlab.mjs +0 -0
  66. /package/template/{.claude → _claude}/scripts/generate-claude-local.mjs +0 -0
  67. /package/template/{.claude → _claude}/scripts/migrate-canonical-priority.mjs +0 -0
  68. /package/template/{.claude → _claude}/scripts/migrate-claude-md-freshness-include.mjs +0 -0
  69. /package/template/{.claude → _claude}/scripts/migrate-open-work.mjs +0 -0
  70. /package/template/{.claude → _claude}/scripts/migrate-session-layout.mjs +0 -0
  71. /package/template/{.claude → _claude}/scripts/migrate-sessions.mjs +0 -0
  72. /package/template/{.claude → _claude}/scripts/migrate-to-workspace-context.mjs +0 -0
  73. /package/template/{.claude → _claude}/scripts/sweep-references.mjs +0 -0
  74. /package/template/{.claude → _claude}/scripts/sync-tasks.mjs +0 -0
  75. /package/template/{.claude → _claude}/scripts/task-worktree.mjs +0 -0
  76. /package/template/{.claude → _claude}/scripts/workspace-diagnostics.mjs +0 -0
  77. /package/template/{.claude → _claude}/settings.json +0 -0
  78. /package/template/{.claude → _claude}/skills/aside/SKILL.md +0 -0
  79. /package/template/{.claude → _claude}/skills/build-docs-site/SKILL.md +0 -0
  80. /package/template/{.claude → _claude}/skills/build-docs-site/checklists/framing.md +0 -0
  81. /package/template/{.claude → _claude}/skills/build-docs-site/checklists/pitfalls.md +0 -0
  82. /package/template/{.claude → _claude}/skills/build-docs-site/checklists/review.md +0 -0
  83. /package/template/{.claude → _claude}/skills/build-docs-site/scripts/bulk-fill-migration.py +0 -0
  84. /package/template/{.claude → _claude}/skills/build-docs-site/scripts/forbidden-word-grep.mjs +0 -0
  85. /package/template/{.claude → _claude}/skills/build-docs-site/scripts/leak-grep.mjs +0 -0
  86. /package/template/{.claude → _claude}/skills/build-docs-site/templates/custom.css.tmpl +0 -0
  87. /package/template/{.claude → _claude}/skills/build-docs-site/templates/docusaurus.config.ts.tmpl +0 -0
  88. /package/template/{.claude → _claude}/skills/build-docs-site/templates/primitives/Arrow.tsx +0 -0
  89. /package/template/{.claude → _claude}/skills/build-docs-site/templates/primitives/Box.tsx +0 -0
  90. /package/template/{.claude → _claude}/skills/build-docs-site/templates/primitives/DiagramContainer.tsx +0 -0
  91. /package/template/{.claude → _claude}/skills/build-docs-site/templates/primitives/Region.tsx +0 -0
  92. /package/template/{.claude → _claude}/skills/build-docs-site/templates/primitives/SectionTitle.tsx +0 -0
  93. /package/template/{.claude → _claude}/skills/build-docs-site/templates/primitives/tokens.ts +0 -0
  94. /package/template/{.claude → _claude}/skills/build-docs-site/templates/sidebars.ts.tmpl +0 -0
  95. /package/template/{.claude → _claude}/skills/build-docs-site/templates/spec.md.tmpl +0 -0
  96. /package/template/{.claude → _claude}/skills/migrate-sessions/SKILL.md +0 -0
  97. /package/template/{.claude → _claude}/skills/pause-work/SKILL.md +0 -0
  98. /package/template/{.claude → _claude}/skills/promote/SKILL.md +0 -0
  99. /package/template/{.claude → _claude}/skills/setup-tracker/SKILL.md +0 -0
  100. /package/template/{.claude → _claude}/skills/sync-work/SKILL.md +0 -0
  101. /package/template/{.claude → _claude}/skills/workspace-init/SKILL.md +0 -0
  102. /package/template/{.claude → _claude}/skills/workspace-update/SKILL.md +0 -0
  103. /package/template/{.mcp.json → _mcp.json} +0 -0
@@ -70,7 +70,7 @@ does not need to be in context while you are editing documentation.
70
70
  ---
71
71
  paths:
72
72
  - ".claude/scripts/**/*.mjs"
73
- - "repos/*/template/.claude/scripts/**/*.mjs"
73
+ - "repos/*/template/_claude/scripts/**/*.mjs"
74
74
  ---
75
75
  ```
76
76
 
@@ -189,11 +189,14 @@ Gitignored files (anything matching `local-only-*`) are excluded automatically,
189
189
  `workspace-context/.indexignore` adds path-prefix excludes for tracked files that should
190
190
  not appear in the shared index.
191
191
 
192
- When `canonical.md` exceeds `workspace.canonicalBudgetBytes` (default 40960), the builder
193
- honours per-file `priority` and section-level `<!-- canonical:trim --> ... <!-- canonical:end-trim -->`
192
+ The canonical byte budget is opt-in: `workspace.canonicalBudgetBytes` is off by default
193
+ (absent or `null`), and the whole always-loaded set is measured by
194
+ `workspace.alwaysLoadedBudgetBytes` instead. When a byte count is set and `canonical.md`
195
+ exceeds it, the builder honours per-file `priority` and section-level
196
+ `<!-- canonical:trim --> ... <!-- canonical:end-trim -->`
194
197
  markers to fit: `priority: reference` files are trimmed, then stubbed; `priority: critical`
195
- files are always included in full. `/maintenance` audits the budget and offers triage when
196
- over.
198
+ files are always included in full. `/maintenance` audits the budget when on and offers
199
+ triage when over.
197
200
 
198
201
  Hand edits to `index.md`, `canonical.md`, or any per-user index are overwritten. Change the
199
202
  source file or its `description:` instead.
@@ -17,7 +17,7 @@ the work at hand. This skill covers everything after that decision.
17
17
  - One `goal-{topic}.md` artifact per effort. Session model: at the top of the session worktree, alongside `session.md`. Task model: in the chat drawer at `workspace-scratchpad/chats/{chat}/`, alongside its phase outputs. One goal per worktree or task either way.
18
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
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
- - Session model: the artifact is tracked on the session branch and lives there until `/complete-work` runs, which strips it before the final PR. Task model: the drawer is machine-local and untracked; `/complete-work` routes the artifact (promote into `workspace-context/` or discard) at completion.
20
+ - Session model: the artifact is tracked on the session branch and lives there until `/complete-work` runs, which strips it before the final PR. Task model: the drawer is machine-local and untracked; `/complete-work` routes the artifact (promote into `workspace-context/` or discard) at completion, so while a task is active give the artifact's frontmatter a `workItem: {id}` line — the offer is scoped to the task that owns the artifact.
21
21
 
22
22
  ## Frontmatter schema
23
23
 
@@ -30,6 +30,7 @@ Under the task model — `workspace.sessionModel` is `"task"` in `workspace.json
30
30
 
31
31
  - Default behavior: write `handoff_{topic}.md` directly into that chat's drawer at `workspace-scratchpad/chats/{chat}/` — the drawer sits outside `workspace-context/`, so `capture-context.mjs` is not involved
32
32
  - No commit for drawer writes: the drawer is gitignored and machine-local; `/complete-work` lists it and asks what to promote into `workspace-context/`
33
+ - While a task is active, add `workItem: {id}` to the file's frontmatter: `/complete-work` offers a drawer item only to the task that owns it, so the tag keeps this capture out of another task's promotion list
33
34
 
34
35
  When called from the workspace root with no active session — every other case, including a `sessionModel: "session"` workspace (the `Chat record:` line is injected in every chat, so it alone does not select the drawer):
35
36
 
@@ -59,9 +59,9 @@ node .claude/scripts/build-workspace-context.mjs --check --root .
59
59
 
60
60
  The script reports per-artifact status as JSON and uses three exit codes to distinguish what's wrong:
61
61
 
62
- - `0` — all artifacts current and the rendered canonical fits inside `workspace.canonicalBudgetBytes`.
62
+ - `0` — all artifacts current and, when a canonical budget is set, the rendered canonical fits inside `workspace.canonicalBudgetBytes`.
63
63
  - `1` — at least one artifact is `missing` or `stale`. Run `--write` to regenerate. `missing` means the artifact does not exist yet; `stale` means it exists but no longer matches its sources (a file was added or deleted, a `description:` changed, a `shared/locked/` file was edited, an `.indexignore` rule was added).
64
- - `2` — artifacts are current but canonical body bytes exceed the budget after the trim and stub stages have already run. Regeneration cannot fix this; the locked content itself needs triage. Stale wins over over-budget when both apply, so a `1` can hide an over-budget condition until you regen.
64
+ - `2` — artifacts are current but canonical body bytes exceed the budget after the trim and stub stages have already run. Only reachable when a budget is set. Regeneration cannot fix this; the locked content itself needs triage. Stale wins over over-budget when both apply, so a `1` can hide an over-budget condition until you regen.
65
65
 
66
66
  The JSON payload always includes a `canonical` block summarizing the budget outcome:
67
67
 
@@ -83,11 +83,40 @@ The JSON payload always includes a `canonical` block summarizing the budget outc
83
83
 
84
84
  `selectionStatus` walks `ok` → `trimmed` → `stubbed` → `over-budget` as the script gives up progressively more reference content trying to fit the budget. `trimmedFiles` lists reference files whose `<!-- canonical:trim --> ... <!-- canonical:end-trim -->` spans were dropped; `stubbedFiles` lists reference files whose entire body was replaced with a one-line breadcrumb. `overBy` is present only when `selectionStatus === 'over-budget'` and reports the bytes still over after stubbing.
85
85
 
86
- Audit mode reports the status verbatim. When `selectionStatus` is `over-budget`, audit emits the budget violation and recommends `/maintenance cleanup` to triage — regeneration will not resolve it. Cleanup mode runs `--write` when `missing` or `stale`, re-checks, and then enters the budget triage flow described in cleanup step 9 if the post-regen check still reports `over-budget`.
86
+ The canonical budget is opt-in. `workspace.canonicalBudgetBytes` is off unless workspace.json sets it — absent or `null` means no budget. When off, `canonical.md` ships every locked file in full, the `canonical` block reports `"budget": null` with `selectionStatus: "ok"`, exit `2` cannot occur, and the audit reports one informational line in place of the budget OK/warning line:
87
+
88
+ ```
89
+ • Canonical budget: off (alwaysLoadedBudgetBytes covers the total)
90
+ ```
91
+
92
+ No warning accompanies it. To turn the budget back on, set a byte count in workspace.json (e.g. `"canonicalBudgetBytes": 40960`) and regenerate.
93
+
94
+ Audit mode reports the status verbatim. When a budget is set and `selectionStatus` is `over-budget`, audit emits the budget violation and recommends `/maintenance cleanup` to triage — regeneration will not resolve it. Cleanup mode runs `--write` when `missing` or `stale`, re-checks, and then enters the budget triage flow described in cleanup step 11 if the post-regen check still reports `over-budget`.
87
95
 
88
96
  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.
89
97
 
90
- ### 6. Template freshness
98
+ ### 6. Always-loaded context budget
99
+
100
+ Everything Claude reads at launch — CLAUDE.md, its @-imports, and the active rules — is measured against `workspace.alwaysLoadedBudgetBytes`:
101
+
102
+ ```bash
103
+ node .claude/scripts/context-footprint.mjs --root .
104
+ ```
105
+
106
+ Rules carrying `paths:` frontmatter are conditional (they load only when a matching file is touched); the script lists them in a separate conditional section and excludes them from the total. With no `alwaysLoadedBudgetBytes` in workspace.json there is no budget and this check passes trivially.
107
+
108
+ Within budget → an OK line: `✓ Always-loaded context: 43 KB / 64 KB`. Over budget → a Warning (the workspace still functions; this is drift, not breakage) naming the top contributors and the fixes:
109
+
110
+ ```
111
+ ⚠ Always-loaded context exceeds budget: 78 KB / 64 KB. Top contributors:
112
+ .claude/rules/git-conventions.md (12 KB), CLAUDE.md (9 KB),
113
+ .claude/rules/workspace-structure.md (8 KB). Scope situational rules with
114
+ paths: frontmatter, or move reference content to shared/.
115
+ ```
116
+
117
+ The script itself exits `1` when over budget; `/maintenance` reports that as the warning above, not as a failed run.
118
+
119
+ ### 7. Template freshness
91
120
 
92
121
  Compare the workspace's pinned template version against the latest published on npm.
93
122
 
@@ -112,7 +141,7 @@ Report one of:
112
141
 
113
142
  Active recommendations. Flags problems and suggests fixes, but asks before acting.
114
143
 
115
- ### 7. Component age check
144
+ ### 8. Component age check
116
145
 
117
146
  Scan the following file sets for a YAML frontmatter `updated:` field:
118
147
  - `.claude/rules/*.md` (active rules only — `.md.skip` files are included too, since the rule content can still drift)
@@ -126,7 +155,7 @@ Files without an `updated:` field are skipped — the check is opt-in and activa
126
155
 
127
156
  When stale candidates are found, surface them as warnings in the output format and link to `config-review.md.skip` (in `.claude/rules/`) as the opt-in rule that documents the review cadence and rationale.
128
157
 
129
- ### 8. Stale context
158
+ ### 9. Stale context
130
159
  - Ephemeral files not updated in 7+ days — suggest resolve, update, or archive
131
160
  - `work-sessions/{name}/` folders whose worktrees are gone — suggest cleanup
132
161
  - Session trackers whose branches have been merged — suggest `/complete-work` post-flight cleanup
@@ -136,15 +165,15 @@ When stale candidates are found, surface them as warnings in the output format a
136
165
  - Braindumps that overlap significantly — suggest merging (e.g., "workspace-branching.md and persistent-work-sessions.md cover the same topic")
137
166
  - Handoffs referencing deleted branches — suggest resolve or remove
138
167
 
139
- ### 9. Context reconciliation
168
+ ### 10. Context reconciliation
140
169
  - Read recent workspace-context writes (last session or last N files by updated date)
141
170
  - For each, scan other workspace-context files for references that are now stale
142
171
  - Surface: "{file} says X but {newer-file} now says Y. Update {file}?"
143
172
  - This is the capture-time cross-check, run retroactively instead of inline
144
173
 
145
- ### 10. Canonical budget triage
174
+ ### 11. Canonical budget triage
146
175
 
147
- This step runs only when the post-regen `--check` from step 9 still reports `selectionStatus: 'over-budget'`. If the regular regen pass cleared the budget — or if `--check` was already `ok`, `trimmed`, or `stubbed` after step 9 — skip this step entirely.
176
+ This step runs only when a canonical budget is set (`workspace.canonicalBudgetBytes` holds a number) and the post-regen `--check` from the cleanup regen pass (Flow step 9) still reports `selectionStatus: 'over-budget'`. With the budget off — absent or `null` in workspace.json — `--check` can never report over-budget, so this step is unreachable. Skip it too if the regular regen pass cleared the budget, or if `--check` was already `ok`, `trimmed`, or `stubbed` after that pass.
148
177
 
149
178
  The rest of cleanup is suggestion-list-with-confirmation: surface a candidate, ask before applying, move on. Triage is the one meaningfully more interactive surface in `/maintenance`. It runs as a small REPL: present the budget state and a triage menu, take one action, re-run `--check`, present the menu again with the new state. No suggestion is auto-applied; every action is the user's choice.
150
179
 
@@ -189,7 +218,7 @@ For each chosen action:
189
218
 
190
219
  Trim markers and demotions only matter for `priority: reference` files — `<!-- canonical:trim -->` spans on a `priority: critical` file are inert until the file is demoted. The triage flow never auto-decides which file to demote or which section to wrap; it surfaces the data, presents options, and waits.
191
220
 
192
- ### 11. Forge configuration
221
+ ### 12. Forge configuration
193
222
 
194
223
  Read `workspace.json`. If `workspace.tracker?.type === 'github-issues'` and `workspace.forge` is unset, emit a notice (not an error):
195
224
 
@@ -201,8 +230,9 @@ Read `workspace.json`. If `workspace.tracker?.type === 'github-issues'` and `wor
201
230
 
202
231
  This is migration guidance for workspaces created before the `forge` field landed — the field is back-compat with a sensible default, so the unset case is not a bug, just an opportunity to make the implicit explicit. If `workspace.forge.type` is set to a value with no adapter at `.claude/scripts/forges/{type}.mjs`, that IS an error and goes in the Issues section.
203
232
 
204
- ### 12. Health metrics
205
- - Canonical budget — read from the same `--check` invocation as step 5. Reported as `current / budget` bytes with the selection status (e.g., `full`, `2 reference files trimmed`). Over-budget cases are deferred to the cleanup triage flow rather than re-reported here.
233
+ ### 13. Health metrics
234
+ - Canonical budget — read from the same `--check` invocation as step 5. When a budget is set, reported as `current / budget` bytes with the selection status (e.g., `full`, `2 reference files trimmed`); over-budget cases are deferred to the cleanup triage flow rather than re-reported here. When off, report the step 5 one-liner: `• Canonical budget: off (alwaysLoadedBudgetBytes covers the total)`.
235
+ - Always-loaded context — read from the same `context-footprint.mjs` invocation as audit step 6, reported the same way (`current / budget` bytes); over-budget is already surfaced as a warning there.
206
236
  - Number of ephemeral files — flag if accumulating without resolution
207
237
  - Session log stats (if `workspace-scratchpad/session-log.jsonl` exists):
208
238
  - Sessions without capture
@@ -231,11 +261,12 @@ Cleanup suggestions (2):
231
261
  ⊕ migration-recipes.md still says "/sync handles dogfood" but
232
262
  /sync was replaced by /sync-work — update?
233
263
 
234
- OK (5):
264
+ OK (6):
235
265
  ✓ All CLAUDE.md skill references valid
236
266
  ✓ Workspace structure matches rule
237
267
  ✓ workspace.json repos all present
238
268
  ✓ Canonical: 17 KB / 40 KB (full)
269
+ ✓ Always-loaded context: 43 KB / 64 KB
239
270
  ✓ Template is up to date (v0.14.0)
240
271
  ```
241
272
 
@@ -246,10 +277,11 @@ OK (5):
246
277
  3. Read workspace.json — extract repo manifest
247
278
  4. Check `.claude/rules/`, `.claude/skills/`, `.claude/agents/` against references
248
279
  5. Check git state (worktrees, branches, remotes)
249
- 6. Run `node .claude/scripts/build-workspace-context.mjs --check --root .` — capture status. Exit `0` = clean and within budget, `1` = artifact missing or stale, `2` = artifacts current but canonical body over budget. The `canonical` block in the JSON output drives both the audit budget line and the cleanup triage decision.
250
- 7. Read session-log.jsonl if it exists
251
- 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. If post-regen `--check` reports `over-budget`, enter the canonical-budget triage flow described in cleanup step 10.
252
- 9. Compile and present findings grouped by severity
280
+ 6. Run `node .claude/scripts/build-workspace-context.mjs --check --root .` — capture status. Exit `0` = clean (and within budget when one is set), `1` = artifact missing or stale, `2` = artifacts current but canonical body over budget — only possible with a budget set. The `canonical` block in the JSON output drives both the audit budget line and the cleanup triage decision; `"budget": null` means the canonical budget is off.
281
+ 7. Run `node .claude/scripts/context-footprint.mjs --root .` — capture the total and the `BUDGET` line. Exit `0` = within budget or no budget set; exit `1` = over budget, reported as a warning with the top contributors (audit step 6).
282
+ 8. Read session-log.jsonl if it exists
283
+ 9. 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. If post-regen `--check` reports `over-budget`, enter the canonical-budget triage flow described in cleanup step 11.
284
+ 10. Compile and present findings grouped by severity
253
285
 
254
286
  ## Notes
255
287
  - Audit mode is always read-only — never modifies files
@@ -52,7 +52,7 @@ Push the branch and open a PR through the forge adapter — per-repo `createForg
52
52
 
53
53
  **Step 5: Tag and publish**
54
54
 
55
- Pull the merge, tag it, push the tag, and publish the forge release:
55
+ Pull the merge, tag it, and push the tag:
56
56
 
57
57
  ```bash
58
58
  git -C repos/{repo} pull --ff-only
@@ -60,11 +60,15 @@ git -C repos/{repo} tag v{version}
60
60
  git -C repos/{repo} push origin v{version}
61
61
  ```
62
62
 
63
+ Who creates the release depends on the repo. If `.github/workflows/publish.yml` exists and itself creates the release (it contains `gh release create`, `softprops/action-gh-release`, or `actions/create-release`), the workflow owns the release — do not call `releaseCreate`; racing it duplicates the release or fails. Instead find and watch its run with `workflowRunFind` / `workflowRunWatch` — retry the find up to 5 times with 3 s backoff (the run may not be registered the moment the tag lands); a failed run is reported to the operator, not thrown — then confirm the release exists with `forge.releaseView({ tag: 'v{version}', repo })`.
64
+
65
+ Otherwise the skill creates the release itself:
66
+
63
67
  ```js
64
68
  await forge.releaseCreate({ tag: 'v{version}', repo, generateNotes: true });
65
69
  ```
66
70
 
67
- If the repo has `.github/workflows/publish.yml`, find and watch its run with `workflowRunFind` / `workflowRunWatch` — retry the find up to 5 times with 3 s backoff (the run may not be registered the moment the tag lands). A failed run is reported to the operator, not thrown.
71
+ If a `publish.yml` without release creation exists, still find and watch its run the same way.
68
72
 
69
73
  **Step 6: Tear down and report**
70
74
 
@@ -21,7 +21,7 @@ New work as a task: one tracker issue, one branch, one worktree per repo the wor
21
21
 
22
22
  If `workspace.tracker` is absent, say tracking is off and skip step 1 — but still ask for the type (`bug` / `feat` / `chore`) and a one-line description, because the type picks the branch prefix — then continue with steps 2–6. Tell the user plainly what that costs: without a tracker there is no `workItem`, the task is not recorded on the chat record, and `/complete-work` cannot find it from the launcher. It is completed either by running `/complete-work` from inside the worktree (cwd detection) or by opening the PR by hand.
23
23
 
24
- 1. **Identify or create the tracker issue and claim it** — the same adapter calls as Flow: Blank steps 3–6:
24
+ 1. **Identify or create the tracker issue and claim it.** If the invocation's arguments already name an issue — `gh:N`, `#N`, or an issue URL — normalize it to the adapter's id (`#42` and a `.../issues/42` URL both mean `gh:42`), fetch it with `tracker.getIssue(id)`, claim it when it is not yet assigned to you (with the same `ALREADY_ASSIGNED` handling as the fallback pick below), and skip the candidate list entirely. Otherwise, list the candidates — the same adapter calls as Flow: Blank steps 3–6:
25
25
 
26
26
  ```javascript
27
27
  import { createTracker } from './.claude/scripts/trackers/interface.mjs';
@@ -60,7 +60,7 @@ If `workspace.tracker` is absent, say tracking is off and skip step 1 — but st
60
60
  ```bash
61
61
  node .claude/scripts/chat-record.mjs --root . --add-task --chat "{chat}" --work-item "{workItem}" --branch "{branch}" --repo "{repo}"
62
62
  ```
63
- `{chat}` is the name from the `Chat record:` line the SessionStart hook injected into this conversation. If there is no such line, say so and skip recording rather than guessing a name.
63
+ `{chat}` is the name from the `Chat record:` line the SessionStart hook injected into this conversation. If there is no such line, run `node .claude/scripts/chat-record.mjs --whoami --root .` first — compaction can drop the hook line, and this recovers the name by matching the chat's session id. When that too prints nothing, say so and skip recording rather than guessing a name.
64
64
 
65
65
  6. **Tell the user where the work happens:** the worktree path(s) above — edits belong there, not in the source clones at `repos/{repo}/`. Work continues from this chat by path. A chat started inside a **project** worktree would not load the workspace's conventions or hooks (a worktree is a context boundary), so staying here is the default. A `.` worktree does load a copy of the workspace's `CLAUDE.md`/`.claude/` — but with the worktree as root, so its chat records land in the worktree's own scratchpad rather than the launcher's; the task still belongs to this chat.
66
66
 
@@ -6,7 +6,7 @@
6
6
  "scratchpadDir": "workspace-scratchpad",
7
7
  "workSessionsDir": "work-sessions",
8
8
  "workspaceContextDir": "workspace-context",
9
- "canonicalBudgetBytes": 40960,
9
+ "alwaysLoadedBudgetBytes": 65536,
10
10
  "subagentContextMaxBytes": 32768,
11
11
  "subagentInlineMaxBytes": 8192,
12
12
  "greeting": "Welcome back to {{project-name}}.",
File without changes
File without changes
File without changes
File without changes