@seanmars/tospec 0.11.0 → 0.13.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 (211) hide show
  1. package/assets/dashboard/style.css +8 -3
  2. package/dist/cli/index.d.ts.map +1 -1
  3. package/dist/cli/index.js +40 -17
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/config.d.ts.map +1 -1
  6. package/dist/commands/config.js +0 -9
  7. package/dist/commands/config.js.map +1 -1
  8. package/dist/commands/dashboard.d.ts +95 -8
  9. package/dist/commands/dashboard.d.ts.map +1 -1
  10. package/dist/commands/dashboard.js +253 -32
  11. package/dist/commands/dashboard.js.map +1 -1
  12. package/dist/commands/decision.d.ts.map +1 -1
  13. package/dist/commands/decision.js +1 -13
  14. package/dist/commands/decision.js.map +1 -1
  15. package/dist/commands/validate.d.ts.map +1 -1
  16. package/dist/commands/validate.js +36 -41
  17. package/dist/commands/validate.js.map +1 -1
  18. package/dist/commands/workflow/instructions.d.ts +0 -2
  19. package/dist/commands/workflow/instructions.d.ts.map +1 -1
  20. package/dist/commands/workflow/instructions.js +2 -37
  21. package/dist/commands/workflow/instructions.js.map +1 -1
  22. package/dist/commands/workflow/shared.d.ts +0 -3
  23. package/dist/commands/workflow/shared.d.ts.map +1 -1
  24. package/dist/commands/workflow/shared.js.map +1 -1
  25. package/dist/core/archive.d.ts +13 -4
  26. package/dist/core/archive.d.ts.map +1 -1
  27. package/dist/core/archive.js +89 -117
  28. package/dist/core/archive.js.map +1 -1
  29. package/dist/core/artifact-graph/instruction-loader.d.ts +0 -5
  30. package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -1
  31. package/dist/core/artifact-graph/instruction-loader.js +31 -37
  32. package/dist/core/artifact-graph/instruction-loader.js.map +1 -1
  33. package/dist/core/artifact-graph/resolver.d.ts +6 -0
  34. package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
  35. package/dist/core/artifact-graph/resolver.js +79 -124
  36. package/dist/core/artifact-graph/resolver.js.map +1 -1
  37. package/dist/core/change-presenter.d.ts +0 -1
  38. package/dist/core/change-presenter.d.ts.map +1 -1
  39. package/dist/core/change-presenter.js +3 -20
  40. package/dist/core/change-presenter.js.map +1 -1
  41. package/dist/core/command-generation/adapters/index.d.ts +9 -1
  42. package/dist/core/command-generation/adapters/index.d.ts.map +1 -1
  43. package/dist/core/command-generation/adapters/index.js +10 -1
  44. package/dist/core/command-generation/adapters/index.js.map +1 -1
  45. package/dist/core/command-generation/index.d.ts +2 -2
  46. package/dist/core/command-generation/index.d.ts.map +1 -1
  47. package/dist/core/command-generation/index.js +2 -2
  48. package/dist/core/command-generation/index.js.map +1 -1
  49. package/dist/core/config.d.ts +0 -4
  50. package/dist/core/config.d.ts.map +1 -1
  51. package/dist/core/config.js +0 -4
  52. package/dist/core/config.js.map +1 -1
  53. package/dist/core/converters/json-converter.d.ts +0 -1
  54. package/dist/core/converters/json-converter.d.ts.map +1 -1
  55. package/dist/core/converters/json-converter.js +3 -17
  56. package/dist/core/converters/json-converter.js.map +1 -1
  57. package/dist/core/dashboard-activity.d.ts.map +1 -1
  58. package/dist/core/dashboard-activity.js +2 -8
  59. package/dist/core/dashboard-activity.js.map +1 -1
  60. package/dist/core/dashboard-data.d.ts +7 -7
  61. package/dist/core/dashboard-data.d.ts.map +1 -1
  62. package/dist/core/dashboard-data.js +15 -54
  63. package/dist/core/dashboard-data.js.map +1 -1
  64. package/dist/core/id.d.ts +0 -8
  65. package/dist/core/id.d.ts.map +1 -1
  66. package/dist/core/id.js +0 -19
  67. package/dist/core/id.js.map +1 -1
  68. package/dist/core/init.d.ts +0 -1
  69. package/dist/core/init.d.ts.map +1 -1
  70. package/dist/core/init.js +11 -26
  71. package/dist/core/init.js.map +1 -1
  72. package/dist/core/list.d.ts.map +1 -1
  73. package/dist/core/list.js +3 -34
  74. package/dist/core/list.js.map +1 -1
  75. package/dist/core/migrate.js +9 -15
  76. package/dist/core/migrate.js.map +1 -1
  77. package/dist/core/parsers/markdown-parser.d.ts +11 -1
  78. package/dist/core/parsers/markdown-parser.d.ts.map +1 -1
  79. package/dist/core/parsers/markdown-parser.js +25 -13
  80. package/dist/core/parsers/markdown-parser.js.map +1 -1
  81. package/dist/core/planning-home.d.ts +6 -0
  82. package/dist/core/planning-home.d.ts.map +1 -1
  83. package/dist/core/planning-home.js +6 -1
  84. package/dist/core/planning-home.js.map +1 -1
  85. package/dist/core/project-config.d.ts +5 -19
  86. package/dist/core/project-config.d.ts.map +1 -1
  87. package/dist/core/project-config.js +11 -130
  88. package/dist/core/project-config.js.map +1 -1
  89. package/dist/core/root-selection.d.ts.map +1 -1
  90. package/dist/core/root-selection.js +2 -15
  91. package/dist/core/root-selection.js.map +1 -1
  92. package/dist/core/shared/index.d.ts +2 -2
  93. package/dist/core/shared/index.d.ts.map +1 -1
  94. package/dist/core/shared/index.js +2 -2
  95. package/dist/core/shared/index.js.map +1 -1
  96. package/dist/core/shared/skill-generation.d.ts +11 -4
  97. package/dist/core/shared/skill-generation.d.ts.map +1 -1
  98. package/dist/core/shared/skill-generation.js +18 -6
  99. package/dist/core/shared/skill-generation.js.map +1 -1
  100. package/dist/core/shared/tool-detection.d.ts +3 -6
  101. package/dist/core/shared/tool-detection.d.ts.map +1 -1
  102. package/dist/core/shared/tool-detection.js +3 -9
  103. package/dist/core/shared/tool-detection.js.map +1 -1
  104. package/dist/core/spec-presenter.d.ts.map +1 -1
  105. package/dist/core/spec-presenter.js.map +1 -1
  106. package/dist/core/specs-apply.d.ts +0 -31
  107. package/dist/core/specs-apply.d.ts.map +1 -1
  108. package/dist/core/specs-apply.js +0 -102
  109. package/dist/core/specs-apply.js.map +1 -1
  110. package/dist/core/templates/fragments/interview.d.ts +10 -0
  111. package/dist/core/templates/fragments/interview.d.ts.map +1 -0
  112. package/dist/core/templates/fragments/interview.js +13 -0
  113. package/dist/core/templates/fragments/interview.js.map +1 -0
  114. package/dist/core/templates/fragments/next-step.d.ts +14 -0
  115. package/dist/core/templates/fragments/next-step.d.ts.map +1 -0
  116. package/dist/core/templates/fragments/next-step.js +14 -0
  117. package/dist/core/templates/fragments/next-step.js.map +1 -0
  118. package/dist/core/templates/fragments/verify.d.ts +20 -0
  119. package/dist/core/templates/fragments/verify.d.ts.map +1 -0
  120. package/dist/core/templates/{workflows → fragments}/verify.js +34 -6
  121. package/dist/core/templates/fragments/verify.js.map +1 -0
  122. package/dist/core/templates/skill-templates.d.ts +1 -1
  123. package/dist/core/templates/skill-templates.d.ts.map +1 -1
  124. package/dist/core/templates/skill-templates.js +1 -1
  125. package/dist/core/templates/skill-templates.js.map +1 -1
  126. package/dist/core/templates/types.d.ts +6 -0
  127. package/dist/core/templates/types.d.ts.map +1 -1
  128. package/dist/core/templates/workflows/apply.d.ts +2 -2
  129. package/dist/core/templates/workflows/apply.d.ts.map +1 -1
  130. package/dist/core/templates/workflows/apply.js +38 -32
  131. package/dist/core/templates/workflows/apply.js.map +1 -1
  132. package/dist/core/templates/workflows/archive.d.ts.map +1 -1
  133. package/dist/core/templates/workflows/archive.js +23 -29
  134. package/dist/core/templates/workflows/archive.js.map +1 -1
  135. package/dist/core/templates/workflows/decision.d.ts.map +1 -1
  136. package/dist/core/templates/workflows/decision.js +11 -8
  137. package/dist/core/templates/workflows/decision.js.map +1 -1
  138. package/dist/core/templates/workflows/explore.d.ts +6 -3
  139. package/dist/core/templates/workflows/explore.d.ts.map +1 -1
  140. package/dist/core/templates/workflows/explore.js +27 -31
  141. package/dist/core/templates/workflows/explore.js.map +1 -1
  142. package/dist/core/templates/workflows/grill.d.ts.map +1 -1
  143. package/dist/core/templates/workflows/grill.js +14 -21
  144. package/dist/core/templates/workflows/grill.js.map +1 -1
  145. package/dist/core/templates/workflows/issue.js +2 -2
  146. package/dist/core/templates/workflows/issue.js.map +1 -1
  147. package/dist/core/templates/workflows/propose.js +1 -1
  148. package/dist/core/templates/workflows/propose.js.map +1 -1
  149. package/dist/core/templates/workflows/reconcile.d.ts +14 -0
  150. package/dist/core/templates/workflows/reconcile.d.ts.map +1 -0
  151. package/dist/core/templates/workflows/{sync.js → reconcile.js} +29 -22
  152. package/dist/core/templates/workflows/reconcile.js.map +1 -0
  153. package/dist/core/templates/workflows/update.d.ts.map +1 -1
  154. package/dist/core/templates/workflows/update.js +18 -28
  155. package/dist/core/templates/workflows/update.js.map +1 -1
  156. package/dist/core/update.d.ts.map +1 -1
  157. package/dist/core/update.js +8 -18
  158. package/dist/core/update.js.map +1 -1
  159. package/dist/core/validation/section-validator.d.ts.map +1 -1
  160. package/dist/core/validation/section-validator.js +3 -16
  161. package/dist/core/validation/section-validator.js.map +1 -1
  162. package/dist/core/validation/validator.d.ts +0 -2
  163. package/dist/core/validation/validator.d.ts.map +1 -1
  164. package/dist/core/validation/validator.js +36 -74
  165. package/dist/core/validation/validator.js.map +1 -1
  166. package/dist/utils/change-utils.d.ts.map +1 -1
  167. package/dist/utils/change-utils.js +3 -6
  168. package/dist/utils/change-utils.js.map +1 -1
  169. package/dist/utils/file-system.d.ts +17 -19
  170. package/dist/utils/file-system.d.ts.map +1 -1
  171. package/dist/utils/file-system.js +41 -189
  172. package/dist/utils/file-system.js.map +1 -1
  173. package/dist/utils/frontmatter.d.ts +22 -0
  174. package/dist/utils/frontmatter.d.ts.map +1 -0
  175. package/dist/utils/frontmatter.js +39 -0
  176. package/dist/utils/frontmatter.js.map +1 -0
  177. package/dist/utils/item-discovery.d.ts +7 -0
  178. package/dist/utils/item-discovery.d.ts.map +1 -1
  179. package/dist/utils/item-discovery.js +13 -23
  180. package/dist/utils/item-discovery.js.map +1 -1
  181. package/dist/utils/link.d.ts +3 -1
  182. package/dist/utils/link.d.ts.map +1 -1
  183. package/dist/utils/link.js +4 -14
  184. package/dist/utils/link.js.map +1 -1
  185. package/dist/utils/task-progress.d.ts +0 -1
  186. package/dist/utils/task-progress.d.ts.map +1 -1
  187. package/dist/utils/task-progress.js +5 -6
  188. package/dist/utils/task-progress.js.map +1 -1
  189. package/package.json +1 -1
  190. package/dist/core/references.d.ts +0 -40
  191. package/dist/core/references.d.ts.map +0 -1
  192. package/dist/core/references.js +0 -11
  193. package/dist/core/references.js.map +0 -1
  194. package/dist/core/templates/workflows/sync.d.ts +0 -14
  195. package/dist/core/templates/workflows/sync.d.ts.map +0 -1
  196. package/dist/core/templates/workflows/sync.js.map +0 -1
  197. package/dist/core/templates/workflows/verify.d.ts +0 -9
  198. package/dist/core/templates/workflows/verify.d.ts.map +0 -1
  199. package/dist/core/templates/workflows/verify.js.map +0 -1
  200. package/dist/utils/command-references.d.ts +0 -18
  201. package/dist/utils/command-references.d.ts.map +0 -1
  202. package/dist/utils/command-references.js +0 -20
  203. package/dist/utils/command-references.js.map +0 -1
  204. package/dist/utils/index.d.ts +0 -6
  205. package/dist/utils/index.d.ts.map +0 -1
  206. package/dist/utils/index.js +0 -9
  207. package/dist/utils/index.js.map +0 -1
  208. package/dist/utils/shell-detection.d.ts +0 -20
  209. package/dist/utils/shell-detection.d.ts.map +0 -1
  210. package/dist/utils/shell-detection.js +0 -41
  211. package/dist/utils/shell-detection.js.map +0 -1
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Verify methodology — apply's opt-in review.
3
+ *
4
+ * verify is not a standalone skill/command; it lives inside both apply variants
5
+ * and runs only when the user asks for it. The methodology is long enough that
6
+ * leaving it inline puts ~45 lines of end-of-run review in front of an agent
7
+ * that is still on task 1 of N, so the skill form discloses it to a sibling
8
+ * `VERIFY.md` and keeps only a pointer. The command form has no sibling file,
9
+ * so it inlines the same text. Either way this module is the single source of
10
+ * truth.
11
+ */
12
+ /** The review protocol itself — shared by the disclosed file and the command. */
13
+ export declare const VERIFY_METHODOLOGY = "Two-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings \u2014 a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.\n\n**Scope \u2014 two subagents, one pass each, and that is the whole review.** The subject under review is always the *code diff*, never another review's output. Do not spawn a third agent to grade the two axes' findings, do not re-review a report you have already written, do not audit the audit. Right-sized review beats deep review: enough eyes to catch real problems, no recursion for its own sake.\n\n**What counts as blocking.** Exactly two kinds of finding block: a **hard violation** of a convention this repo documents, and a **spec-correctness** problem \u2014 a requirement missing, implemented wrongly, or contradicting a decision `design.md` records. Everything else \u2014 judgement calls, style preferences, and every code smell named below \u2014 is **report-only**: report it, do not fix it, and do not re-review because of it. A report-only finding is the user's call to make later, not this run's work. Leave this unstated and the safe reading is to fix everything, which makes \"re-run only the affected axis\" fire on every axis, every time.\n\n**Steps**\n\n1. **Gather context**\n ```bash\n tospec status --change \"<name>\" --json\n ```\n Note `schemaName` (sdd \u2192 compare against `specs/`; issue \u2192 compare against `task.md`) and the files this change touched (from `tasks.md`/`task.md`, or `git diff` against the commit before the change started).\n\n2. **Spawn both axes in parallel** \u2014 a single message with two `Agent` tool calls, both `general-purpose`:\n\n **Standards axis prompt** \u2014 include the diff and the brief: \"Report every place the diff violates this repo's documented conventions (cite the file/rule), plus any of Fowler's code smells you spot (Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Speculative Generality, Message Chains, Middle Man, Refused Bequest) \u2014 name the smell, quote the hunk, and treat documented repo conventions as overriding the baseline. Distinguish hard violations from judgement calls. Skip anything tooling already enforces.\"\n\n **Spec axis prompt** \u2014 include the diff plus, for sdd, the relevant `specs/<capability>/spec.md` delta content (`tospec show \"<name>\" --json`) and `design.md`'s decisions; for issue, `task.md`'s root cause and fix plan. Brief: \"Report (a) requirements/task items that are missing or partially implemented; (b) behavior in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but the implementation looks wrong, or that deviate from design.md's stated decisions. Quote the spec/task line for each finding.\"\n\n3. **Run the full test suite.** This is a hard gate alongside both axes \u2014 a change with green axes but red tests isn't verified.\n\n4. **Re-validate artifacts**\n ```bash\n tospec validate \"<name>\" --json\n ```\n If validation reports an artifact-format or structural problem, fix that artifact and re-run the command until it passes. A review is not complete while artifact validation is red.\n\n5. **Aggregate \u2014 do not merge or rerank**\n\n Present the two reports under `## Standards` and `## Spec` headings. End with one line per axis: total findings and the worst issue within that axis. Do not pick a single overall verdict across axes.\n\n This is a **mechanical collation you do yourself** \u2014 collect, label, count. It is not another review pass and not a job for a subagent: nothing reviews these two reports.\n\n**Verify output**\n\nReport the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified \u2014 tell the user it's ready for `tospec-archive`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply), then send **only the hunk that fixed it** back to the axis that reported it \u2014 never the whole axis, and never the other one. You are reviewing the changed code, not the previous report. A clean axis is not re-run for extra confidence.\n\n**Verify guardrails**\n- Standards and Spec axes are independent \u2014 never let one axis's findings influence the other's report\n- Full test suite must be green; a clean review with red tests is not verified\n- Quote the specific spec/task line or hunk for every finding \u2014 no unsupported claims\n- **One review pass per axis \u2014 never review the review.** No agent audits another agent's findings, no re-reviewing a report you already wrote; a re-run after a fix sees only the hunk that fixed it, and a clean axis is not re-run for extra confidence";
14
+ /** Contents of the `VERIFY.md` shipped beside each apply skill's `SKILL.md`. */
15
+ export declare const VERIFY_DOC = "# Verify \u2014 apply's opt-in review\n\nRun this **when the user asks for a review**, once every task in the tracks file is checked off and `tospec validate` passes. It is not a step apply reaches on its own.\n\nTwo-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings \u2014 a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.\n\n**Scope \u2014 two subagents, one pass each, and that is the whole review.** The subject under review is always the *code diff*, never another review's output. Do not spawn a third agent to grade the two axes' findings, do not re-review a report you have already written, do not audit the audit. Right-sized review beats deep review: enough eyes to catch real problems, no recursion for its own sake.\n\n**What counts as blocking.** Exactly two kinds of finding block: a **hard violation** of a convention this repo documents, and a **spec-correctness** problem \u2014 a requirement missing, implemented wrongly, or contradicting a decision `design.md` records. Everything else \u2014 judgement calls, style preferences, and every code smell named below \u2014 is **report-only**: report it, do not fix it, and do not re-review because of it. A report-only finding is the user's call to make later, not this run's work. Leave this unstated and the safe reading is to fix everything, which makes \"re-run only the affected axis\" fire on every axis, every time.\n\n**Steps**\n\n1. **Gather context**\n ```bash\n tospec status --change \"<name>\" --json\n ```\n Note `schemaName` (sdd \u2192 compare against `specs/`; issue \u2192 compare against `task.md`) and the files this change touched (from `tasks.md`/`task.md`, or `git diff` against the commit before the change started).\n\n2. **Spawn both axes in parallel** \u2014 a single message with two `Agent` tool calls, both `general-purpose`:\n\n **Standards axis prompt** \u2014 include the diff and the brief: \"Report every place the diff violates this repo's documented conventions (cite the file/rule), plus any of Fowler's code smells you spot (Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Speculative Generality, Message Chains, Middle Man, Refused Bequest) \u2014 name the smell, quote the hunk, and treat documented repo conventions as overriding the baseline. Distinguish hard violations from judgement calls. Skip anything tooling already enforces.\"\n\n **Spec axis prompt** \u2014 include the diff plus, for sdd, the relevant `specs/<capability>/spec.md` delta content (`tospec show \"<name>\" --json`) and `design.md`'s decisions; for issue, `task.md`'s root cause and fix plan. Brief: \"Report (a) requirements/task items that are missing or partially implemented; (b) behavior in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but the implementation looks wrong, or that deviate from design.md's stated decisions. Quote the spec/task line for each finding.\"\n\n3. **Run the full test suite.** This is a hard gate alongside both axes \u2014 a change with green axes but red tests isn't verified.\n\n4. **Re-validate artifacts**\n ```bash\n tospec validate \"<name>\" --json\n ```\n If validation reports an artifact-format or structural problem, fix that artifact and re-run the command until it passes. A review is not complete while artifact validation is red.\n\n5. **Aggregate \u2014 do not merge or rerank**\n\n Present the two reports under `## Standards` and `## Spec` headings. End with one line per axis: total findings and the worst issue within that axis. Do not pick a single overall verdict across axes.\n\n This is a **mechanical collation you do yourself** \u2014 collect, label, count. It is not another review pass and not a job for a subagent: nothing reviews these two reports.\n\n**Verify output**\n\nReport the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified \u2014 tell the user it's ready for `tospec-archive`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply), then send **only the hunk that fixed it** back to the axis that reported it \u2014 never the whole axis, and never the other one. You are reviewing the changed code, not the previous report. A clean axis is not re-run for extra confidence.\n\n**Verify guardrails**\n- Standards and Spec axes are independent \u2014 never let one axis's findings influence the other's report\n- Full test suite must be green; a clean review with red tests is not verified\n- Quote the specific spec/task line or hunk for every finding \u2014 no unsupported claims\n- **One review pass per axis \u2014 never review the review.** No agent audits another agent's findings, no re-reviewing a report you already wrote; a re-run after a fix sees only the hunk that fixed it, and a clean axis is not re-run for extra confidence\n";
16
+ /** The pointer that replaces the methodology inside the apply skills. */
17
+ export declare const VERIFY_POINTER = "## Verify (opt-in \u2014 only when the user asks)\n\nThe two-axis review does **not** run on its own. Apply finishes on the full test suite and `tospec validate`; a change with those green is implemented, review or no review.\n\nWhen the user asks for a review, **read `VERIFY.md` in this skill's directory and run it in full.** Don't offer it unprompted either \u2014 no \"shall I review this?\" at the end of a run. If a review does run, the change stays unfinished \u2014 and must not go to `tospec-archive` \u2014 until it comes back clean.";
18
+ /** The same block for the command form, which has no sibling file to point at. */
19
+ export declare const VERIFY_INLINE = "## Verify (opt-in \u2014 only when the user asks)\n\nThe two-axis review does **not** run on its own. Apply finishes on the full test suite and `tospec validate`; a change with those green is implemented, review or no review.\n\nWhen the user asks for a review, run the methodology below in full. Don't offer it unprompted either \u2014 no \"shall I review this?\" at the end of a run. If a review does run, the change stays unfinished \u2014 and must not go to `tospec-archive` \u2014 until it comes back clean.\n\nTwo-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings \u2014 a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.\n\n**Scope \u2014 two subagents, one pass each, and that is the whole review.** The subject under review is always the *code diff*, never another review's output. Do not spawn a third agent to grade the two axes' findings, do not re-review a report you have already written, do not audit the audit. Right-sized review beats deep review: enough eyes to catch real problems, no recursion for its own sake.\n\n**What counts as blocking.** Exactly two kinds of finding block: a **hard violation** of a convention this repo documents, and a **spec-correctness** problem \u2014 a requirement missing, implemented wrongly, or contradicting a decision `design.md` records. Everything else \u2014 judgement calls, style preferences, and every code smell named below \u2014 is **report-only**: report it, do not fix it, and do not re-review because of it. A report-only finding is the user's call to make later, not this run's work. Leave this unstated and the safe reading is to fix everything, which makes \"re-run only the affected axis\" fire on every axis, every time.\n\n**Steps**\n\n1. **Gather context**\n ```bash\n tospec status --change \"<name>\" --json\n ```\n Note `schemaName` (sdd \u2192 compare against `specs/`; issue \u2192 compare against `task.md`) and the files this change touched (from `tasks.md`/`task.md`, or `git diff` against the commit before the change started).\n\n2. **Spawn both axes in parallel** \u2014 a single message with two `Agent` tool calls, both `general-purpose`:\n\n **Standards axis prompt** \u2014 include the diff and the brief: \"Report every place the diff violates this repo's documented conventions (cite the file/rule), plus any of Fowler's code smells you spot (Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Speculative Generality, Message Chains, Middle Man, Refused Bequest) \u2014 name the smell, quote the hunk, and treat documented repo conventions as overriding the baseline. Distinguish hard violations from judgement calls. Skip anything tooling already enforces.\"\n\n **Spec axis prompt** \u2014 include the diff plus, for sdd, the relevant `specs/<capability>/spec.md` delta content (`tospec show \"<name>\" --json`) and `design.md`'s decisions; for issue, `task.md`'s root cause and fix plan. Brief: \"Report (a) requirements/task items that are missing or partially implemented; (b) behavior in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but the implementation looks wrong, or that deviate from design.md's stated decisions. Quote the spec/task line for each finding.\"\n\n3. **Run the full test suite.** This is a hard gate alongside both axes \u2014 a change with green axes but red tests isn't verified.\n\n4. **Re-validate artifacts**\n ```bash\n tospec validate \"<name>\" --json\n ```\n If validation reports an artifact-format or structural problem, fix that artifact and re-run the command until it passes. A review is not complete while artifact validation is red.\n\n5. **Aggregate \u2014 do not merge or rerank**\n\n Present the two reports under `## Standards` and `## Spec` headings. End with one line per axis: total findings and the worst issue within that axis. Do not pick a single overall verdict across axes.\n\n This is a **mechanical collation you do yourself** \u2014 collect, label, count. It is not another review pass and not a job for a subagent: nothing reviews these two reports.\n\n**Verify output**\n\nReport the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified \u2014 tell the user it's ready for `tospec-archive`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply), then send **only the hunk that fixed it** back to the axis that reported it \u2014 never the whole axis, and never the other one. You are reviewing the changed code, not the previous report. A clean axis is not re-run for extra confidence.\n\n**Verify guardrails**\n- Standards and Spec axes are independent \u2014 never let one axis's findings influence the other's report\n- Full test suite must be green; a clean review with red tests is not verified\n- Quote the specific spec/task line or hunk for every finding \u2014 no unsupported claims\n- **One review pass per axis \u2014 never review the review.** No agent audits another agent's findings, no re-reviewing a report you already wrote; a re-run after a fix sees only the hunk that fixed it, and a clean axis is not re-run for extra confidence";
20
+ //# sourceMappingURL=verify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/fragments/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,kyJA0C4N,CAAC;AAE5P,gFAAgF;AAChF,eAAO,MAAM,UAAU,y/JAKtB,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,cAAc,qiBAIoR,CAAC;AAEhT,kFAAkF;AAClF,eAAO,MAAM,aAAa,syKAMJ,CAAC"}
@@ -1,14 +1,21 @@
1
1
  /**
2
- * Verify methodology (embedded into apply's final step).
2
+ * Verify methodology apply's opt-in review.
3
3
  *
4
- * verify is no longer a standalone skill/command it runs automatically at
5
- * the end of `tospec-apply`. This module exports the methodology text so
6
- * `apply.ts` can inline it; there is no skill/command template here anymore.
4
+ * verify is not a standalone skill/command; it lives inside both apply variants
5
+ * and runs only when the user asks for it. The methodology is long enough that
6
+ * leaving it inline puts ~45 lines of end-of-run review in front of an agent
7
+ * that is still on task 1 of N, so the skill form discloses it to a sibling
8
+ * `VERIFY.md` and keeps only a pointer. The command form has no sibling file,
9
+ * so it inlines the same text. Either way this module is the single source of
10
+ * truth.
7
11
  */
12
+ /** The review protocol itself — shared by the disclosed file and the command. */
8
13
  export const VERIFY_METHODOLOGY = `Two-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings — a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.
9
14
 
10
15
  **Scope — two subagents, one pass each, and that is the whole review.** The subject under review is always the *code diff*, never another review's output. Do not spawn a third agent to grade the two axes' findings, do not re-review a report you have already written, do not audit the audit. Right-sized review beats deep review: enough eyes to catch real problems, no recursion for its own sake.
11
16
 
17
+ **What counts as blocking.** Exactly two kinds of finding block: a **hard violation** of a convention this repo documents, and a **spec-correctness** problem — a requirement missing, implemented wrongly, or contradicting a decision \`design.md\` records. Everything else — judgement calls, style preferences, and every code smell named below — is **report-only**: report it, do not fix it, and do not re-review because of it. A report-only finding is the user's call to make later, not this run's work. Leave this unstated and the safe reading is to fix everything, which makes "re-run only the affected axis" fire on every axis, every time.
18
+
12
19
  **Steps**
13
20
 
14
21
  1. **Gather context**
@@ -39,11 +46,32 @@ export const VERIFY_METHODOLOGY = `Two-axis review of the implementation, run as
39
46
 
40
47
  **Verify output**
41
48
 
42
- Report the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified — tell the user it's ready for \`tospec-archive\`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply) and re-run **only the affected axis against the fixed code** until it's clean you are re-reviewing the changed code, not the previous report, and a passing axis is done, so don't re-run it "to be sure".
49
+ Report the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified — tell the user it's ready for \`tospec-archive\`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply), then send **only the hunk that fixed it** back to the axis that reported it — never the whole axis, and never the other one. You are reviewing the changed code, not the previous report. A clean axis is not re-run for extra confidence.
43
50
 
44
51
  **Verify guardrails**
45
52
  - Standards and Spec axes are independent — never let one axis's findings influence the other's report
46
53
  - Full test suite must be green; a clean review with red tests is not verified
47
54
  - Quote the specific spec/task line or hunk for every finding — no unsupported claims
48
- - **One review pass per axis — never review the review.** No agent audits another agent's findings, no re-reviewing a report you already wrote; a re-run after a fix targets the changed code, and a clean axis is not re-run for extra confidence`;
55
+ - **One review pass per axis — never review the review.** No agent audits another agent's findings, no re-reviewing a report you already wrote; a re-run after a fix sees only the hunk that fixed it, and a clean axis is not re-run for extra confidence`;
56
+ /** Contents of the `VERIFY.md` shipped beside each apply skill's `SKILL.md`. */
57
+ export const VERIFY_DOC = `# Verify — apply's opt-in review
58
+
59
+ Run this **when the user asks for a review**, once every task in the tracks file is checked off and \`tospec validate\` passes. It is not a step apply reaches on its own.
60
+
61
+ ${VERIFY_METHODOLOGY}
62
+ `;
63
+ /** The pointer that replaces the methodology inside the apply skills. */
64
+ export const VERIFY_POINTER = `## Verify (opt-in — only when the user asks)
65
+
66
+ The two-axis review does **not** run on its own. Apply finishes on the full test suite and \`tospec validate\`; a change with those green is implemented, review or no review.
67
+
68
+ When the user asks for a review, **read \`VERIFY.md\` in this skill's directory and run it in full.** Don't offer it unprompted either — no "shall I review this?" at the end of a run. If a review does run, the change stays unfinished — and must not go to \`tospec-archive\` — until it comes back clean.`;
69
+ /** The same block for the command form, which has no sibling file to point at. */
70
+ export const VERIFY_INLINE = `## Verify (opt-in — only when the user asks)
71
+
72
+ The two-axis review does **not** run on its own. Apply finishes on the full test suite and \`tospec validate\`; a change with those green is implemented, review or no review.
73
+
74
+ When the user asks for a review, run the methodology below in full. Don't offer it unprompted either — no "shall I review this?" at the end of a run. If a review does run, the change stays unfinished — and must not go to \`tospec-archive\` — until it comes back clean.
75
+
76
+ ${VERIFY_METHODOLOGY}`;
49
77
  //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../src/core/templates/fragments/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iFAAiF;AACjF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2PA0CyN,CAAC;AAE5P,gFAAgF;AAChF,MAAM,CAAC,MAAM,UAAU,GAAG;;;;EAIxB,kBAAkB;CACnB,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,cAAc,GAAG;;;;+SAIiR,CAAC;AAEhT,kFAAkF;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;EAM3B,kBAAkB,EAAE,CAAC"}
@@ -11,6 +11,6 @@ export { getTospecIssueSkillTemplate, getTospecIssueCommandTemplate } from './wo
11
11
  export { getTospecDecisionSkillTemplate, getTospecDecisionCommandTemplate } from './workflows/decision.js';
12
12
  export { getTospecUpdateSkillTemplate, getTospecUpdateCommandTemplate } from './workflows/update.js';
13
13
  export { getTospecApplySkillTemplate, getTospecApplyCommandTemplate, getTospecApplyWithTDDSkillTemplate, getTospecApplyWithTDDCommandTemplate, } from './workflows/apply.js';
14
- export { getTospecSyncSkillTemplate, getTospecSyncCommandTemplate } from './workflows/sync.js';
14
+ export { getTospecReconcileSkillTemplate, getTospecReconcileCommandTemplate } from './workflows/reconcile.js';
15
15
  export { getTospecArchiveSkillTemplate, getTospecArchiveCommandTemplate } from './workflows/archive.js';
16
16
  //# sourceMappingURL=skill-templates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-templates.d.ts","sourceRoot":"","sources":["../../../src/core/templates/skill-templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,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6B,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
@@ -10,6 +10,6 @@ export { getTospecIssueSkillTemplate, getTospecIssueCommandTemplate } from './wo
10
10
  export { getTospecDecisionSkillTemplate, getTospecDecisionCommandTemplate } from './workflows/decision.js';
11
11
  export { getTospecUpdateSkillTemplate, getTospecUpdateCommandTemplate } from './workflows/update.js';
12
12
  export { getTospecApplySkillTemplate, getTospecApplyCommandTemplate, getTospecApplyWithTDDSkillTemplate, getTospecApplyWithTDDCommandTemplate, } from './workflows/apply.js';
13
- export { getTospecSyncSkillTemplate, getTospecSyncCommandTemplate } from './workflows/sync.js';
13
+ export { getTospecReconcileSkillTemplate, getTospecReconcileCommandTemplate } from './workflows/reconcile.js';
14
14
  export { getTospecArchiveSkillTemplate, getTospecArchiveCommandTemplate } from './workflows/archive.js';
15
15
  //# sourceMappingURL=skill-templates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-templates.js","sourceRoot":"","sources":["../../../src/core/templates/skill-templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACxG,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,8BAA8B,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC3G,OAAO,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"skill-templates.js","sourceRoot":"","sources":["../../../src/core/templates/skill-templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACxG,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,8BAA8B,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAC3G,OAAO,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
@@ -11,6 +11,12 @@ export interface SkillTemplate {
11
11
  allowedTools?: string[];
12
12
  /** When true, emits `disable-model-invocation: true` so the skill only runs when explicitly invoked (e.g. via its slash command), never auto-triggered. */
13
13
  disableModelInvocation?: boolean;
14
+ /**
15
+ * Extra files written beside `SKILL.md` in the skill directory, keyed by
16
+ * filename. Used for progressive disclosure: reference the skill points at
17
+ * but shouldn't carry inline (e.g. apply's `VERIFY.md`).
18
+ */
19
+ extraFiles?: Record<string, string>;
14
20
  }
15
21
  export interface CommandTemplate {
16
22
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/templates/types.ts"],"names":[],"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AAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -4,8 +4,8 @@
4
4
  * This file is generated by splitting the legacy monolithic
5
5
  * templates file into workflow-focused modules.
6
6
  *
7
- * Two apply variants share the same gating (`applyRequires`), auto-verify
8
- * step, and re-validate step; they differ only in how tests relate to the
7
+ * Two apply variants share the same gating (`applyRequires`), opt-in verify
8
+ * section, and re-validate step; they differ only in how tests relate to the
9
9
  * implementation:
10
10
  * - `tospec-apply` — default, tests optional (write one when it earns its keep)
11
11
  * - `tospec-apply-with-tdd` — strict TDD, red → green per slice
@@ -1 +1 @@
1
- {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmHlE,wBAAgB,2BAA2B,IAAI,aAAa,CAc3D;AAED,wBAAgB,6BAA6B,IAAI,eAAe,CAY/D;AA4BD,wBAAgB,kCAAkC,IAAI,aAAa,CAclE;AAED,wBAAgB,oCAAoC,IAAI,eAAe,CAYtE"}
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAsHlE,wBAAgB,2BAA2B,IAAI,aAAa,CAe3D;AAED,wBAAgB,6BAA6B,IAAI,eAAe,CAY/D;AA+BD,wBAAgB,kCAAkC,IAAI,aAAa,CAelE;AAED,wBAAgB,oCAAoC,IAAI,eAAe,CAYtE"}
@@ -1,6 +1,10 @@
1
- import { VERIFY_METHODOLOGY } from './verify.js';
1
+ import { VERIFY_DOC, VERIFY_POINTER, VERIFY_INLINE } from '../fragments/verify.js';
2
+ /**
3
+ * @param verifySection Skills pass `VERIFY_POINTER` (methodology disclosed to a
4
+ * sibling `VERIFY.md`); commands pass `VERIFY_INLINE`, having no sibling file.
5
+ */
2
6
  // ponytail: one parameterized template literal, not a template engine.
3
- function buildApplyBody(v) {
7
+ function buildApplyBody(v, verifySection) {
4
8
  return `**Task tracking is file-based only.** The tracks file's checkboxes (\`- [ ]\` / \`- [x]\`) are the single source of truth for progress. Never use a built-in todo or task-tracking tool — editing the checkbox in the file is the only way progress gets recorded.
5
9
 
6
10
  **Steps**
@@ -19,7 +23,7 @@ function buildApplyBody(v) {
19
23
 
20
24
  Act on \`state\`:
21
25
  - \`blocked\` — required artifacts or the tracks file are missing; show \`instruction\` and STOP, sending the user back to \`tospec-propose\`/\`tospec-issue\`.
22
- - \`all_done\` — everything is checked off already; skip to the verify step below.
26
+ - \`all_done\` — everything is checked off already; say so and stop. A change being complete is not by itself a reason to review it.
23
27
  - \`ready\` — proceed.
24
28
 
25
29
  3. **Read the context files**
@@ -32,7 +36,7 @@ function buildApplyBody(v) {
32
36
 
33
37
  5. **Work the tracks file one item at a time**
34
38
 
35
- The tracks file is \`tasks.md\` (sdd) or \`task.md\` (issue). ${v.step2Intro} Never batch multiple items into one pass.
39
+ The tracks file is \`tasks.md\` (sdd) or \`task.md\` (issue). ${v.checkOffRule} Never batch multiple items into one pass.
36
40
 
37
41
  Before starting an item, re-read the parts of design/specs that cover its scope — don't rely on memory from earlier in the conversation, context may have been compressed since.
38
42
 
@@ -50,15 +54,11 @@ ${v.issueBranch}
50
54
  \`\`\`
51
55
  Implementation sometimes touches tasks.md/specs directly (adding a discovered edge case, correcting an estimate) — confirm the change's artifacts are still structurally valid before handing off. Fix and re-run until it passes.
52
56
 
53
- ## Verify (automatic — apply's final step)
54
-
55
- Once every task is checked off and \`tospec validate\` passes, run the two-axis review **automatically**. This is not a separate command the user has to invoke — verify is folded into apply and runs here as its last step, before the change is handed to \`tospec-archive\`.
56
-
57
- ${VERIFY_METHODOLOGY}
57
+ ${verifySection}
58
58
 
59
59
  **Output**
60
60
 
61
- Report which tasks/checkboxes completed this pass, current progress (\`tospec status --change "<name>"\`), and whether all required artifacts are checked off. When everything is done, the verify review above has already run — if it came back clean, tell the user the change is ready for \`tospec-archive\`; if it surfaced blocking findings, keep working here to resolve them.
61
+ Report which tasks/checkboxes completed this pass, current progress (\`tospec status --change "<name>"\`), and whether all required artifacts are checked off. When everything is done and the test suite is green, tell the user the change is ready for \`tospec-archive\`. If they asked for a review and it surfaced findings it defines as blocking, keep working here to resolve them.
62
62
 
63
63
  **Guardrails**
64
64
  ${v.guardrailsHead}
@@ -68,43 +68,46 @@ ${v.guardrailsHead}
68
68
  - Keep code changes minimal and scoped to the item at hand
69
69
  - Any test you do write goes at the pre-agreed seam (design.md for sdd; the existing/new seam identified for issue) — never against internals
70
70
  - Fix root cause: check every caller of a shared function before declaring a fix complete
71
- - Don't hand off to archive until the automatic verify step is clean and the full test suite is green`;
71
+ - Don't hand off to archive until the full test suite is green and, when a review was requested, until it comes back clean`;
72
72
  }
73
73
  // -----------------------------------------------------------------------------
74
74
  // Default apply — implement per slice; tests are optional, not mandated
75
75
  // -----------------------------------------------------------------------------
76
- const APPLY_BODY = buildApplyBody({
77
- step2Intro: 'Take the next unchecked item, implement it, confirm it works against its specs, check it off (\`- [ ]\` → \`- [x]\`), then move to the next.',
76
+ const APPLY_VARIANT = {
77
+ checkOffRule: 'Take the next unchecked item, implement it, confirm it works against its specs, check it off (\`- [ ]\` → \`- [x]\`), then move to the next.',
78
78
  sddBranch: `### sdd branch — implement per slice
79
79
 
80
80
  For each tracer-bullet slice in \`tasks.md\`:
81
81
  1. Implement the minimum that satisfies the behavior the slice's specs describe. Don't anticipate future slices or add speculative flexibility.
82
82
  2. Verify the result matches the behavior the slice's specs describe, and that the existing test suite still passes.
83
- 3. Check off the slice, then move to the next one — one slice per cycle. Refactoring is not part of this loop; it belongs to the verify step at the end of this workflow.
83
+ 3. Check off the slice, then move to the next one — one slice per cycle. Refactoring is not part of this loop; raise it separately once the slice is green.
84
84
 
85
- Writing a new test is **not required** in this loop — add one when it earns its keep. If you do, put it at the seam \`design.md\` named and don't test internals or add implementation-coupled assertions (mocking internal collaborators, reaching into private state, checking the database instead of the interface). Use \`tospec-apply-with-tdd\` when every slice must start from a failing test.`,
85
+ Writing a new test is **not required** in this loop — add one when it earns its keep. If you do, put it at the seam \`design.md\` named and don't test internals or add implementation-coupled assertions (mocking internal collaborators, reaching into private state, checking the database instead of the interface).`,
86
86
  issueBranch: `### issue branch — fix root cause
87
87
 
88
88
  Read \`task.md\`'s feedback loop, then fix the root cause, not the symptom — if the same defect is reachable through multiple callers of a shared function, the fix belongs in the shared function, not patched into just the caller the ticket named (grep every caller of the function you're touching). Confirm the fix with \`task.md\`'s feedback loop and keep the existing suite green.
89
89
 
90
- A regression test is **not required** here — add one when the bug is likely to recur, extending the existing test if there's one at the right seam. Use \`tospec-apply-with-tdd\` when the fix must start from a red regression test.`,
90
+ A regression test is **not required** here — add one when the bug is likely to recur, extending the existing test if there's one at the right seam.`,
91
91
  guardrailsHead: `- One slice/task at a time — no batching
92
92
  - Tests are optional in this loop — write one when it earns its keep, and never let a missing test block progress; \`tospec-apply-with-tdd\` is the variant that mandates them
93
93
  - Never delete, skip, or weaken an existing test to get to green — fix the code instead`,
94
- });
94
+ };
95
+ const APPLY_BODY = buildApplyBody(APPLY_VARIANT, VERIFY_POINTER);
96
+ const APPLY_BODY_COMMAND = buildApplyBody(APPLY_VARIANT, VERIFY_INLINE);
95
97
  export function getTospecApplySkillTemplate() {
96
98
  return {
97
99
  name: 'tospec-apply',
98
- description: 'Implement tasks from a tospec change. Use when the user wants to start implementing, continue implementation, or work through tasks.',
99
- instructions: `Implement a change's tasks one slice at a time, branching by schema, then automatically run the two-axis verify review ready for \`tospec-archive\` when done.
100
+ description: "Implement a tospec change's tasks slice by slice (tests optional). Use when the user wants to start or continue implementing a change.",
101
+ instructions: `Implement a change's tasks one slice at a time, branching by schema ready for \`tospec-archive\` once the tasks are done and the tests are green. The two-axis review is opt-in: it runs only if the user asks for it.
100
102
 
101
103
  **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
102
104
 
103
105
  ${APPLY_BODY}`,
104
106
  license: 'MIT',
105
107
  compatibility: 'Requires tospec CLI.',
106
- metadata: { author: 'tospec', version: '1.0' },
107
- allowedTools: ['Bash(tospec:*)', 'Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Agent', 'AskUserQuestion'],
108
+ metadata: { author: 'tospec' },
109
+ allowedTools: ['Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Agent', 'AskUserQuestion'],
110
+ extraFiles: { 'VERIFY.md': VERIFY_DOC },
108
111
  };
109
112
  }
110
113
  export function getTospecApplyCommandTemplate() {
@@ -113,25 +116,25 @@ export function getTospecApplyCommandTemplate() {
113
116
  description: 'Implement tasks from a change, one slice at a time',
114
117
  category: 'Workflow',
115
118
  tags: ['workflow', 'implementation'],
116
- content: `Implement a change's tasks one slice at a time, branching by schema, then automatically run the two-axis verify review ready for \`tospec-archive\` when done.
119
+ content: `Implement a change's tasks one slice at a time, branching by schema ready for \`tospec-archive\` once the tasks are done and the tests are green. The two-axis review is opt-in: it runs only if the user asks for it.
117
120
 
118
121
  **Input**: Optionally specify a change name after \`tospec-apply\` (e.g., \`tospec-apply add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
119
122
 
120
- ${APPLY_BODY}`,
123
+ ${APPLY_BODY_COMMAND}`,
121
124
  };
122
125
  }
123
126
  // -----------------------------------------------------------------------------
124
127
  // TDD apply — strict red → green per slice
125
128
  // -----------------------------------------------------------------------------
126
- const APPLY_TDD_BODY = buildApplyBody({
127
- step2Intro: 'Take the next unchecked item, implement it, check it off (\`- [ ]\` → \`- [x]\`) only once its test is green, then move to the next.',
129
+ const APPLY_TDD_VARIANT = {
130
+ checkOffRule: 'Take the next unchecked item, implement it, check it off (\`- [ ]\` → \`- [x]\`) only once its test is green, then move to the next.',
128
131
  sddBranch: `### sdd branch — TDD per slice
129
132
 
130
133
  For each tracer-bullet slice in \`tasks.md\`:
131
134
  1. Write the failing test first (red) — **only at the seam \`design.md\` named**. Don't test internals, don't add implementation-coupled assertions (mocking internal collaborators, reaching into private state, checking the database instead of the interface).
132
135
  2. Implement the minimum to pass (green). Don't anticipate future slices or add speculative flexibility.
133
136
  3. Verify the result matches the behavior the slice's specs describe.
134
- 4. Check off the slice, then move to the next one — one slice per cycle. Refactoring is not part of this loop; it belongs to the verify step at the end of this workflow.`,
137
+ 4. Check off the slice, then move to the next one — one slice per cycle. Refactoring is not part of this loop; raise it separately once the slice is green.`,
135
138
  issueBranch: `### issue branch — three-way test split
136
139
 
137
140
  Read \`task.md\`'s feedback loop. Then:
@@ -142,20 +145,23 @@ Read \`task.md\`'s feedback loop. Then:
142
145
  Fix root cause, not symptom — if the same defect is reachable through multiple callers of a shared function, the fix belongs in the shared function, not patched into just the caller the ticket named.`,
143
146
  guardrailsHead: `- Red before green, always — never write the implementation before its failing test
144
147
  - One slice/task at a time — no batching`,
145
- });
148
+ };
149
+ const APPLY_TDD_BODY = buildApplyBody(APPLY_TDD_VARIANT, VERIFY_POINTER);
150
+ const APPLY_TDD_BODY_COMMAND = buildApplyBody(APPLY_TDD_VARIANT, VERIFY_INLINE);
146
151
  export function getTospecApplyWithTDDSkillTemplate() {
147
152
  return {
148
153
  name: 'tospec-apply-with-tdd',
149
154
  description: 'Implement tasks from a tospec change test-first (red → green). Use when the user wants to start or continue implementation with a strict TDD loop.',
150
- instructions: `Implement a change's tasks test-first (red → green), one slice at a time, branching by schema, then automatically run the two-axis verify review ready for \`tospec-archive\` when done.
155
+ instructions: `Implement a change's tasks test-first (red → green), one slice at a time, branching by schema ready for \`tospec-archive\` once the tasks are done and the tests are green. The two-axis review is opt-in: it runs only if the user asks for it.
151
156
 
152
157
  **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
153
158
 
154
159
  ${APPLY_TDD_BODY}`,
155
160
  license: 'MIT',
156
161
  compatibility: 'Requires tospec CLI.',
157
- metadata: { author: 'tospec', version: '1.0' },
158
- allowedTools: ['Bash(tospec:*)', 'Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Agent', 'AskUserQuestion'],
162
+ metadata: { author: 'tospec' },
163
+ allowedTools: ['Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'Agent', 'AskUserQuestion'],
164
+ extraFiles: { 'VERIFY.md': VERIFY_DOC },
159
165
  };
160
166
  }
161
167
  export function getTospecApplyWithTDDCommandTemplate() {
@@ -164,11 +170,11 @@ export function getTospecApplyWithTDDCommandTemplate() {
164
170
  description: 'Implement tasks from a change test-first (red → green)',
165
171
  category: 'Workflow',
166
172
  tags: ['workflow', 'tdd', 'implementation'],
167
- content: `Implement a change's tasks test-first (red → green), one slice at a time, branching by schema, then automatically run the two-axis verify review ready for \`tospec-archive\` when done.
173
+ content: `Implement a change's tasks test-first (red → green), one slice at a time, branching by schema ready for \`tospec-archive\` once the tasks are done and the tests are green. The two-axis review is opt-in: it runs only if the user asks for it.
168
174
 
169
175
  **Input**: Optionally specify a change name after \`tospec-apply-with-tdd\` (e.g., \`tospec-apply-with-tdd add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
170
176
 
171
- ${APPLY_TDD_BODY}`,
177
+ ${APPLY_TDD_BODY_COMMAND}`,
172
178
  };
173
179
  }
174
180
  //# sourceMappingURL=apply.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/apply.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAiBjD,uEAAuE;AACvE,SAAS,cAAc,CAAC,CAAe;IACrC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEA+B0D,CAAC,CAAC,UAAU;;;;;;;;EAQ7E,CAAC,CAAC,SAAS;;EAEX,CAAC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B,WAAW,EAAE,oJAAoJ;QACjK,YAAY,EAAE;;;;EAIhB,cAAc,EAAE;QACd,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC;QAC3F,UAAU,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE;KACxC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC;IAClD,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,wDAAwD;QACrE,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,gBAAgB,CAAC;QAC3C,OAAO,EAAE;;;;EAIX,sBAAsB,EAAE;KACvB,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmDlE,wBAAgB,6BAA6B,IAAI,aAAa,CAc7D;AAED,wBAAgB,+BAA+B,IAAI,eAAe,CAYjE"}
1
+ {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA6ClE,wBAAgB,6BAA6B,IAAI,aAAa,CAc7D;AAED,wBAAgB,+BAA+B,IAAI,eAAe,CAYjE"}
@@ -1,73 +1,67 @@
1
- const ARCHIVE_BODY = `**Finishing a change: confirm verify, decide about sync, then archive — in that order.** Do not run \`tospec archive\` speculatively "to see what happens"; each step below must actually hold first.
1
+ const ARCHIVE_BODY = `**Finishing a change: decide about reconcile, then archive — in that order.** Do not run \`tospec archive\` speculatively "to see what happens"; each step below must actually hold first.
2
2
 
3
- **Step 0verify already happened in apply**
4
-
5
- verify is not a separate command anymore — it runs automatically at the end of \`tospec-apply\`. Before archiving, confirm apply's verify step came back clean (both Standards and Spec axes clear of blocking findings, full test suite green). If apply's verify surfaced blocking issues, **stop** and go back to \`tospec-apply\` to fix them — do not archive over them.
6
-
7
- **Step 1 — judge whether a sync is needed, and only ask if it is**
3
+ **Step 1judge whether a reconcile is needed, and only ask if it is**
8
4
 
9
5
  Archive merges the change's delta specs into \`tospec/specs/\`, so if those specs have drifted from what the code actually does, archiving would lock in a spec that no longer matches reality. Decide **proactively** whether that risk applies here:
10
6
 
11
- - **Sync is warranted** when the change produced delta specs (a non-empty \`specs/<capability>/spec.md\` under the change dir) — i.e. behavior was added or changed, so spec-vs-code drift is possible.
12
- - **Sync is not needed** when there are no delta specs at all (e.g. a purely cosmetic issue fix with no behavior change). In that case skip straight to Step 2 and archive directly — don't ask a pointless question.
7
+ - **Reconcile is warranted** when the change produced delta specs (a non-empty \`specs/<capability>/spec.md\` under the change dir) — i.e. behavior was added or changed, so spec-vs-code drift is possible.
8
+ - **Reconcile is not needed** when there are no delta specs at all (e.g. a purely cosmetic issue fix with no behavior change). In that case skip straight to Step 2 and archive directly — don't ask a pointless question.
13
9
 
14
- If a sync is warranted, **ask the user one question** (make clear both answers are fine):
10
+ If a reconcile is warranted, **ask the user one question** (make clear both answers are fine):
15
11
 
16
- > "This change has spec deltas. Run \`tospec-sync\` to reconcile the specs against the code before archiving? (recommended, but you can archive without it.)"
12
+ > "This change has spec deltas. Run \`tospec-reconcile\` to check the specs against the code before archiving? (recommended, but you can archive without it.)"
17
13
 
18
- - **User says yes** → run the \`tospec-sync\` workflow now. It reconciles each Requirement against the code (code wins) and writes \`sync-report.md\` with \`Conclusion: PASS\`. If it ends in \`Conclusion: FAIL\` (a real CODE-BUG), **stop** and return to \`tospec-apply\` to fix the code — do not archive. On PASS, archive **with** \`--require-sync\` (Step 2, synced branch).
19
- - **User says no** → that's allowed. Skip the sync and archive **without** \`--require-sync\` (Step 2, not-synced branch). Declining does not block archiving.
14
+ - **User says yes** → run the \`tospec-reconcile\` workflow now. It reconciles each Requirement against the code (code wins) and writes \`reconcile-report.md\` with \`Conclusion: PASS\`. If it ends in \`Conclusion: FAIL\` (a real CODE-BUG), **stop** and return to \`tospec-apply\` to fix the code — do not archive. On PASS, archive **with** \`--require-reconcile\` (Step 2, reconciled branch).
15
+ - **User says no** → that's allowed. Skip the reconcile and archive **without** \`--require-reconcile\` (Step 2, not-reconciled branch). Declining does not block archiving.
20
16
 
21
17
  **Step 2 — archive**
22
18
 
23
- Synced branch (user chose to sync and \`sync-report.md\` says \`Conclusion: PASS\`):
19
+ Reconciled branch (user chose to reconcile and \`reconcile-report.md\` says \`Conclusion: PASS\`):
24
20
  \`\`\`bash
25
- tospec archive "<name>" --json --require-sync
21
+ tospec archive "<name>" --json --require-reconcile
26
22
  \`\`\`
27
- \`--require-sync\` is the CLI's own machine-checkable half of the sync gate: it refuses unless \`sync-report.md\` exists with a \`Conclusion: PASS\` line (\`SYNC_REPORT_MISSING\` / \`SYNC_REPORT_FAILED\`). If \`tospec-sync\` actually ran and passed, this succeeds for free — a CLI-enforced backstop behind the instruction-level order above. Only pass \`--require-sync\` when a sync actually ran; otherwise the CLI will (correctly) refuse.
23
+ \`--require-reconcile\` is the CLI's own machine-checkable half of the reconcile gate: it refuses unless \`reconcile-report.md\` exists with a \`Conclusion: PASS\` line (\`RECONCILE_REPORT_MISSING\` / \`RECONCILE_REPORT_FAILED\`). If \`tospec-reconcile\` actually ran and passed, this succeeds for free — a CLI-enforced backstop behind the instruction-level order above. Only pass \`--require-reconcile\` when a reconcile actually ran; otherwise the CLI will (correctly) refuse.
28
24
 
29
- Not-synced branch (sync wasn't needed, or the user declined):
25
+ Not-reconciled branch (reconcile wasn't needed, or the user declined):
30
26
  \`\`\`bash
31
27
  tospec archive "<name>" --json
32
28
  \`\`\`
33
29
 
34
- Either way, the CLI then: re-validates the delta specs (blocking), checks tasks/task completion (with \`--json\`, incomplete tasks block unless you pass \`--yes\` after the user confirms), does a two-phase atomic merge into \`tospec/specs/\` (dry-run + re-validate every target first, writes only if all pass), and moves the change directory — including \`sync-report.md\` when present — into \`tospec/changes/archive/\` under a \`yyyyMMdd_HHmmss-<name>\` timestamp the CLI generates itself.
30
+ Either way, the CLI then: re-validates the delta specs (blocking), checks tasks/task completion (with \`--json\`, incomplete tasks block unless you pass \`--yes\` after the user confirms), does a two-phase atomic merge into \`tospec/specs/\` (dry-run + re-validate every target first, writes only if all pass), and moves the change directory — including \`reconcile-report.md\` when present — into \`tospec/changes/archive/\` under a \`yyyyMMdd_HHmmss-<name>\` timestamp the CLI generates itself.
35
31
 
36
- **Reading the result**: the \`--json\` output is \`{archive, status}\`. Success → \`archive\` holds \`{change, archivedAs, path, specsUpdated}\`. Failure → \`archive\` is \`null\` and \`status[0].code\` tells you which ending you got: \`archive_validation_failed\` (fix artifacts, re-validate), \`archive_tasks_incomplete\` / \`archive_tasks_missing\` (ask the user, then rerun with \`--yes\` to override), \`SYNC_REPORT_MISSING\` / \`SYNC_REPORT_FAILED\` (the sync gate refused). Each status entry carries \`{code, message, fix}\` — follow \`fix\`.
32
+ **Reading the result**: the \`--json\` output is \`{archive, status}\`. Success → \`archive\` holds \`{change, archivedAs, path, specsUpdated}\`. Failure → \`archive\` is \`null\` and \`status[0].code\` tells you which ending you got: \`archive_validation_failed\` (fix artifacts, re-validate), \`archive_tasks_incomplete\` / \`archive_tasks_missing\` (ask the user, then rerun with \`--yes\` to override), \`RECONCILE_REPORT_MISSING\` / \`RECONCILE_REPORT_FAILED\` (the reconcile gate refused). Each status entry carries \`{code, message, fix}\` — follow \`fix\`.
37
33
 
38
34
  **Guardrails — explicit and non-negotiable**
39
- - Judge whether a sync is warranted before archiving; only ask the user when the change has spec deltas — and honor a "no" (archive still proceeds, just without \`--require-sync\`)
40
- - Only pass \`--require-sync\` when \`tospec-sync\` actually produced a passing \`sync-report.md\` this run
41
- - **Never** construct an archive directory name yourself (the \`yyyyMMdd_HHmmss-<name>\` timestamp is generated by \`tospec archive\`'s internals you have no way to reproduce it correctly, and guessing risks a collision or a wrong sort order)
42
- - **Never** create the archive directory yourself
43
- - **Never** manually move, copy, or rename the change directory
35
+ - Judge whether a reconcile is warranted before archiving; only ask the user when the change has spec deltas — and honor a "no" (archive still proceeds, just without \`--require-reconcile\`)
36
+ - Only pass \`--require-reconcile\` when \`tospec-reconcile\` actually produced a passing \`reconcile-report.md\` this run
37
+ - **\`tospec archive\` owns the archive directory** it generates the \`yyyyMMdd_HHmmss-<name>\` name and moves the change there. Let the command do it: the timestamp comes from internals you cannot reproduce, so a hand-built name risks a collision or a wrong sort order
44
38
  - If \`tospec archive\` reports a validation failure or asks for confirmation on incomplete tasks, resolve the underlying issue (or explicitly confirm with the user) — do not route around it with manual file operations
45
39
 
46
40
  **Output**
47
41
 
48
- Report the archived name and path from \`tospec archive\`'s output, whether a sync ran, and confirm \`tospec/specs/\` now reflects the merged change.`;
42
+ Report the archived name and path from \`tospec archive\`'s output, whether a reconcile ran, and confirm \`tospec/specs/\` now reflects the merged change.`;
49
43
  export function getTospecArchiveSkillTemplate() {
50
44
  return {
51
45
  name: 'tospec-archive',
52
- description: 'Finish and archive a completed change: confirm apply\'s verify was clean, judge whether a spec/code sync is needed (asking the user first when it is), then run the one true tospec archive command. Use when the user wants to finalize an implemented change — never to manually move change directories or invent archive folder names.',
53
- instructions: `Finish a completed change: confirm verify (done in apply), decide about sync (run \`tospec-sync\` if warranted and the user agrees), then \`tospec archive\` — the only path to a merged, archived change.
46
+ description: 'Finish and archive a completed tospec change via `tospec archive`, deciding first whether a spec/code reconcile is needed. Use when the user wants to finalize an implemented change.',
47
+ instructions: `Finish a completed change: decide about reconcile (run \`tospec-reconcile\` if warranted and the user agrees), then \`tospec archive\` — the only path to a merged, archived change.
54
48
 
55
49
  **Input**: The user's request should name the change to archive.
56
50
 
57
51
  ${ARCHIVE_BODY}`,
58
52
  license: 'MIT',
59
53
  compatibility: 'Requires tospec CLI.',
60
- metadata: { author: 'tospec', version: '1.0' },
54
+ metadata: { author: 'tospec' },
61
55
  allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'AskUserQuestion'],
62
56
  };
63
57
  }
64
58
  export function getTospecArchiveCommandTemplate() {
65
59
  return {
66
60
  name: 'TOSPEC: Archive',
67
- description: 'Judge whether a spec/code sync is needed (ask if so), then finalize and archive a completed change',
61
+ description: 'Judge whether a spec/code reconcile is needed (ask if so), then finalize and archive a completed change',
68
62
  category: 'Workflow',
69
63
  tags: ['workflow', 'archive'],
70
- content: `Finish a completed change: confirm verify (done in apply), decide about sync (run \`tospec-sync\` if warranted and the user agrees), then \`tospec archive\` — the only path to a merged, archived change.
64
+ content: `Finish a completed change: decide about reconcile (run \`tospec-reconcile\` if warranted and the user agrees), then \`tospec archive\` — the only path to a merged, archived change.
71
65
 
72
66
  **Input**: The argument after \`tospec-archive\` is the change name to archive.
73
67
 
@@ -1 +1 @@
1
- {"version":3,"file":"archive.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sJA+CiI,CAAC;AAEvJ,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,4UAA4U;QACzV,YAAY,EAAE;;;;EAIhB,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAC9C,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;KAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,oGAAoG;QACjH,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;QAC7B,OAAO,EAAE;;;;EAIX,YAAY,EAAE;KACb,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"archive.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/archive.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2JAyCsI,CAAC;AAE5J,MAAM,UAAU,6BAA6B;IAC3C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,uLAAuL;QACpM,YAAY,EAAE;;;;EAIhB,YAAY,EAAE;QACZ,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC9B,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,CAAC;KAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B;IAC7C,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,yGAAyG;QACtH,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC;QAC7B,OAAO,EAAE;;;;EAIX,YAAY,EAAE;KACb,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/decision.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA8ClE,wBAAgB,8BAA8B,IAAI,aAAa,CAe9D;AAED,wBAAgB,gCAAgC,IAAI,eAAe,CAYlE"}
1
+ {"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/decision.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAiDlE,wBAAgB,8BAA8B,IAAI,aAAa,CAe9D;AAED,wBAAgB,gCAAgC,IAAI,eAAe,CAYlE"}
@@ -1,3 +1,4 @@
1
+ import { nextStepLabelRule } from '../fragments/next-step.js';
1
2
  const DECISION_BODY = `Capture a decision that has already been made or is ready to be adopted — the reasoning, the alternatives weighed, and what it affects. A decision left only in chat is a decision that gets re-litigated next week.
2
3
 
3
4
  **Steps**
@@ -14,15 +15,18 @@ const DECISION_BODY = `Capture a decision that has already been made or is ready
14
15
  \`\`\`
15
16
  Derive a kebab-case \`<topic>\` from the subject. The CLI produces both files: it writes \`tospec/decisions/<yyyyMMdd_HHmmss>-<topic>.md\` from its template (Status/Date/title pre-filled) and appends a row to \`tospec/decisions/index.md\` (seeding that ledger on first use). **The CLI owns the dated filename and the index — never create/rename decision files or hand-edit \`index.md\` yourself.** Use \`--status accepted\` if already agreed, or \`--status superseded\` (and name the successor) when replacing an older decision; pass \`--date\` only to backfill a past decision.
16
17
 
17
- 4. **Fill the six sections**
18
- Open the created file and complete every section:
18
+ 4. **Fill the sections**
19
+ Open the created file. Six sections are required — they are the structure the schema validates against:
19
20
  - **Status** — proposed / accepted / superseded (+ Date); if superseded, name the decision that replaces it.
20
21
  - **Context** — the situation and forces that made this decision necessary.
21
22
  - **Decision** — what was chosen, the canonical terms, and why this over the alternatives.
22
23
  - **Impact** — the modules / APIs / docs / tests this touches.
23
24
  - **Alternatives** — each option considered, its trade-offs, and the conclusion.
24
25
  - **Follow-up** — the follow-up implementation items, phased if useful.
25
- - **Decision Process** (optional) — the key questions you asked and the user's answers that shaped this decision. Format each pair as a \`**Q:** question\` line followed by the answer in the next paragraph, one pair per block. Summarize each Q&A; don't paste a full transcript. Omit the section if there was no interactive discussion.
26
+
27
+ The template carries two more that are optional:
28
+ - **Decision Process** — the key questions you asked and the user's answers that shaped this decision. Format each pair as a \`**Q:** question\` line followed by the answer in the next paragraph, one pair per block. Summarize each Q&A; don't paste a full transcript. Omit the section entirely if there was no interactive discussion.
29
+ - **Related Changes** — leave it empty. It fills in later, as changes link back via \`tospec new change --decisions\`.
26
30
 
27
31
  5. **Verify**
28
32
  \`\`\`bash
@@ -34,17 +38,16 @@ const DECISION_BODY = `Capture a decision that has already been made or is ready
34
38
 
35
39
  Summarize the decision, its status, and the follow-up work. If it supersedes an older decision, state which one and flip that older file's Status to \`superseded\`. Report the created filename explicitly — when a change later implements this decision, that filename is what \`tospec new change --decisions\` records to link the change back here (the file's optional \`## Related Changes\` section can list those changes in return).
36
40
 
37
- Then point at the next step. When you put these options to the user, write each label from the decision you just recorded — a short, conversational phrase naming the concrete next action — then append the fixed action keyword in parentheses (\`(update)\`, \`(propose)\`/\`(issue)\`); the words before it must describe *this* action in *this* context, never a canned phrase, and never the raw \`tospec-*\` skill name. If the decision came out of grilling or exploring an **existing** change, offer **(update)** via \`tospec-update\` to fold it into that change's artifacts; if no change exists yet, offer **(propose)** / **(issue)** via \`tospec-propose\`/\`tospec-issue\` and carry the filename into \`--decisions\`.
41
+ Then point at the next step. ${nextStepLabelRule('the decision you just recorded', '\`(update)\`, \`(propose)\`/\`(issue)\`')} If the decision came out of grilling or exploring an **existing** change, offer **(update)** via \`tospec-update\` to fold it into that change's artifacts; if no change exists yet, offer **(propose)** / **(issue)** via \`tospec-propose\`/\`tospec-issue\` and carry the filename into \`--decisions\`.
38
42
 
39
43
  **Guardrails**
40
44
  - The decision file, its date-prefixed filename, and the ledger row are all CLI-generated — pass \`--summary\`, and never create/rename decision files or hand-edit \`index.md\` yourself; only edit the decision file's section contents
41
45
  - Don't record a decision whose rationale or alternatives you can't state — clarify with the user first
42
- - \`superseded\` must name its successor; the superseded record's Status must be updated too
43
- - Keep the six required sections — they are the structure the schema validates against; Decision Process is an optional seventh for the Q&A trail (each pair starts with a \`**Q:**\` line, answer in the next paragraph)`;
46
+ - \`superseded\` must name its successor; the superseded record's Status must be updated too`;
44
47
  export function getTospecDecisionSkillTemplate() {
45
48
  return {
46
49
  name: 'tospec-decision',
47
- description: 'Record an architecture decision as a permanent ADR (dated decision file + derived index). Use when a design/architecture choice has been made or is ready to adopt and should be documented with its rationale, alternatives, and impact instead of left in chat.',
50
+ description: 'Record an architecture decision as a permanent ADR. Use when a design/architecture choice has been made or is ready to adopt and should be documented with its rationale, alternatives, and impact instead of left in chat.',
48
51
  instructions: `Turn a made (or ready-to-adopt) decision into a permanent ADR record via the \`tospec decision\` command.
49
52
 
50
53
  **Input**: The user's request should describe the decision and, ideally, the reasoning and the alternatives that were considered.
@@ -52,7 +55,7 @@ export function getTospecDecisionSkillTemplate() {
52
55
  ${DECISION_BODY}`,
53
56
  license: 'MIT',
54
57
  compatibility: 'Requires tospec CLI.',
55
- metadata: { author: 'tospec', version: '1.0' },
58
+ metadata: { author: 'tospec' },
56
59
  allowedTools: ['Bash(tospec:*)', 'Read', 'Write', 'Edit', 'Grep', 'Glob', 'AskUserQuestion'],
57
60
  };
58
61
  }