intent-planner 0.13.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 (334) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +225 -0
  3. package/README.md +225 -0
  4. package/bin/cli.mjs +289 -0
  5. package/package.json +46 -0
  6. package/src/install.mjs +527 -0
  7. package/templates/en/agents/claude/CLAUDE.md +62 -0
  8. package/templates/en/agents/codex/AGENTS.md +62 -0
  9. package/templates/en/agents/gemini/GEMINI.md +62 -0
  10. package/templates/en/claude/skills/CONTRACT.md +86 -0
  11. package/templates/en/claude/skills/intent-compass/SKILL.md +55 -0
  12. package/templates/en/claude/skills/intent-compass/rules/algo-qoc.md +62 -0
  13. package/templates/en/claude/skills/intent-compass/rules/constraint-surfacing.md +41 -0
  14. package/templates/en/claude/skills/intent-discover/SKILL.md +63 -0
  15. package/templates/en/claude/skills/intent-discover/rules/algo-drift-analysis.md +34 -0
  16. package/templates/en/claude/skills/intent-discover/rules/algo-gore-lite.md +35 -0
  17. package/templates/en/claude/skills/intent-discover/rules/algo-impact-analysis.md +37 -0
  18. package/templates/en/claude/skills/intent-discover/rules/algo-intent-recovery.md +39 -0
  19. package/templates/en/claude/skills/intent-discover/rules/designer-questions.md +78 -0
  20. package/templates/en/claude/skills/intent-discover/rules/drift-terrain.md +105 -0
  21. package/templates/en/claude/skills/intent-discover/rules/mode-selection.md +31 -0
  22. package/templates/en/claude/skills/intent-export-cc-sdd/SKILL.md +88 -0
  23. package/templates/en/claude/skills/intent-export-cc-sdd/rules/drift-export-check.md +75 -0
  24. package/templates/en/claude/skills/intent-export-cc-sdd/rules/export-questions.md +23 -0
  25. package/templates/en/claude/skills/intent-export-cc-sdd/rules/map-cc-sdd.md +62 -0
  26. package/templates/en/claude/skills/intent-export-openspec/SKILL.md +90 -0
  27. package/templates/en/claude/skills/intent-export-openspec/rules/drift-export-check.md +50 -0
  28. package/templates/en/claude/skills/intent-export-openspec/rules/export-questions.md +23 -0
  29. package/templates/en/claude/skills/intent-export-openspec/rules/map-openspec.md +75 -0
  30. package/templates/en/claude/skills/intent-from-spec/SKILL.md +60 -0
  31. package/templates/en/claude/skills/intent-from-spec/rules/extract-intent.md +56 -0
  32. package/templates/en/claude/skills/intent-from-spec/rules/gap-readout.md +54 -0
  33. package/templates/en/claude/skills/intent-from-spec/rules/load-bearing.md +48 -0
  34. package/templates/en/claude/skills/intent-from-spec/rules/omission-recap.md +42 -0
  35. package/templates/en/claude/skills/intent-improve/SKILL.md +70 -0
  36. package/templates/en/claude/skills/intent-improve/rules/improve-axes.md +121 -0
  37. package/templates/en/claude/skills/intent-overview/SKILL.md +63 -0
  38. package/templates/en/claude/skills/intent-overview/rules/aggregate-sources.md +61 -0
  39. package/templates/en/claude/skills/intent-overview/rules/gap-readout.md +54 -0
  40. package/templates/en/claude/skills/intent-overview/rules/mermaid-tree.md +78 -0
  41. package/templates/en/claude/skills/intent-overview/rules/progress-readout.md +119 -0
  42. package/templates/en/claude/skills/intent-packets/SKILL.md +97 -0
  43. package/templates/en/claude/skills/intent-packets/rules/algo-additive-slicing.md +55 -0
  44. package/templates/en/claude/skills/intent-packets/rules/algo-characterization-test.md +40 -0
  45. package/templates/en/claude/skills/intent-packets/rules/algo-example-mapping.md +47 -0
  46. package/templates/en/claude/skills/intent-packets/rules/algo-migration-slicing.md +47 -0
  47. package/templates/en/claude/skills/intent-packets/rules/decision-slots.md +88 -0
  48. package/templates/en/claude/skills/intent-packets/rules/export-route.md +54 -0
  49. package/templates/en/claude/skills/intent-packets/rules/first-packet.md +35 -0
  50. package/templates/en/claude/skills/intent-packets/rules/packet-format.md +207 -0
  51. package/templates/en/claude/skills/intent-packets/rules/walking-skeleton.md +35 -0
  52. package/templates/en/claude/skills/intent-release-note/SKILL.md +58 -0
  53. package/templates/en/claude/skills/intent-release-note/rules/format-changelog.md +40 -0
  54. package/templates/en/claude/skills/intent-release-note/rules/format-github-releases.md +41 -0
  55. package/templates/en/claude/skills/intent-release-note/rules/format-select.md +32 -0
  56. package/templates/en/claude/skills/intent-release-note/rules/source-scope.md +42 -0
  57. package/templates/en/claude/skills/intent-status/SKILL.md +171 -0
  58. package/templates/en/claude/skills/intent-status/rules/decision-table.md +47 -0
  59. package/templates/en/claude/skills/intent-to-spec/SKILL.md +68 -0
  60. package/templates/en/claude/skills/intent-to-spec/rules/fabrication-guard.md +41 -0
  61. package/templates/en/claude/skills/intent-to-spec/rules/format-integrated.md +42 -0
  62. package/templates/en/claude/skills/intent-to-spec/rules/format-nonprogram.md +45 -0
  63. package/templates/en/claude/skills/intent-to-spec/rules/format-upstream.md +41 -0
  64. package/templates/en/claude/skills/intent-to-spec/rules/source-scope.md +50 -0
  65. package/templates/en/claude/skills/intent-validate/SKILL.md +80 -0
  66. package/templates/en/claude/skills/intent-validate/rules/validate-checks.md +121 -0
  67. package/templates/en/claude/skills/intent-writeback/SKILL.md +71 -0
  68. package/templates/en/claude/skills/intent-writeback/rules/writeback-protocol.md +139 -0
  69. package/templates/en/codex/skills/CONTRACT.md +77 -0
  70. package/templates/en/codex/skills/intent-compass/SKILL.md +52 -0
  71. package/templates/en/codex/skills/intent-compass/rules/algo-qoc.md +62 -0
  72. package/templates/en/codex/skills/intent-compass/rules/constraint-surfacing.md +41 -0
  73. package/templates/en/codex/skills/intent-discover/SKILL.md +60 -0
  74. package/templates/en/codex/skills/intent-discover/rules/algo-drift-analysis.md +34 -0
  75. package/templates/en/codex/skills/intent-discover/rules/algo-gore-lite.md +35 -0
  76. package/templates/en/codex/skills/intent-discover/rules/algo-impact-analysis.md +37 -0
  77. package/templates/en/codex/skills/intent-discover/rules/algo-intent-recovery.md +39 -0
  78. package/templates/en/codex/skills/intent-discover/rules/designer-questions.md +78 -0
  79. package/templates/en/codex/skills/intent-discover/rules/drift-terrain.md +105 -0
  80. package/templates/en/codex/skills/intent-discover/rules/mode-selection.md +31 -0
  81. package/templates/en/codex/skills/intent-export-cc-sdd/SKILL.md +85 -0
  82. package/templates/en/codex/skills/intent-export-cc-sdd/rules/drift-export-check.md +75 -0
  83. package/templates/en/codex/skills/intent-export-cc-sdd/rules/export-questions.md +23 -0
  84. package/templates/en/codex/skills/intent-export-cc-sdd/rules/map-cc-sdd.md +62 -0
  85. package/templates/en/codex/skills/intent-export-openspec/SKILL.md +87 -0
  86. package/templates/en/codex/skills/intent-export-openspec/rules/drift-export-check.md +50 -0
  87. package/templates/en/codex/skills/intent-export-openspec/rules/export-questions.md +23 -0
  88. package/templates/en/codex/skills/intent-export-openspec/rules/map-openspec.md +75 -0
  89. package/templates/en/codex/skills/intent-from-spec/SKILL.md +58 -0
  90. package/templates/en/codex/skills/intent-from-spec/rules/extract-intent.md +56 -0
  91. package/templates/en/codex/skills/intent-from-spec/rules/gap-readout.md +54 -0
  92. package/templates/en/codex/skills/intent-from-spec/rules/load-bearing.md +48 -0
  93. package/templates/en/codex/skills/intent-from-spec/rules/omission-recap.md +42 -0
  94. package/templates/en/codex/skills/intent-improve/SKILL.md +67 -0
  95. package/templates/en/codex/skills/intent-improve/rules/improve-axes.md +121 -0
  96. package/templates/en/codex/skills/intent-overview/SKILL.md +61 -0
  97. package/templates/en/codex/skills/intent-overview/rules/aggregate-sources.md +61 -0
  98. package/templates/en/codex/skills/intent-overview/rules/gap-readout.md +54 -0
  99. package/templates/en/codex/skills/intent-overview/rules/mermaid-tree.md +78 -0
  100. package/templates/en/codex/skills/intent-overview/rules/progress-readout.md +119 -0
  101. package/templates/en/codex/skills/intent-packets/SKILL.md +94 -0
  102. package/templates/en/codex/skills/intent-packets/rules/algo-additive-slicing.md +55 -0
  103. package/templates/en/codex/skills/intent-packets/rules/algo-characterization-test.md +40 -0
  104. package/templates/en/codex/skills/intent-packets/rules/algo-example-mapping.md +47 -0
  105. package/templates/en/codex/skills/intent-packets/rules/algo-migration-slicing.md +47 -0
  106. package/templates/en/codex/skills/intent-packets/rules/decision-slots.md +88 -0
  107. package/templates/en/codex/skills/intent-packets/rules/export-route.md +54 -0
  108. package/templates/en/codex/skills/intent-packets/rules/first-packet.md +35 -0
  109. package/templates/en/codex/skills/intent-packets/rules/packet-format.md +207 -0
  110. package/templates/en/codex/skills/intent-packets/rules/walking-skeleton.md +35 -0
  111. package/templates/en/codex/skills/intent-release-note/SKILL.md +56 -0
  112. package/templates/en/codex/skills/intent-release-note/rules/format-changelog.md +40 -0
  113. package/templates/en/codex/skills/intent-release-note/rules/format-github-releases.md +41 -0
  114. package/templates/en/codex/skills/intent-release-note/rules/format-select.md +32 -0
  115. package/templates/en/codex/skills/intent-release-note/rules/source-scope.md +42 -0
  116. package/templates/en/codex/skills/intent-status/SKILL.md +169 -0
  117. package/templates/en/codex/skills/intent-status/rules/decision-table.md +47 -0
  118. package/templates/en/codex/skills/intent-to-spec/SKILL.md +66 -0
  119. package/templates/en/codex/skills/intent-to-spec/rules/fabrication-guard.md +41 -0
  120. package/templates/en/codex/skills/intent-to-spec/rules/format-integrated.md +42 -0
  121. package/templates/en/codex/skills/intent-to-spec/rules/format-nonprogram.md +45 -0
  122. package/templates/en/codex/skills/intent-to-spec/rules/format-upstream.md +41 -0
  123. package/templates/en/codex/skills/intent-to-spec/rules/source-scope.md +50 -0
  124. package/templates/en/codex/skills/intent-validate/SKILL.md +78 -0
  125. package/templates/en/codex/skills/intent-validate/rules/validate-checks.md +121 -0
  126. package/templates/en/codex/skills/intent-writeback/SKILL.md +68 -0
  127. package/templates/en/codex/skills/intent-writeback/rules/writeback-protocol.md +139 -0
  128. package/templates/en/intent/README.md +118 -0
  129. package/templates/en/intent/cc-sdd/README.md +28 -0
  130. package/templates/en/intent/compass-archive/README.md +9 -0
  131. package/templates/en/intent/compass-archive/archive/.gitkeep +0 -0
  132. package/templates/en/intent/compass-archive.md +7 -0
  133. package/templates/en/intent/constraint-library.md +32 -0
  134. package/templates/en/intent/constraint-starters.md +58 -0
  135. package/templates/en/intent/context-cost-cues.md +55 -0
  136. package/templates/en/intent/deltas/README.md +11 -0
  137. package/templates/en/intent/deltas/archive/.gitkeep +0 -0
  138. package/templates/en/intent/deltas.md +34 -0
  139. package/templates/en/intent/drift-log/README.md +11 -0
  140. package/templates/en/intent/drift-log/archive/.gitkeep +0 -0
  141. package/templates/en/intent/drift-log.md +41 -0
  142. package/templates/en/intent/drift-patterns.md +68 -0
  143. package/templates/en/intent/export-log/README.md +12 -0
  144. package/templates/en/intent/export-log/archive/.gitkeep +0 -0
  145. package/templates/en/intent/export-log.md +6 -0
  146. package/templates/en/intent/glossary.md +23 -0
  147. package/templates/en/intent/intent-compass.md +55 -0
  148. package/templates/en/intent/intent-tree.md +59 -0
  149. package/templates/en/intent/milestones/README.md +10 -0
  150. package/templates/en/intent/milestones/archive/.gitkeep +0 -0
  151. package/templates/en/intent/milestones.md +22 -0
  152. package/templates/en/intent/mode.local.md +23 -0
  153. package/templates/en/intent/mode.md +32 -0
  154. package/templates/en/intent/modes/README.md +28 -0
  155. package/templates/en/intent/modes/behavior-unknown.md +57 -0
  156. package/templates/en/intent/modes/feature-growth.md +57 -0
  157. package/templates/en/intent/modes/non-code.md +46 -0
  158. package/templates/en/intent/modes/refactor.md +56 -0
  159. package/templates/en/intent/modes/standard.md +50 -0
  160. package/templates/en/intent/nl-spec/README.md +18 -0
  161. package/templates/en/intent/openspec/proposal.md +15 -0
  162. package/templates/en/intent/openspec/spec-delta.md +25 -0
  163. package/templates/en/intent/overview/README.md +18 -0
  164. package/templates/en/intent/packets/README.md +29 -0
  165. package/templates/en/intent/packets/index.md +6 -0
  166. package/templates/en/intent/packets/plan.md +23 -0
  167. package/templates/en/intent/release-note/README.md +18 -0
  168. package/templates/en/intent/scripts/intent-check.mjs +786 -0
  169. package/templates/en/intent/scripts/pre-push +27 -0
  170. package/templates/en/intent/spec-ingest/README.md +18 -0
  171. package/templates/ja/agents/claude/CLAUDE.md +62 -0
  172. package/templates/ja/agents/codex/AGENTS.md +62 -0
  173. package/templates/ja/agents/gemini/GEMINI.md +62 -0
  174. package/templates/ja/claude/skills/CONTRACT.md +90 -0
  175. package/templates/ja/claude/skills/intent-compass/SKILL.md +55 -0
  176. package/templates/ja/claude/skills/intent-compass/rules/algo-qoc.md +62 -0
  177. package/templates/ja/claude/skills/intent-compass/rules/constraint-surfacing.md +41 -0
  178. package/templates/ja/claude/skills/intent-discover/SKILL.md +63 -0
  179. package/templates/ja/claude/skills/intent-discover/rules/algo-drift-analysis.md +34 -0
  180. package/templates/ja/claude/skills/intent-discover/rules/algo-gore-lite.md +35 -0
  181. package/templates/ja/claude/skills/intent-discover/rules/algo-impact-analysis.md +37 -0
  182. package/templates/ja/claude/skills/intent-discover/rules/algo-intent-recovery.md +39 -0
  183. package/templates/ja/claude/skills/intent-discover/rules/designer-questions.md +78 -0
  184. package/templates/ja/claude/skills/intent-discover/rules/drift-terrain.md +105 -0
  185. package/templates/ja/claude/skills/intent-discover/rules/mode-selection.md +31 -0
  186. package/templates/ja/claude/skills/intent-export-cc-sdd/SKILL.md +88 -0
  187. package/templates/ja/claude/skills/intent-export-cc-sdd/rules/drift-export-check.md +75 -0
  188. package/templates/ja/claude/skills/intent-export-cc-sdd/rules/export-questions.md +23 -0
  189. package/templates/ja/claude/skills/intent-export-cc-sdd/rules/map-cc-sdd.md +62 -0
  190. package/templates/ja/claude/skills/intent-export-openspec/SKILL.md +90 -0
  191. package/templates/ja/claude/skills/intent-export-openspec/rules/drift-export-check.md +50 -0
  192. package/templates/ja/claude/skills/intent-export-openspec/rules/export-questions.md +23 -0
  193. package/templates/ja/claude/skills/intent-export-openspec/rules/map-openspec.md +75 -0
  194. package/templates/ja/claude/skills/intent-from-spec/SKILL.md +60 -0
  195. package/templates/ja/claude/skills/intent-from-spec/rules/extract-intent.md +56 -0
  196. package/templates/ja/claude/skills/intent-from-spec/rules/gap-readout.md +54 -0
  197. package/templates/ja/claude/skills/intent-from-spec/rules/load-bearing.md +48 -0
  198. package/templates/ja/claude/skills/intent-from-spec/rules/omission-recap.md +42 -0
  199. package/templates/ja/claude/skills/intent-improve/SKILL.md +70 -0
  200. package/templates/ja/claude/skills/intent-improve/rules/improve-axes.md +121 -0
  201. package/templates/ja/claude/skills/intent-overview/SKILL.md +63 -0
  202. package/templates/ja/claude/skills/intent-overview/rules/aggregate-sources.md +61 -0
  203. package/templates/ja/claude/skills/intent-overview/rules/gap-readout.md +54 -0
  204. package/templates/ja/claude/skills/intent-overview/rules/mermaid-tree.md +78 -0
  205. package/templates/ja/claude/skills/intent-overview/rules/progress-readout.md +119 -0
  206. package/templates/ja/claude/skills/intent-packets/SKILL.md +97 -0
  207. package/templates/ja/claude/skills/intent-packets/rules/algo-additive-slicing.md +55 -0
  208. package/templates/ja/claude/skills/intent-packets/rules/algo-characterization-test.md +40 -0
  209. package/templates/ja/claude/skills/intent-packets/rules/algo-example-mapping.md +47 -0
  210. package/templates/ja/claude/skills/intent-packets/rules/algo-migration-slicing.md +47 -0
  211. package/templates/ja/claude/skills/intent-packets/rules/decision-slots.md +88 -0
  212. package/templates/ja/claude/skills/intent-packets/rules/export-route.md +54 -0
  213. package/templates/ja/claude/skills/intent-packets/rules/first-packet.md +35 -0
  214. package/templates/ja/claude/skills/intent-packets/rules/packet-format.md +207 -0
  215. package/templates/ja/claude/skills/intent-packets/rules/walking-skeleton.md +35 -0
  216. package/templates/ja/claude/skills/intent-release-note/SKILL.md +58 -0
  217. package/templates/ja/claude/skills/intent-release-note/rules/format-changelog.md +40 -0
  218. package/templates/ja/claude/skills/intent-release-note/rules/format-github-releases.md +41 -0
  219. package/templates/ja/claude/skills/intent-release-note/rules/format-select.md +32 -0
  220. package/templates/ja/claude/skills/intent-release-note/rules/source-scope.md +42 -0
  221. package/templates/ja/claude/skills/intent-status/SKILL.md +171 -0
  222. package/templates/ja/claude/skills/intent-status/rules/decision-table.md +47 -0
  223. package/templates/ja/claude/skills/intent-to-spec/SKILL.md +68 -0
  224. package/templates/ja/claude/skills/intent-to-spec/rules/fabrication-guard.md +41 -0
  225. package/templates/ja/claude/skills/intent-to-spec/rules/format-integrated.md +42 -0
  226. package/templates/ja/claude/skills/intent-to-spec/rules/format-nonprogram.md +45 -0
  227. package/templates/ja/claude/skills/intent-to-spec/rules/format-upstream.md +41 -0
  228. package/templates/ja/claude/skills/intent-to-spec/rules/source-scope.md +50 -0
  229. package/templates/ja/claude/skills/intent-validate/SKILL.md +80 -0
  230. package/templates/ja/claude/skills/intent-validate/rules/validate-checks.md +121 -0
  231. package/templates/ja/claude/skills/intent-writeback/SKILL.md +71 -0
  232. package/templates/ja/claude/skills/intent-writeback/rules/writeback-protocol.md +139 -0
  233. package/templates/ja/codex/skills/CONTRACT.md +81 -0
  234. package/templates/ja/codex/skills/intent-compass/SKILL.md +52 -0
  235. package/templates/ja/codex/skills/intent-compass/rules/algo-qoc.md +62 -0
  236. package/templates/ja/codex/skills/intent-compass/rules/constraint-surfacing.md +41 -0
  237. package/templates/ja/codex/skills/intent-discover/SKILL.md +60 -0
  238. package/templates/ja/codex/skills/intent-discover/rules/algo-drift-analysis.md +34 -0
  239. package/templates/ja/codex/skills/intent-discover/rules/algo-gore-lite.md +35 -0
  240. package/templates/ja/codex/skills/intent-discover/rules/algo-impact-analysis.md +37 -0
  241. package/templates/ja/codex/skills/intent-discover/rules/algo-intent-recovery.md +39 -0
  242. package/templates/ja/codex/skills/intent-discover/rules/designer-questions.md +78 -0
  243. package/templates/ja/codex/skills/intent-discover/rules/drift-terrain.md +105 -0
  244. package/templates/ja/codex/skills/intent-discover/rules/mode-selection.md +31 -0
  245. package/templates/ja/codex/skills/intent-export-cc-sdd/SKILL.md +85 -0
  246. package/templates/ja/codex/skills/intent-export-cc-sdd/rules/drift-export-check.md +75 -0
  247. package/templates/ja/codex/skills/intent-export-cc-sdd/rules/export-questions.md +23 -0
  248. package/templates/ja/codex/skills/intent-export-cc-sdd/rules/map-cc-sdd.md +62 -0
  249. package/templates/ja/codex/skills/intent-export-openspec/SKILL.md +87 -0
  250. package/templates/ja/codex/skills/intent-export-openspec/rules/drift-export-check.md +50 -0
  251. package/templates/ja/codex/skills/intent-export-openspec/rules/export-questions.md +23 -0
  252. package/templates/ja/codex/skills/intent-export-openspec/rules/map-openspec.md +75 -0
  253. package/templates/ja/codex/skills/intent-from-spec/SKILL.md +58 -0
  254. package/templates/ja/codex/skills/intent-from-spec/rules/extract-intent.md +56 -0
  255. package/templates/ja/codex/skills/intent-from-spec/rules/gap-readout.md +54 -0
  256. package/templates/ja/codex/skills/intent-from-spec/rules/load-bearing.md +48 -0
  257. package/templates/ja/codex/skills/intent-from-spec/rules/omission-recap.md +42 -0
  258. package/templates/ja/codex/skills/intent-improve/SKILL.md +67 -0
  259. package/templates/ja/codex/skills/intent-improve/rules/improve-axes.md +121 -0
  260. package/templates/ja/codex/skills/intent-overview/SKILL.md +61 -0
  261. package/templates/ja/codex/skills/intent-overview/rules/aggregate-sources.md +61 -0
  262. package/templates/ja/codex/skills/intent-overview/rules/gap-readout.md +54 -0
  263. package/templates/ja/codex/skills/intent-overview/rules/mermaid-tree.md +78 -0
  264. package/templates/ja/codex/skills/intent-overview/rules/progress-readout.md +119 -0
  265. package/templates/ja/codex/skills/intent-packets/SKILL.md +94 -0
  266. package/templates/ja/codex/skills/intent-packets/rules/algo-additive-slicing.md +55 -0
  267. package/templates/ja/codex/skills/intent-packets/rules/algo-characterization-test.md +40 -0
  268. package/templates/ja/codex/skills/intent-packets/rules/algo-example-mapping.md +47 -0
  269. package/templates/ja/codex/skills/intent-packets/rules/algo-migration-slicing.md +47 -0
  270. package/templates/ja/codex/skills/intent-packets/rules/decision-slots.md +88 -0
  271. package/templates/ja/codex/skills/intent-packets/rules/export-route.md +54 -0
  272. package/templates/ja/codex/skills/intent-packets/rules/first-packet.md +35 -0
  273. package/templates/ja/codex/skills/intent-packets/rules/packet-format.md +207 -0
  274. package/templates/ja/codex/skills/intent-packets/rules/walking-skeleton.md +35 -0
  275. package/templates/ja/codex/skills/intent-release-note/SKILL.md +56 -0
  276. package/templates/ja/codex/skills/intent-release-note/rules/format-changelog.md +40 -0
  277. package/templates/ja/codex/skills/intent-release-note/rules/format-github-releases.md +41 -0
  278. package/templates/ja/codex/skills/intent-release-note/rules/format-select.md +32 -0
  279. package/templates/ja/codex/skills/intent-release-note/rules/source-scope.md +42 -0
  280. package/templates/ja/codex/skills/intent-status/SKILL.md +169 -0
  281. package/templates/ja/codex/skills/intent-status/rules/decision-table.md +47 -0
  282. package/templates/ja/codex/skills/intent-to-spec/SKILL.md +66 -0
  283. package/templates/ja/codex/skills/intent-to-spec/rules/fabrication-guard.md +41 -0
  284. package/templates/ja/codex/skills/intent-to-spec/rules/format-integrated.md +42 -0
  285. package/templates/ja/codex/skills/intent-to-spec/rules/format-nonprogram.md +45 -0
  286. package/templates/ja/codex/skills/intent-to-spec/rules/format-upstream.md +41 -0
  287. package/templates/ja/codex/skills/intent-to-spec/rules/source-scope.md +50 -0
  288. package/templates/ja/codex/skills/intent-validate/SKILL.md +78 -0
  289. package/templates/ja/codex/skills/intent-validate/rules/validate-checks.md +121 -0
  290. package/templates/ja/codex/skills/intent-writeback/SKILL.md +68 -0
  291. package/templates/ja/codex/skills/intent-writeback/rules/writeback-protocol.md +139 -0
  292. package/templates/ja/intent/README.md +118 -0
  293. package/templates/ja/intent/cc-sdd/README.md +28 -0
  294. package/templates/ja/intent/compass-archive/README.md +9 -0
  295. package/templates/ja/intent/compass-archive/archive/.gitkeep +0 -0
  296. package/templates/ja/intent/compass-archive.md +7 -0
  297. package/templates/ja/intent/constraint-library.md +32 -0
  298. package/templates/ja/intent/constraint-starters.md +58 -0
  299. package/templates/ja/intent/context-cost-cues.md +55 -0
  300. package/templates/ja/intent/deltas/README.md +11 -0
  301. package/templates/ja/intent/deltas/archive/.gitkeep +0 -0
  302. package/templates/ja/intent/deltas.md +34 -0
  303. package/templates/ja/intent/drift-log/README.md +11 -0
  304. package/templates/ja/intent/drift-log/archive/.gitkeep +0 -0
  305. package/templates/ja/intent/drift-log.md +41 -0
  306. package/templates/ja/intent/drift-patterns.md +68 -0
  307. package/templates/ja/intent/export-log/README.md +12 -0
  308. package/templates/ja/intent/export-log/archive/.gitkeep +0 -0
  309. package/templates/ja/intent/export-log.md +6 -0
  310. package/templates/ja/intent/glossary.md +23 -0
  311. package/templates/ja/intent/intent-compass.md +55 -0
  312. package/templates/ja/intent/intent-tree.md +59 -0
  313. package/templates/ja/intent/milestones/README.md +10 -0
  314. package/templates/ja/intent/milestones/archive/.gitkeep +0 -0
  315. package/templates/ja/intent/milestones.md +22 -0
  316. package/templates/ja/intent/mode.local.md +23 -0
  317. package/templates/ja/intent/mode.md +32 -0
  318. package/templates/ja/intent/modes/README.md +28 -0
  319. package/templates/ja/intent/modes/behavior-unknown.md +57 -0
  320. package/templates/ja/intent/modes/feature-growth.md +57 -0
  321. package/templates/ja/intent/modes/non-code.md +46 -0
  322. package/templates/ja/intent/modes/refactor.md +56 -0
  323. package/templates/ja/intent/modes/standard.md +50 -0
  324. package/templates/ja/intent/nl-spec/README.md +18 -0
  325. package/templates/ja/intent/openspec/proposal.md +15 -0
  326. package/templates/ja/intent/openspec/spec-delta.md +25 -0
  327. package/templates/ja/intent/overview/README.md +18 -0
  328. package/templates/ja/intent/packets/README.md +29 -0
  329. package/templates/ja/intent/packets/index.md +6 -0
  330. package/templates/ja/intent/packets/plan.md +23 -0
  331. package/templates/ja/intent/release-note/README.md +18 -0
  332. package/templates/ja/intent/scripts/intent-check.mjs +786 -0
  333. package/templates/ja/intent/scripts/pre-push +27 -0
  334. package/templates/ja/intent/spec-ingest/README.md +18 -0
@@ -0,0 +1,78 @@
1
+ # Designer Questions
2
+
3
+ The procedure for confirming and recording whether to delegate the designer-role questions (designer-questions), and for the additional questions asked when it is on. Used in `/intent-discover` after the mode is confirmed (Step 1) and when presenting the Tree update proposal (Step 4). All dialogue is done as confirmation with the user (the means of confirmation follows the conventions in SKILL.md).
4
+
5
+ ## Procedure
6
+
7
+ ### After the mode is confirmed (Step 1)
8
+
9
+ 1. **Confirm whether to delegate the designer-role questions**
10
+ - Read `designer-questions` in `.intent/mode.md`. The canonical values are the two tokens `on` / `off`.
11
+ - If undetermined, first explain what the designer-role questions confirm (list these 4 points: making the L1 (outcomes) success criteria measurable / confirming whether the first packet (unit of work) is a walking skeleton (a minimal implementation that runs end to end from input to output) / the existence of a screen rough when there are user-facing screens / the hypothesis and completion judgment in the case of validation (PoC)), then, without recommending, present the two choices (`on` = wanted / `off` = not wanted) and confirm with the user.
12
+ - If already recorded, present the recorded content (designer-questions / purpose) and confirm only whether it should change.
13
+ - If the user defers the decision, do not fill it in by guessing; record "whether to delegate the designer-role questions is undetermined" in Open Questions and continue.
14
+
15
+ 2. **Record the confirmed designer-questions**
16
+ - Write the confirmed token to the `designer-questions` line in `.intent/mode.md`. Downstream skills (intent-packets / intent-validate) refer to this line.
17
+ - **Non-destructive append for older scaffolds**: if mode.md has no designer-questions / purpose line, append the missing lines while keeping the existing mode / selected / reason / definition lines. If intent-tree.md has no "PoC Experiment Definition" / "Screen Rough Reference" section, append them while keeping the existing sections, then record.
18
+
19
+ 2.5. **Affirm the purpose, success, and intended users (fires regardless of the designer-questions value)**
20
+ - Affirm with the user the L0 purpose and the definition of success derived by inference: present the inferred content placed in L0 (Product Purpose) and L1 (Desired Outcomes) of `.intent/intent-tree.md`, and confirm "whether this reading of the purpose and success is correct".
21
+ - Affirm with the user the inferred intended users and usage context (Actor): present "who, in what situation, is assumed to use this", and confirm whether it is correct.
22
+ - Present each confirmation in a form that lets the user choose "not applicable / unknown / check later", and do not force an answer. This is an affirmation grounded in the infer + confirm philosophy, and does **not** expand into a full active questioning of the functional requirements (rather than eliciting L2–L4 one by one, it only checks that the reading of the root purpose, success, and intended users is not mistaken).
23
+ - Content the user affirms is fixed as canonical directly under that L0/L1. The intended users are recorded as the L1 Actor directly under L1. If the user corrects it, replace the canonical with the corrected content.
24
+ - For items the user defers or chooses "check later", do not fill them in by guessing; route them to Open Questions of `.intent/intent-tree.md` (with the `[by export]` tag if an answer is required by export) or to Assumptions (when placed as a tentative premise) and continue. Do not stop planning.
25
+
26
+ 2.6. **Judge the solution convergence and do the aim-the-solution confirmation (fires regardless of the designer-questions value)**
27
+ - Immediately after step 2.5, read the user's request (the idea and target scope) and the Intent Tree being built, and judge the **solution convergence** of the target architecture the request aims at. The judgment is done by LLM reading and does not depend on external analysis tools or mechanical scoring.
28
+ - Handle it with three branches — convergent / divergent / undecidable:
29
+ - **Convergent** (the request implies a specific architecture almost uniquely; it matches an established pattern) → proceed to the aim-the-solution single-question confirmation below.
30
+ - **Divergent** (multiple valid solutions hold) → do not aim the solution first; proceed via the conventional route (apply the anchoring avoidance of step 7, the Impact Analysis stocktake and neutral option presentation).
31
+ - **Undecidable** → do not finalize by guessing; **treat it as divergent**, and record that it cannot be judged in Open Questions of `.intent/intent-tree.md` and continue.
32
+ - Keep the examples of established patterns to a few and do not enumerate them exhaustively (e.g. cron-ization, CLI-ization, one-shot-ization, etc.; avoiding fixation — examples are cues, not the space of solutions).
33
+ - **Aim-the-solution single-question confirmation when convergent**:
34
+ - **Before** the Impact Analysis stocktake and neutral option presentation, confirm the inferred architecture in **a single question** — "the architecture you are aiming for is this, right?" (do not break it into neutral multiple options).
35
+ - Present the confirmation in a form that lets the user choose "not applicable / unknown / check later", and do not force an answer.
36
+ - Handle the result with the same recording discipline as step 2.5: **affirmed** → record the inferred target architecture as canonical in `.intent/intent-tree.md` (record it directly under the relevant L3 (architectural intent), or as an architecture policy directly under L1/L2, using an existing section; do not add a new section). **corrected** → replace the canonical with the corrected architecture. **deferred / check later** → do not finalize by guessing; route it to Open Questions (with the `[by export]` tag if an answer is required by export) and continue (do not stop planning).
37
+ - Aiming the solution goes only as far as **confirming and recording** the architecture; do not implement or generate code.
38
+
39
+ 3. **Confirm the validation nature (only when designer-questions=on)**
40
+ - Confirm with the user whether this development is "validation that verifies something (PoC = `poc`)" or "production / continuous development (= `product`)", and record it on the `purpose` line in `.intent/mode.md`.
41
+ - Do this confirmation not only immediately after on is confirmed, but also on a re-run when designer-questions is already recorded as on and purpose is undetermined.
42
+ - If the user defers the decision, do not fill it in by guessing; record "purpose undetermined" in Open Questions and continue.
43
+
44
+ 4. **The 3 PoC questions (hypothesis / falsification criteria / GO-NO-GO; only immediately after purpose=poc is confirmed)**
45
+ - Ask the user in this order: Hypothesis (what this PoC is meant to verify) → Falsification Criteria (what, if it cannot be observed, rejects the hypothesis) → GO-NO-GO Criteria (the conditions for deciding whether to proceed or stop after the PoC completes).
46
+ - Record the answers as canonical in "PoC Experiment Definition" of `.intent/intent-tree.md`. For items the user cannot answer, do not fill them in by guessing; record them in Open Questions and continue.
47
+ - **When purpose is not poc, do not fire these questions.**
48
+
49
+ ### When presenting the Tree update proposal (Step 4, designer-questions=on only)
50
+
51
+ 5. **Confirm L1 measurement criteria**
52
+ - For each L1 item, confirm with the user "how achievement is observed and judged", and record it as a `Measurement criteria:` line on that L1 item.
53
+ - For items where the criteria cannot be settled, keep the L1 item itself and record "criteria undecided" in Open Questions.
54
+
55
+ 6. **Confirm whether a screen rough exists**
56
+ - First, judge whether L2/L3 includes user-facing screens.
57
+ - If it does, confirm the existence of a screen rough with the user: exists → record the reference (file path or link) in "Screen Rough Reference". Does not exist → recommend creating one. If the user defers, record that decision with the reason in Open Questions or "Screen Rough Reference" and continue.
58
+ - If it does not, do not confirm with the user; **always** record "Not applicable" in "Screen Rough Reference" (so that intent-validate can judge without inference).
59
+ - Do not create or generate the rough itself (only confirm existence, recommend, and record the reference).
60
+
61
+ 6.5. **Confirm omissions and excess with the tree-level omission recap**
62
+ - Before finalizing the Tree update proposal, return a short summary of the inferred and collected L0–L3 (purpose, success, intended users, and the main outcome and feature branches), and confirm with the user "whether anything is missing or, conversely, whether any premise is excessive" (presented as material for a human to correct the LLM's oversights and hallucinations). This is an omission recap applied to the functional requirements as well, not an eliciting of L2–L4 one by one.
63
+ - If the user points out a **missing** item, reflect it into the relevant section of `.intent/intent-tree.md` and re-present: a missing purpose / success → directly under L0 (Product Purpose) / L1 (Desired Outcomes); a missing intended user → directly under L1 as the L1 Actor; a missing outcome / feature branch → the branch directly under the relevant L1.
64
+ - If the user points out something **excessive**, after confirming, remove that item from the canonical (the relevant section of intent-tree.md). If unsure, do not remove it but demote it to Assumptions of `.intent/intent-tree.md` (keep it as a tentative premise). Always confirm with the user before removing.
65
+ - Present each confirmation in a form that lets the user choose "not applicable / unknown / check later", and do not force an answer. For points the user defers or chooses "check later", do not fill them in by guessing; route them to Open Questions of `.intent/intent-tree.md` (with the `[by export]` tag if an answer is required by export) and continue.
66
+ - Keep the re-editing to at most one round trip (do not converse endlessly in the recap). Route any remaining points to Open Questions of `.intent/intent-tree.md`.
67
+
68
+ 7. **Confirm the posture for decisions-under-constraints (④)**
69
+ - Among the L2/L3 capabilities, briefly summarize those that involve mutating data, external input / system boundaries, or access control, and confirm **all at once, just once**: "in this set of features, which places should we decide on — consistency, idempotency, behavior on error, who may access". (Do not turn each ④ item into an active question one by one; do this as the same "confirm nothing is missing" as the omission recap.)
70
+ - This is not a step that fills in the decisions here and now; it is a step that **captures the posture of which capabilities should have decision slots (④) sown**. **Only for design decisions whose solution is divergent**, do not present a reasonable default value (avoiding anchoring bias). Conversely, for an architecture request judged **convergent** in step 2.6, do not apply anchoring avoidance — aim the inferred solution first (see the aim-the-solution step in 2.6). The list and firing conditions of the slots are owned by `intent-packets/rules/decision-slots.md` (its anchoring-avoidance discipline is unchanged regardless of this step's scoping).
71
+ - For what the user points to as "this should be decided", record it directly under the relevant L3 in `.intent/intent-tree.md` as "a point requiring a decision (④)" (do not write concrete values yet; the actual slot sowing and value finalization are done by intent-packets per packet).
72
+ - **Prompt consider-the-opposite only for high-cost decisions**: only when the user has chosen a stance on a high-cost decision (authorization, consistency, error semantics, backward compatibility), prompt them to name at least one condition under which that stance could become inappropriate (a threat, edge case, or out-of-scope situation) (mitigating confirmation bias). Record the named conditions alongside that "point requiring a decision (④)" in `.intent/intent-tree.md`.
73
+ - Impose this falsification prompt only on high-cost decisions. Do not impose friction on every slot and weigh the dialogue down (avoiding decision fatigue).
74
+ - Present each confirmation in a form that lets the user choose "not applicable / unknown / check later", and do not force an answer. Do not fill in deferrals by guessing; route them to Open Questions and continue.
75
+
76
+ ## When designer-questions is off
77
+
78
+ When off, the only things that fire are the opt-in confirmation in steps 1-2, step 2.5 (affirming the purpose, success, and intended users), and step 2.6 (judging the solution convergence and the aim-the-solution confirmation). Steps 3-7 (validation-nature confirmation, the 3 hypothesis questions, L1 measurement criteria, screen rough, the ④ posture) and step 6.5 (the tree-level recap) do not fire. The L0 purpose, success, and intended users, and the form of the solution (target architecture), differ in nature from the PoC-only information (steps 3-6) and are needed as the root of intent even in product development, so they are included in the minimal off configuration (the effect of preventing detours on requests with an obvious solution holds even when off). Even if a purpose value remains, it is not consulted unless designer-questions is recorded as on.
@@ -0,0 +1,105 @@
1
+ # Drift Terrain
2
+
3
+ The symptom × in-progress Intent Tree matching logic used at Step 3.5 of `/intent-discover`. Runs only when `drift-watch: on` (off / missing / invalid does nothing). The goal is to name, before work starts, "this subject is easy-to-drift terrain," and to make the anti-direction / invariant get written first, before you drift all the way out.
4
+
5
+ ## The only basis for diagnosis is the type catalog
6
+
7
+ - **The only basis for diagnosis is the type catalog in `.intent/drift-patterns.md`.** At the discover stage there is no compass and no packet yet, so the type catalog is the only material to match against (an essential constraint). Matching based on the compass's Invariant / Anti-direction is the job of the export stage (a different drift-watch hook) and is not done here.
8
+ - Terrain diagnosis **assumes false positives**. "Matching" a type is not a confirmation of drift. Name it early on a weak cue, and record swings-and-misses too.
9
+
10
+ ## Procedure
11
+
12
+ 1. **Read drift-patterns.md**
13
+ - Read `.intent/drift-patterns.md` and take all types (the seeds plus every type the user has grown).
14
+ - **When absent**: skip terrain diagnosis and notify the user accordingly (do not stop / do not write to drift-log). Do not run the remaining steps.
15
+
16
+ 2. **Match each type's symptom against the in-progress Intent Tree**
17
+ - Hold each type's `symptom` against the **subject (topic) and L0–L3** (purpose / outcome / capability / behavior & design intent) of the Intent Tree you are currently building.
18
+ - `symptom` is a **weak cue**, not a strong decision condition meaning "if it matches it is definitely drift." Assume false positives; pick it up if it looks suspicious.
19
+
20
+ 3. **When a type matches**
21
+ - **Name it explicitly** to the user. Example: "This subject is terrain where you can easily hit `<id>`."
22
+ - Write that type's "Things to write first" (Anti-direction / Invariant candidates) into the Intent Tree's **Open Questions / anti-direction candidates**. Concretize the subject-dependent parts from context (do not paste the catalog's generic wording verbatim; phrase it for the current subject).
23
+ - Append one entry to `drift-log.md` (see the append procedure below). The values are:
24
+ - `pattern: <the matched type's id>`
25
+ - `stage: discover`
26
+ - `packet: -` (no packet is fixed yet at the discover stage)
27
+ - `mechanism: pattern-catalog`
28
+ - `outcome: prevented` (**a draft**: this is drift-watch's estimate; the verdict is the user's `user-verdict`)
29
+ - `user-verdict: unjudged`
30
+ - `recorded_at: <ISO 8601>`
31
+ - `commit: <short hash | ->`
32
+ - `note: <1-2 lines>` (what you named and what you had written first)
33
+ - If multiple types match, append one entry per type.
34
+
35
+ 4. **When no type matches (a swing and a miss / not-applicable)**
36
+ - **Always record the swing-and-miss too.** So that `missed=0` is not misread as "evidence it worked," record the moments when nothing matched just as evenly (structural avoidance of confirmation bias).
37
+ - Append one entry to `drift-log.md`. The values are:
38
+ - `pattern: -` (no type matched; `uncatalogued:<short name>` is the value for an actual drift outside the catalog, so do not use it for a swing-and-miss — use `-`)
39
+ - `stage: discover`
40
+ - `packet: -`
41
+ - `mechanism: none`
42
+ - `outcome: not-applicable`
43
+ - `user-verdict: unjudged`
44
+ - `recorded_at: <ISO 8601>`
45
+ - `commit: <short hash | ->`
46
+ - `note: <1-2 lines>` (that no type was present in the terrain)
47
+
48
+ ## The append procedure for drift-log
49
+
50
+ - **Write in split form (CONTRACT "Split and archive convention for append-only records")**: drift-log is event-origin, so instead of appending to the end of a single `drift-log.md`, write one entry to a **per-date+slug split file** `drift-log/<date>-<slug>.md`. `<date>` is the recorded_at date; `<slug>` is derived from the pattern (the event) via the existing slug rule (`intent-packets/rules/packet-format.md`) — do not create new/sequential numbering. Because a different event touches a different file, tail collisions disappear by construction. Never rewrite or delete an existing entry (**append-only**).
51
+ - **Always write all 9 keys in the fixed order**: `pattern` → `stage` → `packet` → `mechanism` → `outcome` → `user-verdict` → `recorded_at` → `commit` → `note`. Do not write an entry that is missing even one of the 9 keys.
52
+ - **recorded_at**: write the time of recording in ISO 8601 (transaction time).
53
+ - **commit**: write the result of `git rev-parse --short HEAD`. When it cannot be obtained (non-repository, git CLI absent, etc.), use `-` (fail-open: keep recording).
54
+ - **When the `drift-log/` directory is absent**: create the directory, then write the split file. An old single `drift-log.md`, if still present, can be read side-by-side by readers (migration is handled by this slice's migration step).
55
+ - Follow the sample in the "Entry format" section of `.intent/drift-log.md` (`### drift-log entry`) for the entry format.
56
+
57
+ ## Context cost cues (tied to drift-watch)
58
+
59
+ Alongside terrain diagnosis, run a matching that makes you **notice** a way of progressing that eats context (tokens). This is a **separate catalog** from drift-patterns (types of intent drift); only the symptom differs — it is "a situation that eats context" rather than "intent drift". This is awareness, not a norm, and because it differs in nature from the drift-patterns matching above, it is **kept as a separate procedure**.
60
+
61
+ - **Only when `drift-watch: on`** do this matching (do nothing when off / unset / invalid). When `.intent/context-cost-cues.md` is absent, skip the matching and announce that (do not stop).
62
+ - **This is not recorded to any log.** Unlike the drift-patterns matching above (which appends to `drift-log.md` on both a match and a miss), context cost cues are **not appended to `drift-log.md` or to any other log**. Reason: consumption cannot be measured and its outcome cannot be evaluated, so mixing it into the log would pollute the drift-log tally with guesses; furthermore, what eats context legitimately differs per person, so recording it would intrude on privacy. **Do not apply the "append procedure for drift-log" above to this matching.**
63
+
64
+ ### Procedure
65
+
66
+ 1. **Read context-cost-cues.md**
67
+ - Read `.intent/context-cost-cues.md` and obtain all types (seed + every type the user has grown). If absent, skip and announce (do not stop).
68
+
69
+ 2. **Match each type's symptom against the Intent Tree under construction**
70
+ - Check each type's `symptom` against the subject / way of progressing (topic and L0–L3) of the Intent Tree you are currently building. The `symptom` is a weak cue; if the fit is weak, stay silent (lean toward staying silent over false positives — to keep the awareness feature trustworthy).
71
+ - Use only the subject of the Intent Tree under construction for matching. Do not read token consumption, git diffs, or runtime metrics.
72
+
73
+ 3. **When a type matches (present the cue; do not write to any log)**
74
+ - Name it to the user in a noticing tone. Example: "This subject may match `<id>` — this might be eating context."
75
+ - Add the type's "if this is unintentional" light alternative (thin entry point / JIT pull / limited input) as an **optional choice**. Example: "If this is unintentional, there is also <light alternative> (the judgment is yours)."
76
+ - **Do not correct or instruct.** Phrase it as a cue rather than an imperative or a verdict. Installing many skills or loading full content can be a legitimate high-cost choice, so do not dismiss a context-eating choice as unnecessary. Leave the judgment to the user.
77
+ - **Do not append to any log** (do not reuse the drift-patterns append procedure).
78
+
79
+ 4. **When no type matches**
80
+ - Name nothing. **Write nothing to any log** (do not record a miss either — this matching has no log at all).
81
+
82
+ ## Constraint starter awareness (linked to drift-watch)
83
+
84
+ Alongside terrain diagnosis, perform a light match to give **early awareness** of domain-convention starters. This is the discover-side supplement to constraint-starter surfacing whose primary touchpoint is the compass (`intent-compass/rules/constraint-surfacing.md`); it reads a different catalog from the above (`.intent/constraint-starters.md` = reusable constraint conventions). Its symptom differs from intent-drift and context-cost, so **keep its procedure separate**.
85
+
86
+ - **Only when `drift-watch: on`** perform this match (do nothing when off / unset / invalid). When `.intent/constraint-starters.md` is absent, skip the matching and say so (do not stop).
87
+ - **Record this to no log.** Unlike the drift-patterns match above (which appends to `drift-log.md`), constraint-starter awareness appends to **neither `drift-log.md` nor any other log** (same treatment as context-cost-cues awareness).
88
+ - **This is surfacing, not auto-transcription.** It only gives awareness of candidates; it does not auto-write into Anti-direction / Invariants. Adoption and wording are done by a human in the compass (the primary touchpoint).
89
+
90
+ ### Procedure
91
+
92
+ 1. **Read constraint-starters.md**
93
+ - Read `.intent/constraint-starters.md` (bundled conventions) and, if present, `.intent/constraint-library.md` (constraints the user grew) read-only, and obtain all conventions (per `## id:`). If both are absent, skip and say so (do not stop).
94
+
95
+ 2. **Match each convention's "fits when" against the Intent Tree under construction**
96
+ - Match each convention's `fits when` against the material/domain of the Intent Tree you are building. `fits when` is a weak cue; if the fit is weak, stay silent (lean toward silence over false positives).
97
+ - Use only the material of the Intent Tree under construction for matching. Do not read code diffs or runtime metrics.
98
+
99
+ 3. **When a convention matches (surface awareness; write to no log)**
100
+ - Name it to the user in an awareness tone. Example: "This material may match `<id>` (<name>) — you can consider it as a starter in the compass." Do not push; narrow the candidates.
101
+ - The detailed starter (Anti-direction candidate / Invariant candidate) and the adoption decision are **left to the compass (the primary touchpoint)**. In discover, only give early awareness that "this convention may help."
102
+ - **Append to no log.**
103
+
104
+ 4. **When no convention matches**
105
+ - Name nothing. **Write nothing to any log** (this matching has no log).
@@ -0,0 +1,31 @@
1
+ # Mode Selection
2
+
3
+ The logic for recommending the mode for working out the Intent based on the repository situation. Used at the start of `/intent-discover`. This is also an extension point (when you add a new mode, add its recommendation conditions here).
4
+
5
+ ## Procedure
6
+
7
+ 1. **Enumerate available modes**
8
+ - Glob for `.intent/modes/*.md`. Read each mode's "Applicable situations" section.
9
+
10
+ 2. **Lightly observe the repository situation**
11
+ - Presence/scale of existing code, presence of tests, richness of README/docs, presence of existing `.intent/` deliverables.
12
+ - Do not read deeply. Only the clues needed for a recommendation.
13
+
14
+ 3. **Recommend a mode**
15
+ - The bundled modes at present are the four: `standard` / `refactor` / `behavior-unknown` / `feature-growth`. Recommend based on the repository situation using these conditions:
16
+ - New / intent not yet articulated → `standard` (default)
17
+ - Large existing codebase / refactor target (large existing code, design drift) → `refactor` (intent-less / vibe-coded existing code also routes to refactor, with Intent Recovery in discover)
18
+ - Legacy with unknown behavior (no/few tests, lost specification) → `behavior-unknown`
19
+ - A **feature addition** to an existing system (extend / integrate / add-to style requests, behavior known, redesign is not the goal) → `feature-growth` (distinguishing: if you want to change the existing structure, use `refactor`; if you want to add onto the existing system, use `feature-growth`)
20
+ - When no condition clearly applies, recommend `standard`.
21
+
22
+ 4. **Confirm with the user**
23
+ - Present the recommended mode and the reason, and request confirmation/change via `AskUserQuestion`.
24
+ - **Whether there is one mode candidate or several, always run the recommend → confirm → record wiring**. This keeps the user experience unchanged as modes are added or removed.
25
+
26
+ 5. **Record the confirmed result**
27
+ - Write the confirmed mode to `.intent/mode.local.md` (the local canonical source for mode state; not tracked by git) (mode / selected / reason / definition). In legacy environments where `mode.local.md` does not exist, reads are handled by the backward-compatible fallback (`mode.local.md` → `mode.md` → standard). Enforcement / Drift-watch reads continue to reference `mode.md`.
28
+
29
+ ## Adding a new mode to the recommendation targets
30
+
31
+ When you create a new `.intent/modes/<name>.md`, add to the recommendation guidelines in step 3 above "under what repository situations to recommend <name>".
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: intent-export-cc-sdd
3
+ description: Convert one chosen packet into a condensed draft that can be handed to cc-sdd without wasting tokens. Does not intrude on cc-sdd's main generation. Can invoke /kiro-spec-init when instructed to proceed.
4
+ disable-model-invocation: true
5
+ allowed-tools: Read, Write, Glob, Grep, AskUserQuestion, Skill, Bash
6
+ argument-hint: <target packet name (optional)>
7
+ ---
8
+
9
+ # intent-export-cc-sdd Skill
10
+
11
+ ## Core Mission
12
+ - **Success Criteria**:
13
+ - One target packet is converted into a condensed cc-sdd Project Description + design/tasks hints
14
+ - The input is limited to the target packet file + the compass's project-universal Invariants/Anti-direction, and the full Tree/Compass is not transcribed into cc-sdd
15
+ - The tasks hints carry parent intent / invariant references, forming a propagation structure to impl
16
+ - The output is led by natural-language guidance, and `/kiro-spec-init` can be invoked when instructed to proceed
17
+ - No application code has been changed at all
18
+
19
+ ## Execution Steps
20
+
21
+ ### Step 1: Narrow down to one target packet
22
+ - Read `.intent/packets/index.md` and present the active packet candidates. If index.md is absent, build the candidate list directly from the frontmatter of the files under `.intent/packets/active/`, continue, and prompt regeneration of the index. If `.intent/packets/` itself is absent (or `active/` is empty), guide the user to "run `/intent-packets` first" and stop.
23
+ - If a packet is specified by argument, use it; otherwise narrow down to one from the candidates by priority or user confirmation, and read only the file of the confirmed target packet (under `.intent/packets/active/`) — do not bulk-read all packet files.
24
+ - **Draft guard**: when the confirmed target packet's `state` is draft, confirm via AskUserQuestion whether to "activate it and continue the export"; once the user approves, update the frontmatter `state` to active and regenerate `index.md` before continuing (never export a draft as is without confirmation; this activation is the only canonical write the export makes).
25
+ - Read `.intent/mode.local.md` (falling back to `.intent/mode.md` if absent) for the mode state. If both are absent, continue with the standard default and announce it.
26
+
27
+ ### Step 1.5: Enforcement gate (writeback freshness check)
28
+ - From the `## Enforcement (user-managed)` section of the `.intent/mode.md` read in Step 1, check the value of `enforcement`. If it is off, missing, or an invalid value (including mode.md being absent), skip this check and continue to Step 2 as today.
29
+ - When it is remind or gate, run `node .intent/scripts/intent-check.mjs` with Bash (a read-only script; it creates, modifies, and deletes no files) and follow its stdout.
30
+ - **Interpretation rules for the verdict line**: the stop decision is governed solely by `block=` on the first stdout line (do not re-derive or reinterpret). Whether a warning is needed is decided by `result=stale` or `pending>0`. Even when `result=not-applicable`, use the value of `pending=` from the verdict line as is.
31
+ - When gate and `block=yes`: present the grounds (the pending packet names and the elapsed commit count / threshold; quote intent-check's human-readable lines from the second line onward verbatim), stop the export, and guide the user to run `/intent-writeback`. Then confirm via AskUserQuestion whether to "proceed with the export anyway", and only when the user explicitly instructs to proceed, run the export with a warning attached (the escape hatch for false positives).
32
+ - When remind and a violation is detected (`result=stale` or `pending>0`): present the same grounds as a warning and continue without stopping.
33
+ - Only when intent-check itself cannot run (Bash unavailable, script absent, or exit 2): treat staleness as not-applicable, check `.intent/deltas.md` for pending Delta entries (those carrying `- Status: pending`) via Read/Grep, and enter the same branches above using that result as `pending`.
34
+
35
+ ### Step 1.6: Drift Check (drift-watch)
36
+ - Check the value of `drift-watch` in the `## Drift-watch (user-managed)` section of the `.intent/mode.md` read in Step 1. When it is not `on` (including off, unspecified, invalid value, missing section, or missing mode.md), do not perform this check; continue to Step 1.7 as today (byte-identical to current behavior).
37
+ - Only when it is `on`, read and apply `rules/drift-export-check.md`. The matching of the target packet's design/tasks hints × compass (North Star / Anti-direction / Invariants), the named presentation of conflicts, appending a `stage: export` entry to drift-log, and resolving the outcome by the user's verdict are all delegated to the rule's procedure (do not duplicate the procedure here).
38
+ - This check is **warn-only and does not stop the export** (only the Step 1.5 enforcement gate can stop; drift-watch never stops because it assumes false positives).
39
+ - Order and orthogonality of the three checkpoints: **enforcement (procedure, may stop, Step 1.5) → drift-watch (direction, never stops, Step 1.6) → Open Questions (deadline, never stops, Step 1.7)**. Their inspection targets are orthogonal (procedure / direction / deadline).
40
+
41
+ ### Step 1.7: Confirm unanswered Open Questions
42
+ - Read and apply `rules/export-questions.md`.
43
+
44
+ ### Step 1.8: Preflight check of the cc-sdd prerequisite (warn only — do not stop)
45
+ - Observe read-only whether the `.kiro/` directory exists (Read/Glob; do not push this onto a mechanical check such as `intent-check.mjs`).
46
+ - When `.kiro/` is **absent**: **warn** that cc-sdd (kiro) may not be set up. Guide: "The cc-sdd prerequisite (`.kiro/`) was not found. Set up cc-sdd, or — if a readable artifact is the goal — the format-axis projection (an exit to a readable Spec) is also available." (The choice of exit follows the exit decision lane in `rules/export-route.md`; this SKILL does not name other export/projection skills' commands.) **Do not stop the draft generation** (continue to Step 2 onward).
47
+ - When `.kiro/` **exists**: emit nothing and continue to Step 2 (as before — no warn).
48
+ - This check is **warn only — it does not stop the export** (only the Step 1.5 enforcement gate can stop; the preflight follows drift-watch's false-positive-tolerant stance and does not stop — it does not foreclose adding `.kiro/` later). The exit's appropriateness follows the convention in `rules/export-route.md` (the exit decision lane).
49
+
50
+ ### Step 2: Apply the mapping rules
51
+ - Read and apply `rules/map-cc-sdd.md`.
52
+ - The input is only the one target packet file (including the packet-specific invariants in Safety / Invariants) + the project-universal Invariants/Anti-direction of `.intent/intent-compass.md` (do not read the full Tree or other packets. Only when direction is needed, reference a summary of Tree L0–L1).
53
+
54
+ ### Step 3: Generate the draft
55
+ - Write the drafts under the per-packet directory `.intent/cc-sdd/<slug>/`. The slug derivation and collision handling follow the "Output layout" section of `rules/map-cc-sdd.md`.
56
+ - Write the condensed Project Description (the cc-sdd input body) into `.intent/cc-sdd/<slug>/requirements.md`.
57
+ - Write design hints (bullets) into `.intent/cc-sdd/<slug>/design.md`, and an "Intent-derived constraints" section + tasks check items into `.intent/cc-sdd/<slug>/tasks.md`.
58
+ - Do not complete the cc-sdd main body. Always leave parent intent and invariant references in the tasks hints.
59
+ - Once the drafts are generated, write the export record into a **per-packet split file** `.intent/export-log/<packet-slug>.md` (following CONTRACT "Split and archive convention for append-only records"). Derive `<packet-slug>` from the packet name via the existing slug rule (`intent-packets/rules/packet-format.md`) — do not create new/sequential numbering. The file holds the same table header as the scaffold (`| packet | exported_at | commit |`) plus the row `| <packet name> | <export datetime (ISO 8601 UTC)> | <commit hash> |` (append a row if the file exists; do not erase past rows). Obtain the commit hash by running `git rev-parse --short HEAD` (read-only) with Bash; if it cannot be obtained, record `-`. Create the `.intent/export-log/` directory if absent.
60
+ - Then regenerate the old `.intent/export-log.md` as a **generated active mirror**: concatenate all data rows from `.intent/export-log/*.md` in `exported_at` ascending order and overwrite the mirror with the scaffold header + all rows (the split files are the source of truth; the mirror is derived, never hand-edited). This keeps single-file readers (status / validate / writeback / intent-check) from breaking. The mirror is folded in the later slice (wire) once reader cross-following is complete.
61
+
62
+ ### Step 4: Guide the handoff (natural-language led)
63
+ - The lead of the output is natural-language guidance: show the path of the target packet's `.intent/cc-sdd/<slug>/requirements.md` and confirm "may this be handed to cc-sdd as is".
64
+ - When the user instructs to proceed, read the body of the target packet's `.intent/cc-sdd/<slug>/requirements.md` and invoke `/kiro-spec-init` with that body as the argument (use `Skill`. Do not force the user to copy-paste).
65
+ - As a fallback, also include a newline-minimized copy block for `/kiro-spec-init` (not the lead).
66
+ - **Delegation goes only up to invoking `/kiro-spec-init`**. The subsequent requirements → design → tasks follow cc-sdd's 3-phase approval, waiting for the user's instruction to proceed at each phase. Do not push ahead automatically.
67
+ - **Make the return path explicit (the entry to the writeback phase)**: at the end of the guidance, add one line that once the cc-sdd implementation has gone around once (once learnings emerge from the reality of implementation), they are returned to the canonical deliverables via `/intent-writeback`. Do not settle for writing post-implementation learnings directly into the packet file as Evidence; always go through writeback (via a delta). This guidance makes the phase boundary explicit to the user: "pre-implementation drafting (compass/packets write canonical directly)" vs. "post-implementation extraction (writeback via a delta)".
68
+
69
+ ## Output Description
70
+ - Proposed update to the target packet's `.intent/cc-sdd/<slug>/{requirements, design, tasks}.md`
71
+ - One export-record row appended to `.intent/export-log.md`
72
+ - The target packet file's `state` update and the regeneration of `.intent/packets/index.md` when a draft was activated (omitted when none apply)
73
+ - Confirmation result for unanswered `[by export]` questions (the questions presented and the user's decision; omitted when none apply)
74
+ - Confirmation of whether it may be handed to cc-sdd (natural-language guidance; the lead)
75
+ - Copy block for `/kiro-spec-init` (fallback; secondary)
76
+ - Points to confirm before implementation
77
+ - Return-path guidance after the implementation goes around once (return to canonical via `/intent-writeback`; do not settle for writing Evidence directly into the packet)
78
+
79
+ ## Safety & Fallback
80
+ - If `.intent/packets/` is absent (or `active/` is empty), stop and guide the user to `/intent-packets`.
81
+ - The absence of index.md does not stop; build the candidates directly from the files under `active/`, continue, and prompt regeneration of the index.
82
+ - The only canonical write is the draft-guard activation (`state` update + `index.md` regeneration), and only with the user's approval. Never rewrite intent-tree / intent-compass / packet bodies.
83
+ - The absence of mode.md does not stop; continue with the standard default and announce it.
84
+ - The enforcement check is fail-open: even when intent-check cannot run, do not block the export. The export stops only when enforcement is gate and the verdict line says `block=yes`, or when the unrunnable fallback finds pending deltas under gate; even then the user's explicit instruction to proceed lets it run.
85
+ - The Open Questions check is a confirmation, not a stop; the user's explicit instruction to proceed lets the export run.
86
+ - Do not complete the main body of cc-sdd's requirements/design/tasks (drafts/hints only).
87
+ - Do not auto-invoke cc-sdd phases beyond `/kiro-spec-init`.
88
+ - Do not change application code (INV6. Invoking other skills is a concept distinct from INV6 and is allowed).
@@ -0,0 +1,75 @@
1
+ # Drift Export Check
2
+
3
+ The matching logic used at Step 1.6 of `/intent-export-cc-sdd`: the target packet's design/tasks hints against the compass. It runs only when `drift-watch: on` (off / absent / invalid values do nothing). It sits after the enforcement gate (Step 1.5, which may stop) and before the Open Questions check (Step 1.7, which does not stop), and warns—right before handoff to cc-sdd, the moment before going-back stops working—whether the packet has drifted from the compass's direction.
4
+
5
+ ## The basis of the matching is the compass
6
+
7
+ - **The basis of the matching is the North Star / Anti-direction / Invariants of `.intent/intent-compass.md`.** At the export stage the compass already exists, so here the basis is the compass, not the pattern catalog (`.intent/drift-patterns.md`) (the discover terrain diagnosis has neither compass nor packet yet, so it uses the pattern catalog as its basis. Export is its sibling stage, and the difference is that the basis is the compass).
8
+ - The export matching is **premised on false-positives**. "Hitting" a compass element is not a confirmation of drift. We build in from the start that a valid design may be wrongly caught (false-positive), and we record swings and misses too.
9
+ - **This matching is a direction checkpoint, and it does not stop.** Its inspection target is orthogonal to the enforcement gate (a procedure checkpoint that may stop). We never stop export over a drift detection (only the Step 1.5 enforcement gate may stop).
10
+
11
+ ## Procedure
12
+
13
+ 1. **Obtain the inputs**
14
+ - Take the target packet's **design/tasks hint generation content** (the body of the draft export is about to generate) as the input.
15
+ - Read the **North Star** / **Anti-direction** / **Invariants** (project-universal Invariants) of `.intent/intent-compass.md`.
16
+ - **When the compass is absent / unfilled**: skip the export matching and inform the user of that fact (do not stop / do not write to drift-log either). Do not run the remaining steps.
17
+
18
+ 2. **Match the design/tasks hints against the compass**
19
+ - Hold the design/tasks hints about to be generated against the compass's **Invariants** (do they breach a constraint that must not be broken?), **Anti-direction** (are they leaning toward a direction decided to be avoided?), and **North Star** (have they drifted from the final state?).
20
+ - This is a **semantic match**, not a mechanical decision. Premised on false-positives, pick it up if in doubt.
21
+
22
+ 3. **When there is a conflict**
23
+ - Present a **warning only** to the user—**do not stop export**. Name what was breached (which Invariant / Anti-direction / North Star) and which part of the design/tasks hints is off.
24
+ - Append one entry to `drift-log.md` (see the append procedure below). The values are:
25
+ - `pattern: <a matching drift-patterns id | uncatalogued:<short name> | ->`(an id if identifiable; `uncatalogued:<short name>` for an actual drift outside the catalog; `-` if undeterminable)
26
+ - `stage: export`
27
+ - `packet: <target packet name>`
28
+ - `mechanism: compass-anti-direction`(when an Anti-direction was breached)or `compass-invariant`(when an Invariant was breached; pick by which compass element was breached)
29
+ - `outcome: caught`(a **draft**. This is drift-watch's estimate; the verdict is decided by the user's `user-verdict` and the resolution below)
30
+ - `user-verdict: unjudged`
31
+ - `recorded_at: <ISO 8601>`
32
+ - `commit: <short hash | ->`
33
+ - `note: <1-2 lines>`(what was breached and what was warned about)
34
+ - If multiple places conflict, append one entry per conflict.
35
+
36
+ 4. **outcome is confirmed by the user's judgment (resolving the draft)**
37
+ - Step 3 only **drafts** `caught` for `outcome`; the final value is decided by the user's judgment:
38
+ - When the user heeds the warning and pulls the design back → `caught` (capture succeeded, the "worked" family)
39
+ - When the user ignores it and passes it through anyway → `missed` (could not prevent it, it got through, the "did not work" family)
40
+ - When the design was actually valid and it was a false alarm → `false-positive` (it was a false alarm, the "did not work" family)
41
+ - `user-verdict` backs the final value: `valid` if the point was sound / `false-alarm` if it was a false alarm / `unjudged` if not judged. Even if the user has not judged it, it stays `unjudged` and remains a target for recording and tallying.
42
+
43
+ ## The append procedure to drift-log
44
+
45
+ - **Write in split form (CONTRACT "Split and archive convention for append-only records")**: drift-log is event-origin, so instead of appending to the end of a single `drift-log.md`, write one entry to a **per-date+slug split file** `drift-log/<date>-<slug>.md`. `<date>` is the recorded_at date; `<slug>` is derived from the pattern (the event) via the existing slug rule (`intent-packets/rules/packet-format.md`) — do not create new/sequential numbering. Because a different event touches a different file, tail collisions disappear by construction. Never rewrite or delete an existing entry (**append-only**).
46
+ - **Always write all 9 keys in fixed order**: `pattern` → `stage` → `packet` → `mechanism` → `outcome` → `user-verdict` → `recorded_at` → `commit` → `note`. Do not write an entry that is missing even one of the 9 keys.
47
+ - **recorded_at**: write the recording time in ISO 8601 (transaction time).
48
+ - **commit**: write the result of `git rev-parse --short HEAD`. When it cannot be obtained (non-repository, git CLI absent, etc.), use `-` (fail-open; recording continues).
49
+ - **When the `drift-log/` directory is absent**: create the directory, then write the split file. An old single `drift-log.md`, if still present, can be read side-by-side by readers (migration is handled by this slice's migration step).
50
+ - Follow the sample in the "Entry format" section of `.intent/drift-log.md` (`### drift-log entry`) for the entry format.
51
+
52
+ ## Scope-overflow check (DR9 second defense · packet-scope-overflow)
53
+
54
+ A second check whose **grounds differ from** the compass check above. Whereas the compass check looks at "did this conflict with a universal compass Invariant", this one looks at "**is an implementation instruction arriving that exceeds the target packet's declared scope (`## Scope` / `## Non-scope`)**". When it does, it warns that the **packet-specific invariants** that newly become necessary in that new territory (authorization, data consistency, transaction boundaries, idempotency) are absent from the cc-sdd artifacts—recorded as drift. It runs only when `drift-watch: on`, and—like the compass check—**warns only, never stops, and assumes false positives**. It is also the instrument that measures whether the first defense (the convention-doc rule "go back to intent on scope overflow"—recall only) is working.
55
+
56
+ The check is performed at two points (user-confirmed 2026-06-20, "both"):
57
+
58
+ 1. **At the export waterline (this Step 1.6)**: check whether the draft about to be exported exceeds the target packet's `## Scope` and reaches into the `## Non-scope` side. If the draft itself departs from scope, it is caught at export time.
59
+ 2. **A light cue afterward (re-check at the implementation stage)**: when the **implementation instruction** the user issues after export exceeds the target packet's `## Scope` (e.g., a front-end-only packet being told to implement back-end / authorization / transaction boundaries), re-check lightly and name it. This is the entry point that prompts a return to "go back to intent" (raise a packet for the new territory with `/intent-packets` and re-export); it does not stop.
60
+
61
+ ### Input and discipline of the check
62
+
63
+ - **The input is only the implementation-instruction text and the packet's `## Scope` / `## Non-scope` declarations.** Do not read code diffs or implementation results (INV5/INV6 · DR14). It is a semantic check, not a mechanical decision.
64
+ - The grounds of the check are the **absence of packet-specific invariants**. Do not conflate its logic with the universal compass Invariant check (above). The fact that universal Invariants were transcribed at export does not cover the new territory's specific constraints (a different layer).
65
+ - **Abnormal case**: when the target packet is missing / `## Scope` is blank, skip the check and announce it (do not stop · do not write to drift-log).
66
+
67
+ ### When there is a scope overflow
68
+
69
+ - Present **only a warning** to the user—neither export nor implementation stops. Name what exceeds the packet scope (e.g., front-end), which new territory it reaches (e.g., back-end / authorization / transactions), and which packet-specific invariants (authorization, consistency, transaction boundaries, idempotency) are absent, and advise "raise a packet for the new territory with `/intent-packets` and re-export (go back to intent)".
70
+ - Append one entry to `drift-log.md` (same append procedure as above). The value differences are:
71
+ - `mechanism: packet-scope-overflow` (a second-defense origin distinct from the two compass values; separable in tallies)
72
+ - `pattern: uncatalogued:scope-overflow` (the id of a scope-creep type seed if the type catalog has one; otherwise `uncatalogued:scope-overflow`)
73
+ - `stage: export` (when caught at the waterline). When caught at the later implementation stage, use `stage: export` as well, as an extension of the export-origin check, and state "re-check at the implementation stage" in `note` (do not add a new stage value—keep the existing three-value `discover | export | improve` schema unchanged).
74
+ - The other keys (`packet` / `outcome: caught` draft / `user-verdict: unjudged` / `recorded_at` / `commit` / `note`) follow the same discipline as the compass check.
75
+ - The confirmation of `outcome` is the same as the compass check (`caught` if the user goes back to intent / `missed` if they push through ignoring it / `false-positive` if it was actually a valid extension and a false alarm).
@@ -0,0 +1,23 @@
1
+ # Export Questions Check
2
+
3
+ The procedure for confirming unanswered `[by export]` Open Questions before running the export. Used at Step 1.7 of `/intent-export-cc-sdd`. All dialogue is conducted as confirmation with the user (the means of confirmation follows the SKILL.md conventions).
4
+
5
+ ## Detection
6
+
7
+ - Read the Open Questions sections of `.intent/intent-tree.md` and `.intent/intent-compass.md`, and detect questions containing `[by export]`. A question remaining in the section is treated as unanswered.
8
+ - Detection targets only these two files. The canonical source of questions is the Open Questions sections of both files; the Deferred section of `.intent/packets/plan.md` is a record of intentional deferrals, not questions, and is therefore out of scope.
9
+ - **Do not reference the enforcement setting (the Enforcement section of `.intent/mode.md`)** (this operates independently of the Step 1.5 enforcement gate).
10
+
11
+ ## Procedure
12
+
13
+ 1. **When nothing is detected (including older scaffolds without the tag convention)**
14
+ - Present nothing and proceed to the next step (no behavior change).
15
+
16
+ 2. **When questions are detected**
17
+ - Present the list of detected questions.
18
+ - Confirm with the user whether to "answer them before exporting, or proceed as is".
19
+ - This is a confirmation, not a stop. When the user explicitly instructs to proceed, run the export.
20
+
21
+ ## Discipline
22
+
23
+ - Do not change code.
@@ -0,0 +1,62 @@
1
+ # Mapping: packet → cc-sdd
2
+
3
+ The rules for converting one chosen packet into a cc-sdd draft. Used by the `intent-export-cc-sdd` skill. This is one of the per-export-target mappings (for cc-sdd). To add another target (e.g. OpenSpec), add `rules/map-<target>.md` and create a corresponding `intent-export-<target>` skill (the seam).
4
+
5
+ ## Input scope (strict / information-source contract)
6
+
7
+ - Read only **the one target packet** and **the Invariants / Anti-direction of `.intent/intent-compass.md`**.
8
+ - **Do not read** the full Intent Tree or other packets. Only when the overall direction is needed, reference Tree L0–L1 **as a summary** in a pinpoint manner (no body transcription).
9
+ - This keeps the amount of information passed to cc-sdd to about 1 packet's worth (preventing token explosion).
10
+
11
+ ## Output (drafts of 3 files / do not create the main body)
12
+
13
+ Write the drafts under the per-packet directory `.intent/cc-sdd/<packet-slug>/` (slug derivation is in the next section, "Output layout").
14
+
15
+ ### `.intent/cc-sdd/<packet-slug>/requirements.md`
16
+ - The **Project Description body** (condensed text) fed into cc-sdd's `/kiro-spec-init`.
17
+ - What to include: (a) whose problem it is, (b) the current state, (c) what you want to change / In·Out scope / invariants to protect / parent intent.
18
+ - **Required headings (output contract)**: always include the three headings `## Source Packet`, `## Parent Intent`, and `## Invariants`. The value of `## Source Packet` is the **exact transcription** of the packet name (the anchor that identifies which packet this directory belongs to).
19
+ - The information source is limited to the target packet (Why/Scope/Expected Behavior/Safety) and the compass's Invariants.
20
+
21
+ ### `.intent/cc-sdd/<packet-slug>/design.md`
22
+ - **Hints to prevent oversights (bullets)** for when cc-sdd generates the design. Not the main body.
23
+ - Origin: the packet's Scope/Non-scope/Rollback + the compass's technical-constraint Invariants. Perspectives: responsibility boundaries, dependency direction, side effects, migration/rollback, risk, technical constraints (if the compass Invariants include technology-stack, infrastructure, or license constraints, transcribe them into the hints so that cc-sdd's design technology selection does not deviate from them).
24
+
25
+ ### `.intent/cc-sdd/<packet-slug>/tasks.md`
26
+ - Place an **"Intent-derived constraints" section** (a summary of parent intent / invariant / Anti-direction) at the top.
27
+ - After that, cc-sdd's tasks-generation check items (characterization test / migration slice / each task's invariant reference).
28
+ - Origin: the packet's Validation/Rollback + parent intent + the compass's Invariants/Anti-direction.
29
+
30
+ ## Output layout (slug rule and collision rule)
31
+
32
+ ### Slug rule (deterministic)
33
+
34
+ Derive the directory name (slug) from the packet name **deterministically** in the following order. The same packet name always yields the same slug.
35
+
36
+ 1. Apply NFC normalization.
37
+ 2. Trim leading/trailing whitespace.
38
+ 3. Lowercase ASCII uppercase letters.
39
+ 4. Replace whitespace and path-dangerous characters (`/ \ : * ? " < > |`) with `-`.
40
+ 5. Collapse consecutive `-` into one.
41
+ 6. Strip leading/trailing `-`.
42
+
43
+ - Non-ASCII characters (Japanese etc.) are preserved as-is.
44
+ - If the result is an empty string, use `unnamed-packet` as the slug and notify the user.
45
+
46
+ ### Collision rule
47
+
48
+ - A collision occurs only when the slug matches an existing directory AND that directory's requirements.md `## Source Packet` heading names a **different** packet. Assign a numbered alternative starting at `-2`, and notify the user of the packet-name → directory-name mapping. Never silently overwrite.
49
+ - If `## Source Packet` names the **same** packet, it is not a collision but a re-export: update the drafts in that same directory in place.
50
+
51
+ ## Propagation to impl (strategy X)
52
+
53
+ - Write the tasks hints at the granularity of "**invariant references tied to individual tasks**".
54
+ - Aim: that parent intent and invariants are **transcribed** into each task of the main `tasks.md` that cc-sdd generates. This lets an impl subagent that is invoked in a different session without reading `.intent/` still reference the invariants / Anti-direction via the cc-sdd deliverable (tasks.md).
55
+ - **Responsibility boundary**: intent-planner's responsibility goes only as far as "passing hints in a structure that is easy to transcribe". The actual transcription is left to cc-sdd's tasks generation (do not depend on cc-sdd's behavior). Complete transcription is **not a guarantee, but a probability maximized by structure**.
56
+
57
+ ## Invariants
58
+
59
+ - Do not complete **the main body** of cc-sdd's requirements/design/tasks (drafts/hints only).
60
+ - The tasks hints must always include references to parent intent and invariants.
61
+ - **Never write into another packet's directory** (write only under the target packet's slug directory).
62
+ - Do not intervene in cc-sdd's skills.
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: intent-export-openspec
3
+ description: Convert one chosen packet into a proposal draft + delta spec hints that can be handed to OpenSpec without wasting tokens. Does not intrude on OpenSpec's main generation. Can invoke /opsx:propose when instructed to proceed.
4
+ disable-model-invocation: true
5
+ allowed-tools: Read, Write, Glob, Grep, AskUserQuestion, Skill, Bash
6
+ argument-hint: <target packet name (optional)>
7
+ ---
8
+
9
+ # intent-export-openspec Skill
10
+
11
+ ## Core Mission
12
+ - **Success Criteria**:
13
+ - One target packet is converted into an OpenSpec proposal draft (Why/What Changes/Impact) + delta spec hints
14
+ - The input is limited to the target packet file + the compass's project-universal Invariants/Anti-direction, and the full Tree/Compass is not transcribed into OpenSpec
15
+ - The delta hints carry parent intent / invariant references, forming a propagation structure to impl
16
+ - The output is led by natural-language guidance, and `/opsx:propose` can be invoked when instructed to proceed
17
+ - The output is confined to `.intent/openspec/` and does not touch `.intent/cc-sdd/`
18
+ - No application code has been changed at all
19
+
20
+ ## Execution Steps
21
+
22
+ ### Step 1: Narrow down to one target packet
23
+ - Read `.intent/packets/index.md` and present the active packet candidates. If index.md is absent, build the candidate list directly from the frontmatter of the files under `.intent/packets/active/`, continue, and prompt regeneration of the index. If `.intent/packets/` itself is absent (or `active/` is empty), guide the user to "run `/intent-packets` first" and stop.
24
+ - If a packet is specified by argument, use it; otherwise narrow down to one from the candidates by priority or user confirmation, and read only the file of the confirmed target packet (under `.intent/packets/active/`) — do not bulk-read all packet files.
25
+ - **Draft guard**: when the confirmed target packet's `state` is draft, confirm via AskUserQuestion whether to "activate it and continue the export"; once the user approves, update the frontmatter `state` to active and regenerate `index.md` before continuing (never export a draft as is without confirmation; this activation is the only canonical write the export makes).
26
+ - Read `.intent/mode.local.md` (falling back to `.intent/mode.md` if absent) for the mode state. If both are absent, continue with the standard default and announce it.
27
+
28
+ ### Step 1.5: Enforcement gate (writeback freshness check)
29
+ - From the `## Enforcement (user-managed)` section of the `.intent/mode.md` read in Step 1, check the value of `enforcement`. If it is off, missing, or an invalid value (including mode.md being absent), skip this check and continue to Step 1.6 as today.
30
+ - When it is remind or gate, run `node .intent/scripts/intent-check.mjs` with Bash (a read-only script; it creates, modifies, and deletes no files) and follow its stdout.
31
+ - **Interpretation rules for the verdict line**: the stop decision is governed solely by `block=` on the first stdout line (do not re-derive or reinterpret). Whether a warning is needed is decided by `result=stale` or `pending>0`. Even when `result=not-applicable`, use the value of `pending=` from the verdict line as is.
32
+ - When gate and `block=yes`: present the grounds (the pending packet names and the elapsed commit count / threshold; quote intent-check's human-readable lines from the second line onward verbatim), stop the export, and guide the user to run `/intent-writeback`. Then confirm via AskUserQuestion whether to "proceed with the export anyway", and only when the user explicitly instructs to proceed, run the export with a warning attached (the escape hatch for false positives).
33
+ - When remind and a violation is detected (`result=stale` or `pending>0`): present the same grounds as a warning and continue without stopping.
34
+ - Only when intent-check itself cannot run (Bash unavailable, script absent, or exit 2): treat staleness as not-applicable, check `.intent/deltas.md` for pending Delta entries (those carrying `- Status: pending`) via Read/Grep, and enter the same branches above using that result as `pending`.
35
+
36
+ ### Step 1.6: Drift Check (drift-watch)
37
+ - Check the value of `drift-watch` in the `## Drift-watch (user-managed)` section of the `.intent/mode.md` read in Step 1. When it is not `on` (including off, unspecified, invalid value, missing section, or missing mode.md), do not perform this check; continue to Step 1.7 as today (byte-identical to current behavior).
38
+ - Only when it is `on`, read and apply `rules/drift-export-check.md`. The matching of the target packet's proposal/delta hints × compass (North Star / Anti-direction / Invariants), the named presentation of conflicts, appending a `stage: export` entry to drift-log, and resolving the outcome by the user's verdict are all delegated to the rule's procedure (do not duplicate the procedure here).
39
+ - This check is **warn-only and does not stop the export** (only the Step 1.5 enforcement gate can stop; drift-watch never stops because it assumes false positives).
40
+ - Order and orthogonality of the three checkpoints: **enforcement (procedure, may stop, Step 1.5) → drift-watch (direction, never stops, Step 1.6) → Open Questions (deadline, never stops, Step 1.7)**. Their inspection targets are orthogonal (procedure / direction / deadline).
41
+
42
+ ### Step 1.7: Confirm unanswered Open Questions
43
+ - Read and apply `rules/export-questions.md`.
44
+
45
+ ### Step 1.8: Preflight check of the OpenSpec prerequisite (warn only — do not stop)
46
+ - Observe read-only whether the **`openspec/` directory at the repository root** (the OpenSpec tool's marker) exists (Read/Glob; do not push this onto a mechanical check such as `intent-check.mjs`). It is **distinct from `.intent/openspec/` (this skill's own draft output directory)**; do not mistake the output directory for the prerequisite marker.
47
+ - When the repository-root `openspec/` is **absent**: **warn** that OpenSpec may not be set up. Guide: "The OpenSpec prerequisite (the `openspec/` directory at the repository root) was not found. Set up OpenSpec, or — if a readable artifact is the goal — the format-axis projection (an exit to a readable Spec) is also available." (The choice of exit follows the exit decision lane in `rules/export-route.md`; this SKILL does not name other export/projection skills' commands.) **Do not stop the draft generation** (continue to Step 2 onward).
48
+ - When the repository-root `openspec/` **exists**: emit nothing and continue to Step 2 (as before — no warn).
49
+ - This check is **warn only — it does not stop the export** (only the Step 1.5 enforcement gate can stop; the preflight follows drift-watch's false-positive-tolerant stance and does not stop — it does not foreclose adding `openspec/` later). Because OpenSpec's entry contract `/opsx:propose` cannot be observed read-only, the repository-root `openspec/` is used as a proxy marker for it being set up.
50
+
51
+ ### Step 2: Apply the mapping rules
52
+ - Read and apply `rules/map-openspec.md`.
53
+ - The input is only the one target packet file (including the packet-specific invariants in Safety / Invariants) + the project-universal Invariants/Anti-direction of `.intent/intent-compass.md` (do not read the full Tree or other packets. Only when direction is needed, reference a summary of Tree L0–L1).
54
+
55
+ ### Step 3: Generate the draft
56
+ - Write the drafts under the per-packet directory `.intent/openspec/<slug>/`. The slug derivation and collision handling follow the "Output layout" section of `rules/map-openspec.md`. Continuing to export multiple packets never overwrites another packet's directory.
57
+ - Write the proposal draft (`## Why` / `## What Changes` / `## Impact`) into `.intent/openspec/<slug>/proposal.md`, shaped so the minimal and always-valid "change description" text for `/opsx:propose` can be derived from its opening.
58
+ - Write the delta spec hint skeleton into `.intent/openspec/<slug>/spec-delta.md` (`## ADDED Requirements` by default + conditional `## MODIFIED Requirements` / `## REMOVED Requirements`, with the `### Requirement: <name>` / `#### Scenario: <name>` skeleton).
59
+ - Do not complete the OpenSpec main body. Keep the delta to a hint skeleton; the reconciliation and completion are delegated to OpenSpec (from `/opsx:propose` onward) (INV4). Always leave parent intent and invariant references in the proposal/delta.
60
+ - Once the drafts are generated, write the export record into a **per-packet split file** `.intent/export-log/<packet-slug>.md` (following CONTRACT "Split and archive convention for append-only records"; since both cc-sdd and openspec write to each packet's file under the same split convention, the old tail-append collision on "the single log shared across export targets" disappears structurally). Derive `<packet-slug>` from the packet name via the existing slug rule (`intent-packets/rules/packet-format.md`) — do not create new/sequential numbering. The file holds the same table header as the scaffold (`| packet | exported_at | commit |`) plus the row `| <packet name> | <export datetime (ISO 8601 UTC)> | <commit hash> |` (append a row if the file exists; do not erase past rows). Obtain the commit hash by running `git rev-parse --short HEAD` (read-only) with Bash; if it cannot be obtained, record `-`. Create the `.intent/export-log/` directory if absent.
61
+ - Then regenerate the old `.intent/export-log.md` as a **generated active mirror**: concatenate all data rows from `.intent/export-log/*.md` in `exported_at` ascending order and overwrite the mirror with the scaffold header + all rows (the split files are the source of truth; the mirror is derived, never hand-edited). This keeps single-file readers (status / validate / writeback / intent-check) from breaking. The mirror is folded in the later slice (wire) once reader cross-following is complete.
62
+
63
+ ### Step 4: Guide the handoff (natural-language led)
64
+ - The lead of the output is natural-language guidance: show the paths of the target packet's `.intent/openspec/<slug>/proposal.md` and `spec-delta.md` and confirm "may this be handed to OpenSpec as is".
65
+ - When the user instructs to proceed, read the minimal change description from the target packet's `.intent/openspec/<slug>/proposal.md` and invoke `/opsx:propose` with that as the argument (use `Skill`. Do not force the user to copy-paste).
66
+ - As a fallback, also include a copyable change-description block for `/opsx:propose` (not the lead).
67
+ - **Delegation goes only up to invoking `/opsx:propose`**. The subsequent apply / sync / archive workflows follow OpenSpec, and we do not push ahead automatically.
68
+ - **Make the return path explicit (the entry to the writeback phase)**: at the end of the guidance, add one line that once the OpenSpec implementation has gone around once (once learnings emerge from the reality of implementation), they are returned to the canonical deliverables via `/intent-writeback`. Do not settle for writing post-implementation learnings directly into the packet file as Evidence; always go through writeback (via a delta). This guidance makes the phase boundary explicit to the user: "pre-implementation drafting (compass/packets write canonical directly)" vs. "post-implementation extraction (writeback via a delta)".
69
+
70
+ ## Output Description
71
+ - The target packet's `.intent/openspec/<slug>/{proposal, spec-delta}.md` drafts (the `/opsx:propose` input proposal + delta hint skeleton)
72
+ - One export-record row appended to `.intent/export-log.md`
73
+ - The target packet file's `state` update and the regeneration of `.intent/packets/index.md` when a draft was activated (omitted when none apply)
74
+ - Confirmation result for unanswered `[by export]` questions (the questions presented and the user's decision; omitted when none apply)
75
+ - Confirmation of whether it may be handed to OpenSpec (natural-language guidance; the lead)
76
+ - Copy block for `/opsx:propose` (fallback; secondary)
77
+ - Points to confirm before implementation
78
+ - Return-path guidance after the implementation goes around once (return to canonical via `/intent-writeback`; do not settle for writing Evidence directly into the packet)
79
+
80
+ ## Safety & Fallback
81
+ - If `.intent/packets/` is absent (or `active/` is empty), stop and guide the user to `/intent-packets`.
82
+ - The absence of index.md does not stop; build the candidates directly from the files under `active/`, continue, and prompt regeneration of the index.
83
+ - The only canonical write is the draft-guard activation (`state` update + `index.md` regeneration), and only with the user's approval. Never rewrite intent-tree / intent-compass / packet bodies.
84
+ - The absence of mode.md does not stop; continue with the standard default and announce it.
85
+ - The enforcement check is fail-open: even when intent-check cannot run, do not block the export. The export stops only when enforcement is gate and the verdict line says `block=yes`, or when the unrunnable fallback finds pending deltas under gate; even then the user's explicit instruction to proceed lets it run.
86
+ - The Open Questions check is a confirmation, not a stop; the user's explicit instruction to proceed lets the export run.
87
+ - Do not complete the main body of OpenSpec's proposal / delta spec (drafts/hint skeleton only).
88
+ - Do not auto-invoke the OpenSpec workflow beyond `/opsx:propose` (apply / sync / archive, etc.).
89
+ - Confine the output to `.intent/openspec/` and do not write into `.intent/cc-sdd/`.
90
+ - Do not change application code (INV6. Invoking other skills is a concept distinct from INV6 and is allowed).