@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,34 @@
1
+ ---
2
+ description: "Inspect the Context workspace, decide the next useful action, and proceed."
3
+ argument-hint: "[user intent]"
4
+ allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
+ ---
6
+
7
+ ## Your Task
8
+
9
+ Use this as the conversational entry for an existing Context workspace. There is
10
+ no `context continue` CLI primitive; the command runs lower-level `context ...`
11
+ commands only when the workspace state requires them.
12
+
13
+ If the user is starting a new workspace or a new batch from a raw repository
14
+ root, do not run `context status` first. Use the public Context init entry or
15
+ `context init` to create the workspace, complete the init setup command, then
16
+ return here from the initialized workspace.
17
+
18
+ If `context status` reports `workspace-not-found` and points at a configured
19
+ `context.workspaceDir`, do not keep working from the host repository root. Enter
20
+ that workspace when it exists, or initialize it through the init workflow after
21
+ confirming with the user.
22
+
23
+ Language policy: explain, ask, confirm, and summarize in the user's current
24
+ conversation language. Keep CLI commands, flags, paths, ids, status enum values,
25
+ JSONL payload keys, `source_ref` values, and copied CLI output tokens unchanged.
26
+
27
+ Use the internal `context:skill-continue-workflow` procedure end to end. It owns the
28
+ status loop, safe mechanical next steps, source/scope gate, review gate, package
29
+ gate, and final report rules.
30
+
31
+ Do not infer repo sources, extraction scope, review decisions, or package output
32
+ choices from surrounding files. Do not call source-repo operations such as
33
+ clone, checkout, reset, fetch, install, build, or test without explicit user
34
+ approval.
@@ -1,138 +1,21 @@
1
1
  ---
2
- description: "Initialize a context workspace in the current directory."
3
- argument-hint: "[name] [--layout embedded|root] [--language <text>] [--with-aspects <names>] [--with-all-aspects] [--minimal|--no-aspects] [--focus <text>]"
4
- allowed-tools: Bash(context:*)
2
+ description: "Initialize a Context knowledge workspace."
3
+ argument-hint: "[project-dir] [--name <name>]"
4
+ allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
5
  ---
6
6
 
7
- <!--
8
- This command has no companion skill. Its protocol (the focus multi-choice
9
- UX before `context init` runs) lives inline here per the slash-command
10
- length exemption for self-contained slash commands.
11
- -->
12
-
13
7
  ## Your Task
14
8
 
15
- Initialize a context workspace, including layout, default-language, and focus confirmation before creating it.
16
-
17
- Language rule: ask every question, option label, option description, and final summary in the user's current conversation language. The English question blocks below are semantic templates, not text to copy unless the conversation itself is English. Keep CLI tokens, file paths, aspect names, and stored values such as `Chinese`, `English`, `embedded`, and `root` unchanged.
18
-
19
- ### Step 1 — Ask about workspace layout (unless `$ARGUMENTS` already has `--layout`)
20
-
21
- Use the host's native multi-choice tool when available (Claude Code `AskUserQuestion`, Codex `ask_user_question`, Cursor Plan Mode `AskQuestion`); fall back to markdown choices otherwise.
22
-
23
- Question shape. Do not expose `embedded` / `root` as user-facing option labels; those are CLI tokens only. Translate the user-facing labels and descriptions:
24
-
25
- ```
26
- Q. Where should C4A store this workspace?
27
- A. Default (.context/) — create a `.context/` data directory inside the current project. (Recommended)
28
- B. Current directory — use the current directory itself as the C4A data root.
29
- ```
30
-
31
- Explain the tradeoff in the user's conversation language before asking:
32
- - Default (`.context/`) is for normal code repositories; C4A files live under `.context/`.
33
- - Current directory is only for a dedicated knowledge repository. The current directory must not already contain `.context/`, `config.yaml`, `raw/`, `knowledge/`, `output/`, `aspects/`, or `inbox/`. Existing `AGENTS.md` / `CLAUDE.md` in the selected C4A data root are kept rather than overwritten.
34
-
35
- Map the answer to CLI flags:
36
- - Default (`.context/`) → pass `--layout embedded`
37
- - Current directory → pass `--layout root`
38
-
39
- ### Step 2 — Ask about default language (unless `$ARGUMENTS` already has `--language`)
40
-
41
- Ask one multi-choice question in the user's conversation language:
42
-
43
- ```
44
- Q. What default language should agents use for user-facing replies in this workspace?
45
- A. 中文 — maps to `Chinese`
46
- B. English
47
- C. Other — please describe.
48
- ```
49
-
50
- The option label must be localized, but the stored CLI value should remain stable. Pass the answer as `--language Chinese`, `--language English`, or quote custom text as `--language '<custom text>'`.
51
-
52
- ### Step 3 — Ask about workspace focus (unless user already passed `--focus`)
53
-
54
- Before running `context init`, ask the user **one** multi-choice question about the workspace's focus (the primary intent of this knowledge base). Use the host's native multi-choice tool when available (Claude Code `AskUserQuestion`, Codex `ask_user_question`, Cursor Plan Mode `AskQuestion`); fall back to markdown `A/B/C/D` choices otherwise. Keep it to one question with 2–4 options plus "Other" escape hatch; never dump 5+ at once.
55
-
56
- The question shape (translate all user-facing text to the user's conversation language; keep machine tokens English):
57
-
58
- ```
59
- Q. What will this workspace mainly hold?
60
- A. Business product/R&D knowledge base — business architecture, requirements,
61
- technical architecture, business modules and their supporting tech. (Recommended)
62
- B. Team technical knowledge base — tech stack, infra tools, conventions,
63
- operations, decisions, on-call memos, etc.
64
- C. Product / project user manual — user-facing intro, guides, handbook, Q&A.
65
- D. Research / learning library on a topic — framework comparisons, selection
66
- notes, wiki-style reading notes.
67
- E. Other — please describe.
68
- ```
69
-
70
- Interpret the answer:
71
- - When appending generated or user-provided free text to the shell command, quote it with POSIX single quotes. If the text contains a single quote, escape it as `'\''`; do not use double quotes for free-form values.
72
- - Chose A–D → generate a 2–3 line focus description in the user's language. Phrase it as
73
- "primarily X; supporting materials such as Y may also be filed here" rather than exclusion
74
- language — workspaces absorb auxiliary material in practice. Show the exact generated focus
75
- text to the user and ask for one confirmation before running `context init`. If the user
76
- approves, pass it as `--focus '...'`; if the user edits it, pass the edited text as
77
- `--focus '...'`; if the user declines or says to skip, run without `--focus`.
78
- - Chose E or described freely → pass the user's text verbatim as `--focus '...'`.
79
- - User says "skip" / "don't care" → run `context init` without `--focus`.
80
- - `$ARGUMENTS` already contains `--focus <text>` → skip this step entirely.
81
-
82
- ### Step 4 — Choose aspects (unless `$ARGUMENTS` already has aspect flags)
83
-
84
- Skip this step if `$ARGUMENTS` already includes `--with-aspects`, `--with-all-aspects`, `--minimal`, or `--no-aspects`.
85
-
86
- If the user request names specific aspects, map that directly:
87
- - "only code aspect" / "仅启用 code aspect" → append `--with-aspects code`
88
- - "all aspects" / "全部 aspect" → append `--with-all-aspects`
89
- - "no aspects" / "不安装 aspect" / "minimal" → append `--no-aspects`
90
-
91
- Otherwise ask **one** short single-choice question. Keep the option count to three or fewer; host question tools reject longer option lists. Use the host's free-text `Other` escape hatch when the user needs a custom comma-separated aspect list.
92
-
93
- ```
94
- Q. Which aspects should be installed?
95
- A. code — scripted local source-code capture. (Recommended)
96
- B. all built-in aspects — code, design-system, openapi, graphql.
97
- C. skip — install no aspects now; add later with `context init --with-aspects <name>`.
98
- ```
99
-
100
- Hard rules when mapping into the host UI:
101
-
102
- - Do not present separate options for every built-in aspect; that exceeds host option limits once `skip` is included.
103
- - Put `code` first and mark it as recommended.
104
- - Treat the host auto-injected `Other` as a free-text custom list such as `code,openapi`, not as "skip".
105
-
106
- Map the answer:
107
-
108
- - `code` selected → append `--with-aspects code`.
109
- - `all built-in aspects` selected → append `--with-all-aspects`.
110
- - `skip` selected → append `--no-aspects`.
111
- - Host auto-injected `Other` selected → parse the user's comma-separated aspect names and append `--with-aspects <names>`. If the custom text is empty or invalid, ask once for clarification rather than silently installing all aspects.
112
-
113
- Do not silently install all aspects when the user asked for a code-only workspace.
114
-
115
- ### Step 5 — Run init
116
-
117
- Run `context init $ARGUMENTS` with the selected `--layout`, `--language`, `--focus`, and aspect flags appended when those flags were not already present. The CLI handles skeleton build, `.gitignore`, `AGENTS.md`, `CLAUDE.md -> AGENTS.md`, and aspect templates inside the selected C4A data root.
118
-
119
- If the CLI errors (e.g. an existing workspace without `--with-aspects`, or root layout blockers), surface the error and the CLI's remediation hint.
120
-
121
- To add aspects later in an existing workspace, run `context init --with-aspects <name>` from the workspace root. Use comma-separated names for multiple aspects, for example `context init --with-aspects code,openapi`. Append mode only copies missing aspect templates and does not rewrite workspace config, raw data, or knowledge.
122
-
123
- ### Step 6 — Summarize
9
+ Initialize a Context workspace with the global CLI, then continue only through
10
+ safe mechanical setup steps until the first human decision gate.
124
11
 
125
- Briefly state in the user's conversation language:
126
- - Workspace name
127
- - Layout and data root
128
- - Default language
129
- - Installed aspects
130
- - Whether `AGENTS.md` was created and whether `CLAUDE.md` was linked
131
- - If the user asks to read the generated workspace instructions, run `context workspace read AGENTS.md --format text`; do not open the data-root file with generic file tools.
132
- - Whether focus was recorded (show the first line if yes; mention the user can edit `config.yaml` later if not)
133
- - If the CLI prints a Claude local permission hint, tell the user that `Bash(context:*)` is the recommended scoped allow for heredoc-heavy context workflows. Do not edit `.claude/settings.local.json` unless the user explicitly asks.
134
- - Suggest `/context:capture` as the natural next step
12
+ Language policy: explain, ask, confirm, and summarize in the user's current
13
+ conversation language. Keep CLI commands, flags, file paths, package names,
14
+ enum values, payload keys, and copied CLI output tokens unchanged.
135
15
 
136
- CLI output, file paths, aspect names, flags, and command names stay as printed.
16
+ Use the internal `context:skill-init-workspace` procedure end to end. It owns
17
+ the `context init` invocation, dependency install follow-up, generated
18
+ `AGENTS.md` handoff, status handoff, and stop conditions.
137
19
 
138
- Do NOT read, write, link, or edit workspace files yourself during init — the CLI is the sole writer for skeleton files, `AGENTS.md`, and `CLAUDE.md`.
20
+ Do not add extra project-local agent setup. Do not infer repo sources or
21
+ 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
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-source-scope/SKILL.md`.
31
+ - Delegate review to `${CLAUDE_PLUGIN_ROOT}/skills/skill-review-gate/SKILL.md`.
32
+ - Delegate package output choices to
33
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-package-output/SKILL.md`.
34
+ - Delegate document investigation and structure confirmation to
35
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-prose-align/SKILL.md`.
36
+ - Delegate source-bound prose compile requests to
37
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-prose-compile/SKILL.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
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-source-scope/SKILL.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
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-prose-align/SKILL.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
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-prose-compile/SKILL.md`.
131
+ 4. If status says `compile-ready-for-review` or review is needed, follow
132
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-review-gate/SKILL.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 `${CLAUDE_PLUGIN_ROOT}/skills/skill-package-output/SKILL.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 `${CLAUDE_PLUGIN_ROOT}/skills/skill-continue-workflow/SKILL.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
+ `${CLAUDE_PLUGIN_ROOT}/skills/skill-continue-workflow/SKILL.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>
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: skill-package-output
3
+ description: >
4
+ Internal procedure invoked by the public Context continuation entry; not a user slash command.
5
+ Explains package output choices, prefers kb packages, declares selected
6
+ package builders, builds, and inspects generated package structure.
7
+ tools:
8
+ - Bash
9
+ ---
10
+
11
+ # skill-package-output
12
+
13
+ Choose and build a package output from approved knowledge.
14
+
15
+ ## TL;DR
16
+
17
+ - Package output is a human choice. Do not add package builders just because an
18
+ example exists.
19
+ - Recommend an agent knowledge-base package first for agent consumption.
20
+ - Present an LLM text bundle as an alternative for a single text/RAG import
21
+ bundle.
22
+ - Do not use `kbPackage()` or `llmsPackage()` as user-facing option labels.
23
+ Mention those API names only after the user chooses an output shape.
24
+ - Do not offer `both` as a shortcut. Add one output, build, inspect, then ask
25
+ before adding another.
26
+ - Build happens after review and deterministic close. If status says
27
+ `compile-close-needed`, run `context close --format json` before build.
28
+ - Package templates may customize navigation and query guidance, but coverage,
29
+ gap, scope, or known-limit claims must cite approved knowledge,
30
+ `knowledge/structure.yaml`, or `context-build-inventory.json`.
31
+ - Generated package structure, not `context build` alone, proves usability.
32
+
33
+ <reference>
34
+
35
+ ## Output Shapes
36
+
37
+ Recommended first output:
38
+
39
+ ```text
40
+ dist/<name>-kb/
41
+ ├── AGENTS.md
42
+ ├── skills/
43
+ │ └── knowledge-query/
44
+ │ └── SKILL.md
45
+ └── wikis/
46
+ ├── index.md
47
+ ├── <group>/
48
+ │ ├── index.md
49
+ │ └── ...
50
+ └── ...
51
+ ```
52
+
53
+ Alternative:
54
+
55
+ ```text
56
+ dist/<name>-llms/
57
+ └── llms.txt
58
+ ```
59
+
60
+ </reference>
61
+
62
+ <procedures>
63
+
64
+ ### Step 1 — Read Package Docs
65
+
66
+ Before editing package declarations or templates, read:
67
+
68
+ ```text
69
+ node_modules/@c4a/context/docs/guides/package-outputs.md
70
+ node_modules/@c4a/context/docs/reference/package-templates.md
71
+ ```
72
+
73
+ ### Step 2 — Explain The Choice
74
+
75
+ Explain in the user's conversation language:
76
+
77
+ - an agent knowledge-base package creates copied approved knowledge pages and
78
+ reusable query guidance under `dist/<name>-kb/`;
79
+ - the default `knowledge-query` skill teaches agents how to query and cite those
80
+ copied approved knowledge pages;
81
+ - the kb template must keep `wikis/index.md` as the OKF bundle entry page;
82
+ - the default `wikis/index.md` is intentionally shallow: it describes the
83
+ bundle and links to next-level directories;
84
+ - `context build` maps internal production collections into OKF roots and
85
+ generates child directory indexes such as `<okf-root>/<group>/index.md`, so
86
+ users can browse from OKF root -> group -> page; `wikis/index.md` is the
87
+ required default OKF root entry, while selected `guides/`, `rules/`, or
88
+ `feats/` roots get their own indexes too;
89
+ - an LLM text bundle creates one text/RAG import bundle under
90
+ `dist/<name>-llms/`;
91
+ - the user can customize `src/package-templates/kb/` before build;
92
+ - template variables and examples are documented in
93
+ `node_modules/@c4a/context/docs/reference/template-variables.md`;
94
+ - build writes a package inventory such as `context-build-inventory.json`, which
95
+ templates may cite when describing package coverage. Its edge section reports
96
+ the structural edge contract and the evidence status from `context verify`;
97
+ - the user can skip package output for now and keep only `knowledge/`.
98
+
99
+ Ask which single output to create first using the host's native multi-choice
100
+ tool when available. Use semantic option labels:
101
+
102
+ - Agent knowledge-base package: for agents to query and cite approved knowledge pages.
103
+ - LLM text bundle: for one text/RAG import bundle.
104
+ - Skip package output for now: keep approved Markdown only.
105
+
106
+ ### Step 3 — Declare The Selected Package
107
+
108
+ After the user chooses, read the template variable guide if the template needs
109
+ navigation changes:
110
+
111
+ ```text
112
+ node_modules/@c4a/context/docs/reference/template-variables.md
113
+ ```
114
+
115
+ Then edit `src/index.ts` and package templates according to the SDK docs. For
116
+ kb output, prefer a clear package name such as `<source-name>-kb`.
117
+
118
+ ### Step 4 — Build And Inspect
119
+
120
+ If status says close is required, run:
121
+
122
+ ```bash
123
+ context close --format json
124
+ ```
125
+
126
+ Do not build from unclosed approved knowledge.
127
+
128
+ Run:
129
+
130
+ ```bash
131
+ context build
132
+ ```
133
+
134
+ Inspect the generated `dist/<name>-kb/` or `dist/<name>-llms/` structure against
135
+ [Output Shapes](#output-shapes). For kb packages, inspect every selected
136
+ OKF root that appears in `context-build-inventory.json`, not only
137
+ `wikis/`.
138
+ If templates are placeholders or knowledge pages are thin, say that plainly and
139
+ stop for user direction.
140
+
141
+ If build reports that a template path collides with copied knowledge, do not
142
+ retry blindly. Explain that template files and selected knowledge cannot render
143
+ to the same path, then rename the template file or ask whether to exclude that
144
+ knowledge path.
145
+
146
+ If build reports a template-boundary diagnostic, repair the template by
147
+ referencing approved knowledge, `knowledge/structure.yaml`, or
148
+ `context-build-inventory.json` for coverage/gap/scope/known-limit statements.
149
+ Do not patch `dist/` as the durable fix; edit the template under
150
+ `src/package-templates/`.
151
+
152
+ ### Step 5 — Self-verify Checklist
153
+
154
+ - [ ] User selected the package output. If not, return to **Step 2**.
155
+ - [ ] Only one output was added first. If not, ask before continuing with more.
156
+ - [ ] A kb package template contains `wikis/index.md` and at least one
157
+ `SKILL.md`.
158
+ - [ ] For kb output, the generated OKF root indexes link to next-level
159
+ directories, and child directory indexes exist when selected knowledge has
160
+ subdirectories.
161
+ - [ ] Template paths do not collide with copied knowledge paths.
162
+ - [ ] Template coverage/gap/scope/known-limit claims cite approved knowledge,
163
+ `knowledge/structure.yaml`, or build inventory.
164
+ - [ ] Generated structure was inspected after build. If not, return to
165
+ **Step 4**.
166
+
167
+ </procedures>