@c4a/context-cli 0.6.1 → 0.6.3

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 (246) hide show
  1. package/README.md +77 -12
  2. package/README.zh-CN.md +202 -0
  3. package/cli.js +74066 -45247
  4. package/docs/context-debug-event-v1.schema.json +29 -0
  5. package/docs/context-debug-replay-v1.schema.json +33 -0
  6. package/docs/debug-tracing.md +86 -0
  7. package/docs/quickstart.md +23 -5
  8. package/package.json +8 -3
  9. package/plugins/README.md +60 -118
  10. package/plugins/README_CN.md +51 -102
  11. package/plugins/VERSION +1 -1
  12. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude/commands/continue.md +61 -10
  14. package/plugins/claude/commands/init.md +26 -11
  15. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  16. package/plugins/codex/skills/continue/SKILL.md +61 -11
  17. package/plugins/codex/skills/init/SKILL.md +28 -14
  18. package/plugins/cursor/.cursor-plugin/plugin.json +2 -3
  19. package/plugins/cursor/README.md +2 -2
  20. package/plugins/cursor/commands/context-continue.md +61 -10
  21. package/plugins/cursor/commands/context-init.md +26 -11
  22. package/plugins/skills/context-continue/SKILL.md +61 -11
  23. package/plugins/skills/context-init/SKILL.md +28 -14
  24. package/providers/context/actions/accept-package-templates.yaml +5 -0
  25. package/providers/context/actions/align-next.yaml +6 -0
  26. package/providers/context/actions/apply-managed-review.yaml +5 -0
  27. package/providers/context/actions/apply-structure-confirmation.yaml +5 -0
  28. package/providers/context/actions/build-next.yaml +5 -0
  29. package/providers/context/actions/capture-next.yaml +5 -0
  30. package/providers/context/actions/close-approved-knowledge.yaml +5 -0
  31. package/providers/context/actions/compile-next.yaml +5 -0
  32. package/providers/context/actions/configure-code-extraction.yaml +5 -0
  33. package/providers/context/actions/configure-document-capture.yaml +5 -0
  34. package/providers/context/actions/configure-package-output.yaml +5 -0
  35. package/providers/context/actions/configure-prose-lifecycle.yaml +5 -0
  36. package/providers/context/actions/extract-next.yaml +5 -0
  37. package/providers/context/actions/inspect-document-classification.yaml +5 -0
  38. package/providers/context/actions/inspect-repository-recovery.yaml +6 -0
  39. package/providers/context/actions/inspect-review.yaml +5 -0
  40. package/providers/context/actions/inspect-structure.yaml +5 -0
  41. package/providers/context/actions/maintain-evidence.yaml +6 -0
  42. package/providers/context/actions/materialize-context-view.yaml +8 -0
  43. package/providers/context/actions/reconcile-review-identities.yaml +5 -0
  44. package/providers/context/actions/register-source-batch.yaml +7 -0
  45. package/providers/context/actions/repair-project-entry.yaml +5 -0
  46. package/providers/context/actions/repair-verification.yaml +5 -0
  47. package/providers/context/actions/repair-workspace-state.yaml +5 -0
  48. package/providers/context/actions/restore-repository-sources.yaml +7 -0
  49. package/providers/context/codes.yaml +41 -0
  50. package/providers/context/graphs/workspace.yaml +536 -0
  51. package/providers/context/manifest.json +700 -0
  52. package/providers/context/provider.yaml +12 -0
  53. package/providers/context/resources/diagnostics/projection-stale.md +13 -0
  54. package/providers/context/resources/diagnostics/verification.md +21 -0
  55. package/providers/context/resources/diagnostics/workspace-state.md +27 -0
  56. package/providers/context/resources/dialogue/code-extraction.md +34 -0
  57. package/providers/context/resources/dialogue/document-capture.md +29 -0
  58. package/providers/context/resources/dialogue/document-classification.md +33 -0
  59. package/providers/context/resources/dialogue/evidence-maintenance.md +26 -0
  60. package/providers/context/resources/dialogue/human-gates.md +34 -0
  61. package/providers/context/resources/dialogue/knowledge-review.md +27 -0
  62. package/providers/context/resources/dialogue/package-output.md +30 -0
  63. package/providers/context/resources/dialogue/repository-source-recovery.md +23 -0
  64. package/providers/context/resources/dialogue/source-boundary.md +29 -0
  65. package/providers/context/resources/dialogue/structure-confirmation.md +44 -0
  66. package/providers/context/resources/manuals/guides/lark-resources.md +121 -0
  67. package/providers/context/resources/manuals/guides/package-outputs.md +267 -0
  68. package/providers/context/resources/manuals/reference/package-templates.md +378 -0
  69. package/providers/context/resources/manuals/reference/project-api.md +825 -0
  70. package/providers/context/resources/manuals/reference/template-variables.md +248 -0
  71. package/providers/context/resources/procedures/close-and-build.md +23 -0
  72. package/providers/context/resources/procedures/code-extraction.md +50 -0
  73. package/providers/context/resources/procedures/document-capture.md +49 -0
  74. package/providers/context/resources/procedures/document-classification.md +22 -0
  75. package/providers/context/resources/procedures/evidence-maintenance.md +20 -0
  76. package/providers/context/resources/procedures/knowledge-review.md +34 -0
  77. package/providers/context/resources/procedures/package-output.md +37 -0
  78. package/providers/context/resources/procedures/project-configuration.md +21 -0
  79. package/providers/context/resources/procedures/prose-align.md +68 -0
  80. package/providers/context/resources/procedures/prose-compile.md +23 -0
  81. package/providers/context/resources/procedures/repository-source-recovery.md +43 -0
  82. package/providers/context/resources/procedures/source-boundary.md +48 -0
  83. package/{plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md → providers/context/resources/procedures/source-capture-detailed.md} +54 -19
  84. package/providers/context/resources/procedures/verify-and-repair.md +31 -0
  85. package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/candidate-resolution.md +17 -2
  86. package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/density-profile.md +11 -0
  87. 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
  88. package/{plugins/cursor/skills/skill-prose-align/references/internal-procedures → providers/context/resources/semantic/align}/structure-planning.md +62 -12
  89. package/providers/context/resources/semantic/compile/index.md +31 -0
  90. package/providers/context/resources/views/package-current.yaml +6 -0
  91. package/providers/context/resources/views/review-current.yaml +6 -0
  92. package/providers/context/resources/views/source-boundary.yaml +6 -0
  93. package/providers/context/resources/views/source-current.yaml +6 -0
  94. package/providers/context/resources/views/structure-current.yaml +6 -0
  95. package/providers/context/resources/views/verification-current.yaml +6 -0
  96. package/providers/context/resources/views/workspace-current.yaml +6 -0
  97. package/providers/context/schemas/evidence-maintenance-input.schema.json +30 -0
  98. package/providers/context/schemas/prose-structure-batch.schema.json +35 -0
  99. package/providers/context/schemas/repository-source-recovery.schema.json +40 -0
  100. package/providers/context/schemas/source-batch-input.schema.json +189 -0
  101. package/providers/context/scripts/render-context-view.mjs +21 -0
  102. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +0 -235
  103. package/plugins/claude/skills/skill-init-workspace/SKILL.md +0 -74
  104. package/plugins/claude/skills/skill-package-output/SKILL.md +0 -180
  105. package/plugins/claude/skills/skill-prose-align/SKILL.md +0 -322
  106. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  107. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  108. package/plugins/claude/skills/skill-prose-compile/SKILL.md +0 -287
  109. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  110. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  111. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  112. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  113. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  114. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  115. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  116. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  117. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  118. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  119. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  120. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  121. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  122. package/plugins/claude/skills/skill-review-gate/SKILL.md +0 -138
  123. package/plugins/claude/skills/skill-source-scope/SKILL.md +0 -525
  124. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +0 -201
  125. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +0 -235
  126. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +0 -74
  127. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +0 -180
  128. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  129. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  130. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  131. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  132. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +0 -322
  133. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  134. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  135. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  136. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  137. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  138. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  139. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  140. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  141. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  142. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  143. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  144. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  145. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  146. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +0 -287
  147. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +0 -138
  148. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +0 -525
  149. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +0 -235
  150. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +0 -74
  151. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +0 -180
  152. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  153. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  154. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  155. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +0 -322
  156. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  157. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  158. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  159. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  160. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  161. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  162. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  163. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  164. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  165. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  166. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  167. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  168. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  169. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +0 -287
  170. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +0 -138
  171. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  172. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +0 -525
  173. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +0 -235
  174. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +0 -74
  175. package/plugins/cursor/skills/skill-package-output/SKILL.md +0 -180
  176. package/plugins/cursor/skills/skill-prose-align/SKILL.md +0 -322
  177. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  178. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  179. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  180. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +0 -287
  181. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  182. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  183. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  184. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  185. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  186. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  187. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  188. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  189. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  190. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  191. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  192. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  193. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  194. package/plugins/cursor/skills/skill-review-gate/SKILL.md +0 -138
  195. package/plugins/cursor/skills/skill-source-scope/SKILL.md +0 -525
  196. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +0 -201
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +0 -235
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +0 -74
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +0 -180
  200. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  201. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  202. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  203. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  204. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +0 -322
  205. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  206. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  207. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  208. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  209. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  210. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  211. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  212. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  213. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  214. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  215. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  216. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  217. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  218. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +0 -287
  219. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +0 -138
  220. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  221. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +0 -525
  222. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +0 -235
  223. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +0 -74
  224. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +0 -180
  225. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  226. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  227. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  228. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  229. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +0 -322
  230. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  231. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  232. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  233. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  234. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  235. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  236. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  237. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  238. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  239. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  240. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  241. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  242. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  243. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +0 -287
  244. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +0 -138
  245. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  246. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +0 -525
@@ -1,263 +0,0 @@
1
- # Node Classification Gates
2
-
3
- Use these gates before every structure draft and before authoring the align
4
- payload described by the current schema view.
5
- Align owns Node type, tag, graph, planned Section, and ownership classification. It does **not** write Section prose.
6
-
7
- Current schema mapping:
8
-
9
- - Treat the action checklist, domain checklist, and inference tables as private
10
- working notes unless the current schema view explicitly exposes matching
11
- fields.
12
- - In `context.structure.v1`, persist the outcome through `node_type`, `tags`,
13
- `summary`, `ownership`, `sections[].source_refs`, `edges[]`, and
14
- `unresolved[]`.
15
- - Do not add unknown gate fields to the payload just because this procedure uses
16
- them for reasoning.
17
-
18
- ## Node Type Order
19
-
20
- Answer in this order and stop at the first match:
21
-
22
- 1. **Action?** A large executable event / process with both:
23
- - scale: can support `planned_sections` with at least two distinct Section kinds, or contains at least one child Action;
24
- - process evidence: explicit steps, phases, trigger -> handling -> result, role collaboration, or repeatable plan. Parallel lists such as "three API modes" are not process evidence.
25
- Single-section user-story / scenario / incident records may be meaningful to
26
- a human reader, but the CLI does not infer that exception from source prose.
27
- If the structure cannot express at least two distinct Section kinds or a
28
- child Action, keep the material as a Section under the owning Node.
29
- 2. **Entity?** A concrete independent subject with retrieval value: deployable code, product/application/system, library/module/CLI/symbol, or an atomic term/pattern.
30
- 3. **Domain?** A container/scope that groups at least one child Node.
31
- 4. Otherwise do not create a Node; leave the material for compile as a Section under the owning Node.
32
-
33
- Good examples:
34
-
35
- | Type | Examples |
36
- |---|---|
37
- | `domain` | "X business domain", "Y technical area", "Z research topic" |
38
- | `entity` concrete | `@acme/api-server`, `@acme/ui-kit` `Button`, "X sub-application" |
39
- | `entity` term | "X identifier", "Y business metric", idempotency |
40
- | `action` | "user submits X request end-to-end flow", "operator executes Y change flow", "team Z release flow" |
41
-
42
- ## Title and Source Heading Rules
43
-
44
- 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`.
45
-
46
- After choosing `node_type`, choose the title to fit that type:
47
-
48
- | Final type | Title shape |
49
- |---|---|
50
- | `entity` concrete | The concrete product, service, library, module, CLI, symbol, application, or system name. |
51
- | `entity` term | The atomic concept or pattern name, without extra scope/process suffixes. |
52
- | `domain` | The grouping scope that owns child Nodes. |
53
- | `action` | The executable process / runbook / flow name that passed the Action Gate. |
54
-
55
- 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.
56
-
57
- 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 supported `edges[]`.
58
-
59
- Relation-only sources should not force title copying or dangling graph edges. Decide placeholder handling in this order:
60
-
61
- 1. If resolved current/existing child Nodes make the page a real grouping scope, keep the relation evidence as supported `edges[]` only when the Domain also has at least one source-backed planned Section.
62
- 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, keep that identity in `unresolved[]` until it has source-backed section evidence, a valid generated `parent_index` view with source-backed `contains` edges to child views, or a compile-time `skip` decision. Do not submit root-level `planned_sections: []` or ordinary source-bound `sections: []`.
63
- 3. Otherwise, skip navigation-only / placeholder-only material; keep a short
64
- `unresolved[]` note only when the deferred relation remains useful.
65
-
66
- Do not create a hidden domain-gate object. A kept placeholder needs support:
67
- source refs, approved graph support, or explicit user-confirmed retrieval value.
68
- For Domain placeholders, write only resolved current/existing children as typed
69
- `edges[]`; if all children are unresolved/deferred relation clues, keep those
70
- target hints in `unresolved[]`. If the source names only an atomic concept and
71
- that term is useful on its own, prefer a concise term Entity title without
72
- scope/process suffixes.
73
-
74
- 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.
75
-
76
- ## Section Promotion Gate
77
-
78
- Classify local evidence as a Section before creating a child Node/View. A
79
- heading, table row, FAQ label, or short sub-topic does not by itself establish a
80
- standalone page.
81
-
82
- Promote a Section to a child View only when at least one condition is supported
83
- by source evidence:
84
-
85
- 1. The title is a concrete product/code object/system/module/library, not just a
86
- local heading.
87
- 2. The item is an atomic term or pattern that answers standalone lookup
88
- questions outside the parent page.
89
- 3. The item clears the Action Gate or Domain Gate.
90
- 4. The source gives it independent article identity: owner/date, lifecycle,
91
- timeline, tracking record, or cross-cutting support scope.
92
-
93
- Use one content-neutral test for every proposed child View: does cited evidence
94
- support an independent subject identity, enough context to stand alone, and a
95
- separate retrieval need? A heading, section kind, collection name, or contains
96
- edge is not sufficient by itself. The CLI warns when many same-source,
97
- single-section child Entities look mechanically fragmented, but it does not
98
- reject a page merely because of its content type.
99
-
100
- ## Entity Tag Rules
101
-
102
- Use `tags` to state what the Entity is. Legal combinations:
103
-
104
- | Case | Tags |
105
- |---|---|
106
- | Runtime/code object | one A tag: `app`, `service`, `lib`, `cli`, `module`, or `symbol` |
107
- | Product-analysis object | one B tag: `application` or `system` |
108
- | Code + product object | one A tag plus one B tag |
109
- | Pure term / pattern | only `term` |
110
-
111
- `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 the structure plan express the relation as a typed edge or unresolved relation with `source_refs[]`.
112
-
113
- Do not inherit scope tags mechanically. If a parent Entity is tagged `system` or
114
- `application`, a child Entity should repeat that tag only when it is itself an
115
- independent system/application. Local aspects under that parent should either
116
- use their own shape tag or remain Sections.
117
-
118
- ## Action Gate
119
-
120
- Use `node_type: action` only after the Node Type Order says action. Fill the
121
- action reasoning checklist in your working notes; persist only fields accepted by
122
- the current structure schema.
123
-
124
- The action probe uses five booleans as a reasoning checklist, but the semantic
125
- bar is:
126
-
127
- | Field | Meaning | Evidence rule |
128
- |---|---|---|
129
- | `has_steps_or_phases` | Process evidence exists: steps, phases, trigger -> handling -> result, role collaboration, or repeatable plan. | Hard requirement; support it from span evidence. |
130
- | `has_actor_or_role` | A user, system, operator, service, or role performs the work. | May be inferred; record the source. |
131
- | `has_outcome_or_goal` | The process has a target result, acceptance condition, or operational goal. | May be inferred; record the source. |
132
- | `is_repeatable_or_planned` | The work is repeatable, scheduled, policy-like, or intentionally planned. | May be inferred; record the source. |
133
- | `queries_answerable_with_refs` | The Node can answer how/when/who/what-to-do questions from cited spans. | May be inferred; record the source. |
134
-
135
- 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. The CLI does not infer single-Section Action exceptions from source prose; represent the material with enough structure or keep it as a Section.
136
-
137
- Action anti-examples:
138
-
139
- | Candidate | Correct routing |
140
- |---|---|
141
- | "migrate to X tool" as one conclusion | `decision` Section under the owning Entity |
142
- | "component X usage" as one sentence | `description` + maybe `example` under X |
143
- | "submit -> validate -> generate" as one unexpanded sentence | `spec` Section under X/Y |
144
- | "three API call modes" | `comparison`, `spec`, or `description` Section; not Action |
145
-
146
- ## Fake Entity Gate
147
-
148
- A relationship-style title is only suspicious by itself. Downgrade or change type when at least **two** signals are true:
149
-
150
- 1. Title contains relationship language such as "X impact on Y", "Y under X", "Y side of X", "X migration", or "X collection".
151
- 2. No legal Entity tag fits.
152
- 3. The Node does not stand alone away from its upstream Node.
153
-
154
- Repairs:
155
-
156
- | Pattern | Repair |
157
- |---|---|
158
- | "X impact on Y" | Section under X plus a typed edge or unresolved relation to Y when the evidence supports it |
159
- | "Y under X condition" | Section under Y; X is a condition in the Section body |
160
- | "X subsystem migration" | Action only if it clears the Action Gate; otherwise `decision` Section under X |
161
- | "X error collection" / "X FAQ collection" | `faq` / `incident` Sections under X |
162
-
163
- ## Domain Gate
164
-
165
- Use `node_type: domain` only for a scope that groups child Nodes. Keep this
166
- domain reasoning checklist in working notes and persist supported relations through current
167
- `edges[]` or `unresolved[]`:
168
-
169
- | Field | Meaning |
170
- |---|---|
171
- | `scope_refs[]` | Source refs that describe the scope boundary or grouping. |
172
- | `child_refs[]` | Working-note candidate ids, local refs, or final slugs for children in the scope; persist valid ones as `edges[]`. |
173
- | `grouping_reason` | Why these children belong together under this domain. |
174
-
175
- 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; keep only useful unresolved relation notes. 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.
176
-
177
- 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 supported child edges or unresolved relation hints.
178
-
179
- ## Edge Gate
180
-
181
- Use a typed edge only when all four checks pass:
182
-
183
- 1. Both `from` and `to` nodes exist in the current structure or approved
184
- knowledge.
185
- 2. The relation type is in the current closed set (`is_a`, `contains`,
186
- `depends_on`, `corresponds_to`, `causes`, `triggers`, `prerequisite`,
187
- `applies_to`, `verified_by`, `supersedes`).
188
- 3. `source_refs[]` cite evidence for the relation itself, not just for one
189
- endpoint.
190
- 4. The relation is stronger than a vague "related" hint.
191
-
192
- If any check fails, write an `unresolved[]` item instead of an edge.
193
-
194
- If the source sentence states the relation with uncertainty, keep the edge only
195
- when the uncertainty is source-authored and preserved through
196
- `confidence: possible` or `confidence: hypothesis`. Do not use `confidence` for
197
- Agent uncertainty. If you are uncertain whether the evidence supports the
198
- relation, write `unresolved[]` instead.
199
-
200
- ## Inference Sources
201
-
202
- Inference sources are working notes for the action reasoning checklist; do not
203
- persist this object unless the current schema explicitly exposes it:
204
-
205
- ```yaml
206
- inference_sources:
207
- actor:
208
- source_type: explicit-span
209
- source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
210
- rationale: "The span names the operator role."
211
- outcome_or_goal:
212
- source_type: inferred-from-span
213
- source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
214
- rationale: "The span describes recovery as the expected result."
215
- repeatability_or_plan:
216
- source_type: heading-and-span
217
- source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
218
- rationale: "The runbook heading and ordered list indicate planned reuse."
219
- answerability:
220
- source_type: explicit-span
221
- source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
222
- rationale: "The steps answer how the operation is performed."
223
- ```
224
-
225
- Allowed `source_type` values:
226
-
227
- | Value | Use when |
228
- |---|---|
229
- | `explicit-span` | The evidence span directly states the signal. |
230
- | `heading-and-span` | The heading plus span text together support the signal. |
231
- | `ref-node` | An existing or same-decision Node reference supplies the signal. Include `ref_nodes`. |
232
- | `inferred-from-span` | The signal is inferred from span content. Keep the rationale short and concrete. |
233
-
234
- Each source must include `rationale` when inferred and at least one of `source_refs[]` or `ref_nodes[]`.
235
-
236
- ## Final Reflection
237
-
238
- - 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.
239
- - Action only supports one Section -> write it as a Section instead of an Action, or add source-backed structure that reaches at least two distinct Section kinds / one child Action. The CLI does not use source prose keywords to grant an exception.
240
- - Action "steps" are parallel options/configs -> route to Entity `comparison` / `spec` / `description`.
241
- - Domain has no children -> delete it or merge it into a larger Domain.
242
-
243
- ## Current CLI Quality Diagnostics
244
-
245
- Current `context.structure.v1` validation preserves the old Node quality
246
- checks as deterministic diagnostics:
247
-
248
- | Diagnostic | Meaning | Required response |
249
- |---|---|---|
250
- | `schema.section_kind_invalid` | A planned Section uses a kind outside the current prose kind set. | Replace it with a kind from the schema view; do not invent local kind names. |
251
- | `schema.section_kind_mount_invalid` | A planned Section kind cannot be mounted on the chosen `node_type`. | Choose a kind allowed by the mount matrix, or reclassify the Node before confirming structure. |
252
- | `tags.term_conflict` | An Entity uses `term` together with concrete runtime/product tags such as `lib`, `service`, `application`, or `system`. | Split the term from the concrete object, or remove the conflicting tag before staging. |
253
- | `node.description_dominates` | A non-Action Node has at least half of its planned Sections as `description`. | Re-run kind precision. Keep it only when source evidence is genuinely narrative; otherwise split into `example`, `spec`, `comparison`, `faq`, `incident`, `decision`, `warning`, or `principle`. |
254
- | `node.thin_concrete_entity` | A concrete Entity has one Section and no child Nodes. | Keep it only when it has stable standalone retrieval value; otherwise merge it into the owning Node. |
255
- | `node.children_should_be_sections` | One parent contains many same-source, single-section child Entities with no stable shape tag. | Merge those children into parent Sections unless the user confirms each child has standalone lookup value. |
256
- | `node.term_expanded_beyond_definition` | A `term` Entity has grown past a compact definition or owns children. | Move rules, procedures, designs, and examples to the owning Node; keep the term entry narrow. |
257
- | `node.action_too_thin` | An Action has fewer than two distinct planned Section kinds and no child Action. | Downgrade it to a Section under the owning Node, add a distinct Section kind, or add a child Action; the CLI does not infer a single-section exception from source text. |
258
- | `node.domain_without_children` | A Domain has no source-backed `contains` child edge. | Add supported children, keep an explicitly confirmed no-write placeholder, or reclassify the Node. |
259
- | `tags.child_inherits_system` | A child Entity repeats its parent `system` / `application` scope tag. | Retag by the child’s own shape/scope, or keep the child as a Section if it is only a local aspect. |
260
- | `edge.confidence_invalid` | An edge declares a confidence value outside the current schema. | Use only `possible` or `hypothesis`, or omit the field for source-certain relations. |
261
-
262
- Warnings are not automatic blockers, but they are not suggestions to ignore.
263
- Resolve them or include the user-confirmed rationale when confirming structure.
@@ -1,287 +0,0 @@
1
- ---
2
- name: skill-prose-compile
3
- description: >
4
- Internal procedure invoked by the public Context continuation entry; not a user command.
5
- Uses confirmed Context document structure to create source-bound draft prose
6
- candidates through `context.compile-actions.v1`, without reading raw
7
- snapshots directly.
8
- tools:
9
- - Bash
10
- ---
11
-
12
- # skill-prose-compile
13
-
14
- Compile confirmed document structure into reviewable draft knowledge.
15
-
16
- ## TL;DR
17
-
18
- - Use this after `context status` reports `structure-ready` or
19
- `needs-prose-compile`, or when the user explicitly asks to compile confirmed
20
- prose structure into draft pages.
21
- - The input is already confirmed `context.structure.v1`; do not redesign node
22
- ownership, page paths, or relationships here. Return to prose align if those
23
- are wrong.
24
- - Read compile context through CLI views only: `blockers`, `read-plan`,
25
- `node-context`, and `schema`. Start with `blockers` for large or recently
26
- repaired structures; if it returns section blockers, return to prose align
27
- instead of drafting compile actions. Use align evidence views only when the
28
- compile view or validation output gives a specific source ref that needs exact
29
- text.
30
- - Emit `context.compile-actions.v1`; the CLI mirrors source spans, derives
31
- `content_mode`, writes review candidates, and enforces source-bound evidence.
32
- - The `summary` field in each action is the Agent-authored behavior half only:
33
- compact source-backed recall text for the cited section. The CLI separately
34
- renders the reachability half from confirmed typed edges into review metadata;
35
- do not invent edge summaries or relation fields in the action payload.
36
- - Default to omitted `content` so the CLI mirrors the cited source span.
37
- Do not write explicit `content`. If the evidence cannot be represented as a
38
- faithful mirrored continuous span, split the section or return to prose align
39
- for a confirmed structure change.
40
- - Before semantic judgment, use the CLI `semantic-rules` View to page through
41
- only `semantic_rules.required`; selection `reason` explains why each rule is
42
- needed for the current node.
43
- - Do not produce or validate compile actions from this entry file alone. A
44
- ruleset already present in the active context may be reused only when both its
45
- `handle` and `digest` match. If the context was compacted, the digest changed,
46
- or the rule content is no longer present, resume the CLI rule-page sequence.
47
-
48
- <reference>
49
-
50
- ## User-Facing Gates
51
-
52
- Use semantic labels, not SDK function names:
53
-
54
- | Gate | Say this | Do not say this first |
55
- |---|---|---|
56
- | Compile context | "I will inspect the confirmed structure and each node's planned evidence before drafting sections." | `node-context`, `context.compile-actions.v1` |
57
- | Source-bound draft | "I will mirror supported source spans into reviewable draft pages and attach summary/kind metadata." | `compileProse` |
58
- | Non-mirror evidence | "This section cannot be compiled as-is because the evidence is not one faithful source mirror; we need to split or revise the structure." | "The agent can rewrite this automatically." |
59
- | Structure mismatch | "This compile cannot proceed because the confirmed structure no longer matches the evidence; we need to return to structure confirmation." | Editing `knowledge/` or `unapproved/` directly |
60
-
61
- ## Runtime Discipline
62
-
63
- `skill-continue-workflow` owns global state routing; this Skill owns only the
64
- compile phase selected by that route. Use CLI context/rule/diagnostic Views and
65
- their exact continuation commands. Hints are subordinate to `next_action`.
66
- Never inspect CLI-managed state files as a substitute for a View.
67
- - Compile `read-plan`, `blockers`, `node-context`, and `schema` Views are
68
- workspace-read-only and may be fetched in parallel. `--validate`, `--stage`,
69
- structure confirmation, Review apply, and close remain serial mutations.
70
- - One planned Section produces one compile action. When evidence contains
71
- independently retrievable units, split them into sibling Sections in align;
72
- do not split one planned Section into several compile actions.
73
- - One write still means one View, not one human Review. Stage every View in the
74
- same confirmed structure sequentially, follow `continue_compile_batch`, and
75
- open Review only after the CLI reports that the whole batch is prepared.
76
- - Compile does not get a second, looser rule set. If a rule conflicts with the
77
- current CLI schema or diagnostics, follow the CLI and repair the payload.
78
- - Write digest/hash flags are stale guards. Use values returned by the CLI; do
79
- not parse stdout fragments or host tool-result files to reconstruct them.
80
- - If a payload is too large for a heredoc, stage it under
81
- `.tmp/agent-payloads/<run-id>/...` in the workspace root and redirect stdin
82
- from that file. Never reuse fixed `/tmp/c4a-*` names, and never place agent
83
- scratch payloads under CLI-managed `.tmp/context-cli/`, `sources/`,
84
- `unapproved/`, `knowledge/`, `dist/`, review output, or package output
85
- directories.
86
-
87
- ## Compile Views
88
-
89
- Recommended read order:
90
-
91
- ```bash
92
- context run compile:<type>:<source>:<collection> --view blockers --format json
93
- context run compile:<type>:<source>:<collection> --view read-plan --format json
94
- context run compile:<type>:<source>:<collection> --view node-context --source <view-ref> --format json
95
- context run compile:<type>:<source>:<collection> --view schema --format json
96
- ```
97
-
98
- Use CLI-returned `available_view_refs`, `planned_sections`, `local_sources`, and
99
- `next_action.command`. If `blockers.section_blockers[]` is non-empty, repair the
100
- structure through align first; do not inspect every node or hand-split compile
101
- actions. Do not reconstruct the structure by opening `unapproved/structure.yaml`
102
- or `knowledge/structure.yaml` directly.
103
-
104
- ## Procedure References
105
-
106
- These are current compile rules for source-bound drafting, judgment, semantic
107
- repair, and close handoff.
108
-
109
- | Decision | Reference |
110
- |---|---|
111
- | Compile action drafting, section kind, coverage, summaries, content intent | [references/internal-procedures/compile-actions.md](references/internal-procedures/compile-actions.md) |
112
- | Action/domain compile gates | [references/internal-procedures/compile-actions/references/action-domain-gates.md](references/internal-procedures/compile-actions/references/action-domain-gates.md) |
113
- | Notes, refresh/update, and structural challenges | [references/internal-procedures/compile-actions/references/notes.md](references/internal-procedures/compile-actions/references/notes.md), [references/internal-procedures/compile-actions/references/refresh-and-update.md](references/internal-procedures/compile-actions/references/refresh-and-update.md), [references/internal-procedures/compile-actions/references/structural-challenges.md](references/internal-procedures/compile-actions/references/structural-challenges.md) |
114
- | Support, duplicate, replacement, conflict, weak evidence, and relation judgment | [references/internal-procedures/compile-judgment.md](references/internal-procedures/compile-judgment.md), [references/internal-procedures/semantic-judgment.md](references/internal-procedures/semantic-judgment.md) |
115
- | Leakage, ownership, temporal evidence, disposition, omit, and user confirmation | [references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md](references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md), [references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md](references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md), [references/internal-procedures/semantic-judgment/references/disposition-semantics.md](references/internal-procedures/semantic-judgment/references/disposition-semantics.md), [references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md](references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md), [references/internal-procedures/semantic-judgment/references/user-confirmation.md](references/internal-procedures/semantic-judgment/references/user-confirmation.md) |
116
- | Close gate and current close output boundaries | [references/internal-procedures/close-gate.md](references/internal-procedures/close-gate.md) |
117
-
118
- ## Compile Contract
119
-
120
- The compile action payload uses `schema_version: context.compile-actions.v1`.
121
- Compile may:
122
-
123
- - mirror source spans as `verbatim`;
124
- - emit `skip` decisions when no source-backed body should be written. `skip`
125
- does not produce a placeholder candidate; generated parent-index pages use
126
- the parent-index compile path, not an action payload placeholder.
127
-
128
- Relationships and cross references do not go into verbatim body. In current
129
- output they stay in `structure.yaml` typed edges; this workflow does not render
130
- relationship reference blocks.
131
-
132
- </reference>
133
-
134
- <procedures>
135
-
136
- ### Step 1 — Open Compile Context
137
-
138
- Run:
139
-
140
- ```bash
141
- context run compile:<type>:<source>:<collection> --view blockers --format json
142
- context run compile:<type>:<source>:<collection> --view read-plan --format json
143
- ```
144
-
145
- Use the returned blockers, node list, source overview, and next action. If the
146
- blockers view reports section blockers, return to prose align and repair the
147
- confirmed structure before compile. If the CLI says the structure is missing,
148
- unconfirmed, stale, frozen against the wrong snapshot, or invalid, return to
149
- prose align or source capture as indicated.
150
-
151
- ### Step 2 — Inspect One Node
152
-
153
- For each node that should become draft knowledge, run:
154
-
155
- ```bash
156
- context run compile:<type>:<source>:<collection> --view node-context --source <view-ref> --format json
157
- context run compile:<type>:<source>:<collection> --view schema --format json
158
- context run compile:<type>:<source>:<collection> --view semantic-rules --source <view-ref> --format json
159
- ```
160
-
161
- Follow the semantic-rules `next_action.command` pages before classifying section
162
- kind, summary, support, skip/update, weak evidence, or structure repair. Do not
163
- load rules outside the returned required set.
164
-
165
- Do not treat those references as optional background. They are the current
166
- compile drafting, judgment, and semantic-repair procedures.
167
-
168
- When exact evidence text is needed, use the CLI-returned source ref with the
169
- current evidence view. Do not open snapshot files directly.
170
-
171
- ### Step 3 — Draft And Validate Actions
172
-
173
- Create a `context.compile-actions.v1` payload for the selected view. Prefer
174
- omitted `content` with `source_refs[]` so the CLI mirrors source spans.
175
- If the source evidence is non-contiguous or contains separable examples,
176
- configuration blocks, lists, or procedures, split the compile actions when the
177
- confirmed structure supports that split. If the structure is too coarse, return
178
- to prose align and ask the user to confirm a section split instead of writing
179
- summarized body text. Explicit `content` / `content_intent` is not part of the
180
- current compile contract.
181
-
182
- For small payloads, use stdin/heredoc. For larger payloads, write a scratch file
183
- under `.tmp/agent-payloads/<run-id>/` and pass it through `--input`. Scratch
184
- files are disposable agent working files; they are never compile state and must
185
- not be read back as a substitute for CLI views.
186
-
187
- Validate:
188
-
189
- ```bash
190
- context run compile:<type>:<source>:<collection> --validate --input <compile-actions.yaml> --format json
191
- ```
192
-
193
- Repair diagnostics by routing them to the right decision:
194
-
195
- - source ref or planned-section mismatch -> reread node-context, or return to
196
- structure confirmation if ownership is wrong;
197
- - unsupported kind or op -> use the schema view and current compile references;
198
- - explicit content -> omit `content` and mirror source, or return to align for
199
- a section split;
200
- - weak evidence, duplicate, conflict, omit, or scope issue -> use the compile
201
- judgment / semantic judgment references and ask the user when required;
202
- - frozen structure mismatch -> rerun status and return to align/capture as
203
- directed.
204
-
205
- Use typed diagnostics as the repair contract:
206
-
207
- - `reason_code`, `path`, and `missing[]` identify what to fix;
208
- - warnings are not write blockers unless the response marks them blocking or
209
- the next action says so;
210
- - weak evidence, duplicate, conflict, temporal, leakage, ownership, and scope
211
- issues are semantic review issues, not formatting problems;
212
- - raw/source-ref pointer diagnostics are evidence checks, not content-quality
213
- judges.
214
-
215
- When validation returns a new `next_action.command`, follow that exact command.
216
- When it returns blocking diagnostics without a write command, repair and
217
- validate again. Do not stage a compile payload just because the YAML shape looks
218
- valid.
219
-
220
- ### Step 4 — Stage Draft Candidates
221
-
222
- Stage only after validation has no errors:
223
-
224
- ```bash
225
- context run compile:<type>:<source>:<collection> --stage --input <compile-actions.yaml> --format json
226
- ```
227
-
228
- After staging, follow `next_action` exactly:
229
-
230
- - `continue_compile_batch` with `human_gate=false`: move to the returned next
231
- View and repeat **Step 2–4**. Do not open Review yet.
232
- - `review_candidates` with `human_gate=true`: every planned View in this
233
- confirmed structure slot is prepared; return to `context status`. If
234
- `pendingStructureTargets` is non-empty, complete those slots first. Delegate
235
- one collection-level Review to
236
- `../skill-review-gate/SKILL.md` only when status
237
- reports the complete multi-slot round ready.
238
- - Use `status.structureBatch` as the complete slot overview. Its evidence Views
239
- are parallel-safe, its structure mutations are serial, and Review opens once
240
- after all declared slots are prepared.
241
-
242
- The CLI blocks Review and close while confirmed Views remain unprepared. Do not
243
- turn sequential View writes into sequential user approvals.
244
-
245
- ### Step 5 — Close Handoff
246
-
247
- After the single collection-level batch review apply, return to `context status`. If status says
248
- `compile-close-needed`, run deterministic close:
249
-
250
- ```bash
251
- context close --format json
252
- ```
253
-
254
- Close derives `knowledge/structure.yaml` and edge projection from approved
255
- knowledge, then runs the final verify gate. It must not rewrite approved
256
- verbatim body. References, changelog, package index, and section fingerprint
257
- rebuilds are not current close output.
258
-
259
- Then route to package output when status reaches `ready-to-build`.
260
-
261
- ### Step 6 — Self-verify Checklist
262
-
263
- - [ ] Compile started from confirmed structure, not a new structure proposal.
264
- - [ ] Node context and schema came from compile phase views.
265
- - [ ] Compile references were read before choosing kind/summary/support.
266
- - [ ] Actions mirror source by default and do not invent body text.
267
- - [ ] No explicit reader-visible `content` was written by the Agent.
268
- - [ ] Relationships are expressed as structure edges, not inserted into
269
- verbatim text.
270
- - [ ] No direct edits were made to `sources/`, `.tmp`, `unapproved/`,
271
- `knowledge/`, review HTML, or `dist/`.
272
- - [ ] Every planned View was staged before opening the one batch Review.
273
-
274
- ### Final Report
275
-
276
- Report in the user's language. Include only:
277
-
278
- - view refs compiled in this round;
279
- - candidate ids staged and whether they contain verbatim or empty sections;
280
- - validation warnings that still matter for review;
281
- - whether review, close, verify, or build is the next status route.
282
-
283
- Do not report internal payload digests, source-ref hashes, internal workspace
284
- paths, absolute paths, scratch file paths, or raw CLI JSON unless the user asks
285
- for debug output.
286
-
287
- </procedures>