@c4a/context-cli 0.5.41-beta.7 → 0.6.0-alpha.6

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 (263) hide show
  1. package/README.md +115 -123
  2. package/babel.cjs +257 -0
  3. package/cli.js +64438 -96584
  4. package/docs/quickstart.md +85 -0
  5. package/package.json +3 -1
  6. package/plugin/.claude-plugin/plugin.json.template +1 -1
  7. package/plugin/.codex-plugin/plugin.json.template +5 -5
  8. package/plugin/.cursor-plugin/plugin.json.template +1 -1
  9. package/plugin/README.md +105 -86
  10. package/plugin/README_CN.md +92 -85
  11. package/plugin/commands/continue.md +34 -0
  12. package/plugin/commands/init.md +13 -130
  13. package/plugin/skills/skill-continue-workflow/SKILL.md +172 -0
  14. package/plugin/skills/skill-init-workspace/SKILL.md +74 -0
  15. package/plugin/skills/skill-package-output/SKILL.md +167 -0
  16. package/plugin/skills/skill-prose-align/SKILL.md +296 -0
  17. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  18. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  19. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  20. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  21. package/plugin/skills/skill-prose-compile/SKILL.md +265 -0
  22. package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  23. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  24. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  25. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  26. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  27. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  28. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  29. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  30. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  31. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  32. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  33. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  34. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  35. package/plugin/skills/skill-review-gate/SKILL.md +98 -0
  36. package/plugin/skills/skill-source-scope/SKILL.md +406 -0
  37. package/plugin/skills/skill-source-scope/references/capture-source.md +180 -0
  38. package/plugins/.agents/plugins/marketplace.json +20 -0
  39. package/plugins/.claude-plugin/marketplace.json +13 -0
  40. package/plugins/.cursor-plugin/marketplace.json +17 -0
  41. package/plugins/README.md +150 -0
  42. package/plugins/README_CN.md +136 -0
  43. package/plugins/VERSION +1 -0
  44. package/plugins/assets/icon.svg +3 -0
  45. package/plugins/assets/logo.svg +3 -0
  46. package/plugins/assets/workflow-en.png +0 -0
  47. package/plugins/assets/workflow.png +0 -0
  48. package/plugins/claude/.claude-plugin/plugin.json +16 -0
  49. package/plugins/claude/.generated +1 -0
  50. package/plugins/claude/CLAUDE.md +5 -0
  51. package/plugins/claude/README.md +5 -0
  52. package/plugins/claude/commands/continue.md +34 -0
  53. package/plugins/claude/commands/init.md +21 -0
  54. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +172 -0
  55. package/plugins/claude/skills/skill-init-workspace/SKILL.md +74 -0
  56. package/plugins/claude/skills/skill-package-output/SKILL.md +167 -0
  57. package/plugins/claude/skills/skill-prose-align/SKILL.md +296 -0
  58. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  59. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  60. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  61. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  62. package/plugins/claude/skills/skill-prose-compile/SKILL.md +265 -0
  63. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  64. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  65. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  66. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  67. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  68. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  69. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  70. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  71. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  72. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  73. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  74. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  75. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  76. package/plugins/claude/skills/skill-review-gate/SKILL.md +98 -0
  77. package/plugins/claude/skills/skill-source-scope/SKILL.md +406 -0
  78. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +180 -0
  79. package/plugins/codex/.codex-plugin/plugin.json +38 -0
  80. package/plugins/codex/.generated +1 -0
  81. package/plugins/codex/AGENTS.md +5 -0
  82. package/plugins/codex/README.md +5 -0
  83. package/plugins/codex/assets/icon.svg +3 -0
  84. package/plugins/codex/assets/logo.svg +3 -0
  85. package/plugins/codex/assets/workflow-en.png +0 -0
  86. package/plugins/codex/assets/workflow.png +0 -0
  87. package/plugins/codex/skills/continue/SKILL.md +47 -0
  88. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  89. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +74 -0
  90. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +167 -0
  91. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  92. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  93. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  94. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  95. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +296 -0
  96. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  97. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  98. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  99. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  100. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  101. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  102. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  103. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  104. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  105. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  106. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  107. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  108. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  109. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +265 -0
  110. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +98 -0
  111. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  112. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +406 -0
  113. package/plugins/codex/skills/init/SKILL.md +34 -0
  114. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +172 -0
  115. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +74 -0
  116. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +167 -0
  117. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  118. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  119. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  120. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  121. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +296 -0
  122. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  123. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  124. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  125. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  126. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  127. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  128. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  129. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  130. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  131. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  132. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  133. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  134. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  135. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +265 -0
  136. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +98 -0
  137. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  138. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +406 -0
  139. package/plugins/cursor/.cursor-plugin/plugin.json +29 -0
  140. package/plugins/cursor/.generated +1 -0
  141. package/plugins/cursor/AGENTS.md +5 -0
  142. package/plugins/cursor/README.md +13 -0
  143. package/plugins/cursor/assets/icon.svg +3 -0
  144. package/plugins/cursor/assets/logo.svg +3 -0
  145. package/plugins/cursor/assets/workflow-en.png +0 -0
  146. package/plugins/cursor/assets/workflow.png +0 -0
  147. package/plugins/cursor/commands/context-continue.md +38 -0
  148. package/plugins/cursor/commands/context-init.md +25 -0
  149. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +172 -0
  150. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +74 -0
  151. package/plugins/cursor/skills/skill-package-output/SKILL.md +167 -0
  152. package/plugins/cursor/skills/skill-prose-align/SKILL.md +296 -0
  153. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  154. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  155. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  156. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  157. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +265 -0
  158. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  159. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  160. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  161. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  162. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  163. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  164. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  165. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  166. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  167. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  168. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  169. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  170. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  171. package/plugins/cursor/skills/skill-review-gate/SKILL.md +98 -0
  172. package/plugins/cursor/skills/skill-source-scope/SKILL.md +406 -0
  173. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +180 -0
  174. package/plugins/skills/context-continue/SKILL.md +47 -0
  175. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  176. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +74 -0
  177. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +167 -0
  178. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  179. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  180. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  181. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  182. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +296 -0
  183. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  184. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  185. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  186. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  187. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  188. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  189. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  190. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  191. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  192. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  193. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  194. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  195. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  196. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +265 -0
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +98 -0
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +406 -0
  200. package/plugins/skills/context-init/SKILL.md +34 -0
  201. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +172 -0
  202. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +74 -0
  203. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +167 -0
  204. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  205. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  206. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  207. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  208. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +296 -0
  209. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  210. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  211. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  212. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  213. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  214. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  215. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  216. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  217. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  218. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  219. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  220. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  221. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  222. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +265 -0
  223. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +98 -0
  224. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  225. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +406 -0
  226. package/scripts/build-plugin.ts +70 -123
  227. package/plugin/commands/align.md +0 -71
  228. package/plugin/commands/capture.md +0 -113
  229. package/plugin/commands/compile.md +0 -112
  230. package/plugin/commands/context.md +0 -36
  231. package/plugin/commands/drop.md +0 -38
  232. package/plugin/commands/extract.md +0 -18
  233. package/plugin/commands/ops.md +0 -47
  234. package/plugin/commands/purge.md +0 -22
  235. package/plugin/commands/query.md +0 -22
  236. package/plugin/commands/status.md +0 -25
  237. package/plugin/skills/skill-align-workflow/SKILL.md +0 -110
  238. package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +0 -60
  239. package/plugin/skills/skill-align-workflow/references/density-profile.md +0 -16
  240. package/plugin/skills/skill-align-workflow/references/gates.md +0 -162
  241. package/plugin/skills/skill-compile-close/SKILL.md +0 -127
  242. package/plugin/skills/skill-compile-draft/SKILL.md +0 -175
  243. package/plugin/skills/skill-compile-draft/references/action-domain-gates.md +0 -34
  244. package/plugin/skills/skill-compile-draft/references/notes.md +0 -34
  245. package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +0 -71
  246. package/plugin/skills/skill-compile-draft/references/structural-challenges.md +0 -76
  247. package/plugin/skills/skill-compile-judge/SKILL.md +0 -112
  248. package/plugin/skills/skill-context-query/SKILL.md +0 -236
  249. package/plugin/skills/skill-drop/SKILL.md +0 -189
  250. package/plugin/skills/skill-semantic-reconcile/SKILL.md +0 -136
  251. package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +0 -31
  252. package/plugin/skills/skill-semantic-reconcile/references/mode-semantics.md +0 -41
  253. package/plugin/skills/skill-semantic-reconcile/references/scope-review-and-omit.md +0 -60
  254. package/plugin/skills/skill-semantic-reconcile/references/temporal-and-evidence.md +0 -58
  255. package/plugin/skills/skill-semantic-reconcile/references/user-confirmation.md +0 -71
  256. package/scripts/build-aspect-runtime.ts +0 -45
  257. package/templates/aspect-runtime/aspectRunnerSdk.js +0 -776
  258. package/templates/aspects/README.md +0 -517
  259. package/templates/aspects/code/README.md +0 -48
  260. package/templates/aspects/code/aspect.yaml +0 -21
  261. package/templates/aspects/design-system/README.md +0 -26
  262. package/templates/aspects/graphql/README.md +0 -24
  263. package/templates/aspects/openapi/README.md +0 -24
@@ -0,0 +1,265 @@
1
+ ---
2
+ name: skill-prose-compile
3
+ description: >
4
+ Internal procedure invoked by the public Context continuation entry; not a user slash 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: `read-plan`, `node-context`, and
25
+ `schema`. Use align evidence views only when the compile view or validation
26
+ output gives a specific source ref that needs exact text.
27
+ - Emit `context.compile-actions.v1`; the CLI mirrors source spans, derives
28
+ `content_mode`, writes review candidates, and enforces source-bound evidence.
29
+ - The `summary` field in each action is the Agent-authored behavior half only:
30
+ compact source-backed recall text for the cited section. The CLI separately
31
+ renders the reachability half from confirmed typed edges into review metadata;
32
+ do not invent edge summaries or relation fields in the action payload.
33
+ - Default to omitted `content` so the CLI mirrors the cited source span.
34
+ Do not write explicit `content`. If the evidence cannot be represented as a
35
+ faithful mirrored continuous span, split the section or return to prose align
36
+ for a confirmed structure change.
37
+ - Before choosing section kind, summary, skip/update, weak-evidence handling, or
38
+ structure repair, read the current procedure references listed by the CLI as
39
+ `semantic_reference_files`. These are the migrated compile judgment rules, not
40
+ summaries.
41
+ - Do not produce or validate compile actions from this entry file alone. If the
42
+ relevant `semantic_reference_files` have not been read in the current turn,
43
+ stop and read them first.
44
+
45
+ <reference>
46
+
47
+ ## User-Facing Gates
48
+
49
+ Use semantic labels, not SDK function names:
50
+
51
+ | Gate | Say this | Do not say this first |
52
+ |---|---|---|
53
+ | Compile context | "I will inspect the confirmed structure and each node's planned evidence before drafting sections." | `node-context`, `context.compile-actions.v1` |
54
+ | Source-bound draft | "I will mirror supported source spans into reviewable draft pages and attach summary/kind metadata." | `compileProse` |
55
+ | 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." |
56
+ | 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 |
57
+
58
+ ## Runtime Discipline
59
+
60
+ - Follow `context status`, `routing.next_commands`, compile view
61
+ `next_action`, and validation diagnostics. Treat CLI commands as the source
62
+ of truth.
63
+ - Use only the returned `next_action.command` for the next required write.
64
+ Treat `allowed_actions[]` as permission for read-only insertions; it is not a
65
+ menu of alternate write paths.
66
+ - Treat `agent_hints[]` as temporary diagnostics. If an agent hint conflicts
67
+ with a status route, compile view `next_action`, or validation result, follow
68
+ the top-level route.
69
+ - Do not use direct file tools, shell scripts, `jq`, `sed`, `cat`, `head`,
70
+ `tail`, Python, or Node.js to inspect `sources/`, `unapproved/`,
71
+ `knowledge/`, `dist/`, or CLI-managed `.tmp` as a substitute for Context
72
+ views.
73
+ - Run one write at a time. Do not parallelize compile stage, review apply,
74
+ close, or build writes.
75
+ - Compile does not get a second, looser rule set. If a rule conflicts with the
76
+ current CLI schema or diagnostics, follow the CLI and repair the payload.
77
+ - Write digest/hash flags are stale guards. Use values returned by the CLI; do
78
+ not parse stdout fragments or host tool-result files to reconstruct them.
79
+ - If a payload is too large for a heredoc, stage it under
80
+ `.tmp/agent-payloads/<run-id>/...` in the workspace root and redirect stdin
81
+ from that file. Never reuse fixed `/tmp/c4a-*` names, and never place agent
82
+ scratch payloads under CLI-managed `.tmp/context-cli/`, `sources/`,
83
+ `unapproved/`, `knowledge/`, `dist/`, review output, or package output
84
+ directories.
85
+
86
+ ## Compile Views
87
+
88
+ Recommended read order:
89
+
90
+ ```bash
91
+ context run compile:<type>:<source>:<collection> --view read-plan --format json
92
+ context run compile:<type>:<source>:<collection> --view node-context --source <view-ref> --format json
93
+ context run compile:<type>:<source>:<collection> --view schema --format json
94
+ ```
95
+
96
+ Use CLI-returned `available_view_refs`, `planned_sections`, `local_sources`, and
97
+ `next_action.command`. Do not reconstruct the structure by opening
98
+ `unapproved/structure.yaml` or `knowledge/structure.yaml` directly.
99
+
100
+ ## Procedure References
101
+
102
+ These are current compile rules for source-bound drafting, judgment, semantic
103
+ repair, and close handoff.
104
+
105
+ | Decision | Reference |
106
+ |---|---|
107
+ | Compile action drafting, section kind, coverage, summaries, content intent | [skill-prose-compile/references/internal-procedures/compile-actions.md](skill-prose-compile/references/internal-procedures/compile-actions.md) |
108
+ | Action/domain compile gates | [skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md](skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md) |
109
+ | Notes, refresh/update, and structural challenges | [skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md](skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md), [skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md](skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md), [skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md](skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md) |
110
+ | Support, duplicate, replacement, conflict, weak evidence, and relation judgment | [skill-prose-compile/references/internal-procedures/compile-judgment.md](skill-prose-compile/references/internal-procedures/compile-judgment.md), [skill-prose-compile/references/internal-procedures/semantic-judgment.md](skill-prose-compile/references/internal-procedures/semantic-judgment.md) |
111
+ | Leakage, ownership, temporal evidence, disposition, omit, and user confirmation | [skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md](skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md), [skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md](skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md), [skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md](skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md), [skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md](skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md), [skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md](skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md) |
112
+ | Close gate and current close output boundaries | [skill-prose-compile/references/internal-procedures/close-gate.md](skill-prose-compile/references/internal-procedures/close-gate.md) |
113
+
114
+ ## Compile Contract
115
+
116
+ The compile action payload uses `schema_version: context.compile-actions.v1`.
117
+ Compile may:
118
+
119
+ - mirror source spans as `verbatim`;
120
+ - emit `skip` decisions when no source-backed body should be written. `skip`
121
+ does not produce a placeholder candidate; generated parent-index pages use
122
+ the parent-index compile path, not an action payload placeholder.
123
+
124
+ Relationships and cross references do not go into verbatim body. In current
125
+ output they stay in `structure.yaml` typed edges; this workflow does not render
126
+ relationship reference blocks.
127
+
128
+ </reference>
129
+
130
+ <procedures>
131
+
132
+ ### Step 1 — Open Compile Context
133
+
134
+ Run:
135
+
136
+ ```bash
137
+ context run compile:<type>:<source>:<collection> --view read-plan --format json
138
+ ```
139
+
140
+ Use the returned node list, source overview, and next action. If the CLI says
141
+ the structure is missing, unconfirmed, stale, frozen against the wrong
142
+ snapshot, or invalid, return to prose align or source capture as indicated.
143
+
144
+ ### Step 2 — Inspect One Node
145
+
146
+ For each node that should become draft knowledge, run:
147
+
148
+ ```bash
149
+ context run compile:<type>:<source>:<collection> --view node-context --source <view-ref> --format json
150
+ context run compile:<type>:<source>:<collection> --view schema --format json
151
+ ```
152
+
153
+ Read the compile references listed by `semantic_reference_files` before
154
+ classifying section kind, summary, support, skip/update, weak evidence, or
155
+ structure repair.
156
+
157
+ Do not treat those references as optional background. They are the current
158
+ compile drafting, judgment, and semantic-repair procedures.
159
+
160
+ When exact evidence text is needed, use the CLI-returned source ref with the
161
+ current evidence view. Do not open snapshot files directly.
162
+
163
+ ### Step 3 — Draft And Validate Actions
164
+
165
+ Create a `context.compile-actions.v1` payload for the selected view. Prefer
166
+ omitted `content` with `source_refs[]` so the CLI mirrors source spans.
167
+ If the source evidence is non-contiguous or contains separable examples,
168
+ configuration blocks, lists, or procedures, split the compile actions when the
169
+ confirmed structure supports that split. If the structure is too coarse, return
170
+ to prose align and ask the user to confirm a section split instead of writing
171
+ summarized body text. Explicit `content` / `content_intent` is not part of the
172
+ current compile contract.
173
+
174
+ For small payloads, use stdin/heredoc. For larger payloads, write a scratch file
175
+ under `.tmp/agent-payloads/<run-id>/` and pass it through `--input`. Scratch
176
+ files are disposable agent working files; they are never compile state and must
177
+ not be read back as a substitute for CLI views.
178
+
179
+ Validate:
180
+
181
+ ```bash
182
+ context run compile:<type>:<source>:<collection> --validate --input <compile-actions.yaml> --format json
183
+ ```
184
+
185
+ Repair diagnostics by routing them to the right decision:
186
+
187
+ - source ref or planned-section mismatch -> reread node-context, or return to
188
+ structure confirmation if ownership is wrong;
189
+ - unsupported kind or op -> use the schema view and current compile references;
190
+ - explicit content -> omit `content` and mirror source, or return to align for
191
+ a section split;
192
+ - weak evidence, duplicate, conflict, omit, or scope issue -> use the compile
193
+ judgment / semantic judgment references and ask the user when required;
194
+ - frozen structure mismatch -> rerun status and return to align/capture as
195
+ directed.
196
+
197
+ Use typed diagnostics as the repair contract:
198
+
199
+ - `reason_code`, `path`, and `missing[]` identify what to fix;
200
+ - warnings are not write blockers unless the response marks them blocking or
201
+ the next action says so;
202
+ - weak evidence, duplicate, conflict, temporal, leakage, ownership, and scope
203
+ issues are semantic review issues, not formatting problems;
204
+ - raw/source-ref pointer diagnostics are evidence checks, not content-quality
205
+ judges.
206
+
207
+ When validation returns a new `next_action.command`, follow that exact command.
208
+ When it returns blocking diagnostics without a write command, repair and
209
+ validate again. Do not stage a compile payload just because the YAML shape looks
210
+ valid.
211
+
212
+ ### Step 4 — Stage Draft Candidates
213
+
214
+ Stage only after validation has no errors:
215
+
216
+ ```bash
217
+ context run compile:<type>:<source>:<collection> --stage --input <compile-actions.yaml> --format json
218
+ ```
219
+
220
+ After staging, return to `context status`. If status reaches
221
+ `compile-ready-for-review`, delegate review to
222
+ `skill-review-gate.md`.
223
+
224
+ ### Step 5 — Close Handoff
225
+
226
+ After review apply, return to `context status`. If status says
227
+ `compile-close-needed`, run deterministic close:
228
+
229
+ ```bash
230
+ context close --format json
231
+ ```
232
+
233
+ Close derives `knowledge/structure.yaml` and edge projection from approved
234
+ knowledge, then runs the final verify gate. It must not rewrite approved
235
+ verbatim body. References, changelog, package index, and section fingerprint
236
+ rebuilds are not current close output.
237
+
238
+ Then route to package output when status reaches `ready-to-build`.
239
+
240
+ ### Step 6 — Self-verify Checklist
241
+
242
+ - [ ] Compile started from confirmed structure, not a new structure proposal.
243
+ - [ ] Node context and schema came from compile phase views.
244
+ - [ ] Compile references were read before choosing kind/summary/support.
245
+ - [ ] Actions mirror source by default and do not invent body text.
246
+ - [ ] No explicit reader-visible `content` was written by the Agent.
247
+ - [ ] Relationships are expressed as structure edges, not inserted into
248
+ verbatim text.
249
+ - [ ] No direct edits were made to `sources/`, `.tmp`, `unapproved/`,
250
+ `knowledge/`, review HTML, or `dist/`.
251
+
252
+ ### Final Report
253
+
254
+ Report in the user's language. Include only:
255
+
256
+ - view refs compiled in this round;
257
+ - candidate ids staged and whether they contain verbatim or empty sections;
258
+ - validation warnings that still matter for review;
259
+ - whether review, close, verify, or build is the next status route.
260
+
261
+ Do not report internal payload digests, source-ref hashes, internal workspace
262
+ paths, absolute paths, scratch file paths, or raw CLI JSON unless the user asks
263
+ for debug output.
264
+
265
+ </procedures>
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: skill-review-gate
3
+ description: >
4
+ Internal procedure invoked by the public Context continuation entry; not a user slash command.
5
+ Opens the review UI, waits for user decisions, applies copied JSONL payloads,
6
+ and prevents agent-authored approval/rejection decisions unless the user
7
+ explicitly requests the scoped quick-decision path.
8
+ tools:
9
+ - Bash
10
+ ---
11
+
12
+ # skill-review-gate
13
+
14
+ Run the human review gate. The user decides approval or rejection.
15
+
16
+ ## TL;DR
17
+
18
+ - The agent never approves or rejects candidates on the user's behalf.
19
+ - Use `context review html <collection> --open` for visual review.
20
+ - `<collection>` is an internal production collection such as `architecture`,
21
+ `sop`, `decision`, or `standards`; it is not an OKF package root such as
22
+ `wikis`, `guides`, or `rules`.
23
+ - If browser opening fails or the host cannot make a path clickable, provide the
24
+ `file://` URL.
25
+ - Apply only the JSONL payload copied by the user from the review UI.
26
+ - Do not parse `unapproved/entities.jsonl`, `.tmp`, or HTML internals with
27
+ scripts to synthesize decisions.
28
+ - If the user explicitly asks for quick or automated approval/rejection, use
29
+ `context review approve <candidate-id> --collection <collection>` /
30
+ `context review reject <candidate-id> --collection <collection>` or `--all`;
31
+ these commands still enforce the current scoped candidate-id gate.
32
+
33
+ <procedures>
34
+
35
+ ### Step 1 — Open Review
36
+
37
+ For the internal collection reported by status, run:
38
+
39
+ ```bash
40
+ context review html <collection> --open
41
+ ```
42
+
43
+ Tell the user where the page opened. If needed, provide a clickable
44
+ `file://.../<collection>.html` URL or the exact path printed by the CLI. Do
45
+ not assume a fixed review filename; review scope is collection or `--all`.
46
+ Do not substitute OKF package roots (`wikis`, `guides`, `rules`) for this
47
+ argument; review scope is the internal collection namespace.
48
+
49
+ Explain that this page is the human gate between draft candidates and approved
50
+ knowledge. Approved entries become Markdown under `knowledge/`; rejected entries
51
+ stay in the committed ledger and are not written as knowledge pages. The agent
52
+ must not choose these states.
53
+
54
+ ### Step 2 — Wait For Payload
55
+
56
+ Ask the user to review candidates in the HTML page, open Payload, copy the
57
+ compact JSONL payload, and paste it into the agent chat. The payload records the
58
+ user's decisions, usually as a default decision plus exceptions, so it should
59
+ not be expanded into pretty JSON unless the user asks.
60
+
61
+ The user should not need to create a payload file manually. Do not continue
62
+ until the user supplies that payload.
63
+
64
+ If the user instead explicitly asks the agent to use the quick approval or
65
+ rejection path, do not synthesize JSONL. Run the scoped quick command with the
66
+ candidate id shown by review/list/status and either `--collection <collection>`
67
+ or `--all`.
68
+
69
+ ### Step 3 — Apply Payload
70
+
71
+ After the user pastes the payload into chat, the agent writes it to a normal
72
+ temporary file under the current workspace `.tmp/` directory and runs:
73
+
74
+ ```bash
75
+ context review apply <payload-file>
76
+ ```
77
+
78
+ Do not accept or emit alternate `{ "decisions": [...] }` JSON. Use only
79
+ `context.review.decisions.v1` JSONL.
80
+ Do not use unsupported scratch, workflow, compile, or `.context/config.yaml`
81
+ commands to store this payload.
82
+
83
+ ### Step 4 — Return To Status
84
+
85
+ Run `context status` after apply. If it reports package output choice, return to
86
+ `skill-continue-workflow.md`.
87
+
88
+ ### Step 5 — Self-verify Checklist
89
+
90
+ - [ ] Every decision came from the user's copied payload. If not, stop and
91
+ discard the agent-authored decision, unless the user explicitly requested a
92
+ scoped quick command and that command used `--collection` or `--all`.
93
+ - [ ] Payload was applied through `context review apply`. If not, return to
94
+ **Step 3**.
95
+ - [ ] No direct edits were made to `knowledge/` or `unapproved/`. If not, report
96
+ the protocol error.
97
+
98
+ </procedures>
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: capture-source
3
+ description: >
4
+ Capture local Markdown or Lark/Feishu document sources through registered
5
+ Context sources and declared capture phases. Use the local `context` CLI for
6
+ workspace writes.
7
+ tools:
8
+ - Bash
9
+ ---
10
+
11
+ # Capture
12
+
13
+ Current capture discipline for document sources. The executable path is source
14
+ registration plus the declared capture phase flow:
15
+
16
+ - local Markdown/MDX file source: `context source add file <name> --local <path>`
17
+ followed by `context run capture:file:<name> --format json`;
18
+ - Lark/Feishu source: `context source add lark <name> ...` followed by
19
+ `context run capture:lark:<name> --format json`;
20
+ - refresh: rerun the same declared capture phase after status or the user asks
21
+ for recapture.
22
+
23
+ Use only commands surfaced by the current status output or capture phase.
24
+
25
+ ---
26
+
27
+ ## Workflow
28
+
29
+ Capture is entirely CLI-driven — your role is to register the right source,
30
+ declare the matching capture phase, run the current `context run capture:*`
31
+ command, and relay its output. Never hand-write captured source snapshots: the
32
+ CLI owns normalisation (NFC, BOM strip, line endings) and the `content_hash`
33
+ contract, so any manual edit breaks idempotency.
34
+
35
+ ### Code capture diagnostics
36
+
37
+ Do not run hand-written dependency preflight commands before code extraction or
38
+ document capture. The CLI owns configured runner/plugin resolution and returns
39
+ structured `agent_hints[]` when a runner or remote-document helper is missing or
40
+ misconfigured.
41
+
42
+ If code extraction capture fails with install or runner hints, surface the CLI's `agent_hints[]` command exactly as printed. Ask the user once whether to run that command on their behalf when it touches shared state. If approved, run the exact command from `agent_hints[0].command`, then retry the same capture command. If declined, leave the command visible so the user can run it manually. Do not inline extraction packages, do not hand-write code snapshots, and do not continue with partial capture.
43
+
44
+ Invocation note: document capture and code extraction do not run through `npx`.
45
+ Use the installed `context` CLI and the declared phase command returned by
46
+ `context status` or the phase view. When external helpers are missing, surface
47
+ the CLI's structured install hints instead of substituting your own package
48
+ manager or version.
49
+
50
+ ### Route by source boundary
51
+
52
+ Before choosing a local Markdown capture route, honor the surrounding task context. Driver documents such as run instructions, handbooks, READMEs, plans, feedback issues, corpus/index/manifests, and batch lists are not Context sources unless the user explicitly asks to ingest them. Capture only ingest targets that are already explicit in the user request; if they are missing, ask one clarification instead of capturing the driver document.
53
+
54
+ - One or more local `.md` / `.mdx` files or a local documentation folder to ingest →
55
+ register one file source with the user-confirmed source name and boundary:
56
+ `context source add file <name> --local <file-or-folder>`. For an explicit
57
+ batch inside a broader folder, preserve the user's include list on source
58
+ registration. Default file capture handles `.md`. If the CLI reports
59
+ document-site files such as `.mdx`, `_meta.json`, sidebars, or docs config,
60
+ stop and confirm whether the selected boundary is a documentation site before
61
+ changing capture configuration. For MDX documentation sites that use
62
+ `_meta.json`, declare `mdxJsonDocs()` on `captureFile` in `src/index.ts`;
63
+ keep `_meta.json` only when it is route metadata for the selected document
64
+ folder. The CLI captures it as metadata and generates
65
+ `__context_route_metadata.md` as mechanical route evidence; it also extracts
66
+ static MDX component props/children into `__context_mdx_component_text.md`
67
+ when components carry user-facing text. Declare
68
+ `captureFile({ source: source("<name>"), processor: mdxJsonDocs() })`, then
69
+ run `context run capture:file:<name> --format json`. If the selected MDX page
70
+ is empty or only mounts runtime-rendered content, tell the user that capture
71
+ found a document-site shell and ask for the rendered-site or data-source
72
+ boundary instead of inventing body text.
73
+ - A Lark/Feishu URL, doc token, or wiki token → register one Lark source:
74
+ `context source add lark <name> --url <url>` or the matching token flag.
75
+ Declare `captureLark({ source: source("<name>") })`, then run
76
+ `context run capture:lark:<name> --format json`.
77
+ - Mixed local document and Lark document batches are separate sources unless
78
+ the current CLI explicitly offers a combined source contract. Do not write an
79
+ Agent-side URL/file loop.
80
+ - Refresh or recapture request for an already registered file/Lark source →
81
+ rerun the same declared capture phase. The CLI appends a new snapshot only
82
+ when content changes and never overwrites prior snapshots.
83
+ - Code package extraction is not document capture. Route code source selection
84
+ through `skill-source-scope` extraction preview and the declared extract
85
+ phase. Do not invent a document capture path for code.
86
+ - Conversation notes, decisions, and revision intents are not document capture
87
+ sources in the current workflow unless the CLI status or project-specific
88
+ phase exposes an explicit note source contract. If absent, record the user
89
+ guidance in the conversation and use it as pre-align hints, not as a snapshot
90
+ write.
91
+
92
+ Do not discover files with `find` / `ls` when the user already supplied paths.
93
+ If the include set is large, summarize it and ask for confirmation before
94
+ registration; do not read file bodies before capture permission is clear.
95
+
96
+ ### Output Handling
97
+
98
+ Report the CLI output verbatim. If the CLI reports `N sources changed`, suggest the right next step:
99
+
100
+ - Run `context status --format json` and use its `state`, `routing`, and
101
+ `next_commands`.
102
+ - If status reports `captured-ready-to-investigate`, suggest the returned
103
+ `context run align:<type>:<source>:<collection> --view read-plan --format json`
104
+ command and hand off to `skill-prose-align`.
105
+ - If status reports `needs-structure` or `structure-ready`, follow the returned
106
+ align/compile command instead of naming a generic slash command.
107
+ - If status reports `compile-ready-for-review`, route to the review gate.
108
+ - If the source was code-only and status reports pending code projection,
109
+ follow the CLI-owned extract/compile route returned by status.
110
+
111
+ Never suggest prose compile or hand-built document knowledge for a code-only
112
+ source. Code sources become active knowledge only through the declared
113
+ extraction/review route returned by `context status`.
114
+
115
+ If capture is rejected because another phase or write gate is active, do not
116
+ discard it automatically. Explain the active state from `context status`, follow
117
+ that phase when it is the intended task, and ask the user before discarding
118
+ in-progress work when a current project command exists. If the user expected a
119
+ different repository/workspace, change to the confirmed workspace root before
120
+ retrying capture.
121
+
122
+ ## Final Report
123
+
124
+ Report in the user's conversation language. Translate section headings into the user's language instead of copying the English labels below verbatim. Optimize for human readability: use document titles instead of source ids, package names instead of internal source id strings, and human-readable kind labels ("local markdown", "Feishu doc", "code package") instead of internal tokens. Do not surface content hashes, snapshot digests, internal payload identifiers, or absolute file paths.
125
+
126
+ Stable structure:
127
+
128
+ 1. Completion headline. Single line with the action verb plus core counts: how
129
+ many sources were captured this round, broken down by `new` / `updated` /
130
+ `unchanged`. Capture data from the current `context run capture:* --format
131
+ json` result summary, or per-source statuses when no aggregate is returned.
132
+ 2. Per-source list grouped by status. Show each captured source under one of three groups (`new` / `updated` / `unchanged`); within each group list the document title (`source.title`), kind label, and a short delta indicator for updated sources (for example added/removed line counts when the CLI returns them; otherwise "content changed"). Cache-hit code packages belong in `unchanged`. Omit groups that are empty.
133
+ 3. Pending phase signals. When `context status --format json` reports follow-up
134
+ work tied to this capture (sources pending align, sources pending compile,
135
+ refreshed sources pending recompile, code sources pending projection),
136
+ summarize each as a single line naming the work and which sources are
137
+ affected. Omit the section entirely when there is no pending follow-up.
138
+ 4. Next step. Single command suggestion driven by status: the returned
139
+ `context run align:<type>:<source>:<collection> ...` command when structure work is
140
+ pending, the returned `context run compile:<type>:<source>:<collection> ...`
141
+ command when prose compile work is pending, or the CLI-owned code projection
142
+ command when code projection is pending. If nothing is pending, say so
143
+ explicitly.
144
+
145
+ Do not include raw CLI diagnostics, agent_hints content, schema names, or phase
146
+ payload identifiers in the report. Those belong in earlier troubleshooting
147
+ output, not in the completion summary.
148
+
149
+ ## Reference
150
+
151
+ ### Missing Dependency Recovery
152
+
153
+ If the CLI returns `agent_hints[]` for a missing code runner or plugin package, stop and surface the hint. Ask the user once for permission to run `agent_hints[0].command` (the CLI has already picked the correct package manager — `npm install -g` or `bun install -g` — based on how `context` itself was installed). If approved, run that exact command via `Bash` and then retry the same capture; if declined, leave the command visible for manual install. Never substitute a different package manager or version.
154
+
155
+ If the CLI prints a missing-dependency error like `lark-cli not installed`, walk the user through installation:
156
+
157
+ 1. Ask once up-front whether to proceed with install. If no → stop and tell the user to install manually from the tool's official README, then re-run.
158
+ 2. `WebFetch` the tool's official README (for `lark-cli` that's `https://github.com/larksuite/cli/blob/main/README.md#quick-start-ai-agent`).
159
+ 3. For each command the README prescribes for the user's platform, show the command then call `Bash`. The host's per-tool permission prompt is the user's confirmation surface; don't add extra y/n questions between commands.
160
+ 4. Stop on any failure; surface stderr verbatim.
161
+ 5. After success, tell the user to rerun the current Context command that
162
+ failed.
163
+
164
+ ### Language Policy
165
+
166
+ Your prose to the user follows the user's conversation language. CLI commands, flag names, URLs, env-var names, binary names, source-ids stay English.
167
+
168
+ ### Invariants
169
+
170
+ - Captured source snapshots are immutable post-write — the CLI only ever appends new snapshots.
171
+ - The source registry is authoritative; derived index files are not Agent phase
172
+ inputs.
173
+ - Local `.md` / `.mdx` source identity follows the captured file's stable origin path, not its H1/title. If the user edits the title but captures the same path again, the CLI appends a new snapshot to the same `local:*` source.
174
+ - In `--format json`, code capture runner cache state is authoritative in `result.runner.cacheMode`: `prepared` means a workspace runner was prepared, `cached` means workspace cache hit, and `bypass` means `--no-runner-cache` used a temporary runner directory instead of the workspace runner cache.
175
+ - Code extraction runner evidence is derived by the CLI from emitted source files. Do not ask users to configure `evidence.mode`; rerun capture after fixing the runner emit output.
176
+ - Code extraction snapshots ship with `evidence.mode: none`; symbols/files/edges are indexed inside the code bucket. Do not ask users to inspect or repair a code `.evidence` manifest.
177
+ - Code extraction/projection is separate from document capture. Materialize code
178
+ knowledge through the declared extract/code projection flow before prose align
179
+ attaches documentation to code Nodes.
180
+ - On duplicate capture of the same URL: identical `content_hash` → CLI skips with `unchanged`; different hash → CLI appends a new snapshot.