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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +115 -123
  2. package/babel.cjs +257 -0
  3. package/cli.js +51018 -96457
  4. package/docs/quickstart.md +85 -0
  5. package/package.json +3 -1
  6. package/plugin/.claude-plugin/plugin.json.template +1 -1
  7. package/plugin/.codex-plugin/plugin.json.template +5 -5
  8. package/plugin/.cursor-plugin/plugin.json.template +1 -1
  9. package/plugin/README.md +105 -85
  10. package/plugin/README_CN.md +92 -84
  11. package/plugin/commands/continue.md +34 -0
  12. package/plugin/commands/init.md +13 -130
  13. package/plugin/skills/skill-continue-workflow/SKILL.md +172 -0
  14. package/plugin/skills/skill-init-workspace/SKILL.md +74 -0
  15. package/plugin/skills/skill-package-output/SKILL.md +167 -0
  16. package/plugin/skills/skill-prose-align/SKILL.md +296 -0
  17. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  18. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  19. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  20. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  21. package/plugin/skills/skill-prose-compile/SKILL.md +265 -0
  22. package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  23. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  24. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  25. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  26. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  27. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  28. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  29. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  30. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  31. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  32. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  33. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  34. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  35. package/plugin/skills/skill-review-gate/SKILL.md +98 -0
  36. package/plugin/skills/skill-source-scope/SKILL.md +402 -0
  37. package/plugin/skills/skill-source-scope/references/capture-source.md +171 -0
  38. package/plugins/.agents/plugins/marketplace.json +20 -0
  39. package/plugins/.claude-plugin/marketplace.json +13 -0
  40. package/plugins/.cursor-plugin/marketplace.json +17 -0
  41. package/plugins/README.md +150 -0
  42. package/plugins/README_CN.md +136 -0
  43. package/plugins/VERSION +1 -0
  44. package/plugins/assets/icon.svg +3 -0
  45. package/plugins/assets/logo.svg +3 -0
  46. package/plugins/assets/workflow-en.png +0 -0
  47. package/plugins/assets/workflow.png +0 -0
  48. package/plugins/claude/.claude-plugin/plugin.json +16 -0
  49. package/plugins/claude/.generated +1 -0
  50. package/plugins/claude/CLAUDE.md +5 -0
  51. package/plugins/claude/README.md +5 -0
  52. package/plugins/claude/commands/continue.md +34 -0
  53. package/plugins/claude/commands/init.md +21 -0
  54. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +172 -0
  55. package/plugins/claude/skills/skill-init-workspace/SKILL.md +74 -0
  56. package/plugins/claude/skills/skill-package-output/SKILL.md +167 -0
  57. package/plugins/claude/skills/skill-prose-align/SKILL.md +296 -0
  58. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  59. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  60. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  61. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  62. package/plugins/claude/skills/skill-prose-compile/SKILL.md +265 -0
  63. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  64. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  65. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  66. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  67. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  68. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  69. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  70. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  71. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  72. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  73. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  74. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  75. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  76. package/plugins/claude/skills/skill-review-gate/SKILL.md +98 -0
  77. package/plugins/claude/skills/skill-source-scope/SKILL.md +402 -0
  78. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +171 -0
  79. package/plugins/codex/.codex-plugin/plugin.json +38 -0
  80. package/plugins/codex/.generated +1 -0
  81. package/plugins/codex/AGENTS.md +5 -0
  82. package/plugins/codex/README.md +5 -0
  83. package/plugins/codex/assets/icon.svg +3 -0
  84. package/plugins/codex/assets/logo.svg +3 -0
  85. package/plugins/codex/assets/workflow-en.png +0 -0
  86. package/plugins/codex/assets/workflow.png +0 -0
  87. package/plugins/codex/skills/continue/SKILL.md +47 -0
  88. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  89. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +74 -0
  90. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +167 -0
  91. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  92. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  93. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  94. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  95. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +296 -0
  96. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  97. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  98. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  99. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  100. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  101. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  102. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  103. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  104. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  105. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  106. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  107. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  108. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  109. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +265 -0
  110. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +98 -0
  111. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  112. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +402 -0
  113. package/plugins/codex/skills/init/SKILL.md +34 -0
  114. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +172 -0
  115. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +74 -0
  116. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +167 -0
  117. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  118. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  119. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  120. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  121. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +296 -0
  122. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  123. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  124. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  125. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  126. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  127. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  128. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  129. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  130. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  131. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  132. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  133. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  134. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  135. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +265 -0
  136. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +98 -0
  137. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  138. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +402 -0
  139. package/plugins/cursor/.cursor-plugin/plugin.json +29 -0
  140. package/plugins/cursor/.generated +1 -0
  141. package/plugins/cursor/AGENTS.md +5 -0
  142. package/plugins/cursor/README.md +13 -0
  143. package/plugins/cursor/assets/icon.svg +3 -0
  144. package/plugins/cursor/assets/logo.svg +3 -0
  145. package/plugins/cursor/assets/workflow-en.png +0 -0
  146. package/plugins/cursor/assets/workflow.png +0 -0
  147. package/plugins/cursor/commands/context-continue.md +38 -0
  148. package/plugins/cursor/commands/context-init.md +25 -0
  149. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +172 -0
  150. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +74 -0
  151. package/plugins/cursor/skills/skill-package-output/SKILL.md +167 -0
  152. package/plugins/cursor/skills/skill-prose-align/SKILL.md +296 -0
  153. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  154. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  155. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  156. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  157. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +265 -0
  158. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  159. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  160. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  161. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  162. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  163. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  164. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  165. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  166. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  167. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  168. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  169. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  170. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  171. package/plugins/cursor/skills/skill-review-gate/SKILL.md +98 -0
  172. package/plugins/cursor/skills/skill-source-scope/SKILL.md +402 -0
  173. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +171 -0
  174. package/plugins/skills/context-continue/SKILL.md +47 -0
  175. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  176. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +74 -0
  177. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +167 -0
  178. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  179. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  180. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  181. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  182. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +296 -0
  183. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  184. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  185. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  186. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  187. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  188. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  189. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  190. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  191. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  192. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  193. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  194. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  195. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  196. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +265 -0
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +98 -0
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +402 -0
  200. package/plugins/skills/context-init/SKILL.md +34 -0
  201. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +172 -0
  202. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +74 -0
  203. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +167 -0
  204. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  205. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  206. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  207. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  208. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +296 -0
  209. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  210. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  211. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  212. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  213. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  214. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  215. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  216. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  217. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  218. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  219. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  220. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  221. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  222. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +265 -0
  223. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +98 -0
  224. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  225. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +402 -0
  226. package/scripts/build-plugin.ts +70 -126
  227. package/plugin/commands/align.md +0 -71
  228. package/plugin/commands/capture.md +0 -113
  229. package/plugin/commands/compile.md +0 -103
  230. package/plugin/commands/context.md +0 -35
  231. package/plugin/commands/drop.md +0 -38
  232. package/plugin/commands/extract.md +0 -18
  233. package/plugin/commands/purge.md +0 -22
  234. package/plugin/commands/query.md +0 -22
  235. package/plugin/commands/status.md +0 -25
  236. package/plugin/skills/skill-align-workflow/SKILL.md +0 -110
  237. package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +0 -60
  238. package/plugin/skills/skill-align-workflow/references/density-profile.md +0 -16
  239. package/plugin/skills/skill-align-workflow/references/gates.md +0 -162
  240. package/plugin/skills/skill-compile-close/SKILL.md +0 -127
  241. package/plugin/skills/skill-compile-draft/SKILL.md +0 -175
  242. package/plugin/skills/skill-compile-draft/references/action-domain-gates.md +0 -34
  243. package/plugin/skills/skill-compile-draft/references/notes.md +0 -34
  244. package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +0 -71
  245. package/plugin/skills/skill-compile-draft/references/structural-challenges.md +0 -76
  246. package/plugin/skills/skill-compile-judge/SKILL.md +0 -112
  247. package/plugin/skills/skill-context-query/SKILL.md +0 -233
  248. package/plugin/skills/skill-drop/SKILL.md +0 -189
  249. package/plugin/skills/skill-semantic-reconcile/SKILL.md +0 -136
  250. package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +0 -31
  251. package/plugin/skills/skill-semantic-reconcile/references/mode-semantics.md +0 -41
  252. package/plugin/skills/skill-semantic-reconcile/references/scope-review-and-omit.md +0 -60
  253. package/plugin/skills/skill-semantic-reconcile/references/temporal-and-evidence.md +0 -58
  254. package/plugin/skills/skill-semantic-reconcile/references/user-confirmation.md +0 -71
  255. package/scripts/build-aspect-runtime.ts +0 -45
  256. package/templates/aspect-runtime/aspectRunnerSdk.js +0 -776
  257. package/templates/aspects/README.md +0 -517
  258. package/templates/aspects/code/README.md +0 -48
  259. package/templates/aspects/code/aspect.yaml +0 -21
  260. package/templates/aspects/design-system/README.md +0 -26
  261. package/templates/aspects/graphql/README.md +0 -24
  262. package/templates/aspects/openapi/README.md +0 -24
@@ -0,0 +1,402 @@
1
+ ---
2
+ name: skill-source-scope
3
+ description: >
4
+ Internal procedure invoked by the public Context continuation entry; not a user slash command.
5
+ Handles source registration, monorepo source boundaries, extract phase
6
+ declaration, no-write scope preview, and the pre-extraction confirmation gate.
7
+ tools:
8
+ - Bash
9
+ ---
10
+
11
+ # skill-source-scope
12
+
13
+ Choose and validate what may become draft knowledge.
14
+
15
+ ## TL;DR
16
+
17
+ - Missing source means the next product action is "add a knowledge source".
18
+ Explain that in user-facing language before showing any CLI command.
19
+ - Ask what source the user wants to add: local code repo/package, remote Git
20
+ repo/package, local Markdown/MDX document/folder, article/documentation repo as a
21
+ file source, or Lark/Feishu document. Current CLI can execute repo sources,
22
+ local file sources, and Lark document capture through the declared flow.
23
+ - Treat source registration as a knowledge-boundary decision, not a parameter
24
+ prompt. Explain that the source name becomes a stable namespace in source
25
+ refs, phase ids, and package naming. Approved knowledge paths are derived
26
+ later from collection, containment, and slug. Give concrete examples before
27
+ asking for confirmation.
28
+ - If the user already provided a path and only the source name is missing, still
29
+ explain what that name means. Do not ask "confirm source name" without saying
30
+ whether the boundary is a single package/module or a parent monorepo/subspace
31
+ namespace.
32
+ - Do not infer a source from cwd, parent directories, package names, monorepo
33
+ layout, or git remote.
34
+ - In monorepos, one source may conceptually be the whole repo/subspace or one
35
+ package/subdirectory. If the user wants one package manual, prefer the
36
+ package/subdirectory. If the user wants one unified knowledge product across
37
+ modules, explain that the source name becomes the repo/source identity and
38
+ may be used in codegraph NodeRefs such as `codegraph/product-ui/...` when the
39
+ extraction rules derive those refs. Current repo extraction
40
+ still requires choosing a concrete single-module extraction boundary before
41
+ running extraction; do not run extraction against an ambiguous multi-module
42
+ source.
43
+ - `extractTs.include` filters files inside the selected source; it is not a
44
+ package/module selector.
45
+ - Use `context source inspect <source-name> --format json` for module choices.
46
+ - Before first real extraction, generate a no-write preview and show module
47
+ counts plus `knowledgeTree` / `knowledgePathExamples` to the user. Use
48
+ `--dry-run` only in the command you execute, not as the user-facing label.
49
+ - Human-facing explanations must describe the extraction impact first: what code
50
+ files are read, what symbols become draft knowledge, what is skipped, and what
51
+ review gate follows. Do not lead with `extractTs`, `include`, `exportedOnly`,
52
+ or `reviewValidity`.
53
+ - Document capture has its own gate. After a file or Lark source is registered,
54
+ ask for permission before reading the source body, then show the capture
55
+ summary before handing off to material investigation and structure drafting.
56
+ Do not default to one page per document, and do not create final draft pages
57
+ directly from capture.
58
+ - For capture routing, output handling, missing dependency recovery, and final
59
+ reporting discipline, read the source capture procedure at
60
+ [skill-source-scope/references/capture-source.md](skill-source-scope/references/capture-source.md). Its judgment
61
+ rules use only the declared source/capture phase flow in this skill.
62
+ - Do not use unsupported source lifecycle shortcuts. There is no direct
63
+ source deletion or purge command in this workflow, and agents must not delete
64
+ `sources/`, `knowledge/`, `unapproved/`, `dist/`, or `.tmp` to simulate one.
65
+ If the user asks to retract, remove, or purge a source, stop and explain that
66
+ the current plugin exposes no approved gate for that operation.
67
+
68
+ <reference>
69
+
70
+ ## Source Type Guide
71
+
72
+ When the workspace has no source, do not ask with a raw placeholder command.
73
+ Ask for a knowledge source in plain language and map it to the supported path:
74
+
75
+ | User source | What to ask for | Current handling |
76
+ |---|---|---|
77
+ | Local code repo | knowledge boundary, stable source name, and local repo path | Register with `context source add repo <name> --local <path>`. CLI records git root + optional `subpath`; `sources/repo/<name>` becomes an ignored symlink to the chosen repo/subdir view. |
78
+ | Local monorepo package/module | whether the source is the whole repo/subspace or one package/subdir; stable source name; chosen path | Register the chosen boundary as the repo source. If the user wants one package manual, register that package/subdir. If the user wants a unified subspace manual, register the subspace. Do not use `extractTs.include` as a package selector. |
79
+ | Remote Git repo | knowledge boundary, stable source name, remote URL, pinned commit/ref, desired package/subdir, and permission to clone | CLI does not clone automatically. After explicit user approval, the agent may clone/checkout to an ignored local path, then register that local checkout. Cloned source content must not be committed. |
80
+ | Local Markdown / document file or folder | document boundary, stable source name, local path, include glob if needed, and permission to read the source body | Register with `context source add file <name> --local <path>`, declare the matching capture phase, then hand off to material investigation and structure drafting after capture. Do not run capture before the user confirms read permission. |
81
+ | Lark / Feishu document | document URL/token, intended collection, and permission to read remotely | Register with `context source add lark <name>` plus exactly one of `--url`, `--doc-token`, or `--wiki-token`; declare the matching capture phase, then hand off to material investigation and structure drafting after capture. Explain that capture writes a committed snapshot under `sources/lark/<name>/`, supports offline verify/fresh clone reproduction, and does not write credentials. Do not fetch through ad hoc scripts. |
82
+
83
+ </reference>
84
+
85
+ <procedures>
86
+
87
+ ### Step 1 — Register Only User-Chosen Sources
88
+
89
+ If no source is registered, tell the user that the next step is adding a
90
+ knowledge source. Use the user's language and explain that this is a boundary
91
+ choice:
92
+
93
+ ```text
94
+ You are choosing what one source means for this knowledge workspace.
95
+ The source name becomes part of source refs and phase ids. Approved knowledge
96
+ paths are derived later from collection, containment, and slug. NodeRef and
97
+ ViewRef are identity fields, not path strings.
98
+
99
+ If the source is one package:
100
+ knowledge/codegraph/component-lib/...
101
+ repo:component-lib#symbol:...
102
+ capture:file:component-lib
103
+ dist/component-lib-kb/
104
+
105
+ If the source is one document source:
106
+ knowledge/architecture/entity/example.md
107
+ file:product-docs/getting-started.md#span:...
108
+ align:file:product-docs:architecture
109
+ dist/product-docs-kb/
110
+
111
+ If the source is a parent monorepo/subspace namespace, later multi-module
112
+ outputs can be shaped like:
113
+ knowledge/codegraph/product-ui/component-web/...
114
+ knowledge/codegraph/product-ui/component-lynx/...
115
+ ```
116
+
117
+ If the source already points at one package/module root, the path uses the
118
+ source name once. An extra module/package segment is only expected when the
119
+ chosen source boundary intentionally covers multiple modules. In the current workflow, treat that
120
+ parent source as a planning/inspection boundary first; choose a concrete
121
+ package/subdirectory source before real extraction.
122
+
123
+ When the user has already provided a path, describe the current interpretation
124
+ before asking for the name:
125
+
126
+ ```text
127
+ I am treating this path as the source boundary:
128
+ <path>
129
+
130
+ If this path is one package/module, the source name will be used directly:
131
+ source refs such as repo:<source-name>#...
132
+
133
+ If this path is a parent monorepo/subspace that contains multiple modules, the
134
+ source name becomes the parent source namespace for grouped codegraph NodeRefs
135
+ when extraction derives those refs:
136
+ knowledge/codegraph/<source-name>/<module-name>/...
137
+
138
+ For the current extraction flow, a multi-module parent source is used for
139
+ inspection/planning first. Before reading code, we still need a concrete
140
+ package/subdirectory boundary.
141
+ ```
142
+
143
+ Then ask for one of:
144
+
145
+ - local code repo or package path;
146
+ - remote Git repo URL plus pinned commit/ref and target package/subdir;
147
+ - local document path;
148
+ - Lark/Feishu document URL.
149
+
150
+ Do not ask "what is the source name?" as the first or only question. Ask what
151
+ they want the knowledge source to cover, then propose a source name derived from
152
+ that boundary and explain the path impact.
153
+
154
+ Good user-facing wording:
155
+
156
+ ```text
157
+ Next we need to add a knowledge source.
158
+
159
+ If you only want a manual for the component package, choose that package
160
+ directory as the source boundary, for example:
161
+ name: component-lib
162
+ path: /repo/packages/component-lib
163
+
164
+ If you want one manual for the whole subspace, choose the subspace root:
165
+ name: product-ui
166
+ path: /repo/subspaces/product-ui
167
+
168
+ The name is not just a label. It will appear in source refs such as
169
+ repo:component-lib#... and in phase ids such as extract:component-lib:codegraph.
170
+ Approved paths are derived from collection, containment, and slug. NodeRef and
171
+ ViewRef are identity fields, not path strings.
172
+
173
+ For a unified subspace package shape, a parent source name such as `product-ui`
174
+ lets the output group child modules under that namespace:
175
+ knowledge/codegraph/product-ui/component-web/...
176
+ knowledge/codegraph/product-ui/component-lynx/...
177
+
178
+ Current extraction can inspect a parent source, but it should extract from a
179
+ confirmed single package/subdirectory source. If this path is a parent source,
180
+ I will show the module tree first and ask which package(s) to use before
181
+ reading code.
182
+ ```
183
+
184
+ Mention the CLI command only as an implementation detail after the user chooses
185
+ a supported repo source.
186
+
187
+ For a local repo source, ask for:
188
+
189
+ - source boundary and stable source name;
190
+ - local repo or package/subdirectory path;
191
+ - remote/ref only when not inferable or when the user wants an explicit pin.
192
+
193
+ After the user provides the choice, run:
194
+
195
+ ```bash
196
+ context source add repo <name> --local <repo-or-subdir>
197
+ context source ensure
198
+ ```
199
+
200
+ Add `--remote` / `--ref` only when the user gave explicit values.
201
+
202
+ For a remote Git repo source, ask for permission before clone/checkout. If the
203
+ user approves, clone to an ignored local path, checkout the requested commit,
204
+ then register that local checkout with `context source add repo`. Do not commit
205
+ cloned source content.
206
+
207
+ For local Markdown/MDX document sources, after the user confirms the boundary, run:
208
+
209
+ ```bash
210
+ context source add file <name> --local <file-or-folder>
211
+ ```
212
+
213
+ Default file capture handles Markdown. For MDX documentation sites that use
214
+ `_meta.json` route metadata, declare
215
+ `captureFile({ source: source("<name>"), processor: mdxJsonDocs() })` in
216
+ `src/index.ts`; included `_meta.json` files are route metadata, not body
217
+ evidence. Use `--include` only when the approved boundary is narrower than the
218
+ folder. Then explain that the next operation reads the approved document files
219
+ and writes a committed snapshot under `sources/file/<name>/`. After the user
220
+ confirms read permission, summarize the `src/index.ts` change or show an
221
+ equivalent diff summary, and run the capture phase.
222
+ Apply [skill-source-scope/references/capture-source.md](skill-source-scope/references/capture-source.md) for route
223
+ selection, dependency recovery, output handling, and final reporting, using the
224
+ current capture phase command returned by `context status`.
225
+
226
+ For Lark/Feishu document sources, register the source but do not fetch content
227
+ with ad hoc scripts. Explain which remote document or wiki token will be read,
228
+ that the snapshot is written under `sources/lark/<name>/`, that committed
229
+ snapshots enable offline verify and fresh-clone reproduction, that whether to
230
+ add extra ignore rules is a business repository decision, and that access
231
+ credentials are not written to the workspace. Use the declared capture/align
232
+ flow only after the user confirms remote reading. After declaring
233
+ `captureLark({ source: source("<name>") })`, summarize the `src/index.ts`
234
+ change or show an equivalent diff summary.
235
+ Apply [skill-source-scope/references/capture-source.md](skill-source-scope/references/capture-source.md) for route
236
+ selection, dependency recovery, output handling, and final reporting, using the
237
+ current capture phase command returned by `context status`.
238
+
239
+ ### Step 2 — Handle Monorepos
240
+
241
+ If a registered source may contain multiple packages, run:
242
+
243
+ ```bash
244
+ context source inspect <source-name> --format json
245
+ ```
246
+
247
+ Present the detected module/package paths from that CLI output as a tree. Explain
248
+ the choices without exposing internal API names first:
249
+
250
+ - for the current executable flow, register one package/subdirectory as its
251
+ own source when the user wants a focused package manual;
252
+ - if the user is designing a unified subspace knowledge base, keep the
253
+ parent source name as the namespace decision, but do not run extraction until
254
+ the concrete module extraction boundary is confirmed.
255
+
256
+ Wait for the user to choose. If the user chooses `packages/button`, register it
257
+ as a separate source such as:
258
+
259
+ ```bash
260
+ context source add repo button --local <repo>/packages/button
261
+ ```
262
+
263
+ Do not model a monorepo package choice as `include: ["packages/button/src/**"]`
264
+ on the parent source.
265
+
266
+ ### Step 3 — Review Captured Document Summary
267
+
268
+ When status is `captured-ready-to-investigate`, or after a capture phase
269
+ completes, do not immediately create draft pages or compile actions. Present
270
+ the capture summary first:
271
+
272
+ - document count;
273
+ - title tree, heading tree, or source span distribution from the CLI output;
274
+ - available reading budget and evidence views;
275
+ - snapshot path under `sources/file|lark/<source-name>/`;
276
+ - the fact that approved pages are planned through
277
+ `unapproved/structure.yaml` before compile;
278
+ - whether the source is local file/folder evidence or Lark/Feishu evidence.
279
+
280
+ Then explain the next semantic gate in user-facing terms:
281
+
282
+ ```text
283
+ The source body has been captured into a committed snapshot.
284
+
285
+ Next we investigate the material and propose a structure draft:
286
+ - which knowledge pages should exist;
287
+ - which source spans support each section;
288
+ - which relationships are supported by evidence;
289
+ - what remains unresolved or weak.
290
+
291
+ No approved Markdown is written at this point. Compile can start only after the
292
+ structure is validated and you confirm it.
293
+ ```
294
+
295
+ If the user wants to influence the shape before the Agent drafts it, ask a
296
+ small semantic question with host-native multi-choice support when available:
297
+
298
+ - Continue material investigation and propose a structure draft.
299
+ - First add a reference structure or preference, such as expected domains,
300
+ page naming, or relationship focus.
301
+ - Narrow or correct the captured source before planning.
302
+
303
+ Do not use SDK factory names as user-facing option labels. If the user asks for
304
+ one page per source document, represent that as a degenerate structure draft
305
+ and still route through structure confirmation plus compile. Then follow
306
+ `skill-prose-align.md`.
307
+
308
+ ### Step 4 — Declare Extract And Review
309
+
310
+ Read the SDK guide before editing:
311
+
312
+ ```text
313
+ node_modules/@c4a/context/docs/guides/agent-dialogue.md
314
+ node_modules/@c4a/context/docs/guides/agent-guide.md
315
+ node_modules/@c4a/context/docs/reference/project-api.md
316
+ ```
317
+
318
+ Before editing, explain the proposed extraction in product terms. Use wording
319
+ like:
320
+
321
+ ```text
322
+ The source is ready and resolves to one package/module.
323
+
324
+ Proposed extraction:
325
+ - read TypeScript/TSX files under `src/`;
326
+ - include exported symbols such as components, functions, types, and props;
327
+ - create draft candidates for human review;
328
+ - write no approved Markdown until the review payload is applied.
329
+
330
+ This skips files outside `src/` and non-exported/internal helpers. If you want
331
+ docs, tests, examples, or internal APIs included, say that before extraction.
332
+
333
+ I will first generate a preview without writing candidates. The preview will
334
+ show counts plus the planned `knowledge/` tree.
335
+ ```
336
+
337
+ Only after the user confirms this product-level scope, declare the chosen source
338
+ with `source("<name>")`, add the TypeScript extraction phase, and add the human
339
+ review phase. Use `include` only for a file-level filter within the chosen
340
+ source boundary. Mention the internal API names only in code-change summaries,
341
+ or when the user asks for implementation details.
342
+
343
+ ### Step 5 — Show The Pre-extraction Preview
344
+
345
+ Before real extraction, run the CLI no-write preview:
346
+
347
+ ```bash
348
+ context run <extract-phase-id> --dry-run --format json
349
+ ```
350
+
351
+ Show the user:
352
+
353
+ - resolved source and module/package list;
354
+ - file, symbol, and candidate estimate counts;
355
+ - `knowledgeTree`;
356
+ - several `knowledgePathExamples`.
357
+
358
+ Explain that approved pages will land under paths derived from collection,
359
+ containment, and slug; NodeRef/ViewRef are identity fields, not path strings:
360
+
361
+ ```text
362
+ knowledge/<collection>/<containment>/<slug>.md
363
+ ```
364
+
365
+ If source name, package name, module list, candidate estimate, or path shape is
366
+ not what the user expects, stop and repair the source boundary or source name
367
+ before extraction.
368
+
369
+ For a single-module code source, a repeated path like
370
+ `knowledge/codegraph/<source-name>/<package-name>/...` is usually a schema
371
+ problem or a wrong source boundary. Stop before extraction if the preview shows
372
+ that shape unexpectedly.
373
+
374
+ Do not present this as a CLI option or as "Context default options" to the
375
+ user. Present it as the actual proposed knowledge impact: code area read,
376
+ exported-symbol policy, candidate count, and final path shape. The user-facing
377
+ phrase is "preview without writing".
378
+
379
+ ### Step 6 — Run Extraction Only After Scope Is Clear
380
+
381
+ If the user already confirmed the exact source/scope and the no-write preview
382
+ matches it, run:
383
+
384
+ ```bash
385
+ context run <extract-phase-id>
386
+ ```
387
+
388
+ If the preview reports modules outside the confirmed source boundary, do not
389
+ run extraction. Ask the user to choose the corrected source boundary.
390
+
391
+ ### Step 7 — Self-verify Checklist
392
+
393
+ - [ ] Source choice came from the user, not inference. If not, return to
394
+ **Step 1**.
395
+ - [ ] Monorepo package selection is represented as source boundary. If not,
396
+ return to **Step 2**.
397
+ - [ ] Captured document summary was shown before structure/compile. If not, return to
398
+ **Step 3**.
399
+ - [ ] No-write tree/path preview was shown before first real extraction. If not,
400
+ return to **Step 5**.
401
+
402
+ </procedures>
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: context-init
3
+ description: >
4
+ Initialize a Context knowledge workspace. Use the local `context` CLI for workspace writes.
5
+ tools:
6
+ - Bash
7
+ ---
8
+
9
+ # Init
10
+
11
+ Public Context entry for agents that expose skills instead of slash commands.
12
+
13
+ - Public entry: `context-init`
14
+ - Host command names are installation-specific; use the command or skill surfaced by the current host instead of deriving a filesystem path from an example name.
15
+ - CLI primitive prefix: `context ...`
16
+ - Internal procedures live under `references/internal-procedures/`; read each referenced file in full before following that step.
17
+
18
+ ---
19
+
20
+ ## Workflow
21
+
22
+ Initialize a Context workspace with the global CLI, then continue only through
23
+ safe mechanical setup steps until the first human decision gate.
24
+
25
+ Language policy: explain, ask, confirm, and summarize in the user's current
26
+ conversation language. Keep CLI commands, flags, file paths, package names,
27
+ enum values, payload keys, and copied CLI output tokens unchanged.
28
+
29
+ Use the procedure in `references/internal-procedures/skill-init-workspace.md` end to end. It owns
30
+ the `context init` invocation, dependency install follow-up, generated
31
+ `AGENTS.md` handoff, status handoff, and stop conditions.
32
+
33
+ Do not add extra project-local agent setup. Do not infer repo sources or
34
+ extraction scope from the surrounding monorepo after setup.
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: skill-continue-workflow
3
+ description: >
4
+ Internal procedure invoked by the public Context continuation entry; not a user slash command.
5
+ Runs the status-driven Context process, executes safe mechanical next steps,
6
+ and delegates human gates to source, review, and package procedures.
7
+ tools:
8
+ - Bash
9
+ ---
10
+
11
+ # skill-continue-workflow
12
+
13
+ Continue an existing Context workspace from its current state.
14
+
15
+ ## TL;DR
16
+
17
+ - Use this only inside an initialized Context workspace. If the user is starting
18
+ a new knowledge workspace or a new batch from a raw project/repo root, do not
19
+ run `context status` first; use the init workflow and complete setup before
20
+ returning here.
21
+ - If `context status` reports `workspace-not-found` with a configured
22
+ `context.workspaceDir`, stop. If the directory exists, enter it and rerun
23
+ status. If it does not exist, ask whether to initialize it through the init
24
+ workflow; do not treat the host repository root as the workspace.
25
+ - There is no `context continue` CLI command. Start with `context status`.
26
+ - `context status` and CLI diagnostics are the source of truth.
27
+ - Execute safe mechanical `next:` steps; stop at semantic choices and human
28
+ gates.
29
+ - Delegate source/scope decisions to
30
+ `skill-source-scope.md`.
31
+ - Delegate review to `skill-review-gate.md`.
32
+ - Delegate package output choices to
33
+ `skill-package-output.md`.
34
+ - Delegate document investigation and structure confirmation to
35
+ `skill-prose-align.md`.
36
+ - Delegate source-bound prose compile requests to
37
+ `skill-prose-compile.md`.
38
+ - Do not inspect `.tmp`, `unapproved/`, `knowledge/`, `dist/`, or
39
+ `node_modules/@c4a/context/dist` with ad hoc scripts to decide project state.
40
+ - Only run commands surfaced by the current status route, current phase view,
41
+ review gate, verify/build gate, or package guidance. Do not invent alternate
42
+ lifecycle commands from memory.
43
+
44
+ <reference>
45
+
46
+ ## Safe Mechanical Commands
47
+
48
+ These can run when already implied by current status and no placeholder/human
49
+ choice remains:
50
+
51
+ | State / hint | Allowed action |
52
+ |---|---|
53
+ | source already declared | `context source ensure`, `context source list`, `context source get` |
54
+ | declared phase that does not read new source body or require a semantic choice | `context run <phase-id>` |
55
+ | prose align evidence read | `context run align:<type>:<source>:<collection> --view <view>` |
56
+ | prose structure validation | `context run align:<type>:<source>:<collection> --validate --input <structure.yaml>` |
57
+ | prose compile evidence read | `context run compile:<type>:<source>:<collection> --view <view>` |
58
+ | prose compile action validation | `context run compile:<type>:<source>:<collection> --validate --input <compile-actions.yaml>` |
59
+ | copied review payload supplied by user | `context review apply <payload-file>` |
60
+ | close required after review | `context close --format json` |
61
+ | package already declared and close is clean | `context build` |
62
+ | validation requested | `context verify` |
63
+
64
+ Capture phases are not safe mechanical commands by default. `capture:file:*`
65
+ and `capture:lark:*` read local or remote source bodies and update committed
66
+ snapshots, so they require the source read-permission gate unless the current
67
+ turn already contains explicit user confirmation for that exact source.
68
+
69
+ ## Human Gates
70
+
71
+ Stop and ask, or wait for user input, for:
72
+
73
+ - `Human gate:` in CLI output.
74
+ - placeholders such as `<name>`, `<repo-or-subdir>`, `<phase-id>`, `<collection>`.
75
+ - missing source selection.
76
+ - source boundary/name decisions, because they affect `knowledge/` paths and
77
+ `source_ref` prefixes.
78
+ - source repo operations: clone, checkout, reset, fetch, install, build, test.
79
+ - source scope, package/subdirectory, symbol group, or glob choices.
80
+ - file/Lark capture or refresh, including capture preview, until the user has
81
+ confirmed which local path or remote document may be read.
82
+ - review approval/rejection decisions.
83
+ - document structure confirmation, section ownership, edge confirmation,
84
+ rewrite intent, conflict, weak-evidence, or cross-document organization
85
+ choices unless they are being handled through prose align/compile evidence
86
+ views and validation.
87
+ - package output type or template choices.
88
+
89
+ When a human gate has a fixed small option set, use the host's native
90
+ multi-choice tool when available (Claude Code `AskUserQuestion`, Codex's
91
+ available native user-input tool such as `request_user_input` when exposed,
92
+ Cursor Plan Mode `AskQuestion`). If unavailable, fall back to Markdown `A/B/C`
93
+ choices. Each option must include the effect of choosing it.
94
+
95
+ </reference>
96
+
97
+ <procedures>
98
+
99
+ ### Step 0 — Confirm Workspace Exists
100
+
101
+ If the current task is to create a new Context workspace, or the user has not
102
+ identified an initialized Context workspace root for this turn, do not continue
103
+ with this workflow. Initialize through the public Context init entry or
104
+ `context init` first, run the setup command printed by init, then return to this workflow from the
105
+ created workspace.
106
+
107
+ ### Step 1 — Read Status
108
+
109
+ Run:
110
+
111
+ ```bash
112
+ context status
113
+ ```
114
+
115
+ Use the output as evidence. Explain status and next step in the user's language;
116
+ do not forward a long raw transcript unless requested.
117
+
118
+ ### Step 2 — Route The State
119
+
120
+ 1. If status says `missing-source` or `needs-capture`,
121
+ source boundary/name is unclear, source scope is unclear, or an extract
122
+ phase needs first-run scope confirmation, follow
123
+ `skill-source-scope.md`.
124
+ 2. If status says `captured-ready-to-investigate` or `needs-structure`, or the
125
+ user asks to split, merge, classify, relate, or semantically organize
126
+ document evidence before draft pages exist, follow
127
+ `skill-prose-align.md`.
128
+ 3. If status says `needs-prose-compile` or `structure-ready`, or the user asks
129
+ to turn confirmed structure into source-bound draft pages, follow
130
+ `skill-prose-compile.md`.
131
+ 4. If status says `compile-ready-for-review` or review is needed, follow
132
+ `skill-review-gate.md`.
133
+ 5. If status says `compile-close-needed`, run `context close --format json`
134
+ unless CLI diagnostics require human repair, then return to **Step 1**.
135
+ 6. If status says `ready-to-build`, `built`, `needs-package-output`, or approved knowledge exists but
136
+ package output is not chosen or declared,
137
+ follow `skill-package-output.md`.
138
+ 7. If the next command is safe per [Safe Mechanical Commands](#safe-mechanical-commands),
139
+ run it and return to **Step 1**.
140
+ 8. If the next command crosses a [Human Gate](#human-gates), ask or wait; do not
141
+ guess.
142
+
143
+ ### Step 3 — Execute Safely
144
+
145
+ Before editing `src/index.ts` or package templates, read:
146
+
147
+ ```text
148
+ node_modules/@c4a/context/docs/guides/agent-guide.md
149
+ node_modules/@c4a/context/docs/guides/package-outputs.md
150
+ node_modules/@c4a/context/docs/reference/project-api.md
151
+ node_modules/@c4a/context/docs/reference/package-templates.md
152
+ ```
153
+
154
+ Do not write one-off scripts to parse source packages, count extracted symbols,
155
+ or sample candidates. Use `context source inspect` and the extract no-write
156
+ preview command.
157
+
158
+ ### Step 4 — Report
159
+
160
+ Report only the meaningful state transition: commands run, current status,
161
+ human gate reached, and the precise user decision needed next. Never present
162
+ `context build`, `context verify`, or file counts as proof that a deliverable is
163
+ usable; inspect generated package structure when package output is involved.
164
+
165
+ ### Step 5 — Self-verify Checklist
166
+
167
+ - [ ] `context status` was run first. If not, return to **Step 1**.
168
+ - [ ] No human gate was crossed. If not, stop and report the protocol error.
169
+ - [ ] No ad hoc file/script probing replaced CLI views. If not, discard that
170
+ conclusion and use the CLI view.
171
+
172
+ </procedures>
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: skill-init-workspace
3
+ description: >
4
+ Internal procedure invoked by the public Context init entry; not a user slash command.
5
+ Initializes a Context knowledge workspace, executes only safe setup follow-up,
6
+ then hands off to the next-step workflow until the first human gate.
7
+ tools:
8
+ - Bash
9
+ ---
10
+
11
+ # skill-init-workspace
12
+
13
+ Initialize a Context workspace. The CLI creates files; the agent follows safe
14
+ setup hints and stops before source/scope choices.
15
+
16
+ ## TL;DR
17
+
18
+ - Use `context init`; do not add any extra project-local agent setup.
19
+ - If init prints the standard setup `next:` command, run it instead of only
20
+ repeating it.
21
+ - After the setup command succeeds, enter the workspace and read `AGENTS.md`
22
+ before running `context status`.
23
+ - After setup, use `skill-continue-workflow.md`
24
+ for status-driven continuation.
25
+ - Stop at source registration, extraction scope, review, package output, or any
26
+ external repo operation that needs user choice.
27
+ - Explain in the user's conversation language. Keep CLI commands, flags, paths,
28
+ status values, JSONL keys, and copied CLI tokens unchanged.
29
+
30
+ <procedures>
31
+
32
+ ### Step 1 — Run Init
33
+
34
+ 1. If the user gave no directory, run `context init`.
35
+ 2. If the user gave a directory, run `context init <project-dir>`.
36
+ 3. If the user supplied a project name option, pass it as `--name <name>`.
37
+ 4. Read the CLI feedback block and preserve the project root path.
38
+
39
+ ### Step 2 — Execute Safe Setup
40
+
41
+ 1. If CLI prints `next: cd "<project-root>" && bun install`,
42
+ execute that command.
43
+ 2. If install fails, report the failure and stop.
44
+ 3. If setup succeeds, read `<project-root>/AGENTS.md`.
45
+ 4. After reading `AGENTS.md`, run `context status` from `<project-root>` and
46
+ treat that output as the current workspace state.
47
+
48
+ ### Step 3 — Handoff Or Stop
49
+
50
+ 1. If status is ready for a safe mechanical step, continue with
51
+ `skill-continue-workflow.md`.
52
+ 2. If status is `missing-source`, `Human gate:`, or contains placeholders such as
53
+ `<name>`, `<repo-or-subdir>`, `<phase-id>`, or `<collection>`, ask for the
54
+ missing human choice and stop. For missing sources, ask for the knowledge
55
+ source boundary first; do not ask for a raw source name as an isolated
56
+ parameter.
57
+ 3. Do not infer repo source, source boundary, source name, package, or
58
+ extraction scope from cwd, parent directories, package names, monorepo
59
+ layout, or git remote.
60
+
61
+ ### Step 4 — Report
62
+
63
+ Summarize what was initialized, what setup command ran, current status, and the
64
+ human choice needed next. Do not paste a long raw CLI transcript unless the user
65
+ asks for exact output.
66
+
67
+ ### Step 5 — Self-verify Checklist
68
+
69
+ - [ ] Safe setup was executed when CLI provided the standard setup `next:`. If
70
+ not, return to **Step 2**.
71
+ - [ ] No repo source or extraction scope was inferred. If not, stop and ask the
72
+ user to confirm the source boundary and scope.
73
+
74
+ </procedures>