@c4a/context-cli 0.6.1 → 0.6.2

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 (236) hide show
  1. package/README.md +48 -10
  2. package/README.zh-CN.md +176 -0
  3. package/cli.js +60700 -35477
  4. package/docs/quickstart.md +23 -5
  5. package/package.json +4 -2
  6. package/plugins/README.md +60 -118
  7. package/plugins/README_CN.md +51 -102
  8. package/plugins/VERSION +1 -1
  9. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  10. package/plugins/claude/commands/continue.md +56 -10
  11. package/plugins/claude/commands/init.md +24 -11
  12. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  13. package/plugins/codex/skills/continue/SKILL.md +56 -11
  14. package/plugins/codex/skills/init/SKILL.md +23 -11
  15. package/plugins/cursor/.cursor-plugin/plugin.json +2 -3
  16. package/plugins/cursor/README.md +2 -2
  17. package/plugins/cursor/commands/context-continue.md +56 -10
  18. package/plugins/cursor/commands/context-init.md +24 -11
  19. package/plugins/skills/context-continue/SKILL.md +56 -11
  20. package/plugins/skills/context-init/SKILL.md +23 -11
  21. package/providers/context/actions/accept-package-templates.yaml +5 -0
  22. package/providers/context/actions/align-next.yaml +6 -0
  23. package/providers/context/actions/apply-managed-review.yaml +5 -0
  24. package/providers/context/actions/apply-structure-confirmation.yaml +5 -0
  25. package/providers/context/actions/build-next.yaml +5 -0
  26. package/providers/context/actions/capture-next.yaml +5 -0
  27. package/providers/context/actions/close-approved-knowledge.yaml +5 -0
  28. package/providers/context/actions/compile-next.yaml +5 -0
  29. package/providers/context/actions/configure-code-extraction.yaml +5 -0
  30. package/providers/context/actions/configure-document-capture.yaml +5 -0
  31. package/providers/context/actions/configure-package-output.yaml +5 -0
  32. package/providers/context/actions/configure-prose-lifecycle.yaml +5 -0
  33. package/providers/context/actions/ensure-repository-sources.yaml +5 -0
  34. package/providers/context/actions/extract-next.yaml +5 -0
  35. package/providers/context/actions/inspect-document-classification.yaml +5 -0
  36. package/providers/context/actions/inspect-review.yaml +5 -0
  37. package/providers/context/actions/inspect-structure.yaml +5 -0
  38. package/providers/context/actions/maintain-evidence.yaml +6 -0
  39. package/providers/context/actions/materialize-context-view.yaml +8 -0
  40. package/providers/context/actions/register-source-batch.yaml +7 -0
  41. package/providers/context/actions/repair-project-entry.yaml +5 -0
  42. package/providers/context/actions/repair-verification.yaml +5 -0
  43. package/providers/context/actions/repair-workspace-state.yaml +5 -0
  44. package/providers/context/codes.yaml +40 -0
  45. package/providers/context/graphs/workspace.yaml +494 -0
  46. package/providers/context/manifest.json +637 -0
  47. package/providers/context/provider.yaml +12 -0
  48. package/providers/context/resources/diagnostics/projection-stale.md +13 -0
  49. package/providers/context/resources/diagnostics/verification.md +21 -0
  50. package/providers/context/resources/diagnostics/workspace-state.md +27 -0
  51. package/providers/context/resources/dialogue/code-extraction.md +34 -0
  52. package/providers/context/resources/dialogue/document-capture.md +29 -0
  53. package/providers/context/resources/dialogue/document-classification.md +33 -0
  54. package/providers/context/resources/dialogue/evidence-maintenance.md +26 -0
  55. package/providers/context/resources/dialogue/human-gates.md +34 -0
  56. package/providers/context/resources/dialogue/knowledge-review.md +27 -0
  57. package/providers/context/resources/dialogue/package-output.md +30 -0
  58. package/providers/context/resources/dialogue/source-boundary.md +29 -0
  59. package/providers/context/resources/dialogue/structure-confirmation.md +44 -0
  60. package/providers/context/resources/manuals/guides/package-outputs.md +259 -0
  61. package/providers/context/resources/manuals/reference/package-templates.md +378 -0
  62. package/providers/context/resources/manuals/reference/project-api.md +789 -0
  63. package/providers/context/resources/manuals/reference/template-variables.md +248 -0
  64. package/providers/context/resources/procedures/close-and-build.md +21 -0
  65. package/providers/context/resources/procedures/code-extraction.md +50 -0
  66. package/providers/context/resources/procedures/document-capture.md +45 -0
  67. package/providers/context/resources/procedures/document-classification.md +22 -0
  68. package/providers/context/resources/procedures/evidence-maintenance.md +20 -0
  69. package/providers/context/resources/procedures/knowledge-review.md +24 -0
  70. package/providers/context/resources/procedures/package-output.md +37 -0
  71. package/providers/context/resources/procedures/project-configuration.md +21 -0
  72. package/providers/context/resources/procedures/prose-align.md +68 -0
  73. package/providers/context/resources/procedures/prose-compile.md +23 -0
  74. package/providers/context/resources/procedures/source-boundary.md +48 -0
  75. package/{plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md → providers/context/resources/procedures/source-capture-detailed.md} +41 -19
  76. package/providers/context/resources/procedures/verify-and-repair.md +19 -0
  77. package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/candidate-resolution.md +17 -2
  78. package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/density-profile.md +11 -0
  79. package/{plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/gates.md +13 -0
  80. package/{plugins/cursor/skills/skill-prose-align/references/internal-procedures → providers/context/resources/semantic/align}/structure-planning.md +62 -12
  81. package/providers/context/resources/semantic/compile/index.md +31 -0
  82. package/providers/context/resources/views/package-current.yaml +6 -0
  83. package/providers/context/resources/views/review-current.yaml +6 -0
  84. package/providers/context/resources/views/source-current.yaml +6 -0
  85. package/providers/context/resources/views/structure-current.yaml +6 -0
  86. package/providers/context/resources/views/verification-current.yaml +6 -0
  87. package/providers/context/resources/views/workspace-current.yaml +6 -0
  88. package/providers/context/schemas/evidence-maintenance-input.schema.json +30 -0
  89. package/providers/context/schemas/prose-structure-batch.schema.json +35 -0
  90. package/providers/context/schemas/source-batch-input.schema.json +189 -0
  91. package/providers/context/scripts/render-context-view.mjs +21 -0
  92. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +0 -235
  93. package/plugins/claude/skills/skill-init-workspace/SKILL.md +0 -74
  94. package/plugins/claude/skills/skill-package-output/SKILL.md +0 -180
  95. package/plugins/claude/skills/skill-prose-align/SKILL.md +0 -322
  96. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  97. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  98. package/plugins/claude/skills/skill-prose-compile/SKILL.md +0 -287
  99. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  100. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  101. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  102. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  103. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  104. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  105. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  106. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  107. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  108. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  109. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  110. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  111. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  112. package/plugins/claude/skills/skill-review-gate/SKILL.md +0 -138
  113. package/plugins/claude/skills/skill-source-scope/SKILL.md +0 -525
  114. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +0 -201
  115. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +0 -235
  116. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +0 -74
  117. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +0 -180
  118. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  119. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  120. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  121. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  122. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +0 -322
  123. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  124. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  125. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  126. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  127. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  128. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  129. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  130. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  131. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  132. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  133. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  134. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  135. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  136. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +0 -287
  137. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +0 -138
  138. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  139. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +0 -525
  140. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +0 -235
  141. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +0 -74
  142. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +0 -180
  143. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  144. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  145. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  146. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +0 -322
  147. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  148. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  149. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  150. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  151. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  152. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  153. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  154. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  155. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  156. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  157. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  158. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  159. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  160. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +0 -287
  161. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +0 -138
  162. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +0 -525
  163. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +0 -235
  164. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +0 -74
  165. package/plugins/cursor/skills/skill-package-output/SKILL.md +0 -180
  166. package/plugins/cursor/skills/skill-prose-align/SKILL.md +0 -322
  167. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  168. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  169. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  170. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +0 -287
  171. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  172. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  173. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  174. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  175. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  176. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  177. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  178. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  179. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  180. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  181. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  182. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  183. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  184. package/plugins/cursor/skills/skill-review-gate/SKILL.md +0 -138
  185. package/plugins/cursor/skills/skill-source-scope/SKILL.md +0 -525
  186. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +0 -201
  187. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +0 -235
  188. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +0 -74
  189. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +0 -180
  190. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  191. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  192. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  193. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  194. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +0 -322
  195. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  196. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  200. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  201. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  202. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  203. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  204. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  205. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  206. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  207. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  208. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +0 -287
  209. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +0 -138
  210. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  211. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +0 -525
  212. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +0 -235
  213. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +0 -74
  214. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +0 -180
  215. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  216. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  217. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  218. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  219. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +0 -322
  220. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  221. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  222. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  223. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  224. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  225. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  226. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  227. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  228. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  229. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  230. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  231. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  232. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  233. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +0 -287
  234. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +0 -138
  235. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  236. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +0 -525
@@ -1,322 +0,0 @@
1
- ---
2
- name: skill-prose-align
3
- description: >
4
- Internal procedure invoked by the public Context continuation entry; not a user slash command.
5
- Uses Context document evidence views to propose, validate, and confirm
6
- `unapproved/structure.yaml` without reading raw snapshots directly.
7
- tools:
8
- - Bash
9
- ---
10
-
11
- # skill-prose-align
12
-
13
- Turn captured document evidence into confirmed structure.
14
-
15
- ## TL;DR
16
-
17
- - Use this after document capture, or when the user asks to split, merge,
18
- reorganize, classify, or relate document evidence.
19
- - When status is `captured-ready-to-classify`, run every returned capture-phase
20
- evidence command before editing `src/index.ts`. Use the collection-neutral
21
- title tree, span index, and exact text to propose a mainline collection; wait
22
- for user confirmation, then declare matching align/compile/review phases.
23
- - The first product output is a structure draft, not final page body.
24
- - Read source material only through CLI evidence views: `read-plan`,
25
- `source-index`, `span-detail`, `span-text`, `schema`, and
26
- `structure-summary`. Additional views are diagnostic surfaces; use the route
27
- and view set returned by the CLI.
28
- - Write and validate `context.structure.v1` into `unapproved/structure.yaml`.
29
- Stop for user confirmation before compile.
30
- - Before semantic judgment, use the CLI `semantic-rules` View to page through
31
- only `semantic_rules.required`. Use each selection `reason` to keep unrelated
32
- rules out of the current judgment.
33
- - Plan source evidence as Sections before promoting any heading to a Node/View.
34
- Promotion depends on source-backed standalone retrieval identity, not on a
35
- hard-coded section kind or collection name.
36
- - Do not produce or validate a structure payload from this entry file alone. A
37
- ruleset already present in the active context may be reused only when both its
38
- `handle` and `digest` match. If the context was compacted, the digest changed,
39
- or the rule content is no longer present, resume the CLI rule-page sequence.
40
- - When status reaches `structure-ready` or `needs-prose-compile`, hand off to
41
- `skill-prose-compile.md`.
42
- - Compile, review, close, verify, and build remain separate gates.
43
-
44
- <reference>
45
-
46
- ## User-Facing Gates
47
-
48
- Use semantic labels, not SDK function names:
49
-
50
- | Gate | Say this | Do not say this first |
51
- |---|---|---|
52
- | Collection classification | "I have inspected the captured evidence. Based on these source characteristics, I recommend this knowledge category; please confirm before I configure compilation." | Guessing from a filename, URL, or SDK collection enum before investigation |
53
- | Material investigation | "I will read the evidence index and source spans through Context, then propose a structure draft." | `alignProse`, `source-index`, `context.structure.v1` |
54
- | Structure confirmation | "Confirming this structure freezes page paths, section ownership, and relationships for this compile round." | `unapproved/structure.yaml` as a raw parameter |
55
- | Compile handoff | "The structure is confirmed; I will switch to source-bound compile for draft pages." | Continuing to edit structure in compile |
56
-
57
- ## Runtime Discipline
58
-
59
- `skill-continue-workflow` owns global state routing; this Skill owns only the
60
- align phase selected by that route. Use CLI evidence/rule/diagnostic Views,
61
- follow their exact continuation commands, and treat hints as subordinate to
62
- `next_action`. Evidence reads may be parallel; stage, confirm, Review apply,
63
- close, and build writes remain serial. Never reconstruct digest values or
64
- inspect CLI-managed state files as a substitute for a View.
65
- - If a payload is too large for a heredoc, stage it under
66
- `.tmp/agent-payloads/<run-id>/...` in the workspace root and redirect stdin
67
- from that file. Never reuse fixed `/tmp/c4a-*` names, and never place agent
68
- scratch payloads under CLI-managed `.tmp/context-cli/`, `sources/`,
69
- `unapproved/`, `knowledge/`, `dist/`, or package output directories.
70
- - If a validation or view response includes `reason_code`, `path`, `missing[]`,
71
- `diagnostics`, `repair_hints`, or `agent_hints`, treat those fields as the
72
- repair contract. Do not recover by replaying a stale manual route, editing
73
- rendered files, or guessing schema aliases.
74
-
75
- ## Evidence Views
76
-
77
- Recommended read order:
78
-
79
- ```bash
80
- context run align:<type>:<source>:<collection> --view read-plan --format json
81
- context run align:<type>:<source>:<collection> --view source-index --compact --format json
82
- context run align:<type>:<source>:<collection> --view span-detail --span <source-ref> --format json
83
- context run align:<type>:<source>:<collection> --view span-text --span <source-ref> --format json
84
- context run align:<type>:<source>:<collection> --view schema --format json
85
- context run align:<type>:<source>:<collection> --view structure-summary --input <structure.yaml> --format json
86
- ```
87
-
88
- Use CLI-returned `next_command` values for pagination. Do not reconstruct
89
- documents with ad hoc `cat`, `grep`, or scripts against `sources/` or `.tmp`.
90
-
91
- ## Structure Contract
92
-
93
- The structure draft uses `schema_version: context.structure.v1` and lives at
94
- `unapproved/structure.yaml` after staging. It contains:
95
-
96
- - lifecycle state such as validated/confirmed and frozen snapshot metadata;
97
- - concept `nodes[]` with stable `node_ref`, `node_type`, title/summary, and
98
- ownership;
99
- - materialized `views[]` with `view_ref`, collection, path, section plans, and
100
- evidence refs;
101
- - typed edges using the closed set defined by the CLI;
102
- - unresolved items when evidence is weak, conflicting, or the target node is
103
- missing.
104
-
105
- Confirmed structure is a human gate. Validation passing is not the same as
106
- confirmation. Do not write `lifecycle.state: confirmed`, `confirmed_by`,
107
- `confirmed_at`, or `structure_digest` until the user has explicitly confirmed
108
- the structure proposal in the conversation.
109
-
110
- When the current conversation explicitly authorizes fully managed operation,
111
- use the CLI-returned `--stage --managed` command after successful validation.
112
- The CLI records `confirmed_by: managed-session`; validation errors and unresolved
113
- evidence still block confirmation. Never persist managed mode in `defineProject`
114
- or reuse it in another conversation.
115
-
116
- ## Procedure References
117
-
118
- These are current structure planning rules. They define the source-bound
119
- semantic gates for Node planning, section ownership, and relationship handling.
120
-
121
- | Decision | Reference |
122
- |---|---|
123
- | Structure planning, Node ownership, density, candidate resolution | [skill-prose-align/references/internal-procedures/structure-planning.md](skill-prose-align/references/internal-procedures/structure-planning.md) |
124
- | Node type, title, tags, fake entity, action/domain gates, edge gates | [skill-prose-align/references/internal-procedures/structure-planning/references/gates.md](skill-prose-align/references/internal-procedures/structure-planning/references/gates.md) |
125
- | Source density and coarse reading judgment | [skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md](skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md) |
126
- | Candidate anomalies, stable ids, paths, duplicates, and conflicts | [skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md](skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md) |
127
-
128
- </reference>
129
-
130
- <procedures>
131
-
132
- ### Step 1 — Open Material Investigation
133
-
134
- Run:
135
-
136
- ```bash
137
- context run align:<type>:<source>:<collection> --view read-plan --format json
138
- ```
139
-
140
- Use the returned views, budgets, snapshot hash, and next actions. If the CLI
141
- reports a missing or stale snapshot, route back to source capture/refresh. Do
142
- not read the snapshot file yourself.
143
-
144
- ### Step 2 — Read Evidence Through The Index
145
-
146
- Read a compact index before requesting exact spans:
147
-
148
- ```bash
149
- context run align:<type>:<source>:<collection> --view source-index --compact --format json
150
- ```
151
-
152
- For exact evidence, copy CLI-returned source refs or next commands:
153
-
154
- ```bash
155
- context run align:<type>:<source>:<collection> --view span-detail --span <source-ref> --format json
156
- context run align:<type>:<source>:<collection> --view span-text --span <source-ref> --format json
157
- ```
158
-
159
- Keep a short note of what evidence supports each proposed node, section, and
160
- edge. If the evidence is weak or conflicting, keep it as unresolved instead of
161
- turning it into a fact.
162
-
163
- Before drafting structure, read:
164
-
165
- - [skill-prose-align/references/internal-procedures/structure-planning.md](skill-prose-align/references/internal-procedures/structure-planning.md)
166
- - [skill-prose-align/references/internal-procedures/structure-planning/references/gates.md](skill-prose-align/references/internal-procedures/structure-planning/references/gates.md)
167
- - [skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md](skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md)
168
- - [skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md](skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md)
169
-
170
- Do not treat this as optional background. These files contain the current
171
- semantic gates for source-bound structure planning. A structure payload drafted
172
- without the applicable references is incomplete, even if the CLI schema accepts
173
- its shape.
174
-
175
- ### Step 3 — Draft And Validate Structure
176
-
177
- Request the schema:
178
-
179
- ```bash
180
- context run align:<type>:<source>:<collection> --view schema --format json
181
- ```
182
-
183
- Create a `context.structure.v1` YAML file. The draft may include a one-page-per
184
- source shape, but that is represented as ordinary nodes and sections; it does
185
- not bypass structure confirmation.
186
-
187
- For small payloads, use stdin/heredoc. For larger payloads, write a scratch file
188
- under `.tmp/agent-payloads/<run-id>/` and pass it through `--input`. Scratch
189
- files are disposable agent working files; they are never phase state and
190
- must not be read back as a substitute for CLI views.
191
-
192
- Validate:
193
-
194
- ```bash
195
- context run align:<type>:<source>:<collection> --validate --input <structure.yaml> --format json
196
- ```
197
-
198
- Validation returns a compact summary and writes a temporary HTML report under
199
- `.tmp/context-runtime/reports/`. A validation report with
200
- `confirmation_ready=false` is an Agent repair artifact, not a user review gate:
201
- do not ask the user to approve it. The staged report produced after
202
- `confirmation_ready=true` is the final review surface; use its
203
- `structure_report.file_url` as the primary user-facing link and include
204
- `structure_report.absolute_path` as a copyable fallback.
205
- If the user needs a focused view, run:
206
-
207
- ```bash
208
- context run align:<type>:<source>:<collection> --view structure-summary --input <structure.yaml> --format json
209
- ```
210
-
211
- The explicit `structure-summary` View returns the full summary for focused
212
- debugging. For user confirmation, prioritize the default first-screen fields:
213
- `review_notice`, `structure_report`, and `structure_summary_compact`. A valid
214
- user-facing confirmation prompt must include the report `file_url`, the absolute
215
- path fallback, and a compact summary of collections/views/unresolved/diagnostics.
216
- Do not ask the user to confirm from counts alone.
217
-
218
- Repair diagnostics by routing them to the right decision:
219
-
220
- - source ref or snapshot mismatch -> reread evidence views or refresh capture;
221
- - unsupported node/section/edge -> remove it or mark unresolved;
222
- - duplicate/conflict -> ask the user which structure should win;
223
- - illegal edge type, missing target node, or edge without source refs -> fix the
224
- structure or keep the relation unresolved;
225
- - stale structure -> regenerate from the current snapshot hash.
226
-
227
- When validation returns `repair_confirmation_blockers`, follow its exact repair
228
- route without stopping for human confirmation. `--repair suggested-splits`
229
- mechanically splits non-contiguous source mirror Sections; write its
230
- `repaired_payload` to a scratch YAML file and validate again. For oversized
231
- Views, use the returned child-View and contains-edge suggestions, but classify
232
- each child Node from evidence instead of mechanically inheriting the parent
233
- type. Repair other diagnostics from evidence and validate again. Ask the user only when evidence
234
- supports multiple incompatible semantic choices, and label that question as a
235
- structure-design choice rather than final review. Do not stage until
236
- `confirmation_ready=true`.
237
-
238
- ### Step 4 — Review Structure Before Confirmation
239
-
240
- After validation reports `confirmation_ready=true`, stage the draft. The stage
241
- command opens the final report. Then show the user:
242
-
243
- - node list and planned paths;
244
- - section ownership;
245
- - typed edges and unresolved relation candidates;
246
- - expected compile order;
247
- - downstream impact: these choices freeze paths, section ownership, and
248
- relationships for this compile round.
249
- - the `structure_report.file_url` generated by validate or `--view
250
- structure-summary`;
251
- - the `structure_report.absolute_path` fallback in case the host cannot click
252
- file URLs.
253
-
254
- If the CLI stage result includes `next_action.human_gate: true`, treat it as a
255
- hard stop for structure review. Do not ask for a blind "confirm structure"
256
- reply. Surface the report `file_url`, absolute path, and enough structured
257
- summary for the user to inspect what will be confirmed.
258
-
259
- Do not turn `confirmation_blockers` into a preliminary approval round. A
260
- validator-required page split, continuous-source split, ref repair, or
261
- structure-spine connection is work to resolve before staging. If a genuinely
262
- ambiguous semantic choice needs the user, ask only that choice and then resume
263
- repair; it does not replace the final report-based confirmation.
264
-
265
- Use the host's multi-choice question tool when available. If unavailable, use a
266
- short Markdown fallback. Good options are:
267
-
268
- - Confirm this structure and continue to compile.
269
- - Revise the structure with additional guidance.
270
- - Go back to source scope or capture because the evidence set is wrong.
271
-
272
- Only after confirmation, run the CLI confirmation command, normally:
273
-
274
- ```bash
275
- context run align:<type>:<source>:<collection> --confirm --format json
276
- ```
277
-
278
- If confirming a structure file other than `unapproved/structure.yaml`, pass it
279
- with `--input <structure.yaml>`. A draft stage in `unapproved/structure.yaml` is
280
- not confirmation. Do not edit `unapproved/structure.yaml` after confirmation to
281
- change meaning; return to this gate instead.
282
-
283
- ### Step 5 — Handoff To Compile
284
-
285
- After the user confirms the structure and the CLI reports `structure-ready` or
286
- `needs-prose-compile`, stop this procedure and follow:
287
-
288
- ```text
289
- skill-prose-compile.md
290
- ```
291
-
292
- Do not keep editing structure while compiling. If compile diagnostics show the
293
- planned structure is wrong, return to this align gate and ask the user to
294
- confirm the corrected structure.
295
-
296
- ### Step 6 — Self-verify Checklist
297
-
298
- - [ ] Evidence came only from Context evidence views.
299
- - [ ] `context.structure.v1` was validated before user confirmation.
300
- - [ ] User confirmed the structure before compile.
301
- - [ ] Compile was delegated to `skill-prose-compile`; this procedure did not
302
- write draft page body.
303
- - [ ] Relationships are expressed as structure edges or unresolved items.
304
- - [ ] No direct edits were made to `sources/`, `.tmp`, `unapproved/`,
305
- `knowledge/`, review HTML, or `dist/`.
306
-
307
- ### Final Report
308
-
309
- Report in the user's language. Include only:
310
-
311
- - evidence views actually read;
312
- - proposed and confirmed node count, section count, edge count, and unresolved
313
- count;
314
- - user confirmation outcome;
315
- - validation warnings that still matter for compile;
316
- - next route reported by status or the align phase.
317
-
318
- Do not report payload digests, snapshot hashes, source-ref hashes, absolute
319
- paths, or scratch file paths unless the CLI explicitly asks the user to repair
320
- one.
321
-
322
- </procedures>
@@ -1,132 +0,0 @@
1
- ---
2
- name: close-gate
3
- description: >
4
- Internal procedure invoked by the current compile/continue flow; not a user
5
- slash command. Runs after review apply. Triggers `context close --format json`,
6
- which derives knowledge/structure.yaml, projects approved edges, and runs the
7
- final verify gate. Agent intervention is limited to interpreting CLI output
8
- and routing verify errors back to source capture, align structure, compile
9
- actions, or review as appropriate. The skill never hand-edits rendered
10
- knowledge.
11
- tools:
12
- - Bash
13
- ---
14
-
15
- # close-gate — approved structure projection + final verify
16
-
17
- Close a compile run. The CLI does the work; the skill reads the
18
- CLI's output and routes any failure back to the correct upstream
19
- command. It does not hand-edit rendered knowledge.
20
-
21
- ## TL;DR — Non-negotiables
22
-
23
- - CLI-driven. `context close --format json` derives `knowledge/structure.yaml`,
24
- projects approved edges, and verifies the final workspace including edge
25
- source refs. Use the command's stdout + exit code; that's the close's full
26
- output.
27
- - **Agent NEVER edits rendered knowledge from the close stage.** The CLI is the
28
- sole writer for approved structure projection. If verify reports an error
29
- here, route it back, not around:
30
- - Content / Section issues → re-run the current compile gate for the affected
31
- node after fixing compile actions.
32
- - Structural issues → return to the align structure gate and reconfirm.
33
- - Source/evidence issues → recapture the affected source, then rerun align or
34
- compile as status instructs.
35
- - Exit 0 → summarise approved node count, approved edge count, structural edge
36
- contract status, and verify status. References, changelog, package index,
37
- section fingerprints, and full incremental cache rebuilds are not current
38
- close output.
39
- - Exit 2 → report the full issue list verbatim + point at the right re-entry command above. Do not hand-open the affected rendered article.
40
- - Materialized knowledge means approved Markdown plus its approved
41
- `knowledge/structure.yaml` projection. A compile skip action records reviewed
42
- evidence, but it does not by itself materialize an arbitrary finalized Node.
43
- - Never re-run compile actions from close to paper over verify failures. Draft
44
- failures belong in the compile loop.
45
- - Do not use Python, Node.js, shell scripts, `ls`, `find`, `rg`, `cat`, or similar ad-hoc commands to inspect `sources/`, `unapproved/`, `knowledge/`, or `dist/` files.
46
- - Current close can self-heal stale or malformed `knowledge/structure.yaml`
47
- projection by deriving it again from approved Markdown and approved edge
48
- sources. It must not rewrite verbatim section body.
49
- - LLM-assisted repair (`--fix-with-llm`) is not a current close action.
50
- - Output language: summary prose matches the user's language; CLI output, issue codes, file paths stay as printed.
51
- - Current align state is internal CLI state, not a file protocol. The CLI owns
52
- this lifecycle — the agent must not move, delete, or archive workspace output
53
- files by hand.
54
- - Semantic decisions are applied and recorded before close. Compile-close does
55
- not judge or rewrite semantic decisions; it only verifies the already-applied
56
- workspace and rebuilds approved structure projection.
57
-
58
- <reference>
59
-
60
- ## Stages inside `context close --format json`
61
-
62
- Close is one in-process command with one exit code:
63
-
64
- 1. **Approved knowledge scan** — reads approved Markdown only through CLI
65
- project readers.
66
- 2. **Structure projection** — writes deterministic `knowledge/structure.yaml`
67
- with nodes, approved edge projection, input hash, and structural edge
68
- contract status.
69
- 3. **Workspace verify** — runs the final verify gate. Any error prevents close
70
- readiness.
71
- 4. **Status receipt** — reports whether close is ready and which upstream gate
72
- owns any failure.
73
-
74
- ## Outcome routing
75
-
76
- | Outcome | Agent action |
77
- |---|---|
78
- | Ready, verify pass | Summarise approved nodes, approved edges, structural edge contract, and verify status. Stop. |
79
- | Ready, verify warnings only | Summarise warning codes and state that build may proceed when warnings are allowed by status/build gate. |
80
- | Verify error in approved section content/evidence | Surface the issue list and route back to compile actions or source recapture as indicated by status. Do not edit approved Markdown. |
81
- | Verify error in approved structure projection | Run `context close --format json` once more only when status says the projection is close-repairable; otherwise return to align structure. |
82
- | Source/evidence stale or missing | Route to source capture/refresh, then rerun align/compile as status instructs. |
83
-
84
- The close stage never edits rendered knowledge on the agent side. Every verify
85
- error routes back to the correct upstream gate (source capture, align
86
- structure, compile actions, or review), never sideways into a hand Edit. Use
87
- the CLI issue code and hint printed by `context close --format json` for the
88
- error→command mapping.
89
-
90
- References, changelog, section fingerprints, and package index rebuilds are not
91
- current close outputs.
92
-
93
- </reference>
94
-
95
- <procedures>
96
-
97
- ### Step 1 — Invoke close
98
-
99
- Run `context close --format json`. The caller may have already invoked it;
100
- check for existing output before re-running.
101
-
102
- ### Step 2 — Interpret
103
-
104
- Use stdout + stderr. The exit code selects the path via [Outcome routing](#outcome-routing).
105
-
106
- ### Step 3 — Route errors to the correct upstream command
107
-
108
- 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:
109
-
110
- - Section / content issue → rerun the current compile gate for that node.
111
- - Structure issue → return to align structure and user confirmation.
112
- - Source/evidence issue → recapture the affected source, then rerun align or
113
- compile as status instructs.
114
-
115
- 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.
116
-
117
- ### Step 4 — Report
118
-
119
- Summarise in the user's language:
120
-
121
- - Approved node count.
122
- - Approved edge count and structural edge contract status.
123
- - Verify result: pass / pass-with-unverifiable-evidence / fail, with issue
124
- codes verbatim.
125
-
126
- Stop. Do not auto-invoke follow-on commands.
127
-
128
- ### Step 5 — Final guardrails
129
-
130
- Run close once, surface every error with its re-entry command, and never inspect or edit rendered knowledge outside the CLI.
131
-
132
- </procedures>
@@ -1,52 +0,0 @@
1
- # Action and Domain gates
2
-
3
- Consult this reference when **`node.node_type` is `action` or `domain`**. For
4
- `entity` Nodes, ignore this file and follow the main SKILL.md procedure.
5
-
6
- ## Action Nodes (`node.node_type === "action"`)
7
-
8
- Treat the confirmed node type and planned sections as the compile boundary for
9
- procedural claims. An Action Node exists because align confirmed process
10
- evidence: steps/phases, trigger -> handling -> result, role collaboration, or a
11
- repeatable plan. Actor, goal/outcome, repeatability, answerability, trigger,
12
- step, and phase claims **must** come from the selected planned section
13
- `source_refs[]`; do not invent process semantics from the title alone.
14
-
15
- | Evidence pattern | What it authorizes |
16
- |---|---|
17
- | Planned section source refs contain ordered steps, phases, or repeatable handling | `spec` or `example` Sections for procedure content. |
18
- | Planned section source refs explicitly name actor, goal, outcome, or repeatability | Concise `description` / `spec` Sections using those same refs. |
19
- | No source ref states a trigger | **No trigger Section.** Write goal or applicability if supported, but do not fabricate a trigger sentence. |
20
- | Existing structure edge or unresolved relation indicates another Node is required for answerability | Mention only what the current source refs support; keep the relation in structure, not in compile action fields or verbatim body. |
21
-
22
- If the planned sections for an `action` node do not contain source-backed
23
- process evidence, treat that as a structural defect and return to align using
24
- [structural-challenges.md](structural-challenges.md). Do not invent an action
25
- body just because the node type is `action`.
26
-
27
- If the current evidence can only support one thin Section or only a parallel
28
- option/config list, do not stretch it into procedure prose. Emit `skip` for the
29
- unsupported planned section, or return to align so the node can be revised. The
30
- CLI does not auto-downgrade an Action or choose replacement Entity tags.
31
-
32
- ## Domain Nodes (`node.node_type === "domain"`)
33
-
34
- Treat Domain nodes as grouping surfaces. The domain's scope and child grouping
35
- are expressed by confirmed `edges[]` and by source-backed planned sections; they
36
- do **not** authorize new reader-facing facts by themselves.
37
-
38
- - Source refs on planned sections may orient coverage of the Domain's range, but
39
- only those refs can support reader-facing text.
40
- - Child relations belong to `structure.yaml` typed edges, not active Sections;
41
- do not turn a child list into a Section.
42
- - Align-time grouping rationale is not evidence. Do **not** turn it into a
43
- `description` Section unless the planned source refs state the same claim.
44
-
45
- 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`.
46
-
47
- ## How this slots into the main procedure
48
-
49
- - **Step 1 — Sanity-check**: after the standard `node.id` / mount-matrix check,
50
- run the action/domain inspection above.
51
- - **Step 2 — Classify**: respect the gate's authorization boundary when picking kinds.
52
- - **Step 5 — Self-verify**: confirm no Section was written from evidence the gate disallowed.
@@ -1,48 +0,0 @@
1
- # Note snippets
2
-
3
- Consult this reference only when the current CLI exposes note evidence in a
4
- source-bound phase view. Note evidence carries conversation material
5
- (revisions, decisions, brainstorms) rather than primary source documents.
6
-
7
- ## TL;DR
8
-
9
- Note snippets are **prioritization hints, not write authority**. `note_intent`, `anchored_to[]`, and `revision_kind` may suggest update / replacement / complement / skip, but they never authorize a write without semantic review.
10
-
11
- ## How to route a note snippet
12
-
13
- When a source evidence entry has `source_type: "note"`:
14
-
15
- 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` / replacement review / `add` (as a complement) / `skip`. **Do not create a new Node** from the note title here — that is an align-time concern.
16
-
17
- 2. **Use `note_intent` and `revision_kind` to bias the action**:
18
-
19
- | `note_intent` | typical action |
20
- |---|---|
21
- | `revision` | `update` when meaning stays the same; otherwise replacement review against the anchored Section |
22
- | `decision` | `add` a `decision` Section when no equivalent exists; otherwise `update` |
23
- | `brainstorm` | usually `skip` unless the brainstorm explicitly confirms a fact the Node should record |
24
-
25
- `revision_kind` (`replace` / `clarify` / ...) refines the choice within `revision`.
26
-
27
- 3. **No-write reviewed-no-write case.** If the note says "don't modify active
28
- knowledge yet" or the correct outcome is no-write after review, emit `skip`
29
- with the note's current `source_refs[]` when the CLI exposes them. This lets
30
- semantic review record `reviewed_no_write` instead of treating the skip as an
31
- unreviewed no-op.
32
-
33
- 4. **Bare skip is not allowed for notes.** A bare `skip` (no evidence) is only
34
- for deterministic no-op cases such as unchanged input or pure navigation.
35
- Notes always carry an anchor and an intent; the skip must cite the note's
36
- explicit source ref when the current CLI exposes one.
37
-
38
- ## Where this lives in the main procedure
39
-
40
- - **Step 2 — Classify**: run the note-first comparison **before** the generic kind priority chain. If the note resolves to `update` / replacement review / `skip` (reviewed), record the current action or user/structure route and move on; do not also process the same note through the generic chain.
41
- - **Step 5 — Self-verify**: every note snippet was either consumed by an
42
- anchored action or carried into a `skip` with `source_refs[]` when the current
43
- CLI exposes citeable refs.
44
-
45
- Notes never become compile challenge actions on their own. If a note describes a
46
- structural problem (missing Action, wrong parent, etc.), capture or cite the
47
- underlying source evidence and return to the structure gate described in
48
- `references/structural-challenges.md`.
@@ -1,85 +0,0 @@
1
- # Refresh and update
2
-
3
- Consult this reference when **any** of the following holds:
4
-
5
- - `existing.sections[]` is non-empty (Node already has active knowledge; this is a refresh, not a first compile).
6
- - `incremental.status` is `unchanged` or `full-context` (non-default incremental signals).
7
- - `incremental.locator_only_changes[]` is non-empty (locator-only deltas without content changes).
8
-
9
- For first compile of a fresh Node with `incremental.status === "changed-only"`, skip this file.
10
-
11
- ## Incremental status handling
12
-
13
- | `incremental.status` | What to do |
14
- |---|---|
15
- | `changed-only` (default) | Normal path — main SKILL.md procedure applies as written. |
16
- | `unchanged` | Emit exactly one `skip` action with a brief reason. Do not iterate snippets. |
17
- | `full-context` | Draft from the full fallback. **Preserve `unknown_inputs[]` reasons** in any abort/retry explanation so the caller sees why the fallback was needed. |
18
-
19
- The CLI may deterministically skip unchanged output or update locator-only evidence before writing. **Do not force artificial content changes to bypass fingerprint skip** — those skips are part of the protocol, not a problem to route around.
20
-
21
- ## Locator-only changes
22
-
23
- `incremental.locator_only_changes[]` entries always carry `agent_action: "none"` and `handled_by: "compile-close"`. **Do not emit a draft action for those Sections** unless the same Section also appears in `changed_blocks[]` with a real content change.
24
-
25
- ## Reconciling with `existing.sections[]`
26
-
27
- When `existing.sections[]` is non-empty, every section id you read here is a
28
- potential same-section `update` target or a signal that the structure/user gate
29
- must decide a higher-risk replacement or withdrawal. Walk the existing Sections
30
- in order and decide:
31
-
32
- | Raw evidence vs existing Section | op |
33
- |---|---|
34
- | Raw still supports the existing claim unchanged | Emit nothing (or one summarising `skip`) |
35
- | Raw clarifies or rephrases without changing meaning | `update` — same `section-N` stays active |
36
- | Raw changes meaning (new spec value, reversed decision) | Stop and route to user/structure review; do not emulate a replacement with `update` |
37
- | Raw removes the supporting evidence | Stop and route to user/structure review; do not hide the previous active section with a compile no-write |
38
-
39
- ### Replacement vs `update` semantics
40
-
41
- Replacement preserves the audit trail so readers can see that the prior policy
42
- changed — **critical for specs / decisions / principles**. Use `update` only
43
- for typo / wording fixes / detail additions that do not change meaning. When
44
- meaning changes or support disappears, do not write a compile action until the
45
- user/structure gate has chosen the intended disposition.
46
-
47
- ### Current output mechanics
48
-
49
- - `update` keeps the same planned section identity. In the current
50
- `context.compile-actions.v1` shape, emit `op: "update"` with `section_id`,
51
- `kind` when needed, `summary` when useful, and current `source_refs[]`. Omit
52
- `content` so the CLI mirrors the new cited source span. If the intended update
53
- requires translation, compression, or reorganization, stop and return to the
54
- structure/user gate instead of writing reader-visible content in compile.
55
- - Fresh replacement content is a new structure/review decision, not a current
56
- compile write shape. Preserve the semantic judgment in the user report or
57
- unresolved structure discussion and route back to the appropriate gate; do
58
- not invent unsupported target fields.
59
-
60
- ## Output shape (current update path)
61
-
62
- ```jsonc
63
- {
64
- "schema_version": "context.compile-actions.v1",
65
- "view_ref": "architecture:entity/example",
66
- "actions": [
67
- {
68
- "op": "update",
69
- "section_id": "retention-policy",
70
- "kind": "spec",
71
- "summary": "...",
72
- "source_refs": ["file:docs/example.md#span:retention L10-14@<span-hash>"]
73
- }
74
- ]
75
- }
76
- ```
77
-
78
- ## How this slots into the main procedure
79
-
80
- - **Step 1 — Sanity-check**: when `existing.sections[]` is non-empty, read every section id and status before classifying snippets. When `incremental.status` is `unchanged`, short-circuit with one `skip`.
81
- - **Step 2 — Classify**: still walk the kind priority chain for each citation-eligible snippet; the reconciliation table above governs which `op` to emit for snippets that map to an existing Section.
82
- - **Step 5 — Self-verify**: every `update` targets a known planned section id
83
- from the confirmed structure. If a replacement or withdrawal judgment has no
84
- accepted compile action shape, stop and route back through review/align
85
- instead of emitting unsupported fields.