create-specfuse 0.18.0 → 0.20.0-rc.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 (48) hide show
  1. package/README.md +80 -9
  2. package/dist/fuseqa/templates/_case-schema.yaml +6 -2
  3. package/dist/fuseqa/templates/ledger.md +9 -9
  4. package/dist/index.js +5 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/prompts.d.ts +2 -0
  7. package/dist/prompts.d.ts.map +1 -1
  8. package/dist/prompts.js +32 -2
  9. package/dist/prompts.js.map +1 -1
  10. package/dist/scaffolder.d.ts.map +1 -1
  11. package/dist/scaffolder.js +44 -1
  12. package/dist/scaffolder.js.map +1 -1
  13. package/dist/templates/beat-hook.d.ts +14 -0
  14. package/dist/templates/beat-hook.d.ts.map +1 -0
  15. package/dist/templates/beat-hook.js +57 -0
  16. package/dist/templates/beat-hook.js.map +1 -0
  17. package/dist/templates/claude-md.d.ts.map +1 -1
  18. package/dist/templates/claude-md.js +80 -7
  19. package/dist/templates/claude-md.js.map +1 -1
  20. package/dist/templates/fuseqa-skill.d.ts.map +1 -1
  21. package/dist/templates/fuseqa-skill.js +5 -0
  22. package/dist/templates/fuseqa-skill.js.map +1 -1
  23. package/dist/templates/openspec-config.d.ts.map +1 -1
  24. package/dist/templates/openspec-config.js +4 -0
  25. package/dist/templates/openspec-config.js.map +1 -1
  26. package/dist/templates/pipeline-records.d.ts +22 -0
  27. package/dist/templates/pipeline-records.d.ts.map +1 -0
  28. package/dist/templates/pipeline-records.js +84 -0
  29. package/dist/templates/pipeline-records.js.map +1 -0
  30. package/dist/templates/requirement-brief.d.ts +20 -0
  31. package/dist/templates/requirement-brief.d.ts.map +1 -0
  32. package/dist/templates/requirement-brief.js +131 -0
  33. package/dist/templates/requirement-brief.js.map +1 -0
  34. package/dist/templates/specfuse-command.d.ts +2 -19
  35. package/dist/templates/specfuse-command.d.ts.map +1 -1
  36. package/dist/templates/specfuse-command.js +251 -39
  37. package/dist/templates/specfuse-command.js.map +1 -1
  38. package/dist/templates/specfuse-flash-agent.d.ts +12 -0
  39. package/dist/templates/specfuse-flash-agent.d.ts.map +1 -0
  40. package/dist/templates/specfuse-flash-agent.js +73 -0
  41. package/dist/templates/specfuse-flash-agent.js.map +1 -0
  42. package/dist/templates/traceability.d.ts +29 -0
  43. package/dist/templates/traceability.d.ts.map +1 -0
  44. package/dist/templates/traceability.js +81 -0
  45. package/dist/templates/traceability.js.map +1 -0
  46. package/dist/types.d.ts +2 -0
  47. package/dist/types.d.ts.map +1 -1
  48. package/package.json +2 -2
@@ -1,3 +1,7 @@
1
+ import { renderBeatHookRules } from "./beat-hook.js";
2
+ import { renderReviewRecordRules, renderSkippedReviewRecord, renderTestResultDeclarationSection, renderTestResultRules, } from "./pipeline-records.js";
3
+ import { renderInteractiveBriefQuestions, renderRequirementBriefRules, renderUnattendedBriefDecisions, } from "./requirement-brief.js";
4
+ import { renderLedgerTracePointer, renderTaskTracePointer, renderTestTracePointer, renderTraceabilityRules, } from "./traceability.js";
1
5
  function renderCommitConvention() {
2
6
  return `## Commit Convention
3
7
  - Use conventional commits: feat:, fix:, refactor:, test:, docs:, chore:
@@ -27,6 +31,7 @@ When \`/opsx:propose\` is invoked:
27
31
  1. **MUST activate Superpowers \`brainstorming\` as a pre-requisite skill.**
28
32
  - Ask ONE question at a time (Socratic method). Never fire multiple questions in a single turn.
29
33
  - Proactively present 2-3 architectural alternatives with explicit trade-offs.
34
+ - **Requirement brief:** read the pre-think beat's output first and ask about the business fields the requirement leaves out, one at a time and ordered by impact, at most five questions in all; the artifacts carry the \`spec-meta\` block and a \`clarification\` block for each field the model decided (see Requirement Brief above).
30
35
  - **STOP brainstorming BEFORE its "Write design doc" step (step 6).** Do NOT write to \`docs/superpowers/specs/\`. All spec files are managed exclusively by OpenSpec.
31
36
  - **If the three-gate test (see DESIGN-TOKENS.md Generation Rules above) triggers:** MUST invoke \`/design-md\` skill NOW (before generating artifacts). For weak intent, state that visual design was not discussed in brainstorming before running the questionnaire. Complete the questionnaire → generate DESIGN-TOKENS.md → THEN proceed.
32
37
  - Only after human confirms the approach, generate ALL artifacts (proposal -> design -> specs -> tasks) in one pass.
@@ -36,7 +41,11 @@ When \`/opsx:propose\` is invoked:
36
41
  3. Every proposal artifact MUST contain:
37
42
  - **Non-goals** section (what this change explicitly does NOT do)
38
43
  - **Trade-offs** section (alternatives considered and why they were rejected)
39
- - **Verification strategy** (how we know this change works)`;
44
+ - **Verification strategy** (how we know this change works)
45
+
46
+ 4. **Beat hooks.** Run the \`pre-think\` beat hook after the change is created and before the first artifact, and the \`post-think\` beat hook after \`tasks.md\` is written (see Beat Hooks above).
47
+
48
+ 5. **Traceability.** ${renderTaskTracePointer()}`;
40
49
  }
41
50
  function renderPathB() {
42
51
  return `### Path B: Step-by-Step Change
@@ -47,6 +56,7 @@ When \`/opsx:new\` is invoked:
47
56
 
48
57
  2. **BEFORE drafting the first artifact (proposal), MUST activate Superpowers \`brainstorming\`.**
49
58
  - Use Socratic questioning to clarify scope, non-goals, and trade-offs.
59
+ - **Requirement brief:** read the pre-think beat's output first and ask about the business fields the requirement leaves out, one at a time and ordered by impact, at most five questions in all; the artifacts carry the \`spec-meta\` block and a \`clarification\` block for each field the model decided (see Requirement Brief above).
50
60
  - **STOP brainstorming BEFORE its "Write design doc" step (step 6).** Do NOT write to \`docs/superpowers/specs/\`. All spec files are managed exclusively by OpenSpec.
51
61
  - **If the three-gate test (see DESIGN-TOKENS.md Generation Rules above) triggers:** MUST invoke \`/design-md\` skill NOW (before drafting proposal). For weak intent, state that visual design was not discussed in brainstorming before running the questionnaire. Complete the questionnaire → generate DESIGN-TOKENS.md → THEN proceed.
52
62
  - Only after the user confirms the approach, draft the proposal artifact.
@@ -63,7 +73,11 @@ When \`/opsx:new\` is invoked:
63
73
 
64
74
  4. **Pace control: one artifact per \`/opsx:continue\` invocation.**
65
75
  - Never auto-advance to the next artifact without explicit user confirmation.
66
- - This is the key difference from Path A — the user controls the rhythm.`;
76
+ - This is the key difference from Path A — the user controls the rhythm.
77
+
78
+ 5. **Beat hooks.** Run the \`pre-think\` beat hook once the change directory exists and before drafting the proposal, and the \`post-think\` beat hook after \`tasks.md\` is written (see Beat Hooks above).
79
+
80
+ 6. **Traceability.** ${renderTaskTracePointer()}`;
67
81
  }
68
82
  function renderExploration() {
69
83
  return `### Exploration
@@ -100,6 +114,7 @@ When \`/opsx:apply\` is invoked:
100
114
  a. Write a failing test FIRST
101
115
  b. Write minimal code to make it pass
102
116
  c. Refactor while keeping tests green
117
+ - ${renderTestTracePointer()}
103
118
 
104
119
  2. **MUST activate Superpowers \`verification-before-completion\` before marking ANY task done.**
105
120
  - **IRON LAW: NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.**
@@ -137,7 +152,9 @@ When \`/opsx:apply\` is invoked:
137
152
  Worktree is NOT needed when:
138
153
  - Single-file bugfix
139
154
  - Adding a new independent module (no impact on existing code)
140
- - Documentation or configuration adjustments`;
155
+ - Documentation or configuration adjustments
156
+
157
+ 6. **Beat hooks.** When every task passes, run the \`post-apply\` beat hook (see Beat Hooks above). Before it, run the declared test result command, if any (see Test Results above).`;
141
158
  }
142
159
  export function renderApplyFuseReview() {
143
160
  return `### Phase 2.5: FuseReview Checkpoint (Post-Apply)
@@ -154,6 +171,10 @@ FuseReview is the post-apply review: Think reviews direction, Do produces code,
154
171
 
155
172
  **If the user declines:** record the skip decision in the apply completion report together with the change facts (task count, subagent usage, modules), so the skip is auditable rather than invisible.
156
173
 
174
+ **Review record:** when the review closes, write the change-root \`review.md\` (see Review Record above); when the user declines, write the skipped-review record described there instead. A \`BLOCK\` decision stops before archive.
175
+
176
+ **Beat hooks:** when the review closes — or after the skip is recorded when the user declines — run the \`post-review\` beat hook (see Beat Hooks above).
177
+
157
178
  **Prose changes use the FuseDoc standard:** when the reviewed diff changes prose — docs, comments, READMEs, diagnostics — apply the FuseDoc standard (see Documentation Standard above) alongside the review method. The skill owns the rules; this file does not restate them.
158
179
 
159
180
  **Handling findings:**
@@ -170,7 +191,7 @@ FuseReview is the post-apply review: Think reviews direction, Do produces code,
170
191
  export function renderFuseQAOnDemand() {
171
192
  return `### On-Demand: FuseQA (E2E Verification)
172
193
 
173
- FuseQA verifies the built artifact through real user entry points. It is **not part of the default \`/specfuse\` pipeline — not a pipeline beat — and has no checkpoint**: \`/specfuse\` never invokes it, and neither apply completion nor entry to Verify depends on a FuseQA decision. Run it explicitly with \`/fuseqa\` when local end-to-end verification is meaningful; \`/specfuse:full\` is the complete variant that enters it automatically after FuseReview and before Verify.
194
+ FuseQA verifies the built artifact through real user entry points. It is **not part of the default \`/specfuse\` pipeline — not a pipeline beat — and has no checkpoint**: \`/specfuse\` never invokes it, and neither apply completion nor entry to Verify depends on a FuseQA decision. Run it explicitly with \`/fuseqa\` when local end-to-end verification is meaningful; \`/specfuse:full\` and \`/specfuse:flashmode\` are the complete variants that enter it automatically after FuseReview and before Verify.
174
195
 
175
196
  **Applicability.** Use it when the artifact can be deployed and exercised locally — a CLI, a small service, a library, a local web app. A distributed system cannot be meaningfully exercised on one machine; run equivalent checks in CI/CD rather than in the development phase.
176
197
 
@@ -184,6 +205,8 @@ FuseQA verifies the built artifact through real user entry points. It is **not p
184
205
 
185
206
  **Cases are project assets with a recorded lifecycle.** Cases live in \`tests/e2e/<capability>/\`, the capability name matching \`openspec/specs/<capability>/\`. Addition records its source (the spec Scenario or the escaped defect); correction records why the prior judgment was wrong; removal records why the case is no longer valid. Without a reason, "deleting a red case" and "hiding a defect" are indistinguishable in the ledger.
186
207
 
208
+ ${renderLedgerTracePointer()}
209
+
187
210
  The full method lives at \`.claude/skills/fuseqa/SKILL.md\`.`;
188
211
  }
189
212
  export function renderFuseDocStandard() {
@@ -199,6 +222,35 @@ The standard lives at \`.claude/skills/fusedoc/SKILL.md\`. It governs three thin
199
222
 
200
223
  Scope is required. An invocation naming no scope reports the missing input rather than inferring a repository-wide one.`;
201
224
  }
225
+ function renderBeatHooks() {
226
+ return `### Beat Hooks
227
+
228
+ ${renderBeatHookRules('interactive')}`;
229
+ }
230
+ function renderReviewRecord() {
231
+ return `### Review Record
232
+
233
+ ${renderReviewRecordRules()}
234
+
235
+ ${renderSkippedReviewRecord()}`;
236
+ }
237
+ function renderTestResults() {
238
+ return `### Test Results
239
+
240
+ ${renderTestResultRules('interactive')}`;
241
+ }
242
+ function renderRequirementBrief() {
243
+ return `### Requirement Brief
244
+
245
+ ${renderRequirementBriefRules()}
246
+
247
+ ${renderInteractiveBriefQuestions()}`;
248
+ }
249
+ function renderTraceability() {
250
+ return `### Traceability
251
+
252
+ ${renderTraceabilityRules()}`;
253
+ }
202
254
  export function renderAutoMode() {
203
255
  return `### Auto Mode: /specfuse
204
256
 
@@ -206,21 +258,26 @@ export function renderAutoMode() {
206
258
 
207
259
  **Automatic decisions.** Do not call \`AskUserQuestion\` for any decision point. The model answers with the recommended option and records the decision with its rationale in the final report:
208
260
  - **Brainstorming:** derive 2–3 alternatives with trade-offs, select the recommended one, and write the selection and rationale into \`design.md\`.
261
+ - **Requirement brief:** ${renderUnattendedBriefDecisions()} See Requirement Brief above.
209
262
  - **Design tokens:** when the three-gate test triggers \`/design-md\`, answer the questionnaire with recommended values; never overwrite an existing \`DESIGN-TOKENS.md\`.
210
263
  - **Model switch:** record \`continue with current model\`; do not switch and do not ask.
211
264
  - **FuseReview:** record \`auto: entered\` and run the review.
212
- - **FuseQA:** under \`/specfuse\`, not part of the pipeline; do not invoke it. It remains available only through an explicit \`/fuseqa\` request or the \`/specfuse:full\` variant.
265
+ - **FuseQA:** under \`/specfuse\`, not part of the pipeline; do not invoke it. It remains available only through an explicit \`/fuseqa\` request or the \`/specfuse:full\` and \`/specfuse:flashmode\` variants.
213
266
  - **Path B pace control:** generate all artifacts in one pass; do not stop between artifacts for review.
214
267
 
268
+ **Beat hooks.** A beat hook runs at six boundaries, in order: \`pre-think\` after the change is created, \`post-think\` after \`tasks.md\`, \`post-apply\` when every task passes, \`post-review\` when FuseReview closes, \`pre-archive\` after every Verify check passes and before archive, and \`post-archive\` after archive. See Beat Hooks above.
269
+
215
270
  **Execution order.** Brainstorming decisions → proposal → specs → design → tasks → apply under \`test-driven-development\` and \`verification-before-completion\` → FuseReview → verify → archive. The command definition at \`.claude/commands/specfuse.md\` carries the full procedure.
216
271
 
217
272
  **Exit sequence.** Under \`/specfuse\`, auto mode enters FuseReview. The apply completion report records the FuseReview decision only. FuseQA is not invoked and no FuseQA decision is recorded; it remains an explicit \`/fuseqa\` invocation outside this command.
218
273
 
219
274
  **Full variant.** \`/specfuse:full\` runs the same policy but enters FuseQA after FuseReview and before Verify, recording \`auto: entered\` for both decisions. It keeps the no-commit/no-push and verify-gates-archive rules unchanged; \`/specfuse\` still leaves FuseQA on demand.
220
275
 
276
+ **Flashmode variant.** \`/specfuse:flashmode\` runs the same sequence with Do, FuseReview, and FuseQA on \`specfuse-flash\` subagents, one per beat; the main model writes the artifacts, runs Verify, and archives. The command is \`.claude/commands/specfuse/flashmode.md\` and the agent definition is \`.claude/agents/specfuse-flash.md\`. A \`specfuse-flash\` subagent follows its agent definition: the checkpoint questions above and the subagent-mode trigger do not apply to it, and it asks no question.
277
+
221
278
  **Verify gates archive.** Archive only after \`/opsx:verify\`, the project's full test suite, and the project's linter pass. If any check still fails after best-effort repair, do not archive; keep the change directory and write each failure with its raw output into the final report.
222
279
 
223
- **Worktree isolation.** When a worktree trigger condition is met, create and enter the worktree before writing any artifact, so the whole pipeline stays inside it. Never merge it back to the trunk; leave it in place for the user to inspect. If worktree creation fails, continue in the current working tree and record the fallback. Because auto mode does not commit, FuseReview reads the working-tree diff from the baseline, including untracked files. Subagent-driven development is not used under auto mode: its integration step requires a merge.
280
+ **Worktree isolation.** When a worktree trigger condition is met, create and enter the worktree before writing any artifact, so the whole pipeline stays inside it. Never merge it back to the trunk; leave it in place for the user to inspect. If worktree creation fails, continue in the current working tree and record the fallback. Because auto mode does not commit, FuseReview reads the working-tree diff from the baseline, including untracked files. Subagent-driven development is not used to parallelize work under auto mode: its integration step requires a merge. \`/specfuse:flashmode\` dispatches one subagent at a time into the same workspace, with no worktree per subagent and no merge.
224
281
 
225
282
  **Prohibitions.** Never run \`git commit\`, \`git push\`, or \`git merge\`. Auto mode does not waive TDD, verification evidence, or the documentation standard.
226
283
 
@@ -232,9 +289,13 @@ export function renderVerifyPhase() {
232
289
  Before \`/opsx:archive\`:
233
290
 
234
291
  1. Run \`/opsx:verify\` to validate implementation matches all specs
235
- 2. Run the project's full test suite and paste evidence — this run **is the E2E regression gate**: the suite includes every case under \`tests/e2e/\`, and this gate MUST NOT be skipped
292
+ 2. Run the project's full test suite and paste evidence — this run **is the E2E regression gate**: the suite includes every case under \`tests/e2e/\`, and this gate MUST NOT be skipped. Run the declared test result command, if any, in the same pass (see Test Results above).
236
293
  3. Run the project's linter with zero warnings
237
294
 
295
+ 4. **Beat hooks.** After every check passes, run the \`pre-archive\` beat hook and archive only after it continues; after \`/opsx:archive\` succeeds, run the \`post-archive\` beat hook (see Beat Hooks above).
296
+
297
+ **Review record.** Do not archive while the change-root \`review.md\` says \`FuseReview: BLOCK\`; \`CONCERNS\` does not block archive.
298
+
238
299
  Prose synced into \`openspec/specs/\` follows the FuseDoc standard (see Documentation Standard above). Invoke \`/fusedoc\` on the synced text; the skill owns the rules, this file does not restate them.`;
239
300
  }
240
301
  function renderGeneralRules() {
@@ -259,6 +320,8 @@ export function composeCLAUDEmd(_ctx) {
259
320
  "",
260
321
  renderDesignTokensRules(),
261
322
  "",
323
+ renderTestResultDeclarationSection(),
324
+ "",
262
325
  "---",
263
326
  "",
264
327
  "<!-- FUSION:START -->",
@@ -269,6 +332,16 @@ export function composeCLAUDEmd(_ctx) {
269
332
  "",
270
333
  renderFuseDocStandard(),
271
334
  "",
335
+ renderBeatHooks(),
336
+ "",
337
+ renderReviewRecord(),
338
+ "",
339
+ renderTestResults(),
340
+ "",
341
+ renderRequirementBrief(),
342
+ "",
343
+ renderTraceability(),
344
+ "",
272
345
  renderAutoMode(),
273
346
  "",
274
347
  renderPathA(),
@@ -1 +1 @@
1
- {"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/templates/claude-md.ts"],"names":[],"mappings":"AAEA,SAAS,sBAAsB;IAC7B,OAAO;;iCAEwB,CAAC;AAClC,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO;;;;;;;;;;;;;oJAa2I,CAAC;AACrJ,CAAC;AAED,SAAS,WAAW;IAClB,OAAO;;;;;;;;;;;;;;;;+DAgBsD,CAAC;AAChE,CAAC;AAED,SAAS,WAAW;IAClB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;4EAwBmE,CAAC;AAC7E,CAAC;AAED,SAAS,iBAAiB;IACxB,OAAO;;;;;;;;;;;;qGAY4F,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAwDuC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;uHAyB8G,CAAC;AACxH,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO;;;;;;;;;;;;;;;;6DAgBoD,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;wHAU+G,CAAC;AACzH,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;kNAwByM,CAAC;AACnN,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO;;;;;;;;0MAQiM,CAAC;AAC3M,CAAC;AAED,SAAS,kBAAkB;IACzB,OAAO;;;;;;;2EAOkE,CAAC;AAC5E,CAAC;AAED,2EAA2E;AAC3E,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,IAAqB;IACnD,MAAM,QAAQ,GAAG;QACf,qBAAqB;QACrB,EAAE;QACF,sBAAsB,EAAE;QACxB,EAAE;QACF,uBAAuB,EAAE;QACzB,EAAE;QACF,KAAK;QACL,EAAE;QACF,uBAAuB;QACvB,0DAA0D;QAC1D,EAAE;QACF,4EAA4E;QAC5E,sDAAsD;QACtD,EAAE;QACF,qBAAqB,EAAE;QACvB,EAAE;QACF,cAAc,EAAE;QAChB,EAAE;QACF,WAAW,EAAE;QACb,EAAE;QACF,WAAW,EAAE;QACb,EAAE;QACF,iBAAiB,EAAE;QACnB,EAAE;QACF,gBAAgB,EAAE;QAClB,EAAE;QACF,qBAAqB,EAAE;QACvB,EAAE;QACF,iBAAiB,EAAE;QACnB,EAAE;QACF,oBAAoB,EAAE;QACtB,EAAE;QACF,kBAAkB,EAAE;QACpB,qBAAqB;KACtB,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACpC,CAAC"}
1
+ {"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/templates/claude-md.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,kCAAkC,EAClC,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAE3B,SAAS,sBAAsB;IAC7B,OAAO;;iCAEwB,CAAC;AAClC,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO;;;;;;;;;;;;;oJAa2I,CAAC;AACrJ,CAAC;AAED,SAAS,WAAW;IAClB,OAAO;;;;;;;;;;;;;;;;;;;;;uBAqBc,sBAAsB,EAAE,EAAE,CAAC;AAClD,CAAC;AAED,SAA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;;;;0MAYiM,CAAC;AAC3M,CAAC;AAED,SAAS,kBAAkB;IACzB,OAAO;;;;;;;2EAOkE,CAAC;AAC5E,CAAC;AAED,2EAA2E;AAC3E,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,IAAqB;IACnD,MAAM,QAAQ,GAAG;QACf,qBAAqB;QACrB,EAAE;QACF,sBAAsB,EAAE;QACxB,EAAE;QACF,uBAAuB,EAAE;QACzB,EAAE;QACF,kCAAkC,EAAE;QACpC,EAAE;QACF,KAAK;QACL,EAAE;QACF,uBAAuB;QACvB,0DAA0D;QAC1D,EAAE;QACF,4EAA4E;QAC5E,sDAAsD;QACtD,EAAE;QACF,qBAAqB,EAAE;QACvB,EAAE;QACF,eAAe,EAAE;QACjB,EAAE;QACF,kBAAkB,EAAE;QACpB,EAAE;QACF,iBAAiB,EAAE;QACnB,EAAE;QACF,sBAAsB,EAAE;QACxB,EAAE;QACF,kBAAkB,EAAE;QACpB,EAAE;QACF,cAAc,EAAE;QAChB,EAAE;QACF,WAAW,EAAE;QACb,EAAE;QACF,WAAW,EAAE;QACb,EAAE;QACF,iBAAiB,EAAE;QACnB,EAAE;QACF,gBAAgB,EAAE;QAClB,EAAE;QACF,qBAAqB,EAAE;QACvB,EAAE;QACF,iBAAiB,EAAE;QACnB,EAAE;QACF,oBAAoB,EAAE;QACtB,EAAE;QACF,kBAAkB,EAAE;QACpB,qBAAqB;KACtB,CAAC;IACF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fuseqa-skill.d.ts","sourceRoot":"","sources":["../../src/templates/fuseqa-skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAgHhE"}
1
+ {"version":3,"file":"fuseqa-skill.d.ts","sourceRoot":"","sources":["../../src/templates/fuseqa-skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAOnD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAoHhE"}
@@ -1,3 +1,4 @@
1
+ import { renderLedgerTraceRule, renderTestTraceRule, renderTraceReferenceRule, } from './traceability.js';
1
2
  export function composeFuseQASkill(_ctx) {
2
3
  return `---
3
4
  name: fuseqa
@@ -47,6 +48,8 @@ Two hard rules, both mechanically checkable:
47
48
  - **No importing project source.** A case that imports from \`../src/\` is not a FuseQA case — it is a unit test wearing a costume. This is grep-checkable, so it is checked.
48
49
  - **The artifact under test is the build output, not the source.** TDD covers \`src/\`; FuseQA covers what ships. The bin-shim entry-guard defect above passes at source level and fails as a built artifact — that gap is this skill's whole subject.
49
50
 
51
+ **Writing \`traces-to\`.** ${renderTraceReferenceRule()} ${renderTestTraceRule()}
52
+
50
53
  ---
51
54
 
52
55
  ## §3 Entry recipes
@@ -108,6 +111,8 @@ Cases live in \`tests/e2e/<capability>/\`, the capability name matching \`opensp
108
111
  - **Correction** — why the original judgment was wrong.
109
112
  - **Removal** — why the case is no longer valid. Without a reason, "deleting a red case" and "hiding a defect" look identical in the ledger.
110
113
 
114
+ **Ledger format.** ${renderLedgerTraceRule()}
115
+
111
116
  A suite that only grows rots: cases outlive their requirements, drift into permanent red, and get skipped wholesale. Retirement with a recorded reason is what keeps the suite trustworthy.
112
117
  `;
113
118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fuseqa-skill.js","sourceRoot":"","sources":["../../src/templates/fuseqa-skill.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CAAC,IAAqB;IACtD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GR,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"fuseqa-skill.js","sourceRoot":"","sources":["../../src/templates/fuseqa-skill.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,UAAU,kBAAkB,CAAC,IAAqB;IACtD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAgDoB,wBAAwB,EAAE,IAAI,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+D3D,qBAAqB,EAAE;;;CAG3C,CAAC;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"openspec-config.d.ts","sourceRoot":"","sources":["../../src/templates/openspec-config.ts"],"names":[],"mappings":"AAiCA,wBAAgB,qBAAqB,IAAI,MAAM,CAM9C"}
1
+ {"version":3,"file":"openspec-config.d.ts","sourceRoot":"","sources":["../../src/templates/openspec-config.ts"],"names":[],"mappings":"AA0CA,wBAAgB,qBAAqB,IAAI,MAAM,CAM9C"}
@@ -1,3 +1,4 @@
1
+ import { renderScenarioNameRule, renderTaskTraceRule, renderTraceReferenceRule, } from './traceability.js';
1
2
  // Stack-agnostic rule set. These are process constraints that hold for any
2
3
  // project, not stack-specific hints (crates, hooks, etc. were dropped with
3
4
  // the stack layer).
@@ -20,6 +21,7 @@ const RULES = {
20
21
  'Specs must define both success and failure behaviors',
21
22
  'Include boundary conditions and edge cases',
22
23
  'Reference concrete symbols, not vague descriptions',
24
+ renderScenarioNameRule(),
23
25
  ],
24
26
  tasks: [
25
27
  'Break tasks into chunks of max 2 hours of work',
@@ -27,6 +29,8 @@ const RULES = {
27
29
  'Tasks must follow TDD order - write test first, then implement, then refactor',
28
30
  'Every task must include a verification command',
29
31
  'Mark blocking dependencies explicitly between tasks',
32
+ renderTraceReferenceRule(),
33
+ renderTaskTraceRule(),
30
34
  ],
31
35
  };
32
36
  export function composeOpenspecConfig() {
@@ -1 +1 @@
1
- {"version":3,"file":"openspec-config.js","sourceRoot":"","sources":["../../src/templates/openspec-config.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,oBAAoB;AACpB,MAAM,OAAO,GAAG;mEACmD,CAAC;AAEpE,MAAM,KAAK,GAA6B;IACtC,QAAQ,EAAE;QACR,2FAA2F;QAC3F,gFAAgF;QAChF,+CAA+C;QAC/C,gCAAgC;KACjC;IACD,MAAM,EAAE;QACN,gEAAgE;QAChE,iCAAiC;QACjC,qDAAqD;KACtD;IACD,KAAK,EAAE;QACL,0CAA0C;QAC1C,sDAAsD;QACtD,4CAA4C;QAC5C,oDAAoD;KACrD;IACD,KAAK,EAAE;QACL,gDAAgD;QAChD,+EAA+E;QAC/E,+EAA+E;QAC/E,gDAAgD;QAChD,qDAAqD;KACtD;CACF,CAAC;AAEF,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,KAAK;KACb,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"openspec-config.js","sourceRoot":"","sources":["../../src/templates/openspec-config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,2EAA2E;AAC3E,2EAA2E;AAC3E,oBAAoB;AACpB,MAAM,OAAO,GAAG;mEACmD,CAAC;AAEpE,MAAM,KAAK,GAA6B;IACtC,QAAQ,EAAE;QACR,2FAA2F;QAC3F,gFAAgF;QAChF,+CAA+C;QAC/C,gCAAgC;KACjC;IACD,MAAM,EAAE;QACN,gEAAgE;QAChE,iCAAiC;QACjC,qDAAqD;KACtD;IACD,KAAK,EAAE;QACL,0CAA0C;QAC1C,sDAAsD;QACtD,4CAA4C;QAC5C,oDAAoD;QACpD,sBAAsB,EAAE;KACzB;IACD,KAAK,EAAE;QACL,gDAAgD;QAChD,+EAA+E;QAC/E,+EAA+E;QAC/E,gDAAgD;QAChD,qDAAqD;QACrD,wBAAwB,EAAE;QAC1B,mBAAmB,EAAE;KACtB;CACF,CAAC;AAEF,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,KAAK;KACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Renders the two pipeline records shared by every SpecFuse entry point: the
3
+ * change-root review record and the optional machine-readable test result.
4
+ *
5
+ * Both are prose: no runtime in this package reads `review.md` or a project's
6
+ * declaration. Each entry point renders these strings once; a test compares
7
+ * them across modes so the wording cannot drift.
8
+ */
9
+ export declare const REVIEW_RECORD_PATH = "openspec/changes/<change>/review.md";
10
+ export declare const TEST_RESULT_FILES: {
11
+ readonly junit: "evidence/verify-result.xml";
12
+ readonly 'pytest-json': "evidence/verify-result.json";
13
+ };
14
+ /** Decision line, state after re-review, reflection block, example. */
15
+ export declare function renderReviewRecordRules(): string;
16
+ /** Interactive-only paragraph for a declined review. */
17
+ export declare function renderSkippedReviewRecord(): string;
18
+ /** Declaration shape and run rules; context changes only the report noun. */
19
+ export declare function renderTestResultRules(context: 'unattended' | 'interactive'): string;
20
+ /** The empty project section rendered outside the FUSION block. */
21
+ export declare function renderTestResultDeclarationSection(): string;
22
+ //# sourceMappingURL=pipeline-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-records.d.ts","sourceRoot":"","sources":["../../src/templates/pipeline-records.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,wCAAwC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,uEAAuE;AACvE,wBAAgB,uBAAuB,IAAI,MAAM,CA0BhD;AAED,wDAAwD;AACxD,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,YAAY,GAAG,aAAa,GACpC,MAAM,CA8BR;AAED,mEAAmE;AACnE,wBAAgB,kCAAkC,IAAI,MAAM,CAM3D"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Renders the two pipeline records shared by every SpecFuse entry point: the
3
+ * change-root review record and the optional machine-readable test result.
4
+ *
5
+ * Both are prose: no runtime in this package reads `review.md` or a project's
6
+ * declaration. Each entry point renders these strings once; a test compares
7
+ * them across modes so the wording cannot drift.
8
+ */
9
+ export const REVIEW_RECORD_PATH = 'openspec/changes/<change>/review.md';
10
+ export const TEST_RESULT_FILES = {
11
+ junit: 'evidence/verify-result.xml',
12
+ 'pytest-json': 'evidence/verify-result.json',
13
+ };
14
+ /** Decision line, state after re-review, reflection block, example. */
15
+ export function renderReviewRecordRules() {
16
+ return [
17
+ "After FuseReview closes — after the last fix re-review and before the `post-review` beat hook — the main model writes `" +
18
+ REVIEW_RECORD_PATH +
19
+ "`. A reviewer's working note such as `handoff/review.md` does not replace it, and a subagent never writes it. The body records the findings and how each was handled; two parts have a fixed form.",
20
+ '',
21
+ '**Decision line.** Exactly one line starts with `FuseReview: ` and carries one value of `FuseReview: PASS|CONCERNS|BLOCK`. Prose, headings, and indented lines never carry the decision; a second decision line or any other value makes the decision invalid.',
22
+ '',
23
+ '- `PASS`: no finding is open, and the review was a cold read.',
24
+ '- `CONCERNS`: no Blocking finding is open, but a Suggestion is open or the review was not a cold read.',
25
+ '- `BLOCK`: a Blocking finding is still open when the fix rounds end.',
26
+ '',
27
+ 'The decision reflects the state after the fix re-review: a finding the re-review closed is `addressed`; a finding the re-review raised and no fix round closed is `open` and counts toward the decision. `CONCERNS` does not block archive. `BLOCK` stops the run without archiving, after the `post-review` beat hook runs.',
28
+ '',
29
+ '**Reflection block.** One fenced code block whose info string is `reflection`. Its body has one top-level key, `items`, listing each finding as one item. Each item has `id` and `status`, one of `open`, `addressed`, or `waived`; a `waived` item also has non-empty `reason`, `owner`, and `expires` (a `YYYY-MM-DD` date). With no items, write `items:` with an empty value; never write `items: []`.',
30
+ '',
31
+ '````markdown',
32
+ 'FuseReview: PASS',
33
+ '',
34
+ 'No finding is open.',
35
+ '',
36
+ '```reflection',
37
+ 'items:',
38
+ '```',
39
+ '````',
40
+ ].join('\n');
41
+ }
42
+ /** Interactive-only paragraph for a declined review. */
43
+ export function renderSkippedReviewRecord() {
44
+ return '**Skipped review.** When the user declines FuseReview at the checkpoint, still write `' + REVIEW_RECORD_PATH + '`: the decision line `FuseReview: CONCERNS`; a body stating `FuseReview skipped by user` and the change facts listed at the checkpoint (task count, whether subagent mode was used, the modules touched); and a `reflection` block with one item: `id: review-skipped`, `status: waived`, a `reason` giving the user\'s reason, an `owner` naming the person who decided, and an `expires` date 30 days after the skip. Then run the `post-review` beat hook as usual.';
45
+ }
46
+ /** Declaration shape and run rules; context changes only the report noun. */
47
+ export function renderTestResultRules(context) {
48
+ const invalidDeclaration = context === 'interactive'
49
+ ? '- A section missing either item declares nothing. A `format` other than `junit` or `pytest-json`, or a `command` without `{out}`, also declares nothing; record it as one line in the final report (the completion report in interactive mode).'
50
+ : '- A section missing either item declares nothing. A `format` other than `junit` or `pytest-json`, or a `command` without `{out}`, also declares nothing; record it as one line in the final report.';
51
+ return [
52
+ 'A project may declare a command that writes machine-readable test results, in a `## Test Result Declaration` section of its `CLAUDE.md`, outside the FUSION block. The section holds two list items:',
53
+ '',
54
+ '- `format`: `junit` or `pytest-json`. `junit` writes `' +
55
+ TEST_RESULT_FILES.junit +
56
+ '` and `pytest-json` writes `' +
57
+ TEST_RESULT_FILES['pytest-json'] +
58
+ '`, both under the change directory `openspec/changes/<change>/`.',
59
+ '- `command`: the command that writes the result file. It contains `{out}`, which is replaced with that path.',
60
+ '',
61
+ 'For example, the items `format: junit` and `command: pytest --junitxml={out}` declare JUnit XML results.',
62
+ '',
63
+ '- Without a declaration no result file is written; raw terminal output still goes to `evidence/*.txt`.',
64
+ invalidDeclaration,
65
+ '- Run the declared command from the project root twice: once when implementation ends, before the `post-apply` beat hook, and once in Verify alongside the full test suite. Each run overwrites the result file, so the Verify run is the one that remains.',
66
+ '- `' +
67
+ TEST_RESULT_FILES.junit +
68
+ '` and `' +
69
+ TEST_RESULT_FILES['pytest-json'] +
70
+ '` never exist together: remove the other extension before writing.',
71
+ '- When a fix round changes code, tests, or docs, rerun the declared command before rerunning `post-apply`.',
72
+ '- A non-zero exit fails that run, as a failing test suite does.',
73
+ '- The main model runs the declared command; a subagent never runs it.',
74
+ ].join('\n');
75
+ }
76
+ /** The empty project section rendered outside the FUSION block. */
77
+ export function renderTestResultDeclarationSection() {
78
+ return [
79
+ '## Test Result Declaration',
80
+ '',
81
+ 'Optional. To have the pipeline write machine-readable test results to `evidence/verify-result.<ext>` in each change directory, add two list items to this section: `format`, either `junit` or `pytest-json`, and `command`, a command containing `{out}` — for example `format: junit` with `command: pytest --junitxml={out}`, each as a `- ` list item. Until both items exist, this project declares nothing. This section is outside the FUSION block, so rescaffolding keeps it.',
82
+ ].join('\n');
83
+ }
84
+ //# sourceMappingURL=pipeline-records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline-records.js","sourceRoot":"","sources":["../../src/templates/pipeline-records.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,qCAAqC,CAAC;AAExE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,4BAA4B;IACnC,aAAa,EAAE,6BAA6B;CACpC,CAAC;AAEX,uEAAuE;AACvE,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,yHAAyH;YACvH,kBAAkB;YAClB,oMAAoM;QACtM,EAAE;QACF,gQAAgQ;QAChQ,EAAE;QACF,+DAA+D;QAC/D,wGAAwG;QACxG,sEAAsE;QACtE,EAAE;QACF,8TAA8T;QAC9T,EAAE;QACF,4YAA4Y;QAC5Y,EAAE;QACF,cAAc;QACd,kBAAkB;QAClB,EAAE;QACF,qBAAqB;QACrB,EAAE;QACF,eAAe;QACf,QAAQ;QACR,KAAK;QACL,MAAM;KACP,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,yBAAyB;IACvC,OAAO,wFAAwF,GAAG,kBAAkB,GAAG,wcAAwc,CAAC;AAClkB,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,qBAAqB,CACnC,OAAqC;IAErC,MAAM,kBAAkB,GACtB,OAAO,KAAK,aAAa;QACvB,CAAC,CAAC,iPAAiP;QACnP,CAAC,CAAC,qMAAqM,CAAC;IAE5M,OAAO;QACL,sMAAsM;QACtM,EAAE;QACF,wDAAwD;YACtD,iBAAiB,CAAC,KAAK;YACvB,8BAA8B;YAC9B,iBAAiB,CAAC,aAAa,CAAC;YAChC,kEAAkE;QACpE,8GAA8G;QAC9G,EAAE;QACF,0GAA0G;QAC1G,EAAE;QACF,wGAAwG;QACxG,kBAAkB;QAClB,6PAA6P;QAC7P,KAAK;YACH,iBAAiB,CAAC,KAAK;YACvB,SAAS;YACT,iBAAiB,CAAC,aAAa,CAAC;YAChC,oEAAoE;QACtE,4GAA4G;QAC5G,iEAAiE;QACjE,uEAAuE;KACxE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,kCAAkC;IAChD,OAAO;QACL,4BAA4B;QAC5B,EAAE;QACF,wdAAwd;KACzd,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Renders the requirement brief protocol shared by every SpecFuse entry point:
3
+ * the `spec-meta` block in `proposal.md` and the `clarification` block in
4
+ * `design.md`.
5
+ *
6
+ * The rules are prose: no runtime in this package parses either block. Each
7
+ * entry point renders these strings once; tests compare them across outputs so
8
+ * the wording cannot drift, and they carry no reference to a directory a
9
+ * generated project lacks.
10
+ */
11
+ export declare const REQUIREMENT_BRIEF_FIELDS: readonly ["scope", "workType", "priority", "source", "stakeholder", "nfrThresholds", "scopeExclusions"];
12
+ export declare const WORK_TYPES: readonly ["feature", "bugfix", "refactor", "chore"];
13
+ export declare const PRIORITIES: readonly ["must", "should", "could", "wont"];
14
+ /** Block definition, field table, examples, clarification definition. */
15
+ export declare function renderRequirementBriefRules(): string;
16
+ /** One paragraph, no label: who decides each field in an unattended run. */
17
+ export declare function renderUnattendedBriefDecisions(): string;
18
+ /** One paragraph: the interactive question rule. Only CLAUDE.md renders it. */
19
+ export declare function renderInteractiveBriefQuestions(): string;
20
+ //# sourceMappingURL=requirement-brief.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requirement-brief.d.ts","sourceRoot":"","sources":["../../src/templates/requirement-brief.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,yGAQ3B,CAAC;AAEX,eAAO,MAAM,UAAU,qDAAsD,CAAC;AAE9E,eAAO,MAAM,UAAU,8CAA+C,CAAC;AA0GvE,yEAAyE;AACzE,wBAAgB,2BAA2B,IAAI,MAAM,CAcpD;AAED,4EAA4E;AAC5E,wBAAgB,8BAA8B,IAAI,MAAM,CAEvD;AAED,+EAA+E;AAC/E,wBAAgB,+BAA+B,IAAI,MAAM,CAExD"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Renders the requirement brief protocol shared by every SpecFuse entry point:
3
+ * the `spec-meta` block in `proposal.md` and the `clarification` block in
4
+ * `design.md`.
5
+ *
6
+ * The rules are prose: no runtime in this package parses either block. Each
7
+ * entry point renders these strings once; tests compare them across outputs so
8
+ * the wording cannot drift, and they carry no reference to a directory a
9
+ * generated project lacks.
10
+ */
11
+ export const REQUIREMENT_BRIEF_FIELDS = [
12
+ 'scope',
13
+ 'workType',
14
+ 'priority',
15
+ 'source',
16
+ 'stakeholder',
17
+ 'nfrThresholds',
18
+ 'scopeExclusions',
19
+ ];
20
+ export const WORK_TYPES = ['feature', 'bugfix', 'refactor', 'chore'];
21
+ export const PRIORITIES = ['must', 'should', 'could', 'wont'];
22
+ /** The `value` shape of each field, as the table states it. */
23
+ const FIELD_SHAPES = {
24
+ scope: 'non-empty string',
25
+ workType: 'string',
26
+ priority: 'string',
27
+ source: 'string',
28
+ stakeholder: 'string',
29
+ nfrThresholds: 'list of strings, may be empty `[]`',
30
+ scopeExclusions: 'list of strings, may be empty `[]`',
31
+ };
32
+ /** Fields whose allowed values are a closed set; the rest render an em dash. */
33
+ const FIELD_ENUMS = {
34
+ workType: WORK_TYPES,
35
+ priority: PRIORITIES,
36
+ };
37
+ /** Example values for the `spec-meta` block, keyed by field and emitted in field order. */
38
+ const EXAMPLE = {
39
+ scope: {
40
+ value: [' value: Export the monthly report as CSV'],
41
+ decidedBy: 'human',
42
+ },
43
+ workType: {
44
+ value: [` value: ${WORK_TYPES[0]}`],
45
+ decidedBy: 'ai',
46
+ reason: 'Adds an export users can run',
47
+ },
48
+ priority: {
49
+ value: [` value: ${PRIORITIES[1]}`],
50
+ decidedBy: 'ai',
51
+ reason: 'The requirement names no deadline',
52
+ },
53
+ source: {
54
+ value: [' value: Support request from the finance team'],
55
+ decidedBy: 'human',
56
+ },
57
+ stakeholder: {
58
+ value: [' value: Finance team'],
59
+ decidedBy: 'human',
60
+ },
61
+ nfrThresholds: {
62
+ value: [' value:', ' - An export of 10000 rows finishes within 5 seconds'],
63
+ decidedBy: 'human',
64
+ },
65
+ scopeExclusions: {
66
+ value: [' value: []'],
67
+ decidedBy: 'ai',
68
+ reason: 'The requirement excludes nothing',
69
+ },
70
+ };
71
+ function enumCell(values) {
72
+ return values.map((value) => '`' + value + '`').join(', ');
73
+ }
74
+ function renderFieldTable() {
75
+ const rows = REQUIREMENT_BRIEF_FIELDS.map((field) => {
76
+ const allowed = FIELD_ENUMS[field];
77
+ const values = allowed ? enumCell(allowed) : '—';
78
+ return `| \`${field}\` | ${FIELD_SHAPES[field]} | ${values} |`;
79
+ });
80
+ return ['| Field | `value` shape | Allowed values |', '|---|---|---|', ...rows].join('\n');
81
+ }
82
+ function renderSpecMetaExample() {
83
+ const lines = ['````markdown', '```spec-meta'];
84
+ for (const field of REQUIREMENT_BRIEF_FIELDS) {
85
+ const entry = EXAMPLE[field];
86
+ lines.push(`${field}:`, ...entry.value, ` decidedBy: ${entry.decidedBy}`);
87
+ if (entry.decidedBy === 'ai') {
88
+ lines.push(` reason: ${entry.reason}`);
89
+ }
90
+ }
91
+ lines.push('```', '````');
92
+ return lines.join('\n');
93
+ }
94
+ function renderClarificationExample() {
95
+ return [
96
+ '````markdown',
97
+ '```clarification',
98
+ 'question: Which work type applies?',
99
+ 'status: answered',
100
+ `answer: ${WORK_TYPES[0]}`,
101
+ 'decidedBy: ai',
102
+ 'reason: Adds an export users can run',
103
+ '```',
104
+ '````',
105
+ ].join('\n');
106
+ }
107
+ /** Block definition, field table, examples, clarification definition. */
108
+ export function renderRequirementBriefRules() {
109
+ return [
110
+ '`proposal.md` holds one fenced code block whose info string is `spec-meta`: the requirement brief. It has exactly seven fields, and the list is fixed: `scope` is required; `workType`, `priority`, `source`, `stakeholder`, `nfrThresholds`, and `scopeExclusions` are optional. Each field is a block mapping with `value` and `decidedBy`, which is `human` or `ai`; a `decidedBy: ai` field also has a non-empty `reason`.',
111
+ '',
112
+ renderFieldTable(),
113
+ '',
114
+ renderSpecMetaExample(),
115
+ '',
116
+ '`design.md` holds a `## Clarifications` section. Each clarification is one fenced code block whose info string is `clarification`; a clarification written as a plain paragraph does not count. Required keys are `question` and `status`, which is `open` or `answered`; optional keys are `answer`, `options`, `impacts`, `decidedBy`, and `reason`. A `status: answered` block has a non-empty `answer`; a `status: open` block has no `answer`. `decidedBy` is `human` or `ai`, and `decidedBy: ai` needs a non-empty `reason`.',
117
+ '',
118
+ renderClarificationExample(),
119
+ '',
120
+ 'Every field recorded `decidedBy: ai` has one answered `clarification` block with `decidedBy: ai` and a non-empty `reason`; a `clarification` block for a field recorded `decidedBy: human` is optional. A field already recorded `decidedBy: human` is never rewritten by the model.',
121
+ ].join('\n');
122
+ }
123
+ /** One paragraph, no label: who decides each field in an unattended run. */
124
+ export function renderUnattendedBriefDecisions() {
125
+ return 'Ask no question about the brief. Record a field whose value the requirement text states as `decidedBy: human`. Give every other field the recommended value, `decidedBy: ai`, and a `reason`, and write one answered `clarification` block for it in `design.md`.';
126
+ }
127
+ /** One paragraph: the interactive question rule. Only CLAUDE.md renders it. */
128
+ export function renderInteractiveBriefQuestions() {
129
+ return "**Questions in brainstorming (Path A and Path B).** Before other questions, read the pre-think beat's output and list the business fields the requirement leaves out — `workType`, `priority`, `source`, `stakeholder`, `nfrThresholds`, `scopeExclusions` — as open questions; when there is no such output, list them from the requirement alone. Ask one question at a time, only about a missing business field or a high-impact item, ordered by impact. A high-impact item is an approach that would overturn a decision already recorded in the pre-think beat's output. Brainstorming asks at most five questions in all. Record a field the user answers as `decidedBy: human`, a field left unasked as `decidedBy: ai` with a `reason`, and a field the user hands to the model as `decidedBy: ai` with `reason: delegated`.";
130
+ }
131
+ //# sourceMappingURL=requirement-brief.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requirement-brief.js","sourceRoot":"","sources":["../../src/templates/requirement-brief.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,aAAa;IACb,eAAe;IACf,iBAAiB;CACT,CAAC;AAEX,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAE9E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAIvE,+DAA+D;AAC/D,MAAM,YAAY,GAA0B;IAC1C,KAAK,EAAE,kBAAkB;IACz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AAK;QACL,MAAM;KACP,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,gaAAga;QACha,EAAE;QACF,gBAAgB,EAAE;QAClB,EAAE;QACF,qBAAqB,EAAE;QACvB,EAAE;QACF,qgBAAqgB;QACrgB,EAAE;QACF,0BAA0B,EAAE;QAC5B,EAAE;QACF,sRAAsR;KACvR,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,8BAA8B;IAC5C,OAAO,mQAAmQ,CAAC;AAC7Q,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,+BAA+B;IAC7C,OAAO,wyBAAwyB,CAAC;AAClzB,CAAC"}
@@ -1,22 +1,5 @@
1
- /**
2
- * Renders the unattended pipeline as Claude Code slash commands and as
3
- * dsh-invocable skills.
4
- *
5
- * The pipeline is prose, not a runtime: every ordering rule below is enforced
6
- * only by the model reading it. Keep clauses exact — the tests assert the
7
- * sentences that carry each requirement, because a looser paraphrase can drop
8
- * a prohibition (for example, "archive after verify" without "only when every
9
- * check passes") while every keyword still appears.
10
- *
11
- * Both modes share the same automatic-decision policy, TDD rules, verify gate,
12
- * and prohibitions. They differ only in the FuseQA posture, the execution
13
- * order, the worktree phase list, and the completion report. The Claude and
14
- * dsh variants differ only in their frontmatter, the way the requirement
15
- * arrives, and the harness-specific skill and verify paths.
16
- */
17
- type SpecfuseMode = 'default' | 'full';
18
1
  export declare function composeSpecfuseCommand(): string;
19
2
  export declare function composeSpecfuseFullCommand(): string;
20
- export declare function composeSpecfuseDshSkill(mode: SpecfuseMode): string;
21
- export {};
3
+ export declare function composeSpecfuseFlashmodeCommand(): string;
4
+ export declare function composeSpecfuseDshSkill(mode: 'default' | 'full'): string;
22
5
  //# sourceMappingURL=specfuse-command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"specfuse-command.d.ts","sourceRoot":"","sources":["../../src/templates/specfuse-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,KAAK,YAAY,GAAG,SAAS,GAAG,MAAM,CAAC;AAqJvC,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAelE"}
1
+ {"version":3,"file":"specfuse-command.d.ts","sourceRoot":"","sources":["../../src/templates/specfuse-command.ts"],"names":[],"mappings":"AA0XA,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED,wBAAgB,+BAA+B,IAAI,MAAM,CAExD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAexE"}