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,579 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "First-time project setup — scans codebase, generates CLAUDE.md, installs language rules, discovers skills"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Project Setup Wizard
|
|
6
|
+
|
|
7
|
+
You are setting up Claude Code for this project. Follow these stages precisely.
|
|
8
|
+
|
|
9
|
+
## Stage 0 — Source Directory Detection
|
|
10
|
+
|
|
11
|
+
Verify that all 4 source directories from the Claude Code Pilot are properly installed.
|
|
12
|
+
|
|
13
|
+
Check the following paths relative to the project root:
|
|
14
|
+
|
|
15
|
+
1. **Kit commands** — check if `.claude/commands/setup.md` exists (this file is a kit-specific marker)
|
|
16
|
+
2. **GSD commands** — check if `.claude/commands/gsd/` directory exists and is non-empty (contains the 32 GSD commands)
|
|
17
|
+
3. **ECC toolbox** — check if `.claude/ecc-scripts/` directory exists (contains hooks, lib, detection scripts)
|
|
18
|
+
4. **GSD SDLC workflows** — check if `.claude/get-shit-done/` directory exists and contains `workflows/` subdirectory
|
|
19
|
+
|
|
20
|
+
Use the Bash tool to run existence checks (e.g., `ls` or `test -d`). Count items in each directory.
|
|
21
|
+
|
|
22
|
+
Present results in this format:
|
|
23
|
+
```
|
|
24
|
+
Source Directory Detection:
|
|
25
|
+
[PASS] Kit commands .claude/commands/ (N kit commands)
|
|
26
|
+
[PASS] GSD commands .claude/commands/gsd/ (N commands)
|
|
27
|
+
[PASS] ECC toolbox .claude/ecc-scripts/ (hooks, lib, detection)
|
|
28
|
+
[PASS] GSD workflows .claude/get-shit-done/ (workflows, references, templates)
|
|
29
|
+
|
|
30
|
+
All 4 source directories detected.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If any directory is missing, show:
|
|
34
|
+
```
|
|
35
|
+
[FAIL] GSD commands .claude/commands/gsd/ -- NOT FOUND
|
|
36
|
+
Fix: Run /kit:update or reinstall with npx claude-code-pilot@latest
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Continue to Stage 1 regardless — detection is informational, not blocking.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Stage 1 — Detect
|
|
44
|
+
|
|
45
|
+
Check if this is an existing codebase or new project:
|
|
46
|
+
|
|
47
|
+
1. Run `ls -la` and `find . -maxdepth 2 -type f | head -50`
|
|
48
|
+
2. Check for: `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `Gemfile`, `pom.xml`
|
|
49
|
+
|
|
50
|
+
**Files exist** → Stage 2A (scan). **Mostly empty** → Stage 2B (interview).
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Stage 2A — Scan Existing Codebase
|
|
55
|
+
|
|
56
|
+
Use subagents to explore (keeps main context clean). Tailor the exploration prompts based on what Stage 1 detected:
|
|
57
|
+
|
|
58
|
+
**If Next.js detected** (react + next in dependencies, or next.config.* exists):
|
|
59
|
+
```
|
|
60
|
+
Use subagents to investigate:
|
|
61
|
+
1. App Router vs Pages Router -- check for app/ vs pages/ directory
|
|
62
|
+
2. Server vs Client components -- grep for 'use client' directives
|
|
63
|
+
3. Data fetching -- check for fetch(), server actions, tRPC, or API routes
|
|
64
|
+
4. Styling -- check for tailwind.config, CSS modules, styled-components
|
|
65
|
+
5. Testing -- check for jest.config, vitest.config, playwright.config
|
|
66
|
+
6. Database/ORM -- check for prisma/, drizzle.config, or direct DB imports
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**If Python/Django detected** (manage.py exists, or django in dependencies):
|
|
70
|
+
```
|
|
71
|
+
Use subagents to investigate:
|
|
72
|
+
1. Django apps -- list directories with models.py
|
|
73
|
+
2. Database -- check for DATABASES in settings.py, migration files
|
|
74
|
+
3. Auth -- check for custom User model, third-party auth (allauth, etc.)
|
|
75
|
+
4. API -- check for rest_framework, graphene, or plain views
|
|
76
|
+
5. Testing -- check for pytest.ini, manage.py test, test directories
|
|
77
|
+
6. Deployment -- check for Dockerfile, gunicorn config, WSGI/ASGI
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**If Go project detected** (go.mod exists):
|
|
81
|
+
```
|
|
82
|
+
Use subagents to investigate:
|
|
83
|
+
1. Module structure -- list top-level packages (cmd/, internal/, pkg/)
|
|
84
|
+
2. Web framework -- check for gin, echo, chi, net/http
|
|
85
|
+
3. Database -- check for sqlx, gorm, pgx, migrate files
|
|
86
|
+
4. Testing -- check for _test.go patterns, testify usage
|
|
87
|
+
5. Build -- check for Makefile, Dockerfile, go generate directives
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**If generic/unknown project** (none of the above matched clearly):
|
|
91
|
+
```
|
|
92
|
+
Use subagents to investigate:
|
|
93
|
+
1. Language and framework markers -- package.json, go.mod, Cargo.toml, etc.
|
|
94
|
+
2. Directory structure -- key directories and their purposes
|
|
95
|
+
3. Build commands -- from manifest files (package.json scripts, Makefile, etc.)
|
|
96
|
+
4. Test commands -- test runner config and test file locations
|
|
97
|
+
5. Linting/formatting -- .eslintrc, .prettierrc, biome.json, etc.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Present findings:
|
|
101
|
+
```
|
|
102
|
+
Tech Stack: [framework] + [language] + [database]
|
|
103
|
+
Linting: [tool] (config: [file])
|
|
104
|
+
Testing: [framework] (command: [cmd])
|
|
105
|
+
Structure: [key directories]
|
|
106
|
+
Languages detected: [list]
|
|
107
|
+
|
|
108
|
+
Does this look right?
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Wait for confirmation → Stage 3.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Stage 2B — New Project Interview
|
|
116
|
+
|
|
117
|
+
Use AskUserQuestion:
|
|
118
|
+
1. What are you building?
|
|
119
|
+
2. What tech stack? (or "recommend for me")
|
|
120
|
+
3. Database? Auth?
|
|
121
|
+
4. Preferences? (linter, tests)
|
|
122
|
+
|
|
123
|
+
Then → Stage 3.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Stage 3 — Install Language Rules
|
|
128
|
+
|
|
129
|
+
Based on detected languages, activate language-specific rules from `available-rules/`:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# For each detected language (e.g., typescript, python, golang):
|
|
133
|
+
cp -r .claude/available-rules/<language>/ .claude/rules/<language>/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Always confirm with the user:
|
|
137
|
+
```
|
|
138
|
+
Detected languages: TypeScript, Python
|
|
139
|
+
I'll activate language-specific rules for: coding-style, patterns, security, testing, hooks
|
|
140
|
+
|
|
141
|
+
Proceed?
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Common rules (`.claude/rules/common/`) are already active for all projects.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Stage 4 — Directory-Scoped CLAUDE.md
|
|
149
|
+
|
|
150
|
+
Generate CLAUDE.md files for recognized project subdirectories. These provide directory-specific context that Claude Code loads on demand when reading files in those directories.
|
|
151
|
+
|
|
152
|
+
**Step 1: Scan for recognized directories**
|
|
153
|
+
|
|
154
|
+
Check the project root for these directories: `src/`, `test/`, `tests/`, `lib/`, `app/`, `api/`, `scripts/`, `docs/`
|
|
155
|
+
|
|
156
|
+
Skip any directory that does not exist.
|
|
157
|
+
|
|
158
|
+
**Step 2: Check existing CLAUDE.md files**
|
|
159
|
+
|
|
160
|
+
For each existing recognized directory:
|
|
161
|
+
- If no `CLAUDE.md` exists in the directory: mark for generation
|
|
162
|
+
- If `CLAUDE.md` exists and its **first line** contains `<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->`: mark for regeneration (overwrite)
|
|
163
|
+
- If `CLAUDE.md` exists **without** that marker on line 1: skip (user customized it)
|
|
164
|
+
|
|
165
|
+
**Step 3: Confirm with user**
|
|
166
|
+
|
|
167
|
+
Show a summary and ask for confirmation once (not per-file):
|
|
168
|
+
```
|
|
169
|
+
Directory-scoped CLAUDE.md files will be generated for:
|
|
170
|
+
src/ -- Source code (Next.js conventions)
|
|
171
|
+
test/ -- Test files (Jest + React Testing Library)
|
|
172
|
+
docs/ -- Documentation
|
|
173
|
+
|
|
174
|
+
Proceed? (These can be customized later -- /setup:refresh will skip files you edit)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Step 4: Generate files**
|
|
178
|
+
|
|
179
|
+
After confirmation, use the Write tool to create each file. Every generated file MUST start with the marker comment on line 1.
|
|
180
|
+
|
|
181
|
+
Use these templates based on the detected stack (from Stage 1):
|
|
182
|
+
|
|
183
|
+
### src/ templates
|
|
184
|
+
|
|
185
|
+
**Next.js project:**
|
|
186
|
+
```markdown
|
|
187
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
188
|
+
# Source Code (src/)
|
|
189
|
+
|
|
190
|
+
This directory contains the application source code for a **Next.js** project.
|
|
191
|
+
|
|
192
|
+
## Conventions
|
|
193
|
+
|
|
194
|
+
- Use Server Components by default. Add `'use client'` only when the component needs browser APIs or interactivity.
|
|
195
|
+
- App Router conventions: page.tsx for routes, layout.tsx for layouts, loading.tsx for suspense boundaries.
|
|
196
|
+
- Import paths use `@/` alias (maps to `src/`).
|
|
197
|
+
- Keep files under 400 lines. Extract utilities to `lib/` or shared modules.
|
|
198
|
+
- Co-locate component tests as `ComponentName.test.tsx` alongside the component file.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Express + TypeScript project:**
|
|
202
|
+
```markdown
|
|
203
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
204
|
+
# Source Code (src/)
|
|
205
|
+
|
|
206
|
+
This directory contains the application source code for an **Express + TypeScript** project.
|
|
207
|
+
|
|
208
|
+
## Conventions
|
|
209
|
+
|
|
210
|
+
- Controllers in `controllers/`. Services in `services/`. Type definitions in `types/`.
|
|
211
|
+
- Route handlers receive (req, res, next) and delegate to services.
|
|
212
|
+
- All service functions return typed results, never throw for expected errors.
|
|
213
|
+
- Keep files under 400 lines. Extract shared utilities to `lib/` or `utils/`.
|
|
214
|
+
- Validate request bodies at the controller layer before passing to services.
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Python + Django project:**
|
|
218
|
+
```markdown
|
|
219
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
220
|
+
# Source Code (src/)
|
|
221
|
+
|
|
222
|
+
This directory contains the application source code for a **Django** project.
|
|
223
|
+
|
|
224
|
+
## Conventions
|
|
225
|
+
|
|
226
|
+
- Apps follow Django conventions. Models in `models.py`. Views in `views.py`. URLs in `urls.py`.
|
|
227
|
+
- Use class-based views for CRUD operations, function-based views for custom logic.
|
|
228
|
+
- Keep models focused -- one responsibility per model. Use proxy models for alternative representations.
|
|
229
|
+
- Keep files under 400 lines. Extract complex queries to managers.
|
|
230
|
+
- Use Django's ORM. Raw SQL only when ORM cannot express the query efficiently.
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Go project:**
|
|
234
|
+
```markdown
|
|
235
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
236
|
+
# Source Code (src/)
|
|
237
|
+
|
|
238
|
+
This directory contains the application source code for a **Go** project.
|
|
239
|
+
|
|
240
|
+
## Conventions
|
|
241
|
+
|
|
242
|
+
- Package-per-directory. Exported functions start with uppercase.
|
|
243
|
+
- Interfaces are defined near the consumer, not the implementer.
|
|
244
|
+
- Error handling: return errors, do not panic. Wrap errors with context using fmt.Errorf.
|
|
245
|
+
- Keep files under 400 lines. One primary type per file.
|
|
246
|
+
- Use dependency injection. Accept interfaces, return structs.
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Generic project (unknown framework):**
|
|
250
|
+
```markdown
|
|
251
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
252
|
+
# Source Code (src/)
|
|
253
|
+
|
|
254
|
+
This directory contains the application source code.
|
|
255
|
+
|
|
256
|
+
## Conventions
|
|
257
|
+
|
|
258
|
+
- Follow existing patterns in this directory. Keep files focused and under 400 lines.
|
|
259
|
+
- Organize by feature or domain, not by file type.
|
|
260
|
+
- Export public interfaces through index files where applicable.
|
|
261
|
+
- Separate business logic from I/O and framework code.
|
|
262
|
+
- Keep imports organized: stdlib first, then external, then internal.
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### test/ or tests/ templates
|
|
266
|
+
|
|
267
|
+
**Next.js / React project:**
|
|
268
|
+
```markdown
|
|
269
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
270
|
+
# Tests (test/)
|
|
271
|
+
|
|
272
|
+
This directory contains automated tests.
|
|
273
|
+
|
|
274
|
+
## Conventions
|
|
275
|
+
|
|
276
|
+
- Use Jest with React Testing Library for component tests.
|
|
277
|
+
- Test file naming: `*.test.tsx` or `*.test.ts` matching the source file being tested.
|
|
278
|
+
- Mock Next.js router and navigation using `next/navigation` mocks.
|
|
279
|
+
- Prefer testing user-visible behavior over implementation details.
|
|
280
|
+
- Each test should be independent -- no shared mutable state between tests.
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
**Python + Django project:**
|
|
284
|
+
```markdown
|
|
285
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
286
|
+
# Tests (tests/)
|
|
287
|
+
|
|
288
|
+
This directory contains automated tests.
|
|
289
|
+
|
|
290
|
+
## Conventions
|
|
291
|
+
|
|
292
|
+
- Use pytest. Fixtures in `conftest.py`.
|
|
293
|
+
- Mark database tests with `@pytest.mark.django_db`.
|
|
294
|
+
- Test file naming: `test_*.py` matching the module being tested.
|
|
295
|
+
- Do not mock what you can test directly. Prefer integration over unit when cost is similar.
|
|
296
|
+
- Each test should be independent -- no shared mutable state between tests.
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
**Go project:**
|
|
300
|
+
```markdown
|
|
301
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
302
|
+
# Tests (test/)
|
|
303
|
+
|
|
304
|
+
This directory contains automated tests.
|
|
305
|
+
|
|
306
|
+
## Conventions
|
|
307
|
+
|
|
308
|
+
- Test files: `*_test.go` in the same package as the code being tested.
|
|
309
|
+
- Use table-driven tests for multiple input/output scenarios.
|
|
310
|
+
- Use `testify` if present in go.mod, otherwise use stdlib `testing`.
|
|
311
|
+
- Integration tests that need external services use build tags.
|
|
312
|
+
- Each test should be independent -- no shared mutable state between tests.
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Generic project:**
|
|
316
|
+
```markdown
|
|
317
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
318
|
+
# Tests (test/)
|
|
319
|
+
|
|
320
|
+
This directory contains automated tests.
|
|
321
|
+
|
|
322
|
+
## Conventions
|
|
323
|
+
|
|
324
|
+
- Test file naming: `*.test.*` matching the source file being tested.
|
|
325
|
+
- Use the project's configured test runner (see root CLAUDE.md for commands).
|
|
326
|
+
- Integration tests may use real filesystem I/O in temp directories.
|
|
327
|
+
- Do not mock what you can test directly. Prefer integration over unit when cost is similar.
|
|
328
|
+
- Each test should be independent -- no shared mutable state between tests.
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### lib/ template (all stacks)
|
|
332
|
+
|
|
333
|
+
```markdown
|
|
334
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
335
|
+
# Shared Libraries (lib/)
|
|
336
|
+
|
|
337
|
+
This directory contains shared utility functions and libraries.
|
|
338
|
+
|
|
339
|
+
## Conventions
|
|
340
|
+
|
|
341
|
+
- Pure utility functions. Minimize side effects.
|
|
342
|
+
- Export public API through an index file where applicable.
|
|
343
|
+
- Functions should be small, focused, and well-documented.
|
|
344
|
+
- No framework-specific code -- keep lib/ portable across the project.
|
|
345
|
+
- Keep files under 400 lines. Group related utilities in subdirectories.
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### app/ templates
|
|
349
|
+
|
|
350
|
+
**Next.js App Router:**
|
|
351
|
+
```markdown
|
|
352
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
353
|
+
# App Directory (app/)
|
|
354
|
+
|
|
355
|
+
This directory contains Next.js App Router pages and layouts.
|
|
356
|
+
|
|
357
|
+
## Conventions
|
|
358
|
+
|
|
359
|
+
- Server Components by default. Add `'use client'` only when needed for browser APIs or interactivity.
|
|
360
|
+
- Route structure: `page.tsx` for routes, `layout.tsx` for layouts, `loading.tsx` for suspense, `error.tsx` for error boundaries.
|
|
361
|
+
- Route handlers in `route.ts` files for API endpoints.
|
|
362
|
+
- Co-locate page-specific components in the same route directory.
|
|
363
|
+
- Metadata exports for SEO in `page.tsx` and `layout.tsx`.
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
**Rails project:**
|
|
367
|
+
```markdown
|
|
368
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
369
|
+
# App Directory (app/)
|
|
370
|
+
|
|
371
|
+
This directory contains the Rails application code.
|
|
372
|
+
|
|
373
|
+
## Conventions
|
|
374
|
+
|
|
375
|
+
- Follow Rails conventions: models/, controllers/, views/, helpers/, mailers/.
|
|
376
|
+
- Skinny controllers, fat models. Business logic belongs in models or service objects.
|
|
377
|
+
- Use concerns for shared behavior across models or controllers.
|
|
378
|
+
- Keep views simple -- complex logic goes in helpers or presenters.
|
|
379
|
+
- Follow RESTful routing conventions.
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Generic app/ directory:**
|
|
383
|
+
```markdown
|
|
384
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
385
|
+
# Application (app/)
|
|
386
|
+
|
|
387
|
+
This directory contains the main application code.
|
|
388
|
+
|
|
389
|
+
## Conventions
|
|
390
|
+
|
|
391
|
+
- Follow existing patterns in this directory.
|
|
392
|
+
- Organize by feature or domain, not by file type.
|
|
393
|
+
- Keep entry points clearly identified and minimal.
|
|
394
|
+
- Separate configuration from application logic.
|
|
395
|
+
- Keep files under 400 lines.
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### api/ template (all stacks)
|
|
399
|
+
|
|
400
|
+
```markdown
|
|
401
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
402
|
+
# API Layer (api/)
|
|
403
|
+
|
|
404
|
+
This directory contains API endpoints and route handlers.
|
|
405
|
+
|
|
406
|
+
## Conventions
|
|
407
|
+
|
|
408
|
+
- REST conventions: use standard HTTP methods (GET, POST, PUT, DELETE).
|
|
409
|
+
- Validate all inputs at the handler level before processing.
|
|
410
|
+
- Return consistent error format: `{ "error": "message", "code": "ERROR_CODE" }`.
|
|
411
|
+
- Group related endpoints in subdirectories by resource.
|
|
412
|
+
- Keep handlers thin -- delegate business logic to services or models.
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### scripts/ template (all stacks)
|
|
416
|
+
|
|
417
|
+
```markdown
|
|
418
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
419
|
+
# Scripts (scripts/)
|
|
420
|
+
|
|
421
|
+
This directory contains build, development, and maintenance scripts.
|
|
422
|
+
|
|
423
|
+
## Conventions
|
|
424
|
+
|
|
425
|
+
- Shell scripts must be POSIX-compatible (sh, not bash-specific).
|
|
426
|
+
- Include a usage comment at the top of each script explaining what it does and how to run it.
|
|
427
|
+
- Scripts should be idempotent when possible -- safe to run multiple times.
|
|
428
|
+
- Use `set -euo pipefail` (or POSIX equivalent) for error handling.
|
|
429
|
+
- Keep scripts focused -- one task per script.
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### docs/ template (all stacks)
|
|
433
|
+
|
|
434
|
+
```markdown
|
|
435
|
+
<!-- Generated by /setup -- customize freely, /setup:refresh will regenerate if this comment is present -->
|
|
436
|
+
# Documentation (docs/)
|
|
437
|
+
|
|
438
|
+
This directory contains project documentation.
|
|
439
|
+
|
|
440
|
+
## Conventions
|
|
441
|
+
|
|
442
|
+
- Keep docs current with code changes. Outdated docs are worse than no docs.
|
|
443
|
+
- Use relative links between documents (not absolute URLs).
|
|
444
|
+
- No auto-generated content in manually-written docs.
|
|
445
|
+
- Structure: guides/ for how-tos, reference/ for API docs, architecture/ for system design.
|
|
446
|
+
- Include diagrams as code (Mermaid, PlantUML) rather than binary images when possible.
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
---
|
|
450
|
+
|
|
451
|
+
## Stage 5 — Generate CLAUDE.md
|
|
452
|
+
|
|
453
|
+
Write CLAUDE.md under 100 lines. Sections:
|
|
454
|
+
|
|
455
|
+
- **Why** (2-3 lines): project purpose
|
|
456
|
+
- **Tech Stack** (8-12 lines): everything detected, with versions
|
|
457
|
+
- **Project Map** (5-8 lines): key directories
|
|
458
|
+
- **Build & Validate** (8-10 lines): exact commands
|
|
459
|
+
- **Universal Rules** (5-7 lines): project-specific patterns
|
|
460
|
+
- **Forbidden** (4-6 lines): things that break this project
|
|
461
|
+
- **Methodology — GSD** (6-8 lines): reference /gsd: commands
|
|
462
|
+
- **Toolbox — ECC** (6-8 lines): reference /verify, /checkpoint, /save-session, /learn
|
|
463
|
+
- **Before ANY work** (2 lines): `npx skills find <keywords>`
|
|
464
|
+
- **Reference Docs & MCP** (3-4 lines): point to docs/, contexts/, registries
|
|
465
|
+
- **Gotchas** (3-5 lines): non-obvious things from scan
|
|
466
|
+
|
|
467
|
+
Show the user and ask for corrections.
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## Stage 6 — Generate Architecture Guide
|
|
472
|
+
|
|
473
|
+
Create `docs/agent-guides/architecture.md`:
|
|
474
|
+
|
|
475
|
+
**Existing**: system overview, auth flow, data model, request flow, key decisions.
|
|
476
|
+
**New**: skeleton with planned architecture.
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
## Stage 7 — MCP Auto-Configuration
|
|
481
|
+
|
|
482
|
+
Detect MCP-compatible binaries on PATH and add entries to `.mcp.json`.
|
|
483
|
+
|
|
484
|
+
**Step 1: Read existing .mcp.json**
|
|
485
|
+
|
|
486
|
+
Read the project's `.mcp.json` file. If missing or malformed JSON, start with `{ "mcpServers": {} }`.
|
|
487
|
+
|
|
488
|
+
**Step 2: Check for binaries**
|
|
489
|
+
|
|
490
|
+
Use the Bash tool to check for each binary:
|
|
491
|
+
|
|
492
|
+
1. `which codebase-memory-mcp` (or `where codebase-memory-mcp` on Windows)
|
|
493
|
+
2. `which ccc` (or `where ccc` on Windows)
|
|
494
|
+
|
|
495
|
+
Wrap each in try/catch -- if `which` fails, the binary is not installed.
|
|
496
|
+
|
|
497
|
+
**Step 3: Add entries for detected binaries**
|
|
498
|
+
|
|
499
|
+
For each binary found:
|
|
500
|
+
- Get the resolved path from the command output (stdout.trim())
|
|
501
|
+
- Check if the corresponding key already exists in `mcpServers`:
|
|
502
|
+
- `codebase-memory-mcp` found and key `"codebase-memory-mcp"` missing: add `{ "command": "<resolved_path>", "args": [] }`
|
|
503
|
+
- `ccc` found and key `"cocoindex-code"` missing: add `{ "command": "<resolved_path>", "args": ["mcp"] }`
|
|
504
|
+
- Key already exists: skip (never overwrite user config)
|
|
505
|
+
|
|
506
|
+
**Step 4: Write updated .mcp.json**
|
|
507
|
+
|
|
508
|
+
Write the file back with `JSON.stringify(config, null, 2)`.
|
|
509
|
+
|
|
510
|
+
**Step 5: Report status**
|
|
511
|
+
|
|
512
|
+
```
|
|
513
|
+
MCP Tool Detection:
|
|
514
|
+
[ADDED] codebase-memory-mcp /usr/local/bin/codebase-memory-mcp
|
|
515
|
+
[SKIP] cocoindex-code Already configured in .mcp.json
|
|
516
|
+
[MISSING] ccc Not found -- install with instructions below
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
For MISSING tools, print install instructions:
|
|
520
|
+
- **codebase-memory-mcp**: `curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/scripts/setup.sh | bash`
|
|
521
|
+
- **cocoindex-code (ccc)**: `pipx install cocoindex-code` or `uv tool install cocoindex-code`
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
## Stage 8 — Discover Skills & MCP
|
|
526
|
+
|
|
527
|
+
Search for skills:
|
|
528
|
+
```bash
|
|
529
|
+
npx skills find [framework]
|
|
530
|
+
npx skills find [language] [testing]
|
|
531
|
+
npx skills find [database]
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
Check MCP registries (github.com/mcp, mcp.so) for relevant servers.
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## Stage 9 — Initialize
|
|
539
|
+
|
|
540
|
+
- **New project**: Suggest `/gsd:new-project` for roadmap/milestones
|
|
541
|
+
- **Existing project**: Suggest `/gsd:quick "first task"` or `/gsd:discuss-phase 1`
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
## Stage 10 — Commit
|
|
546
|
+
|
|
547
|
+
```bash
|
|
548
|
+
git add CLAUDE.md */CLAUDE.md .claude/ .mcp.json docs/
|
|
549
|
+
git commit -m "chore: add Claude Code Pilot
|
|
550
|
+
|
|
551
|
+
- GSD methodology (32 commands, 12 agents)
|
|
552
|
+
- ECC toolbox (sessions, learning, verification, quality gates)
|
|
553
|
+
- Language rules: [detected]
|
|
554
|
+
- Directory-scoped CLAUDE.md files: [list of directories]
|
|
555
|
+
- MCP auto-configured: [list of detected tools]
|
|
556
|
+
- Safety hooks + notifications
|
|
557
|
+
- Architecture documentation"
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
Summary:
|
|
561
|
+
```
|
|
562
|
+
Setup complete!
|
|
563
|
+
|
|
564
|
+
Configured:
|
|
565
|
+
- CLAUDE.md — [X]-line project guide
|
|
566
|
+
- [N] directory CLAUDE.md files (src/, test/, ...)
|
|
567
|
+
- GSD — 32 commands, 12 agents, context monitoring, statusline
|
|
568
|
+
- ECC — Sessions, learning, verification, checkpoints, quality gates
|
|
569
|
+
- [N] ECC agents (architect, code-reviewer, security, tdd, ...)
|
|
570
|
+
- [N] language rule sets activated
|
|
571
|
+
- [N] ecosystem skills installed
|
|
572
|
+
- MCP tools: [list of detected/added tools]
|
|
573
|
+
- Safety hooks + desktop notifications
|
|
574
|
+
|
|
575
|
+
Methodology: /gsd:discuss → /gsd:plan → /gsd:execute → /gsd:verify
|
|
576
|
+
Quality: /verify → /checkpoint → /quality-gate
|
|
577
|
+
Persistence: /save-session → /resume-session → /learn → /evolve
|
|
578
|
+
Update: /kit:update
|
|
579
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "MCP tool recommendations per task type -- which tools to use when"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Tool Guide
|
|
6
|
+
|
|
7
|
+
MCP tools consume context tokens on every invocation. Selecting the right tools per task type improves response quality and speed. The principle: **use 3-5 focused tools, not every tool available.** Loading irrelevant tools wastes tokens and dilutes attention (Stripe's "15 from 400" insight).
|
|
8
|
+
|
|
9
|
+
## Tool Inventory
|
|
10
|
+
|
|
11
|
+
The kit configures or recommends these MCP tools:
|
|
12
|
+
|
|
13
|
+
| Tool | What It Does |
|
|
14
|
+
|------|-------------|
|
|
15
|
+
| **Context7** | Up-to-date library documentation. Prevents hallucinated APIs. |
|
|
16
|
+
| **codebase-memory-mcp** | Code navigation, call graph tracing, semantic search across your codebase. |
|
|
17
|
+
| **cocoindex-code** | Code indexing and semantic search (alternative to codebase-memory-mcp). |
|
|
18
|
+
| **find-skills** | Discover ecosystem skills, templates, and starter kits. |
|
|
19
|
+
| **WebSearch / WebFetch** | Web research and URL content fetching (built-in or MCP). |
|
|
20
|
+
|
|
21
|
+
## Recommendations by Task Type
|
|
22
|
+
|
|
23
|
+
| Task Type | Use These | Why | Defer These |
|
|
24
|
+
|-----------|-----------|-----|-------------|
|
|
25
|
+
| **Coding / Implementation** | Context7 (library docs), codebase-memory-mcp (code nav) | Up-to-date APIs prevent hallucination. Code graph for navigation. | find-skills (only if new framework) |
|
|
26
|
+
| **Research / Planning** | Context7 (docs), WebSearch, WebFetch | Need current information for architecture decisions. | codebase-memory-mcp (not needed for planning) |
|
|
27
|
+
| **Code Review** | codebase-memory-mcp (trace call paths), Context7 (verify API usage) | Review needs code navigation and API correctness. | WebSearch (usually irrelevant) |
|
|
28
|
+
| **Testing** | codebase-memory-mcp (find test patterns), Context7 (test framework docs) | Need existing patterns and framework APIs. | find-skills (only if new test framework) |
|
|
29
|
+
| **Debugging** | codebase-memory-mcp (trace call paths), Context7 (verify APIs) | Debugging needs call graph tracing and API verification. | WebSearch (last resort) |
|
|
30
|
+
| **Documentation** | Context7 (verify API accuracy), WebFetch (reference docs) | Docs must be accurate to current APIs. | codebase-memory-mcp (overkill for docs) |
|
|
31
|
+
|
|
32
|
+
## Usage Tips
|
|
33
|
+
|
|
34
|
+
- If a tool is not installed, Claude will skip it automatically -- no errors.
|
|
35
|
+
- Use `/setup` to auto-detect and configure available MCP tools.
|
|
36
|
+
- Context7 is the highest-value tool -- it prevents the #1 cause of agent errors (outdated API usage).
|
|
37
|
+
- codebase-memory-mcp and cocoindex-code serve similar purposes -- you don't need both.
|
|
38
|
+
- For large codebases (100+ files), codebase-memory-mcp significantly reduces context waste from file exploration.
|
|
39
|
+
|
|
40
|
+
## When to Add New MCP Tools
|
|
41
|
+
|
|
42
|
+
- Check [mcp.so](https://mcp.so) or [github.com/mcp](https://github.com/mcp) for domain-specific servers.
|
|
43
|
+
- Add to `.mcp.json` only when the tool addresses a recurring need.
|
|
44
|
+
- Prefer stdio servers (local binaries) over remote HTTP servers for speed and privacy.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Kit update checker — SessionStart hook
|
|
3
|
+
// Checks npm for newer claude-code-pilot version in background
|
|
4
|
+
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const os = require('os');
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
|
|
10
|
+
const cwd = process.cwd();
|
|
11
|
+
const homeDir = os.homedir();
|
|
12
|
+
|
|
13
|
+
function findVersionFile() {
|
|
14
|
+
const local = path.join(cwd, '.claude', 'kit-version', 'VERSION');
|
|
15
|
+
if (fs.existsSync(local)) return local;
|
|
16
|
+
const configDir = process.env.CLAUDE_CONFIG_DIR || path.join(homeDir, '.claude');
|
|
17
|
+
const global = path.join(configDir, 'kit-version', 'VERSION');
|
|
18
|
+
if (fs.existsSync(global)) return global;
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const versionFile = findVersionFile();
|
|
23
|
+
if (!versionFile) process.exit(0);
|
|
24
|
+
|
|
25
|
+
const configDir = process.env.CLAUDE_CONFIG_DIR || path.join(homeDir, '.claude');
|
|
26
|
+
const cacheDir = path.join(configDir, 'cache');
|
|
27
|
+
const cacheFile = path.join(cacheDir, 'kit-update-check.json');
|
|
28
|
+
try { fs.mkdirSync(cacheDir, { recursive: true }); } catch {}
|
|
29
|
+
|
|
30
|
+
// Background check
|
|
31
|
+
const child = spawn(process.execPath, ['-e', `
|
|
32
|
+
const fs = require('fs');
|
|
33
|
+
const { execSync } = require('child_process');
|
|
34
|
+
const vf = ${JSON.stringify(versionFile)};
|
|
35
|
+
const cf = ${JSON.stringify(cacheFile)};
|
|
36
|
+
let installed = '0.0.0';
|
|
37
|
+
try { installed = fs.readFileSync(vf, 'utf8').trim(); } catch {}
|
|
38
|
+
let latest = null;
|
|
39
|
+
try { latest = execSync('npm view claude-code-pilot version', { encoding: 'utf8', timeout: 10000, windowsHide: true }).trim(); } catch {}
|
|
40
|
+
fs.writeFileSync(cf, JSON.stringify({ update_available: latest && installed !== latest, installed, latest: latest || 'unknown', checked: Math.floor(Date.now() / 1000) }));
|
|
41
|
+
`], { stdio: 'ignore', windowsHide: true, detached: true });
|
|
42
|
+
child.unref();
|
|
43
|
+
|
|
44
|
+
// Show cached result if fresh
|
|
45
|
+
try {
|
|
46
|
+
if (fs.existsSync(cacheFile)) {
|
|
47
|
+
const cached = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
|
|
48
|
+
if ((Math.floor(Date.now() / 1000) - (cached.checked || 0)) < 86400 && cached.update_available) {
|
|
49
|
+
process.stdout.write(JSON.stringify({
|
|
50
|
+
additionalContext: `⬆️ Pilot update available: ${cached.installed} → ${cached.latest}. Run /kit:update to upgrade.`
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} catch {}
|
package/kit/mcp.json
ADDED