@heyai-rules/pilo-masterkit 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/.agent/agents/PILO_MASTER.md +77 -0
  2. package/.agent/agents/architect.md +211 -0
  3. package/.agent/agents/backend-specialist.md +263 -0
  4. package/.agent/agents/build-error-resolver.md +114 -0
  5. package/.agent/agents/chief-of-staff.md +151 -0
  6. package/.agent/agents/code-archaeologist.md +106 -0
  7. package/.agent/agents/code-reviewer.md +237 -0
  8. package/.agent/agents/cpp-build-resolver.md +90 -0
  9. package/.agent/agents/cpp-reviewer.md +72 -0
  10. package/.agent/agents/database-architect.md +226 -0
  11. package/.agent/agents/database-reviewer.md +91 -0
  12. package/.agent/agents/debugger.md +225 -0
  13. package/.agent/agents/devops-engineer.md +242 -0
  14. package/.agent/agents/doc-updater.md +107 -0
  15. package/.agent/agents/docs-lookup.md +68 -0
  16. package/.agent/agents/documentation-writer.md +104 -0
  17. package/.agent/agents/e2e-runner.md +107 -0
  18. package/.agent/agents/explorer-agent.md +73 -0
  19. package/.agent/agents/flutter-reviewer.md +243 -0
  20. package/.agent/agents/frontend-specialist.md +593 -0
  21. package/.agent/agents/game-developer.md +162 -0
  22. package/.agent/agents/go-build-resolver.md +94 -0
  23. package/.agent/agents/go-reviewer.md +76 -0
  24. package/.agent/agents/harness-optimizer.md +35 -0
  25. package/.agent/agents/java-build-resolver.md +153 -0
  26. package/.agent/agents/java-reviewer.md +92 -0
  27. package/.agent/agents/kotlin-build-resolver.md +118 -0
  28. package/.agent/agents/kotlin-reviewer.md +159 -0
  29. package/.agent/agents/loop-operator.md +36 -0
  30. package/.agent/agents/mobile-developer.md +377 -0
  31. package/.agent/agents/orchestrator.md +416 -0
  32. package/.agent/agents/penetration-tester.md +188 -0
  33. package/.agent/agents/performance-optimizer.md +187 -0
  34. package/.agent/agents/planner.md +212 -0
  35. package/.agent/agents/product-manager.md +112 -0
  36. package/.agent/agents/product-owner.md +95 -0
  37. package/.agent/agents/project-planner.md +406 -0
  38. package/.agent/agents/python-reviewer.md +98 -0
  39. package/.agent/agents/pytorch-build-resolver.md +120 -0
  40. package/.agent/agents/qa-automation-engineer.md +103 -0
  41. package/.agent/agents/refactor-cleaner.md +85 -0
  42. package/.agent/agents/rust-build-resolver.md +148 -0
  43. package/.agent/agents/rust-reviewer.md +94 -0
  44. package/.agent/agents/security-auditor.md +170 -0
  45. package/.agent/agents/security-reviewer.md +108 -0
  46. package/.agent/agents/seo-specialist.md +111 -0
  47. package/.agent/agents/tdd-guide.md +91 -0
  48. package/.agent/agents/test-engineer.md +158 -0
  49. package/.agent/agents/typescript-reviewer.md +112 -0
  50. package/.agent/rules/ARCHITECTURAL_BLUEPRINTS.md +62 -0
  51. package/.agent/rules/CODE_CRAFTSMANSHIP.md +69 -0
  52. package/.agent/rules/CORE_RULES.md +72 -0
  53. package/.agent/rules/PROJECT_MAP.md +58 -0
  54. package/.agent/rules/QUALITY_ASSURANCE.md +54 -0
  55. package/.agent/rules/SECURITY_ARMOR.md +44 -0
  56. package/.agent/rules/VERSION_ORCHESTRATION.md +64 -0
  57. package/.agent/rules/WORKFLOW_ORCHESTRATION.md +55 -0
  58. package/.agent/scripts/auto_preview.py +148 -0
  59. package/.agent/scripts/checklist.py +217 -0
  60. package/.agent/scripts/session_manager.py +120 -0
  61. package/.agent/scripts/verify_all.py +327 -0
  62. package/.agent/skills/api-patterns/SKILL.md +81 -0
  63. package/.agent/skills/api-patterns/api-style.md +42 -0
  64. package/.agent/skills/api-patterns/auth.md +24 -0
  65. package/.agent/skills/api-patterns/documentation.md +26 -0
  66. package/.agent/skills/api-patterns/graphql.md +41 -0
  67. package/.agent/skills/api-patterns/rate-limiting.md +31 -0
  68. package/.agent/skills/api-patterns/response.md +37 -0
  69. package/.agent/skills/api-patterns/rest.md +40 -0
  70. package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
  71. package/.agent/skills/api-patterns/security-testing.md +122 -0
  72. package/.agent/skills/api-patterns/trpc.md +41 -0
  73. package/.agent/skills/api-patterns/versioning.md +22 -0
  74. package/.agent/skills/app-builder/SKILL.md +75 -0
  75. package/.agent/skills/app-builder/agent-coordination.md +71 -0
  76. package/.agent/skills/app-builder/feature-building.md +53 -0
  77. package/.agent/skills/app-builder/project-detection.md +34 -0
  78. package/.agent/skills/app-builder/scaffolding.md +118 -0
  79. package/.agent/skills/app-builder/tech-stack.md +41 -0
  80. package/.agent/skills/app-builder/templates/SKILL.md +39 -0
  81. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  82. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  83. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  84. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  85. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
  86. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  87. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  88. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
  89. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
  90. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
  91. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
  92. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  93. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
  94. package/.agent/skills/architecture/SKILL.md +55 -0
  95. package/.agent/skills/architecture/context-discovery.md +43 -0
  96. package/.agent/skills/architecture/examples.md +94 -0
  97. package/.agent/skills/architecture/pattern-selection.md +68 -0
  98. package/.agent/skills/architecture/patterns-reference.md +50 -0
  99. package/.agent/skills/architecture/trade-off-analysis.md +77 -0
  100. package/.agent/skills/bash-linux/SKILL.md +199 -0
  101. package/.agent/skills/behavioral-modes/SKILL.md +242 -0
  102. package/.agent/skills/brainstorming/SKILL.md +163 -0
  103. package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
  104. package/.agent/skills/clean-code/SKILL.md +201 -0
  105. package/.agent/skills/code-review-checklist/SKILL.md +109 -0
  106. package/.agent/skills/database-design/SKILL.md +52 -0
  107. package/.agent/skills/database-design/database-selection.md +43 -0
  108. package/.agent/skills/database-design/indexing.md +39 -0
  109. package/.agent/skills/database-design/migrations.md +48 -0
  110. package/.agent/skills/database-design/optimization.md +36 -0
  111. package/.agent/skills/database-design/orm-selection.md +30 -0
  112. package/.agent/skills/database-design/schema-design.md +56 -0
  113. package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
  114. package/.agent/skills/deployment-procedures/SKILL.md +241 -0
  115. package/.agent/skills/doc.md +177 -0
  116. package/.agent/skills/documentation-templates/SKILL.md +194 -0
  117. package/.agent/skills/frontend-design/SKILL.md +452 -0
  118. package/.agent/skills/frontend-design/animation-guide.md +331 -0
  119. package/.agent/skills/frontend-design/color-system.md +311 -0
  120. package/.agent/skills/frontend-design/decision-trees.md +418 -0
  121. package/.agent/skills/frontend-design/motion-graphics.md +306 -0
  122. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
  123. package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
  124. package/.agent/skills/frontend-design/typography-system.md +345 -0
  125. package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
  126. package/.agent/skills/frontend-design/visual-effects.md +383 -0
  127. package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
  128. package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
  129. package/.agent/skills/game-development/SKILL.md +167 -0
  130. package/.agent/skills/game-development/game-art/SKILL.md +185 -0
  131. package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
  132. package/.agent/skills/game-development/game-design/SKILL.md +129 -0
  133. package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
  134. package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
  135. package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
  136. package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
  137. package/.agent/skills/game-development/web-games/SKILL.md +150 -0
  138. package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
  139. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
  140. package/.agent/skills/i18n-localization/SKILL.md +154 -0
  141. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
  142. package/.agent/skills/intelligent-routing/SKILL.md +335 -0
  143. package/.agent/skills/lint-and-validate/SKILL.md +45 -0
  144. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  145. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
  146. package/.agent/skills/mcp-builder/SKILL.md +176 -0
  147. package/.agent/skills/mobile-design/SKILL.md +394 -0
  148. package/.agent/skills/mobile-design/decision-trees.md +516 -0
  149. package/.agent/skills/mobile-design/mobile-backend.md +491 -0
  150. package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
  151. package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
  152. package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
  153. package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
  154. package/.agent/skills/mobile-design/mobile-performance.md +767 -0
  155. package/.agent/skills/mobile-design/mobile-testing.md +356 -0
  156. package/.agent/skills/mobile-design/mobile-typography.md +433 -0
  157. package/.agent/skills/mobile-design/platform-android.md +666 -0
  158. package/.agent/skills/mobile-design/platform-ios.md +561 -0
  159. package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
  160. package/.agent/skills/mobile-design/touch-psychology.md +537 -0
  161. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
  162. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  163. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  164. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  165. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  166. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  167. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  168. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  169. package/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
  170. package/.agent/skills/nextjs-react-expert/SKILL.md +293 -0
  171. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  172. package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
  173. package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
  174. package/.agent/skills/parallel-agents/SKILL.md +175 -0
  175. package/.agent/skills/performance-profiling/SKILL.md +143 -0
  176. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
  177. package/.agent/skills/plan-writing/SKILL.md +152 -0
  178. package/.agent/skills/powershell-windows/SKILL.md +167 -0
  179. package/.agent/skills/python-patterns/SKILL.md +441 -0
  180. package/.agent/skills/red-team-tactics/SKILL.md +199 -0
  181. package/.agent/skills/rust-pro/SKILL.md +176 -0
  182. package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
  183. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  184. package/.agent/skills/server-management/SKILL.md +161 -0
  185. package/.agent/skills/systematic-debugging/SKILL.md +109 -0
  186. package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
  187. package/.agent/skills/tdd-workflow/SKILL.md +149 -0
  188. package/.agent/skills/testing-patterns/SKILL.md +178 -0
  189. package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
  190. package/.agent/skills/ui-ux-pro-max/SKILL.md +292 -0
  191. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  192. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  193. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  194. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  195. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  196. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  197. package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  198. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  199. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  200. package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  201. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  202. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  203. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  204. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  205. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  206. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  207. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  208. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  209. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  210. package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
  211. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  212. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  213. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  214. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  215. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
  216. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
  217. package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/search.cpython-314.pyc +0 -0
  218. package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
  219. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  220. package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
  221. package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
  222. package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
  223. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  224. package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
  225. package/.agent/skills/webapp-testing/SKILL.md +187 -0
  226. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
  227. package/.agent/tasks/lessons.md +40 -0
  228. package/.agent/tasks/todo.md +33 -0
  229. package/.agent/workflows/aside.md +164 -0
  230. package/.agent/workflows/brainstorm.md +113 -0
  231. package/.agent/workflows/build-fix.md +62 -0
  232. package/.agent/workflows/checkpoint.md +74 -0
  233. package/.agent/workflows/claw.md +51 -0
  234. package/.agent/workflows/code-review.md +40 -0
  235. package/.agent/workflows/context-budget.md +29 -0
  236. package/.agent/workflows/cpp-build.md +173 -0
  237. package/.agent/workflows/cpp-review.md +132 -0
  238. package/.agent/workflows/cpp-test.md +251 -0
  239. package/.agent/workflows/create.md +59 -0
  240. package/.agent/workflows/debug.md +103 -0
  241. package/.agent/workflows/deploy.md +176 -0
  242. package/.agent/workflows/devfleet.md +92 -0
  243. package/.agent/workflows/docs.md +31 -0
  244. package/.agent/workflows/e2e.md +365 -0
  245. package/.agent/workflows/enhance.md +63 -0
  246. package/.agent/workflows/eval.md +120 -0
  247. package/.agent/workflows/evolve.md +178 -0
  248. package/.agent/workflows/go-build.md +183 -0
  249. package/.agent/workflows/go-review.md +148 -0
  250. package/.agent/workflows/go-test.md +268 -0
  251. package/.agent/workflows/gradle-build.md +70 -0
  252. package/.agent/workflows/harness-audit.md +71 -0
  253. package/.agent/workflows/init-docs.md +46 -0
  254. package/.agent/workflows/instinct-export.md +66 -0
  255. package/.agent/workflows/instinct-import.md +114 -0
  256. package/.agent/workflows/instinct-status.md +59 -0
  257. package/.agent/workflows/kotlin-build.md +174 -0
  258. package/.agent/workflows/kotlin-review.md +140 -0
  259. package/.agent/workflows/kotlin-test.md +312 -0
  260. package/.agent/workflows/learn-eval.md +116 -0
  261. package/.agent/workflows/learn.md +70 -0
  262. package/.agent/workflows/loop-start.md +32 -0
  263. package/.agent/workflows/loop-status.md +24 -0
  264. package/.agent/workflows/model-route.md +26 -0
  265. package/.agent/workflows/multi-backend.md +158 -0
  266. package/.agent/workflows/multi-execute.md +315 -0
  267. package/.agent/workflows/multi-frontend.md +158 -0
  268. package/.agent/workflows/multi-plan.md +268 -0
  269. package/.agent/workflows/multi-workflow.md +191 -0
  270. package/.agent/workflows/orchestrate.md +231 -0
  271. package/.agent/workflows/plan.md +115 -0
  272. package/.agent/workflows/pm2.md +272 -0
  273. package/.agent/workflows/preview.md +81 -0
  274. package/.agent/workflows/projects.md +39 -0
  275. package/.agent/workflows/promote.md +41 -0
  276. package/.agent/workflows/prompt-optimize.md +38 -0
  277. package/.agent/workflows/prune.md +31 -0
  278. package/.agent/workflows/python-review.md +297 -0
  279. package/.agent/workflows/quality-gate.md +29 -0
  280. package/.agent/workflows/refactor-clean.md +80 -0
  281. package/.agent/workflows/resume-session.md +156 -0
  282. package/.agent/workflows/rules-distill.md +11 -0
  283. package/.agent/workflows/rust-build.md +187 -0
  284. package/.agent/workflows/rust-review.md +142 -0
  285. package/.agent/workflows/rust-test.md +308 -0
  286. package/.agent/workflows/save-session.md +275 -0
  287. package/.agent/workflows/sessions.md +333 -0
  288. package/.agent/workflows/setup-pm.md +80 -0
  289. package/.agent/workflows/skill-create.md +174 -0
  290. package/.agent/workflows/skill-health.md +54 -0
  291. package/.agent/workflows/status.md +86 -0
  292. package/.agent/workflows/tdd.md +328 -0
  293. package/.agent/workflows/test-coverage.md +69 -0
  294. package/.agent/workflows/test.md +144 -0
  295. package/.agent/workflows/ui-ux-pro-max.md +296 -0
  296. package/.agent/workflows/update-codemaps.md +72 -0
  297. package/.agent/workflows/update-docs.md +84 -0
  298. package/.agent/workflows/verify.md +59 -0
  299. package/LICENSE +176 -0
  300. package/README.md +136 -0
  301. package/RELEASE.md +36 -0
  302. package/package.json +79 -0
  303. package/scripts/release-check.js +55 -0
  304. package/src/bin/cli.js +78 -0
  305. package/src/lib/installer.js +140 -0
@@ -0,0 +1,275 @@
1
+ ---
2
+ description: Save current session state to a dated file in ~/.claude/session-data/ so work can be resumed in a future session with full context.
3
+ ---
4
+
5
+ # Save Session Command
6
+
7
+ Capture everything that happened in this session — what was built, what worked, what failed, what's left — and write it to a dated file so the next session can pick up exactly where this one left off.
8
+
9
+ ## When to Use
10
+
11
+ - End of a work session before closing Claude Code
12
+ - Before hitting context limits (run this first, then start a fresh session)
13
+ - After solving a complex problem you want to remember
14
+ - Any time you need to hand off context to a future session
15
+
16
+ ## Process
17
+
18
+ ### Step 1: Gather context
19
+
20
+ Before writing the file, collect:
21
+
22
+ - Read all files modified during this session (use git diff or recall from conversation)
23
+ - Review what was discussed, attempted, and decided
24
+ - Note any errors encountered and how they were resolved (or not)
25
+ - Check current test/build status if relevant
26
+
27
+ ### Step 2: Create the sessions folder if it doesn't exist
28
+
29
+ Create the canonical sessions folder in the user's Claude home directory:
30
+
31
+ ```bash
32
+ mkdir -p ~/.claude/session-data
33
+ ```
34
+
35
+ ### Step 3: Write the session file
36
+
37
+ Create `~/.claude/session-data/YYYY-MM-DD-<short-id>-session.tmp`, using today's actual date and a short-id that satisfies the rules enforced by `SESSION_FILENAME_REGEX` in `session-manager.js`:
38
+
39
+ - Compatibility characters: letters `a-z` / `A-Z`, digits `0-9`, hyphens `-`, underscores `_`
40
+ - Compatibility minimum length: 1 character
41
+ - Recommended style for new files: lowercase letters, digits, and hyphens with 8+ characters to avoid collisions
42
+
43
+ Valid examples: `abc123de`, `a1b2c3d4`, `frontend-worktree-1`, `ChezMoi_2`
44
+ Avoid for new files: `A`, `test_id1`, `ABC123de`
45
+
46
+ Full valid filename example: `2024-01-15-abc123de-session.tmp`
47
+
48
+ The legacy filename `YYYY-MM-DD-session.tmp` is still valid, but new session files should prefer the short-id form to avoid same-day collisions.
49
+
50
+ ### Step 4: Populate the file with all sections below
51
+
52
+ Write every section honestly. Do not skip sections — write "Nothing yet" or "N/A" if a section genuinely has no content. An incomplete file is worse than an honest empty section.
53
+
54
+ ### Step 5: Show the file to the user
55
+
56
+ After writing, display the full contents and ask:
57
+
58
+ ```
59
+ Session saved to [actual resolved path to the session file]
60
+
61
+ Does this look accurate? Anything to correct or add before we close?
62
+ ```
63
+
64
+ Wait for confirmation. Make edits if requested.
65
+
66
+ ---
67
+
68
+ ## Session File Format
69
+
70
+ ```markdown
71
+ # Session: YYYY-MM-DD
72
+
73
+ **Started:** [approximate time if known]
74
+ **Last Updated:** [current time]
75
+ **Project:** [project name or path]
76
+ **Topic:** [one-line summary of what this session was about]
77
+
78
+ ---
79
+
80
+ ## What We Are Building
81
+
82
+ [1-3 paragraphs describing the feature, bug fix, or task. Include enough
83
+ context that someone with zero memory of this session can understand the goal.
84
+ Include: what it does, why it's needed, how it fits into the larger system.]
85
+
86
+ ---
87
+
88
+ ## What WORKED (with evidence)
89
+
90
+ [List only things that are confirmed working. For each item include WHY you
91
+ know it works — test passed, ran in browser, Postman returned 200, etc.
92
+ Without evidence, move it to "Not Tried Yet" instead.]
93
+
94
+ - **[thing that works]** — confirmed by: [specific evidence]
95
+ - **[thing that works]** — confirmed by: [specific evidence]
96
+
97
+ If nothing is confirmed working yet: "Nothing confirmed working yet — all approaches still in progress or untested."
98
+
99
+ ---
100
+
101
+ ## What Did NOT Work (and why)
102
+
103
+ [This is the most important section. List every approach tried that failed.
104
+ For each failure write the EXACT reason so the next session doesn't retry it.
105
+ Be specific: "threw X error because Y" is useful. "didn't work" is not.]
106
+
107
+ - **[approach tried]** — failed because: [exact reason / error message]
108
+ - **[approach tried]** — failed because: [exact reason / error message]
109
+
110
+ If nothing failed: "No failed approaches yet."
111
+
112
+ ---
113
+
114
+ ## What Has NOT Been Tried Yet
115
+
116
+ [Approaches that seem promising but haven't been attempted. Ideas from the
117
+ conversation. Alternative solutions worth exploring. Be specific enough that
118
+ the next session knows exactly what to try.]
119
+
120
+ - [approach / idea]
121
+ - [approach / idea]
122
+
123
+ If nothing is queued: "No specific untried approaches identified."
124
+
125
+ ---
126
+
127
+ ## Current State of Files
128
+
129
+ [Every file touched this session. Be precise about what state each file is in.]
130
+
131
+ | File | Status | Notes |
132
+ | ----------------- | -------------- | -------------------------- |
133
+ | `path/to/file.ts` | ✅ Complete | [what it does] |
134
+ | `path/to/file.ts` | 🔄 In Progress | [what's done, what's left] |
135
+ | `path/to/file.ts` | ❌ Broken | [what's wrong] |
136
+ | `path/to/file.ts` | 🗒️ Not Started | [planned but not touched] |
137
+
138
+ If no files were touched: "No files modified this session."
139
+
140
+ ---
141
+
142
+ ## Decisions Made
143
+
144
+ [Architecture choices, tradeoffs accepted, approaches chosen and why.
145
+ These prevent the next session from relitigating settled decisions.]
146
+
147
+ - **[decision]** — reason: [why this was chosen over alternatives]
148
+
149
+ If no significant decisions: "No major decisions made this session."
150
+
151
+ ---
152
+
153
+ ## Blockers & Open Questions
154
+
155
+ [Anything unresolved that the next session needs to address or investigate.
156
+ Questions that came up but weren't answered. External dependencies waiting on.]
157
+
158
+ - [blocker / open question]
159
+
160
+ If none: "No active blockers."
161
+
162
+ ---
163
+
164
+ ## Exact Next Step
165
+
166
+ [If known: The single most important thing to do when resuming. Be precise
167
+ enough that resuming requires zero thinking about where to start.]
168
+
169
+ [If not known: "Next step not determined — review 'What Has NOT Been Tried Yet'
170
+ and 'Blockers' sections to decide on direction before starting."]
171
+
172
+ ---
173
+
174
+ ## Environment & Setup Notes
175
+
176
+ [Only fill this if relevant — commands needed to run the project, env vars
177
+ required, services that need to be running, etc. Skip if standard setup.]
178
+
179
+ [If none: omit this section entirely.]
180
+ ```
181
+
182
+ ---
183
+
184
+ ## Example Output
185
+
186
+ ```markdown
187
+ # Session: 2024-01-15
188
+
189
+ **Started:** ~2pm
190
+ **Last Updated:** 5:30pm
191
+ **Project:** my-app
192
+ **Topic:** Building JWT authentication with httpOnly cookies
193
+
194
+ ---
195
+
196
+ ## What We Are Building
197
+
198
+ User authentication system for the Next.js app. Users register with email/password,
199
+ receive a JWT stored in an httpOnly cookie (not localStorage), and protected routes
200
+ check for a valid token via middleware. The goal is session persistence across browser
201
+ refreshes without exposing the token to JavaScript.
202
+
203
+ ---
204
+
205
+ ## What WORKED (with evidence)
206
+
207
+ - **`/api/auth/register` endpoint** — confirmed by: Postman POST returns 200 with user
208
+ object, row visible in Supabase dashboard, bcrypt hash stored correctly
209
+ - **JWT generation in `lib/auth.ts`** — confirmed by: unit test passes
210
+ (`npm test -- auth.test.ts`), decoded token at jwt.io shows correct payload
211
+ - **Password hashing** — confirmed by: `bcrypt.compare()` returns true in test
212
+
213
+ ---
214
+
215
+ ## What Did NOT Work (and why)
216
+
217
+ - **Next-Auth library** — failed because: conflicts with our custom Prisma adapter,
218
+ threw "Cannot use adapter with credentials provider in this configuration" on every
219
+ request. Not worth debugging — too opinionated for our setup.
220
+ - **Storing JWT in localStorage** — failed because: SSR renders happen before
221
+ localStorage is available, caused React hydration mismatch error on every page load.
222
+ This approach is fundamentally incompatible with Next.js SSR.
223
+
224
+ ---
225
+
226
+ ## What Has NOT Been Tried Yet
227
+
228
+ - Store JWT as httpOnly cookie in the login route response (most likely solution)
229
+ - Use `cookies()` from `next/headers` to read token in server components
230
+ - Write middleware.ts to protect routes by checking cookie existence
231
+
232
+ ---
233
+
234
+ ## Current State of Files
235
+
236
+ | File | Status | Notes |
237
+ | -------------------------------- | -------------- | ----------------------------------------------- |
238
+ | `app/api/auth/register/route.ts` | ✅ Complete | Works, tested |
239
+ | `app/api/auth/login/route.ts` | 🔄 In Progress | Token generates but not setting cookie yet |
240
+ | `lib/auth.ts` | ✅ Complete | JWT helpers, all tested |
241
+ | `middleware.ts` | 🗒️ Not Started | Route protection, needs cookie read logic first |
242
+ | `app/login/page.tsx` | 🗒️ Not Started | UI not started |
243
+
244
+ ---
245
+
246
+ ## Decisions Made
247
+
248
+ - **httpOnly cookie over localStorage** — reason: prevents XSS token theft, works with SSR
249
+ - **Custom auth over Next-Auth** — reason: Next-Auth conflicts with our Prisma setup, not worth the fight
250
+
251
+ ---
252
+
253
+ ## Blockers & Open Questions
254
+
255
+ - Does `cookies().set()` work inside a Route Handler or only in Server Actions? Need to verify.
256
+
257
+ ---
258
+
259
+ ## Exact Next Step
260
+
261
+ In `app/api/auth/login/route.ts`, after generating the JWT, set it as an httpOnly
262
+ cookie using `cookies().set('token', jwt, { httpOnly: true, secure: true, sameSite: 'strict' })`.
263
+ Then test with Postman — the response should include a `Set-Cookie` header.
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Notes
269
+
270
+ - Each session gets its own file — never append to a previous session's file
271
+ - The "What Did NOT Work" section is the most critical — future sessions will blindly retry failed approaches without it
272
+ - If the user asks to save mid-session (not just at the end), save what's known so far and mark in-progress items clearly
273
+ - The file is meant to be read by Claude at the start of the next session via `/resume-session`
274
+ - Use the canonical global session store: `~/.claude/session-data/`
275
+ - Prefer the short-id filename form (`YYYY-MM-DD-<short-id>-session.tmp`) for any new session file
@@ -0,0 +1,333 @@
1
+ ---
2
+ description: Manage Claude Code session history, aliases, and session metadata.
3
+ ---
4
+
5
+ # Sessions Command
6
+
7
+ Manage Claude Code session history - list, load, alias, and edit sessions stored in `~/.claude/session-data/` with legacy reads from `~/.claude/sessions/`.
8
+
9
+ ## Usage
10
+
11
+ `/sessions [list|load|alias|info|help] [options]`
12
+
13
+ ## Actions
14
+
15
+ ### List Sessions
16
+
17
+ Display all sessions with metadata, filtering, and pagination.
18
+
19
+ Use `/sessions info` when you need operator-surface context for a swarm: branch, worktree path, and session recency.
20
+
21
+ ```bash
22
+ /sessions # List all sessions (default)
23
+ /sessions list # Same as above
24
+ /sessions list --limit 10 # Show 10 sessions
25
+ /sessions list --date 2026-02-01 # Filter by date
26
+ /sessions list --search abc # Search by session ID
27
+ ```
28
+
29
+ **Script:**
30
+ ```bash
31
+ node -e "
32
+ const sm = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-manager');
33
+ const aa = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-aliases');
34
+ const path = require('path');
35
+
36
+ const result = sm.getAllSessions({ limit: 20 });
37
+ const aliases = aa.listAliases();
38
+ const aliasMap = {};
39
+ for (const a of aliases) aliasMap[a.sessionPath] = a.name;
40
+
41
+ console.log('Sessions (showing ' + result.sessions.length + ' of ' + result.total + '):');
42
+ console.log('');
43
+ console.log('ID Date Time Branch Worktree Alias');
44
+ console.log('────────────────────────────────────────────────────────────────────');
45
+
46
+ for (const s of result.sessions) {
47
+ const alias = aliasMap[s.filename] || '';
48
+ const metadata = sm.parseSessionMetadata(sm.getSessionContent(s.sessionPath));
49
+ const id = s.shortId === 'no-id' ? '(none)' : s.shortId.slice(0, 8);
50
+ const time = s.modifiedTime.toTimeString().slice(0, 5);
51
+ const branch = (metadata.branch || '-').slice(0, 12);
52
+ const worktree = metadata.worktree ? path.basename(metadata.worktree).slice(0, 18) : '-';
53
+
54
+ console.log(id.padEnd(8) + ' ' + s.date + ' ' + time + ' ' + branch.padEnd(12) + ' ' + worktree.padEnd(18) + ' ' + alias);
55
+ }
56
+ "
57
+ ```
58
+
59
+ ### Load Session
60
+
61
+ Load and display a session's content (by ID or alias).
62
+
63
+ ```bash
64
+ /sessions load <id|alias> # Load session
65
+ /sessions load 2026-02-01 # By date (for no-id sessions)
66
+ /sessions load a1b2c3d4 # By short ID
67
+ /sessions load my-alias # By alias name
68
+ ```
69
+
70
+ **Script:**
71
+ ```bash
72
+ node -e "
73
+ const sm = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-manager');
74
+ const aa = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-aliases');
75
+ const id = process.argv[1];
76
+
77
+ // First try to resolve as alias
78
+ const resolved = aa.resolveAlias(id);
79
+ const sessionId = resolved ? resolved.sessionPath : id;
80
+
81
+ const session = sm.getSessionById(sessionId, true);
82
+ if (!session) {
83
+ console.log('Session not found: ' + id);
84
+ process.exit(1);
85
+ }
86
+
87
+ const stats = sm.getSessionStats(session.sessionPath);
88
+ const size = sm.getSessionSize(session.sessionPath);
89
+ const aliases = aa.getAliasesForSession(session.filename);
90
+
91
+ console.log('Session: ' + session.filename);
92
+ console.log('Path: ' + session.sessionPath);
93
+ console.log('');
94
+ console.log('Statistics:');
95
+ console.log(' Lines: ' + stats.lineCount);
96
+ console.log(' Total items: ' + stats.totalItems);
97
+ console.log(' Completed: ' + stats.completedItems);
98
+ console.log(' In progress: ' + stats.inProgressItems);
99
+ console.log(' Size: ' + size);
100
+ console.log('');
101
+
102
+ if (aliases.length > 0) {
103
+ console.log('Aliases: ' + aliases.map(a => a.name).join(', '));
104
+ console.log('');
105
+ }
106
+
107
+ if (session.metadata.title) {
108
+ console.log('Title: ' + session.metadata.title);
109
+ console.log('');
110
+ }
111
+
112
+ if (session.metadata.started) {
113
+ console.log('Started: ' + session.metadata.started);
114
+ }
115
+
116
+ if (session.metadata.lastUpdated) {
117
+ console.log('Last Updated: ' + session.metadata.lastUpdated);
118
+ }
119
+
120
+ if (session.metadata.project) {
121
+ console.log('Project: ' + session.metadata.project);
122
+ }
123
+
124
+ if (session.metadata.branch) {
125
+ console.log('Branch: ' + session.metadata.branch);
126
+ }
127
+
128
+ if (session.metadata.worktree) {
129
+ console.log('Worktree: ' + session.metadata.worktree);
130
+ }
131
+ " "$ARGUMENTS"
132
+ ```
133
+
134
+ ### Create Alias
135
+
136
+ Create a memorable alias for a session.
137
+
138
+ ```bash
139
+ /sessions alias <id> <name> # Create alias
140
+ /sessions alias 2026-02-01 today-work # Create alias named "today-work"
141
+ ```
142
+
143
+ **Script:**
144
+ ```bash
145
+ node -e "
146
+ const sm = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-manager');
147
+ const aa = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-aliases');
148
+
149
+ const sessionId = process.argv[1];
150
+ const aliasName = process.argv[2];
151
+
152
+ if (!sessionId || !aliasName) {
153
+ console.log('Usage: /sessions alias <id> <name>');
154
+ process.exit(1);
155
+ }
156
+
157
+ // Get session filename
158
+ const session = sm.getSessionById(sessionId);
159
+ if (!session) {
160
+ console.log('Session not found: ' + sessionId);
161
+ process.exit(1);
162
+ }
163
+
164
+ const result = aa.setAlias(aliasName, session.filename);
165
+ if (result.success) {
166
+ console.log('✓ Alias created: ' + aliasName + ' → ' + session.filename);
167
+ } else {
168
+ console.log('✗ Error: ' + result.error);
169
+ process.exit(1);
170
+ }
171
+ " "$ARGUMENTS"
172
+ ```
173
+
174
+ ### Remove Alias
175
+
176
+ Delete an existing alias.
177
+
178
+ ```bash
179
+ /sessions alias --remove <name> # Remove alias
180
+ /sessions unalias <name> # Same as above
181
+ ```
182
+
183
+ **Script:**
184
+ ```bash
185
+ node -e "
186
+ const aa = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-aliases');
187
+
188
+ const aliasName = process.argv[1];
189
+ if (!aliasName) {
190
+ console.log('Usage: /sessions alias --remove <name>');
191
+ process.exit(1);
192
+ }
193
+
194
+ const result = aa.deleteAlias(aliasName);
195
+ if (result.success) {
196
+ console.log('✓ Alias removed: ' + aliasName);
197
+ } else {
198
+ console.log('✗ Error: ' + result.error);
199
+ process.exit(1);
200
+ }
201
+ " "$ARGUMENTS"
202
+ ```
203
+
204
+ ### Session Info
205
+
206
+ Show detailed information about a session.
207
+
208
+ ```bash
209
+ /sessions info <id|alias> # Show session details
210
+ ```
211
+
212
+ **Script:**
213
+ ```bash
214
+ node -e "
215
+ const sm = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-manager');
216
+ const aa = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-aliases');
217
+
218
+ const id = process.argv[1];
219
+ const resolved = aa.resolveAlias(id);
220
+ const sessionId = resolved ? resolved.sessionPath : id;
221
+
222
+ const session = sm.getSessionById(sessionId, true);
223
+ if (!session) {
224
+ console.log('Session not found: ' + id);
225
+ process.exit(1);
226
+ }
227
+
228
+ const stats = sm.getSessionStats(session.sessionPath);
229
+ const size = sm.getSessionSize(session.sessionPath);
230
+ const aliases = aa.getAliasesForSession(session.filename);
231
+
232
+ console.log('Session Information');
233
+ console.log('════════════════════');
234
+ console.log('ID: ' + (session.shortId === 'no-id' ? '(none)' : session.shortId));
235
+ console.log('Filename: ' + session.filename);
236
+ console.log('Date: ' + session.date);
237
+ console.log('Modified: ' + session.modifiedTime.toISOString().slice(0, 19).replace('T', ' '));
238
+ console.log('Project: ' + (session.metadata.project || '-'));
239
+ console.log('Branch: ' + (session.metadata.branch || '-'));
240
+ console.log('Worktree: ' + (session.metadata.worktree || '-'));
241
+ console.log('');
242
+ console.log('Content:');
243
+ console.log(' Lines: ' + stats.lineCount);
244
+ console.log(' Total items: ' + stats.totalItems);
245
+ console.log(' Completed: ' + stats.completedItems);
246
+ console.log(' In progress: ' + stats.inProgressItems);
247
+ console.log(' Size: ' + size);
248
+ if (aliases.length > 0) {
249
+ console.log('Aliases: ' + aliases.map(a => a.name).join(', '));
250
+ }
251
+ " "$ARGUMENTS"
252
+ ```
253
+
254
+ ### List Aliases
255
+
256
+ Show all session aliases.
257
+
258
+ ```bash
259
+ /sessions aliases # List all aliases
260
+ ```
261
+
262
+ **Script:**
263
+ ```bash
264
+ node -e "
265
+ const aa = require((()=>{var e=process.env.CLAUDE_PLUGIN_ROOT;if(e&&e.trim())return e.trim();var p=require('path'),f=require('fs'),h=require('os').homedir(),d=p.join(h,'.claude'),q=p.join('scripts','lib','utils.js');if(f.existsSync(p.join(d,q)))return d;try{var b=p.join(d,'plugins','cache','everything-claude-code');for(var o of f.readdirSync(b))for(var v of f.readdirSync(p.join(b,o))){var c=p.join(b,o,v);if(f.existsSync(p.join(c,q)))return c}}catch(x){}return d})()+'/scripts/lib/session-aliases');
266
+
267
+ const aliases = aa.listAliases();
268
+ console.log('Session Aliases (' + aliases.length + '):');
269
+ console.log('');
270
+
271
+ if (aliases.length === 0) {
272
+ console.log('No aliases found.');
273
+ } else {
274
+ console.log('Name Session File Title');
275
+ console.log('─────────────────────────────────────────────────────────────');
276
+ for (const a of aliases) {
277
+ const name = a.name.padEnd(12);
278
+ const file = (a.sessionPath.length > 30 ? a.sessionPath.slice(0, 27) + '...' : a.sessionPath).padEnd(30);
279
+ const title = a.title || '';
280
+ console.log(name + ' ' + file + ' ' + title);
281
+ }
282
+ }
283
+ "
284
+ ```
285
+
286
+ ## Operator Notes
287
+
288
+ - Session files persist `Project`, `Branch`, and `Worktree` in the header so `/sessions info` can disambiguate parallel tmux/worktree runs.
289
+ - For command-center style monitoring, combine `/sessions info`, `git diff --stat`, and the cost metrics emitted by `scripts/hooks/cost-tracker.js`.
290
+
291
+ ## Arguments
292
+
293
+ $ARGUMENTS:
294
+ - `list [options]` - List sessions
295
+ - `--limit <n>` - Max sessions to show (default: 50)
296
+ - `--date <YYYY-MM-DD>` - Filter by date
297
+ - `--search <pattern>` - Search in session ID
298
+ - `load <id|alias>` - Load session content
299
+ - `alias <id> <name>` - Create alias for session
300
+ - `alias --remove <name>` - Remove alias
301
+ - `unalias <name>` - Same as `--remove`
302
+ - `info <id|alias>` - Show session statistics
303
+ - `aliases` - List all aliases
304
+ - `help` - Show this help
305
+
306
+ ## Examples
307
+
308
+ ```bash
309
+ # List all sessions
310
+ /sessions list
311
+
312
+ # Create an alias for today's session
313
+ /sessions alias 2026-02-01 today
314
+
315
+ # Load session by alias
316
+ /sessions load today
317
+
318
+ # Show session info
319
+ /sessions info today
320
+
321
+ # Remove alias
322
+ /sessions alias --remove today
323
+
324
+ # List all aliases
325
+ /sessions aliases
326
+ ```
327
+
328
+ ## Notes
329
+
330
+ - Sessions are stored as markdown files in `~/.claude/session-data/` with legacy reads from `~/.claude/sessions/`
331
+ - Aliases are stored in `~/.claude/session-aliases.json`
332
+ - Session IDs can be shortened (first 4-8 characters usually unique enough)
333
+ - Use aliases for frequently referenced sessions
@@ -0,0 +1,80 @@
1
+ ---
2
+ description: Configure your preferred package manager (npm/pnpm/yarn/bun)
3
+ disable-model-invocation: true
4
+ ---
5
+
6
+ # Package Manager Setup
7
+
8
+ Configure your preferred package manager for this project or globally.
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ # Detect current package manager
14
+ node scripts/setup-package-manager.js --detect
15
+
16
+ # Set global preference
17
+ node scripts/setup-package-manager.js --global pnpm
18
+
19
+ # Set project preference
20
+ node scripts/setup-package-manager.js --project bun
21
+
22
+ # List available package managers
23
+ node scripts/setup-package-manager.js --list
24
+ ```
25
+
26
+ ## Detection Priority
27
+
28
+ When determining which package manager to use, the following order is checked:
29
+
30
+ 1. **Environment variable**: `CLAUDE_PACKAGE_MANAGER`
31
+ 2. **Project config**: `.claude/package-manager.json`
32
+ 3. **package.json**: `packageManager` field
33
+ 4. **Lock file**: Presence of package-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lockb
34
+ 5. **Global config**: `~/.claude/package-manager.json`
35
+ 6. **Fallback**: First available package manager (pnpm > bun > yarn > npm)
36
+
37
+ ## Configuration Files
38
+
39
+ ### Global Configuration
40
+ ```json
41
+ // ~/.claude/package-manager.json
42
+ {
43
+ "packageManager": "pnpm"
44
+ }
45
+ ```
46
+
47
+ ### Project Configuration
48
+ ```json
49
+ // .claude/package-manager.json
50
+ {
51
+ "packageManager": "bun"
52
+ }
53
+ ```
54
+
55
+ ### package.json
56
+ ```json
57
+ {
58
+ "packageManager": "pnpm@8.6.0"
59
+ }
60
+ ```
61
+
62
+ ## Environment Variable
63
+
64
+ Set `CLAUDE_PACKAGE_MANAGER` to override all other detection methods:
65
+
66
+ ```bash
67
+ # Windows (PowerShell)
68
+ $env:CLAUDE_PACKAGE_MANAGER = "pnpm"
69
+
70
+ # macOS/Linux
71
+ export CLAUDE_PACKAGE_MANAGER=pnpm
72
+ ```
73
+
74
+ ## Run the Detection
75
+
76
+ To see current package manager detection results, run:
77
+
78
+ ```bash
79
+ node scripts/setup-package-manager.js --detect
80
+ ```