agentleFS
teltringhamteltringham/sdd-plugin/skills/sdd-init/SKILL.md

sdd-init

Skill0 starsChanged 8 months agoMITView on GitHub

Bootstraps the SDD context directory structure for a project. Creates context/specs/, context/plans/, context/impl/, and spec/active/ directories with convention guides. Use when starting a new SDD project or adding SDD to an existing codebase.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 4 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check if context/ already exists.

    line 12
  2. Distinctive:

    Create the following directories:

    line 14
  3. Very specific:

    When .sdd/role contains workspace (case-insensitive, leading/trailing whitespace trimmed), the stop hook exits idle without scanning any …

    line 49
  4. Very specific:

    After this, Claude Code sessions in home-lab/ will not fire the Ralph stop hook even if spec/active/ contains PRDs with passes: false …

    line 68
  5. Very specific:

    Create context/impl/backprop-log.json with initial empty structure:

    line 84
  6. Very specific:

    Create progress.txt if it does not exist, using the template from ${CLAUDE_PLUGIN_ROOT}/templates/progress.txt (includes typed symbol …

    line 93
  7. Very specific:

    Choice 1 (default — local same-family): Write .sdd/config.json:

    line 126
  8. Very specific:

    Choice 4 (skip): Do not write .sdd/config.json.

    line 152
  9. Distinctive:

    Always print the following note as part of the step 7 summary output:

    line 168
  10. Distinctive:

    All directories exist with CLAUDE.md guides

    line 176
  11. Distinctive:

    No existing files are overwritten without user confirmation

    line 180

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SDD Init

Bootstrap the Spec-Driven Development directory structure in the current project.

Process

  1. Check if context/ already exists. If it does, warn the user and ask before overwriting any CLAUDE.md files.
  2. Create the following directories:
    context/
    ├── refs/          # Reference material (existing docs, research, examples)
    ├── specs/         # Specifications with acceptance criteria
    ├── plans/         # Task decomposition and dependency graphs
    ├── impl/          # Implementation tracking and backpropagation logs
    └── prompts/       # Phase-specific prompt templates (optional)
  3. Also create spec/active/ if it does not exist (this is where prd.json task files live).

3b. Create the .sdd/ infrastructure directory:

.sdd/
├── session/       # JSONL session logs (gitignored)
├── worktrees/     # Ralph worktree isolation (gitignored)
├── tips/          # Symlink to plugin tips/ or project-local tips
└── role           # Optional: role marker (see §3b-role below)

§3b-role — .sdd/role marker convention (v1.1.0+)

Some directories contain SDD spec files (spec/active/*.prd.json) for planning or reference purposes, but are NOT active implementation directories. Without a marker, the Ralph stop hook would fire on these directories and dispatch stories from a planning workspace — the opposite of the intended behavior (closes smoke #14).

To suppress Ralph-loop firing in a non-implementation directory, create the file .sdd/role with the single line workspace:

workspace

When .sdd/role contains workspace (case-insensitive, leading/trailing whitespace trimmed), the stop hook exits idle without scanning any PRDs, regardless of their contents.

The default role — when the file is absent OR contains implementation — is implementation: the hook fires normally.

When to set .sdd/role = workspace:

  • A directory that holds planning PRDs, spec libraries, or documentation PRDs that are not being actively implemented in the current session.
  • Multi-project home directories (e.g. ~/project-roots/home-lab/) where PRDs exist for planning and tracking but implementation happens in child repositories.

Example (home-lab planning workspace):

mkdir -p ~/project-roots/home-lab/.sdd
echo workspace > ~/project-roots/home-lab/.sdd/role

After this, Claude Code sessions in home-lab/ will not fire the Ralph stop hook even if spec/active/ contains PRDs with passes: false stories.

Commit the marker: .sdd/role is safe to commit. It contains no credentials or session state. Add .sdd/session/ and .sdd/worktrees/ to .gitignore (step 3d) but NOT .sdd/role itself.

3c. Create context/decisions/ for Architecture Decision Records.

3d. Add .sdd/session/ and .sdd/worktrees/ to .gitignore if not already present.

  1. Copy CLAUDE.md convention guides into each context subdirectory from the plugin templates:
    • context/specs/CLAUDE.md from ${CLAUDE_PLUGIN_ROOT}/templates/context/specs-CLAUDE.md
    • context/plans/CLAUDE.md from ${CLAUDE_PLUGIN_ROOT}/templates/context/plans-CLAUDE.md
    • context/impl/CLAUDE.md from ${CLAUDE_PLUGIN_ROOT}/templates/context/impl-CLAUDE.md
  2. Create context/impl/backprop-log.json with initial empty structure:

    {
      "entries": []
    }

    The root key is entries (canonical as of v1.0.0). Older projects may have logs with the prior backpropagation_log root key — readers in this plugin accept both during the migration window, and scripts/migrate-backprop-log.sh rewrites old-shape logs in place.

  3. Create progress.txt if it does not exist, using the template from ${CLAUDE_PLUGIN_ROOT}/templates/progress.txt (includes typed symbol conventions).

6b. Copy constitution.md from ${CLAUDE_PLUGIN_ROOT}/constitution.md into the project root (or spec/constitution.md) if not present. This provides SDD governance rules.

6c. Provider config prompt. Ask the operator how to configure provider routing for this project. Display the following prompt verbatim and read a single character (default 1 on empty input):

Configure provider routing for this project? sdd-init will write
.sdd/config.json based on your choice.

  [1] Default: local same-family
      Worker: local. Architect-tier: local. same_family_warning=true.
      Local-by-default; cross-family wiring audits will be flagged
      per spec-plugin-v1.md §2.4.

  [2] Cross-family: local worker + hosted Anthropic architect-tier
      Worker: local. Architect-tier: anthropic-hosted.
      same_family_warning=false. Recommended for projects with
      opaque-external interface work.

  [3] Custom: pick worker and architect-tier individually
      (advanced — operator picks each from the supported list:
      worker ∈ {local}, architect_tier ∈ {local, anthropic-hosted}).

  [4] Skip (config not written)
      Project will run without provider config; sdd_resolve_provider
      returns 'no_config' until config is added.

Choice [default 1]:

Branch on the operator's response. The target file is .sdd/config.json (relative to project root, alongside the rest of the .sdd/ infrastructure created in step 3b). The matching JSON Schema is written to .sdd/config.schema.json so editors and validators can reference it.

  • Choice 1 (default — local same-family). Write .sdd/config.json:
    {
      "version": 1,
      "worker": { "provider": "local" },
      "architect_tier": { "provider": "local" },
      "same_family_warning": true
    }
  • Choice 2 (cross-family — local worker + hosted Anthropic architect). Write .sdd/config.json:
    {
      "version": 1,
      "worker": { "provider": "local" },
      "architect_tier": { "provider": "anthropic-hosted" },
      "same_family_warning": false
    }
  • Choice 3 (custom). Prompt twice — once for worker.provider and once for architect_tier.provider. Validate each response against the supported list before writing; on invalid input, re-prompt for that field. Supported values at v1.0.0:

    • worker.provider ∈ {local} (worker is constrained to local at v1.0.0; the prompt is functionally informational, but ask for parity with the schema's structure so future provider expansion does not require re-implementing the prompt).
    • architect_tier.provider ∈ {local, anthropic-hosted}. Provider names are free-form strings that should match keys in .sdd/providers.yaml when one exists — local conventionally names your self-hosted inference lane.

    Compute same_family_warning from equality of the two provider fields: true if worker.provider == architect_tier.provider, else false. Then write .sdd/config.json with the resolved version: 1, worker, architect_tier, and same_family_warning fields.

  • Choice 4 (skip). Do not write .sdd/config.json. Print exactly:
    Skipped provider config. Run /sdd-init again or hand-edit .sdd/config.json (schema at .sdd/config.schema.json) before running missions.

Notes for the operator:

  • The config is project-local and meant to be committed to the repo. It contains no credentials — credential resolution happens elsewhere (keychain / vault).
  • The operator may re-run sdd-init later to overwrite .sdd/config.json, or hand-edit the file directly per the JSON Schema at .sdd/config.schema.json.
  • Cross-reference: this is the v1.0.0 acceptance criterion from decisions-2026-05-08.md Conflict 3 — config must be simple and clean, single file, schema next to it.
  1. Print a summary of what was created and suggest next steps:
    • "Run /sdd-spec [feature] to create your first specification"
    • "Run /sdd-status to check project state"

7b. First-run note (v1.1+): session restart required after plugin upgrade.

Always print the following note as part of the step 7 summary output:

Session restart note: If you just upgraded this plugin via claude plugins install, the running Claude Code session keeps the old MCP layer until you restart. New behaviors, tools, and schema changes from the upgrade are not active yet. Exit Claude Code and reopen it to bind to the new version. See README's "Session restart required after upgrade" section for details.

This rule applies on every /sdd-init invocation — not only the first run — because the most common reason to re-run /sdd-init in an existing project is to pick up a plugin upgrade. Printing the note unconditionally keeps the rule visible without requiring the skill to detect whether an upgrade actually occurred.

Output contract

  • All directories exist with CLAUDE.md guides
  • context/impl/backprop-log.json exists with empty log
  • progress.txt exists
  • .sdd/config.json exists IF operator chose option 1, 2, or 3 (option 4 leaves it absent — sdd_resolve_provider returns no_config in that state, which is intentional).
  • No existing files are overwritten without user confirmation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.