From loaf
Bootstraps new or existing projects through intelligent state detection, structured interviews, and document population. Use when the user asks "how do I start a new project?", "set up Loaf," or "bootstrap my project." Produces populated project d...
How this skill is triggered — by the user, by Claude, or both
Slash command
/loaf:bootstrapThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
First-contact project setup: detect state, interview the builder, populate project documents.
First-contact project setup: detect state, interview the builder, populate project documents.
Input: $ARGUMENTS
AskUserQuestiondocs/BRIEF.mddocs/BRIEF.md, docs/VISION.md, .agents/AGENTS.md at minimum) exist and contain populated content.claude/CLAUDE.md -> .agents/AGENTS.md and ./AGENTS.md -> .agents/AGENTS.md.agents/sessions/ capturing key decisions and interview exchanges| Topic | Reference | Use When |
|---|---|---|
| Interview Guide | interview-guide.md | Conducting the builder interview (all modes) |
Bootstrap is the intelligent half of the 0-to-1 experience. The mechanical half (loaf setup) handles scaffolding, building, and installing. Bootstrap handles everything that requires understanding: reading briefs, interviewing the builder, populating project documents, and recording decisions.
The goal is to go from "I have an idea" (or "I have a codebase") to a populated set of project documents -- BRIEF.md, VISION.md, STRATEGY.md, ARCHITECTURE.md, and AGENTS.md -- through a structured but conversational process.
Parse $ARGUMENTS to determine brief intake mode:
| Input Pattern | Mode | Example |
|---|---|---|
| Text description | Inline brief | /loaf:bootstrap Build a CLI tool that manages knowledge bases |
| File path | File brief | /loaf:bootstrap ~/Desktop/project-brief.md |
| Folder path | Folder brief | /loaf:bootstrap ./docs/ |
| Empty | Interactive | /loaf:bootstrap |
After determining intake mode, proceed to state detection -- they are independent concerns.
Automatically classify the project into one of three modes. Do not ask the user to choose -- detect and confirm.
| Signal | Brownfield | Greenfield + Brief | Greenfield + Empty |
|---|---|---|---|
.git with commit history | Yes | -- | -- |
| Source code files | Yes | -- | -- |
package.json, Gemfile, go.mod, etc. | Yes | -- | -- |
| README.md or existing docs | Yes | -- | -- |
docs/BRIEF.md or brief passed as argument | -- | Yes | -- |
| Empty/minimal directory, no brief | -- | -- | Yes |
.git directory and run git log --oneline -5 2>/dev/null to verify commit historydocs/BRIEF.md or brief input from $ARGUMENTSBriefly state what was found and proceed. Examples:
If the user corrects the detection, adjust and proceed.
The canonical brief location is docs/BRIEF.md. Handle each intake form:
When $ARGUMENTS contains a text description (not a file or folder path):
docs/BRIEF.md with frontmatterWhen $ARGUMENTS is a path to a file:
docs/BRIEF.md -- use in place, add frontmatter if missingdocs/BRIEF.md with original_path in frontmatterWhen $ARGUMENTS is a path to a directory:
docs/BRIEF.md with source: folderWhen $ARGUMENTS is empty and no docs/BRIEF.md exists:
docs/BRIEF.md with source: interviewFollow templates/brief.md for the full brief template. Frontmatter:
---
source: file | text | folder | interview
original_path: ~/Desktop/project-brief.md # only if copied from external source
created: 2026-03-27T01:54:00Z # use actual timestamp
---
If docs/BRIEF.md already exists and no new brief was provided:
Interview depth adapts to the detected mode. All interviews use AskUserQuestion. The full interview framework is in references/interview-guide.md.
The project exists. Code exists. Docs may exist. Lighter interview, heavier analysis.
Before interviewing:
Interview focus (6-10 questions):
Opening pattern: Show the builder what you learned from the code first. "I see a Python/FastAPI project with PostgreSQL and Docker. The test suite uses pytest with 85% coverage. Is that the intended stack going forward?" Let the codebase speak, then fill gaps.
A brief exists but needs validation and gap-filling. Moderate depth.
Before interviewing:
Interview focus (8-12 questions):
Opening pattern: Quote the brief back, confirm accuracy, then pivot to gaps.
No code, no brief, just a person with an idea. Deepest interview.
Run all four phases from references/interview-guide.md:
Expect 15-25 questions across all phases. Follow the phase transition signals in the interview guide. Be patient -- the builder may circle back or contradict themselves. That is normal.
Opening pattern: "Tell me about what you're building. What problem are you solving?"
Avoid these across all modes:
Draft documents in this order. Each document gets a structured review before moving to the next.
| Document | When | Content Source |
|---|---|---|
docs/BRIEF.md | Always (if not already present) | Intake text, external file, or synthesized interview |
docs/VISION.md | Always | Brief + interview (purpose, target users, success criteria, non-goals) |
docs/STRATEGY.md | When enough info available | Interview (current focus, priorities, constraints, open questions) |
docs/ARCHITECTURE.md | When technical choices stated | Brief + detected stack (overview, components, technology choices) |
.agents/AGENTS.md | Always (incremental) | Detected stack (build/test commands, project structure, Loaf skills) |
Start with detected/discussed stack info and build up:
Never overwrite existing documents without explicit confirmation. If a document already exists:
After drafting each document, present it section-by-section for iteration using AskUserQuestion.
For each document:
| Document | Section | Prompt |
|---|---|---|
| BRIEF.md | Problem | "Is this problem statement accurate?" |
| BRIEF.md | Users | "Did I capture the right target users?" |
| VISION.md | Purpose | "Does this capture why this project exists?" |
| VISION.md | Non-goals | "Are these the right non-goals?" |
| VISION.md | Success criteria | "Anything missing from success criteria?" |
| STRATEGY.md | Priorities | "Are these the right current priorities?" |
| ARCHITECTURE.md | Tech choices | "Are these the right technical constraints, or did I add assumptions?" |
If the builder is satisfied, they can say "looks good" or "approve all" to skip remaining sections. Accept this gracefully and move on.
After all documents are reviewed and approved:
Check if loaf kb init CLI command is available:
loaf kb init --help 2>/dev/null
loaf kb init to scaffold the knowledge basedocs/knowledge/ directory with a README explaining its purpose:# Knowledge Base
This directory will hold the project's knowledge base -- decisions, patterns,
and context that accumulate over the project's lifetime.
When `loaf kb` tooling is available, run `loaf kb init` to scaffold the full
knowledge base structure.
After scaffolding, ask the builder if they have other Loaf projects they would like to import knowledge from. Don't auto-detect -- ask explicitly.
Create symlinks per Loaf convention:
# .claude/CLAUDE.md -> .agents/AGENTS.md
mkdir -p .claude
ln -sf ../.agents/AGENTS.md .claude/CLAUDE.md
# ./AGENTS.md -> .agents/AGENTS.md (root convenience symlink)
ln -sf .agents/AGENTS.md ./AGENTS.md
If symlinks already exist and point to the right targets, skip silently. If they exist but point elsewhere, warn the user and ask before changing.
Save the bootstrap interview as a session file:
.agents/sessions/{YYYYMMDD}-{HHMMSS}-bootstrap.md
The session should capture:
Follow templates/session.md for structure and frontmatter schema.
Suggest relevant next steps based on what was learned:
/loaf:brainstorm -- if the idea needs more exploration/loaf:idea -- if specific feature ideas emerged during the interview/loaf:research -- if there are open questions that need investigation/loaf:shape -- if a specific feature is ready to be bounded into a specloaf doctor -- to verify the setup is healthySuggest at least 2 relevant paths. Don't auto-run any of them.
This skill is designed for Claude Code (uses AskUserQuestion, Write/Edit tools). For other harnesses, the equivalent workflow is:
loaf setup (or loaf init && loaf build && loaf install --to all manually)docs/BRIEF.md manually with project descriptiondocs/VISION.md, docs/STRATEGY.md, docs/ARCHITECTURE.md manually.agents/AGENTS.md with build commands, test commands, and project structure.claude/CLAUDE.md -> .agents/AGENTS.md and ./AGENTS.md -> .agents/AGENTS.mdloaf kb init if available, or create docs/knowledge/ with a READMEdocs/BRIEF.mdnpx claudepluginhub levifig/loafCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.