claude-code-pilot 2.0.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/LICENSE +21 -0
- package/README.md +151 -0
- package/bin/install.js +431 -0
- package/docs/agent-guides/architecture.md +107 -0
- package/ecc/agents/architect.md +211 -0
- package/ecc/agents/code-reviewer.md +237 -0
- package/ecc/agents/doc-updater.md +107 -0
- package/ecc/agents/e2e-runner.md +107 -0
- package/ecc/agents/security-reviewer.md +108 -0
- package/ecc/agents/tdd-guide.md +91 -0
- package/ecc/commands/checkpoint.md +74 -0
- package/ecc/commands/evolve.md +178 -0
- package/ecc/commands/learn.md +70 -0
- package/ecc/commands/model-route.md +26 -0
- package/ecc/commands/quality-gate.md +29 -0
- package/ecc/commands/resume-session.md +155 -0
- package/ecc/commands/save-session.md +275 -0
- package/ecc/commands/sessions.md +305 -0
- package/ecc/commands/verify.md +59 -0
- package/ecc/contexts/dev.md +20 -0
- package/ecc/contexts/research.md +26 -0
- package/ecc/contexts/review.md +22 -0
- package/ecc/examples/CLAUDE.md +100 -0
- package/ecc/examples/django-api-CLAUDE.md +308 -0
- package/ecc/examples/go-microservice-CLAUDE.md +267 -0
- package/ecc/examples/rust-api-CLAUDE.md +285 -0
- package/ecc/examples/saas-nextjs-CLAUDE.md +166 -0
- package/ecc/examples/user-CLAUDE.md +109 -0
- package/ecc/rules/common/agents.md +49 -0
- package/ecc/rules/common/coding-style.md +48 -0
- package/ecc/rules/common/development-workflow.md +37 -0
- package/ecc/rules/common/git-workflow.md +24 -0
- package/ecc/rules/common/hooks.md +30 -0
- package/ecc/rules/common/patterns.md +31 -0
- package/ecc/rules/common/performance.md +55 -0
- package/ecc/rules/common/security.md +29 -0
- package/ecc/rules/common/testing.md +29 -0
- package/ecc/rules/golang/coding-style.md +32 -0
- package/ecc/rules/golang/hooks.md +17 -0
- package/ecc/rules/golang/patterns.md +45 -0
- package/ecc/rules/golang/security.md +34 -0
- package/ecc/rules/golang/testing.md +31 -0
- package/ecc/rules/kotlin/coding-style.md +86 -0
- package/ecc/rules/kotlin/patterns.md +146 -0
- package/ecc/rules/kotlin/security.md +82 -0
- package/ecc/rules/kotlin/testing.md +128 -0
- package/ecc/rules/perl/coding-style.md +46 -0
- package/ecc/rules/perl/hooks.md +22 -0
- package/ecc/rules/perl/patterns.md +76 -0
- package/ecc/rules/perl/security.md +69 -0
- package/ecc/rules/perl/testing.md +54 -0
- package/ecc/rules/php/coding-style.md +35 -0
- package/ecc/rules/php/hooks.md +24 -0
- package/ecc/rules/php/patterns.md +32 -0
- package/ecc/rules/php/security.md +33 -0
- package/ecc/rules/php/testing.md +34 -0
- package/ecc/rules/python/coding-style.md +42 -0
- package/ecc/rules/python/hooks.md +19 -0
- package/ecc/rules/python/patterns.md +39 -0
- package/ecc/rules/python/security.md +30 -0
- package/ecc/rules/python/testing.md +38 -0
- package/ecc/rules/swift/coding-style.md +47 -0
- package/ecc/rules/swift/hooks.md +20 -0
- package/ecc/rules/swift/patterns.md +66 -0
- package/ecc/rules/swift/security.md +33 -0
- package/ecc/rules/swift/testing.md +45 -0
- package/ecc/rules/typescript/coding-style.md +199 -0
- package/ecc/rules/typescript/hooks.md +22 -0
- package/ecc/rules/typescript/patterns.md +52 -0
- package/ecc/rules/typescript/security.md +28 -0
- package/ecc/rules/typescript/testing.md +18 -0
- package/ecc/scripts/hooks/check-hook-enabled.js +12 -0
- package/ecc/scripts/hooks/evaluate-session.js +100 -0
- package/ecc/scripts/hooks/pre-compact.js +48 -0
- package/ecc/scripts/hooks/run-with-flags-shell.sh +32 -0
- package/ecc/scripts/hooks/run-with-flags.js +120 -0
- package/ecc/scripts/hooks/session-end-marker.js +15 -0
- package/ecc/scripts/hooks/session-end.js +258 -0
- package/ecc/scripts/hooks/session-start.js +97 -0
- package/ecc/scripts/hooks/suggest-compact.js +80 -0
- package/ecc/scripts/lib/hook-flags.js +74 -0
- package/ecc/scripts/lib/package-manager.d.ts +119 -0
- package/ecc/scripts/lib/package-manager.js +431 -0
- package/ecc/scripts/lib/project-detect.js +428 -0
- package/ecc/scripts/lib/resolve-formatter.js +185 -0
- package/ecc/scripts/lib/session-aliases.d.ts +136 -0
- package/ecc/scripts/lib/session-aliases.js +481 -0
- package/ecc/scripts/lib/session-manager.d.ts +131 -0
- package/ecc/scripts/lib/session-manager.js +444 -0
- package/ecc/scripts/lib/shell-split.js +86 -0
- package/ecc/scripts/lib/utils.d.ts +183 -0
- package/ecc/scripts/lib/utils.js +543 -0
- package/ecc/skills/continuous-learning-v2/SKILL.md +365 -0
- package/ecc/skills/continuous-learning-v2/agents/observer-loop.sh +144 -0
- package/ecc/skills/continuous-learning-v2/agents/observer.md +198 -0
- package/ecc/skills/continuous-learning-v2/agents/start-observer.sh +194 -0
- package/ecc/skills/continuous-learning-v2/config.json +8 -0
- package/ecc/skills/continuous-learning-v2/hooks/observe.sh +246 -0
- package/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +218 -0
- package/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +1148 -0
- package/ecc/skills/continuous-learning-v2/scripts/test_parse_instinct.py +984 -0
- package/ecc/skills/strategic-compact/SKILL.md +103 -0
- package/ecc/skills/strategic-compact/suggest-compact.sh +54 -0
- package/ecc/skills/verification-loop-SKILL.md +126 -0
- package/gsd/LICENSE +21 -0
- package/gsd/agents/gsd-codebase-mapper.md +772 -0
- package/gsd/agents/gsd-debugger.md +1257 -0
- package/gsd/agents/gsd-executor.md +489 -0
- package/gsd/agents/gsd-integration-checker.md +445 -0
- package/gsd/agents/gsd-nyquist-auditor.md +178 -0
- package/gsd/agents/gsd-phase-researcher.md +555 -0
- package/gsd/agents/gsd-plan-checker.md +708 -0
- package/gsd/agents/gsd-planner.md +1309 -0
- package/gsd/agents/gsd-project-researcher.md +631 -0
- package/gsd/agents/gsd-research-synthesizer.md +249 -0
- package/gsd/agents/gsd-roadmapper.md +652 -0
- package/gsd/agents/gsd-verifier.md +581 -0
- package/gsd/commands-gsd/add-phase.md +43 -0
- package/gsd/commands-gsd/add-tests.md +41 -0
- package/gsd/commands-gsd/add-todo.md +47 -0
- package/gsd/commands-gsd/audit-milestone.md +36 -0
- package/gsd/commands-gsd/check-todos.md +45 -0
- package/gsd/commands-gsd/cleanup.md +18 -0
- package/gsd/commands-gsd/complete-milestone.md +136 -0
- package/gsd/commands-gsd/debug.md +168 -0
- package/gsd/commands-gsd/discuss-phase.md +90 -0
- package/gsd/commands-gsd/execute-phase.md +41 -0
- package/gsd/commands-gsd/health.md +22 -0
- package/gsd/commands-gsd/help.md +22 -0
- package/gsd/commands-gsd/insert-phase.md +32 -0
- package/gsd/commands-gsd/join-discord.md +18 -0
- package/gsd/commands-gsd/list-phase-assumptions.md +46 -0
- package/gsd/commands-gsd/map-codebase.md +71 -0
- package/gsd/commands-gsd/new-milestone.md +44 -0
- package/gsd/commands-gsd/new-project.md +42 -0
- package/gsd/commands-gsd/pause-work.md +38 -0
- package/gsd/commands-gsd/plan-milestone-gaps.md +34 -0
- package/gsd/commands-gsd/plan-phase.md +45 -0
- package/gsd/commands-gsd/progress.md +24 -0
- package/gsd/commands-gsd/quick.md +45 -0
- package/gsd/commands-gsd/reapply-patches.md +123 -0
- package/gsd/commands-gsd/remove-phase.md +31 -0
- package/gsd/commands-gsd/research-phase.md +190 -0
- package/gsd/commands-gsd/resume-work.md +40 -0
- package/gsd/commands-gsd/set-profile.md +34 -0
- package/gsd/commands-gsd/settings.md +36 -0
- package/gsd/commands-gsd/update.md +37 -0
- package/gsd/commands-gsd/validate-phase.md +35 -0
- package/gsd/commands-gsd/verify-work.md +38 -0
- package/gsd/get-shit-done/bin/gsd-tools.cjs +592 -0
- package/gsd/get-shit-done/bin/lib/commands.cjs +548 -0
- package/gsd/get-shit-done/bin/lib/config.cjs +169 -0
- package/gsd/get-shit-done/bin/lib/core.cjs +492 -0
- package/gsd/get-shit-done/bin/lib/frontmatter.cjs +299 -0
- package/gsd/get-shit-done/bin/lib/init.cjs +710 -0
- package/gsd/get-shit-done/bin/lib/milestone.cjs +241 -0
- package/gsd/get-shit-done/bin/lib/phase.cjs +901 -0
- package/gsd/get-shit-done/bin/lib/roadmap.cjs +298 -0
- package/gsd/get-shit-done/bin/lib/state.cjs +721 -0
- package/gsd/get-shit-done/bin/lib/template.cjs +222 -0
- package/gsd/get-shit-done/bin/lib/verify.cjs +820 -0
- package/gsd/get-shit-done/references/checkpoints.md +776 -0
- package/gsd/get-shit-done/references/continuation-format.md +249 -0
- package/gsd/get-shit-done/references/decimal-phase-calculation.md +65 -0
- package/gsd/get-shit-done/references/git-integration.md +248 -0
- package/gsd/get-shit-done/references/git-planning-commit.md +38 -0
- package/gsd/get-shit-done/references/model-profile-resolution.md +34 -0
- package/gsd/get-shit-done/references/model-profiles.md +93 -0
- package/gsd/get-shit-done/references/phase-argument-parsing.md +61 -0
- package/gsd/get-shit-done/references/planning-config.md +200 -0
- package/gsd/get-shit-done/references/questioning.md +162 -0
- package/gsd/get-shit-done/references/tdd.md +263 -0
- package/gsd/get-shit-done/references/ui-brand.md +160 -0
- package/gsd/get-shit-done/references/verification-patterns.md +612 -0
- package/gsd/get-shit-done/templates/DEBUG.md +164 -0
- package/gsd/get-shit-done/templates/UAT.md +247 -0
- package/gsd/get-shit-done/templates/VALIDATION.md +76 -0
- package/gsd/get-shit-done/templates/codebase/architecture.md +255 -0
- package/gsd/get-shit-done/templates/codebase/concerns.md +310 -0
- package/gsd/get-shit-done/templates/codebase/conventions.md +307 -0
- package/gsd/get-shit-done/templates/codebase/integrations.md +280 -0
- package/gsd/get-shit-done/templates/codebase/stack.md +186 -0
- package/gsd/get-shit-done/templates/codebase/structure.md +285 -0
- package/gsd/get-shit-done/templates/codebase/testing.md +480 -0
- package/gsd/get-shit-done/templates/config.json +37 -0
- package/gsd/get-shit-done/templates/context.md +297 -0
- package/gsd/get-shit-done/templates/continue-here.md +78 -0
- package/gsd/get-shit-done/templates/debug-subagent-prompt.md +91 -0
- package/gsd/get-shit-done/templates/discovery.md +146 -0
- package/gsd/get-shit-done/templates/milestone-archive.md +123 -0
- package/gsd/get-shit-done/templates/milestone.md +115 -0
- package/gsd/get-shit-done/templates/phase-prompt.md +569 -0
- package/gsd/get-shit-done/templates/planner-subagent-prompt.md +117 -0
- package/gsd/get-shit-done/templates/project.md +184 -0
- package/gsd/get-shit-done/templates/requirements.md +231 -0
- package/gsd/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
- package/gsd/get-shit-done/templates/research-project/FEATURES.md +147 -0
- package/gsd/get-shit-done/templates/research-project/PITFALLS.md +200 -0
- package/gsd/get-shit-done/templates/research-project/STACK.md +120 -0
- package/gsd/get-shit-done/templates/research-project/SUMMARY.md +170 -0
- package/gsd/get-shit-done/templates/research.md +552 -0
- package/gsd/get-shit-done/templates/retrospective.md +54 -0
- package/gsd/get-shit-done/templates/roadmap.md +202 -0
- package/gsd/get-shit-done/templates/state.md +176 -0
- package/gsd/get-shit-done/templates/summary-complex.md +59 -0
- package/gsd/get-shit-done/templates/summary-minimal.md +41 -0
- package/gsd/get-shit-done/templates/summary-standard.md +48 -0
- package/gsd/get-shit-done/templates/summary.md +248 -0
- package/gsd/get-shit-done/templates/user-setup.md +311 -0
- package/gsd/get-shit-done/templates/verification-report.md +322 -0
- package/gsd/get-shit-done/workflows/add-phase.md +112 -0
- package/gsd/get-shit-done/workflows/add-tests.md +351 -0
- package/gsd/get-shit-done/workflows/add-todo.md +158 -0
- package/gsd/get-shit-done/workflows/audit-milestone.md +332 -0
- package/gsd/get-shit-done/workflows/check-todos.md +177 -0
- package/gsd/get-shit-done/workflows/cleanup.md +152 -0
- package/gsd/get-shit-done/workflows/complete-milestone.md +764 -0
- package/gsd/get-shit-done/workflows/diagnose-issues.md +219 -0
- package/gsd/get-shit-done/workflows/discovery-phase.md +289 -0
- package/gsd/get-shit-done/workflows/discuss-phase.md +676 -0
- package/gsd/get-shit-done/workflows/execute-phase.md +459 -0
- package/gsd/get-shit-done/workflows/execute-plan.md +449 -0
- package/gsd/get-shit-done/workflows/health.md +159 -0
- package/gsd/get-shit-done/workflows/help.md +489 -0
- package/gsd/get-shit-done/workflows/insert-phase.md +130 -0
- package/gsd/get-shit-done/workflows/list-phase-assumptions.md +178 -0
- package/gsd/get-shit-done/workflows/map-codebase.md +316 -0
- package/gsd/get-shit-done/workflows/new-milestone.md +384 -0
- package/gsd/get-shit-done/workflows/new-project.md +1111 -0
- package/gsd/get-shit-done/workflows/pause-work.md +122 -0
- package/gsd/get-shit-done/workflows/plan-milestone-gaps.md +274 -0
- package/gsd/get-shit-done/workflows/plan-phase.md +560 -0
- package/gsd/get-shit-done/workflows/progress.md +382 -0
- package/gsd/get-shit-done/workflows/quick.md +601 -0
- package/gsd/get-shit-done/workflows/remove-phase.md +155 -0
- package/gsd/get-shit-done/workflows/research-phase.md +74 -0
- package/gsd/get-shit-done/workflows/resume-project.md +307 -0
- package/gsd/get-shit-done/workflows/set-profile.md +81 -0
- package/gsd/get-shit-done/workflows/settings.md +214 -0
- package/gsd/get-shit-done/workflows/transition.md +544 -0
- package/gsd/get-shit-done/workflows/update.md +240 -0
- package/gsd/get-shit-done/workflows/validate-phase.md +167 -0
- package/gsd/get-shit-done/workflows/verify-phase.md +243 -0
- package/gsd/get-shit-done/workflows/verify-work.md +583 -0
- package/gsd/hooks/gsd-check-update.js +81 -0
- package/gsd/hooks/gsd-context-monitor.js +141 -0
- package/gsd/hooks/gsd-statusline.js +115 -0
- package/kit/CLAUDE.md +43 -0
- package/kit/commands/kit/update.md +46 -0
- package/kit/commands/setup-refresh.md +50 -0
- package/kit/commands/setup.md +579 -0
- package/kit/commands/tool-guide.md +44 -0
- package/kit/hooks/kit-check-update.js +54 -0
- package/kit/mcp.json +10 -0
- package/kit/rules/code-style.md +24 -0
- package/manifest.json +30 -0
- package/package.json +36 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
# Sessions Command
|
|
2
|
+
|
|
3
|
+
Manage Claude Code session history - list, load, alias, and edit sessions stored in `~/.claude/sessions/`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
`/sessions [list|load|alias|info|help] [options]`
|
|
8
|
+
|
|
9
|
+
## Actions
|
|
10
|
+
|
|
11
|
+
### List Sessions
|
|
12
|
+
|
|
13
|
+
Display all sessions with metadata, filtering, and pagination.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
/sessions # List all sessions (default)
|
|
17
|
+
/sessions list # Same as above
|
|
18
|
+
/sessions list --limit 10 # Show 10 sessions
|
|
19
|
+
/sessions list --date 2026-02-01 # Filter by date
|
|
20
|
+
/sessions list --search abc # Search by session ID
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Script:**
|
|
24
|
+
```bash
|
|
25
|
+
node -e "
|
|
26
|
+
const sm = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-manager');
|
|
27
|
+
const aa = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-aliases');
|
|
28
|
+
|
|
29
|
+
const result = sm.getAllSessions({ limit: 20 });
|
|
30
|
+
const aliases = aa.listAliases();
|
|
31
|
+
const aliasMap = {};
|
|
32
|
+
for (const a of aliases) aliasMap[a.sessionPath] = a.name;
|
|
33
|
+
|
|
34
|
+
console.log('Sessions (showing ' + result.sessions.length + ' of ' + result.total + '):');
|
|
35
|
+
console.log('');
|
|
36
|
+
console.log('ID Date Time Size Lines Alias');
|
|
37
|
+
console.log('────────────────────────────────────────────────────');
|
|
38
|
+
|
|
39
|
+
for (const s of result.sessions) {
|
|
40
|
+
const alias = aliasMap[s.filename] || '';
|
|
41
|
+
const size = sm.getSessionSize(s.sessionPath);
|
|
42
|
+
const stats = sm.getSessionStats(s.sessionPath);
|
|
43
|
+
const id = s.shortId === 'no-id' ? '(none)' : s.shortId.slice(0, 8);
|
|
44
|
+
const time = s.modifiedTime.toTimeString().slice(0, 5);
|
|
45
|
+
|
|
46
|
+
console.log(id.padEnd(8) + ' ' + s.date + ' ' + time + ' ' + size.padEnd(7) + ' ' + String(stats.lineCount).padEnd(5) + ' ' + alias);
|
|
47
|
+
}
|
|
48
|
+
"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Load Session
|
|
52
|
+
|
|
53
|
+
Load and display a session's content (by ID or alias).
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
/sessions load <id|alias> # Load session
|
|
57
|
+
/sessions load 2026-02-01 # By date (for no-id sessions)
|
|
58
|
+
/sessions load a1b2c3d4 # By short ID
|
|
59
|
+
/sessions load my-alias # By alias name
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Script:**
|
|
63
|
+
```bash
|
|
64
|
+
node -e "
|
|
65
|
+
const sm = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-manager');
|
|
66
|
+
const aa = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-aliases');
|
|
67
|
+
const id = process.argv[1];
|
|
68
|
+
|
|
69
|
+
// First try to resolve as alias
|
|
70
|
+
const resolved = aa.resolveAlias(id);
|
|
71
|
+
const sessionId = resolved ? resolved.sessionPath : id;
|
|
72
|
+
|
|
73
|
+
const session = sm.getSessionById(sessionId, true);
|
|
74
|
+
if (!session) {
|
|
75
|
+
console.log('Session not found: ' + id);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const stats = sm.getSessionStats(session.sessionPath);
|
|
80
|
+
const size = sm.getSessionSize(session.sessionPath);
|
|
81
|
+
const aliases = aa.getAliasesForSession(session.filename);
|
|
82
|
+
|
|
83
|
+
console.log('Session: ' + session.filename);
|
|
84
|
+
console.log('Path: ~/.claude/sessions/' + session.filename);
|
|
85
|
+
console.log('');
|
|
86
|
+
console.log('Statistics:');
|
|
87
|
+
console.log(' Lines: ' + stats.lineCount);
|
|
88
|
+
console.log(' Total items: ' + stats.totalItems);
|
|
89
|
+
console.log(' Completed: ' + stats.completedItems);
|
|
90
|
+
console.log(' In progress: ' + stats.inProgressItems);
|
|
91
|
+
console.log(' Size: ' + size);
|
|
92
|
+
console.log('');
|
|
93
|
+
|
|
94
|
+
if (aliases.length > 0) {
|
|
95
|
+
console.log('Aliases: ' + aliases.map(a => a.name).join(', '));
|
|
96
|
+
console.log('');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (session.metadata.title) {
|
|
100
|
+
console.log('Title: ' + session.metadata.title);
|
|
101
|
+
console.log('');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (session.metadata.started) {
|
|
105
|
+
console.log('Started: ' + session.metadata.started);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (session.metadata.lastUpdated) {
|
|
109
|
+
console.log('Last Updated: ' + session.metadata.lastUpdated);
|
|
110
|
+
}
|
|
111
|
+
" "$ARGUMENTS"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Create Alias
|
|
115
|
+
|
|
116
|
+
Create a memorable alias for a session.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
/sessions alias <id> <name> # Create alias
|
|
120
|
+
/sessions alias 2026-02-01 today-work # Create alias named "today-work"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Script:**
|
|
124
|
+
```bash
|
|
125
|
+
node -e "
|
|
126
|
+
const sm = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-manager');
|
|
127
|
+
const aa = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-aliases');
|
|
128
|
+
|
|
129
|
+
const sessionId = process.argv[1];
|
|
130
|
+
const aliasName = process.argv[2];
|
|
131
|
+
|
|
132
|
+
if (!sessionId || !aliasName) {
|
|
133
|
+
console.log('Usage: /sessions alias <id> <name>');
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Get session filename
|
|
138
|
+
const session = sm.getSessionById(sessionId);
|
|
139
|
+
if (!session) {
|
|
140
|
+
console.log('Session not found: ' + sessionId);
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const result = aa.setAlias(aliasName, session.filename);
|
|
145
|
+
if (result.success) {
|
|
146
|
+
console.log('✓ Alias created: ' + aliasName + ' → ' + session.filename);
|
|
147
|
+
} else {
|
|
148
|
+
console.log('✗ Error: ' + result.error);
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
" "$ARGUMENTS"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Remove Alias
|
|
155
|
+
|
|
156
|
+
Delete an existing alias.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
/sessions alias --remove <name> # Remove alias
|
|
160
|
+
/sessions unalias <name> # Same as above
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Script:**
|
|
164
|
+
```bash
|
|
165
|
+
node -e "
|
|
166
|
+
const aa = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-aliases');
|
|
167
|
+
|
|
168
|
+
const aliasName = process.argv[1];
|
|
169
|
+
if (!aliasName) {
|
|
170
|
+
console.log('Usage: /sessions alias --remove <name>');
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const result = aa.deleteAlias(aliasName);
|
|
175
|
+
if (result.success) {
|
|
176
|
+
console.log('✓ Alias removed: ' + aliasName);
|
|
177
|
+
} else {
|
|
178
|
+
console.log('✗ Error: ' + result.error);
|
|
179
|
+
process.exit(1);
|
|
180
|
+
}
|
|
181
|
+
" "$ARGUMENTS"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Session Info
|
|
185
|
+
|
|
186
|
+
Show detailed information about a session.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
/sessions info <id|alias> # Show session details
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Script:**
|
|
193
|
+
```bash
|
|
194
|
+
node -e "
|
|
195
|
+
const sm = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-manager');
|
|
196
|
+
const aa = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-aliases');
|
|
197
|
+
|
|
198
|
+
const id = process.argv[1];
|
|
199
|
+
const resolved = aa.resolveAlias(id);
|
|
200
|
+
const sessionId = resolved ? resolved.sessionPath : id;
|
|
201
|
+
|
|
202
|
+
const session = sm.getSessionById(sessionId, true);
|
|
203
|
+
if (!session) {
|
|
204
|
+
console.log('Session not found: ' + id);
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const stats = sm.getSessionStats(session.sessionPath);
|
|
209
|
+
const size = sm.getSessionSize(session.sessionPath);
|
|
210
|
+
const aliases = aa.getAliasesForSession(session.filename);
|
|
211
|
+
|
|
212
|
+
console.log('Session Information');
|
|
213
|
+
console.log('════════════════════');
|
|
214
|
+
console.log('ID: ' + (session.shortId === 'no-id' ? '(none)' : session.shortId));
|
|
215
|
+
console.log('Filename: ' + session.filename);
|
|
216
|
+
console.log('Date: ' + session.date);
|
|
217
|
+
console.log('Modified: ' + session.modifiedTime.toISOString().slice(0, 19).replace('T', ' '));
|
|
218
|
+
console.log('');
|
|
219
|
+
console.log('Content:');
|
|
220
|
+
console.log(' Lines: ' + stats.lineCount);
|
|
221
|
+
console.log(' Total items: ' + stats.totalItems);
|
|
222
|
+
console.log(' Completed: ' + stats.completedItems);
|
|
223
|
+
console.log(' In progress: ' + stats.inProgressItems);
|
|
224
|
+
console.log(' Size: ' + size);
|
|
225
|
+
if (aliases.length > 0) {
|
|
226
|
+
console.log('Aliases: ' + aliases.map(a => a.name).join(', '));
|
|
227
|
+
}
|
|
228
|
+
" "$ARGUMENTS"
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### List Aliases
|
|
232
|
+
|
|
233
|
+
Show all session aliases.
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
/sessions aliases # List all aliases
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Script:**
|
|
240
|
+
```bash
|
|
241
|
+
node -e "
|
|
242
|
+
const aa = require((process.env.CLAUDE_PLUGIN_ROOT||require('path').join(require('os').homedir(),'.claude'))+'/scripts/lib/session-aliases');
|
|
243
|
+
|
|
244
|
+
const aliases = aa.listAliases();
|
|
245
|
+
console.log('Session Aliases (' + aliases.length + '):');
|
|
246
|
+
console.log('');
|
|
247
|
+
|
|
248
|
+
if (aliases.length === 0) {
|
|
249
|
+
console.log('No aliases found.');
|
|
250
|
+
} else {
|
|
251
|
+
console.log('Name Session File Title');
|
|
252
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
253
|
+
for (const a of aliases) {
|
|
254
|
+
const name = a.name.padEnd(12);
|
|
255
|
+
const file = (a.sessionPath.length > 30 ? a.sessionPath.slice(0, 27) + '...' : a.sessionPath).padEnd(30);
|
|
256
|
+
const title = a.title || '';
|
|
257
|
+
console.log(name + ' ' + file + ' ' + title);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
"
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Arguments
|
|
264
|
+
|
|
265
|
+
$ARGUMENTS:
|
|
266
|
+
- `list [options]` - List sessions
|
|
267
|
+
- `--limit <n>` - Max sessions to show (default: 50)
|
|
268
|
+
- `--date <YYYY-MM-DD>` - Filter by date
|
|
269
|
+
- `--search <pattern>` - Search in session ID
|
|
270
|
+
- `load <id|alias>` - Load session content
|
|
271
|
+
- `alias <id> <name>` - Create alias for session
|
|
272
|
+
- `alias --remove <name>` - Remove alias
|
|
273
|
+
- `unalias <name>` - Same as `--remove`
|
|
274
|
+
- `info <id|alias>` - Show session statistics
|
|
275
|
+
- `aliases` - List all aliases
|
|
276
|
+
- `help` - Show this help
|
|
277
|
+
|
|
278
|
+
## Examples
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
# List all sessions
|
|
282
|
+
/sessions list
|
|
283
|
+
|
|
284
|
+
# Create an alias for today's session
|
|
285
|
+
/sessions alias 2026-02-01 today
|
|
286
|
+
|
|
287
|
+
# Load session by alias
|
|
288
|
+
/sessions load today
|
|
289
|
+
|
|
290
|
+
# Show session info
|
|
291
|
+
/sessions info today
|
|
292
|
+
|
|
293
|
+
# Remove alias
|
|
294
|
+
/sessions alias --remove today
|
|
295
|
+
|
|
296
|
+
# List all aliases
|
|
297
|
+
/sessions aliases
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Notes
|
|
301
|
+
|
|
302
|
+
- Sessions are stored as markdown files in `~/.claude/sessions/`
|
|
303
|
+
- Aliases are stored in `~/.claude/session-aliases.json`
|
|
304
|
+
- Session IDs can be shortened (first 4-8 characters usually unique enough)
|
|
305
|
+
- Use aliases for frequently referenced sessions
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Verification Command
|
|
2
|
+
|
|
3
|
+
Run comprehensive verification on current codebase state.
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
Execute verification in this exact order:
|
|
8
|
+
|
|
9
|
+
1. **Build Check**
|
|
10
|
+
- Run the build command for this project
|
|
11
|
+
- If it fails, report errors and STOP
|
|
12
|
+
|
|
13
|
+
2. **Type Check**
|
|
14
|
+
- Run TypeScript/type checker
|
|
15
|
+
- Report all errors with file:line
|
|
16
|
+
|
|
17
|
+
3. **Lint Check**
|
|
18
|
+
- Run linter
|
|
19
|
+
- Report warnings and errors
|
|
20
|
+
|
|
21
|
+
4. **Test Suite**
|
|
22
|
+
- Run all tests
|
|
23
|
+
- Report pass/fail count
|
|
24
|
+
- Report coverage percentage
|
|
25
|
+
|
|
26
|
+
5. **Console.log Audit**
|
|
27
|
+
- Search for console.log in source files
|
|
28
|
+
- Report locations
|
|
29
|
+
|
|
30
|
+
6. **Git Status**
|
|
31
|
+
- Show uncommitted changes
|
|
32
|
+
- Show files modified since last commit
|
|
33
|
+
|
|
34
|
+
## Output
|
|
35
|
+
|
|
36
|
+
Produce a concise verification report:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
VERIFICATION: [PASS/FAIL]
|
|
40
|
+
|
|
41
|
+
Build: [OK/FAIL]
|
|
42
|
+
Types: [OK/X errors]
|
|
43
|
+
Lint: [OK/X issues]
|
|
44
|
+
Tests: [X/Y passed, Z% coverage]
|
|
45
|
+
Secrets: [OK/X found]
|
|
46
|
+
Logs: [OK/X console.logs]
|
|
47
|
+
|
|
48
|
+
Ready for PR: [YES/NO]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If any critical issues, list them with fix suggestions.
|
|
52
|
+
|
|
53
|
+
## Arguments
|
|
54
|
+
|
|
55
|
+
$ARGUMENTS can be:
|
|
56
|
+
- `quick` - Only build + types
|
|
57
|
+
- `full` - All checks (default)
|
|
58
|
+
- `pre-commit` - Checks relevant for commits
|
|
59
|
+
- `pre-pr` - Full checks plus security scan
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Development Context
|
|
2
|
+
|
|
3
|
+
Mode: Active development
|
|
4
|
+
Focus: Implementation, coding, building features
|
|
5
|
+
|
|
6
|
+
## Behavior
|
|
7
|
+
- Write code first, explain after
|
|
8
|
+
- Prefer working solutions over perfect solutions
|
|
9
|
+
- Run tests after changes
|
|
10
|
+
- Keep commits atomic
|
|
11
|
+
|
|
12
|
+
## Priorities
|
|
13
|
+
1. Get it working
|
|
14
|
+
2. Get it right
|
|
15
|
+
3. Get it clean
|
|
16
|
+
|
|
17
|
+
## Tools to favor
|
|
18
|
+
- Edit, Write for code changes
|
|
19
|
+
- Bash for running tests/builds
|
|
20
|
+
- Grep, Glob for finding code
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Research Context
|
|
2
|
+
|
|
3
|
+
Mode: Exploration, investigation, learning
|
|
4
|
+
Focus: Understanding before acting
|
|
5
|
+
|
|
6
|
+
## Behavior
|
|
7
|
+
- Read widely before concluding
|
|
8
|
+
- Ask clarifying questions
|
|
9
|
+
- Document findings as you go
|
|
10
|
+
- Don't write code until understanding is clear
|
|
11
|
+
|
|
12
|
+
## Research Process
|
|
13
|
+
1. Understand the question
|
|
14
|
+
2. Explore relevant code/docs
|
|
15
|
+
3. Form hypothesis
|
|
16
|
+
4. Verify with evidence
|
|
17
|
+
5. Summarize findings
|
|
18
|
+
|
|
19
|
+
## Tools to favor
|
|
20
|
+
- Read for understanding code
|
|
21
|
+
- Grep, Glob for finding patterns
|
|
22
|
+
- WebSearch, WebFetch for external docs
|
|
23
|
+
- Task with Explore agent for codebase questions
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
Findings first, recommendations second
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Code Review Context
|
|
2
|
+
|
|
3
|
+
Mode: PR review, code analysis
|
|
4
|
+
Focus: Quality, security, maintainability
|
|
5
|
+
|
|
6
|
+
## Behavior
|
|
7
|
+
- Read thoroughly before commenting
|
|
8
|
+
- Prioritize issues by severity (critical > high > medium > low)
|
|
9
|
+
- Suggest fixes, don't just point out problems
|
|
10
|
+
- Check for security vulnerabilities
|
|
11
|
+
|
|
12
|
+
## Review Checklist
|
|
13
|
+
- [ ] Logic errors
|
|
14
|
+
- [ ] Edge cases
|
|
15
|
+
- [ ] Error handling
|
|
16
|
+
- [ ] Security (injection, auth, secrets)
|
|
17
|
+
- [ ] Performance
|
|
18
|
+
- [ ] Readability
|
|
19
|
+
- [ ] Test coverage
|
|
20
|
+
|
|
21
|
+
## Output Format
|
|
22
|
+
Group findings by file, severity first
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Example Project CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This is an example project-level CLAUDE.md file. Place this in your project root.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
[Brief description of your project - what it does, tech stack]
|
|
8
|
+
|
|
9
|
+
## Critical Rules
|
|
10
|
+
|
|
11
|
+
### 1. Code Organization
|
|
12
|
+
|
|
13
|
+
- Many small files over few large files
|
|
14
|
+
- High cohesion, low coupling
|
|
15
|
+
- 200-400 lines typical, 800 max per file
|
|
16
|
+
- Organize by feature/domain, not by type
|
|
17
|
+
|
|
18
|
+
### 2. Code Style
|
|
19
|
+
|
|
20
|
+
- No emojis in code, comments, or documentation
|
|
21
|
+
- Immutability always - never mutate objects or arrays
|
|
22
|
+
- No console.log in production code
|
|
23
|
+
- Proper error handling with try/catch
|
|
24
|
+
- Input validation with Zod or similar
|
|
25
|
+
|
|
26
|
+
### 3. Testing
|
|
27
|
+
|
|
28
|
+
- TDD: Write tests first
|
|
29
|
+
- 80% minimum coverage
|
|
30
|
+
- Unit tests for utilities
|
|
31
|
+
- Integration tests for APIs
|
|
32
|
+
- E2E tests for critical flows
|
|
33
|
+
|
|
34
|
+
### 4. Security
|
|
35
|
+
|
|
36
|
+
- No hardcoded secrets
|
|
37
|
+
- Environment variables for sensitive data
|
|
38
|
+
- Validate all user inputs
|
|
39
|
+
- Parameterized queries only
|
|
40
|
+
- CSRF protection enabled
|
|
41
|
+
|
|
42
|
+
## File Structure
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
src/
|
|
46
|
+
|-- app/ # Next.js app router
|
|
47
|
+
|-- components/ # Reusable UI components
|
|
48
|
+
|-- hooks/ # Custom React hooks
|
|
49
|
+
|-- lib/ # Utility libraries
|
|
50
|
+
|-- types/ # TypeScript definitions
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Key Patterns
|
|
54
|
+
|
|
55
|
+
### API Response Format
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface ApiResponse<T> {
|
|
59
|
+
success: boolean
|
|
60
|
+
data?: T
|
|
61
|
+
error?: string
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Error Handling
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
try {
|
|
69
|
+
const result = await operation()
|
|
70
|
+
return { success: true, data: result }
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error('Operation failed:', error)
|
|
73
|
+
return { success: false, error: 'User-friendly message' }
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Environment Variables
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Required
|
|
81
|
+
DATABASE_URL=
|
|
82
|
+
API_KEY=
|
|
83
|
+
|
|
84
|
+
# Optional
|
|
85
|
+
DEBUG=false
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Available Commands
|
|
89
|
+
|
|
90
|
+
- `/tdd` - Test-driven development workflow
|
|
91
|
+
- `/plan` - Create implementation plan
|
|
92
|
+
- `/code-review` - Review code quality
|
|
93
|
+
- `/build-fix` - Fix build errors
|
|
94
|
+
|
|
95
|
+
## Git Workflow
|
|
96
|
+
|
|
97
|
+
- Conventional commits: `feat:`, `fix:`, `refactor:`, `docs:`, `test:`
|
|
98
|
+
- Never commit to main directly
|
|
99
|
+
- PRs require review
|
|
100
|
+
- All tests must pass before merge
|