Bootstrap a project
CLAUDE.mdfrom the template indocs/templates/. Detects stack signals, asks 5 focused questions, writes a compliant file under the project root.
Triggers: /project-claude-init, init project claude, bootstrap claude, create project CLAUDE.md, set up claude in this project
Process
Step 0 — Refuse to run in the wrong context
This skill is for projects OTHER than the claude-config repo. Refuse and stop
if any of these is true:
- CWD basename is
claude-configoragent-config. - CWD contains both
install.shandskills/_shared/.
Print: This skill is for external projects. The claude-config repo edits its own CLAUDE.md directly. and stop.
Step 1 — Check for existing CLAUDE.md
If CLAUDE.md already exists at CWD root, STOP and ask:
A
CLAUDE.mdalready exists. Choose one:
- Audit the existing file with
/config-audit(recommended).- Overwrite with a fresh template (destructive).
- Cancel.
Wait for the answer. Only proceed to Step 2 if the user explicitly picks overwrite.
Step 2 — Locate the template
Read ~/.claude/docs/templates/project-claude-template.md. If missing, fall
back to the repo path if the user has the claude-config repo cloned
locally (~/agent-config/docs/templates/... or ~/claude-config/docs/...).
If neither path resolves, STOP and tell the user to run install.sh from
claude-config on this machine first.
Step 3 — Detect stack signals
Scan the project root (one level deep) for stack indicators:
| File present | Stack hint |
|---|---|
package.json |
Node.js. Read dependencies to refine: next, react, vue, svelte, express, fastify, nest. |
pyproject.toml / requirements.txt |
Python. |
go.mod |
Go. |
Cargo.toml |
Rust. |
pom.xml / build.gradle |
Java/Kotlin. |
Gemfile |
Ruby. |
composer.json |
PHP. |
mix.exs |
Elixir. |
Also detect test/lint/build commands from package.json scripts or
equivalents.
Cache the detected stack signals — they prefill answers in Step 4 but do NOT bypass user confirmation.
Step 4 — Ask the 5 wizard questions
Ask one at a time. STOP after each.
Q1 — Stack description
One-line stack description (prefilled from detection — confirm or edit):
Detected: <stack signals from Step 3>
Q2 — Conventions
What conventions does this project enforce that the global layer does not
cover? List 1-5 bullets, or "none" if the project uses standard conventions.
Q3 — Commands
Commands (one per line, leave blank to skip):
Install: <prefilled from package.json scripts if available>
Dev: <prefilled>
Test: <prefilled>
Lint: <prefilled>
Type check: <prefilled>
Build: <prefilled>
Q4 — Domain glossary
Does this project have non-obvious domain terms that affect code reading
(e.g. "Wallet", "Reconciliation", "Tenant")? List 0-10 terms with one-line
definitions, or "none".
Q5 — Overrides global
Do you need to override any global rule for this project? If yes, name the
rule and the reason. If unsure, answer "none" — overrides should be rare and
deliberate.
Step 5 — Render preview
Use the template skeleton. Fill placeholders with the answers. Drop any section the user answered with "none" or blank. Show the rendered file inside a fenced code block. Ask:
Confirm to write
CLAUDE.mdat the project root? (y / edit / n)
y → write. edit → ask which section, loop back. n → abort.
Step 6 — Write
Write CLAUDE.md at CWD root. Do NOT touch any other file.
Step 7 — Post-write checklist
Print to the user:
Created: CLAUDE.md (<N> lines).
Recommended next steps:
1. Review the file.
2. Run /config-audit from this directory to check cross-layer duplication.
3. Commit the file.
Reminders:
- This file is the project layer. The global layer (from claude-config)
still applies in every session.
- Do not restate global rules here. If you need to deviate, use the
"Overrides global" section.
Step 8 — Save to engram
Call mem_save:
- title:
Initialized CLAUDE.md for <project name> - type:
config - topic_key:
project-init/<project-name> - content: structured What/Why/Where/Learned with the 5 wizard answers.
Rules
- Never run in the
claude-config/agent-configrepo. That repo edits its ownCLAUDE.mddirectly. - Never overwrite an existing
CLAUDE.mdwithout explicit user confirmation. - Never write outside CWD. This skill produces exactly one file:
<cwd>/CLAUDE.md. - Never restate global rules in the generated file. If the user offers global rules during the wizard (response format, verification, engram), refuse and point to the global layer.
- Stop after every question. Never bundle. Never default silently.
- Keep the generated file under 60 lines. Empty sections are dropped, not preserved.
- Do not commit. Do not run any audit automatically. Those decisions are the user's.