create-sessions-dir 0.2.0 → 0.3.1
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 +52 -3
- package/dist/index.js +340 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/claude/commands/change-git-strategy.md +115 -0
- package/templates/claude/commands/document.md +21 -5
- package/templates/claude/commands/end-session.md +27 -2
- package/templates/claude/commands/plan.md +53 -0
- package/templates/claude/commands/start-session.md +24 -1
- package/templates/claude/scripts/should-archive.sh +49 -0
- package/templates/claude/scripts/untrack-sessions.sh +78 -0
- package/templates/sessions/.gitignore-commit +5 -0
- package/templates/sessions/.gitignore-hybrid +18 -0
- package/templates/sessions/.gitignore-ignore +3 -0
- package/templates/sessions/README.md +21 -1
- package/templates/sessions/WORKSPACE.md +46 -0
package/README.md
CHANGED
|
@@ -21,7 +21,9 @@ npx create-sessions-dir
|
|
|
21
21
|
This creates:
|
|
22
22
|
- `.sessions/` directory with context files
|
|
23
23
|
- `.claude/commands/` with slash commands for Claude Code
|
|
24
|
+
- `.claude/scripts/` with helper scripts
|
|
24
25
|
- Templates and workflow guide
|
|
26
|
+
- Optionally creates or updates CLAUDE.md to document the pattern
|
|
25
27
|
|
|
26
28
|
Then start your first session:
|
|
27
29
|
```bash
|
|
@@ -34,14 +36,21 @@ Then start your first session:
|
|
|
34
36
|
.sessions/
|
|
35
37
|
index.md # Your living context document
|
|
36
38
|
archive/ # For completed work
|
|
39
|
+
plans/ # Implementation plans
|
|
40
|
+
prep/ # Pre-session context
|
|
37
41
|
README.md # Workflow guide and examples
|
|
42
|
+
.gitignore # Ignores data/, scratch/ directories
|
|
43
|
+
WORKSPACE.md # Monorepo guide (if detected)
|
|
38
44
|
|
|
39
45
|
.claude/
|
|
40
46
|
commands/
|
|
41
47
|
start-session.md # /start-session command
|
|
42
48
|
end-session.md # /end-session command
|
|
43
49
|
document.md # /document <topic> command
|
|
50
|
+
plan.md # /plan command
|
|
44
51
|
archive-session.md # /archive-session command
|
|
52
|
+
scripts/
|
|
53
|
+
should-archive.sh # PR detection for smart archiving
|
|
45
54
|
```
|
|
46
55
|
|
|
47
56
|
## Usage
|
|
@@ -50,19 +59,25 @@ Then start your first session:
|
|
|
50
59
|
```
|
|
51
60
|
/start-session
|
|
52
61
|
```
|
|
53
|
-
Claude reads your context and asks what you want to work on.
|
|
62
|
+
Claude reads your context and asks what you want to work on. You can provide a GitHub/Linear URL and Claude will fetch details automatically.
|
|
54
63
|
|
|
55
64
|
### End a Session
|
|
56
65
|
```
|
|
57
66
|
/end-session
|
|
58
67
|
```
|
|
59
|
-
Claude updates your context with what happened and commits the changes.
|
|
68
|
+
Claude updates your context with what happened. If you referenced PRs (like #123) and they're merged, Claude will offer to archive automatically. Then commits the changes.
|
|
69
|
+
|
|
70
|
+
### Plan Implementation
|
|
71
|
+
```
|
|
72
|
+
/plan
|
|
73
|
+
```
|
|
74
|
+
Claude launches a planning agent to design your implementation, creating a structured plan in `.sessions/plans/`.
|
|
60
75
|
|
|
61
76
|
### Document a Topic
|
|
62
77
|
```
|
|
63
78
|
/document architecture
|
|
64
79
|
```
|
|
65
|
-
Claude
|
|
80
|
+
Claude launches an exploration agent to understand the topic, then creates documentation in `.sessions/docs/`.
|
|
66
81
|
|
|
67
82
|
### Archive Completed Work
|
|
68
83
|
```
|
|
@@ -70,11 +85,41 @@ Claude creates topic-specific documentation in `.sessions/docs/`. Use this for a
|
|
|
70
85
|
```
|
|
71
86
|
Claude moves finished work to the archive to keep your context file clean.
|
|
72
87
|
|
|
88
|
+
### Change Git Strategy
|
|
89
|
+
```
|
|
90
|
+
/change-git-strategy
|
|
91
|
+
```
|
|
92
|
+
Change how .sessions/ is handled in git (hybrid, commit all, or ignore all). Useful if you want to share more/less with your team.
|
|
93
|
+
|
|
73
94
|
## Requirements
|
|
74
95
|
|
|
75
96
|
- Any project (works with any language/framework)
|
|
76
97
|
- Claude Code CLI (optional but recommended for slash commands)
|
|
77
98
|
|
|
99
|
+
## Updating
|
|
100
|
+
|
|
101
|
+
Already have a Sessions Directory from v0.1 or v0.2? Just run:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx create-sessions-dir
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
It will detect your existing setup and update it to v0.3.0 **without touching your work**. All your session notes, archive, and docs are preserved. Only the commands and structure are updated.
|
|
108
|
+
|
|
109
|
+
## Interactive Setup
|
|
110
|
+
|
|
111
|
+
During installation, you'll be prompted for:
|
|
112
|
+
|
|
113
|
+
1. **Git strategy** - How .sessions/ should be handled in git
|
|
114
|
+
- **Ignore all** (default) - Keep sessions completely local
|
|
115
|
+
- **Hybrid** - Commit docs/plans, keep notes private
|
|
116
|
+
- **Commit all** - Share everything with team
|
|
117
|
+
|
|
118
|
+
2. **CLAUDE.md documentation** - Document the pattern for your team
|
|
119
|
+
- Creates new CLAUDE.md if none exists
|
|
120
|
+
- Appends to existing CLAUDE.md if detected
|
|
121
|
+
- Skips if Sessions Pattern already documented
|
|
122
|
+
|
|
78
123
|
## Why This Works
|
|
79
124
|
|
|
80
125
|
AI coding agents are stateless - they don't remember previous sessions. The Sessions Directory Pattern solves this by:
|
|
@@ -86,6 +131,10 @@ AI coding agents are stateless - they don't remember previous sessions. The Sess
|
|
|
86
131
|
|
|
87
132
|
Read the full story: [vieko.dev/sessions](https://vieko.dev/sessions)
|
|
88
133
|
|
|
134
|
+
## Acknowledgments
|
|
135
|
+
|
|
136
|
+
Thanks to [Aman Azad](https://github.com/namadaza) for the nudge to turn the pattern into a tool.
|
|
137
|
+
|
|
89
138
|
## License
|
|
90
139
|
|
|
91
140
|
MIT © [Vieko Franetovic](https://vieko.dev)
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, chmodSync } from 'fs';
|
|
3
3
|
import { join, dirname } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { execSync } from 'child_process';
|
|
6
|
+
import prompts from 'prompts';
|
|
6
7
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
8
|
const __dirname = dirname(__filename);
|
|
8
9
|
// Colors for terminal output
|
|
@@ -20,6 +21,212 @@ function log(message, color = colors.reset) {
|
|
|
20
21
|
function checkExistingSessions() {
|
|
21
22
|
return existsSync('.sessions');
|
|
22
23
|
}
|
|
24
|
+
function detectVersion() {
|
|
25
|
+
// Try to detect version from existing setup
|
|
26
|
+
if (!existsSync('.sessions'))
|
|
27
|
+
return null;
|
|
28
|
+
// Check for v0.3-specific files (not just directories users might create)
|
|
29
|
+
const hasArchiveScript = existsSync('.claude/scripts/should-archive.sh');
|
|
30
|
+
const hasPlanCommand = existsSync('.claude/commands/plan.md');
|
|
31
|
+
const hasHybridGitignore = existsSync('.sessions/.gitignore') &&
|
|
32
|
+
readFileSync('.sessions/.gitignore', 'utf-8').includes('!docs/');
|
|
33
|
+
// If any v0.3-specific feature exists, consider it v0.3+
|
|
34
|
+
if (hasArchiveScript || hasPlanCommand || hasHybridGitignore) {
|
|
35
|
+
return 'v0.3+';
|
|
36
|
+
}
|
|
37
|
+
return 'v0.1-0.2'; // Old version
|
|
38
|
+
}
|
|
39
|
+
async function promptGitStrategy() {
|
|
40
|
+
const response = await prompts({
|
|
41
|
+
type: 'select',
|
|
42
|
+
name: 'strategy',
|
|
43
|
+
message: 'How should .sessions/ be handled in git?',
|
|
44
|
+
choices: [
|
|
45
|
+
{
|
|
46
|
+
title: 'Ignore all (recommended)',
|
|
47
|
+
value: 'ignore',
|
|
48
|
+
description: 'Keep sessions completely local (start solo, share later if needed)'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: 'Hybrid',
|
|
52
|
+
value: 'hybrid',
|
|
53
|
+
description: 'Commit docs/plans, keep working notes private'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
title: 'Commit all',
|
|
57
|
+
value: 'commit',
|
|
58
|
+
description: 'Share session notes with team, preserve history'
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
initial: 0
|
|
62
|
+
});
|
|
63
|
+
return response.strategy || 'ignore';
|
|
64
|
+
}
|
|
65
|
+
async function promptClaudeMdUpdate() {
|
|
66
|
+
// Check if CLAUDE.md exists
|
|
67
|
+
if (!existsSync('CLAUDE.md')) {
|
|
68
|
+
const response = await prompts({
|
|
69
|
+
type: 'confirm',
|
|
70
|
+
name: 'create',
|
|
71
|
+
message: 'Create CLAUDE.md to document Sessions Pattern for your team?',
|
|
72
|
+
initial: true
|
|
73
|
+
});
|
|
74
|
+
return response.create ?? false;
|
|
75
|
+
}
|
|
76
|
+
// CLAUDE.md exists - check if Sessions Pattern already documented
|
|
77
|
+
const existing = readFileSync('CLAUDE.md', 'utf-8');
|
|
78
|
+
if (existing.includes('Sessions Pattern') || existing.includes('.sessions/')) {
|
|
79
|
+
log('✓ CLAUDE.md already mentions Sessions Pattern', colors.green);
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
// Ask to append
|
|
83
|
+
const response = await prompts({
|
|
84
|
+
type: 'confirm',
|
|
85
|
+
name: 'append',
|
|
86
|
+
message: 'Add Sessions Pattern documentation to existing CLAUDE.md?',
|
|
87
|
+
initial: true
|
|
88
|
+
});
|
|
89
|
+
return response.append ?? false;
|
|
90
|
+
}
|
|
91
|
+
function createOrUpdateClaudeMd(isNew) {
|
|
92
|
+
const sessionsSection = `
|
|
93
|
+
## Sessions Pattern (Optional)
|
|
94
|
+
|
|
95
|
+
If you've set up the Sessions Directory Pattern (\`npx create-sessions-dir\`):
|
|
96
|
+
|
|
97
|
+
- \`/start-session\` - Read context, fetch GitHub/Linear issues
|
|
98
|
+
- \`/end-session\` - Update context, detect merged PRs, auto-archive
|
|
99
|
+
- \`/plan\` - Create structured implementation plans
|
|
100
|
+
- \`/document\` - Topic-specific documentation with sub-agents
|
|
101
|
+
- \`/change-git-strategy\` - Change git strategy for .sessions/
|
|
102
|
+
|
|
103
|
+
Learn more: https://vieko.dev/sessions
|
|
104
|
+
|
|
105
|
+
## External Tools (Optional)
|
|
106
|
+
|
|
107
|
+
**For GitHub integration:**
|
|
108
|
+
\`\`\`bash
|
|
109
|
+
gh auth login # Required for PR/issue fetching
|
|
110
|
+
\`\`\`
|
|
111
|
+
|
|
112
|
+
**For Linear integration:**
|
|
113
|
+
\`\`\`bash
|
|
114
|
+
npm install -g linearis
|
|
115
|
+
echo "your-api-token" > ~/.linear_api_token
|
|
116
|
+
# Or: export LINEAR_API_TOKEN=your-token
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
Get token: Linear Settings → Security & Access → Personal API keys
|
|
120
|
+
|
|
121
|
+
Commands will gracefully handle missing tools and prompt for manual input.
|
|
122
|
+
`;
|
|
123
|
+
if (isNew) {
|
|
124
|
+
// Create new CLAUDE.md
|
|
125
|
+
const content = `# CLAUDE.md
|
|
126
|
+
|
|
127
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
128
|
+
${sessionsSection}`;
|
|
129
|
+
writeFileSync('CLAUDE.md', content);
|
|
130
|
+
log('✓ Created CLAUDE.md with Sessions Pattern documentation', colors.green);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// Append to existing CLAUDE.md
|
|
134
|
+
const existing = readFileSync('CLAUDE.md', 'utf-8');
|
|
135
|
+
const updated = existing + '\n' + sessionsSection;
|
|
136
|
+
writeFileSync('CLAUDE.md', updated);
|
|
137
|
+
log('✓ Added Sessions Pattern section to CLAUDE.md', colors.green);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function createGitignore(strategy) {
|
|
141
|
+
const templateMap = {
|
|
142
|
+
commit: 'sessions/.gitignore-commit',
|
|
143
|
+
ignore: 'sessions/.gitignore-ignore',
|
|
144
|
+
hybrid: 'sessions/.gitignore-hybrid'
|
|
145
|
+
};
|
|
146
|
+
const template = templateMap[strategy] || templateMap.hybrid;
|
|
147
|
+
const gitignoreContent = getTemplateContent(template);
|
|
148
|
+
writeFileSync('.sessions/.gitignore', gitignoreContent);
|
|
149
|
+
const strategyLabels = {
|
|
150
|
+
commit: 'commit strategy (team-shared)',
|
|
151
|
+
ignore: 'ignore strategy (personal)',
|
|
152
|
+
hybrid: 'hybrid strategy (docs committed, notes private)'
|
|
153
|
+
};
|
|
154
|
+
log(`✓ Created .sessions/.gitignore (${strategyLabels[strategy]})`, colors.green);
|
|
155
|
+
}
|
|
156
|
+
function updateExistingSetup() {
|
|
157
|
+
log('\n📦 Updating existing Sessions Directory...', colors.cyan);
|
|
158
|
+
const version = detectVersion();
|
|
159
|
+
if (version === 'v0.3+') {
|
|
160
|
+
log('✓ Already on latest version', colors.green);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// Create new directories (safe - won't overwrite)
|
|
164
|
+
if (!existsSync('.sessions/plans')) {
|
|
165
|
+
mkdirSync('.sessions/plans', { recursive: true });
|
|
166
|
+
log('✓ Created .sessions/plans/', colors.green);
|
|
167
|
+
}
|
|
168
|
+
if (!existsSync('.sessions/prep')) {
|
|
169
|
+
mkdirSync('.sessions/prep', { recursive: true });
|
|
170
|
+
log('✓ Created .sessions/prep/', colors.green);
|
|
171
|
+
}
|
|
172
|
+
if (!existsSync('.claude/scripts')) {
|
|
173
|
+
mkdirSync('.claude/scripts', { recursive: true });
|
|
174
|
+
log('✓ Created .claude/scripts/', colors.green);
|
|
175
|
+
}
|
|
176
|
+
// Update .gitignore to ignore if it only has basic content
|
|
177
|
+
if (existsSync('.sessions/.gitignore')) {
|
|
178
|
+
const existing = readFileSync('.sessions/.gitignore', 'utf-8');
|
|
179
|
+
// If it's the old basic version, update to ignore (safest for updates)
|
|
180
|
+
if (existing.includes('data/') && existing.includes('scratch/') && existing.split('\n').length < 10) {
|
|
181
|
+
createGitignore('ignore');
|
|
182
|
+
log('✓ Updated .sessions/.gitignore to ignore strategy', colors.cyan);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
// No gitignore exists, create ignore (safest for updates - prevents accidental commits)
|
|
187
|
+
createGitignore('ignore');
|
|
188
|
+
}
|
|
189
|
+
// Update or create commands
|
|
190
|
+
const commands = ['start-session', 'end-session', 'document', 'archive-session'];
|
|
191
|
+
for (const cmd of commands) {
|
|
192
|
+
const content = getTemplateContent(`claude/commands/${cmd}.md`);
|
|
193
|
+
writeFileSync(`.claude/commands/${cmd}.md`, content);
|
|
194
|
+
log(`✓ Updated .claude/commands/${cmd}.md`, colors.green);
|
|
195
|
+
}
|
|
196
|
+
// Create new v0.3 commands
|
|
197
|
+
const newCommands = ['plan', 'change-git-strategy'];
|
|
198
|
+
for (const cmd of newCommands) {
|
|
199
|
+
if (!existsSync(`.claude/commands/${cmd}.md`)) {
|
|
200
|
+
const content = getTemplateContent(`claude/commands/${cmd}.md`);
|
|
201
|
+
writeFileSync(`.claude/commands/${cmd}.md`, content);
|
|
202
|
+
log(`✓ Created .claude/commands/${cmd}.md`, colors.green);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// Create scripts
|
|
206
|
+
if (!existsSync('.claude/scripts/should-archive.sh')) {
|
|
207
|
+
const shouldArchiveScript = getTemplateContent('claude/scripts/should-archive.sh');
|
|
208
|
+
writeFileSync('.claude/scripts/should-archive.sh', shouldArchiveScript);
|
|
209
|
+
chmodSync('.claude/scripts/should-archive.sh', 0o755);
|
|
210
|
+
log('✓ Created .claude/scripts/should-archive.sh', colors.green);
|
|
211
|
+
}
|
|
212
|
+
if (!existsSync('.claude/scripts/untrack-sessions.sh')) {
|
|
213
|
+
const untrackScript = getTemplateContent('claude/scripts/untrack-sessions.sh');
|
|
214
|
+
writeFileSync('.claude/scripts/untrack-sessions.sh', untrackScript);
|
|
215
|
+
chmodSync('.claude/scripts/untrack-sessions.sh', 0o755);
|
|
216
|
+
log('✓ Created .claude/scripts/untrack-sessions.sh', colors.green);
|
|
217
|
+
}
|
|
218
|
+
// Check for monorepo and add workspace support if needed
|
|
219
|
+
const monorepo = detectMonorepo();
|
|
220
|
+
if (monorepo.isMonorepo && !existsSync('.sessions/WORKSPACE.md')) {
|
|
221
|
+
mkdirSync('.sessions/packages', { recursive: true });
|
|
222
|
+
log('✓ Detected monorepo - created .sessions/packages/', colors.cyan);
|
|
223
|
+
const workspaceContent = getTemplateContent('sessions/WORKSPACE.md')
|
|
224
|
+
.replace('{{PACKAGES}}', monorepo.packages.map(p => `- ${p}`).join('\n'));
|
|
225
|
+
writeFileSync('.sessions/WORKSPACE.md', workspaceContent);
|
|
226
|
+
log('✓ Created .sessions/WORKSPACE.md', colors.green);
|
|
227
|
+
}
|
|
228
|
+
log('\n✓ Update complete! Your existing work is preserved.', colors.green + colors.bright);
|
|
229
|
+
}
|
|
23
230
|
function checkClaudeCLI() {
|
|
24
231
|
try {
|
|
25
232
|
execSync('which claude', { stdio: 'ignore' });
|
|
@@ -68,17 +275,87 @@ function getTemplateContent(filename) {
|
|
|
68
275
|
const filePath = join(templatesDir, filename);
|
|
69
276
|
return readFileSync(filePath, 'utf-8');
|
|
70
277
|
}
|
|
278
|
+
function detectMonorepo() {
|
|
279
|
+
// Check for pnpm workspace
|
|
280
|
+
if (existsSync('pnpm-workspace.yaml')) {
|
|
281
|
+
try {
|
|
282
|
+
const yaml = readFileSync('pnpm-workspace.yaml', 'utf-8');
|
|
283
|
+
// Simple YAML parsing for packages array
|
|
284
|
+
const packagesMatch = yaml.match(/packages:\s*\n((?:\s*-\s*.+\n?)+)/);
|
|
285
|
+
if (packagesMatch) {
|
|
286
|
+
const packages = packagesMatch[1]
|
|
287
|
+
.split('\n')
|
|
288
|
+
.filter(line => line.trim().startsWith('-'))
|
|
289
|
+
.map(line => line.trim().substring(1).trim());
|
|
290
|
+
return { isMonorepo: true, root: process.cwd(), packages };
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
// Fall through
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// Check for npm/yarn/bun workspaces (also used by Turborepo)
|
|
298
|
+
if (existsSync('package.json')) {
|
|
299
|
+
try {
|
|
300
|
+
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
|
|
301
|
+
if (pkg.workspaces) {
|
|
302
|
+
const packages = Array.isArray(pkg.workspaces)
|
|
303
|
+
? pkg.workspaces
|
|
304
|
+
: pkg.workspaces.packages || [];
|
|
305
|
+
return { isMonorepo: true, root: process.cwd(), packages };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
// Fall through
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
// Check for Lerna
|
|
313
|
+
if (existsSync('lerna.json')) {
|
|
314
|
+
try {
|
|
315
|
+
const lerna = JSON.parse(readFileSync('lerna.json', 'utf-8'));
|
|
316
|
+
const packages = lerna.packages || ['packages/*'];
|
|
317
|
+
return { isMonorepo: true, root: process.cwd(), packages };
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
// Fall through
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
// Check for Turborepo (fallback if no workspace config found yet)
|
|
324
|
+
// Turborepo uses underlying workspace configs, so this is a hint to check deeper
|
|
325
|
+
if (existsSync('turbo.json') || existsSync('turbo.jsonc')) {
|
|
326
|
+
// Turborepo detected but no workspace config - might be misconfigured or minimal setup
|
|
327
|
+
// Default to common patterns
|
|
328
|
+
return { isMonorepo: true, root: process.cwd(), packages: ['apps/*', 'packages/*'] };
|
|
329
|
+
}
|
|
330
|
+
return { isMonorepo: false, root: process.cwd(), packages: [] };
|
|
331
|
+
}
|
|
71
332
|
function createSessionsDirectory() {
|
|
72
333
|
const projectName = getProjectName();
|
|
73
334
|
const currentDate = getCurrentDate();
|
|
74
|
-
|
|
335
|
+
const monorepo = detectMonorepo();
|
|
336
|
+
// Create base directories
|
|
75
337
|
mkdirSync('.sessions', { recursive: true });
|
|
76
338
|
mkdirSync('.sessions/archive', { recursive: true });
|
|
339
|
+
mkdirSync('.sessions/plans', { recursive: true });
|
|
340
|
+
mkdirSync('.sessions/prep', { recursive: true });
|
|
77
341
|
mkdirSync('.claude', { recursive: true });
|
|
78
342
|
mkdirSync('.claude/commands', { recursive: true });
|
|
343
|
+
mkdirSync('.claude/scripts', { recursive: true });
|
|
79
344
|
log('\n✓ Created .sessions/ directory', colors.green);
|
|
80
345
|
log('✓ Created .sessions/archive/ directory', colors.green);
|
|
346
|
+
log('✓ Created .sessions/plans/ directory', colors.green);
|
|
347
|
+
log('✓ Created .sessions/prep/ directory', colors.green);
|
|
81
348
|
log('✓ Created .claude/commands/ directory', colors.green);
|
|
349
|
+
log('✓ Created .claude/scripts/ directory', colors.green);
|
|
350
|
+
// Handle monorepo setup
|
|
351
|
+
if (monorepo.isMonorepo) {
|
|
352
|
+
mkdirSync('.sessions/packages', { recursive: true });
|
|
353
|
+
log('✓ Detected monorepo - created .sessions/packages/', colors.cyan);
|
|
354
|
+
const workspaceContent = getTemplateContent('sessions/WORKSPACE.md')
|
|
355
|
+
.replace('{{PACKAGES}}', monorepo.packages.map(p => `- ${p}`).join('\n'));
|
|
356
|
+
writeFileSync('.sessions/WORKSPACE.md', workspaceContent);
|
|
357
|
+
log('✓ Created .sessions/WORKSPACE.md', colors.green);
|
|
358
|
+
}
|
|
82
359
|
// Create index.md
|
|
83
360
|
const indexContent = getTemplateContent('sessions/index.md')
|
|
84
361
|
.replace('{{PROJECT_NAME}}', projectName)
|
|
@@ -89,6 +366,7 @@ function createSessionsDirectory() {
|
|
|
89
366
|
const readmeContent = getTemplateContent('sessions/README.md');
|
|
90
367
|
writeFileSync('.sessions/README.md', readmeContent);
|
|
91
368
|
log('✓ Created .sessions/README.md', colors.green);
|
|
369
|
+
// Git strategy will be set in main() after user prompt
|
|
92
370
|
// Create slash commands
|
|
93
371
|
const startSessionContent = getTemplateContent('claude/commands/start-session.md');
|
|
94
372
|
writeFileSync('.claude/commands/start-session.md', startSessionContent);
|
|
@@ -102,18 +380,73 @@ function createSessionsDirectory() {
|
|
|
102
380
|
const documentContent = getTemplateContent('claude/commands/document.md');
|
|
103
381
|
writeFileSync('.claude/commands/document.md', documentContent);
|
|
104
382
|
log('✓ Created .claude/commands/document.md', colors.green);
|
|
383
|
+
const planContent = getTemplateContent('claude/commands/plan.md');
|
|
384
|
+
writeFileSync('.claude/commands/plan.md', planContent);
|
|
385
|
+
log('✓ Created .claude/commands/plan.md', colors.green);
|
|
386
|
+
const changeGitStrategyContent = getTemplateContent('claude/commands/change-git-strategy.md');
|
|
387
|
+
writeFileSync('.claude/commands/change-git-strategy.md', changeGitStrategyContent);
|
|
388
|
+
log('✓ Created .claude/commands/change-git-strategy.md', colors.green);
|
|
389
|
+
// Create scripts
|
|
390
|
+
const shouldArchiveScript = getTemplateContent('claude/scripts/should-archive.sh');
|
|
391
|
+
writeFileSync('.claude/scripts/should-archive.sh', shouldArchiveScript);
|
|
392
|
+
chmodSync('.claude/scripts/should-archive.sh', 0o755);
|
|
393
|
+
log('✓ Created .claude/scripts/should-archive.sh', colors.green);
|
|
394
|
+
const untrackScript = getTemplateContent('claude/scripts/untrack-sessions.sh');
|
|
395
|
+
writeFileSync('.claude/scripts/untrack-sessions.sh', untrackScript);
|
|
396
|
+
chmodSync('.claude/scripts/untrack-sessions.sh', 0o755);
|
|
397
|
+
log('✓ Created .claude/scripts/untrack-sessions.sh', colors.green);
|
|
105
398
|
}
|
|
106
|
-
function main() {
|
|
399
|
+
async function main() {
|
|
107
400
|
log('\n✨ create-sessions-dir', colors.cyan + colors.bright);
|
|
108
401
|
log(' Setting up Sessions Directory Pattern\n', colors.cyan);
|
|
109
402
|
// Check for existing .sessions directory
|
|
110
403
|
if (checkExistingSessions()) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
404
|
+
const version = detectVersion();
|
|
405
|
+
if (version === 'v0.3+') {
|
|
406
|
+
log('✓ Sessions Directory already exists and is up to date', colors.green);
|
|
407
|
+
log(' No updates needed.\n', colors.cyan);
|
|
408
|
+
process.exit(0);
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
log('📦 Existing Sessions Directory detected (older version)', colors.cyan);
|
|
412
|
+
log(' Updating to v0.3.0 with new features...\n', colors.cyan);
|
|
413
|
+
updateExistingSetup();
|
|
414
|
+
// Check for Claude CLI
|
|
415
|
+
const hasClaudeCLI = checkClaudeCLI();
|
|
416
|
+
log('\n' + '─'.repeat(50), colors.blue);
|
|
417
|
+
log('\n🎉 Update complete!\n', colors.green + colors.bright);
|
|
418
|
+
log('What\'s new in v0.3.0:', colors.bright);
|
|
419
|
+
log(' • Smart PR detection and archiving (.claude/scripts/should-archive.sh)');
|
|
420
|
+
log(' • GitHub/Linear issue integration (/start-session)');
|
|
421
|
+
log(' • Implementation planning (/plan)');
|
|
422
|
+
log(' • Enhanced documentation with sub-agents (/document)');
|
|
423
|
+
log(' • Monorepo support (auto-detected)');
|
|
424
|
+
log(' • New directories: plans/, prep/\n');
|
|
425
|
+
if (!hasClaudeCLI) {
|
|
426
|
+
log('⚠️ Claude CLI not detected', colors.yellow);
|
|
427
|
+
log(' Install it to use slash commands:', colors.yellow);
|
|
428
|
+
log(' npm install -g @anthropic-ai/claude-code\n', colors.cyan);
|
|
429
|
+
}
|
|
430
|
+
log('Next steps:', colors.bright);
|
|
431
|
+
log(' 1. Check updated commands in .claude/commands/');
|
|
432
|
+
log(' 2. Try /plan to create an implementation plan');
|
|
433
|
+
log(' 3. Learn more: https://vieko.dev/sessions\n');
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
114
436
|
}
|
|
115
|
-
// Create the structure
|
|
437
|
+
// Create the structure (fresh install)
|
|
116
438
|
createSessionsDirectory();
|
|
439
|
+
// Prompt for git strategy
|
|
440
|
+
log('');
|
|
441
|
+
const gitStrategy = await promptGitStrategy();
|
|
442
|
+
createGitignore(gitStrategy);
|
|
443
|
+
// Prompt for CLAUDE.md documentation
|
|
444
|
+
log('');
|
|
445
|
+
const shouldUpdateClaudeMd = await promptClaudeMdUpdate();
|
|
446
|
+
if (shouldUpdateClaudeMd) {
|
|
447
|
+
const isNew = !existsSync('CLAUDE.md');
|
|
448
|
+
createOrUpdateClaudeMd(isNew);
|
|
449
|
+
}
|
|
117
450
|
// Check for Claude CLI
|
|
118
451
|
const hasClaudeCLI = checkClaudeCLI();
|
|
119
452
|
log('\n' + '─'.repeat(50), colors.blue);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,6BAA6B;AAC7B,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,SAAS,GAAG,CAAC,OAAe,EAAE,QAAgB,MAAM,CAAC,KAAK;IACxD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,qBAAqB;IAC5B,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,cAAc;IACrB,IAAI,CAA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
4
|
+
|
|
5
|
+
Change the git strategy for .sessions/ directory.
|
|
6
|
+
|
|
7
|
+
**Current Strategies:**
|
|
8
|
+
|
|
9
|
+
1. **Hybrid (recommended)**
|
|
10
|
+
- Commits: docs/, plans/, packages/, README.md, WORKSPACE.md
|
|
11
|
+
- Ignores: index.md, archive/, prep/, data/, scratch/
|
|
12
|
+
- Use case: Share architecture/decisions, keep personal notes private
|
|
13
|
+
|
|
14
|
+
2. **Commit all (team-shared)**
|
|
15
|
+
- Commits: Everything except data/, scratch/
|
|
16
|
+
- Ignores: Only temporary data
|
|
17
|
+
- Use case: Full team collaboration, shared session history
|
|
18
|
+
|
|
19
|
+
3. **Ignore all (personal)**
|
|
20
|
+
- Commits: Nothing in .sessions/
|
|
21
|
+
- Ignores: Everything
|
|
22
|
+
- Use case: Solo dev or completely private workflow
|
|
23
|
+
|
|
24
|
+
**Steps:**
|
|
25
|
+
|
|
26
|
+
1. Ask: "Which git strategy do you want?"
|
|
27
|
+
- Show current strategy if detectable from .sessions/.gitignore
|
|
28
|
+
- Options: hybrid, commit, ignore
|
|
29
|
+
|
|
30
|
+
2. Based on choice, update .sessions/.gitignore:
|
|
31
|
+
|
|
32
|
+
**For hybrid:**
|
|
33
|
+
```
|
|
34
|
+
# Personal working notes (not committed)
|
|
35
|
+
index.md
|
|
36
|
+
archive/
|
|
37
|
+
prep/
|
|
38
|
+
|
|
39
|
+
# Temporary data
|
|
40
|
+
data/
|
|
41
|
+
scratch/
|
|
42
|
+
*.tmp
|
|
43
|
+
*.local
|
|
44
|
+
|
|
45
|
+
# Team documentation (committed)
|
|
46
|
+
!docs/
|
|
47
|
+
!plans/
|
|
48
|
+
!packages/
|
|
49
|
+
!README.md
|
|
50
|
+
!WORKSPACE.md
|
|
51
|
+
!.gitignore
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**For commit:**
|
|
55
|
+
```
|
|
56
|
+
# Temporary and local data
|
|
57
|
+
data/
|
|
58
|
+
scratch/
|
|
59
|
+
*.tmp
|
|
60
|
+
*.local
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**For ignore:**
|
|
64
|
+
```
|
|
65
|
+
# Keep all sessions local (not committed)
|
|
66
|
+
# Remove this file if you want to commit sessions to git
|
|
67
|
+
*
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
3. Show what changed:
|
|
71
|
+
- "Changed from [old strategy] to [new strategy]"
|
|
72
|
+
- "Run 'git status .sessions/' to see current state"
|
|
73
|
+
|
|
74
|
+
4. Check if any .sessions/ files are already tracked in git:
|
|
75
|
+
```bash
|
|
76
|
+
git ls-files .sessions/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If files are found AND new strategy is more restrictive:
|
|
80
|
+
- **Switching to "ignore all"**: Warn that previously committed files are still tracked
|
|
81
|
+
- **Switching to "hybrid"**: Warn that personal files (index.md, archive/) are still tracked
|
|
82
|
+
|
|
83
|
+
Provide the command to untrack them:
|
|
84
|
+
```bash
|
|
85
|
+
# For ignore all:
|
|
86
|
+
git rm --cached -r .sessions/
|
|
87
|
+
|
|
88
|
+
# For hybrid (untrack personal files only):
|
|
89
|
+
git rm --cached .sessions/index.md .sessions/archive/ .sessions/prep/
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Important**: This removes files from git tracking but keeps them on disk.
|
|
93
|
+
|
|
94
|
+
Provide two options:
|
|
95
|
+
|
|
96
|
+
**Option A: Use helper script (recommended)**
|
|
97
|
+
```bash
|
|
98
|
+
.claude/scripts/untrack-sessions.sh [ignore|hybrid]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Option B: Manual git command**
|
|
102
|
+
```bash
|
|
103
|
+
git rm --cached -r .sessions/ # For ignore all
|
|
104
|
+
git rm --cached .sessions/index.md ... # For hybrid
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Ask user: "Do you want me to run the helper script now? [y/N]"
|
|
108
|
+
- If yes: Run `.claude/scripts/untrack-sessions.sh [strategy]`, show result
|
|
109
|
+
- If no: Show both options they can run manually
|
|
110
|
+
|
|
111
|
+
5. Remind user to commit the .gitignore change:
|
|
112
|
+
```bash
|
|
113
|
+
git add .sessions/.gitignore
|
|
114
|
+
git commit -m "Change sessions git strategy to [new strategy]"
|
|
115
|
+
```
|
|
@@ -1,16 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create topic-specific documentation
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
Create or update documentation for a specific topic in .sessions/docs/
|
|
2
6
|
|
|
3
7
|
The user will provide a topic name (e.g., "authentication", "api-design", "testing-strategy").
|
|
4
8
|
|
|
5
9
|
Steps:
|
|
6
10
|
1. If .sessions/docs/ doesn't exist, create it first
|
|
7
|
-
2.
|
|
8
|
-
3.
|
|
9
|
-
|
|
11
|
+
2. Ask: "What should be documented about [topic]?"
|
|
12
|
+
3. Launch an Explore agent with:
|
|
13
|
+
"Thoroughly explore the codebase to understand [topic].
|
|
14
|
+
|
|
15
|
+
Focus on:
|
|
16
|
+
- Architecture and patterns
|
|
17
|
+
- Key implementation details
|
|
18
|
+
- Important decisions and trade-offs
|
|
19
|
+
- Critical files and code locations
|
|
20
|
+
|
|
21
|
+
Return a structured summary suitable for documentation."
|
|
22
|
+
|
|
23
|
+
4. Use the agent's findings to create .sessions/docs/<topic>.md with:
|
|
10
24
|
- Overview of the topic
|
|
11
25
|
- Current decisions and rationale
|
|
12
26
|
- Implementation details or patterns
|
|
27
|
+
- Key files and code references (use file:line format)
|
|
13
28
|
- Open questions or considerations
|
|
14
|
-
- Links to relevant code or resources
|
|
15
29
|
|
|
16
|
-
|
|
30
|
+
5. Add reference to this doc in index.md under relevant section
|
|
31
|
+
|
|
32
|
+
Keep documentation scannable with clear headings and bullet points.
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Bash(git:*), Bash(.claude/scripts/*:*)
|
|
3
|
+
description: End session and update context
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Context
|
|
7
|
+
|
|
8
|
+
- Current git status: !`git status --short`
|
|
9
|
+
- Archive recommendation: !`.claude/scripts/should-archive.sh`
|
|
10
|
+
|
|
11
|
+
## Your task
|
|
12
|
+
|
|
13
|
+
Update .sessions/index.md with session accomplishments.
|
|
2
14
|
|
|
3
15
|
Include:
|
|
4
16
|
- Today's date
|
|
@@ -6,4 +18,17 @@ Include:
|
|
|
6
18
|
- Any blockers or open questions
|
|
7
19
|
- Next session priorities
|
|
8
20
|
|
|
9
|
-
|
|
21
|
+
Check the archive recommendation output above.
|
|
22
|
+
|
|
23
|
+
If the script output contains "ARCHIVE_RECOMMENDED":
|
|
24
|
+
- The listed PRs have been merged
|
|
25
|
+
- Ask: "Archive this session's work? [Y/n]"
|
|
26
|
+
- If yes:
|
|
27
|
+
- Move relevant session notes to .sessions/archive/YYYY-MM-DD-<description>.md
|
|
28
|
+
- Remove completed items from index.md
|
|
29
|
+
- Keep ongoing/next work in place
|
|
30
|
+
|
|
31
|
+
If the script output is "NO_ARCHIVE":
|
|
32
|
+
- Skip archiving (no merged PRs detected)
|
|
33
|
+
|
|
34
|
+
Commit changes with a descriptive message about the session.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create implementation plan
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Create or update a plan in .sessions/plans/
|
|
6
|
+
|
|
7
|
+
Steps:
|
|
8
|
+
1. If .sessions/plans/ doesn't exist, create it first
|
|
9
|
+
2. Ask: "What are you planning to implement?"
|
|
10
|
+
3. Launch a Plan agent with:
|
|
11
|
+
"Help design the implementation for [description].
|
|
12
|
+
|
|
13
|
+
Analyze the codebase and provide:
|
|
14
|
+
- Requirements breakdown
|
|
15
|
+
- Architecture decisions and trade-offs
|
|
16
|
+
- Files that need changes (with file:line references)
|
|
17
|
+
- Implementation steps
|
|
18
|
+
- Risks and open questions"
|
|
19
|
+
|
|
20
|
+
4. Create .sessions/plans/YYYY-MM-DD-<name>.md with structured plan:
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
# Plan: [Feature Name]
|
|
24
|
+
**Date**: YYYY-MM-DD
|
|
25
|
+
**Status**: Draft
|
|
26
|
+
|
|
27
|
+
## Goal
|
|
28
|
+
[What we're building and why]
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
- [ ] Requirement 1
|
|
32
|
+
- [ ] Requirement 2
|
|
33
|
+
|
|
34
|
+
## Architecture Decisions
|
|
35
|
+
- **Decision**: Choice made
|
|
36
|
+
- **Rationale**: Why we chose this approach
|
|
37
|
+
- **Trade-offs**: What we're optimizing for
|
|
38
|
+
|
|
39
|
+
## Implementation Steps
|
|
40
|
+
1. [ ] Step 1 (file:line references)
|
|
41
|
+
2. [ ] Step 2 (file:line references)
|
|
42
|
+
|
|
43
|
+
## Risks & Open Questions
|
|
44
|
+
- What we're unsure about
|
|
45
|
+
- What could go wrong
|
|
46
|
+
|
|
47
|
+
## Related
|
|
48
|
+
- Links to issues, PRs, other plans
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
5. Add reference to plan in index.md: "Planning: [Feature] (see plans/YYYY-MM-DD-<name>.md)"
|
|
52
|
+
|
|
53
|
+
Then ask: "Ready to start implementing?"
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
allowed-tools: Bash(gh:*), Bash(linearis:*)
|
|
3
|
+
description: Start a new session
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
Read .sessions/index.md and report when ready.
|
|
2
7
|
|
|
8
|
+
Check if .sessions/WORKSPACE.md exists (don't error if missing). If it exists, mention that monorepo support is active and show detected packages.
|
|
9
|
+
|
|
3
10
|
Summarize:
|
|
4
11
|
- Current state
|
|
5
12
|
- Recent work
|
|
6
13
|
- Next priorities
|
|
7
14
|
|
|
8
|
-
Then ask
|
|
15
|
+
Then ask: "What do you want to work on this session?"
|
|
16
|
+
|
|
17
|
+
**Only fetch external context if user provides a new URL or issue ID:**
|
|
18
|
+
|
|
19
|
+
If user provides a GitHub/Linear URL or issue ID:
|
|
20
|
+
- **GitHub**: gh pr view [URL] --json title,body,state,labels
|
|
21
|
+
- **GitHub**: gh issue view [URL] --json title,body,state,labels
|
|
22
|
+
- **Linear**: linearis issues read [ID] (e.g., DEV-456, GTMENG-304)
|
|
23
|
+
- Summarize the fetched context
|
|
24
|
+
- Store in .sessions/prep/YYYY-MM-DD-topic.md
|
|
25
|
+
- Add reference to index.md
|
|
26
|
+
|
|
27
|
+
Otherwise (continuing work, ad-hoc task, etc.):
|
|
28
|
+
- Proceed with existing session context
|
|
29
|
+
- Session notes are the source of truth for ongoing work
|
|
30
|
+
|
|
31
|
+
Confirm understanding and ask how to proceed.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# should-archive.sh
|
|
4
|
+
# Detects merged PRs referenced in session notes and recommends archiving
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Check if gh CLI is installed
|
|
9
|
+
if ! command -v gh &> /dev/null; then
|
|
10
|
+
echo "NO_ARCHIVE: gh CLI not found (install: brew install gh)"
|
|
11
|
+
exit 0
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
# Check if .sessions/index.md exists
|
|
15
|
+
if [ ! -f ".sessions/index.md" ]; then
|
|
16
|
+
echo "NO_ARCHIVE: .sessions/index.md not found"
|
|
17
|
+
exit 0
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Extract PR numbers from session notes (#xxx format)
|
|
21
|
+
pr_numbers=$(grep -oE '#[0-9]+' .sessions/index.md 2>/dev/null | grep -oE '[0-9]+' | sort -u || true)
|
|
22
|
+
|
|
23
|
+
if [ -z "$pr_numbers" ]; then
|
|
24
|
+
echo "NO_ARCHIVE: No PR references found in session notes"
|
|
25
|
+
exit 0
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
merged_prs=()
|
|
29
|
+
|
|
30
|
+
# Check each PR's status
|
|
31
|
+
for pr in $pr_numbers; do
|
|
32
|
+
# Query PR state, handle errors gracefully
|
|
33
|
+
state=$(gh pr view "$pr" --json state --jq '.state' 2>/dev/null || echo "NOT_FOUND")
|
|
34
|
+
|
|
35
|
+
if [ "$state" = "MERGED" ]; then
|
|
36
|
+
title=$(gh pr view "$pr" --json title --jq '.title' 2>/dev/null || echo "Unknown")
|
|
37
|
+
merged_prs+=("#$pr: $title")
|
|
38
|
+
fi
|
|
39
|
+
done
|
|
40
|
+
|
|
41
|
+
# Output recommendation
|
|
42
|
+
if [ ${#merged_prs[@]} -eq 0 ]; then
|
|
43
|
+
echo "NO_ARCHIVE: No merged PRs found"
|
|
44
|
+
else
|
|
45
|
+
echo "ARCHIVE_RECOMMENDED: Found merged PRs:"
|
|
46
|
+
for pr in "${merged_prs[@]}"; do
|
|
47
|
+
echo " - $pr"
|
|
48
|
+
done
|
|
49
|
+
fi
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# untrack-sessions.sh
|
|
4
|
+
# Helper script to untrack .sessions/ files from git after changing strategy
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
strategy="${1:-}"
|
|
9
|
+
|
|
10
|
+
if [ -z "$strategy" ]; then
|
|
11
|
+
echo "Usage: .claude/scripts/untrack-sessions.sh [ignore|hybrid]"
|
|
12
|
+
echo ""
|
|
13
|
+
echo " ignore - Untrack all .sessions/ files"
|
|
14
|
+
echo " hybrid - Untrack only personal files (index.md, archive/, prep/)"
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# Check if in git repo
|
|
19
|
+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
|
20
|
+
echo "[ERROR] Not in a git repository"
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Check if .sessions/ exists
|
|
25
|
+
if [ ! -d ".sessions" ]; then
|
|
26
|
+
echo "[ERROR] .sessions/ directory not found"
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Check what's currently tracked
|
|
31
|
+
tracked_files=$(git ls-files .sessions/ | wc -l | tr -d ' ')
|
|
32
|
+
|
|
33
|
+
if [ "$tracked_files" -eq 0 ]; then
|
|
34
|
+
echo "[OK] No .sessions/ files are tracked in git"
|
|
35
|
+
exit 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
echo "[INFO] Found $tracked_files tracked files in .sessions/"
|
|
39
|
+
echo ""
|
|
40
|
+
|
|
41
|
+
case "$strategy" in
|
|
42
|
+
ignore)
|
|
43
|
+
echo "Untracking ALL .sessions/ files..."
|
|
44
|
+
git rm --cached -r .sessions/ 2>/dev/null || true
|
|
45
|
+
echo "[OK] All .sessions/ files untracked"
|
|
46
|
+
echo ""
|
|
47
|
+
echo "Files removed from git but kept on disk."
|
|
48
|
+
echo "Run 'git status' to see changes."
|
|
49
|
+
;;
|
|
50
|
+
|
|
51
|
+
hybrid)
|
|
52
|
+
echo "Untracking personal files (index.md, archive/, prep/)..."
|
|
53
|
+
|
|
54
|
+
# Untrack specific files/directories
|
|
55
|
+
git rm --cached .sessions/index.md 2>/dev/null || true
|
|
56
|
+
git rm --cached -r .sessions/archive/ 2>/dev/null || true
|
|
57
|
+
git rm --cached -r .sessions/prep/ 2>/dev/null || true
|
|
58
|
+
git rm --cached -r .sessions/data/ 2>/dev/null || true
|
|
59
|
+
git rm --cached -r .sessions/scratch/ 2>/dev/null || true
|
|
60
|
+
|
|
61
|
+
echo "[OK] Personal files untracked"
|
|
62
|
+
echo ""
|
|
63
|
+
echo "Kept tracked: docs/, plans/, packages/"
|
|
64
|
+
echo "Files removed from git but kept on disk."
|
|
65
|
+
echo "Run 'git status' to see changes."
|
|
66
|
+
;;
|
|
67
|
+
|
|
68
|
+
*)
|
|
69
|
+
echo "[ERROR] Unknown strategy: $strategy"
|
|
70
|
+
echo "Use 'ignore' or 'hybrid'"
|
|
71
|
+
exit 1
|
|
72
|
+
;;
|
|
73
|
+
esac
|
|
74
|
+
|
|
75
|
+
echo ""
|
|
76
|
+
echo "Next steps:"
|
|
77
|
+
echo " 1. Review: git status .sessions/"
|
|
78
|
+
echo " 2. Commit: git commit -m 'Change sessions strategy to $strategy'"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Personal working notes (not committed)
|
|
2
|
+
index.md
|
|
3
|
+
archive/
|
|
4
|
+
prep/
|
|
5
|
+
|
|
6
|
+
# Temporary data
|
|
7
|
+
data/
|
|
8
|
+
scratch/
|
|
9
|
+
*.tmp
|
|
10
|
+
*.local
|
|
11
|
+
|
|
12
|
+
# Team documentation (committed)
|
|
13
|
+
!docs/
|
|
14
|
+
!plans/
|
|
15
|
+
!packages/
|
|
16
|
+
!README.md
|
|
17
|
+
!WORKSPACE.md
|
|
18
|
+
!.gitignore
|
|
@@ -167,15 +167,35 @@ Clean up .sessions/index.md by removing completed items.
|
|
|
167
167
|
|
|
168
168
|
---
|
|
169
169
|
|
|
170
|
+
## Optional Directories
|
|
171
|
+
|
|
172
|
+
The Sessions Directory supports extensions:
|
|
173
|
+
|
|
174
|
+
- `docs/` - Topic-specific documentation (use `/document`)
|
|
175
|
+
- `plans/` - Implementation plans (use `/plan`)
|
|
176
|
+
- `prep/` - Pre-session context gathering (created by `/start-session`)
|
|
177
|
+
- `archive/` - Completed work (use `/end-session` auto-detect)
|
|
178
|
+
- `data/` - Sample/test data for tasks (git-ignored)
|
|
179
|
+
- `scratch/` - Temporary experiments (git-ignored)
|
|
180
|
+
|
|
181
|
+
A `.gitignore` is included to exclude temporary directories.
|
|
182
|
+
|
|
170
183
|
## Customizing
|
|
171
184
|
|
|
172
185
|
This structure is a starting point. Adapt it to your needs:
|
|
173
186
|
|
|
174
|
-
- Add topic-specific docs
|
|
187
|
+
- Add more topic-specific docs in `.sessions/docs/`
|
|
175
188
|
- Create templates for recurring documentation
|
|
176
189
|
- Structure the archive however makes sense for your project
|
|
177
190
|
- Modify slash commands in `.claude/commands/` to match your workflow
|
|
178
191
|
|
|
192
|
+
## Monorepo Support
|
|
193
|
+
|
|
194
|
+
If you're in a monorepo, check for `.sessions/WORKSPACE.md` which provides guidance on:
|
|
195
|
+
- Shared sessions at the root level
|
|
196
|
+
- Package-specific notes in `.sessions/packages/`
|
|
197
|
+
- Cross-package work tracking
|
|
198
|
+
|
|
179
199
|
---
|
|
180
200
|
|
|
181
201
|
## Why This Works
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Workspace Configuration
|
|
2
|
+
|
|
3
|
+
**Detected Monorepo Packages:**
|
|
4
|
+
{{PACKAGES}}
|
|
5
|
+
|
|
6
|
+
## Monorepo Sessions Pattern
|
|
7
|
+
|
|
8
|
+
This repository uses a shared sessions directory at the root level.
|
|
9
|
+
|
|
10
|
+
### Structure
|
|
11
|
+
|
|
12
|
+
- `.sessions/index.md` - Main session context (cross-package work)
|
|
13
|
+
- `.sessions/packages/<name>.md` - Package-specific notes (optional)
|
|
14
|
+
- `.sessions/plans/` - Implementation plans (can span packages)
|
|
15
|
+
- `.sessions/archive/` - Completed work from all packages
|
|
16
|
+
|
|
17
|
+
### Usage
|
|
18
|
+
|
|
19
|
+
**Starting a session:**
|
|
20
|
+
```bash
|
|
21
|
+
/start-session
|
|
22
|
+
# Claude reads root index.md and asks what you're working on
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Working across packages:**
|
|
26
|
+
Reference related work in your session notes:
|
|
27
|
+
```markdown
|
|
28
|
+
## Current Work
|
|
29
|
+
- Working on auth in app-a
|
|
30
|
+
- Related: API changes in app-b (see .sessions/packages/app-b.md)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Ending a session:**
|
|
34
|
+
```bash
|
|
35
|
+
/end-session
|
|
36
|
+
# Updates root index.md with work across all packages
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Package-Specific Notes (Optional)
|
|
40
|
+
|
|
41
|
+
Create `.sessions/packages/<package-name>.md` for detailed package context:
|
|
42
|
+
- Deep technical decisions specific to that package
|
|
43
|
+
- Package-specific architecture notes
|
|
44
|
+
- Dependencies and interactions with other packages
|
|
45
|
+
|
|
46
|
+
The root `index.md` ties everything together at a high level.
|