Claude-kit bootstrap-project
Initializes the Claude Code configuration in a new or existing project using the dotforge template.
git clone https://github.com/luiseiman/dotforge
T=$(mktemp -d) && git clone --depth=1 https://github.com/luiseiman/dotforge "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/bootstrap-project" ~/.claude/skills/luiseiman-claude-kit-bootstrap-project && rm -rf "$T"
skills/bootstrap-project/SKILL.mdBootstrap Project
Initialize a complete
.claude/ in the current project using the dotforge template.
Step 0: Determine profile
Check if $ARGUMENTS contains
--profile minimal, --profile standard, or --profile full.
If not specified, use standard as default.
Profiles control what gets installed:
| Component | minimal | standard | full |
|---|---|---|---|
| CLAUDE.md | yes | yes | yes |
| settings.json | yes | yes | yes |
| block-destructive hook | yes | yes | yes |
| lint-on-save hook | no | yes | yes |
| session-report hook | no | yes | yes |
| warn-missing-test hook | no | no | yes (strict profile) |
| rules/ (_common + stack) | yes | yes | yes |
| commands/ | no | yes | yes |
| agents/ + orchestration | no | yes | yes |
| agent-memory/ | no | no | yes |
| CLAUDE_ERRORS.md | no | yes | yes (pre-populated) |
| memory.md rule | no | yes | yes |
Save the profile in
.claude/settings.local.json under env.FORGE_BOOTSTRAP_PROFILE.
Step 1: Detect stack
Use detection rules from
$DOTFORGE_DIR/stacks/detect.md.
Step 2: Confirm with user
Show:
Profile: {{profile}} Detected stack: {{stacks}} Will create: - CLAUDE.md (base template + stack rules) - .claude/settings.json (base permissions + stack) - .claude/rules/ (common rules + stack) - .claude/hooks/ (block-destructive + lint + session-report) [minimal: block-destructive only] - .claude/commands/ (audit, health) [minimal: skipped] - .claude/agents/ + orchestration [minimal: skipped] - CLAUDE_ERRORS.md (empty, for error logging) [minimal: skipped] Proceed? (yes/no)
Adapt the list shown based on the profile (hide components that won't be installed).
Step 3: Generate CLAUDE.md
Use
$DOTFORGE_DIR/template/CLAUDE.md.tmpl as the base.
Replace markers:
→ name of the current directory{{PROJECT_NAME}}
→ detected technologies<!-- forge:stack -->
→ detected build/test commands (package.json scripts, Makefile targets, etc.)<!-- forge:commands -->
Step 4: Generate settings.json
- Load
as the base$DOTFORGE_DIR/template/settings.json.tmpl - For each detected stack, read
$DOTFORGE_DIR/stacks/{stack}/settings.json.partial - Merge: combine the
arrays from all partials with the base (union of sets, no duplicates)allow - Merge: combine the
arrays the same waydeny - Write to
.claude/settings.json
Multi-stack: If multiple stacks are detected (e.g.: python-fastapi + react-vite-ts + docker-deploy), merge ALL partials. Order does not matter — it is a union of sets.
Step 4b: Validate JSON
Before writing
settings.json, validate that the generated JSON is valid:
python3 -c 'import json; json.load(open(".claude/settings.json"))' 2>&1
Or if not yet written, validate the content in memory/string:
echo '<json_content>' | python3 -c 'import json,sys; json.load(sys.stdin)'
If validation fails, show the exact error and DO NOT write the file. Fix the JSON before continuing.
Step 5: Copy hooks
- Copy
→$DOTFORGE_DIR/template/hooks/block-destructive.sh
(ALL profiles).claude/hooks/ - If profile is
orstandard
: copyfull$DOTFORGE_DIR/template/hooks/lint-on-save.sh - If profile is
orstandard
: copyfull$DOTFORGE_DIR/template/hooks/session-report.sh - If profile is
orstandard
: copyfull$DOTFORGE_DIR/template/hooks/detect-stack-drift.sh - If profile is
: copyfull$DOTFORGE_DIR/template/hooks/warn-missing-test.sh
all copied hookschmod +x- For each detected stack, if
exists:$DOTFORGE_DIR/stacks/{stack}/hooks/- Copy the entire hooks directory to
.claude/hooks/{stack}/ - If a
directory exists alongside hooks, copy it too (e.g., hookify needs core/ + hooks/)core/ - Ensure Python scripts are executable
- Copy the entire hooks directory to
Step 6: Copy rules
- Copy
→$DOTFORGE_DIR/template/rules/_common.md.claude/rules/ - For each detected stack, copy rules from
→$DOTFORGE_DIR/stacks/{stack}/rules/.claude/rules/
Step 6b: Domain knowledge scaffolding
Only if domain info was provided (via
/forge init Q4 or user explicitly requests it during bootstrap).
If any detected stack has a
domain: field in its rules (e.g., stacks/trading/rules/trading.md):
- Create
directory.claude/rules/domain/ - Copy domain-tagged rules from the stack into
instead of.claude/rules/domain/.claude/rules/ - Show: "Domain stack detected: {{domain}}. Domain rules copied to .claude/rules/domain/"
If the user provided domain description (from init Q4 context):
- Create
directory if not exists.claude/rules/domain/ - Generate 1-3 seed domain rule files based on the described concepts:
- Each file: frontmatter with
(domain-specific patterns),globs:
tag,domain:
(today)last_verified: - Content: key facts, constraints, business rules — concise, imperative, <40 lines each
- File names: kebab-case matching the domain area (e.g.,
,jira-api.md
)agile-metrics.md
- Each file: frontmatter with
- Show generated files to user for confirmation before writing
If neither condition is met, skip this step entirely — no noise for projects without domain context.
Important: Domain rules in
.claude/rules/domain/ are project-owned. They are NOT tracked in the forge manifest and are NOT updated by /forge sync.
Step 7: Copy commands
Skip if profile is
.minimal
Copy
$DOTFORGE_DIR/template/commands/ → .claude/commands/
Step 8: Copy agents and orchestration rule
Skip if profile is
.minimal
- Copy
→$DOTFORGE_DIR/agents/*.md.claude/agents/ - Copy
→$DOTFORGE_DIR/template/rules/agents.md.claude/rules/agents.md
This gives the project access to the 6 specialized subagents (researcher, architect, implementer, code-reviewer, security-auditor, test-runner) and the orchestration rule that defines when to delegate.
Step 9: Create CLAUDE_ERRORS.md
Skip if profile is
.minimal
For
full profile: pre-populate with the Type column format and example entry.
For standard profile: create empty template.
# Known errors — {{PROJECT_NAME}} Evolving log of errors and lessons learned. Consult BEFORE working in areas with prior errors. Truth hierarchy: source code > CLAUDE.md > CLAUDE_ERRORS.md > auto-memory ## Format | Date | Area | Type | Error | Root cause | Fix | Derived rule | |------|------|------|-------|------------|-----|--------------| Valid types: `syntax`, `logic`, `integration`, `config`, `security`
Step 9b: Create agent-memory/
Only for
profile. Standard creates the directory but not the seed files.full
Create
.claude/agent-memory/ directory for agents with memory: project to persist learnings:
mkdir -p .claude/agent-memory
Create a seed file for each memory-enabled agent so the directory structure is ready:
for agent in implementer architect code-reviewer security-auditor; do touch ".claude/agent-memory/${agent}.md" done
This enables implementer, architect, code-reviewer, and security-auditor to accumulate project-specific knowledge across sessions.
Step 10: Suggest global hook
If the user does not have
detect-claude-changes.sh installed in ~/.claude/settings.json, show:
Tip: For automatic practice capture, install the global hook: Copy hooks/detect-claude-changes.sh to ~/.claude/hooks/ Add in ~/.claude/settings.json under hooks → Stop See docs for details.
Step 11: Generate manifest
Create
.claude/.forge-manifest.json with the SHA256 hash of each file created during bootstrap:
shasum -a 256 <file> | cut -d' ' -f1
Format:
{ "dotforge_version": "<version from $DOTFORGE_DIR/VERSION>", "synced_at": "<current date YYYY-MM-DD>", "stacks": ["<detected-stack-1>", "<detected-stack-2>"], "files": { ".claude/settings.json": {"hash": "sha256:<hash>", "source": "template+stacks"}, ".claude/rules/_common.md": {"hash": "sha256:<hash>", "source": "template"}, ".claude/hooks/block-destructive.sh": {"hash": "sha256:<hash>", "source": "template"}, ".claude/hooks/lint-on-save.sh": {"hash": "sha256:<hash>", "source": "template"} } }
indicates where the file came from:source
,"template"
(if merged from base + stacks), or"template+stacks"
."stacks/<name>"- Include ALL files created in
(rules, hooks, commands, agents)..claude/ - Do NOT include CLAUDE.md or CLAUDE_ERRORS.md (they are in the root, not in
)..claude/
Step 12: Report
Show a summary of created files and suggest running
/audit-project to verify.