---
name: "Scaffold creates complete project structure"
---

# Story 214: Scaffold creates complete project structure

## User Story

As a new Story Kit user, I want `scaffold_story_kit()` to create the correct project structure so that I have a working pipeline without manual configuration.

## Acceptance Criteria

- [ ] Creates the `work/` pipeline directories: `work/1_upcoming/`, `work/2_current/`, `work/3_qa/`, `work/4_merge/`, `work/5_done/`, `work/6_archived/` — each with a `.gitkeep` file so empty dirs survive git clone
- [ ] Removes creation of the old `stories/` and `stories/archive/` directories
- [ ] Writes `.story_kit/README.md` using `include_str!` to embed the canonical README at build time (replacing the stale `STORY_KIT_README` constant)
- [ ] Writes `.story_kit/project.toml` with a sensible default agent config (one coder, one qa, one mergemaster — using `sonnet` model aliases)
- [ ] Writes `.mcp.json` in the project root (reuse existing `worktree_write_mcp_json`)
- [ ] Writes `specs/00_CONTEXT.md` as a blank template with section headings (High-Level Goal, Core Features, Domain Definition, Glossary) and the scaffold sentinel marker — NOT content about Story Kit itself
- [ ] Writes `specs/tech/STACK.md` as a blank template with section headings (Core Stack, Coding Standards, Quality Gates, Libraries) and the scaffold sentinel marker — NOT content about Story Kit itself
- [ ] Runs `git init` if the directory is not already a git repo
- [ ] Makes an initial commit with the scaffolded files (only on fresh `git init`, not into an existing repo)
- [ ] Unit tests verify: all expected directories exist, all expected files have correct content, `.gitkeep` files are present in work dirs, template specs contain placeholder headings not Story Kit content, `project.toml` has valid default agent config
- [ ] Test that scaffold is idempotent — running it twice on the same directory doesn't overwrite or duplicate files
- [ ] Test that scaffold into an existing git repo does not run `git init` or create an initial commit
- [ ] Appends Story Kit entries to the project's `.gitignore` (or creates one if missing): `.story_kit/worktrees/`, `.story_kit/merge_workspace/`, `.story_kit/coverage/`, `.story_kit_port`, `store.json`. Does not duplicate entries already present.

## Out of Scope

- TBD
