@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.
- package/README.md +5 -5
- package/lib/init.mjs +19 -0
- package/package.json +1 -1
- package/template/.claude/hooks/_utils.mjs +1 -1
- package/template/.claude/hooks/repo-write-detection.mjs +161 -64
- package/template/.claude/hooks/session-end.mjs +68 -2
- package/template/.claude/hooks/session-start.mjs +35 -1
- package/template/.claude/hooks/subagent-start.mjs +89 -22
- package/template/.claude/lib/session-frontmatter.mjs +28 -0
- package/template/.claude/rules/coherent-revisions.md +1 -1
- package/template/.claude/rules/config-review.md.skip +29 -0
- package/template/.claude/rules/forge-operations.md +51 -0
- package/template/.claude/rules/git-conventions.md +16 -11
- package/template/.claude/rules/goal-driven-work.md +8 -403
- package/template/.claude/rules/honest-pushback.md +37 -37
- package/template/.claude/rules/memory-guidance.md +43 -90
- package/template/.claude/rules/superpowers-workflow.md.skip +1 -1
- package/template/.claude/rules/work-item-tracking.md +30 -72
- package/template/.claude/rules/workspace-structure.md +49 -69
- package/template/.claude/scripts/build-workspace-context.mjs +61 -16
- package/template/.claude/scripts/chat-record.mjs +282 -0
- package/template/.claude/scripts/cleanup-work-session.mjs +363 -36
- package/template/.claude/scripts/context-footprint.mjs +282 -0
- package/template/.claude/scripts/forges/github.mjs +255 -0
- package/template/.claude/scripts/forges/gitlab.mjs +20 -0
- package/template/.claude/scripts/forges/interface.mjs +125 -0
- package/template/.claude/scripts/generate-claude-local.mjs +21 -2
- package/template/.claude/scripts/migrate-sessions.mjs +1571 -0
- package/template/.claude/scripts/migrate-to-workspace-context.mjs +7 -2
- package/template/.claude/scripts/task-worktree.mjs +525 -0
- package/template/.claude/scripts/workspace-diagnostics.mjs +654 -0
- package/template/.claude/settings.json +5 -13
- package/template/.claude/skills/braindump/SKILL.md +11 -4
- package/template/.claude/skills/build-docs-site/SKILL.md +5 -5
- package/template/.claude/skills/build-docs-site/templates/spec.md.tmpl +1 -1
- package/template/.claude/skills/complete-work/SKILL.md +255 -215
- package/template/.claude/skills/context-placement/SKILL.md +199 -0
- package/template/.claude/skills/goal-driven-work/SKILL.md +459 -0
- package/template/.claude/skills/handoff/SKILL.md +11 -4
- package/template/.claude/skills/maintenance/SKILL.md +39 -6
- package/template/.claude/skills/migrate-sessions/SKILL.md +70 -0
- package/template/.claude/skills/pause-work/SKILL.md +33 -8
- package/template/.claude/skills/release/SKILL.md +44 -108
- package/template/.claude/skills/start-work/SKILL.md +89 -7
- package/template/.claude/skills/workspace-init/SKILL.md +34 -0
- package/template/.claude/skills/workspace-update/SKILL.md +4 -0
- package/template/.claudeignore +3 -0
- package/template/CLAUDE.md.tmpl +20 -2
- package/template/CODEBASE.md.tmpl +13 -0
- package/template/_gitignore +9 -0
- package/template/repo-claude.md.tmpl +10 -0
- package/template/workspace.json.tmpl +5 -3
- package/template/.claude/hooks/worktree-create.mjs +0 -53
|
@@ -1,109 +1,62 @@
|
|
|
1
|
-
# Memory Guidance
|
|
1
|
+
# Memory and Placement Guidance
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Where durable content goes, and what each destination costs.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Where durable content goes
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- Patterns that caused bugs or confusion
|
|
10
|
-
- User corrections about project conventions
|
|
11
|
-
- External system URLs, credentials locations, API quirks
|
|
12
|
-
- Workarounds for tooling issues
|
|
7
|
+
Eight destinations, ordered cheapest first. Work down and stop at the first that genuinely
|
|
8
|
+
fits. The right column is what every session pays, forever, for the choice.
|
|
13
9
|
|
|
14
|
-
|
|
10
|
+
| destination | for | always-loaded cost |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| nowhere | already covered, or true only today | zero |
|
|
13
|
+
| `.claude/rules/*.md` with `paths:` | an instruction that applies only to certain files | zero until a match is read |
|
|
14
|
+
| a skill | a procedure with steps, invoked on demand | its `description` line |
|
|
15
|
+
| auto-memory | machine-local preference or correction; not shared, not reviewable | one `MEMORY.md` line |
|
|
16
|
+
| `team-member/{user}/` | one person's working context | one index line, that user |
|
|
17
|
+
| `shared/` | team-visible reference, looked up when relevant | one index line |
|
|
18
|
+
| `shared/locked/` | canonical team truth | **the whole file, every session** |
|
|
19
|
+
| `.claude/rules/*.md` (no `paths:`) | an instruction that must hold in every session | **the whole file, every session** |
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Anything already captured in a workspace-context file
|
|
19
|
-
- Anything documented in .claude/rules/
|
|
21
|
+
**`nowhere` is the most common correct answer.** A second copy in a second location is
|
|
22
|
+
worse than none — they drift, and the reader cannot tell which is current.
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
The two bold rows tax every session in this workspace, and anything shipped in the template
|
|
25
|
+
taxes every downstream workspace too. Reach them only after the cheaper rows are actually
|
|
26
|
+
ruled out. Prefer `paths:` for anything domain-specific: a rule about migration scripts does
|
|
27
|
+
not need to be in context while editing documentation.
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
- Decisions and progress from this session → update the session tracker body at `work-sessions/{name}/workspace/session.md` (consumed by /complete-work)
|
|
25
|
-
- Patterns, corrections, and insights that apply beyond this session → auto-memory (persists across all sessions)
|
|
26
|
-
- Don't duplicate: if something is already in the session tracker, don't also save it to auto-memory
|
|
27
|
-
|
|
28
|
-
## Workspace-Context Frontmatter
|
|
29
|
-
|
|
30
|
-
Every workspace-context file should have YAML frontmatter. The fields below are conventions, not all required.
|
|
31
|
-
|
|
32
|
-
**Standard fields:**
|
|
33
|
-
|
|
34
|
-
- `state` — `locked` (team truth) or `ephemeral` (working context). Locked files live under `shared/locked/`; ephemeral files live elsewhere under `shared/` or `team-member/{user}/`.
|
|
35
|
-
- `lifecycle` — for ephemeral files: `active` (still relevant) or `resolved` (handled, kept for record).
|
|
36
|
-
- `type` — kind of content: `reference`, `braindump`, `handoff`, `research`, `design`, `index`, `canonical`, `promoted`.
|
|
37
|
-
- `priority` — for locked files only: `critical` (always loaded into canonical) or `reference` (eligible for trim/stub under canonical budget pressure). Default when absent is `critical`. See `build-workspace-context.mjs` for selection semantics.
|
|
38
|
-
- `topic` — kebab-case slug matching the filename (after the type prefix, when one is present).
|
|
39
|
-
- `author` — username scope owner. Required for `team-member/{user}/` files.
|
|
40
|
-
- `updated` — ISO date of last meaningful edit. `/maintenance` flags stale `lifecycle: active` files based on this.
|
|
41
|
-
|
|
42
|
-
**Index-feeding field:**
|
|
43
|
-
|
|
44
|
-
- `description` — one-line summary, used verbatim by `workspace-context/index.md` and per-user team-member indexes. When omitted, the index falls back to the first sentence of the body, then the filename slug (with the `braindump_`/`handoff_`/`research_` prefix stripped). Adding a `description:` to a file with a weak fallback is the cheapest way to improve the index.
|
|
45
|
-
|
|
46
|
-
**Optional confidence marker:**
|
|
47
|
-
|
|
48
|
-
- `confidence` — `high` | `medium` | `low`. Apply to research, design, and exploration files where the conclusions might still shift. Skip on locked files (locked = high by definition) and on workflow artifacts like handoffs and braindumps. The frontmatter integrity check in `/maintenance` validates the value if present.
|
|
49
|
-
|
|
50
|
-
**Example for a research file:**
|
|
51
|
-
|
|
52
|
-
```yaml
|
|
53
|
-
---
|
|
54
|
-
state: ephemeral
|
|
55
|
-
lifecycle: active
|
|
56
|
-
type: research
|
|
57
|
-
topic: vector-search-evaluation
|
|
58
|
-
description: Evaluation of FAISS for workspace-context — concluded NL index is sufficient at our scale.
|
|
59
|
-
author: alex
|
|
60
|
-
confidence: medium
|
|
61
|
-
updated: 2026-04-25
|
|
62
|
-
---
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Workspace-Context Auto-Generated Files
|
|
66
|
-
|
|
67
|
-
A single generator at `.claude/scripts/build-workspace-context.mjs` produces three artifacts in one pass:
|
|
68
|
-
|
|
69
|
-
- `workspace-context/index.md` — navigation catalog of everything under `shared/` (locked files first, then the rest). Imported by the workspace-level `CLAUDE.md`.
|
|
70
|
-
- `workspace-context/canonical.md` — verbatim concatenation of `shared/locked/*.md` so team truths are loaded into every session prompt. Also imported by `CLAUDE.md`.
|
|
71
|
-
- `workspace-context/team-member/{user}/index.md` — per-user navigation catalog, one per team member. Imported by each user's gitignored `CLAUDE.local.md`.
|
|
72
|
-
|
|
73
|
-
Gitignored files (e.g. anything matching `local-only-*`) are excluded automatically, and `workspace-context/.indexignore` adds path-prefix excludes for tracked files that shouldn't appear in the shared index (e.g. archived release notes).
|
|
74
|
-
|
|
75
|
-
When `workspace-context/canonical.md` exceeds `workspace.canonicalBudgetBytes` (default 40960), the builder honors per-file `priority` and section-level `<!-- canonical:trim --> ... <!-- canonical:end-trim -->` markers to fit: `priority: reference` files are trimmed first, then stubbed, while `priority: critical` files are always included in full. `/maintenance` audits the budget and offers a triage flow when over.
|
|
29
|
+
**Before writing to either bold row, state the cost:**
|
|
76
30
|
|
|
77
31
|
```bash
|
|
78
|
-
node .claude/scripts/
|
|
79
|
-
node .claude/scripts/build-workspace-context.mjs --write --root . # regenerate all three
|
|
32
|
+
node .claude/scripts/context-footprint.mjs --root . --add <bytes> --as <destination>
|
|
80
33
|
```
|
|
81
34
|
|
|
82
|
-
|
|
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*.
|
|
35
|
+
## The canonical test
|
|
87
36
|
|
|
88
|
-
|
|
37
|
+
Canonical describes what *is* and what *to do*, never what *to think*.
|
|
89
38
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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.
|
|
39
|
+
> If Claude read this for the first time during a session about an unrelated topic, would it
|
|
40
|
+
> (a) help frame the problem correctly, or (b) push it toward a particular answer to a
|
|
41
|
+
> question that hasn't been asked yet?
|
|
95
42
|
|
|
96
|
-
|
|
43
|
+
(a) is canonical. (b) is `shared/` at most, more often `team-member/{user}/`. Pre-loaded
|
|
44
|
+
conclusions don't read as opinions to Claude — they read as ground truth, and they frame
|
|
45
|
+
what Claude considers before the question is asked.
|
|
97
46
|
|
|
98
|
-
-
|
|
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.
|
|
47
|
+
## Auto-memory specifically
|
|
102
48
|
|
|
103
|
-
|
|
49
|
+
Save: architecture decisions and their rationale, patterns that caused bugs, user
|
|
50
|
+
corrections about project conventions, external URLs and API quirks, tooling workarounds.
|
|
104
51
|
|
|
105
|
-
|
|
52
|
+
Don't save: temporary debugging state, file contents (re-read them), anything already in a
|
|
53
|
+
workspace-context file or a rule.
|
|
106
54
|
|
|
107
|
-
|
|
55
|
+
When work is in flight, its decisions and progress go in the lifecycle's own state — the
|
|
56
|
+
session tracker body at `work-sessions/{name}/workspace/session.md` (session model) or the
|
|
57
|
+
chat drawer at `workspace-scratchpad/chats/{chat}/` (task model) — which `/complete-work`
|
|
58
|
+
consumes. Auto-memory is for what outlives the work. Never both.
|
|
108
59
|
|
|
109
|
-
|
|
60
|
+
For the full routing procedure, the frontmatter schema, the generator invocations, and the
|
|
61
|
+
belongs/doesn't-belong lists behind the canonical test, invoke the `context-placement`
|
|
62
|
+
skill.
|
|
@@ -12,7 +12,7 @@ Activate this rule if the superpowers plugin is installed.
|
|
|
12
12
|
## Specs and Plans
|
|
13
13
|
|
|
14
14
|
- Specs and plans live in the active worktree during development
|
|
15
|
-
- They are ephemeral — consumed by /complete-work into
|
|
15
|
+
- They are ephemeral — consumed by /complete-work into the PR body, then removed
|
|
16
16
|
- If a spec/plan already exists for the current branch, version it: `-v2`, `-v3`, etc.
|
|
17
17
|
|
|
18
18
|
## Execution
|
|
@@ -1,90 +1,48 @@
|
|
|
1
1
|
# Work Item Tracking
|
|
2
2
|
|
|
3
|
-
When a workspace has
|
|
3
|
+
When a workspace has a tracker configured, **all work items — bugs, features, chores — live
|
|
4
|
+
in that tracker.** There is no local file mirroring its state. Skills reach it through
|
|
5
|
+
`createTracker()` from `.claude/scripts/trackers/interface.mjs`; that module is the source of
|
|
6
|
+
truth for the available methods, and the four skills that use it (`start-work`, `pause-work`,
|
|
7
|
+
`complete-work`, `setup-tracker`) each carry the exact calls they make.
|
|
4
8
|
|
|
5
9
|
## Why external-first
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
Two people can't start the same ticket — the tracker is the source of truth for who has what.
|
|
12
|
+
Status changes reach the whole team the moment they happen rather than after a push. And
|
|
13
|
+
humans and Claude read the same list in the same place.
|
|
10
14
|
|
|
11
15
|
## Configuration
|
|
12
16
|
|
|
13
|
-
`workspace.json` → `workspace.tracker`:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"tracker": {
|
|
19
|
-
"type": "github-issues",
|
|
20
|
-
"repo": "your-org/your-workspace"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- `type` — identifies the adapter module at `.claude/scripts/trackers/{type}.mjs`. Only `github-issues` ships in the template; others are additive.
|
|
27
|
-
- `repo` — adapter-specific. For `github-issues`, the owner/name slug of the repo where issues live. `"auto"` resolves to the workspace's own git remote.
|
|
28
|
-
|
|
29
|
-
Absence of `workspace.tracker` means tracking is disabled. Skills handle this by falling back to a blank/describe-the-work flow — they do not fabricate a local mirror.
|
|
30
|
-
|
|
31
|
-
## Adapter interface (for Claude)
|
|
32
|
-
|
|
33
|
-
Import from `.claude/scripts/trackers/interface.mjs`:
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
import { createTracker, AlreadyAssignedError } from '.claude/scripts/trackers/interface.mjs';
|
|
37
|
-
|
|
38
|
-
const tracker = createTracker(workspace.tracker);
|
|
39
|
-
|
|
40
|
-
const mine = await tracker.listAssignedToMe(); // Issue[]
|
|
41
|
-
const open = await tracker.listUnassigned(); // Issue[]
|
|
42
|
-
const issue = await tracker.claim('gh:42'); // throws AlreadyAssignedError on contention
|
|
43
|
-
const created = await tracker.createIssue({ title, body, labels: ['feat', 'P2'], milestone: 'Backlog' });
|
|
44
|
-
await tracker.comment('gh:42', 'paused here; see branch X');
|
|
45
|
-
await tracker.closeIssue('gh:42', { comment: 'shipped in PR #99' });
|
|
46
|
-
|
|
47
|
-
// Setup-time: idempotent milestone / label creation
|
|
48
|
-
await tracker.ensureLabels(); // creates bug/feat/chore/P1/P2/P3 if absent
|
|
49
|
-
await tracker.ensureMilestone({ title: 'Backlog', description: 'Triage later' });
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
All skills that touch work items use this interface. Adapters are not called directly.
|
|
17
|
+
`workspace.json` → `workspace.tracker`: `{ "type": "github-issues", "repo": "owner/name" }`.
|
|
18
|
+
`type` names the adapter at `.claude/scripts/trackers/{type}.mjs`; only `github-issues` ships.
|
|
19
|
+
`repo` is adapter-specific — for GitHub, the slug where issues live, or `"auto"` to resolve
|
|
20
|
+
from the git remote. No `workspace.tracker` means tracking is disabled, and skills fall back
|
|
21
|
+
to a blank describe-the-work flow rather than fabricating a local mirror.
|
|
53
22
|
|
|
54
23
|
## Session linkage
|
|
55
24
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```yaml
|
|
59
|
-
workItem: gh:42
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The value is the adapter-prefixed issue ID. This survives adapter swaps — replacing the GitHub adapter with a Linear adapter later doesn't require re-linking session trackers (though the prefix changes for *new* sessions).
|
|
25
|
+
`/start-work` records the adapter-prefixed issue ID in session frontmatter as `workItem: gh:42`.
|
|
26
|
+
The prefix makes it self-describing across adapter swaps.
|
|
63
27
|
|
|
64
28
|
## When to create issues
|
|
65
29
|
|
|
66
|
-
- **
|
|
67
|
-
- **
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- Do not create, write to, or read `workspace-context/open-work.md`. That file is deprecated.
|
|
73
|
-
- Do not write ticket state into `session.md` frontmatter beyond the `workItem:` pointer. Status, assignment, milestone, and labels live in the tracker.
|
|
74
|
-
- Do not cache issue bodies locally. Always fetch via `tracker.getIssue(id)` when the content is needed.
|
|
75
|
-
|
|
76
|
-
## Skill behavior
|
|
30
|
+
- **Work described during `/start-work`** → create the issue, then claim it.
|
|
31
|
+
- **A bug or feature found mid-session** → ask "Create an issue for this? [Y/n]". Link it to
|
|
32
|
+
the session if it is in scope; leave it unassigned if it is a future concern.
|
|
33
|
+
- **Never during braindumps or handoffs.** Those are discussion artifacts. Action items can
|
|
34
|
+
graduate to issues later, at `/start-work`.
|
|
77
35
|
|
|
78
|
-
|
|
36
|
+
## What not to do
|
|
79
37
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
-
|
|
84
|
-
- **`/workspace-init`** — prompts to run `/setup-tracker` at the end of init. Does not pre-populate tickets.
|
|
38
|
+
- Do not create, read, or write `workspace-context/open-work.md`. It is deprecated.
|
|
39
|
+
- Do not put ticket state in session frontmatter beyond the `workItem:` pointer. Status,
|
|
40
|
+
assignment, labels and milestone live in the tracker.
|
|
41
|
+
- Do not cache issue bodies locally. Fetch with `tracker.getIssue(id)` when you need one.
|
|
85
42
|
|
|
86
|
-
##
|
|
43
|
+
## Boundaries
|
|
87
44
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
45
|
+
Adapter choice is per workspace; this rule prescribes no particular tracker. Beyond the six
|
|
46
|
+
labels `ensureLabels()` creates (`bug`, `feat`, `chore`, `P1`, `P2`, `P3`), it prescribes no
|
|
47
|
+
schema — teams with an existing tracker skip label creation. Tracker-native features like
|
|
48
|
+
comments, reactions and linked PRs stay in the tracker's own UI.
|
|
@@ -1,99 +1,79 @@
|
|
|
1
1
|
# Workspace Structure
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All paths are relative to the workspace root. Two work lifecycles coexist, selected for new work by `workspace.sessionModel` in `workspace.json`: **task** (the forward path — one issue, one branch, one worktree per touched repo, chat at the root) and **session** (supported — a self-contained `work-sessions/{name}/` folder per effort with a workspace worktree and a `session.md` tracker).
|
|
4
4
|
|
|
5
5
|
## Directory Layout
|
|
6
6
|
|
|
7
|
-
|
|
|
8
|
-
|
|
9
|
-
| `repos/` | Source clones
|
|
10
|
-
| `
|
|
11
|
-
|
|
|
12
|
-
| `work-sessions/{name}/workspace
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
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 |
|
|
18
|
-
| `work-sessions/{name}/workspace/repos/` | Real directory holding nested project worktrees for this session | No (gitignored) |
|
|
19
|
-
| `work-sessions/{name}/workspace/repos/{repo}/` | Project worktree nested inside the workspace worktree | No (gitignored) |
|
|
20
|
-
| `workspace-context/` | Team knowledge and per-user context | Yes |
|
|
21
|
-
| `workspace-context/shared/` | Team-visible content — handoffs, braindumps, research, references | Yes |
|
|
22
|
-
| `workspace-context/shared/locked/` | Canonical team truths — auto-concatenated into `canonical.md` and loaded into every session | Yes |
|
|
23
|
-
| `workspace-context/team-member/{user}/` | Per-user working context — default destination for personal captures | Yes |
|
|
24
|
-
| `workspace-context/index.md` | Auto-generated navigation catalog of `shared/` (locked first, then ephemerals) | Yes |
|
|
25
|
-
| `workspace-context/canonical.md` | Auto-generated verbatim concatenation of `shared/locked/*.md` | Yes |
|
|
26
|
-
| `workspace-context/team-member/{user}/index.md` | Auto-generated per-user navigation catalog | Yes |
|
|
27
|
-
| `workspace-context/.indexignore` | Path prefixes to exclude from `index.md` (e.g., archived release notes) | Yes |
|
|
28
|
-
| `workspace-context/release-notes/` | Per-branch release-note artifacts — `unreleased/` and `archive/` | Yes |
|
|
29
|
-
| `workspace-scratchpad/` | Disposable workspace-scoped files — session log, hook debug output | No (gitignored, lazy) |
|
|
30
|
-
| `CLAUDE.md` | Workspace launcher prompt — imports `canonical.md` and `index.md` | Yes |
|
|
31
|
-
| `CLAUDE.local.md` | Per-user prompt — imports `team-member/{user}/index.md` | No (gitignored) |
|
|
32
|
-
| `.claude/` | Claude Code configuration — rules, agents, skills, hooks, scripts, lib | Yes (except settings.local.json) |
|
|
33
|
-
|
|
34
|
-
Session content (tracker, specs, plans) lives at the top of each session's workspace worktree. It is tracked on the session branch, not on main. Pushing the session branch carries durable session thinking across machines. When `/complete-work` finalizes the session, it synthesizes the content into release notes and removes the files from the branch before the final PR so main's top level stays free of session artifacts.
|
|
7
|
+
| Path | Purpose | Tracked? |
|
|
8
|
+
|------|---------|----------|
|
|
9
|
+
| `repos/{repo}/` | Source clones (always on the default branch) | No |
|
|
10
|
+
| `repos/{repo}/.claude/worktrees/{slug}/` | Task worktree for a project repo (`{slug}` = branch with `/` → `-`) | No |
|
|
11
|
+
| `.claude/worktrees/{slug}/` | Task worktree for the workspace repo (`--repo .`) — Claude Code's native worktree location; the two converge | No |
|
|
12
|
+
| `work-sessions/{name}/workspace/…` | Session lifecycle: workspace worktree, nested project worktrees at `workspace/repos/{repo}/`, `session.md` + artifacts (`design/plan/goal/research/crossref-*.md`) on top | Session branch |
|
|
13
|
+
| `workspace-context/` | Team knowledge: `shared/` (ephemerals), `shared/locked/` (canonical truths), `team-member/{user}/` (per-user) | Yes |
|
|
14
|
+
| `workspace-context/index.md`, `canonical.md`, `team-member/{user}/index.md` | Auto-generated catalogs (`canonical.md` = verbatim `shared/locked/`; `.indexignore` excludes paths) — regenerate with `build-workspace-context.mjs`, never hand-edit | Yes |
|
|
15
|
+
| `workspace-scratchpad/` | Machine-local, regenerable: session log, hook debug output, chat records `chats/{chat}.json`, chat drawers `chats/{chat}/` (task-lifecycle designs, plans, braindumps, research in progress) | No |
|
|
16
|
+
| `CLAUDE.md`, `CLAUDE.local.md`, `.claude/` | Launcher prompt (imports `canonical.md` + `index.md`); per-user prompt; rules, agents, skills, hooks, scripts | All but `CLAUDE.local.md`, `settings.local.json`, `.claude/.active-session.json`, and `.claude/worktrees/` |
|
|
35
17
|
|
|
36
18
|
## Workspace-Context Levels
|
|
37
19
|
|
|
38
|
-
Three layers, in increasing trust order:
|
|
39
|
-
|
|
40
20
|
| Level | Path | What lives there | How it gets there |
|
|
41
|
-
|
|
42
|
-
| Personal | `team-member/{user}/` | Per-user braindumps, handoffs, research
|
|
43
|
-
| Shared | `shared/`
|
|
44
|
-
| Canonical | `shared/locked/` | Promoted truths —
|
|
45
|
-
|
|
46
|
-
Canonical content is verbatim-loaded into every session via `CLAUDE.md` → `@workspace-context/canonical.md`. Personal content is loaded only for the active user via the gitignored `CLAUDE.local.md`.
|
|
21
|
+
|-------|------|------------------|-------------------|
|
|
22
|
+
| Personal | `team-member/{user}/` | Per-user braindumps, handoffs, research | Default for `/braindump`, `/handoff`, `/aside` (session lifecycle / no drawer; task-lifecycle chats default to the chat drawer) |
|
|
23
|
+
| Shared | `shared/` | Team-visible ephemerals | Explicit `--scope shared` or `/promote` |
|
|
24
|
+
| Canonical | `shared/locked/` | Promoted truths — conventions, discipline, status | `/promote` (locked target) |
|
|
47
25
|
|
|
48
|
-
|
|
26
|
+
Canonical loads verbatim into every session (`CLAUDE.md` → `@workspace-context/canonical.md`); personal only for the active user (`CLAUDE.local.md`). Inflight work state (session tracker, chat drawer) never lives in `workspace-context/` — that is for knowledge that outlives any single effort.
|
|
49
27
|
|
|
50
|
-
##
|
|
28
|
+
## Dynamic context loading (hooks)
|
|
51
29
|
|
|
52
|
-
|
|
30
|
+
- **`session-start.mjs`** (`SessionStart`): injects the workspace name, a `Chat record:` line naming this chat's record, and a `Workspace root:` line with the launcher's absolute path (git-derived roots land on the source clone from inside a task worktree); with an active session pointer, also the session's name, branch, work item, and shared-context catalog.
|
|
31
|
+
- **`subagent-start.mjs`** (`SubagentStart`): gives subagents the canonical truths they miss (subagents do not load `CLAUDE.md`) — locked files under `workspace.subagentInlineMaxBytes` (8192) are inlined with frontmatter stripped, larger ones become pointers, and past `workspace.subagentContextMaxBytes` (32768) the largest demote first. Gitignored and `local-only-*` files are excluded.
|
|
53
32
|
|
|
54
|
-
|
|
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`.
|
|
33
|
+
Both are Node.js scripts — cross-platform, no shell dependency.
|
|
57
34
|
|
|
58
|
-
|
|
35
|
+
## Spec and Plan Locations — MANDATORY OVERRIDE
|
|
59
36
|
|
|
60
|
-
|
|
37
|
+
**Specs, plans, and goal artifacts MUST be written to the current lifecycle's work area, not to `docs/superpowers/` or any other location.**
|
|
61
38
|
|
|
62
|
-
|
|
39
|
+
- Session: top of the session worktree — `design-{topic}.md`, `plan-{topic}.md`, `goal-{topic}.md`, plus goal-native `research-*.md`/`crossref-*.md` siblings. On the session branch; stripped before the final PR.
|
|
40
|
+
- Task: the chat drawer `workspace-scratchpad/chats/{chat}/` — same artifact names. Machine-local; `/complete-work` promotes what deserves to survive into `workspace-context/`.
|
|
63
41
|
|
|
64
|
-
|
|
42
|
+
This overrides external skills' default paths (e.g., Superpowers' `docs/superpowers/specs/`) — those skills defer to user preferences, and this rule IS that override. Never create `docs/superpowers/` directories. Version an existing artifact: `design-{topic}-v2.md`.
|
|
65
43
|
|
|
66
44
|
## File Naming Conventions
|
|
67
45
|
|
|
68
|
-
|
|
69
|
-
- Workspace worktrees: `work-sessions/{session-name}/workspace/`
|
|
70
|
-
- Project worktrees: `work-sessions/{session-name}/workspace/repos/{repo-name}/`
|
|
71
|
-
- Session trackers: `work-sessions/{session-name}/workspace/session.md`
|
|
72
|
-
- Specs: `design-{topic}.md` (top of worktree)
|
|
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)
|
|
77
|
-
|
|
78
|
-
For ephemeral content under `shared/` and `team-member/{user}/`, the filename prefix signals the type:
|
|
46
|
+
Ephemeral files under `shared/` and `team-member/{user}/` carry a type prefix:
|
|
79
47
|
|
|
80
48
|
| Skill | Filename prefix |
|
|
81
49
|
|-------|-----------------|
|
|
82
50
|
| `/braindump` | `braindump_{topic}.md` |
|
|
83
51
|
| `/handoff` | `handoff_{topic}.md` |
|
|
84
|
-
| `/aside` (full
|
|
85
|
-
| `/aside --quick` | `braindump_{topic}.md` (with `variant: aside` in frontmatter) |
|
|
52
|
+
| `/aside` (full) / `--quick` | `research_{topic}.md` / `braindump_{topic}.md` (`variant: aside`) |
|
|
86
53
|
| `/promote` | preserves source prefix |
|
|
87
|
-
| `/release` | strips prefix when locking — `shared/locked/` files use bare names since location signals the type |
|
|
88
54
|
|
|
89
|
-
Local-only
|
|
55
|
+
Local-only drafts add a `local-only-` prefix to stay gitignored until promoted.
|
|
90
56
|
|
|
91
57
|
## Rules
|
|
92
58
|
|
|
93
|
-
- The workspace root stays on
|
|
94
|
-
- All real work happens in
|
|
95
|
-
- Session content
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
59
|
+
- The workspace root stays on its default branch — it is the launcher, not a worktree.
|
|
60
|
+
- All real work happens in worktrees — `work-sessions/{name}/workspace/` (session) or a `.claude/worktrees/{slug}/` location (task). Source clones at `repos/{repo}/` never take a feature branch.
|
|
61
|
+
- Session content commits to the session branch; task work to task worktrees; drawer writes need no commit (gitignored, machine-local).
|
|
62
|
+
- `workspace-scratchpad/` is machine-local and regenerable — losing it costs a re-derivation, not the work. Not all of it is disposable: `session-log.jsonl` is real history no other file carries.
|
|
63
|
+
- Hand edits to auto-generated catalogs are overwritten by `build-workspace-context.mjs` — update the source files (or their `description:` frontmatter) instead.
|
|
64
|
+
|
|
65
|
+
## Per-repo commands
|
|
66
|
+
|
|
67
|
+
Per-repo test, lint, and build commands belong in `repos/{repo}/CLAUDE.md` under `## Commands`, scoping invocations to that repo instead of the whole monorepo. `/workspace-init` scaffolds the stub.
|
|
68
|
+
|
|
69
|
+
## Explore before editing
|
|
70
|
+
|
|
71
|
+
Before editing an unfamiliar codebase, map the affected surface first — typically a `researcher.md` subagent dispatch (`disallowedTools: [Edit, Write, Bash]`) returning affected files, callers, and dependencies. Edit only after the map is established.
|
|
72
|
+
|
|
73
|
+
## Launching Claude inside a worktree
|
|
74
|
+
|
|
75
|
+
A git worktree is a context boundary: `CLAUDE.md` discovery stops at the worktree's root, and gitignored content (`repos/`, `local-only-*`, `workspace-scratchpad/`) is absent from it. So a chat launched inside a project worktree — a session's `workspace/repos/{repo}/` or a task's `repos/{repo}/.claude/worktrees/{slug}/` — sees only that repo's own `CLAUDE.md`, not the workspace conventions or hooks. Keep the chat at the workspace root and reach worktrees by path; launch inside one only for deliberately isolated, repo-only work.
|
|
76
|
+
|
|
77
|
+
## Grep vs LSP
|
|
78
|
+
|
|
79
|
+
**Grep/Ripgrep** searches content as text — fast, no server, but no language awareness, so symbol searches surface false positives. **LSP** (`mcp__lsp__*`) understands types and scope — find-all-references returns only real usages — but needs an LSP MCP server in `.mcp.json`. Grep when you don't know where to look; LSP for precise navigation of a specific symbol.
|