@zigrivers/scaffold 2.1.2 → 2.28.1

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 (97) hide show
  1. package/README.md +272 -59
  2. package/knowledge/core/adr-craft.md +53 -0
  3. package/knowledge/core/ai-memory-management.md +246 -0
  4. package/knowledge/core/api-design.md +4 -0
  5. package/knowledge/core/claude-md-patterns.md +254 -0
  6. package/knowledge/core/coding-conventions.md +246 -0
  7. package/knowledge/core/database-design.md +4 -0
  8. package/knowledge/core/design-system-tokens.md +465 -0
  9. package/knowledge/core/dev-environment.md +223 -0
  10. package/knowledge/core/domain-modeling.md +4 -0
  11. package/knowledge/core/eval-craft.md +1008 -0
  12. package/knowledge/core/multi-model-review-dispatch.md +250 -0
  13. package/knowledge/core/operations-runbook.md +37 -226
  14. package/knowledge/core/project-structure-patterns.md +231 -0
  15. package/knowledge/core/review-step-template.md +247 -0
  16. package/knowledge/core/{security-review.md → security-best-practices.md} +5 -1
  17. package/knowledge/core/task-decomposition.md +57 -34
  18. package/knowledge/core/task-tracking.md +225 -0
  19. package/knowledge/core/tech-stack-selection.md +214 -0
  20. package/knowledge/core/testing-strategy.md +63 -70
  21. package/knowledge/core/user-stories.md +69 -60
  22. package/knowledge/core/user-story-innovation.md +57 -0
  23. package/knowledge/core/ux-specification.md +5 -148
  24. package/knowledge/finalization/apply-fixes-and-freeze.md +165 -14
  25. package/knowledge/product/prd-craft.md +55 -34
  26. package/knowledge/review/review-adr.md +32 -0
  27. package/knowledge/review/{review-api-contracts.md → review-api-design.md} +34 -1
  28. package/knowledge/review/{review-database-schema.md → review-database-design.md} +27 -1
  29. package/knowledge/review/review-domain-modeling.md +33 -0
  30. package/knowledge/review/review-implementation-tasks.md +50 -0
  31. package/knowledge/review/review-operations.md +55 -0
  32. package/knowledge/review/review-prd.md +33 -0
  33. package/knowledge/review/review-security.md +53 -0
  34. package/knowledge/review/review-system-architecture.md +28 -0
  35. package/knowledge/review/review-testing-strategy.md +51 -0
  36. package/knowledge/review/review-user-stories.md +54 -0
  37. package/knowledge/review/{review-ux-spec.md → review-ux-specification.md} +37 -1
  38. package/methodology/custom-defaults.yml +32 -3
  39. package/methodology/deep.yml +32 -3
  40. package/methodology/mvp.yml +32 -3
  41. package/package.json +2 -1
  42. package/pipeline/architecture/review-architecture.md +18 -6
  43. package/pipeline/architecture/system-architecture.md +14 -2
  44. package/pipeline/consolidation/claude-md-optimization.md +73 -0
  45. package/pipeline/consolidation/workflow-audit.md +73 -0
  46. package/pipeline/decisions/adrs.md +14 -2
  47. package/pipeline/decisions/review-adrs.md +18 -5
  48. package/pipeline/environment/ai-memory-setup.md +70 -0
  49. package/pipeline/environment/automated-pr-review.md +70 -0
  50. package/pipeline/environment/design-system.md +73 -0
  51. package/pipeline/environment/dev-env-setup.md +65 -0
  52. package/pipeline/environment/git-workflow.md +71 -0
  53. package/pipeline/finalization/apply-fixes-and-freeze.md +1 -1
  54. package/pipeline/finalization/developer-onboarding-guide.md +1 -1
  55. package/pipeline/finalization/implementation-playbook.md +3 -3
  56. package/pipeline/foundation/beads.md +68 -0
  57. package/pipeline/foundation/coding-standards.md +68 -0
  58. package/pipeline/foundation/project-structure.md +69 -0
  59. package/pipeline/foundation/tdd.md +60 -0
  60. package/pipeline/foundation/tech-stack.md +74 -0
  61. package/pipeline/integration/add-e2e-testing.md +65 -0
  62. package/pipeline/modeling/domain-modeling.md +14 -2
  63. package/pipeline/modeling/review-domain-modeling.md +18 -5
  64. package/pipeline/parity/platform-parity-review.md +70 -0
  65. package/pipeline/planning/implementation-plan-review.md +56 -0
  66. package/pipeline/planning/{implementation-tasks.md → implementation-plan.md} +29 -9
  67. package/pipeline/pre/create-prd.md +13 -4
  68. package/pipeline/pre/innovate-prd.md +37 -8
  69. package/pipeline/pre/innovate-user-stories.md +38 -7
  70. package/pipeline/pre/review-prd.md +18 -6
  71. package/pipeline/pre/review-user-stories.md +23 -6
  72. package/pipeline/pre/user-stories.md +12 -2
  73. package/pipeline/quality/create-evals.md +102 -0
  74. package/pipeline/quality/operations.md +38 -13
  75. package/pipeline/quality/review-operations.md +17 -5
  76. package/pipeline/quality/review-security.md +17 -5
  77. package/pipeline/quality/review-testing.md +20 -8
  78. package/pipeline/quality/security.md +25 -3
  79. package/pipeline/quality/story-tests.md +73 -0
  80. package/pipeline/specification/api-contracts.md +17 -2
  81. package/pipeline/specification/database-schema.md +17 -2
  82. package/pipeline/specification/review-api.md +18 -6
  83. package/pipeline/specification/review-database.md +18 -6
  84. package/pipeline/specification/review-ux.md +19 -7
  85. package/pipeline/specification/ux-spec.md +29 -10
  86. package/pipeline/validation/critical-path-walkthrough.md +34 -7
  87. package/pipeline/validation/cross-phase-consistency.md +34 -7
  88. package/pipeline/validation/decision-completeness.md +34 -7
  89. package/pipeline/validation/dependency-graph-validation.md +34 -7
  90. package/pipeline/validation/implementability-dry-run.md +34 -7
  91. package/pipeline/validation/scope-creep-check.md +34 -7
  92. package/pipeline/validation/traceability-matrix.md +34 -7
  93. package/skills/multi-model-dispatch/SKILL.md +326 -0
  94. package/skills/scaffold-pipeline/SKILL.md +195 -0
  95. package/skills/scaffold-runner/SKILL.md +465 -0
  96. package/pipeline/planning/review-tasks.md +0 -38
  97. package/pipeline/quality/testing-strategy.md +0 -42
@@ -0,0 +1,465 @@
1
+ ---
2
+ name: scaffold-runner
3
+ description: Interactive wrapper for the scaffold CLI that surfaces decision points, manages pipeline execution, and provides a seamless scaffold workflow inside Claude Code.
4
+ ---
5
+
6
+ # Scaffold Runner
7
+
8
+ This skill provides an intelligent interactive layer between the user and the `scaffold` CLI. It ensures that decision points embedded in scaffold prompts are surfaced to the user before execution, and manages the full step lifecycle.
9
+
10
+ ## When This Skill Activates
11
+
12
+ - User says "run scaffold <step>", "scaffold <step>", or "run the next scaffold step"
13
+ - User asks "what's next?", "where am I in the pipeline?", or "scaffold status"
14
+ - User asks to run any pipeline step by name (e.g., "create the PRD", "set up testing")
15
+ - User asks to run multiple steps: "run all reviews", "run phases 5-8", "finish the pipeline", "run the next 5 steps"
16
+ - User asks to re-run groups: "re-run all reviews", "redo quality gates", "re-run from user-stories onward"
17
+ - Working in a project with a `.scaffold/` directory
18
+
19
+ ## Core Workflow: Smart Scaffold Execution
20
+
21
+ When the user wants to run a scaffold step, follow this exact process:
22
+
23
+ ### Step 1: Check Eligibility
24
+
25
+ Run `scaffold next` to see what's eligible. If the user named a specific step, verify it appears in the eligible list. If it's not eligible, explain which dependencies are blocking it and suggest the eligible steps instead.
26
+
27
+ ```bash
28
+ scaffold next
29
+ ```
30
+
31
+ ### Step 2: Preview the Assembled Prompt
32
+
33
+ Capture the assembled prompt WITHOUT executing it yet:
34
+
35
+ ```bash
36
+ scaffold run <step> --auto 2>&1
37
+ ```
38
+
39
+ Save the output. This is the full 7-section prompt that includes step instructions, knowledge base content, project context, and methodology guidance. **Do not execute the prompt content yet.**
40
+
41
+ ### Step 3: Extract Decision Points
42
+
43
+ Scan the assembled prompt for user-facing questions. Look for these patterns:
44
+
45
+ **Explicit question markers:**
46
+ - Lines containing `AskUserQuestionTool` or `AskUserQuestion`
47
+ - Lines containing "ask the user" or "ask me"
48
+ - Lines containing "Use AskUserQuestionTool for these decisions:"
49
+
50
+ **Common decision categories:**
51
+ - **Depth/thoroughness**: "depth level", "how thorough", "exhaustive vs focused"
52
+ - **Strictness**: "strict", "moderate", "lenient", "strictness level"
53
+ - **Optional sections**: "include [X]?", "optional", "skip if not needed"
54
+ - **Architecture choices**: "which pattern", "choose between", "select"
55
+ - **Technology preferences**: "framework", "library", "tool choice"
56
+ - **Scope decisions**: "MVP or full", "include [feature]?", "defer or include"
57
+
58
+ **Decision extraction rules:**
59
+ - Group related questions together (don't ask one at a time)
60
+ - Provide the options mentioned in the prompt text
61
+ - Include your recommendation based on the project context
62
+ - If the prompt says "use AskUserQuestionTool for these decisions:" followed by a bulleted list, extract each bullet as a separate question
63
+
64
+ ### Step 4: Surface Decisions to the User
65
+
66
+ Present all extracted decision points to the user using AskUserQuestion. Group them into a single call with up to 4 questions. If there are more than 4, batch them into multiple calls.
67
+
68
+ For each decision:
69
+ - Frame it as a clear choice with concrete options
70
+ - Include the default/recommended option based on the project's methodology preset
71
+ - Add brief context about the impact of each choice
72
+
73
+ **Example presentation:**
74
+ ```
75
+ Before running this step, I need a few decisions:
76
+
77
+ 1. Architecture depth: Full specification with detailed data flows, or high-level
78
+ component overview? [Full spec (recommended for depth 5) / High-level overview]
79
+
80
+ 2. Include performance benchmarks section? [Yes / No — skip for MVP]
81
+
82
+ 3. Error handling strategy: Custom error classes with codes, or standard
83
+ try/catch with logging? [Custom classes (recommended) / Standard try/catch]
84
+ ```
85
+
86
+ If the assembled prompt has NO decision points (the step is fully automated), skip this step and proceed directly to execution.
87
+
88
+ ### Step 5: Execute the Prompt
89
+
90
+ Now execute the assembled prompt as your working instructions. This means:
91
+
92
+ 1. Read the assembled prompt output from Step 2
93
+ 2. Follow its instructions section by section
94
+ 3. Where the prompt says "ask the user about X", substitute the answer from Step 4
95
+ 4. Where the prompt says "use AskUserQuestionTool", use the pre-collected answer instead
96
+ 5. Perform all file operations, artifact creation, and validation the prompt describes
97
+
98
+ **Critical: Execute the FULL prompt faithfully.** Don't skip sections, don't summarize, don't take shortcuts. The assembled prompt was carefully constructed with knowledge base content and project context — every section matters.
99
+
100
+ ### Step 6: Post-Execution
101
+
102
+ After the step completes:
103
+
104
+ 1. **Mark completion** — If the step was run via `scaffold run`, it's auto-tracked. If the prompt was captured with `scaffold run --auto` and executed manually, mark it complete:
105
+ ```bash
106
+ scaffold complete <step>
107
+ ```
108
+ Then verify with `scaffold status`.
109
+
110
+ 2. **Show what's next** — Run:
111
+ ```bash
112
+ scaffold next
113
+ ```
114
+
115
+ 3. **Offer continuation** — Tell the user:
116
+ ```
117
+ Step complete. Next eligible: scaffold run <next-step>
118
+ Want me to continue with the next step?
119
+ ```
120
+
121
+ ## Session Preferences
122
+
123
+ Track these preferences within the current session to avoid re-asking:
124
+
125
+ | Preference | Example | How to Track |
126
+ |---|---|---|
127
+ | Default depth | "Use depth 3 for everything" | Remember and apply to all steps |
128
+ | Skip optional steps | "Skip design system, I don't have a frontend" | Batch skip with `scaffold skip <step1> <step2> --reason "..."` |
129
+ | Methodology | "I'm using MVP" | Informs default recommendations |
130
+ | Batch mode | "Run the next 3 steps" | Execute sequentially, surface decisions for each |
131
+ | Compact status | User is mid-pipeline, only cares about remaining work | Default to `scaffold status --compact` |
132
+
133
+ When the user sets a preference, acknowledge it and apply it to subsequent steps. Don't ask about it again unless the context changes.
134
+
135
+ ## Pipeline Navigation Commands
136
+
137
+ Respond to these natural language requests:
138
+
139
+ | User Says | Action |
140
+ |---|---|
141
+ | "What's next?" / "Next step" | Run `scaffold next`, present eligible steps |
142
+ | "Where am I?" / "Pipeline status" | Run `scaffold status`, present progress summary |
143
+ | "What does X do?" | Run `scaffold info <step>`, present purpose and dependencies |
144
+ | "Is X applicable?" / "Do I need X?" | Run `scaffold check <step>` to detect platform and brownfield status |
145
+ | "Set up memory" / "Configure AI memory" / "Add memory" | Run `scaffold run ai-memory-setup` — sets up modular rules, optional MCP memory server, and external context |
146
+ | "Set up testing" / "Add Playwright" / "Add Maestro" | Run `scaffold run add-e2e-testing` — auto-detects web/mobile and configures the right framework(s) |
147
+ | "Run multi-model review" / "Review stories with other models" | Run `scaffold run review-user-stories` at depth 5 (multi-model capabilities are now built into review-user-stories) |
148
+ | "Skip X" | Run `scaffold skip <step> --reason "<user's reason>"` |
149
+ | "Skip X, Y, and Z" | Run `scaffold skip <step1> <step2> <step3> --reason "<reason>"` |
150
+ | "What's left?" / "Show remaining" | Run `scaffold status --compact`, show only pending/in-progress steps |
151
+ | "Re-run X" / "Redo X" / "Go back to X" | Reset then re-run: `scaffold reset <step> --force && scaffold run <step>` |
152
+ | "Re-run all reviews" / "Redo quality gates" | Batch re-run — see [Batch Execution](#batch-execution) |
153
+ | "Run phases 5-8" / "Run modeling through specs" | Batch run by phase range — see [Batch Execution](#batch-execution) |
154
+ | "Run the next N steps" / "Finish the pipeline" | Batch forward run — see [Batch Execution](#batch-execution) |
155
+ | "Continue the batch" / "Resume" | Resume an interrupted batch from where it stopped |
156
+ | "Mark X as done" / "Complete X" | Run `scaffold complete <step>` — marks a step as completed when executed outside `scaffold run` |
157
+ | "Reset X" / "Reset X to pending" | Run `scaffold reset <step>`, confirm if completed |
158
+ | "Show the full pipeline" | Run `scaffold list`, present with status indicators |
159
+ | "Open the dashboard" | Run `scaffold dashboard` |
160
+ | "Switch to MVP" / "Change depth" | Run `scaffold init --methodology <preset>` |
161
+
162
+ ### Re-running Steps
163
+
164
+ When the user wants to re-run a completed step (e.g., "re-run the PRD", "redo create-prd", "I want to update my user stories"):
165
+
166
+ 1. **Reset the step to pending**: Run `scaffold reset <step> --force`
167
+ 2. **Then run it**: Follow the normal Smart Scaffold Execution workflow (preview → extract decisions → ask user → execute)
168
+ 3. The step will run in **update mode** — it detects the existing artifact and updates it rather than starting from scratch
169
+
170
+ This is useful when:
171
+ - The user wants to incorporate new requirements into an existing artifact
172
+ - A prior step was run at a shallow depth and the user wants to re-run at deeper depth
173
+ - The user modified upstream documents and wants downstream steps to reflect changes
174
+
175
+ ### Skipping Steps
176
+
177
+ **Single skip:** `scaffold skip <step> --reason "reason"`
178
+
179
+ **Batch skip:** `scaffold skip <step1> <step2> <step3> --reason "reason"`
180
+
181
+ Use batch skip when the user wants to skip multiple related steps at once (e.g., "skip all the optional testing steps", "I don't have a frontend — skip design-system and add-e2e-testing"). This avoids running the command multiple times and gives a single summary of newly eligible steps.
182
+
183
+ When the user says "skip" without a reason, still pass `--reason` with a brief reason inferred from context (e.g., `--reason "no frontend"`, `--reason "using external CI"`). This aids team visibility in state.json.
184
+
185
+ If a batch skip partially fails (e.g., one step not found), the CLI skips the valid steps and reports errors for the rest. Exit code 2 indicates partial failure.
186
+
187
+ ### Compact Status
188
+
189
+ When the user asks "what's left?", "show remaining steps", or is deep into the pipeline, use `scaffold status --compact` instead of the full status view. This:
190
+
191
+ - Shows a summary line with counts (completed, skipped, pending, in progress)
192
+ - Lists only pending and in-progress steps (hides completed/skipped)
193
+ - Keeps the output focused on what's actionable
194
+
195
+ Use the full `scaffold status` (without `--compact`) when the user asks for a complete overview or wants to see what was skipped.
196
+
197
+ ### Depth-Aware Steps
198
+
199
+ Some steps behave significantly differently at higher depths. When running these steps, surface the depth choice as a decision point:
200
+
201
+ **`review-user-stories`** — The review step scales with depth:
202
+ - Depth 1-3: Claude-only multi-pass review (6 review passes)
203
+ - Depth 4: Adds requirements index (REQ-xxx IDs) and coverage matrix (coverage.json) for formal PRD traceability
204
+ - Depth 5: Adds multi-model dispatch to Codex/Gemini CLI for independent validation, with graceful fallback to Claude-only enhanced review if CLIs aren't available
205
+
206
+ When running `review-user-stories` at depth 5, check if `codex` or `gemini` CLI is available (`command -v codex`, `command -v gemini`). If neither is available, inform the user that the step will fall back to a Claude-only adversarial self-review — still valuable but less thorough than multi-model review.
207
+
208
+ **`ai-memory-setup`** — Three-tier AI memory configuration:
209
+ - Tier 1 (Modular Rules): Extracts conventions from coding-standards.md, tech-stack.md, git-workflow.md into path-scoped `.claude/rules/` files. Always recommended.
210
+ - Tier 2 (Persistent Memory): Configures MCP Knowledge Graph server (`@modelcontextprotocol/server-memory`), lifecycle hooks (PreCompact, Stop), and decision logging in `docs/decisions/`.
211
+ - Tier 3 (External Context): Adds library documentation server (Context7/Nia/Docfork) to prevent API hallucination. Only relevant for projects with external dependencies.
212
+
213
+ The step auto-detects installed MCP servers and presents tier choices as decision points. Brownfield detection: if `.claude/rules/` exists, enters update mode preserving user customizations.
214
+
215
+ **`add-e2e-testing`** — Unified E2E testing step that auto-detects the platform:
216
+ - Reads `docs/tech-stack.md` and `package.json` to determine web (Playwright), mobile (Maestro), or both
217
+ - Self-skips for backend-only projects with no frontend
218
+ - Detects brownfield (existing Playwright config or Maestro flows) and auto-enters update mode
219
+
220
+ Before running this step, you can use `scaffold check add-e2e-testing` to preview what it will detect without executing.
221
+
222
+ ### Applicability Checking
223
+
224
+ Use `scaffold check <step>` to check if a conditional step applies to the current project:
225
+
226
+ ```bash
227
+ scaffold check add-e2e-testing
228
+ # → Applicable: yes | Platform: web | Brownfield: no | Mode: fresh
229
+ ```
230
+
231
+ This is useful when the user asks "Do I need this step?" or when previewing which optional steps apply before running them.
232
+
233
+ ### Multi-Model Review at Depth 4-5
234
+
235
+ All review and validation steps now support independent multi-model validation at depth 4-5 using Codex and/or Gemini CLIs. The `multi-model-dispatch` skill documents the correct invocation patterns:
236
+
237
+ - **Codex**: `codex exec --skip-git-repo-check -s read-only --ephemeral "prompt" 2>/dev/null` (NOT bare `codex`)
238
+ - **Gemini**: `NO_BROWSER=true gemini -p "prompt" --output-format json --approval-mode yolo 2>/dev/null`
239
+
240
+ **`NO_BROWSER=true` is required for all Gemini invocations** from Claude Code's Bash tool. Without it, Gemini's child process relaunch shows a consent prompt that hangs in non-TTY shells.
241
+
242
+ **Auth verification is mandatory before dispatch.** CLI tokens expire mid-session. Before running any review at depth 4-5:
243
+ 1. Check Codex auth: `codex login status`
244
+ 2. Check Gemini auth: `NO_BROWSER=true gemini -p "respond with ok" -o json` (exit 41 = auth failure)
245
+ 3. If auth fails, tell the user to re-authenticate: `! gemini -p "hello"` or `! codex login` (the `!` prefix runs it interactively with TTY access)
246
+ 4. **Never silently skip a CLI due to auth failure** — surface it to the user
247
+
248
+ When running a review step at depth 4-5:
249
+ 1. Check CLI availability before dispatching
250
+ 2. If both available, run dual-model review for highest quality
251
+ 3. If one available, run single-model external review
252
+ 4. If neither available, fall back to Claude-only adversarial self-review
253
+
254
+ The runner should surface the depth choice as a decision point for review steps, noting that depth 4-5 enables multi-model validation if CLIs are available.
255
+
256
+ ## Batch Execution
257
+
258
+ When the user asks to run multiple steps at once, the runner resolves the request into an ordered step list and executes them sequentially, continuing autonomously between steps. It only stops when a step produces a blocker that requires human intervention.
259
+
260
+ ### Batch Intent Resolution
261
+
262
+ Map natural language requests to concrete step lists using `scaffold status` output and phase/name matching:
263
+
264
+ | User Says | Resolution Strategy |
265
+ |---|---|
266
+ | "Re-run all reviews" | All steps whose name starts with `review-` that are `completed` → reset + re-run each |
267
+ | "Run phases 5-8" / "Run modeling through specification" | All enabled steps in the named phases, in pipeline order |
268
+ | "Run remaining planning steps" | All `pending` steps in the `planning` phase |
269
+ | "Run everything from domain-modeling onward" | All enabled steps with pipeline order >= domain-modeling's order |
270
+ | "Run the next 5 steps" | Take the next 5 from `scaffold next`, execute in order |
271
+ | "Run all pending steps" | Loop: `scaffold next` → execute → repeat until nothing eligible |
272
+ | "Re-run all of phase 9" / "Redo quality gates" | All steps in the `quality` phase → reset + re-run each |
273
+ | "Run validation checks" | All steps in the `validation` phase |
274
+ | "Finish the pipeline" | All remaining pending steps, in dependency order |
275
+
276
+ **Phase name reference** (for resolving phase-based requests):
277
+
278
+ | Phase Name | Also Known As | Steps |
279
+ |---|---|---|
280
+ | pre | Product Definition | create-prd, review-prd, innovate-prd, user-stories, review-user-stories, innovate-user-stories |
281
+ | foundation | Project Foundation | beads, tech-stack, coding-standards, tdd, project-structure |
282
+ | environment | Dev Environment | dev-env-setup, design-system, git-workflow, automated-pr-review, ai-memory-setup |
283
+ | integration | Testing Integration | add-e2e-testing |
284
+ | modeling | Domain Modeling | domain-modeling, review-domain-modeling |
285
+ | decisions | Architecture Decisions | adrs, review-adrs |
286
+ | architecture | System Architecture | system-architecture, review-architecture |
287
+ | specification | Specifications | database-schema, review-database, api-contracts, review-api, ux-spec, review-ux |
288
+ | quality | Quality Gates | review-testing, story-tests, create-evals, operations, review-operations, security, review-security |
289
+ | parity | Platform Parity | platform-parity-review |
290
+ | consolidation | Consolidation | claude-md-optimization, workflow-audit |
291
+ | planning | Planning | implementation-plan, implementation-plan-review |
292
+ | validation | Validation | cross-phase-consistency, traceability-matrix, decision-completeness, critical-path-walkthrough, implementability-dry-run, dependency-graph-validation, scope-creep-check |
293
+ | finalization | Finalization | apply-fixes-and-freeze, developer-onboarding-guide, implementation-playbook |
294
+
295
+ ### Resolution Process
296
+
297
+ 1. **Get current state**: Run `scaffold status` to see all step statuses
298
+ 2. **Identify target steps**: Based on the user's request, build the ordered list:
299
+ - For phase-based: filter by phase name(s), keep pipeline order
300
+ - For name-based: match step names (prefix matching for "all reviews" → `review-*`)
301
+ - For re-runs: filter to `completed` steps, plan reset before each
302
+ - For forward runs: filter to `pending` or eligible steps
303
+ 3. **Check for disabled/skipped steps**: Exclude steps that are `skipped` or disabled by methodology unless the user explicitly names them
304
+ 4. **Check eligibility**: For each step, verify dependencies are met. If a step has unmet dependencies AND those dependencies are in the batch list (earlier), it's fine — they'll be completed first. If dependencies are unmet and NOT in the batch, flag it.
305
+ 5. **Present the plan**: Show the user what will be executed:
306
+
307
+ ```
308
+ Batch plan: 7 steps to execute sequentially
309
+
310
+ 1. ○ review-testing (pending → run)
311
+ 2. ○ create-evals (pending → run)
312
+ 3. ○ operations (pending → run)
313
+ 4. ○ review-operations (pending → run)
314
+ 5. ○ security (pending → run)
315
+ 6. ○ review-security (pending → run)
316
+ 7. ✓ review-architecture (completed → reset + re-run)
317
+
318
+ Session preferences: depth 4, carry forward decisions
319
+ Estimated: autonomous execution, stops only on blockers
320
+
321
+ Proceed? [Yes / Yes, but ask me before each step / Modify list]
322
+ ```
323
+
324
+ 6. **Get confirmation**: Wait for the user to approve the plan before starting execution.
325
+
326
+ ### Execution Protocol
327
+
328
+ For each step in the batch:
329
+
330
+ #### A. Pre-Step
331
+
332
+ 1. **Report progress**: `"Step 3/7: operations — Deployment, monitoring, incident response"`
333
+ 2. **If re-run**: Reset the step first: `scaffold reset <step> --force`
334
+ 3. **Check eligibility**: Run `scaffold next` and verify the step is eligible. If not, report the blocker and either:
335
+ - Wait for user input (if the blocker is external)
336
+ - Skip this step and continue (if the user pre-approved skipping blockers)
337
+
338
+ #### B. Execution
339
+
340
+ 4. **Capture prompt**: `scaffold run <step> --auto 2>&1`
341
+ 5. **Extract decisions**: Scan for decision points (same as single-step workflow)
342
+ 6. **Apply session preferences**: If the user already set depth, strictness, or other preferences earlier in the batch (or in session preferences), substitute those answers without re-asking
343
+ 7. **Surface NEW decisions only**: If this step has decision points not covered by session preferences, ask the user. Group up to 4 questions per call.
344
+ 8. **Execute the prompt**: Follow the assembled prompt faithfully
345
+
346
+ #### C. Post-Step
347
+
348
+ 9. **Mark completion**: `scaffold complete <step>`
349
+ 10. **Brief status report**: One-line summary of what was produced:
350
+ ```
351
+ ✓ operations complete — created docs/operations-runbook.md
352
+ ```
353
+ 11. **Check for issues**: If the step surfaced warnings, unresolved questions, or quality concerns — report them briefly but **continue to the next step** unless they are blockers.
354
+
355
+ #### D. Continue or Stop
356
+
357
+ **Continue automatically when:**
358
+ - Step completed successfully
359
+ - Step produced warnings or non-critical issues (report them, keep going)
360
+ - Step produced artifacts that downstream steps need (they're on disk now)
361
+
362
+ **Stop and ask the user when:**
363
+ - Step failed with an error (CLI error, missing file, broken prerequisite)
364
+ - Step requires a decision that can't be resolved from session preferences
365
+ - Step produced a critical finding that changes the batch plan (e.g., "the PRD is missing a key requirement that affects all downstream work")
366
+ - The user asked for "ask me before each step" mode
367
+
368
+ ### Decision Carry-Forward
369
+
370
+ Within a batch, decisions made for early steps carry forward to later steps:
371
+
372
+ | Decision | Scope | How It Carries |
373
+ |---|---|---|
374
+ | Depth level | All steps | "Use depth 4" applies to every step in the batch |
375
+ | Strictness | All review steps | "Be strict" applies to all reviews |
376
+ | Optional sections | Per-step | "Include performance benchmarks" applies only to the step where asked |
377
+ | Technology choices | All steps | "Use PostgreSQL" remembered for all steps that ask about DB |
378
+ | Skip patterns | All steps | "Skip frontend sections" applied wherever relevant |
379
+
380
+ When a new step has a decision point that matches a carried-forward preference, substitute the answer silently. Only surface the decision if it's genuinely new or if context has changed (e.g., a previous step's output contradicts an earlier decision).
381
+
382
+ ### Batch Summary
383
+
384
+ After all steps complete (or the batch is interrupted), present a summary:
385
+
386
+ ```
387
+ Batch complete: 6/7 steps executed
388
+
389
+ ✓ review-testing — reviewed TDD strategy (2 findings, both fixed)
390
+ ✓ create-evals — generated 12 eval checks
391
+ ✓ operations — created operations runbook
392
+ ✓ review-operations — reviewed operations (1 P1 finding, fixed)
393
+ ✓ security — created security review
394
+ ✗ review-security — STOPPED: Codex CLI auth expired (needs: ! codex login)
395
+ ○ review-architecture — not reached
396
+
397
+ Issues requiring attention:
398
+ 1. review-security blocked on Codex auth — run `! codex login` to fix, then "continue batch"
399
+
400
+ Next eligible after batch: cross-phase-consistency, traceability-matrix
401
+ ```
402
+
403
+ ### Resuming an Interrupted Batch
404
+
405
+ If the batch was interrupted (blocker, user stopped it, session ended), the user can resume:
406
+
407
+ | User Says | Action |
408
+ |---|---|
409
+ | "Continue the batch" / "Resume" | Pick up from where the batch stopped, re-check eligibility |
410
+ | "Skip that step and continue" | Skip the blocked step, continue with the next |
411
+ | "Stop the batch" | End batch execution, show summary of what completed |
412
+ | "Restart the batch" | Re-run the entire original batch plan from the beginning |
413
+
414
+ To resume, re-read the batch plan (kept in conversation context) and find the first incomplete step. Check eligibility and continue from there.
415
+
416
+ ### Batch + Re-run Patterns
417
+
418
+ Common batch patterns for re-running groups of steps:
419
+
420
+ **"Re-run all reviews"** — Useful when upstream docs changed:
421
+ ```
422
+ Steps: review-prd, review-user-stories, review-domain-modeling, review-adrs,
423
+ review-architecture, review-database, review-api, review-ux,
424
+ review-testing, review-operations, review-security,
425
+ implementation-plan-review
426
+ Action: reset each → re-run in pipeline order
427
+ Note: Each runs in update mode (detects existing artifact)
428
+ ```
429
+
430
+ **"Re-run from user-stories onward"** — Useful when PRD changed significantly:
431
+ ```
432
+ Steps: All steps with order >= user-stories, filtered to completed/pending
433
+ Action: reset completed ones → run all in pipeline order
434
+ Warning: This is a large batch — confirm with user
435
+ ```
436
+
437
+ **"Run all validation checks"** — Useful before implementation:
438
+ ```
439
+ Steps: cross-phase-consistency, traceability-matrix, decision-completeness,
440
+ critical-path-walkthrough, implementability-dry-run,
441
+ dependency-graph-validation, scope-creep-check
442
+ Action: These are independent (no deps between them) — run sequentially
443
+ Note: These are quick, low-decision steps — usually fully autonomous
444
+ ```
445
+
446
+ ## Error Handling
447
+
448
+ | Situation | Response |
449
+ |---|---|
450
+ | Step not eligible | Show blocking dependencies. Suggest running them first or skipping with `scaffold skip`. |
451
+ | scaffold CLI not installed | Tell user: "Install with `npm install -g @zigrivers/scaffold`" |
452
+ | No .scaffold/ directory | Tell user: "Run `scaffold init` to initialize this project" |
453
+ | Step fails during execution | Show the error, suggest checking docs/prerequisites, offer to retry |
454
+ | Assembled prompt is empty | The step may not have knowledge entries. Fall back to running the command file directly via `/scaffold:<step>` |
455
+ | Batch step fails | Report the failure, ask whether to skip and continue or stop the batch |
456
+ | Batch blocker (auth, missing input) | Stop batch, report the issue, offer recovery path, allow "continue batch" after fix |
457
+
458
+ ## What This Skill Does NOT Do
459
+
460
+ - **Does not bypass the CLI** — always runs `scaffold run`, `scaffold next`, `scaffold status`
461
+ - **Does not modify .scaffold/config.json** — reads only (unless user explicitly asks to change methodology)
462
+ - **Does not invent pipeline steps** — the pipeline defines what runs; this skill executes it
463
+ - **Does not suppress questions** — every decision point gets surfaced. Silent defaults defeat the purpose.
464
+ - **Does not cache preferences across sessions** — each Claude Code session starts fresh
465
+ - **Does not run steps in parallel** — batch execution is always sequential (one step at a time per ADR-021). Parallel execution is for the implementation phase via separate worktrees.
@@ -1,38 +0,0 @@
1
- ---
2
- name: review-tasks
3
- description: Review implementation tasks for coverage and feasibility
4
- phase: "planning"
5
- order: 26
6
- dependencies: [implementation-tasks]
7
- outputs: [docs/reviews/review-tasks.md]
8
- conditional: null
9
- knowledge-base: [review-methodology, review-implementation-tasks]
10
- ---
11
-
12
- ## Purpose
13
- Review implementation tasks targeting task-specific failure modes: architecture
14
- coverage gaps, missing dependencies, tasks too large or too vague for agents,
15
- critical path inaccuracy, and invalid parallelization assumptions.
16
-
17
- ## Inputs
18
- - docs/implementation-tasks.md (required) — tasks to review
19
- - docs/system-architecture.md (required) — for coverage checking
20
- - docs/domain-models/ (required) — for completeness
21
-
22
- ## Expected Outputs
23
- - docs/reviews/review-tasks.md — findings and resolution log
24
- - docs/implementation-tasks.md — updated with fixes
25
-
26
- ## Quality Criteria
27
- - Architecture coverage verified (every component has tasks)
28
- - Dependency graph is valid DAG
29
- - No task is too large for a single agent session
30
- - Critical path is accurate
31
- - Parallelization assumptions are valid
32
-
33
- ## Methodology Scaling
34
- - **deep**: Full multi-pass review. **mvp**: Coverage check only.
35
- - **custom:depth(1-5)**: Scale passes with depth.
36
-
37
- ## Mode Detection
38
- Re-review mode if previous review exists.
@@ -1,42 +0,0 @@
1
- ---
2
- name: testing-strategy
3
- description: Define testing and quality strategy across all layers
4
- phase: "quality"
5
- order: 19
6
- dependencies: [review-architecture]
7
- outputs: [docs/testing-strategy.md]
8
- conditional: null
9
- knowledge-base: [testing-strategy]
10
- ---
11
-
12
- ## Purpose
13
- Define the testing strategy: test pyramid, coverage goals per layer, testing
14
- patterns, quality gates, and performance testing approach. This tells agents
15
- how to test the code they write.
16
-
17
- ## Inputs
18
- - docs/system-architecture.md (required) — layers to test
19
- - docs/domain-models/ (required) — business rules to verify
20
- - docs/adrs/ (required) — testing technology choices
21
- - docs/api-contracts.md (optional) — API test scenarios
22
- - docs/database-schema.md (optional) — data layer test scenarios
23
-
24
- ## Expected Outputs
25
- - docs/testing-strategy.md — testing approach with coverage goals and patterns
26
-
27
- ## Quality Criteria
28
- - Test pyramid defined with coverage targets per layer
29
- - Testing patterns specified for each layer (unit, integration, e2e)
30
- - Quality gates defined (what must pass before merge)
31
- - Edge cases from domain invariants are test scenarios
32
- - Performance testing approach for critical paths
33
-
34
- ## Methodology Scaling
35
- - **deep**: Comprehensive strategy. Test matrix by layer and component. Specific
36
- test patterns per architecture pattern. Performance benchmarks. CI integration.
37
- Test data strategy. Mutation testing approach.
38
- - **mvp**: Test pyramid overview. Key testing patterns. What must pass before deploy.
39
- - **custom:depth(1-5)**: Scale detail with depth.
40
-
41
- ## Mode Detection
42
- Update mode if strategy exists.