@ulysses-ai/create-workspace 0.16.0-beta.1 → 0.18.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 (53) hide show
  1. package/README.md +5 -5
  2. package/lib/init.mjs +19 -0
  3. package/package.json +1 -1
  4. package/template/.claude/hooks/_utils.mjs +1 -1
  5. package/template/.claude/hooks/repo-write-detection.mjs +161 -64
  6. package/template/.claude/hooks/session-end.mjs +68 -2
  7. package/template/.claude/hooks/session-start.mjs +35 -1
  8. package/template/.claude/hooks/subagent-start.mjs +89 -22
  9. package/template/.claude/lib/session-frontmatter.mjs +28 -0
  10. package/template/.claude/rules/coherent-revisions.md +1 -1
  11. package/template/.claude/rules/config-review.md.skip +29 -0
  12. package/template/.claude/rules/forge-operations.md +51 -0
  13. package/template/.claude/rules/git-conventions.md +16 -11
  14. package/template/.claude/rules/goal-driven-work.md +8 -403
  15. package/template/.claude/rules/honest-pushback.md +37 -37
  16. package/template/.claude/rules/memory-guidance.md +43 -90
  17. package/template/.claude/rules/superpowers-workflow.md.skip +1 -1
  18. package/template/.claude/rules/work-item-tracking.md +30 -72
  19. package/template/.claude/rules/workspace-structure.md +49 -69
  20. package/template/.claude/scripts/build-workspace-context.mjs +61 -16
  21. package/template/.claude/scripts/chat-record.mjs +282 -0
  22. package/template/.claude/scripts/cleanup-work-session.mjs +363 -36
  23. package/template/.claude/scripts/context-footprint.mjs +282 -0
  24. package/template/.claude/scripts/forges/github.mjs +255 -0
  25. package/template/.claude/scripts/forges/gitlab.mjs +20 -0
  26. package/template/.claude/scripts/forges/interface.mjs +125 -0
  27. package/template/.claude/scripts/generate-claude-local.mjs +21 -2
  28. package/template/.claude/scripts/migrate-sessions.mjs +1571 -0
  29. package/template/.claude/scripts/migrate-to-workspace-context.mjs +7 -2
  30. package/template/.claude/scripts/task-worktree.mjs +525 -0
  31. package/template/.claude/scripts/workspace-diagnostics.mjs +654 -0
  32. package/template/.claude/settings.json +5 -13
  33. package/template/.claude/skills/braindump/SKILL.md +11 -4
  34. package/template/.claude/skills/build-docs-site/SKILL.md +5 -5
  35. package/template/.claude/skills/build-docs-site/templates/spec.md.tmpl +1 -1
  36. package/template/.claude/skills/complete-work/SKILL.md +255 -215
  37. package/template/.claude/skills/context-placement/SKILL.md +199 -0
  38. package/template/.claude/skills/goal-driven-work/SKILL.md +459 -0
  39. package/template/.claude/skills/handoff/SKILL.md +11 -4
  40. package/template/.claude/skills/maintenance/SKILL.md +39 -6
  41. package/template/.claude/skills/migrate-sessions/SKILL.md +70 -0
  42. package/template/.claude/skills/pause-work/SKILL.md +33 -8
  43. package/template/.claude/skills/release/SKILL.md +44 -108
  44. package/template/.claude/skills/start-work/SKILL.md +89 -7
  45. package/template/.claude/skills/workspace-init/SKILL.md +34 -0
  46. package/template/.claude/skills/workspace-update/SKILL.md +4 -0
  47. package/template/.claudeignore +3 -0
  48. package/template/CLAUDE.md.tmpl +20 -2
  49. package/template/CODEBASE.md.tmpl +13 -0
  50. package/template/_gitignore +9 -0
  51. package/template/repo-claude.md.tmpl +10 -0
  52. package/template/workspace.json.tmpl +5 -3
  53. package/template/.claude/hooks/worktree-create.mjs +0 -53
@@ -19,6 +19,7 @@
19
19
 
20
20
  import { readFileSync, writeFileSync, existsSync, realpathSync } from 'node:fs';
21
21
  import { join, resolve } from 'node:path';
22
+ import { spawnSync } from 'node:child_process';
22
23
  import { fileURLToPath } from 'node:url';
23
24
 
24
25
  function isMainModule(metaUrl) {
@@ -85,11 +86,29 @@ function generateClaudeLocal(root, { force = false } = {}) {
85
86
  return { path: target, status: existsSync(target) ? 'written' : 'written' };
86
87
  }
87
88
 
89
+ // The per-user index CLAUDE.local.md imports is generated, not tracked
90
+ // (gh:132) — so on a fresh clone it does not exist yet, and writing an
91
+ // importer for a missing file leaves a dangling @-import. Regenerate the
92
+ // workspace-context artifacts here, where the importer is created, rather
93
+ // than leaving the gap for /workspace-init to remember.
94
+ function ensurePerUserIndex(root) {
95
+ const builder = join(root, '.claude', 'scripts', 'build-workspace-context.mjs');
96
+ if (!existsSync(builder)) return { regenerated: false, reason: 'builder not present' };
97
+ const r = spawnSync(process.execPath, [builder, '--write', '--root', root], {
98
+ encoding: 'utf-8',
99
+ });
100
+ if (r.status !== 0) {
101
+ return { regenerated: false, reason: (r.stderr || '').trim() || `exit ${r.status}` };
102
+ }
103
+ return { regenerated: true };
104
+ }
105
+
88
106
  function main() {
89
107
  const args = parseArgs(process.argv);
90
108
  const root = resolve(args.root);
91
109
  const result = generateClaudeLocal(root, { force: args.force });
92
- process.stdout.write(JSON.stringify(result) + '\n');
110
+ const index = ensurePerUserIndex(root);
111
+ process.stdout.write(JSON.stringify({ ...result, index }) + '\n');
93
112
  }
94
113
 
95
114
  if (isMainModule(import.meta.url)) {
@@ -101,4 +120,4 @@ if (isMainModule(import.meta.url)) {
101
120
  }
102
121
  }
103
122
 
104
- export { readWorkspaceUser, renderClaudeLocal, generateClaudeLocal };
123
+ export { readWorkspaceUser, renderClaudeLocal, generateClaudeLocal, ensurePerUserIndex };