sddx-workflow 0.9.0 → 0.10.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 (98) hide show
  1. package/README.md +249 -63
  2. package/dist/cli.js +370 -129
  3. package/package.json +1 -1
  4. package/templates/AGENTS.md +38 -5
  5. package/templates/CLAUDE.md +76 -5
  6. package/templates/claude-commands/conventions-sync.md +3 -0
  7. package/templates/claude-commands/impl-gap.md +10 -0
  8. package/templates/claude-commands/research.md +7 -0
  9. package/templates/claude-commands/review.md +1 -1
  10. package/templates/claude-commands/scan.md +5 -0
  11. package/templates/claude-commands/spec-amend.md +7 -0
  12. package/templates/claude-commands/spec-analyze.md +5 -0
  13. package/templates/claude-commands/spec-clarify.md +5 -0
  14. package/templates/claude-commands/spec-conflicts.md +3 -0
  15. package/templates/claude-commands/spec-status.md +3 -0
  16. package/templates/claude-commands/spec-tasks.md +3 -3
  17. package/templates/claude-commands/verify.md +5 -0
  18. package/templates/codex-skills/conventions-sync/SKILL.md +8 -0
  19. package/templates/codex-skills/impl-gap/SKILL.md +10 -0
  20. package/templates/codex-skills/research/SKILL.md +10 -0
  21. package/templates/codex-skills/review/SKILL.md +2 -2
  22. package/templates/codex-skills/scan/SKILL.md +8 -0
  23. package/templates/codex-skills/spec-amend/SKILL.md +10 -0
  24. package/templates/codex-skills/spec-analyze/SKILL.md +8 -0
  25. package/templates/codex-skills/spec-clarify/SKILL.md +8 -0
  26. package/templates/codex-skills/spec-conflicts/SKILL.md +8 -0
  27. package/templates/codex-skills/spec-status/SKILL.md +8 -0
  28. package/templates/codex-skills/spec-tasks/SKILL.md +3 -3
  29. package/templates/codex-skills/verify/SKILL.md +8 -0
  30. package/templates/conventions/base.md +7 -0
  31. package/templates/copilot-instructions.md +35 -5
  32. package/templates/copilot-prompts/conventions-sync.prompt.md +8 -0
  33. package/templates/copilot-prompts/impl-gap.prompt.md +10 -0
  34. package/templates/copilot-prompts/research.prompt.md +10 -0
  35. package/templates/copilot-prompts/review.prompt.md +2 -2
  36. package/templates/copilot-prompts/scan.prompt.md +8 -0
  37. package/templates/copilot-prompts/spec-amend.prompt.md +10 -0
  38. package/templates/copilot-prompts/spec-analyze.prompt.md +8 -0
  39. package/templates/copilot-prompts/spec-clarify.prompt.md +8 -0
  40. package/templates/copilot-prompts/spec-conflicts.prompt.md +8 -0
  41. package/templates/copilot-prompts/spec-status.prompt.md +8 -0
  42. package/templates/copilot-prompts/spec-tasks.prompt.md +3 -3
  43. package/templates/copilot-prompts/verify.prompt.md +8 -0
  44. package/templates/cursor-rules/sddx-workflow.mdc +34 -5
  45. package/templates/gemini-commands/ask.toml +8 -0
  46. package/templates/gemini-commands/assume.toml +10 -0
  47. package/templates/gemini-commands/bootstrap.toml +9 -0
  48. package/templates/gemini-commands/bugfix.toml +10 -0
  49. package/templates/gemini-commands/conventions-sync.toml +6 -0
  50. package/templates/gemini-commands/finish.toml +8 -0
  51. package/templates/gemini-commands/impl-gap.toml +10 -0
  52. package/templates/gemini-commands/refactor.toml +8 -0
  53. package/templates/gemini-commands/research.toml +10 -0
  54. package/templates/gemini-commands/review.toml +8 -0
  55. package/templates/gemini-commands/scan.toml +6 -0
  56. package/templates/gemini-commands/spec-amend.toml +10 -0
  57. package/templates/gemini-commands/spec-analyze.toml +6 -0
  58. package/templates/gemini-commands/spec-clarify.toml +6 -0
  59. package/templates/gemini-commands/spec-conflicts.toml +6 -0
  60. package/templates/gemini-commands/spec-new.toml +7 -0
  61. package/templates/gemini-commands/spec-plan.toml +7 -0
  62. package/templates/gemini-commands/spec-status.toml +6 -0
  63. package/templates/gemini-commands/spec-tasks.toml +8 -0
  64. package/templates/gemini-commands/verify.toml +6 -0
  65. package/templates/gemini.md +37 -5
  66. package/templates/specs/_template/1-requirements.md +42 -0
  67. package/templates/specs/_template/2-plan.md +14 -0
  68. package/templates/specs/_template/2a-data-model.md +29 -0
  69. package/templates/specs/_template/2b-api-contracts.md +27 -0
  70. package/templates/specs/_template/2c-research.md +25 -0
  71. package/templates/specs/_template/3-tasks.md +2 -1
  72. package/templates/specs/_template/amendments.md +15 -0
  73. package/templates/specs/_template/analysis.md +49 -0
  74. package/templates/specs/_template/impl-gaps.md +15 -0
  75. package/templates/specs/_template/verify-report.md +43 -0
  76. package/templates/windsurf-rules/sddx-workflow.md +34 -5
  77. package/templates/windsurf-workflows/ask.md +9 -0
  78. package/templates/windsurf-workflows/assume.md +11 -0
  79. package/templates/windsurf-workflows/bootstrap.md +10 -0
  80. package/templates/windsurf-workflows/bugfix.md +11 -0
  81. package/templates/windsurf-workflows/conventions-sync.md +7 -0
  82. package/templates/windsurf-workflows/finish.md +9 -0
  83. package/templates/windsurf-workflows/impl-gap.md +9 -0
  84. package/templates/windsurf-workflows/refactor.md +9 -0
  85. package/templates/windsurf-workflows/research.md +9 -0
  86. package/templates/windsurf-workflows/review.md +9 -0
  87. package/templates/windsurf-workflows/scan.md +7 -0
  88. package/templates/windsurf-workflows/spec-amend.md +9 -0
  89. package/templates/windsurf-workflows/spec-analyze.md +9 -0
  90. package/templates/windsurf-workflows/spec-clarify.md +9 -0
  91. package/templates/windsurf-workflows/spec-conflicts.md +7 -0
  92. package/templates/windsurf-workflows/spec-new.md +10 -0
  93. package/templates/windsurf-workflows/spec-plan.md +10 -0
  94. package/templates/windsurf-workflows/spec-status.md +7 -0
  95. package/templates/windsurf-workflows/spec-tasks.md +11 -0
  96. package/templates/windsurf-workflows/verify.md +9 -0
  97. package/templates/workflow.md +323 -29
  98. package/templates/zed-rules/sddx-workflow.md +33 -5
@@ -5,23 +5,52 @@ alwaysApply: true
5
5
 
6
6
  This project uses the SDD Protocol. Before starting any task, read:
7
7
 
8
- 1. `.sdd/workflow.md` — all commands, ceremony levels, and stop points
8
+ 1. `.sdd/workflow.md` — all commands, permissions, stop points, anti-patterns
9
9
  2. `.sdd/project-overview.md` — what this app is, its non-goals, and domains
10
10
  3. `.sdd/conventions.md` — project-specific conventions and patterns
11
11
 
12
12
  ## Available commands
13
13
 
14
+ ### Project setup
15
+ | Command | Purpose |
16
+ |---|---|
17
+ | `/bootstrap` | Populate project context — interview or `--scan` |
18
+ | `/scan` | Discovery-only pass over an existing codebase |
19
+ | `/conventions-sync` | Refresh conventions, preserving manual sections |
20
+
21
+ ### Exploration
14
22
  | Command | Purpose |
15
23
  |---|---|
16
- | `/bootstrap` | Populate project context — interview or codebase scan |
17
24
  | `/ask` | Research only — no code changes |
25
+ | `/research` | Non-binding research artifact |
18
26
  | `/assume` | List assumptions and stop for confirmation |
19
- | `/bugfix` | Reproduce → diagnose → fix → validate |
20
- | `/refactor` | Restructure without behavior change |
27
+
28
+ ### Feature flow
29
+ | Command | Purpose |
30
+ |---|---|
21
31
  | `/spec-new` | Scaffold a spec folder |
32
+ | `/spec-clarify` | Pre-plan clarification |
22
33
  | `/spec-plan` | Generate technical plan — stop for approval |
23
34
  | `/spec-tasks` | Execute plan one task at a time, TDD-first |
24
- | `/review` | Final audit before closing |
35
+ | `/impl-gap` | Stop and report blocking ambiguity |
36
+ | `/spec-amend` | Documented Change Request |
37
+ | `/spec-analyze` | Cross-consistency analysis |
38
+ | `/verify` | Strict mechanical audit |
39
+ | `/review` | Lighter human-touch final pass |
25
40
  | `/finish` | Stage files and generate commit message |
26
41
 
42
+ ### Multi-spec
43
+ | Command | Purpose |
44
+ |---|---|
45
+ | `/spec-status` | Show all active specs and phase |
46
+ | `/spec-conflicts` | Detect file conflicts between specs |
47
+
48
+ ### Other
49
+ | Command | Purpose |
50
+ |---|---|
51
+ | `/bugfix` | Reproduce → diagnose → fix → validate |
52
+ | `/refactor` | Restructure without behavior change |
53
+
54
+ Standard workflow: `/spec-new` → `/spec-clarify` → `/spec-plan` → `/spec-tasks` → `/verify` → `/review` → `/finish`.
55
+
27
56
  Full definitions for each command are in `.sdd/workflow.md`.
@@ -0,0 +1,8 @@
1
+ description = "Research and exploration — no code changes"
2
+ prompt = """
3
+ Execute the /ask command defined in .sdd/workflow.md.
4
+
5
+ Research and exploration only — do not modify any files. Read, analyze, and summarize findings with explicit options or recommendations.
6
+
7
+ Topic: {{args}}
8
+ """
@@ -0,0 +1,10 @@
1
+ description = "Surface all assumptions before acting — stop for confirmation"
2
+ prompt = """
3
+ Execute the /assume command defined in .sdd/workflow.md.
4
+
5
+ List every assumption being made about the task, codebase state, and technical decisions.
6
+ For each: what you're assuming, why, and what changes if it's wrong.
7
+ Stop and wait for confirmation before proceeding.
8
+
9
+ Context: {{args}}
10
+ """
@@ -0,0 +1,9 @@
1
+ description = "Populate project context via interview or codebase scan"
2
+ prompt = """
3
+ Execute the /bootstrap command defined in .sdd/workflow.md.
4
+
5
+ If the project already has code, scan the codebase first (read structure, package files, schema, routes), infer what you can, then ask only about what the code cannot answer.
6
+ If it's a new project, ask the 6 interview questions defined in workflow.md one at a time.
7
+
8
+ Present the full draft of .sdd/project-overview.md and .sdd/conventions.md for approval before writing any file.
9
+ """
@@ -0,0 +1,10 @@
1
+ description = "Reproduce → diagnose → fix → validate"
2
+ prompt = """
3
+ Execute the /bugfix command defined in .sdd/workflow.md.
4
+
5
+ Follow the stages in order without skipping: Reproduce → Diagnose → Fix → Validate.
6
+ Stop after Reproduce if the bug cannot be confirmed with a test or repro case.
7
+ Escalate to /spec-new if the fix scope exceeds ~1 file or ~50 lines.
8
+
9
+ Bug or error: {{args}}
10
+ """
@@ -0,0 +1,6 @@
1
+ description = "Refresh .sdd/conventions.md from current project state — preserves manual sections"
2
+ prompt = """
3
+ Execute the /conventions-sync command defined in .sdd/workflow.md.
4
+
5
+ Scan packages, structure, lint/format configs, ORM/router. Preserve sections marked `<!-- manual -->` verbatim; regenerate auto-sections. Present diff and STOP for approval before writing.
6
+ """
@@ -0,0 +1,8 @@
1
+ description = "Stage files and generate a conventional commit message"
2
+ prompt = """
3
+ Execute the /finish command defined in .sdd/workflow.md.
4
+
5
+ Run git status and git diff. Stage all relevant files (exclude .env*, build artifacts, scratch files). Determine the commit type. Draft a conventional commit message following the format in workflow.md — one overview sentence, detailed bullets with reasoning, optional footer for non-obvious context.
6
+
7
+ Stop and present the staged file list and commit message for approval before committing.
8
+ """
@@ -0,0 +1,10 @@
1
+ description = "Stop and report when a task is blocked by ambiguity or impossibility"
2
+ prompt = """
3
+ Execute the /impl-gap command defined in .sdd/workflow.md.
4
+
5
+ Usage: /impl-gap <feature>
6
+
7
+ STOP execution. Create specs/<feature>/impl-gaps.md from the template if missing, then append a GAP entry with current task, problem, impact, proposed resolution, action required, and resolution placeholder. Wait for human direction. If the gap requires changing the spec, escalate to /spec-amend.
8
+
9
+ Feature: {{args}}
10
+ """
@@ -0,0 +1,8 @@
1
+ description = "Restructure without changing external behavior"
2
+ prompt = """
3
+ Execute the /refactor command defined in .sdd/workflow.md.
4
+
5
+ Run existing tests first to establish a green baseline. Implement in small steps — tests must stay green throughout. No new features or bug fixes mixed in.
6
+
7
+ Target: {{args}}
8
+ """
@@ -0,0 +1,10 @@
1
+ description = "Targeted exploration with non-binding artifact — separates exploration from commitment"
2
+ prompt = """
3
+ Execute the /research command defined in .sdd/workflow.md.
4
+
5
+ Usage: /research <feature> <topic>
6
+
7
+ Investigate options for the topic. Read specs/<feature>/1-requirements.md and write a research artifact in the spec folder with options, pros/cons, current versions/maintenance status, and a non-binding recommendation. Do NOT modify 2-plan.md.
8
+
9
+ Spec and topic (e.g. "auth-refresh jwt-libraries"): {{args}}
10
+ """
@@ -0,0 +1,8 @@
1
+ description = "Lighter human-touch final pass — runs after /verify"
2
+ prompt = """
3
+ Execute the /review command defined in .sdd/workflow.md.
4
+
5
+ Read the implementation qualitatively: clarity, naming, simplicity, leaky abstractions, copy-paste smell, comments that lie. Note minor follow-ups; don't enforce mechanical checks (that's /verify's job). If a structural issue is found, escalate to /spec-amend.
6
+
7
+ Spec: {{args}}
8
+ """
@@ -0,0 +1,6 @@
1
+ description = "Discovery-only pass over an existing codebase — writes scan-report.md"
2
+ prompt = """
3
+ Execute the /scan command defined in .sdd/workflow.md.
4
+
5
+ Read package manifests, directory structure, lint/format configs, and observable conventions. Produce scan-report.md at repo root with findings. Do not modify any .sdd/ file.
6
+ """
@@ -0,0 +1,10 @@
1
+ description = "Documented Change Request for post-approval spec changes"
2
+ prompt = """
3
+ Execute the /spec-amend command defined in .sdd/workflow.md.
4
+
5
+ Usage: /spec-amend <feature> <change-summary>
6
+
7
+ Create specs/<feature>/amendments.md from the template if missing, then append a CR entry with motive, requirement changes, plan changes, affected tasks, and status "Pending approval". Stop for explicit approval before propagating any change to 1-requirements.md or 2-plan.md.
8
+
9
+ Feature and change summary: {{args}}
10
+ """
@@ -0,0 +1,6 @@
1
+ description = "Cross-consistency analysis (goal-task coverage, plan-task coverage, scope creep)"
2
+ prompt = """
3
+ Execute the /spec-analyze command defined in .sdd/workflow.md.
4
+
5
+ Check: every G-ID referenced by at least one task; every "Components Affected" entry referenced by at least one task; any task lacking a goal reference (scope creep). Write specs/{{args}}/analysis.md.
6
+ """
@@ -0,0 +1,6 @@
1
+ description = "Pre-plan clarification — generates blocking and non-blocking questions"
2
+ prompt = """
3
+ Execute the /spec-clarify command defined in .sdd/workflow.md.
4
+
5
+ Generate categorized clarification questions for specs/{{args}}/1-requirements.md (blocking vs. non-blocking). Wait for answers. Append questions and answers to a Clarifications section of the requirements doc. No other section is modified.
6
+ """
@@ -0,0 +1,6 @@
1
+ description = "Detect file-level conflicts between active specs — detection only"
2
+ prompt = """
3
+ Execute the /spec-conflicts command defined in .sdd/workflow.md.
4
+
5
+ Cross-reference "Components Affected" across all active specs. Report each file touched by two or more specs, naming the specs and suggesting sequencing. Do not modify any spec.
6
+ """
@@ -0,0 +1,7 @@
1
+ description = "Scaffold a spec folder for a new feature"
2
+ prompt = """
3
+ Execute the /spec-new command defined in .sdd/workflow.md.
4
+
5
+ Create a specs/{{args}}/ folder by copying the three template files from specs/_template/.
6
+ Replace <Feature Name> in each file title with the actual feature name.
7
+ """
@@ -0,0 +1,7 @@
1
+ description = "Generate technical plan — stops for approval before any code"
2
+ prompt = """
3
+ Execute the /spec-plan command defined in .sdd/workflow.md.
4
+
5
+ Read specs/{{args}}/1-requirements.md, run /assume to surface assumptions, then draft the technical plan in specs/{{args}}/2-plan.md.
6
+ Stop for explicit approval before writing any implementation code.
7
+ """
@@ -0,0 +1,6 @@
1
+ description = "Show state of all active specs — phase, progress, outstanding CRs and gaps"
2
+ prompt = """
3
+ Execute the /spec-status command defined in .sdd/workflow.md.
4
+
5
+ List directories under specs/ excluding _template and _done. For each: feature name, current phase, progress (N/M tasks), outstanding CRs or unresolved gaps. Do not modify any file.
6
+ """
@@ -0,0 +1,8 @@
1
+ description = "Execute approved plan one task at a time, TDD-first"
2
+ prompt = """
3
+ Execute the /spec-tasks command defined in .sdd/workflow.md.
4
+
5
+ Then read the approved specs/{{args}}/2-plan.md and execute tasks one at a time. Write the test first (red), implement until green, run the full suite, then move to the next task.
6
+
7
+ If a task is blocked by ambiguity, contradiction, or technical impossibility, STOP and run /impl-gap — never improvise. If the gap requires changing the spec, escalate to /spec-amend.
8
+ """
@@ -0,0 +1,6 @@
1
+ description = "Strict mechanical audit — read-only; writes verify-report.md"
2
+ prompt = """
3
+ Execute the /verify command defined in .sdd/workflow.md.
4
+
5
+ Read-only mechanical audit. Check: all tasks marked complete, every goal has an artifact, every acceptance scenario has a passing test, full test suite green, no out-of-scope file changes, no unresolved /impl-gap entries, no pending CRs. Write specs/{{args}}/verify-report.md. Do not modify code or specs.
6
+ """
@@ -2,23 +2,55 @@
2
2
 
3
3
  This project uses the SDD Protocol. Read these files before starting any task:
4
4
 
5
- 1. **[.sdd/workflow.md](.sdd/workflow.md)** — commands, ceremony levels, and stop points
5
+ 1. **[.sdd/workflow.md](.sdd/workflow.md)** — commands, permissions, stop points, anti-patterns
6
6
  2. **[.sdd/project-overview.md](.sdd/project-overview.md)** — what this app is, its non-goals, domains, and definition of done
7
7
  3. **[.sdd/conventions.md](.sdd/conventions.md)** — project-specific conventions and patterns
8
8
 
9
9
  ## Quick Reference
10
10
 
11
+ ### Project setup
11
12
  | Intent | Workflow |
12
13
  |---|---|
13
- | Initialize project context | `bootstrap` (new) · `bootstrap --scan` (existing) |
14
- | Explore / research | `ask` |
14
+ | Initialize project context (new) | `bootstrap` |
15
+ | Initialize project context (existing codebase) | `bootstrap --scan` |
16
+ | Discovery-only scan of an existing codebase | `scan` |
17
+ | Refresh conventions from current project state | `conventions-sync` |
18
+
19
+ ### Exploration
20
+ | Intent | Workflow |
21
+ |---|---|
22
+ | Research / ask without changing anything | `ask` |
23
+ | Non-binding research artifact for a topic | `research` |
15
24
  | Surface and validate assumptions | `assume` |
25
+
26
+ ### Feature flow
27
+ | Intent | Workflow |
28
+ |---|---|
29
+ | Scaffold a spec folder | `spec-new` |
30
+ | Clarify a draft before planning | `spec-clarify` |
31
+ | Generate technical plan (stops for approval) | `spec-plan` |
32
+ | Execute approved plan one task at a time | `spec-tasks` |
33
+ | Stop and report an implementation gap | `impl-gap` |
34
+ | Document a Change Request for spec edits | `spec-amend` |
35
+ | Cross-consistency analysis (goals / plan / tasks) | `spec-analyze` |
36
+ | Strict mechanical audit | `verify` |
37
+ | Lighter human-touch final pass | `review` |
38
+ | Stage and commit | `finish` |
39
+
40
+ ### Multi-spec
41
+ | Intent | Workflow |
42
+ |---|---|
43
+ | Show state of all active specs | `spec-status` |
44
+ | Detect file-level conflicts between specs | `spec-conflicts` |
45
+
46
+ ### Other
47
+ | Intent | Workflow |
48
+ |---|---|
16
49
  | Fix a confirmed bug | `bugfix` → `finish` |
17
50
  | Restructure without behavior change | `refactor` → `finish` |
18
- | New feature | `spec-new` → `spec-plan` → `spec-tasks` → `review` → `finish` |
19
- | Stage + commit after any work | `finish` |
20
51
 
21
52
  Invoke any workflow by name (e.g., "run bootstrap", "start spec-new for auth-refresh").
53
+ Standard workflow: `spec-new` → `spec-clarify` → `spec-plan` → `spec-tasks` → `verify` → `review` → `finish`.
22
54
  Full definitions are in `.sdd/workflow.md`.
23
55
 
24
56
  ## Active Specs
@@ -1,5 +1,10 @@
1
1
  # Requirements: <Feature Name>
2
2
 
3
+ > **Decisions and trade-offs only — no implementation.** Code snippets are allowed
4
+ > only when they reduce ambiguity (e.g. a function signature, an example input/output,
5
+ > a concrete error shape). If a snippet is doing anything more than that, it belongs
6
+ > in `2-plan.md`, not here.
7
+
3
8
  ## Status
4
9
 
5
10
  - [ ] Draft
@@ -70,6 +75,24 @@ Scenario: <add one scenario per distinct behavior>
70
75
  Business: "Must ship before the Q2 demo on May 15."
71
76
  UX: "Must match the existing row layout in the info modal — no redesign." -->
72
77
 
78
+ ## Assumptions
79
+
80
+ <!-- What this document is taking as given about users, business rules, or scope.
81
+ Different from Constraints (hard rules from outside) and Open Questions (unresolved).
82
+ Each assumption must be **falsifiable** — something the reader could correct.
83
+ Generic filler ("users want a good experience") is not an assumption.
84
+
85
+ Format: what + why we're assuming it + what changes if it's wrong.
86
+
87
+ Example:
88
+ 1. **Users only need the most recent open timestamp, not a history.** — based on
89
+ the original feature request; nobody asked for history.
90
+ If wrong: the data model needs an access_log table, not a single column.
91
+
92
+ 2. **"Opening" means clicking into the file viewer, not previewing in a list.** —
93
+ list previews are passive, not deliberate access.
94
+ If wrong: the trigger surface expands and we'd record many more events. -->
95
+
73
96
  ## Open Questions
74
97
 
75
98
  <!-- Mark each question by whether it blocks planning or can be decided during it.
@@ -79,3 +102,22 @@ Scenario: <add one scenario per distinct behavior>
79
102
 
80
103
  ⚠️ Non-blocking — can be decided during planning with a reasonable default:
81
104
  Should the timestamp be relative ("3 days ago") or absolute ("Apr 12, 14:30")? -->
105
+
106
+ ## Clarifications
107
+
108
+ <!-- Populated by /spec-clarify (pre-plan) or appended by /spec-amend (post-approval).
109
+
110
+ Format — use checkboxes so /spec-plan can detect unanswered blocking questions:
111
+ - [ ] ⛔ BLOCKING — <question>
112
+ - [x] ⛔ BLOCKING — <question> → <answer>
113
+ - [ ] ⚠️ NON-BLOCKING — <question> (default if unanswered: <assumed default>)
114
+ - [x] ⚠️ NON-BLOCKING — <question> → <answer>
115
+
116
+ /spec-plan must stop if any "[ ] ⛔ BLOCKING" entry exists with no answer.
117
+ Non-blocking questions without an answer proceed with the stated default.
118
+
119
+ Example:
120
+ - [x] ⛔ BLOCKING — Does folder navigation count as "opening" a file? → No. Only files opened in the viewer count. Trigger surface stays narrow.
121
+ - [x] ⚠️ NON-BLOCKING — Timestamp format? → Relative ("3 days ago"); switch to absolute on hover.
122
+ -->
123
+
@@ -39,6 +39,13 @@
39
39
  — rejected because it would bump updated_at on every read, corrupting
40
40
  the 'modified' timestamp shown to users." -->
41
41
 
42
+ <!-- Optional artifacts: if this plan needs more depth in a specific area, /spec-plan
43
+ may produce additional files alongside this one — reference them here:
44
+ - 2a-data-model.md — when persistence is non-trivial (schemas, migrations, ER)
45
+ - 2b-api-contracts.md — when new external HTTP/RPC/event contracts are introduced
46
+ - 2c-research.md — when outstanding /research output belongs in the plan
47
+ If unused, just delete this comment. -->
48
+
42
49
  ## Tradeoffs
43
50
 
44
51
  <!-- Conscious sacrifices the chosen approach makes. Only include if they exist.
@@ -104,6 +111,13 @@
104
111
  since this plan was written, changing its interface
105
112
  - A task requires touching files not listed here -->
106
113
 
114
+ ## Gap Handling
115
+
116
+ <!-- Implementation-time ambiguities, contradictions, or technical impossibilities
117
+ are NOT recorded in this plan. Run /impl-gap and append to
118
+ specs/<feature>/impl-gaps.md. If the resolution changes requirements or plan,
119
+ escalate via /spec-amend before editing approved spec files. -->
120
+
107
121
  ## Verification
108
122
 
109
123
  <!-- How to confirm each task is done. Link explicitly to scenarios in 1-requirements.md.
@@ -0,0 +1,29 @@
1
+ # Data Model — <Feature Name>
2
+
3
+ > Optional artifact. Generated by /spec-plan when persistence changes are non-trivial.
4
+ > Referenced from `2-plan.md` §Approach. Delete this file if unused.
5
+
6
+ ## Tables / Collections
7
+
8
+ <!-- For each new or modified table:
9
+ - **Name** — purpose, primary key
10
+ - **New columns:** name, type, nullable, default, constraint
11
+ - **Indexes added:** columns, unique/non-unique, reason
12
+ - **Relationships:** FK target, ON DELETE behavior, embedding, etc.
13
+
14
+ Example:
15
+ **recent_files** — stores per-user recently opened file list
16
+ - user_id: uuid, FK → users.id ON DELETE CASCADE
17
+ - file_path: text, not null
18
+ - opened_at: timestamptz, not null, default now()
19
+ - Index: (user_id, opened_at DESC) for timeline queries
20
+ -->
21
+
22
+ ## Migrations
23
+
24
+ <!-- Migration strategy and order of operations.
25
+ Note zero-downtime constraints (add-column-then-backfill, rename-in-steps, etc.) -->
26
+
27
+ ## ER Diagram (optional)
28
+
29
+ <!-- ASCII or Mermaid ER diagram if the relationships are non-obvious -->
@@ -0,0 +1,27 @@
1
+ # API Contracts — <Feature Name>
2
+
3
+ > Optional artifact. Generated by /spec-plan when new external HTTP/RPC/event contracts are introduced.
4
+ > Referenced from `2-plan.md` §Approach. Delete this file if unused.
5
+
6
+ ## HTTP Endpoints
7
+
8
+ <!-- For each new or modified endpoint:
9
+ Method + path | Auth required | Request body | Response | Error codes
10
+
11
+ Example:
12
+ **GET /api/recent-files**
13
+ - Auth: session cookie (user must be authenticated)
14
+ - Query params: limit (default 10, max 50)
15
+ - Response 200: { files: [{ path: string, openedAt: string }] }
16
+ - Response 401: { error: "unauthenticated" }
17
+ -->
18
+
19
+ ## Events / Webhooks
20
+
21
+ <!-- For each new event or webhook:
22
+ Name | Payload schema | Trigger condition | Consumer(s) -->
23
+
24
+ ## External APIs Consumed
25
+
26
+ <!-- Third-party APIs this feature calls:
27
+ Service | Endpoint | Auth method | Rate limits | Fallback behavior -->
@@ -0,0 +1,25 @@
1
+ # Research Summary — <Feature Name>
2
+
3
+ > Optional artifact. Carries over /research output that directly informs the plan.
4
+ > Referenced from `2-plan.md` §Approach. Delete this file if unused.
5
+ > Full research detail lives in `specs/<feature>/research-<topic>.md` files.
6
+
7
+ ## Decision
8
+
9
+ <!-- The option selected and the one-line rationale.
10
+ Example: "Using NextAuth with GitHub provider — OAuth2 support is built-in,
11
+ team already has a GitHub org, and it avoids a separate auth service." -->
12
+
13
+ ## Alternatives Considered
14
+
15
+ <!-- Options evaluated and rejected, with rejection reason.
16
+ Prevents re-litigating the same debate in future PRs.
17
+
18
+ Example:
19
+ - **Passport.js** — rejected: requires manual session management; more boilerplate for no benefit here.
20
+ - **Auth0** — rejected: adds a paid third-party dependency; overkill for internal tooling. -->
21
+
22
+ ## Open Questions
23
+
24
+ <!-- Research items not yet resolved.
25
+ Move blocking ones to `1-requirements.md` §Clarifications as ⛔ BLOCKING entries. -->
@@ -11,7 +11,7 @@ Plan approved: <!-- date -->
11
11
  - One task at a time — finish it completely before moving on
12
12
  - Write the test first — it must fail (red) before any implementation; implement until green; then run the full suite
13
13
  - Each task touches only what's needed — no cleanup of adjacent code
14
- - If a task reveals new scope, STOP and update 2-plan.md before continuing
14
+ - If a task reveals ambiguity, contradiction, impossibility, or new scope, STOP and run /impl-gap. If requirements or plan must change, escalate to /spec-amend before editing approved spec files.
15
15
 
16
16
  ---
17
17
 
@@ -49,5 +49,6 @@ Plan approved: <!-- date -->
49
49
 
50
50
  - [ ] All tasks done
51
51
  - [ ] Every acceptance scenario in 1-requirements.md covered by a passing test
52
+ - [ ] /verify completed
52
53
  - [ ] /review completed
53
54
  - [ ] Spec moved to `specs/_done/<name>/`
@@ -0,0 +1,15 @@
1
+ # Change Requests — <Feature Name>
2
+
3
+ <!-- Populated by /spec-amend. Never edit existing entries — append only.
4
+ CR numbering is per-spec and monotonic (CR-001, CR-002, …).
5
+ Rejected CRs stay with status "Rejected" and a one-line reason — never delete history.
6
+
7
+ Format:
8
+ ## CR-NNN — YYYY-MM-DD
9
+ - **Trigger:** user-requested | gap-NNN | review-finding
10
+ - **Motive:** why this change is necessary
11
+ - **Change in requirements:** what sections of 1-requirements.md change, and how
12
+ - **Change in plan:** what sections of 2-plan.md change, and how
13
+ - **Affected tasks:** T-XX, T-YY (tasks that may need to redo work or whose verification changes)
14
+ - **Status:** Pending approval | Approved YYYY-MM-DD | Rejected — <reason>
15
+ -->
@@ -0,0 +1,49 @@
1
+ # Cross-Consistency Analysis — <Feature Name>
2
+
3
+ Date: <YYYY-MM-DD>
4
+ Re-runs overwrite this file. Output is advisory — the human decides whether to amend or accept each gap.
5
+
6
+ ---
7
+
8
+ ## 1. Goal-to-Task Coverage
9
+
10
+ Every goal ID (G1, G2…) from `1-requirements.md` must appear in at least one task in `3-tasks.md`.
11
+
12
+ | Goal | Referenced in task(s) | Status |
13
+ |------|-----------------------|--------|
14
+ | G1 | | ✅ / ❌ |
15
+
16
+ ### Missing goals
17
+ <!-- Goals with no referencing task — these are coverage gaps -->
18
+
19
+ ---
20
+
21
+ ## 2. Plan-to-Task Coverage
22
+
23
+ Every entry in "Components Affected" in `2-plan.md` must appear in at least one task's Changes field.
24
+
25
+ | Component | Referenced in task(s) | Status |
26
+ |-----------|-----------------------|--------|
27
+ | | | ✅ / ❌ |
28
+
29
+ ### Missing components
30
+ <!-- Components with no referencing task — may indicate unplanned work or an incomplete task list -->
31
+
32
+ ---
33
+
34
+ ## 3. Scope Creep
35
+
36
+ Tasks that do not reference any goal ID may be out of scope.
37
+
38
+ | Task | Goals referenced |
39
+ |------|-----------------|
40
+ | | |
41
+
42
+ ### Findings
43
+ <!-- Tasks with no goal reference — flag for human review. May be legitimate (housekeeping) or genuine scope creep. -->
44
+
45
+ ---
46
+
47
+ ## Conclusion
48
+
49
+ <!-- Advisory summary. For each miss: state whether to add a task, add a goal, or accept the gap as intentional. -->
@@ -0,0 +1,15 @@
1
+ # Implementation Gaps — <Feature Name>
2
+
3
+ <!-- Populated by /impl-gap during /spec-tasks. Never improvise — always stop and record.
4
+ GAP numbering is per-spec and monotonic (GAP-001, GAP-002, …).
5
+ Resolved entries include a Resolution field. If escalated to /spec-amend, include the CR reference.
6
+
7
+ Format:
8
+ ## GAP-NNN — YYYY-MM-DD
9
+ - **Task:** T-XX (short description)
10
+ - **Problem:** what the spec says vs. what is blocking
11
+ - **Impact:** which other tasks are blocked
12
+ - **Proposed resolution:** agent's suggestion (non-binding)
13
+ - **Action required:** Approval | Escalate to /spec-amend
14
+ - **Resolution:** filled in after human direction (and CR-NNN reference if applicable)
15
+ -->
@@ -0,0 +1,43 @@
1
+ # Verify Report — <Feature Name>
2
+
3
+ Date: <YYYY-MM-DD>
4
+ Spec: specs/<feature>/
5
+
6
+ ---
7
+
8
+ ## Checks
9
+
10
+ | # | Check | Status | Evidence |
11
+ |---|-------|--------|----------|
12
+ | 1 | All tasks in `3-tasks.md` marked complete | | |
13
+ | 2 | Every goal (G1, G2…) has a referencing task and an observable artifact | | |
14
+ | 3 | Every acceptance scenario has a corresponding passing test | | |
15
+ | 4 | Full test suite passes | | |
16
+ | 5 | No files modified outside "Components Affected" in `2-plan.md` | | |
17
+ | 6 | No unresolved `/impl-gap` entries | | |
18
+ | 7 | No CRs in "Pending approval" status | | |
19
+
20
+ ---
21
+
22
+ ## Detail
23
+
24
+ ### Tasks
25
+ <!-- List each task from 3-tasks.md and its completion artifact (file, test, route, etc.) -->
26
+
27
+ ### Goals
28
+ <!-- List each G-ID from 1-requirements.md with the task(s) that implement it -->
29
+
30
+ ### Scenarios
31
+ <!-- List each BDD scenario with its test file and pass/fail status -->
32
+
33
+ ### Scope
34
+ <!-- List all modified files and confirm each appears in "Components Affected" -->
35
+
36
+ ### Gaps and CRs
37
+ <!-- State of any open impl-gaps.md or amendments.md entries -->
38
+
39
+ ---
40
+
41
+ ## Conclusion
42
+
43
+ <!-- PASS or FAIL — one sentence. If FAIL, name each failing check and the artifact needed to resolve it. -->