/smith:smith [--preset flask-react|fastapi-next|cli-python|express-react]from smith
Initializes SpecKit on new/existing projects by scanning the codebase, conducting an interactive interview, and generating CLAUDE.md, constitution.md, and .specify/ scaffolding with commands and agents.
Ships in smith. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Bootstrap a project with the full SpecKit spec-driven development workflow. This skill scans the existing codebase to pre-fill answers, interviews you about your project, and generates all configuration files.
Arguments: $ARGUMENTS
The SpecKit skill assets (templates, scripts, commands, agents) are bundled at:
~/.claude/skills/smith/
├── templates/ # spec, plan, tasks, checklist, agent-file templates
├── scripts/ # Shell scripts for feature management
├── commands/ # Slash command definitions (smith.specify, etc.)
└── agents/ # Agent definitions (architect, senior-qa, etc.)
Verify this directory exists. If missing, abort with: "SpecKit skill assets not found at ~/.claude/skills/smith/. Please reinstall the skill."
If $ARGUMENTS contains --preset <name>, load preset defaults and skip to Phase 3 (confirmation). Available presets:
| Preset | Stack |
|---|---|
flask-react | Flask 3.x + React 19 + SQLite + Tailwind + Poetry + npm |
fastapi-next | FastAPI + Next.js + PostgreSQL + TypeScript + pip + npm |
cli-python | Python CLI (Click/Typer) + no frontend + Poetry |
express-react | Express.js + React 19 + PostgreSQL + TypeScript + npm |
If no preset, proceed to Phase 2.
Scan the current working directory to detect existing project characteristics. For each signal found, record it as a pre-filled answer. Present findings as a detection report before asking questions.
CLAUDE.md — extract project name and description if presentpackage.json → extract name, descriptionpyproject.toml → extract [tool.poetry].name, descriptionCargo.toml → extract [package].name, descriptiongo.mod → extract module nameREADME.md → extract first heading and description paragraphFrontend:
package.json dependencies: react → React, vue → Vue, svelte → Svelte, next → Next.js, @angular/core → Angularpackage.json dependencies: tailwindcss → Tailwind, styled-components, @emotion/react, sasstsconfig.json exists → TypeScript; otherwise JavaScript.storybook/ dir or @storybook/* in devDepsBackend:
pyproject.toml or requirements.txt: flask → Flask, fastapi → FastAPI, django → Djangopackage.json dependencies: express → Express, fastify → Fastify, hono → Honogo.mod → GoCargo.toml → RustGemfile: rails → Rails, sinatra → SinatraDatabase:
pyproject.toml/requirements.txt: sqlalchemy → SQLAlchemy, psycopg2/asyncpg → PostgreSQL, pymongo → MongoDBpackage.json: prisma → Prisma, typeorm → TypeORM, mongoose → MongoDB, pg → PostgreSQL, better-sqlite3/sqlite3 → SQLite*.db or *.sqlite files → SQLitedocker-compose.yml services: postgres, mysql, redis, mongoPackage Managers:
poetry.lock → Poetry; Pipfile.lock → Pipenv; requirements.txt → pippackage-lock.json → npm; yarn.lock → Yarn; pnpm-lock.yaml → pnpmCargo.lock → Cargo; go.sum → Go modulesAuth:
oauth, jwt, passport, flask-login, next-auth, auth0 in dependencies or code.eslintrc* or eslint.config.* → ESLint; ruff.toml or [tool.ruff] in pyproject.toml → Ruff; .pylintrc → Pylint.prettierrc* → Prettier; Ruff format → Ruffvitest or jest in package.json → Vitest/Jest; pytest in pyproject.toml → Pytest; go test patterns → Go test.github/workflows/ → GitHub Actions; .gitlab-ci.yml → GitLab CI; Jenkinsfile → JenkinsDockerfile or docker-compose.yml → Docker.storybook/ directory → Storybookfrontend/ + backend/ → Web app (separate dirs)src/ only → Single projectapps/ or packages/ → Monorepo (directory heuristic)ios/ or android/ → Mobile.specify/, .claude/commands/, .claude/agents/Detect monorepo orchestration tools by their config files. These take precedence over directory heuristics:
Config file detection:
pnpm-workspace.yaml → pnpm workspacespackage.json with workspaces field → npm/yarn workspaces (parse JSON to confirm)nx.json → Nx monorepoturbo.json → Turborepolerna.json → Lernarush.json → RushWhen monorepo config is found:
packages array from pnpm-workspace.yamlworkspaces field from package.json (can be array or object with packages key)projects from nx.json or scan for project.json files; check workspaceLayout for custom pathspackages array from lerna.json; check useWorkspaces flagprojects array from rush.jsonMultiple tools: If multiple configs exist (e.g., turbo.json + pnpm-workspace.yaml), record both — Turbo is often used alongside a workspace manager.
CLAUDE.md — warn user it will be regenerated (offer to preserve or replace).specify/ — warn and offer to update or replace.claude/commands/ — same.claude/agents/ — same.specify/memory/constitution.mdDisplay findings in a clear table:
## Codebase Detection Report
| Category | Detected | Confidence | Value |
|----------|----------|------------|-------|
| Project Name | Yes | High | "my-project" (from package.json) |
| Structure | Yes | High | Monorepo |
| Monorepo Tool | Yes | High | pnpm workspaces (from pnpm-workspace.yaml) |
| Workspace Packages | Yes | High | packages/*, apps/* |
| Frontend | Yes | High | React 19 + TypeScript |
| Styling | Yes | High | Tailwind CSS |
| Backend | Yes | High | Flask 3.x + Python 3.12 |
| Database | Yes | Medium | SQLite (found .db files) |
| Package Manager | Yes | High | pnpm (from pnpm-lock.yaml) |
| Auth | No | — | Not detected |
| Linting | Yes | High | ESLint + Ruff |
| Testing | Yes | High | Vitest + Pytest |
| CI/CD | Yes | High | GitHub Actions |
| Docker | Yes | High | Docker Compose |
| Storybook | No | — | Not detected |
| Default Branch | Yes | High | development (from origin/HEAD) |
Items marked "No" or "Medium" confidence will be asked about in the interview.
Default-branch detection step: Detect the repository's default/integration branch and record it for the report row above and the base-branch interview question. Run:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'
If this resolves (e.g. development, develop, trunk), use it as the detected value;
if it fails (no origin remote, detached HEAD), fall back to main. This value seeds the
base-branch interview question (below) and is written to the constitution as base_branch:.
Instead of prompting the user interactively, generate a persistent intake document at specs/init-intake.md.
IMPORTANT: This file is the permanent record of project configuration decisions. Never delete it. If it already exists, read it and use the existing answers — do not regenerate unless the user explicitly asks to refresh it.
specs/ directory if it doesn't existmkdir -p specs
specs/init-intake.md does NOT exist, generate itCreate specs/init-intake.md with:
Base-branch question (Workflow Preferences group): Include a question — distinct from the feature-branch naming question (Q25) — that asks which branch is the project's integration/base branch. Smith cuts feature branches from it and targets PRs at it. Wording: "Which branch is your integration/base branch? (Smith cuts feature branches from it and targets PRs at it.)" Auto-detect the recommended value and pre-fill the Answer with it:
git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'
If detection fails (no origin remote, detached HEAD), recommend main. The user may
override the recommendation with any branch name (e.g. a development → main promotion flow
where the user targets development even though origin/HEAD points at main). The chosen
value is written to the constitution frontmatter as base_branch: in Phase 4.
The recommended answers should be based on:
specs/init-intake.md ALREADY exists, read and use itParse the existing file to extract the Answer lines for each question. These answers drive all subsequent file generation in Phase 4. Tell the user: "Found existing specs/init-intake.md — using your recorded answers. Edit the file and re-run /smith to change any decisions."
After generating (or loading) the intake document, walk the user through every question interactively, one at a time. Invoke the smith-question skill for the canonical presentation contract (Context → Options with pros/cons → Recommended + reasoning, one at a time, wait for reply) and never use the interactive AskUserQuestion popup — the intake walk is markdown. The intake adds two init-specific elements on top of that contract (a Current answer line and back navigation). For each question, present:
Then wait for the user's response. Accepted responses (this intake walk's own grammar, a superset of smith-question's with back):
specs/init-intake.md immediatelyAfter all questions are answered, present a final summary table of all answers and ask the user to confirm before proceeding to Phase 4.
Update specs/init-intake.md in real-time as the user answers — do not batch updates.
After the interactive walkthrough is complete and the user confirms, generate all project files.
Create the directory structure and copy files from the skill assets:
mkdir -p .specify/memory .specify/templates .specify/scripts/bash
mkdir -p docs/sessions
mkdir -p specs/questions
mkdir -p .smith/vault/sessions .smith/vault/agents .smith/vault/queue .smith/vault/bank .smith/vault/ledger
mkdir -p .smith/vault/active-workflows
# Bootstrap marker so the workflow-gate hook (PreToolUse) allows the
# rest of /smith init to write the remaining scaffold. Without this,
# the gate would deny every subsequent Write/Edit because no marker
# exists yet. Cleared at the end of /smith init (see Phase 4.10).
cat > .smith/vault/active-workflows/bootstrap.yaml << EOF
workflow: smith
feature: project-initialization
# NOTE: this captures the CURRENT HEAD branch (the branch /smith init runs on),
# not the project's integration/base branch. The `|| echo main` is the
# current-branch fallback for a detached HEAD — it is intentionally NOT the
# configured base branch and must not be replaced with get-base-branch.sh.
branch: $(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo main)
started: $(date -u +"%Y-%m-%dT%H:%M:%S")
EOF
The docs/sessions/ directory holds session chat logs (timestamped Q&A records with YAML frontmatter for searchability). The specs/questions/ directory holds structured question files generated before complex changes (numbered questions with options, recommendations, and answer fields). Both are required by the global workflow tenets in ~/.claude/CLAUDE.md.
The .smith/vault/ledger/ directory holds the Ledger — Smith's learned knowledge from past workflow executions. After creating the directory, scaffold the Ledger template files: patterns.md, antipatterns.md, tool-preferences.md, edge-cases.md, project-quirks.md (each with a header and empty-state message), and meta.yaml (initialized with creation date and zero counters). See the smith-reflect skill for the exact file formats.
Seed the browser_verification.urls key in .smith/security-config.json (the security-guard-mcp-browser.sh hook's config; see docs/security-model.md) so a freshly-initialized project always has a well-formed schema for that guard to read, even before any environment is named. Non-destructive: if the file doesn't exist yet, create it containing just this key; if it exists, merge in the key only when browser_verification.urls isn't already present, preserving any existing warn_only_mode/allowed_commands/production_domains/etc. content untouched. bash+zsh-safe read-modify-write via python3:
python3 - "$PWD/.smith/security-config.json" << 'PYEOF'
import json, os, sys
path = sys.argv[1]
config = {}
if os.path.isfile(path):
try:
with open(path) as f:
config = json.load(f)
except Exception:
config = {}
bv = config.get("browser_verification")
if not isinstance(bv, dict) or "urls" not in bv:
bv = bv if isinstance(bv, dict) else {}
bv.setdefault("urls", {"staging": [], "production": []})
config["browser_verification"] = bv
with open(path, "w") as f:
json.dump(config, f, indent=2)
f.write("\n")
PYEOF
Seed the security_review key in .smith/config.json (this feature's data-model.md §1 schema; see docs/security-model.md's "Security Review Pass" section) so an already-existing .smith/config.json also receives it. A brand-new .smith/config.json already gets this key for free from hooks/session-start-logger.sh's whole-file copy of templates/config.default.json, which now includes security_review — but that whole-file-copy-if-absent logic never touches a file that already exists, which is the case on every project that has run even one Claude Code session before this feature shipped. Same non-destructive merge idiom as /smith-update's §5.1c sibling (skills/smith-update/SKILL.md): a bash-level existence gate plus a python-level isinstance(config, dict) check, so an absent or malformed file is left alone rather than (re)created with only this key. Merge the key only when security_review isn't already present at all, preserving every other existing key untouched. If .smith/config.json does not exist at all, leave it absent — the template copy described above already handles a fresh project. bash+zsh-safe read-modify-write via python3:
if [ -f "$PWD/.smith/config.json" ]; then
python3 - "$PWD/.smith/config.json" << 'PYEOF'
import json, sys
path = sys.argv[1]
try:
with open(path) as f:
config = json.load(f)
except Exception:
config = None
if isinstance(config, dict) and "security_review" not in config:
config["security_review"] = {
"enforcement_tier": "flag",
"review_model": "opus",
"layers": {
"secret_scan": True,
"sast": True,
"llm_review": True
},
"excludes": [],
"allowlist_globs": ["package-lock.json", "yarn.lock"]
}
with open(path, "w") as f:
json.dump(config, f, indent=2)
f.write("\n")
PYEOF
fi
Seed the supply_chain key in .smith/config.json (this feature's data-model.md §1 schema; see docs/security-model.md's "Supply-Chain & License Review" section) so an already-existing .smith/config.json also receives it. A brand-new .smith/config.json already gets this key for free from hooks/session-start-logger.sh's whole-file copy of templates/config.default.json, which now includes supply_chain — but that whole-file-copy-if-absent logic never touches a file that already exists, which is the case on every project that has run even one Claude Code session before this feature shipped. Same non-destructive merge idiom as /smith-update's §5.1d sibling (skills/smith-update/SKILL.md): a bash-level existence gate plus a python-level isinstance(config, dict) check, so an absent or malformed file is left alone rather than (re)created with only this key. Merge the key only when supply_chain isn't already present at all, preserving every other existing key untouched. If .smith/config.json does not exist at all, leave it absent — the template copy described above already handles a fresh project. bash+zsh-safe read-modify-write via python3:
if [ -f "$PWD/.smith/config.json" ]; then
python3 - "$PWD/.smith/config.json" << 'PYEOF'
import json, sys
path = sys.argv[1]
try:
with open(path) as f:
config = json.load(f)
except Exception:
config = None
if isinstance(config, dict) and "supply_chain" not in config:
config["supply_chain"] = {
"cve_scan": True,
"license_inventory": True,
"license_policy": {
"allow": [],
"deny": []
},
"timeout_seconds": 60,
"excludes": []
}
with open(path, "w") as f:
json.dump(config, f, indent=2)
f.write("\n")
PYEOF
fi
Seed the quality key in .smith/config.json (spec FR-21, plan.md's §Contracts schema) so an already-existing .smith/config.json also receives it. A brand-new .smith/config.json already gets this key for free from hooks/session-start-logger.sh's whole-file copy of templates/config.default.json, which now includes quality — but that whole-file-copy-if-absent logic never touches a file that already exists, which is the case on every project that has run even one Claude Code session before this feature shipped. Same non-destructive merge idiom as /smith-update's §5.1e sibling (skills/smith-update/SKILL.md): a bash-level existence gate plus a python-level isinstance(config, dict) check, so an absent or malformed file is left alone rather than (re)created with only this key. Merge the key only when quality isn't already present at all, preserving every other existing key untouched. If .smith/config.json does not exist at all, leave it absent — the template copy described above already handles a fresh project. bash+zsh-safe read-modify-write via python3:
if [ -f "$PWD/.smith/config.json" ]; then
python3 - "$PWD/.smith/config.json" << 'PYEOF'
import json, sys
path = sys.argv[1]
try:
with open(path) as f:
config = json.load(f)
except Exception:
config = None
if isinstance(config, dict) and "quality" not in config:
config["quality"] = {
"test": [],
"lint": [],
"typecheck": [],
"coverage": {
"command": None,
"minimum_percent": None,
"regex": None
},
"function_length": {
"soft": 50,
"decompose": 100
},
"timeout_seconds": 120,
"excludes": []
}
with open(path, "w") as f:
json.dump(config, f, indent=2)
f.write("\n")
PYEOF
fi
Seed the scheduled_audits key in .smith/config.json (spec FR-19/FR-20 of the 58-scheduled-audits feature, plan.md's §Contracts schema) so an already-existing .smith/config.json also receives it. A brand-new .smith/config.json already gets this key for free from hooks/session-start-logger.sh's whole-file copy of templates/config.default.json, which now includes scheduled_audits — but that whole-file-copy-if-absent logic never touches a file that already exists, which is the case on every project that has run even one Claude Code session before this feature shipped. Same non-destructive merge idiom as /smith-update's §5.1f sibling (skills/smith-update/SKILL.md): a bash-level existence gate plus a python-level isinstance(config, dict) check, so an absent or malformed file is left alone rather than (re)created with only this key. Merge the key only when scheduled_audits isn't already present at all, preserving every other existing key untouched. If .smith/config.json does not exist at all, leave it absent — the template copy described above already handles a fresh project. enabled: false MUST be the merged value — no project gets unattended scheduled-audit behavior without explicit opt-in. bash+zsh-safe read-modify-write via python3:
if [ -f "$PWD/.smith/config.json" ]; then
python3 - "$PWD/.smith/config.json" << 'PYEOF'
import json, sys
path = sys.argv[1]
try:
with open(path) as f:
config = json.load(f)
except Exception:
config = None
if isinstance(config, dict) and "scheduled_audits" not in config:
config["scheduled_audits"] = {
"enabled": False,
"cadence_days": 7,
"subsets": ["requirements", "codequality", "security", "dependencies", "workflow"],
"systems": "--all",
"skip_pdf": True
}
with open(path, "w") as f:
json.dump(config, f, indent=2)
f.write("\n")
PYEOF
fi
Seed the question_gate key in .smith/config.json (spec FR-15/FR-16 of the 67-deterministic-questions feature) so an already-existing .smith/config.json also receives it. A brand-new .smith/config.json already gets this key for free from hooks/session-start-logger.sh's whole-file copy of templates/config.default.json, which now includes question_gate — but that whole-file-copy-if-absent logic never touches a file that already exists. Same non-destructive merge idiom as /smith-update's §5.1g sibling (skills/smith-update/SKILL.md): a bash-level existence gate plus a python-level isinstance(config, dict) check, so an absent or malformed file is left alone rather than (re)created with only this key. Merge the key only when question_gate isn't already present at all, preserving every other existing key untouched. If .smith/config.json does not exist at all, leave it absent — the question-gate-guard.sh hook treats an absent key as off (fail-open) until the project is re-seeded, so a fresh project gets deny from the template copy while an un-migrated one is never silently changed. bash+zsh-safe read-modify-write via python3:
if [ -f "$PWD/.smith/config.json" ]; then
python3 - "$PWD/.smith/config.json" << 'PYEOF'
import json, sys
path = sys.argv[1]
try:
with open(path) as f:
config = json.load(f)
except Exception:
config = None
if isinstance(config, dict) and "question_gate" not in config:
config["question_gate"] = {
"mode": "deny"
}
with open(path, "w") as f:
json.dump(config, f, indent=2)
f.write("\n")
PYEOF
fi
Copy from ~/.claude/skills/smith/:
templates/* → .specify/templates/scripts/* → .specify/scripts/bash/This scripts/* glob copies every helper in skills/smith/scripts/, including
get-base-branch.sh and clear-active-workflow.sh — no per-script copy instruction is
needed, and get-base-branch.sh is scaffolded to .specify/scripts/bash/get-base-branch.sh
automatically.
Make scripts executable:
chmod +x .specify/scripts/bash/*.sh
.specify/memory/constitution.md)Generate a constitution file using the interview answers. Structure:
---
base_branch: [from the base-branch interview answer; default `main` if unanswered]
---
# [Project Name] Constitution
## Core Principles
### I. Code Quality Standards
[Generated based on detected linters, languages, component patterns]
### II. Testing Standards
[Generated based on detected test frameworks, coverage target from Q20]
### III. User Experience Consistency
[Generated only if frontend detected — based on styling framework, component tool]
### IV. Performance Requirements
[Generated from Q21 answers, or standard defaults]
## Technology Constraints
[Generated from tech stack answers Q5-Q13]
## Development Workflow
### Branch Strategy
[Generated from Q25 (feature-branch naming) and the base-branch question. State the
configured integration/base branch — the value written to `base_branch:` in the
frontmatter above — so it is human-readable here as well as machine-readable in the
frontmatter that `get-base-branch.sh` parses.]
### SpecKit Workflow
[Standard — always included]
### Commit Standards
[Generated from Q26, Q28]
### Quality Gates
[Generated from Q23, Q27]
## Governance
[Standard boilerplate with project name, version 1.0.0, current date]
Use the following rules for content generation:
Monorepo-specific constitution rules (only if monorepo detected):
nx affected:test)workspace:*)Generate a CLAUDE.md file at the project root using the interview answers. Structure:
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
[Project name and description from Q1-Q2]
### Project Governance
See `.specify/memory/constitution.md` for binding project principles.
### Business Domain
[Domain from Q3, entities from Q4 if provided]
## Tech Stack
### Frontend
[From Q5-Q7, only if frontend exists]
### Backend
[From Q8-Q12, only if backend exists]
### Monorepo Structure
[Generated only if monorepo detected — include workspace layout, package locations, and orchestration tool]
## Git Commit Guidelines
[Generated from Q26, Q28 — include linking format, co-author trailer]
## Common Commands
### CI/CD Scripts
[Generated based on detected CI scripts, or suggest creating them]
### Docker Development
[Generated only if Docker detected]
### Frontend Development
[Generated from frontend stack — npm/yarn commands]
### Backend Development
[Generated from backend stack — poetry/pip commands, test commands]
### Database
[Generated from database choice — migration commands if ORM detected]
### Monorepo Commands
[Generated only if monorepo detected — include workspace-aware commands]
## Architecture
### Backend Structure
[Generated from directory scan or standard template for the stack]
### Frontend Structure
[Generated from directory scan or standard template for the stack]
### Key Patterns
[Generated based on stack — e.g., "Application Factory" for Flask, "API Routes" for Next.js]
## SpecKit Workflow
[Standard section — always included, customized with review gate selections from Q27]
### Issue-Driven Workflow
[Standard — customized with issue tracker from Q24]
### Subagent Usage
[Standard — always included]
### Review Gates (Mandatory)
[Generated from Q27 selections]
### When Asked "What's Next?"
[Standard — always included]
### Directory Structure
[Standard .specify/ structure]
### Branch Naming
[From Q25]
## E2E Testing with Playwright MCP
[Generated only if Playwright MCP selected in Q19 — reference the "MCP-First Browser Verification" section (`templates/claude-md-additions.md`, appended by `/smith-index --migrate-templates`) by name for the tool-presence/`mcp_mode`/interactive decision chain and fallback idiom; do not restate that chain here]
IMPORTANT rules for CLAUDE.md generation:
## Recent Changes / changelog section, and do NOT @-reference
a doc that any workflow then appends per-change prose to (e.g. a data-model.md
with a growing "Last Updated" header). @-referenced files are loaded into context
in full, every session, and per-change appends turn them into multi-hundred-KB
context sinks that also cause merge conflicts on every branch. The durable
per-change record already lives in .smith/vault/sessions/ + the Ledger + git —
those ARE the changelog. Keep CLAUDE.md and any @-referenced doc small and
stable: structural/durable content only (overview, tech stack, ERD, entity tables,
enums), never accumulating history.Monorepo-specific CLAUDE.md content (only if monorepo detected):
For the ### Monorepo Structure section, include:
packages/*, apps/*)For the ### Monorepo Commands section, generate tool-specific commands:
pnpm workspaces:
pnpm install # Install all workspace dependencies
pnpm -F <package> add <dep> # Add dependency to specific package
pnpm -F <package> run <script> # Run script in specific package
pnpm -r run build # Run build in all packages
pnpm -F "...<package>" test # Test package and its dependents
npm/yarn workspaces:
npm install # Install all workspace dependencies
npm -w <package> run <script> # Run script in specific package
npm run <script> --workspaces # Run script in all workspaces
Nx:
npx nx run <project>:<target> # Run target in specific project
npx nx affected:build # Build only affected projects
npx nx affected:test # Test only affected projects
npx nx graph # Visualize project dependencies
npx nx run-many -t build # Run build in all projects
Turborepo:
turbo run build # Run build with caching
turbo run test # Run tests with caching
turbo run build --filter=<pkg> # Build specific package
turbo run build --filter=...<pkg> # Build package and dependents
Lerna:
lerna bootstrap # Link local packages
lerna run build # Run build in all packages
lerna run test --scope=<pkg> # Run test in specific package
lerna publish # Publish changed packages
Rush:
rush install # Install dependencies
rush build # Build all projects
rush build -t <project> # Build specific project and deps
rush test # Run tests
.claude/commands/Create the project's .claude/commands/ directory and copy command files from the skill assets:
mkdir -p .claude/commands
Copy from ~/.claude/skills/smith/commands/:
smith.*.md files → .claude/commands/review-respond.md → .claude/commands/.claude/agents/ (Optional)If the user selected review gates in Q27, create custom agent definitions:
mkdir -p .claude/agents
Copy from ~/.claude/skills/smith/agents/:
architect.md → .claude/agents/product-manager.md → .claude/agents/senior-qa.md, staff-backend.md, staff-frontend.md, staff-fullstack.md, staff-infrastructure.mdAfter copying, replace [PROJECT_NAME] placeholders in the agent files with the actual project name from Q1.
.claude/settings.json (if not exists)If no .claude/settings.json exists, create one with sensible defaults:
{
"permissions": {
"allow": [
"Bash(git status:*)",
"Bash(git log:*)",
"Bash(git diff:*)",
"Bash(git branch:*)",
"Bash(./.specify/scripts/*:*)",
"Bash(.specify/scripts/bash/clear-active-workflow.sh:*)",
"Bash(.specify/scripts/bash/get-base-branch.sh:*)"
]
}
}
The clear-active-workflow.sh entry is listed explicitly so Smith workflow cleanup still works on projects that add Bash(rm:*) to the deny list as a safety rail. The helper is narrow (single file, no globs, path-escape guarded) and lets skills remove the active-workflow marker without weakening the deny rule.
The get-base-branch.sh entry is listed explicitly for the same reason: every Smith skill that needs the integration branch resolves it via .specify/scripts/bash/get-base-branch.sh, so projects with strict Bash allow/deny rails must permit it. The helper is read-only (no writes, no globs, no recursion) and always echoes a branch name (main on any non-resolution).
Add framework-specific permissions based on detected stack:
"Bash(npm run:*)", "Bash(npm install:*)""Bash(poetry run:*)", "Bash(poetry install:*)""Bash(docker:*)", "Bash(docker compose:*)""Bash(./scripts/*:*)"Add monorepo-specific permissions based on detected orchestration tool:
"Bash(pnpm:*)", "Bash(pnpm -F:*)", "Bash(pnpm -r:*)""Bash(npx nx:*)", "Bash(nx:*)""Bash(turbo:*)", "Bash(turbo run:*)""Bash(lerna:*)", "Bash(npx lerna:*)""Bash(rush:*)"If .claude/settings.json already exists, do NOT overwrite — inform the user they may want to add the .specify/scripts permission manually, plus Bash(.specify/scripts/bash/clear-active-workflow.sh:*) if their config includes a broad Bash(rm:*) deny rule (needed so Smith workflow cleanup can remove active-workflow markers), and Bash(.specify/scripts/bash/get-base-branch.sh:*) so base-branch resolution works under strict Bash rails.
.gitignore EntriesIf .gitignore exists, append SpecKit-related entries if not already present:
# SpecKit / Claude Code
.claude/agent-memory/
.claude/todos/
If .gitignore doesn't exist, create one with standard patterns for the detected stack plus the above entries.
Then merge the canonical Smith vault & index policy (the team-shareable selective policy from feature 36). This is a single source of truth shipped as a template asset — do NOT inline-duplicate the list here; read it from the installed path and merge idempotently using sentinel markers.
Source template (prefer the installed copy, fall back to the repo-dev copy):
~/.claude/skills/smith-index/templates/.gitignore-smith-additionsskills/smith-index/templates/.gitignore-smith-additionsAnd the matching .gitattributes policy (de-emphasizes generated .meta in diffs):
~/.claude/skills/smith-index/templates/.gitattributes-smith-additionsskills/smith-index/templates/.gitattributes-smith-additionsIdempotent sentinel merge contract:
# >>> smith-gitignore-policy >>> … # <<< smith-gitignore-policy <<< (and # >>> smith-gitattributes-policy >>> … # <<< smith-gitattributes-policy <<< for .gitattributes)..gitattributes if it does not exist).Staleness guard (Feature 38). A pre-Feature-36 installed template is the
inverse policy (it IGNORES index/files/ + index/systems/) and lacks the
# >>> smith-gitignore-policy >>> sentinel. /smith init has no upstream clone to
auto-repair from (unlike /smith-update), so if the resolved installed template is
stale it must NOT be applied. Prefer the repo-dev copy if it is current; otherwise
warn the user to run /smith-update and SKIP the policy merge rather than writing
the wrong (inverted) policy.
Run this self-contained python3 block (robust sentinel replace-or-append — no sed portability issues):
# Resolve the template source (installed path first, repo-dev fallback).
SENTINEL='# >>> smith-gitignore-policy >>>'
SMITH_TPL_DIR="$HOME/.claude/skills/smith-index/templates"
[ -f "$SMITH_TPL_DIR/.gitignore-smith-additions" ] || SMITH_TPL_DIR="skills/smith-index/templates"
# Staleness guard: if the resolved template lacks the sentinel, it's a pre-Feature-36
# (inverted) policy. Try the repo-dev copy; if that's also stale/absent, skip the merge.
if ! grep -qF "$SENTINEL" "$SMITH_TPL_DIR/.gitignore-smith-additions" 2>/dev/null; then
if grep -qF "$SENTINEL" "skills/smith-index/templates/.gitignore-smith-additions" 2>/dev/null; then
SMITH_TPL_DIR="skills/smith-index/templates"
else
echo "WARNING: the installed Smith gitignore template is stale (pre-Feature-36,"
echo " no sentinel marker) and no current repo-dev copy was found. Skipping"
echo " the .gitignore/.gitattributes policy merge to avoid writing the wrong"
echo " (inverted) policy. Run /smith-update to refresh the installed template,"
echo " then re-run /smith init (or just /smith-update, which re-merges the policy)."
SMITH_TPL_DIR=""
fi
fi
if [ -n "$SMITH_TPL_DIR" ]; then
python3 - "$SMITH_TPL_DIR" <<'PYEOF'
import sys, pathlib
tpl_dir = pathlib.Path(sys.argv[1])
def merge(target_path, tpl_path, open_marker, close_marker):
tpl = pathlib.Path(tpl_path)
if not tpl.exists():
print(f"WARNING: template not found: {tpl_path} — skipping")
return
block = tpl.read_text().rstrip("\n") + "\n"
target = pathlib.Path(target_path)
existing = target.read_text() if target.exists() else ""
if open_marker in existing and close_marker in existing:
# Replace the managed region (inclusive) with the fresh block.
pre = existing.split(open_marker, 1)[0]
post = existing.split(close_marker, 1)[1]
new = pre.rstrip("\n") + ("\n\n" if pre.strip() else "") + block + post.lstrip("\n")
action = "refreshed"
else:
sep = "" if (not existing or existing.endswith("\n\n")) else ("\n" if existing.endswith("\n") else "\n\n")
new = existing + sep + block
action = "appended"
target.write_text(new)
print(f"{action}: {open_marker.split()[1]} in {target_path}")
merge(".gitignore", tpl_dir / ".gitignore-smith-additions",
"# >>> smith-gitignore-policy >>>", "# <<< smith-gitignore-policy <<<")
merge(".gitattributes", tpl_dir / ".gitattributes-smith-additions",
"# >>> smith-gitattributes-policy >>>", "# <<< smith-gitattributes-policy <<<")
PYEOF
fi # end: SMITH_TPL_DIR non-empty (merge not skipped by staleness guard)
The policy is a negative list: .smith/ is NOT ignored wholesale. Only the specific volatile paths in the block are ignored; everything else under .smith/ (the manifest.md, config/, index/files/ + index/systems/ .meta describe layer, ledger/, bank/, agents/, and sessions/*.md) is committed and shared with the team. Re-running /smith init replaces the managed region in place, so the block never duplicates.
Smith v2 path-resolver tier 1 reads .specify/systems/<id>/spec.md YAML frontmatter (system, paths) to bucket files into systems. Declaring systems upfront lets /smith-index route files correctly from day one. This step is optional — skip if the project is small, exploratory, or doesn't yet have clear system boundaries. Systems can also be added later manually or via /smith-migrate-system-paths on a project that grew .specify/systems/ organically.
Ask the operator:
"Does this project have logical systems you'd like to declare upfront, so
/smith-indexcan route files correctly from day one? (yes/skip)"
If the operator answers anything other than yes / y / Y, skip this step silently.
If yes, enter a per-system loop:
email-pipeline, command-center, auth). Re-prompt on blank input. Strip surrounding whitespace.system-NN-<short-name> where NN is the count of .specify/systems/system-*/ directories that exist so far in this run, plus one, zero-padded to two digits (01, 02, ...).*, ?, [, ], {, }, !) — v1 supports literal prefixes only. Print: "Glob characters not allowed in v1 — please enter a literal prefix." and re-prompt for the same slot./ if missing.~/.claude/skills/smith/templates/system-spec-template.md, and write it to .specify/systems/<id>/spec.md with these substitutions in the YAML frontmatter block ONLY (do not touch the body):
system: system-<NN>-<short-kebab-name> → system: <id> - <relative-prefix>/ is replaced by one - <prefix> line per collected entry, preserving two-space indentation. If the list is empty, emit paths: [] on a single line in place of the multi-line block.status: draft stays as-is.also_affects: [] stays as-is.Validation invariant (enforced by step 3): every prefix written into the paths: list contains no glob characters and ends with /. The resolver loads paths defensively, but this step is also the first line of defense.
After the loop completes, print a summary:
Scaffolded N system spec(s):
- .specify/systems/system-01-<name>/spec.md (2 paths)
- .specify/systems/system-02-<name>/spec.md (1 path)
You can edit the body of each spec at any time. Run `/smith-migrate-system-paths` to bulk-propose paths from existing prose.
If the operator types skip at any per-system prompt, skip that system (do not write a spec for it) and continue the outer "another system?" loop.
Cross-reference — WordPress-shaped projects. If the operator separately
runs /smith-index --init-system-paths on a project whose root contains
both wp-load.php and wp-includes/, that flag now auto-seeds the
generated system-paths.json stub with 17 WordPress-core exclusion rules
(see skills/smith-index/SKILL.md). This is unrelated to the system-spec
scaffolding above and is not triggered by /smith init itself — the
operator (or a later workflow step) must invoke /smith-index --init-system-paths explicitly for it to apply.
The bootstrap marker created in Phase 4.1 has done its job — Phase 4 file generation is complete. Remove it via the shipped helper:
.specify/scripts/bash/clear-active-workflow.sh "bootstrap"
After this, the workflow-gate hook enforces normal discipline: subsequent file edits require one of the four top-level workflows (/smith-new, /smith-bugfix, /smith-debug, /smith-build) or /smith-finish to be active.
After generating all files, present a summary:
## SpecKit Initialization Complete
### Files Created
| File | Status |
|------|--------|
| `CLAUDE.md` | Created / Updated |
| `.specify/memory/constitution.md` | Created |
| `.specify/templates/` (5 files) | Created |
| `.specify/scripts/bash/` (5 files) | Created |
| `.claude/commands/` (10 files) | Created |
| `.claude/agents/` (7 files) | Created |
| `.claude/settings.json` | Created / Skipped (exists) |
| `docs/sessions/` | Created (session chat logs) |
| `specs/questions/` | Created (pre-implementation question files) |
| `specs/init-intake.md` | Created (permanent project config decisions) |
| `.specify/systems/system-*/spec.md` (N files) | Created / Skipped (4.8) |
### Available Commands
| Command | Description |
|---------|-------------|
| `/smith.specify <description>` | Create feature spec |
| `/smith.clarify` | Clarify spec ambiguities |
| `/smith.plan` | Generate implementation plan |
| `/smith.tasks` | Generate task breakdown |
| `/smith.analyze` | Cross-artifact consistency check |
| `/smith.implement` | Execute tasks |
| `/smith.checklist` | Generate quality checklist |
| `/smith.constitution` | Update project constitution |
### Next Steps
1. Review `CLAUDE.md` and `.specify/memory/constitution.md` — adjust any generated content
2. Commit the generated files: `git add CLAUDE.md .specify/ .claude/ && git commit -m "chore: initialize SpecKit workflow"`
3. Start your first feature: `/smith.specify <your feature description>`
~/.claude/skills/smith/ and writes to the current working directoryCLAUDE.md exists, offer to merge or replace/smith.init again should detect existing setup and offer to updateagents/architect.md (opens in a new tab)agents/product-manager.md (opens in a new tab)agents/senior-qa.md (opens in a new tab)agents/staff-backend.md (opens in a new tab)agents/staff-frontend.md (opens in a new tab)agents/staff-fullstack.md (opens in a new tab)agents/staff-infrastructure.md (opens in a new tab)scripts/audit-pdf-generator.mjs (opens in a new tab)scripts/check-prerequisites.sh (opens in a new tab)scripts/clear-active-workflow.sh (opens in a new tab)scripts/common.sh (opens in a new tab)scripts/create-new-feature.sh (opens in a new tab)scripts/get-base-branch.sh (opens in a new tab)scripts/setup-plan.sh (opens in a new tab)scripts/update-agent-context.sh (opens in a new tab)templates/agent-file-template.md (opens in a new tab)templates/checklist-template.md (opens in a new tab)templates/plan-template.md (opens in a new tab)templates/spec-template.md (opens in a new tab)templates/system-spec-template.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
project-setup, spec-driven-development, scaffolding, specify
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, hooks: Invalid string: must start with "./", hooks: Invalid string: must end with ".json", skills: Invalid string: must start with "./"
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, hooks: Invalid string: must start with "./", hooks: Invalid string: must end with ".json", skills: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
36 skills in this plugin
/smith-activityOpen the local Smith activity dashboard — one loopback daemon serving every registered project, showing live workflow phases, sessions, subagents, worktrees, token usage and divergence findings. Start, stop, restart or check the daemon, or open a new tab for the current project./smith-analyzePerform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation./smith-auditRun a comprehensive audit on a specific system or all systems. Prompts for system selection, then runs all sub-audits and produces a unified report./smith-bankCaptures ideas mid-conversation and stores them in the vault for later processing. Use when the user wants to save an idea, park a thought, or come back to something later. Supports listing, processing, editing, and prioritizing banked ideas./smith-bugfixLightweight fix workflow for bugs and small changes. Autonomous from invocation through merged PR — no questions gate, no spec generation, no planning phase./smith-buildAutonomous build phase — generates tasks, implements, tests, commits, pushes, merges, and produces release notes. Runs without user interaction.Other plugins' skills for the same job