Skip to content
Development
Command

/craft-init

One-time setup to initialize the Craft harness for a project.

From plugin
4031 skills27 agents31 commands7 hooks1 MCP
shell
$ npx -y skills add drobins25/craft --agent claude-code

Ships with craft. Installing the plugin gets this command.

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/craft-init

Context preview

What this command does when you run it.

One-time setup to initialize the Craft harness for a project.

Command definition

craft-init.md
name: init
description: "One-time setup to initialize the Craft harness for a project."

Project Init

Set up the Craft harness for your project. Run once at the start.

Flow

Phase 0: Init

Before scanning or asking questions, check what the user needs.

Use **AskUserQuestion**:

question: "What kind of setup do you need?"
header: "Setup"
options:
  - label: "Full setup (Recommended)"
    description: "Scan project, extract patterns, configure tokens/conventions"
  - label: "Quick setup"
    description: "Just the .craft/ directory structure — for projects with strong existing docs (CLAUDE.md, etc.)"

**Use these exact option labels and the (Recommended) marker as written.** Do not reframe descriptions, swap the order, or move (Recommended) to a different option based on directory state. Quick setup is for users with a strong existing CLAUDE.md who explicitly want to skip scanning. Full setup is the default for everyone else, **including empty directories** — Phase 3 (the inspiration design session) is the project-DNA flow that runs regardless of whether code is present yet.

**If "Quick setup":**

Ask one follow-up for project type:

Use **AskUserQuestion**:

question: "What type of project is this?"
header: "Type"
options:
  - label: "UI / Web app"
    description: "Includes design tokens, inspiration, components templates"
  - label: "CLI / Backend / Plugin"
    description: "Includes naming conventions, schemas, code patterns"

Then: 1. **For UI projects:** Run `${CLAUDE_PLUGIN_ROOT}/hooks/scripts/setup-craft.sh ui`

  • Quick setup skips the scanner, so there's no visual file count. Tokens are deferred - the setup script never creates tokens.yaml.
  • The user chose quick setup because they have strong existing docs. Tokens can be added later when you have visual code to reference.

2. **For CLI projects:** Run `${CLAUDE_PLUGIN_ROOT}/hooks/scripts/setup-craft.sh cli`

  • Conventions are deferred too - quick setup never scans, so there's nothing real to write yet.

3. Go to Phase 6 (First Cycle Kickoff) and present its AskUserQuestion. Do NOT improvise a kickoff prompt here - Phase 6 owns the kickoff on every path.

The `.craft/` structure is created with sensible template defaults. The project's existing CLAUDE.md serves as the source of truth for stack, patterns, and conventions - no need to duplicate into project.md. Run `/craft:update-docs` later when there's code to scan.

Show this recap before the Phase 6 question:

> "Directory structure created. > > Your CLAUDE.md is your project DNA - Craft will use it alongside `.craft/` state. > [If UI:] Design tokens can be added later when you're ready - no guessing upfront. > [If CLI:] Project conventions can be added when there's code to learn from - run `/craft:update-docs` once you have code to scan, or add conventions to `.craft/design/locked.md` directly."

Quick setup never scans, so `.craft/design/.confidence-signals.yaml` carries no `total_files` key on this path - per Phase 6's marker rule, NO option carries (Recommended). `PROJECT_TYPE` comes from the type question above (UI / Web app -> `ui`; CLI / Backend / Plugin -> `cli`) and gates the mockup option as usual.

**If "Full setup":** Create the task rail, then continue to Phase 0.5 below.

**The task rail (Full setup only - Quick setup is seconds long and never builds one):** six TaskCreate tasks, blockedBy-chained in order: **Intent -> Scan -> Shape -> Design -> Scaffold -> Kickoff**. Task SUBJECTS are exactly the six beat names - no "Init:" prefix, no descriptive suffix; the subject is a label, detail goes in the task description. Beat-to-phase mapping: Intent = Phase 0.5, Scan = Phase 0a/0b + Phase 1, Shape = Phase 1b + 2 + 2b, Design = Phase 3 (the whole inspiration session - ONE task across all sources and riffs, like mockup's Polish), Scaffold = Phase 4 + 5 + 5b, Kickoff = Phase 6. Substeps never become tasks - no AskUserQuestion, agent spawn, or script run gets its own task. Beats the flow bypasses complete-with-note, never delete. The rail ENDS at Kickoff - whatever the first move routes into (mockup, cycle creation) creates its own tasks.

**If invoked with `RESUME_INSPIRATION=true`:**

Read `.craft/design/.inspiration-session`. Check the `phase` field:

  • `"collecting"` -> Skip to Phase 3a. Present: "Resuming your inspiration session. You have [N] source(s) so far."
  • `"assembling"` -> Skip to Phase 3b. Present: "Resuming your inspiration session. Let me re-assemble your [N] sources."
  • `"riffing"` -> Skip to Phase 3b first (to re-present the assembly), then proceed to Phase 3c. Present: "Resuming your inspiration session with [N] riff(s) applied."

Skip Phase 0, 0a, 0b, 1, 2, and 2b entirely - the session file already has all context needed.

Recreate the task rail (tasks are session-ephemeral - the previous session's rail is gone): create the six tasks exactly as the Full-setup rail block above specifies, immediately complete Intent, Scan, and Shape with the note "pre-resume - settled in the original init session", and leave Design open. The `.inspiration-session` file is the durable truth the rail is rebuilt from - the same role record.md plays for mockup.

---

Phase 0.5: Project Intent (Optional)

Before scanning the codebase, capture the user's project intent in their own words. This becomes substrate for the muse session in Phase 5b and surfaces the user's voice in `project.md`. Skipping is fine — projects that just want structure can move on; the muse session in Phase 5b will also be skipped.

This phase only fires on the Full setup path (Quick setup routes directly to setup script + Phase 6, bypassing everything in between).

Use **AskUserQuestion**:

question: "Want to capture your project intent now? Two short questions about what you're building."
header: "Intent"
options:
  - label: "Yes, capture intent"
    description: "Two short answers the muse distills into your project's Emotional Core - every cycle you plan
Read more
Read it on GitHub ↗

Showing the first part of this file.

Ships withcraft

Stop Vibing. Start Crafting. Claude Code plugin: guided + controlled development orchestration harness with built-in workflow + state management, for designing + building durable, production-ready software through the entire product lifecycle - new projects

Get the whole plugin, auto-invoked
Stats
40
Stars
0
Views
5
Forks
Active
Maintenance
Shell
Language
MIT
License
2d ago
Last commit
3mo ago
Created

Repo: drobins25/craft