@c4a/context-cli 0.5.41-beta.6 → 0.6.0-alpha.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 (262) hide show
  1. package/README.md +115 -123
  2. package/babel.cjs +257 -0
  3. package/cli.js +51018 -96457
  4. package/docs/quickstart.md +85 -0
  5. package/package.json +3 -1
  6. package/plugin/.claude-plugin/plugin.json.template +1 -1
  7. package/plugin/.codex-plugin/plugin.json.template +5 -5
  8. package/plugin/.cursor-plugin/plugin.json.template +1 -1
  9. package/plugin/README.md +105 -85
  10. package/plugin/README_CN.md +92 -84
  11. package/plugin/commands/continue.md +34 -0
  12. package/plugin/commands/init.md +13 -130
  13. package/plugin/skills/skill-continue-workflow/SKILL.md +172 -0
  14. package/plugin/skills/skill-init-workspace/SKILL.md +74 -0
  15. package/plugin/skills/skill-package-output/SKILL.md +167 -0
  16. package/plugin/skills/skill-prose-align/SKILL.md +296 -0
  17. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  18. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  19. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  20. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  21. package/plugin/skills/skill-prose-compile/SKILL.md +265 -0
  22. package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  23. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  24. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  25. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  26. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  27. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  28. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  29. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  30. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  31. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  32. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  33. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  34. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  35. package/plugin/skills/skill-review-gate/SKILL.md +98 -0
  36. package/plugin/skills/skill-source-scope/SKILL.md +402 -0
  37. package/plugin/skills/skill-source-scope/references/capture-source.md +171 -0
  38. package/plugins/.agents/plugins/marketplace.json +20 -0
  39. package/plugins/.claude-plugin/marketplace.json +13 -0
  40. package/plugins/.cursor-plugin/marketplace.json +17 -0
  41. package/plugins/README.md +150 -0
  42. package/plugins/README_CN.md +136 -0
  43. package/plugins/VERSION +1 -0
  44. package/plugins/assets/icon.svg +3 -0
  45. package/plugins/assets/logo.svg +3 -0
  46. package/plugins/assets/workflow-en.png +0 -0
  47. package/plugins/assets/workflow.png +0 -0
  48. package/plugins/claude/.claude-plugin/plugin.json +16 -0
  49. package/plugins/claude/.generated +1 -0
  50. package/plugins/claude/CLAUDE.md +5 -0
  51. package/plugins/claude/README.md +5 -0
  52. package/plugins/claude/commands/continue.md +34 -0
  53. package/plugins/claude/commands/init.md +21 -0
  54. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +172 -0
  55. package/plugins/claude/skills/skill-init-workspace/SKILL.md +74 -0
  56. package/plugins/claude/skills/skill-package-output/SKILL.md +167 -0
  57. package/plugins/claude/skills/skill-prose-align/SKILL.md +296 -0
  58. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  59. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  60. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  61. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  62. package/plugins/claude/skills/skill-prose-compile/SKILL.md +265 -0
  63. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  64. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  65. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  66. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  67. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  68. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  69. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  70. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  71. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  72. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  73. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  74. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  75. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  76. package/plugins/claude/skills/skill-review-gate/SKILL.md +98 -0
  77. package/plugins/claude/skills/skill-source-scope/SKILL.md +402 -0
  78. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +171 -0
  79. package/plugins/codex/.codex-plugin/plugin.json +38 -0
  80. package/plugins/codex/.generated +1 -0
  81. package/plugins/codex/AGENTS.md +5 -0
  82. package/plugins/codex/README.md +5 -0
  83. package/plugins/codex/assets/icon.svg +3 -0
  84. package/plugins/codex/assets/logo.svg +3 -0
  85. package/plugins/codex/assets/workflow-en.png +0 -0
  86. package/plugins/codex/assets/workflow.png +0 -0
  87. package/plugins/codex/skills/continue/SKILL.md +47 -0
  88. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  89. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +74 -0
  90. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +167 -0
  91. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  92. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  93. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  94. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  95. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +296 -0
  96. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  97. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  98. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  99. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  100. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  101. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  102. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  103. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  104. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  105. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  106. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  107. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  108. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  109. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +265 -0
  110. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +98 -0
  111. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  112. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +402 -0
  113. package/plugins/codex/skills/init/SKILL.md +34 -0
  114. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +172 -0
  115. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +74 -0
  116. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +167 -0
  117. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  118. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  119. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  120. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  121. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +296 -0
  122. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  123. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  124. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  125. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  126. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  127. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  128. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  129. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  130. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  131. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  132. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  133. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  134. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  135. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +265 -0
  136. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +98 -0
  137. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  138. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +402 -0
  139. package/plugins/cursor/.cursor-plugin/plugin.json +29 -0
  140. package/plugins/cursor/.generated +1 -0
  141. package/plugins/cursor/AGENTS.md +5 -0
  142. package/plugins/cursor/README.md +13 -0
  143. package/plugins/cursor/assets/icon.svg +3 -0
  144. package/plugins/cursor/assets/logo.svg +3 -0
  145. package/plugins/cursor/assets/workflow-en.png +0 -0
  146. package/plugins/cursor/assets/workflow.png +0 -0
  147. package/plugins/cursor/commands/context-continue.md +38 -0
  148. package/plugins/cursor/commands/context-init.md +25 -0
  149. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +172 -0
  150. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +74 -0
  151. package/plugins/cursor/skills/skill-package-output/SKILL.md +167 -0
  152. package/plugins/cursor/skills/skill-prose-align/SKILL.md +296 -0
  153. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  154. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  155. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  156. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  157. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +265 -0
  158. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  159. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  160. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  161. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  162. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  163. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  164. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  165. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  166. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  167. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  168. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  169. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  170. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  171. package/plugins/cursor/skills/skill-review-gate/SKILL.md +98 -0
  172. package/plugins/cursor/skills/skill-source-scope/SKILL.md +402 -0
  173. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +171 -0
  174. package/plugins/skills/context-continue/SKILL.md +47 -0
  175. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  176. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +74 -0
  177. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +167 -0
  178. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  179. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  180. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  181. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  182. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +296 -0
  183. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  184. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  185. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  186. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  187. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  188. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  189. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  190. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  191. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  192. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  193. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  194. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  195. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  196. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +265 -0
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +98 -0
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +402 -0
  200. package/plugins/skills/context-init/SKILL.md +34 -0
  201. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +172 -0
  202. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +74 -0
  203. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +167 -0
  204. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  205. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  206. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  207. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  208. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +296 -0
  209. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  210. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  211. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  212. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  213. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  214. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  215. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  216. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  217. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  218. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  219. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  220. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  221. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  222. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +265 -0
  223. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +98 -0
  224. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  225. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +402 -0
  226. package/scripts/build-plugin.ts +70 -126
  227. package/plugin/commands/align.md +0 -71
  228. package/plugin/commands/capture.md +0 -113
  229. package/plugin/commands/compile.md +0 -103
  230. package/plugin/commands/context.md +0 -35
  231. package/plugin/commands/drop.md +0 -38
  232. package/plugin/commands/extract.md +0 -18
  233. package/plugin/commands/purge.md +0 -22
  234. package/plugin/commands/query.md +0 -22
  235. package/plugin/commands/status.md +0 -25
  236. package/plugin/skills/skill-align-workflow/SKILL.md +0 -110
  237. package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +0 -60
  238. package/plugin/skills/skill-align-workflow/references/density-profile.md +0 -16
  239. package/plugin/skills/skill-align-workflow/references/gates.md +0 -162
  240. package/plugin/skills/skill-compile-close/SKILL.md +0 -127
  241. package/plugin/skills/skill-compile-draft/SKILL.md +0 -175
  242. package/plugin/skills/skill-compile-draft/references/action-domain-gates.md +0 -34
  243. package/plugin/skills/skill-compile-draft/references/notes.md +0 -34
  244. package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +0 -71
  245. package/plugin/skills/skill-compile-draft/references/structural-challenges.md +0 -76
  246. package/plugin/skills/skill-compile-judge/SKILL.md +0 -112
  247. package/plugin/skills/skill-context-query/SKILL.md +0 -233
  248. package/plugin/skills/skill-drop/SKILL.md +0 -189
  249. package/plugin/skills/skill-semantic-reconcile/SKILL.md +0 -136
  250. package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +0 -31
  251. package/plugin/skills/skill-semantic-reconcile/references/mode-semantics.md +0 -41
  252. package/plugin/skills/skill-semantic-reconcile/references/scope-review-and-omit.md +0 -60
  253. package/plugin/skills/skill-semantic-reconcile/references/temporal-and-evidence.md +0 -58
  254. package/plugin/skills/skill-semantic-reconcile/references/user-confirmation.md +0 -71
  255. package/scripts/build-aspect-runtime.ts +0 -45
  256. package/templates/aspect-runtime/aspectRunnerSdk.js +0 -776
  257. package/templates/aspects/README.md +0 -517
  258. package/templates/aspects/code/README.md +0 -48
  259. package/templates/aspects/code/aspect.yaml +0 -21
  260. package/templates/aspects/design-system/README.md +0 -26
  261. package/templates/aspects/graphql/README.md +0 -24
  262. package/templates/aspects/openapi/README.md +0 -24
@@ -1,162 +0,0 @@
1
- # Node Classification Gates
2
-
3
- Use these gates before every candidate batch and before authoring the align payload requested by `next_action.input_schema`.
4
- Align owns Node type, tag, graph, planned Section, and ownership classification. It does **not** write Section prose.
5
-
6
- ## Node Type Order
7
-
8
- Answer in this order and stop at the first match:
9
-
10
- 1. **Action?** A large executable event / process with both:
11
- - scale: can support `planned_sections` with at least two distinct Section kinds, or contains at least one child Action;
12
- - process evidence: explicit steps, phases, trigger -> handling -> result, role collaboration, or repeatable plan. Parallel lists such as "three API modes" are not process evidence.
13
- 2. **Entity?** A concrete independent subject with retrieval value: deployable code, product/application/system, library/module/CLI/symbol, or an atomic term/pattern.
14
- 3. **Domain?** A container/scope that groups at least one child Node.
15
- 4. Otherwise do not create a Node; leave the material for compile as a Section under the owning Node.
16
-
17
- Good examples:
18
-
19
- | Type | Examples |
20
- |---|---|
21
- | `domain` | "X business domain", "Y technical area", "Z research topic" |
22
- | `entity` concrete | `@acme/api-server`, `@acme/ui-kit` `Button`, "X sub-application" |
23
- | `entity` term | "X identifier", "Y business metric", idempotency |
24
- | `action` | "user submits X request end-to-end flow", "operator executes Y change flow", "team Z release flow" |
25
-
26
- ## Title and Source Heading Rules
27
-
28
- Classify the Node by the evidence referent, not by the source file title, heading, or local section title. A source title is ordinary evidence just like body prose. It has no automatic right to become `node.title`, `aliases[]`, or `slug`.
29
-
30
- After choosing `node_type`, choose the title to fit that type:
31
-
32
- | Final type | Title shape |
33
- |---|---|
34
- | `entity` concrete | The concrete product, service, library, module, CLI, symbol, application, or system name. |
35
- | `entity` term | The atomic concept or pattern name, without extra scope/process suffixes. |
36
- | `domain` | The grouping scope that owns child Nodes. |
37
- | `action` | The executable process / runbook / flow name that passed the Action Gate. |
38
-
39
- Scope/process words in a source title are warning signals when proposed as an Entity title, not hard classification rules. Re-check the type/title when a proposed Entity title contains words such as "方案", "架构", "体系", "演练", "流程", "策略", "能力", "机制", "framework", "architecture", "system", "strategy", "process", or "drill". Keep the wording only when evidence shows it is the formal name of a concrete object or an atomic term.
40
-
41
- Do not promote broad architecture/system/方案 content to `domain` just because it sounds like a scope. When the source has writable Sections but no resolvable current/existing child Nodes, use an Entity such as `[system]` or `[application]` and put the architecture facts in Sections. Use `domain` only when it groups child Nodes through `domain_gate.child_refs`.
42
-
43
- Relation-only sources should not force title copying or dangling graph edges. Decide placeholder handling in this order:
44
-
45
- 1. If resolved current/existing child Nodes make the page a real grouping scope, preserve it as a no-write Domain.
46
- 2. If an explicit user-facing retrieval need or graph need makes the source/page identity valuable, and the title names an atomic concept or concrete object, preserve it as a no-write Entity with root-level `planned_sections: []`. This priority still applies when all child refs are unresolved/deferred; keep those target hints pending rather than writing dangling graph refs.
47
- 3. Otherwise, skip navigation-only / placeholder-only material and classify its coverable blocks, usually as `ignored`.
48
-
49
- Do not put `planned_sections` inside `domain_gate`. A kept placeholder needs support: `context_only` block(s) with `visible_to`, owned/shared evidence, or finalized graph support. `ignored` blocks only dispose unused material and do not support close materialization by themselves. For Domain placeholders, write only resolved current/existing children in `domain_gate.child_refs`; if all children are unresolved/deferred relation clues, use `child_refs: []` and keep those target hints in pending relation refs. If the source names only an atomic concept and that term is useful on its own, prefer a concise term Entity title without scope/process suffixes.
50
-
51
- For no-write placeholder summaries, describe only the preserved page identity and unresolved navigation clues. Do not say the Node "provides navigation/links/relations to X" unless those targets are resolved graph children or rendered links; say the source contains deferred navigation clues instead.
52
-
53
- ## Entity Tag Rules
54
-
55
- Use `tags` to state what the Entity is. Legal combinations:
56
-
57
- | Case | Tags |
58
- |---|---|
59
- | Runtime/code object | one A tag: `app`, `service`, `lib`, `cli`, `module`, or `symbol` |
60
- | Product-analysis object | one B tag: `application` or `system` |
61
- | Code + product object | one A tag plus one B tag |
62
- | Pure term / pattern | only `term` |
63
-
64
- `term` is mutually exclusive with A/B tags. React is `[lib]`, not `[lib, term]`; if a separate term entry is useful, create another Entity tagged `[term]` and let compile use Section-local `refers_to_nodes[]`.
65
-
66
- ## Action Gate
67
-
68
- Use `node_type: action` only after the Node Type Order says action. Fill `action_probe` and `action_gate`.
69
-
70
- `action_probe` still uses the five schema booleans, but the semantic bar is:
71
-
72
- | Field | Meaning | Evidence rule |
73
- |---|---|---|
74
- | `has_steps_or_phases` | Process evidence exists: steps, phases, trigger -> handling -> result, role collaboration, or repeatable plan. | Hard requirement; support it from block evidence. |
75
- | `has_actor_or_role` | A user, system, operator, service, or role performs the work. | May be inferred; record the source. |
76
- | `has_outcome_or_goal` | The process has a target result, acceptance condition, or operational goal. | May be inferred; record the source. |
77
- | `is_repeatable_or_planned` | The work is repeatable, scheduled, policy-like, or intentionally planned. | May be inferred; record the source. |
78
- | `queries_answerable_with_refs` | The Node can answer how/when/who/what-to-do questions from cited blocks. | May be inferred; record the source. |
79
-
80
- Do not emit an Action for a single sentence, a one-off conclusion, a short operation, or a parallel enumeration. Those become Sections under the owning Entity or Domain.
81
-
82
- Action anti-examples:
83
-
84
- | Candidate | Correct routing |
85
- |---|---|
86
- | "migrate to X tool" as one conclusion | `decision` Section under the owning Entity |
87
- | "component X usage" as one sentence | `description` + maybe `example` under X |
88
- | "submit -> validate -> generate" as one unexpanded sentence | `spec` Section under X/Y |
89
- | "three API call modes" | `comparison`, `spec`, or `description` Section; not Action |
90
-
91
- ## Fake Entity Gate
92
-
93
- A relationship-style title is only suspicious by itself. Downgrade or change type when at least **two** signals are true:
94
-
95
- 1. Title contains relationship language such as "X impact on Y", "Y under X", "Y side of X", "X migration", or "X collection".
96
- 2. No legal Entity tag fits.
97
- 3. The Node does not stand alone away from its upstream Node.
98
-
99
- Repairs:
100
-
101
- | Pattern | Repair |
102
- |---|---|
103
- | "X impact on Y" | Section under X with `refers_to_nodes: [Y]` |
104
- | "Y under X condition" | Section under Y; X is a condition in the Section body |
105
- | "X subsystem migration" | Action only if it clears the Action Gate; otherwise `decision` Section under X |
106
- | "X error collection" / "X FAQ collection" | `faq` / `incident` Sections under X |
107
-
108
- ## Domain Gate
109
-
110
- Use `node_type: domain` only for a scope that groups child Nodes. Fill:
111
-
112
- | Field | Meaning |
113
- |---|---|
114
- | `scope_blocks[]` | Blocks that describe the scope boundary or grouping. |
115
- | `child_refs[]` | Candidate ids, local refs, or final slugs for children in the scope. |
116
- | `grouping_reason` | Why these children belong together under this domain. |
117
-
118
- If a domain has no resolvable child refs, no clear grouping reason, or only one same-file child without a broader scope, do not emit a Domain. For navigation-only / placeholder-only sources with only deferred children, skip the Node after ruling out standalone retrieval or graph value for an atomic-term or concrete Entity; still classify that source's coverable blocks with a source-wide `ownership_groups[]` rule, usually `ignored` for pure placeholders. Emit an Entity only when evidence names an atomic term or concrete object and choose its Entity tag yourself. The CLI rejects invalid Domain gates; it does not auto-downgrade a Domain or choose fallback tags.
119
-
120
- Scope-name titles such as "X 业务域", "Y 领域", "business domain", or "technical area" are a warning sign when proposed as Entity. Keep them as Entity only when the subject is an atomic term or concrete object; otherwise use Domain with `domain_gate.child_refs`.
121
-
122
- ## Inference Sources
123
-
124
- `action_gate.inference_sources` is required and must be a structured object with four keys:
125
-
126
- ```yaml
127
- inference_sources:
128
- actor:
129
- source_type: explicit-block
130
- evidence_blocks: [7a6f4c9d2e10]
131
- rationale: "The block names the operator role."
132
- outcome_or_goal:
133
- source_type: inferred-from-block
134
- evidence_blocks: [7a6f4c9d2e10]
135
- rationale: "The block describes recovery as the expected result."
136
- repeatability_or_plan:
137
- source_type: heading-and-block
138
- evidence_blocks: [7a6f4c9d2e10]
139
- rationale: "The runbook heading and ordered list indicate planned reuse."
140
- answerability:
141
- source_type: explicit-block
142
- evidence_blocks: [7a6f4c9d2e10]
143
- rationale: "The steps answer how the operation is performed."
144
- ```
145
-
146
- Allowed `source_type` values:
147
-
148
- | Value | Use when |
149
- |---|---|
150
- | `explicit-block` | The evidence block directly states the signal. |
151
- | `heading-and-block` | The heading plus block text together support the signal. |
152
- | `ref-node` | An existing or same-decision Node reference supplies the signal. Include `ref_nodes`. |
153
- | `inferred-from-block` | The signal is inferred from block content. Keep the rationale short and concrete. |
154
-
155
- Each source must include `rationale` when inferred and at least one of `evidence_blocks[]` or `ref_nodes[]`.
156
-
157
- ## Final Reflection
158
-
159
- - Entity cannot pick a legal tag, or depends on its upstream title to make sense -> write it as a Section under the upstream Node or change type before submit.
160
- - Action only supports one Section -> write it as a Section instead of an Action. The discriminator is scale, not the presence of "step" words.
161
- - Action "steps" are parallel options/configs -> route to Entity `comparison` / `spec` / `description`.
162
- - Domain has no children -> delete it or merge it into a larger Domain.
@@ -1,127 +0,0 @@
1
- ---
2
- name: skill-compile-close
3
- description: >
4
- Packaged skill invoked by `/context:compile`; not a user slash command. Runs after every draft
5
- iteration. Triggers `context compile close`, which in one invocation
6
- refreshes locator-only evidence, canonicalizes source refs, compacts and verifies the final workspace,
7
- rebuilds the knowledge index, appends a changelog
8
- entry, rebuilds section fingerprints + incremental cache, and
9
- archives compile scratch files. Agent intervention is
10
- limited to interpreting the CLI's output and routing any verify
11
- error back to its upstream command (`/context:compile` for Section
12
- issues, `/context:align` for structural issues, `/context:drop`
13
- for dropped-source references). The skill never hand-edits rendered knowledge.
14
- Activates once all draft actions are applied and before user-visible
15
- success is declared.
16
- tools:
17
- - Bash
18
- ---
19
-
20
- # skill-compile-close — global verify + index + changelog
21
-
22
- Close a compile run. The CLI does the work; the skill reads the
23
- CLI's output and routes any failure back to the correct upstream
24
- command. It does not hand-edit rendered knowledge.
25
-
26
- ## TL;DR — Non-negotiables
27
-
28
- - CLI-driven. `context compile close` performs deterministic close writes first (locator refresh, source_ref canonicalization, compact, index/changelog), verifies the final workspace, then rebuilds section fingerprints + incremental cache and archives compile scratch files. Use the command's stdout + exit code; that's the close's full output.
29
- - **Agent NEVER edits rendered knowledge from the close stage.** The CLI is the sole writer for articles, the index, and the changelog. If verify reports an error here, route it back, not around:
30
- - Content / Section issues (`invalid-section-mount`, `body-ad-hoc-heading`, `dangling-source-alias`) → user re-runs `/context:compile` (draft loop fixes its own Section actions; the close stage does not patch)
31
- - Structural issues (`contains-cycle`, `edge-dangling-node`, `duplicate-slug`, `invalid-node-type`, `domain-same-file-child`) → user runs `/context:align` to revise the plan
32
- - Source issues (`dropped-source-reference`) → user runs `/context:drop <id>` to complete the drop
33
- - Exit 0 → summarise node/section totals, verify, `recompiled`, `locator_updates`, `rebuilt`, fingerprint rebuild count, archive status / archived file count, and any `ready_with_debt` coverage warnings when printed. If the close receipt reports severely low coverage, surface the returned `--cover-uncovered-only` command as the recommended repair before treating the debt as accepted.
34
- - Exit 2 → report the full issue list verbatim + point at the right re-entry command above. Do not hand-open the affected rendered article.
35
- - Coverage warnings are CLI-owned diagnostics. `ready_with_debt` means close succeeded and unresolved coverage remains visible. For severely low coverage, recommend one `--cover-uncovered-only` repair pass unless the user explicitly accepts the debt; otherwise report the warning and follow returned coverage view commands / `available_actions[]` only if the user chooses a repair or skip round.
36
- - Coverage and engagement denominators count primary citable content evidence. URL/reference-only, marker, frontmatter, embed, navigation, and context-only evidence is excluded or bucketed as non-blocking bookkeeping by the CLI.
37
- - Materialized knowledge means either a CLI-written knowledge article, or an explicit no-write placeholder from align: `planned_sections: []` plus source/context/graph support. A compile skip action records reviewed evidence, but it does not by itself materialize an arbitrary finalized Node.
38
- - If close is blocked only because finalized block ownership/support is wrong, use `context compile repair ownership --input - --format json` with `align.ownership-patch.v2`. This keeps the active compile workflow and completed node progress. Do not abandon compile just to run `context align patch ownership`.
39
- - Never re-run `context compile draft` from close to paper over verify failures. Draft failures belong in the draft loop.
40
- - Do not use Python, Node.js, shell scripts, `ls`, `find`, `rg`, `cat`, or similar ad-hoc commands to inspect `WORKSPACE_DIR`, `.context`, knowledge files, or `/tmp` workflow artifacts.
41
- - Derivable files self-heal: missing `_index.md` or `changelog.md` is rebuilt inside `context compile close` before the append, locator-only source moves are refreshed, non-canonical but hash-valid `source_ref` locators are canonicalized, and high-signal coverage candidates already backed by active Sections are marked covered. No pre-check needed.
42
- - LLM-assisted repair (`--fix-with-llm`) is not available in the current release.
43
- - Output language: summary prose matches the user's language; CLI output, issue codes, file paths stay as printed.
44
- - Successful close archives CLI scratch artifacts through the output lifecycle and rebuilds the user-level incremental cache. Current align state is internal CLI state, not a file protocol. The CLI owns this lifecycle — the agent must not move, delete, or archive workspace output files by hand.
45
- - Semantic decisions are applied and recorded before close. Compile-close does not judge or rewrite semantic decisions; it only verifies the already-applied workspace and rebuilds derived indexes.
46
-
47
- <reference>
48
-
49
- ## Stages inside `context compile close`
50
-
51
- Close is one in-process command with one exit code:
52
-
53
- 1. **Coverage guard with self-heal** — drops stale candidates and treats high-signal candidates already backed by active Sections as covered.
54
- 2. **Locator refresh** — if evidence moved but block hashes are unchanged, updates only section locators.
55
- 3. **Source ref canonicalization** — if a Section `source_ref` resolves to the same raw evidence block but has a stale anchor/range rendering, rewrites it to the canonical locator.
56
- 4. **Workspace compact** — re-renders every knowledge article canonically (Section order, frontmatter field order, `## Contains` list ordering, heading depth).
57
- 5. **Rebuild knowledge index** — regenerates the index from the current workspace state; previous content overwritten.
58
- 6. **Append changelog** — appends one compile list item to the changelog; existing entries preserved.
59
- 7. **Workspace verify** — runs the full rule set against the final close output. Any error flips exit to 2 and close rolls back its writes.
60
- 8. **Rebuild incremental cache** — rebuilds section fingerprints and cache indexes from workspace truth sources.
61
- 9. **Archive scratch files** — moves CLI-owned context/draft/prepare/review scratch payloads into the output archive lifecycle.
62
-
63
- ## Outcome routing
64
-
65
- | Outcome | Agent action |
66
- |---|---|
67
- | Exit 0, 0 issues | Summarise those counts in the user's language: Nodes touched; Sections added / updated / superseded / deprecated / skipped; `recompiled`; `locator_updates`; `rebuilt`; verify green. Stop. |
68
- | Exit 0, warnings only | Summarise + list warnings verbatim. For severely low coverage, recommend the CLI-returned `--cover-uncovered-only` repair command before final acceptance; for other coverage warnings, surface returned coverage view commands / `available_actions[]` instead of inventing a local decision matrix. |
69
- | Exit 2, Section / content issue | Surface the full issue list; point the user at re-running `/context:compile` (the draft loop owns Section writes). Do NOT Edit the affected rendered article. |
70
- | Exit 2, `compile-close-finalized-node-missing-knowledge` | If the missing Node has real citation evidence, point the user at `/context:compile` for that Node. If it is intentionally navigation-only or placeholder-only and only block ownership/support is wrong, use `context compile repair ownership --input - --format json` to make support explicit with `context_only` + `visible_to` or owned/shared evidence. `ignored` blocks do not support the placeholder by themselves. If the Node itself is structurally wrong, route back to `/context:align` after the active compile workflow is resolved. |
71
- | Exit 2, structural issue (cycle, duplicate slug, `invalid-node-type`, `domain-same-file-child`) | Surface the full issue list; point the user at `/context:align` to revise structure. Do not re-run compile. |
72
- | Exit 2, `dropped-source-reference` | Surface the source-id; point the user at `/context:drop <id>` to complete the drop cleanup. |
73
-
74
- The close stage never edits rendered knowledge on the agent side. Every verify error routes back to the correct upstream command (compile / align / drop), never sideways into a hand Edit. Use the CLI issue code and hint printed by `context compile close` for the error→command mapping.
75
-
76
- ## Changelog entry shape
77
-
78
- `context compile close` appends one markdown list item per run to
79
- the changelog with aggregate counts — not a multi-line
80
- block:
81
-
82
- ```
83
- - [compile] nodes=N sections=M recompiled=R locator_updates=L @ <ISO timestamp>
84
- ```
85
-
86
- `[drop]` lines from `/context:drop` follow the same single-line list-
87
- item convention (see the drop skill for the exact shape).
88
-
89
- </reference>
90
-
91
- <procedures>
92
-
93
- ### Step 1 — Invoke close
94
-
95
- Run `context compile close`. The caller (typically `/context:compile`) may have already invoked it; check for existing output before re-running.
96
-
97
- ### Step 2 — Interpret
98
-
99
- Use stdout + stderr. The exit code selects the path via [Outcome routing](#outcome-routing).
100
-
101
- ### Step 3 — Route errors to the correct upstream command
102
-
103
- For each error in the CLI's report, classify via [Outcome routing](#outcome-routing) and name the re-entry command in your report. Do NOT hand-edit rendered knowledge — that violates the CLI-sole-writer principle and masks the real upstream fix. Specifically:
104
-
105
- - Section / content issue → user re-runs `/context:compile` (draft loop produces new Section actions; the CLI re-writes).
106
- - `compile-close-finalized-node-missing-knowledge` → content Nodes go back through `/context:compile`; ownership-only placeholder support fixes use `context compile repair ownership --input - --format json`; structural Node changes still go through `/context:align` after the active compile workflow is resolved.
107
- - Structural issue → user runs `/context:align` (revise the plan; re-compile afterwards).
108
- - `dropped-source-reference` → user runs `/context:drop <id>` to finish drop cleanup.
109
-
110
- One pass. If the CLI reports multiple errors, list them all and let the user choose the order; do not loop the close stage itself.
111
-
112
- ### Step 4 — Report
113
-
114
- Summarise in the user's language:
115
-
116
- - Nodes touched and counts per op (add / update / supersede / deprecate / skip / locator-only).
117
- - Knowledge index rebuilt / updated; changelog appended at `<timestamp>`.
118
- - Incremental close counts printed by the CLI: `recompiled`, `locator_updates`, `canonical_source_ref_updates`, `rebuilt`, and section fingerprint rebuild count.
119
- - Verify result: green / `<n>` warnings / `<n>` errors (issue codes verbatim).
120
-
121
- Stop. Do not auto-invoke follow-on commands.
122
-
123
- ### Step 5 — Final guardrails
124
-
125
- Run close once, surface every error with its re-entry command, and never inspect or edit rendered knowledge outside the CLI.
126
-
127
- </procedures>
@@ -1,175 +0,0 @@
1
- ---
2
- name: skill-compile-draft
3
- description: >
4
- Packaged skill invoked by `/context:compile`; not a user slash command. For one Node at a time, reads
5
- the CLI-provided `NodeContext` (planned metadata, raw snippets, and
6
- existing Sections if any), classifies every raw fragment into a Section
7
- kind via the priority chain, writes source-bound actions with `kind`,
8
- optional `summary` / `content`, and `source_block_ids[]`,
9
- and emits a compile draft JSON document for the caller to submit to the current envelope's
10
- `next_action.command`.
11
- Activates when `/context:compile` iterates across the confirmed align plan.
12
- tools:
13
- - Bash
14
- ---
15
-
16
- # skill-compile-draft — write Section actions for one Node
17
-
18
- Classify raw evidence for one Node into `add` / `skip` (and on refresh: `update` / `supersede` / `deprecate`) actions; emit JSON; the CLI performs every write.
19
-
20
- ## TL;DR — Non-negotiables
21
-
22
- - One Node per invocation — `node_slug` MUST equal `node.slug`; no cross-Node writes. Finish the current Node's draft quality checks before the caller moves to another Node's review/apply loop.
23
- - Agent emits JSON only; no markdown, no direct workspace file writes. The caller submits the JSON to the current envelope's `next_action.command`; the CLI validates and stores workflow payloads.
24
- - Evidence boundary: treat the CLI-provided NodeContext and evidence views as complete. Cite only block ids surfaced as citation-eligible in `source-refs-index` `items[]`, `citable_source_refs[]`, or `raw_snippet_indexes.citation_eligible`; treat `supporting_context_refs[]`, `context_only`, and secondary-shared snippets as background. `request_full_text` may expose visible text for inspection through the narrow text view (`context compile context <slug> --request-full-text <block_id> --view text --format json`), and it does not change citation eligibility. If supporting/context-only evidence is needed as a citation, emit `pending_ownership_challenge` or `structure_challenge` — see [references/structural-challenges.md](references/structural-challenges.md). Never `grep` / `sed` / `jq` / `cat` / `head` raw `--format json` stdout or workflow scratch files in `/tmp` or `.context/.cache/`; use semantic views and follow returned `next_command` / `how_to_explore[]`. For write commands that take `--payload-digest`, omit the flag unless the CLI explicitly asks for a stale guard. When an explicit digest is needed, use `context workflow show --payload <name> --digest-only --format text`; do not parse JSON stdout to recover it.
25
- - Actions are candidate write actions, not final semantic decisions; `context reconcile prepare` re-derives near-duplicate / conflict / merge relations from `candidates[]` on its own. Op naming is scoped by schema: compile-draft `actions[]` already targets Sections, so Section lifecycle ops are verb-only (`add`, `update`, `supersede`, `deprecate`, `skip`). Do not use align-style names such as `add_section`, `write_section`, or `propose_section`.
26
- - Citation validation passing is not completion. Before emitting, estimate coverage from the provided `raw_snippets[]`: if there are 3+ citation-eligible snippets, a one-action draft is valid only when the later snippets are duplicates, navigation, placeholders, or continuations of the same fact. Small dense docs still need multiple actions when later snippets state distinct capabilities, constraints, examples, risks, FAQ, or usage notes. Large manuals/design docs should compile to several orthogonal actions in the same draft. Do not switch into "speed mode" because the first action validates; coverage is part of the draft task.
27
- - Pick `kind` from the CLI's `context schema compile-draft` contract, especially `section_kind_priority` and the mount matrix. Treat kind precision as a drafting quality preference, not a reason to loop forever when the CLI accepts the write. A `decision` fits when the source explicitly records a choice, tradeoff, adopted path, or policy conclusion with a reason; multiple surfaced alternatives are a strong signal but not required. Bare rules or checks without a recorded choice are usually `spec`. Reach `description` only after every more specific kind fails.
28
- - `node.planned_sections[]` is an align-time scaffold hint, not a hard completion gate. Prefer a planned kind when the evidence fits; if a source-backed stronger kind differs, emit it and let the CLI warning guide review.
29
- - `kind × node.type` must satisfy the CLI Section mount matrix; mismatches get rejected at write time. When the strongest kind is blocked by mount matrix, fall to the next legal kind whose form actually fits — do not collapse to `description` just because it mounts everywhere, and do not invent thin precision (e.g. one-line `spec`) just to avoid `description` either. See [Description anti-abuse gates](#description-anti-abuse-gates) for the classification checks at the description boundary.
30
- - Every write action cites raw via `source_block_ids[]` from `source-refs-index` `items[].block_id` or `citable_source_refs[].block_id`; the CLI expands it to canonical `source_refs[]` before saving. Use explicit `source_refs[]` only when the CLI gives no block id for the needed citation. Multiple ids/refs in one action must be one contiguous citation-eligible run from the same source; split around any intervening citation-eligible block used by another action. Never mix both fields in one action, fabricate ids, or cite navigation-only blocks as evidence for a content Section.
31
- - For large source-ref views, prefer the returned `source_refs_index_command` / `source_refs_command` / `--view source-refs-index` when you only need block ids; open `source_refs_detail_command` only when you need quote preview or explicit `source_refs[]`. Treat `--draft-scaffold` as a compact action skeleton for large Nodes; use returned full-text/detail commands for only the blocks an action needs.
32
- - `content` is optional and omitted by default on source-backed writes. If the cited raw block is already the right reader-visible text, cite it with `source_block_ids[]` / `source_refs[]` and let the CLI mirror raw into content. Write `content` only for an intentional source-faithful reader-surface rewrite, such as translation, structural reorganization, or preserving a table, list, command, config, or code fence that would otherwise be unclear. Add `summary` when it helps readers/query output; summary is recall text, not evidence. The CLI rejects retired fields (`body`, `detail`, `raw`, singular `source_ref`, quoted-evidence) with canonical repair hints — read those hints rather than memorising the blacklist. Omit optional fields when empty.
33
- - Preserve user-facing Markdown structure from cited raw when it carries meaning: inline code/code fences, Markdown links and URLs, blockquotes, list nesting, tables, and emphasis around key terms. Summary remains plain text; content may keep raw Markdown when that is the clearest faithful Section text. Do not patch solely for style cleanup unless the cited source meaning is materially lost.
34
- - Do not synthesize a user-facing prefix by concatenating `heading_path` values (for example, `Parent - Child:`) when that prefix is not in the cited raw. Use headings only to choose grouping and framing; if a heading's wording is itself useful, keep it as sourced content only when it appears in the cited block text.
35
- - Preserve source-backed URLs, code identifiers, `source_ref`, or `block_id` literals when they are part of the reader-facing knowledge or a repair challenge. Do not rely on memorized URL rules, and do not add literals only for scoring or traceability.
36
- - `refers_to_nodes[]` only carries known slugs. Prefer already materialized or compiled target Nodes; in first-pass compile, skip a slug that is only known from the current align plan and not yet materialized unless the CLI explicitly surfaces it as safe or needed. Never invent a slug.
37
- - `skip` is the honest default when raw adds nothing. Bare `skip` (no evidence) is only for deterministic no-ops such as unchanged input, pure navigation, or context-only/background snippets; empty `source_block_ids[]` / `source_refs[]` on skip is treated as bare skip. When a citation-eligible snippet was reviewed and intentionally not written, emit `skip` with `source_block_ids[]` from `source-refs-index` `items[].block_id` or `citable_source_refs[].block_id` so semantic review can record `reviewed_no_write`. Never attach `context_only` / supporting block ids to skip; raise a challenge if they should become citation evidence.
38
- - Any Node may legitimately compile to no Sections when the provided snippets contain only navigation (`Parent` / `Children` / `Related` / `Relations`) or placeholder text that explicitly says no detailed content is available. Emit `skip`; do not turn align summaries, parent/child lists, sibling links, or placeholders into `description` Sections. The align graph and Node metadata preserve structure; narrow context-only navigation/reference blocks may be rendered later as a `References` auto-block, while active Sections still need citation-eligible content.
39
- - FAQ collections attach to the most specific finalized Node (Entity → Action → Domain fallback); never create a standalone FAQ container.
40
- - Output language: Node-facing summaries and user-facing draft explanations follow `NodeContext.generation_policy.language` when present; otherwise match the raw material. Section `summary` is reader/query aid: write Chinese summary prose for clearly Chinese cited evidence or mirrored content; English summary prose is acceptable for clearly English evidence; mixed technical evidence may keep concise mixed-language terms. Do not patch an already clear stored summary solely to switch language, but do not draft English prose summaries for Chinese evidence. Draft `content` is source-bound: prefer the cited source language when it differs from the workspace language, and do not translate quoted English facts into Chinese just to satisfy workspace language. Preserve product names, code identifiers, CLI flags, slugs, `block_id` / `source_ref` tokens, and exact quoted evidence as printed. Kind / confidence / identifier fields stay English.
41
- - Stable output: keep action order aligned with evidence order — that ordering is the only stability concern the CLI cannot enforce. The CLI rejects unknown fields (timestamps, random ids, host/scratch paths) and canonicalises stored payloads; fixed rules and schema come from this skill, so only the current NodeContext should vary between repeated Node draft calls.
42
-
43
- ## Edge cases — consult references when:
44
-
45
- | Condition | Reference |
46
- |---|---|
47
- | `node.type` is `action` or `domain` | [references/action-domain-gates.md](references/action-domain-gates.md); use `node.action_gate` (including `trigger_blocks`) and treat `node.domain_gate` as grouping metadata |
48
- | any `raw_snippets[].source_type` is `"note"` | [references/notes.md](references/notes.md) |
49
- | `existing.sections[]` non-empty, **or** `incremental.status` is `unchanged` / `full-context`, **or** `incremental.locator_only_changes[]` non-empty | [references/refresh-and-update.md](references/refresh-and-update.md) |
50
- | evidence implies missing Action / wrong parent / `depends_on` gap / ownership upgrade from `context_only` or secondary-shared | [references/structural-challenges.md](references/structural-challenges.md) |
51
-
52
- If none of the above hold, you are on the main path (first compile of an entity Node with default `changed-only` incremental status). The procedure below covers that path end-to-end.
53
-
54
- <reference>
55
-
56
- ## Input — `NodeContext`
57
-
58
- Canonical shape: `context schema node-context --format yaml` (or `--format json`). The CLI is the source of truth for fields, enums, and produced-by paths.
59
-
60
- Boundary recap (rules not captured by the schema enums):
61
-
62
- - `mentions[]` are raw positions that named this Node; `raw_snippets[]` are the wider context blocks around those positions, or the changed raw blocks selected by `context compile scan`. These two arrays are the evidence floor — never reach outside them.
63
- - `node.sources[]` are the only sources that may be cited as `src-N`. `node.context_sources[]` contribute `raw_snippets[]` for comparison or background only and must not be cited unless the CLI has also placed that source in `node.sources[]`.
64
- - `source_id` is the source registry id (e.g. `local:billing`); `src-N` aliases only appear inside `source_ref` strings. Prefer `source-refs-index` `items[].block_id` or `citable_source_refs[].block_id` in draft `source_block_ids[]`; if you must use explicit `source_refs[]`, copy `raw_snippets[].source_ref` verbatim.
65
-
66
- ## Output — Compile Draft JSON (main path)
67
-
68
- Canonical shape: `context schema compile-draft --format yaml` (or `--format json`). The CLI is the source of truth for fields, enums, and validation — do not memorise the shape from this file.
69
-
70
- Main-path ops are **`add`** and **`skip`**. A typical new Section action is `{ op: "add", kind: "<chain-picked>", summary: "...", source_block_ids: ["<block_id>"] }`; omit `content` unless this action intentionally rewrites the cited raw for the reader. Never spell that as `add_section` because the `actions[]` array already names the target object. A bare skip is `{ op: "skip", reason: "..." }`; a reviewed-no-write skip carries `source_block_ids[]` only from citation-eligible `source-refs-index` `items[].block_id` or `citable_source_refs[].block_id`.
71
-
72
- Minimal valid draft envelope:
73
-
74
- ```json
75
- {
76
- "schema_version": "compile.draft.v2",
77
- "node_slug": "<matches node.slug>",
78
- "actions": []
79
- }
80
- ```
81
-
82
- `update` / `supersede` / `deprecate` ops live in [references/refresh-and-update.md](references/refresh-and-update.md). `structure_challenge` / `pending_ownership_challenge` ops live in [references/structural-challenges.md](references/structural-challenges.md). Do not emit them from the main path.
83
-
84
- `source_block_ids[]` is a mechanical shorthand over the same citation-eligible evidence; a single citation is still a single-element array. Treat `planned_section_groups[].draft_action_templates` as the align section scaffold. Keep hard citation-gap templates separate because non-contiguous evidence cannot form one source_ref; `heading_spans` and `local_headings` are facts for your judgment, not split commands. When one Section summarises contiguous multi-block evidence, list only the block ids the action actually consumes, and only when no citation-eligible block between them belongs to another action. If using explicit `source_refs[]`, copy them verbatim from `raw_snippets[].source_ref`. Preserve raw wording in `content` when it is already clear. Preserving a cited prose/bullet list as the Section's user-facing content is allowed when that list is the actual knowledge; the anti-pattern is copying raw text only as traceability padding. For `example` Sections that cite command / config / code fences, include the relevant fenced block in `content` only when writing reader-visible content. Inline command/code spans are not fences; if the cited raw is a numbered list or prose with inline code, keep that shape and do not synthesize a ```bash``` block or shell commands.
85
-
86
- ## Section Kind Choice
87
-
88
- Use `context schema compile-draft --view minimal --format json` (or yaml) for the current legal kind list, priority order, and mount matrix. This skill adds only semantic guardrails:
89
-
90
- - Stop at the first kind whose source-backed form fits.
91
- - Do not choose `description` to hide lists, rules, tables, samples, risks, choices, or Q+A evidence that has a more precise kind.
92
- - When the strongest kind is not mountable on this Node type, choose the next legal kind that the evidence truly supports, or `skip` with a structural challenge reason.
93
-
94
- Confidence is optional. Omit it for ordinary confirmed claims; set it only when the evidence is clearly verified, inferred, or speculative according to the schema enum.
95
-
96
- ## Description anti-abuse gates
97
-
98
- `description` is the kind for narrative claims that do not match any other form. Before locking in `kind: description` for a snippet, run three classification checks against the cited block:
99
-
100
- 1. **Atomicity**: single narrative, or multi-step / multi-row / multi-config? Multi → split into the right kinds — each step into its own `spec` / `warning`, each row into a `comparison` Section, each config block into `example` (sample) or `spec` (constraint with a check method).
101
- 2. **Kind-precision**: does a higher-priority kind fit better? A code / config / command block belongs in `example`; a comparison table belongs in `comparison`; a Q+A pair belongs in `faq`; a real incident with timeline belongs in `incident`; ordinary "typical scenario" / case-study / impact-result examples are `example`, not `incident`, unless the source is explicitly an outage, incident review, postmortem, or dated fault-handling timeline; a versioned change record belongs in `changelog`; an explicit source-backed choice / tradeoff / adopted path with rationale belongs in `decision` even when only one chosen option is surfaced; a verifiable rule with a check method belongs in `spec`; explicit risks belong in `warning`; a stable design rule or core mechanism without a recorded choice or check method belongs in `principle`.
102
- 3. **Action threshold**: multi-step fragments that clear the Action bar → emit `op: skip` with a note "evidence warrants sub-Action; re-align needed"; do not create Nodes from this skill.
103
-
104
- A Node whose raw is genuinely narrative — definitions, summaries, plain prose without enumerations or normative wording — legitimately ends with description-dominant output. The smell fires the other way: when raw contained enumerations, normative rules, or code blocks, and the draft collapsed them to `description`. Redraft from Step 2 in that case, not from a percentage threshold. Navigation-only evidence is handled separately by the TL;DR navigation rule and Step 2 — the gates above are not the right place to second-guess that path.
105
-
106
- ## Glossary and `refers_to_nodes`
107
-
108
- When a Section meaningfully discusses another known Node, or should be discoverable through that Node in query/navigation, put that known slug in `refers_to_nodes[]` — do NOT substitute it into the prose. This preserves explicit cross-Node anchors for query answers and citations without rewriting the claim. Slugs come from existing Sections or the context glossary. Slugs that are only declared by the current align plan but not yet materialized are pending targets: skip them on first-pass draft unless the CLI explicitly surfaces the relationship as safe or needed. Do not remove an existing valid ref just because verify says the target is pending; continue compiling the target or let the CLI refresh renderer blocks. A Section can reference multiple Nodes (common on `comparison` / `decision`). Do not add a slug for incidental product-name mentions that add no Section-local relationship or navigation value.
109
-
110
- If the CLI returns `compile-missing-refers-to-node`, treat it as a relation-recall check, not a style advisory. Add the suggested slug when the drafted Section text meaningfully discusses that known Node or should be discoverable through it. Omit it only for incidental mentions, code/package names inside examples, or navigation-only evidence that should remain no-write.
111
-
112
- If the CLI returns summary quality or low-coverage advisories with `agent_recommended_action: ignore`, do not patch solely to satisfy the advisory and do not inspect every folded detail row by default. Patch only when the cited source meaning is lost, the user asks for cleanup, or the returned `next_action` asks for a draft patch.
113
-
114
- ## FAQ attachment priority
115
-
116
- | FAQ topic | Attach to |
117
- |---|---|
118
- | About a concrete thing | That thing's Entity (Section `faq`) |
119
- | About a mechanism or term | The matching Entity |
120
- | About an action / flow | That Action |
121
- | Cross-topic / generic workspace FAQ | Domain (fallback only) |
122
-
123
- Never manufacture a FAQ container Node. If a FAQ cluster grows too large, a sub-Entity is the correct escape hatch; flag it in `decisions.notes` for a re-align pass.
124
-
125
- </reference>
126
-
127
- <procedures>
128
-
129
- ### Step 1 — Sanity-check the context
130
-
131
- Confirm `node.slug` is set; abort if not. Note `node.type` — it caps legal kinds per the CLI Section mount matrix.
132
-
133
- Check edge case conditions from the routing table at the top of this skill. If any apply, read the relevant reference **before** continuing. The references explain how their conditions modify Step 1 / Step 2 / Step 3.
134
-
135
- Estimate coverage from the provided `raw_snippets[]` before writing actions. Treat "the first quote is supported" as only a validation result, not a completion signal.
136
-
137
- Use the CLI-provided citation-eligible snippets and diagnostics as the coverage contract. Distinct source-backed facts should become distinct actions or evidence-carrying skips; duplicates, navigation-only blocks, placeholders, and unsupported fragments can be skipped. If later CLI diagnostics report low coverage, repair the same draft through the returned `next_action`.
138
-
139
- ### Step 2 — Classify each raw snippet
140
-
141
- For each `raw_snippets[]` entry:
142
-
143
- 1. If the snippet only contains navigation or placeholder evidence (`Parent` / `Children` / `Related` / `Relations`, sibling links, "no detailed content", etc.), emit `skip`. Do not create a Section whose content is just "Children: ..." or "Related: ..." and do not summarize facts that are not present in the snippet.
144
- 2. Pick kind using [Section Kind Choice](#section-kind-choice); stop at the first kind whose trigger fires.
145
- 3. Verify the kind against the mount matrix for `node.type`. Mismatch → pick the next legal kind down the chain, or emit `skip` with a reason pointing at a better Node. Never "fall through to description" just to place evidence.
146
- 4. If you land on `description`, walk the [Description anti-abuse gates](#description-anti-abuse-gates). Any gate fires → split or `skip`.
147
-
148
- For dense documents, group nearby snippets by their `block_locator_id` heading prefix and write one action per coherent fact group. Repeated `#` headings inside one source are often internal chapters of the current Node; keep them as Sections unless the raw evidence establishes a separate durable Node identity.
149
-
150
- ### Step 3 — Build actions
151
-
152
- For each classified snippet:
153
-
154
- 1. Decide whether `content` is needed. The default for source-backed writes is no `content`: cite `source_block_ids[]` / `source_refs[]` and let the CLI mirror raw into the Section content. Add explicit `content` only when the cited raw needs an intentional reader-surface rewrite, such as translation, structural reorganization, or preserving Markdown/code/table shape that the mirror path would not express clearly. Keep one coherent, cited fact group per action.
155
- 2. When you do write `content`, keep it faithful to the cited raw terms: do not introduce acronyms, abbreviations, translations, or aliases that do not appear in the cited raw snippet unless raw itself defines the equivalence or the user confirms it later during semantic review.
156
- - Do not lightly rewrite same-language prose for fluency, casing, entity-name consistency, or sentence cleanup. If the raw text is already clear, omit `content` instead of writing a near-copy.
157
- - Preserve meaningful Markdown formatting from the cited raw when explicit `content` is necessary: inline code markers, fenced blocks, Markdown link targets, blockquote markers, nested list structure, tables, and emphasis on key terms. Do not flatten these into plain prose unless the formatting is purely decorative.
158
- - There is no separate default `evidence-echo` warning. Treat "echo" as an anti-pattern: raw copied only to show basis/evidence, while `source_ref` already provides traceability.
159
- - For `description` / `spec`, a concise summary plus the cited bullet list is acceptable when the bullets are the useful user-facing knowledge. It becomes echo only when the copied text is not meant to be read as active knowledge.
160
- - For `example` Sections that cite a code, config, or command fence, keep `content` centered on the cited fenced block. Put framing prose such as "basic configuration example" in `summary`, or cite a separate prose block in a separate action when that prose is itself source-backed knowledge. If the source only has prose/list text with inline code, preserve prose/list plus inline code; do not turn it into a fenced script.
161
- 3. For long `content`, add `summary` when it helps readers or query output. Summary is LLM-authored reader/query aid: one plain paragraph, no Markdown, and should stay compact. In YAML payloads, write `summary` as a plain single-line scalar; reserve literal block scalars for multi-line `content`. If you cannot write a meaningful summary, omit the field entirely; generic placeholders like "description section covering N evidence blocks" are worse than no summary. The CLI reports advisory hints for missing or weak summaries; it does not treat summary quality as an evidence failure. Keep summaries faithful to the source-backed action, but do not copy raw-only keywords into `summary` for scoring.
162
- 4. Preserve meaningful source-backed literals in `content`, `summary`, skip reason, or repair challenge when they are part of the knowledge. Do not patch only to satisfy non-blocking URL or style advisories.
163
- 5. Omit `confidence` for ordinary confirmed claims. Assign it only when the evidence is clearly verified, inferred, or speculative according to the schema enum.
164
- 6. Fill `refers_to_nodes[]` per [Glossary and refers_to_nodes](#glossary-and-refers_to_nodes).
165
- 7. Cite evidence with `source_block_ids[]`, picking values from `source-refs-index` `items[].block_id` or `citable_source_refs[].block_id`. Use CLI-provided `planned_section_groups[].draft_action_templates` as the starting scaffold; hard citation-gap templates stay separate, while heading/local-heading annotated evidence may stay together or be split by semantic knowledge unit. When one Section summarizes contiguous multi-block evidence, list only the block ids consumed by that Section action. If the evidence is non-contiguous or contains separable claims, split the draft into separately cited actions instead of stretching one action across unrelated blocks. For `skip`, include `source_block_ids[]` only when the skip represents reviewed no-write material from citation-eligible evidence; omit evidence for purely deterministic no-ops, navigation, and context-only/background snippets. Never submit singular `source_ref`, mix `source_block_ids` with `source_refs`, or use quoted-evidence fields; invalid evidence references remain blocking.
166
-
167
- Rendered knowledge starts with optional `c4a:summary`, then the active `content`. If `content` differs from the cited raw, the CLI may render a debug-only `c4a:raw` block for audit; agents must not emit `raw`.
168
-
169
- ### Step 4 — Emit the JSON
170
-
171
- Emit one compile draft JSON document for the caller to submit to the current envelope's `next_action.command`. No markdown wrapper, no leading prose, no trailing commentary.
172
-
173
- Before returning, ensure `schema_version` is `compile.draft.v2`, `node_slug` matches `node.slug`, fields conform to `context schema compile-draft`, citations point only at CLI-provided evidence, and NodeContext was the only evidence source.
174
-
175
- </procedures>
@@ -1,34 +0,0 @@
1
- # Action and Domain gates
2
-
3
- Consult this reference when **`node.type` is `action` or `domain`**. For `entity` Nodes, ignore this file and follow the main SKILL.md procedure.
4
-
5
- ## Action Nodes (`node.type === "action"`)
6
-
7
- Treat `node.action_gate` as the compile boundary for procedural claims. An Action Node exists because align found both scale and process evidence: at least two meaningful Sections or a child Action, plus steps/phases/trigger-handling-result/role collaboration/repeatable plan evidence. Actor, goal/outcome, repeatability, answerability, trigger, step, and phase claims **must** come from cited `raw_snippets[]` or the structured `action_gate.inference_sources` entries.
8
-
9
- | Gate block | What it authorizes |
10
- |---|---|
11
- | `step_blocks` / `phase_blocks` / cited step snippets | `spec` or `example` Sections for procedure content |
12
- | `actor_blocks`, `goal_blocks`, `outcome_blocks`, `repeatability_or_plan_blocks` | concise `description` / `spec` Sections when the same source refs are citation-eligible |
13
- | Empty `trigger_blocks` | **No trigger Section.** Write goal or applicability if supported, but do not fabricate a trigger sentence. |
14
- | `inference_sources.answerability.ref_nodes` | Becomes `refers_to_nodes[]` when the current Section depends on those Nodes; do **not** summarize those Nodes' facts inside this Node. |
15
-
16
- If `action_gate` is absent on a Node whose `type` is `action`, treat it as a structural defect — emit a `structure_challenge` (see `references/structural-challenges.md`) instead of inventing process semantics.
17
-
18
- If the current evidence can only support one thin Section or only a parallel option/config list, do not stretch it into procedure prose. Emit `skip` or `structure_challenge` so align can revise the structure; the CLI does not auto-downgrade an Action or choose replacement Entity tags.
19
-
20
- ## Domain Nodes (`node.type === "domain"`)
21
-
22
- Treat `node.domain_gate` as **grouping metadata only**. It explains scope and child grouping; it does **not** authorize new Section facts by itself.
23
-
24
- - `scope_blocks` may help orient your Section coverage of the Domain's range but are not write authority.
25
- - `child_refs` belong to the align graph, not to active Sections — do not turn the list into a Section.
26
- - `grouping_reason` is align-time reasoning. Do **not** turn it into a `description` Section unless citation-eligible raw snippets state the same claim.
27
-
28
- Recall the mount matrix limit: Domain Nodes allow only `description`, `warning`, `principle`, `decision`, `faq`. A spec / example / comparison / incident / changelog landing here is a kind/type mismatch — drop down the priority chain or `skip`.
29
-
30
- ## How this slots into the main procedure
31
-
32
- - **Step 1 — Sanity-check**: after the standard `node.slug` / mount-matrix check, run the action_gate / domain_gate inspection above.
33
- - **Step 2 — Classify**: respect the gate's authorization boundary when picking kinds.
34
- - **Step 5 — Self-verify**: confirm no Section was written from evidence the gate disallowed.
@@ -1,34 +0,0 @@
1
- # Note snippets
2
-
3
- Consult this reference when **any `raw_snippets[].source_type` is `"note"`**. Note snippets came from `context capture --note` and carry conversation material (revisions, decisions, brainstorms) rather than primary source documents.
4
-
5
- ## TL;DR
6
-
7
- Note snippets are **prioritization hints, not write authority**. `note_intent`, `anchored_to[]`, and `revision_kind` may suggest update / supersede / complement / skip, but they never authorize a write without semantic review.
8
-
9
- ## How to route a note snippet
10
-
11
- When a `raw_snippets[]` entry has `source_type: "note"`:
12
-
13
- 1. **Compare against the anchor first.** If `anchored_to[]` names this Node or one of its Sections, treat that target as the candidate for `update` / `supersede` / `add` (as a complement) / `skip`. **Do not create a new Node** from the note title here — that is an align-time concern.
14
-
15
- 2. **Use `note_intent` and `revision_kind` to bias the action**:
16
-
17
- | `note_intent` | typical action |
18
- |---|---|
19
- | `revision` | `update` or `supersede` against the anchored Section |
20
- | `decision` | `add` a `decision` Section when no equivalent exists; otherwise `update` |
21
- | `brainstorm` | usually `skip` unless the brainstorm explicitly confirms a fact the Node should record |
22
-
23
- `revision_kind` (`replace` / `clarify` / ...) refines the choice within `revision`.
24
-
25
- 3. **No-write reviewed-no-write case.** If the note says "don't modify active knowledge yet" or the correct outcome is no-write after review, emit `skip` with `source_block_ids[]` containing the note's citation-eligible block id. This lets semantic review record `reviewed_no_write` instead of treating the skip as an unreviewed no-op.
26
-
27
- 4. **Bare skip is not allowed for notes.** A bare `skip` (no evidence) is only for deterministic no-op cases such as unchanged input or pure navigation. Notes always carry an anchor and an intent; the skip must cite the note's block id or explicit source_ref.
28
-
29
- ## Where this lives in the main procedure
30
-
31
- - **Step 2 — Classify**: run the note-first comparison **before** the generic kind priority chain. If the note resolves to `update` / `supersede` / `skip` (reviewed), record the action and move on; do not also process the same note through the generic chain.
32
- - **Step 5 — Self-verify**: every note snippet was either consumed by an anchored action or carried into a `skip` with `source_block_ids[]`.
33
-
34
- Notes never become structure_challenge or pending_ownership_challenge on their own. If a note describes a structural problem (missing Action, wrong parent, etc.), capture the underlying evidence in raw form and emit the challenge from that — see `references/structural-challenges.md`.