@zigrivers/scaffold 3.0.2 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +13 -10
  2. package/agent-skills/scaffold-pipeline/SKILL.md +204 -0
  3. package/agent-skills/scaffold-runner/SKILL.md +621 -0
  4. package/dist/cli/commands/build.test.js +41 -7
  5. package/dist/cli/commands/build.test.js.map +1 -1
  6. package/dist/cli/commands/skill.d.ts.map +1 -1
  7. package/dist/cli/commands/skill.js +105 -41
  8. package/dist/cli/commands/skill.js.map +1 -1
  9. package/dist/cli/commands/skill.test.js +93 -31
  10. package/dist/cli/commands/skill.test.js.map +1 -1
  11. package/dist/config/migration.js.map +1 -1
  12. package/dist/config/migration.test.js +4 -0
  13. package/dist/config/migration.test.js.map +1 -1
  14. package/dist/config/schema.d.ts +3 -3
  15. package/dist/config/schema.js +1 -1
  16. package/dist/config/schema.js.map +1 -1
  17. package/dist/config/schema.test.js +8 -0
  18. package/dist/config/schema.test.js.map +1 -1
  19. package/dist/core/adapters/adapter.d.ts +1 -1
  20. package/dist/core/adapters/adapter.d.ts.map +1 -1
  21. package/dist/core/adapters/adapter.js +4 -1
  22. package/dist/core/adapters/adapter.js.map +1 -1
  23. package/dist/core/adapters/adapter.test.js +5 -2
  24. package/dist/core/adapters/adapter.test.js.map +1 -1
  25. package/dist/core/adapters/gemini.d.ts +10 -0
  26. package/dist/core/adapters/gemini.d.ts.map +1 -0
  27. package/dist/core/adapters/gemini.js +126 -0
  28. package/dist/core/adapters/gemini.js.map +1 -0
  29. package/dist/core/adapters/gemini.test.d.ts +2 -0
  30. package/dist/core/adapters/gemini.test.d.ts.map +1 -0
  31. package/dist/core/adapters/gemini.test.js +91 -0
  32. package/dist/core/adapters/gemini.test.js.map +1 -0
  33. package/dist/e2e/init.test.js +78 -0
  34. package/dist/e2e/init.test.js.map +1 -1
  35. package/dist/project/gemini-md.d.ts +7 -0
  36. package/dist/project/gemini-md.d.ts.map +1 -0
  37. package/dist/project/gemini-md.js +59 -0
  38. package/dist/project/gemini-md.js.map +1 -0
  39. package/dist/project/gemini-md.test.d.ts +2 -0
  40. package/dist/project/gemini-md.test.d.ts.map +1 -0
  41. package/dist/project/gemini-md.test.js +104 -0
  42. package/dist/project/gemini-md.test.js.map +1 -0
  43. package/dist/types/config.d.ts +1 -1
  44. package/dist/types/config.d.ts.map +1 -1
  45. package/dist/types/wizard.d.ts +1 -1
  46. package/dist/types/wizard.d.ts.map +1 -1
  47. package/dist/utils/fs.d.ts +6 -0
  48. package/dist/utils/fs.d.ts.map +1 -1
  49. package/dist/utils/fs.js +13 -0
  50. package/dist/utils/fs.js.map +1 -1
  51. package/dist/utils/fs.test.js +15 -1
  52. package/dist/utils/fs.test.js.map +1 -1
  53. package/dist/wizard/questions.d.ts +1 -1
  54. package/dist/wizard/questions.d.ts.map +1 -1
  55. package/dist/wizard/questions.js +3 -0
  56. package/dist/wizard/questions.js.map +1 -1
  57. package/dist/wizard/questions.test.d.ts +2 -0
  58. package/dist/wizard/questions.test.d.ts.map +1 -0
  59. package/dist/wizard/questions.test.js +36 -0
  60. package/dist/wizard/questions.test.js.map +1 -0
  61. package/dist/wizard/wizard.js.map +1 -1
  62. package/dist/wizard/wizard.test.js +21 -1
  63. package/dist/wizard/wizard.test.js.map +1 -1
  64. package/package.json +2 -1
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Scaffold
2
2
 
3
- A TypeScript CLI that assembles AI-powered prompts at runtime to guide you from "I have an idea" to working software. Scaffold walks you through 60 structured pipeline steps — organized into 16 phases — plus 10 utility tools, and Claude Code handles the research, planning, and implementation for you.
3
+ A TypeScript CLI that assembles AI-powered prompts at runtime to guide you from "I have an idea" to working software. Scaffold walks you through 60 structured pipeline steps — organized into 16 phases — plus 10 utility tools, and the supported AI tools handle the research, planning, and implementation for you.
4
4
 
5
5
  By the end, you'll have a fully planned, standards-documented, implementation-ready project with working code.
6
6
 
7
7
  ## What is Scaffold?
8
8
 
9
- Scaffold is a composable meta-prompt pipeline built for [Claude Code](https://docs.anthropic.com/en/docs/claude-code), Anthropic's command-line coding tool. If you have an idea for a software project but don't know where to start — or you want to make sure your project is set up with solid architecture, standards, and tests from day one — Scaffold guides you through every step.
9
+ Scaffold is a composable meta-prompt pipeline built for [Claude Code](https://docs.anthropic.com/en/docs/claude-code), Gemini, and other supported AI coding tools. If you have an idea for a software project but don't know where to start — or you want to make sure your project is set up with solid architecture, standards, and tests from day one — Scaffold guides you through every step.
10
10
 
11
11
  Here's how it works:
12
12
 
@@ -19,9 +19,9 @@ Here's how it works:
19
19
  You can run steps two ways:
20
20
 
21
21
  - **CLI**: `scaffold run create-prd` — the assembly engine builds a full prompt from the meta-prompt, knowledge base entries, and project context. Best for the structured pipeline with dependency tracking.
22
- - **Slash commands**: `/scaffold:create-prd` in Claude Code — uses pre-rendered, self-contained prompts. Best for quick access to individual commands without the full pipeline ceremony.
22
+ - **Slash commands**: `/scaffold:create-prd` in Claude Code or Gemini — uses pre-rendered, self-contained prompts. Best for quick access to individual commands without the full pipeline ceremony.
23
23
 
24
- Either way, Scaffold constructs the prompt and Claude does the work. The CLI tracks pipeline state and dependencies; slash commands are fire-and-forget.
24
+ Either way, Scaffold constructs the prompt and the target AI tool does the work. The CLI tracks pipeline state and dependencies; slash commands are fire-and-forget.
25
25
 
26
26
  ## Key Concepts
27
27
 
@@ -118,7 +118,7 @@ Install the Scaffold plugin inside Claude Code for slash commands AND the intera
118
118
  This gives you:
119
119
  - **Slash commands** (`/scaffold:create-prd`, `/scaffold:tdd`, etc.) — quick access to any pipeline step
120
120
  - **Scaffold Runner skill** — intelligent interactive wrapper that surfaces decision points (depth level, strictness, optional sections) before execution instead of letting Claude pick defaults silently
121
- - **Pipeline reference skill** — shows pipeline ordering, dependencies, and completion status
121
+ - **Pipeline reference skill** — shows pipeline ordering, dependencies, and phase structure
122
122
  - **Multi-model dispatch skill** — correct invocation patterns for Codex and Gemini CLIs
123
123
 
124
124
  **Usage** — just tell Claude Code what you want in natural language:
@@ -138,7 +138,9 @@ The plugin is optional — everything it does can also be done with `scaffold ru
138
138
  > ```bash
139
139
  > scaffold skill install
140
140
  > ```
141
- > This copies the Scaffold Runner, Pipeline Reference, and Multi-Model Dispatch skills to `.claude/skills/` in your project.
141
+ > This copies the Scaffold Runner and Pipeline Reference skills to both `.claude/skills/` and `.agents/skills/` in your project.
142
+
143
+ > **Gemini users**: `scaffold build` keeps a root `GEMINI.md` in sync with the shared runner instructions and generates `.gemini/commands/scaffold/*.toml` slash commands. Plain prompts like `scaffold status` work because Gemini loads `GEMINI.md`.
142
144
 
143
145
  ## Updating
144
146
 
@@ -833,12 +835,12 @@ src/
833
835
  ├── cli/middleware/ # Project root detection, output mode resolution
834
836
  ├── cli/output/ # Output strategies (interactive, json, auto)
835
837
  ├── core/assembly/ # Assembly engine — meta-prompt → full prompt
836
- ├── core/adapters/ # Platform adapters (Claude Code, Codex, Universal)
838
+ ├── core/adapters/ # Platform adapters (Claude Code, Gemini, Codex, Universal)
837
839
  ├── core/dependency/ # DAG builder, topological sort, eligibility
838
840
  ├── core/knowledge/ # Knowledge update assembler
839
841
  ├── state/ # State manager, lock manager, decision logger
840
842
  ├── config/ # Config loading, migration, schema validation
841
- ├── project/ # Project detector, CLAUDE.md manager, adoption
843
+ ├── project/ # Project detector, CLAUDE.md/GEMINI.md managers, adoption
842
844
  ├── wizard/ # Init wizard (interactive + --auto)
843
845
  ├── validation/ # Config, state, frontmatter validators
844
846
  ├── types/ # TypeScript types and enums
@@ -851,7 +853,7 @@ src/
851
853
  - **Assembly engine** (`src/core/assembly/engine.ts`) — Pure orchestrator with no I/O. Constructs 7-section prompts from meta-prompt + knowledge + context + methodology + instructions + depth guidance.
852
854
  - **State manager** (`src/state/state-manager.ts`) — Atomic writes via tmp + `fs.renameSync()`. Tracks step status, in-progress records, and next-eligible cache. Includes migration system for step renames and retired steps.
853
855
  - **Dependency graph** (`src/core/dependency/`) — Kahn's algorithm topological sort with phase-aware ordering and cycle detection.
854
- - **Platform adapters** (`src/core/adapters/`) — 3-step lifecycle (initialize → generateStepWrapper → finalize) producing hidden adapter artifacts under `.scaffold/generated/claude-code/`, `.scaffold/generated/codex/`, and `.scaffold/generated/universal/`.
856
+ - **Platform adapters** (`src/core/adapters/`) — 3-step lifecycle (initialize → generateStepWrapper → finalize) producing `.scaffold/generated/claude-code/commands/`, `.scaffold/generated/codex/AGENTS.md`, `.scaffold/generated/universal/prompts/README.md`, and Gemini project-local files under `.agents/skills/`, `GEMINI.md`, and `.gemini/commands/scaffold/`.
855
857
  - **Project detector** (`src/project/detector.ts`) — Scans for file system signals to classify projects as greenfield, brownfield, or v1-migration.
856
858
  - **Check command** (`src/cli/commands/check.ts`) — Applicability detection for conditional steps (platform detection, GitHub remote detection, CLI availability).
857
859
 
@@ -864,6 +866,7 @@ knowledge/ # 61 domain expertise entries (core, product, review, vali
864
866
  methodology/ # 3 YAML presets (deep, mvp, custom)
865
867
  commands/ # 72 Claude Code slash commands (60 pipeline + 9 tools + 3 supplemental)
866
868
  skills/ # 3 Claude Code skills (pipeline reference, runner, multi-model dispatch)
869
+ agent-skills/ # 2 shared agent skills packaged for Claude Code and Gemini installs
867
870
  ```
868
871
 
869
872
  ### Testing
@@ -878,7 +881,7 @@ skills/ # 3 Claude Code skills (pipeline reference, runner, multi-
878
881
  ### Contributing
879
882
 
880
883
  1. Meta-prompt content lives in `pipeline/` — edit the relevant `.md` file
881
- 2. If you changed adapter behavior, run `scaffold build` in a test project and inspect the generated artifacts under `.scaffold/generated/`.
884
+ 2. If you changed adapter behavior, run `scaffold build` in a test project and inspect the generated artifacts under `.scaffold/generated/` plus the Gemini project-local outputs (`.agents/skills/`, `GEMINI.md`, `.gemini/commands/scaffold/`).
882
885
  3. Run `make check-all` (lint + type-check + test + evals) before submitting
883
886
  4. Knowledge entries live in `knowledge/` — follow the existing frontmatter schema
884
887
  5. ADRs documenting architectural decisions are in `docs/v2/adrs/`
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: scaffold-pipeline
3
+ description: Static reference for scaffold pipeline ordering, dependencies, and phase structure. Use ONLY for questions about pipeline design, step ordering, or dependency constraints — NOT for status, progress, or "what's next" queries (those go through scaffold-runner).
4
+ ---
5
+
6
+ # Scaffold Pipeline Reference
7
+
8
+ This skill is a **static reference** for pipeline ordering and dependency constraints. It does NOT handle status checks, progress queries, or navigation.
9
+
10
+ **Activation boundary:** If the user asks "where am I?", "what's next?", "pipeline status", or anything about their current progress → **do not use this skill**. The `scaffold-runner` skill handles all status/navigation via the `scaffold` CLI.
11
+
12
+ Use this skill ONLY when the user asks about:
13
+ - Pipeline design: "what phases are there?", "what's the ordering?"
14
+ - Dependency rules: "what depends on what?", "can I run X before Y?"
15
+ - Step reference: "what commands are in phase 3?", "is design-system optional?"
16
+
17
+ ## Phases
18
+
19
+ 16 phases, each with a slug (used in frontmatter) and display name. Canonical source: `src/types/frontmatter.ts` `PHASES` constant.
20
+
21
+ | # | Slug | Display Name | Description |
22
+ |---|------|-------------|-------------|
23
+ | 0 | `vision` | Product Vision | Transforms your idea into a strategic vision document covering who it's for, what makes it different, and what success looks like. |
24
+ | 1 | `pre` | Product Definition | Translates your vision into a PRD with features, personas, and success criteria, then breaks it into user stories with testable acceptance criteria. |
25
+ | 2 | `foundation` | Project Foundation | Researches and documents technology choices, creates coding standards with linter configs, defines testing strategy, and designs directory layout. |
26
+ | 3 | `environment` | Development Environment | Sets up local dev environment, design system (web only), git workflow with CI and worktrees, automated PR review, and AI memory persistence. |
27
+ | 4 | `integration` | Testing Integration | Auto-detects platform and configures E2E testing — Playwright for web, Maestro for mobile. Skips for backend-only. |
28
+ | 5 | `modeling` | Domain Modeling | Identifies core concepts (entities, relationships, invariants, events) and establishes a shared vocabulary across all docs and code. |
29
+ | 6 | `decisions` | Architecture Decisions | Documents every significant design decision with alternatives and consequences, so future contributors know why. |
30
+ | 7 | `architecture` | System Architecture | Designs the system blueprint — components, data flows, module structure, and extension points. |
31
+ | 8 | `specification` | Specifications | Creates interface specs: database schema with constraints, API contracts with error codes, UX flows with accessibility. Each conditional. |
32
+ | 9 | `quality` | Quality Gates | Reviews testing, generates test skeletons, creates eval checks, designs deployment pipeline, and conducts security review. |
33
+ | 10 | `parity` | Platform Parity | Audits documentation for platform-specific gaps. Skips for single-platform projects. |
34
+ | 11 | `consolidation` | Consolidation | Optimizes AGENTS.md under 200 lines and audits all workflow docs for consistency. |
35
+ | 12 | `planning` | Planning | Decomposes stories into concrete tasks scoped to ~150 lines and 3 files max, with clear acceptance criteria. |
36
+ | 13 | `validation` | Validation | Seven cross-cutting audits: scope creep, dependency cycles, implementability, traceability, naming drift, broken handoffs, decision completeness. |
37
+ | 14 | `finalization` | Finalization | Applies validation findings, freezes docs, creates onboarding guide, and writes the implementation playbook. |
38
+ | 15 | `build` | Build | Stateless TDD execution: single/multi-agent modes, session resume, quick tasks, and new feature enhancements. |
39
+
40
+ ## Pipeline Order
41
+
42
+ | # | Phase | Command | Notes |
43
+ |---|-------|---------|-------|
44
+ | 1 | Product Definition | `/scaffold:create-prd` | Interactive — requires user input |
45
+ | 2 | Product Definition | `/scaffold:review-prd` | Multi-pass PRD review |
46
+ | 2.5 | Product Definition | `/scaffold:innovate-prd` | **(optional)** Feature-level innovation |
47
+ | 3 | Product Definition | `/scaffold:user-stories` | Covers every PRD feature |
48
+ | 4 | Product Definition | `/scaffold:review-user-stories` | Multi-pass story review; depth 4+ adds requirements index |
49
+ | 4.5 | Product Definition | `/scaffold:innovate-user-stories` | **(optional)** UX-level enhancements |
50
+ | 5 | Project Foundation | `/scaffold:beads` | **(optional)** Creates AGENTS.md + task tracking |
51
+ | 6 | Project Foundation | `/scaffold:tech-stack` | Drives all technical decisions |
52
+ | 7 | Project Foundation | `/scaffold:coding-standards` | References tech-stack.md |
53
+ | 8 | Project Foundation | `/scaffold:tdd` | References tech-stack.md + coding-standards.md |
54
+ | 9 | Project Foundation | `/scaffold:project-structure` | References all Phase 2 docs |
55
+ | 10 | Dev Environment | `/scaffold:dev-env-setup` | Creates lint/test/install commands |
56
+ | 11 | Dev Environment | `/scaffold:design-system` | **(optional)** Frontend projects only |
57
+ | 12 | Dev Environment | `/scaffold:git-workflow` | Branching, CI, worktrees, permissions |
58
+ | 12.5 | Dev Environment | `/scaffold:automated-pr-review` | **(optional)** Local CLI or external reviewer |
59
+ | 13 | Dev Environment | `/scaffold:ai-memory-setup` | Modular rules, optional MCP memory + external docs |
60
+ | 14 | Testing Integration | `/scaffold:add-e2e-testing` | **(optional)** Playwright (web) and/or Maestro (mobile) |
61
+ | 15 | Domain Modeling | `/scaffold:domain-modeling` | Entities, aggregates, events, bounded contexts |
62
+ | 16 | Domain Modeling | `/scaffold:review-domain-modeling` | 10-pass domain model review |
63
+ | 17 | Architecture Decisions | `/scaffold:adrs` | Architecture Decision Records |
64
+ | 18 | Architecture Decisions | `/scaffold:review-adrs` | Review for contradictions, missing decisions |
65
+ | 19 | System Architecture | `/scaffold:system-architecture` | Components, data flows, module structure |
66
+ | 20 | System Architecture | `/scaffold:review-architecture` | Coverage gaps, constraint violations |
67
+ | 21 | Specifications | `/scaffold:database-schema` | **(optional)** Tables, indexes, constraints |
68
+ | 22 | Specifications | `/scaffold:review-database` | **(optional)** Schema review |
69
+ | 23 | Specifications | `/scaffold:api-contracts` | **(optional)** Endpoints, error codes, auth |
70
+ | 24 | Specifications | `/scaffold:review-api` | **(optional)** API contracts review |
71
+ | 25 | Specifications | `/scaffold:ux-spec` | **(optional)** Flows, states, accessibility |
72
+ | 26 | Specifications | `/scaffold:review-ux` | **(optional)** UX spec review |
73
+ | 27 | Quality Gates | `/scaffold:review-testing` | Reviews TDD strategy for coverage gaps |
74
+ | 27.5 | Quality Gates | `/scaffold:story-tests` | Tagged test skeletons from user story ACs |
75
+ | 28 | Quality Gates | `/scaffold:create-evals` | Generates eval checks from standards docs |
76
+ | 29 | Quality Gates | `/scaffold:operations` | Deployment, monitoring, incident response |
77
+ | 30 | Quality Gates | `/scaffold:review-operations` | Reviews operations runbook |
78
+ | 31 | Quality Gates | `/scaffold:security` | Threat model, auth, data protection |
79
+ | 32 | Quality Gates | `/scaffold:review-security` | Reviews security posture |
80
+ | 33 | Platform Parity | `/scaffold:platform-parity-review` | **(optional)** Multi-platform projects |
81
+ | 34 | Consolidation | `/scaffold:Codex-md-optimization` | Run BEFORE workflow-audit |
82
+ | 35 | Consolidation | `/scaffold:workflow-audit` | Run AFTER Codex-md-optimization |
83
+ | 36 | Planning | `/scaffold:implementation-plan` | Creates full task graph |
84
+ | 37 | Planning | `/scaffold:implementation-plan-review` | Second pass for quality + multi-model validation (depth 4+) |
85
+ | 38 | Validation | `/scaffold:cross-phase-consistency` | Naming, assumptions, interfaces |
86
+ | 39 | Validation | `/scaffold:traceability-matrix` | PRD → Stories → Architecture → Tasks |
87
+ | 40 | Validation | `/scaffold:decision-completeness` | All decisions recorded and justified |
88
+ | 41 | Validation | `/scaffold:critical-path-walkthrough` | End-to-end critical journey trace |
89
+ | 42 | Validation | `/scaffold:implementability-dry-run` | Simulate agent picking up tasks |
90
+ | 43 | Validation | `/scaffold:dependency-graph-validation` | Verify task DAG is acyclic |
91
+ | 44 | Validation | `/scaffold:scope-creep-check` | Specs stay within PRD boundaries |
92
+ | 45 | Finalization | `/scaffold:apply-fixes-and-freeze` | Apply findings, freeze docs |
93
+ | 46 | Finalization | `/scaffold:developer-onboarding-guide` | "Start here" for new devs/agents |
94
+ | 47 | Finalization | `/scaffold:implementation-playbook` | Operational guide for agent execution |
95
+ | 48 | Execution | `/scaffold:single-agent-start` | Single-agent TDD execution loop |
96
+ | 48 | Execution | `/scaffold:multi-agent-start` | Multi-agent — one per worktree |
97
+
98
+ ### Phase 15 — Build (stateless, on-demand)
99
+
100
+ 6 steps. Available once Phase 14 is complete. These steps are **stateless** — they don't track completion state and are always available for repeated use.
101
+
102
+ | Order | Step | Description |
103
+ |-------|------|-------------|
104
+ | 1510 | single-agent-start | Start single-agent TDD execution loop |
105
+ | 1520 | single-agent-resume | Resume single-agent work after a break |
106
+ | 1530 | multi-agent-start | Start multi-agent execution loop in a worktree |
107
+ | 1540 | multi-agent-resume | Resume multi-agent work after a break |
108
+ | 1550 | quick-task | Create a focused task for a bug fix, refactor, or small improvement |
109
+ | 1560 | new-enhancement | Add a new feature to an existing project |
110
+
111
+ ## Standalone Commands
112
+
113
+ | Command | When to Use |
114
+ |---------|-------------|
115
+ | `/scaffold:single-agent-resume` | Resume work after a break |
116
+ | `/scaffold:multi-agent-resume` | Resume multi-agent work after a break |
117
+ | `/scaffold:new-enhancement` | Add a feature to an existing project |
118
+ | `/scaffold:quick-task` | Create a focused task for a bug fix, refactor, or small improvement |
119
+ | `/scaffold:version-bump` | Bump version and update changelog without tagging or releasing |
120
+ | `/scaffold:release` | Create a versioned release with changelog and GitHub release |
121
+ | `/scaffold:prompt-pipeline` | Show the full pipeline reference |
122
+ | `/scaffold:dashboard` | Open visual pipeline dashboard in browser |
123
+
124
+ ## Execution Model
125
+
126
+ ### Two Parallel Tracks
127
+
128
+ After Phase 1 (Product Definition), the pipeline splits into **two independent tracks** that can run concurrently. They converge at Phase 12 (Planning).
129
+
130
+ ```
131
+ ┌─ Track A: Infrastructure ──────────────────────┐
132
+ │ │
133
+ Phase 1 │ Phase 2 (foundation) │
134
+ create-prd ─→ review-prd │ tech-stack → coding-standards → tdd │
135
+ ↓ │ ↓ │
136
+ user-stories │ project-structure → dev-env-setup │
137
+ ↓ │ ↓ │
138
+ review-user-stories ──┐ │ git-workflow → Codex-md-optimization │
139
+ │ │ ↓ ↓ │
140
+ │ │ ai-memory-setup workflow-audit │
141
+ │ │ │
142
+ │ └────────────────────────────────────────────────┘
143
+
144
+ │ ┌─ Track B: Domain & Quality ───────────────────┐
145
+ │ │ │
146
+ └──→ │ Phase 5-8: domain-modeling → adrs → │
147
+ │ system-architecture → specs (DB/API/UX) │
148
+ │ │
149
+ │ Phase 9: tdd → review-testing → operations │
150
+ │ → security (+ reviews for each) │
151
+ │ │
152
+ └────────────────────────────────────────────────┘
153
+
154
+ ┌───────────────┴───────────────┐
155
+ │ Phase 12: Planning │
156
+ │ (convergence point — │
157
+ │ depends on both tracks) │
158
+ └───────────────┬───────────────┘
159
+
160
+ Phase 13: Validation (7 parallel checks)
161
+
162
+ Phase 14: Finalization → Execution
163
+ ```
164
+
165
+ ### How Order Numbers Work
166
+
167
+ The `order` field is a **tiebreaker**, not a sequence number. Execution order is determined by:
168
+
169
+ 1. **Dependency graph** (primary) — topological sort ensures prerequisites complete first
170
+ 2. **Order field** (secondary) — when multiple steps are eligible simultaneously, lower order runs first
171
+
172
+ Order numbers are **phase-aligned**: Phase N uses orders in the N00 range (Phase 1 = 100s, Phase 2 = 200s, etc.). This makes it easy to identify which phase a step belongs to from its order alone.
173
+
174
+ ### Which Phases Can Run in Parallel
175
+
176
+ Steps within the same track that don't depend on each other can run in parallel (in separate sessions/worktrees):
177
+
178
+ - **Track A** and **Track B** are fully independent until Phase 12
179
+ - Within Track B, specification steps (Phase 8) can parallelize: DB schema, API contracts, and UX spec all depend on review-architecture but not each other
180
+ - Validation steps (Phase 13) all depend on implementation-plan-review but not each other — all 7 can run in parallel
181
+
182
+ ## Critical Ordering Constraints
183
+
184
+ 1. **Tech Stack before Coding Standards and TDD** — they reference it
185
+ 2. **Dev Setup before Git Workflow** — Git Workflow references lint/test commands
186
+ 3. **Git Workflow before AI Memory Setup** — memory rules are extracted from project docs
187
+ 4. **User Stories before Domain Modeling** — domain models derive from stories
188
+ 5. **Domain Modeling → ADRs → Architecture** — linear chain through modeling phases
189
+ 6. **Architecture before Specification** — DB, API, UX specs derive from architecture (can parallelize)
190
+ 7. **TDD → Review Testing → Operations → Security** — quality gate chain
191
+ 8. **Both tracks converge at Implementation Plan** — depends on tdd, operations, security, AND review-architecture
192
+ 9. **All 7 Validation checks before Apply Fixes & Freeze** — freeze requires all findings
193
+ 10. **Finalization before Execution** — agents need frozen docs and playbook
194
+
195
+ ## Status & Navigation
196
+
197
+ For all status, progress, and navigation queries, use the `scaffold-runner` skill, which delegates to the `scaffold` CLI:
198
+
199
+ - `scaffold status` — current pipeline progress
200
+ - `scaffold status --compact` — show only actionable steps (pending/in-progress)
201
+ - `scaffold next` — next eligible steps
202
+ - `scaffold list` — full pipeline with status indicators
203
+ - `scaffold skip <step> [<step2>...] --reason "..."` — skip one or more steps
204
+ - `scaffold reset <step> --force` — reset a step to re-run it