@c4a/context-cli 0.5.41-beta.7 → 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 (263) hide show
  1. package/README.md +115 -123
  2. package/babel.cjs +257 -0
  3. package/cli.js +51114 -97079
  4. package/docs/quickstart.md +85 -0
  5. package/package.json +3 -1
  6. package/plugin/.claude-plugin/plugin.json.template +1 -1
  7. package/plugin/.codex-plugin/plugin.json.template +5 -5
  8. package/plugin/.cursor-plugin/plugin.json.template +1 -1
  9. package/plugin/README.md +105 -86
  10. package/plugin/README_CN.md +92 -85
  11. package/plugin/commands/continue.md +34 -0
  12. package/plugin/commands/init.md +13 -130
  13. package/plugin/skills/skill-continue-workflow/SKILL.md +172 -0
  14. package/plugin/skills/skill-init-workspace/SKILL.md +74 -0
  15. package/plugin/skills/skill-package-output/SKILL.md +167 -0
  16. package/plugin/skills/skill-prose-align/SKILL.md +296 -0
  17. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  18. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  19. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  20. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  21. package/plugin/skills/skill-prose-compile/SKILL.md +265 -0
  22. package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  23. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  24. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  25. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  26. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  27. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  28. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  29. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  30. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  31. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  32. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  33. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  34. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  35. package/plugin/skills/skill-review-gate/SKILL.md +98 -0
  36. package/plugin/skills/skill-source-scope/SKILL.md +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 -123
  227. package/plugin/commands/align.md +0 -71
  228. package/plugin/commands/capture.md +0 -113
  229. package/plugin/commands/compile.md +0 -112
  230. package/plugin/commands/context.md +0 -36
  231. package/plugin/commands/drop.md +0 -38
  232. package/plugin/commands/extract.md +0 -18
  233. package/plugin/commands/ops.md +0 -47
  234. package/plugin/commands/purge.md +0 -22
  235. package/plugin/commands/query.md +0 -22
  236. package/plugin/commands/status.md +0 -25
  237. package/plugin/skills/skill-align-workflow/SKILL.md +0 -110
  238. package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +0 -60
  239. package/plugin/skills/skill-align-workflow/references/density-profile.md +0 -16
  240. package/plugin/skills/skill-align-workflow/references/gates.md +0 -162
  241. package/plugin/skills/skill-compile-close/SKILL.md +0 -127
  242. package/plugin/skills/skill-compile-draft/SKILL.md +0 -175
  243. package/plugin/skills/skill-compile-draft/references/action-domain-gates.md +0 -34
  244. package/plugin/skills/skill-compile-draft/references/notes.md +0 -34
  245. package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +0 -71
  246. package/plugin/skills/skill-compile-draft/references/structural-challenges.md +0 -76
  247. package/plugin/skills/skill-compile-judge/SKILL.md +0 -112
  248. package/plugin/skills/skill-context-query/SKILL.md +0 -236
  249. package/plugin/skills/skill-drop/SKILL.md +0 -189
  250. package/plugin/skills/skill-semantic-reconcile/SKILL.md +0 -136
  251. package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +0 -31
  252. package/plugin/skills/skill-semantic-reconcile/references/mode-semantics.md +0 -41
  253. package/plugin/skills/skill-semantic-reconcile/references/scope-review-and-omit.md +0 -60
  254. package/plugin/skills/skill-semantic-reconcile/references/temporal-and-evidence.md +0 -58
  255. package/plugin/skills/skill-semantic-reconcile/references/user-confirmation.md +0 -71
  256. package/scripts/build-aspect-runtime.ts +0 -45
  257. package/templates/aspect-runtime/aspectRunnerSdk.js +0 -776
  258. package/templates/aspects/README.md +0 -517
  259. package/templates/aspects/code/README.md +0 -48
  260. package/templates/aspects/code/aspect.yaml +0 -21
  261. package/templates/aspects/design-system/README.md +0 -26
  262. package/templates/aspects/graphql/README.md +0 -24
  263. package/templates/aspects/openapi/README.md +0 -24
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env bun
2
2
  /**
3
3
  * build-plugin.ts — materialize installable plugin trees from the human-edited
4
- * plugin/ source directory directly into the nested c4a-plugins/ repo
5
- * (remote: github.com/context4ai/context). c4a-plugins/ is .gitignore'd by
6
- * c4a; it is its own git repo, the single source of marketplace distribution.
4
+ * plugin/ source directory.
7
5
  *
6
+ * The normal 0.6.x target is `dist/plugins` inside the @c4a/context-cli npm
7
+ * package. `context plugin install` resolves that bundled directory at runtime
8
+ * and installs it globally for Claude / Codex.
8
9
  * Source of truth:
9
10
  * - plugin/commands/
10
11
  * - plugin/skills/
@@ -12,13 +13,13 @@
12
13
  * - plugin/.codex-plugin/plugin.json.template
13
14
  * - plugin/.cursor-plugin/plugin.json.template
14
15
  *
15
- * Generated outputs under c4a-plugins/:
16
+ * Generated outputs under the target root:
16
17
  * - claude/ — Claude plugin root
17
18
  * - codex/ — Codex plugin root
18
19
  * - cursor/ — Cursor plugin root
19
20
  * - skills/ — Vercel-style standalone skills (no plugin manifest)
20
21
  *
21
- * Plus three marketplace.json files at c4a-plugins/ root pointing at the
22
+ * Plus three marketplace.json files at the target root pointing at the
22
23
  * respective subdirs, so a single repo serves four install paths.
23
24
  */
24
25
 
@@ -28,12 +29,7 @@ import { fileURLToPath } from "node:url";
28
29
 
29
30
  const __dirname = dirname(fileURLToPath(import.meta.url));
30
31
  const pkgRoot = resolve(__dirname, "..");
31
- const repoRoot = resolve(pkgRoot, "../..");
32
- // Integration tests stage build into a temp dir; allow override so the staged
33
- // run does not require a real c4a-plugins/ clone next to the staged scripts.
34
- const PLUGINS_ROOT = process.env.C4A_PLUGINS_ROOT
35
- ? resolve(process.env.C4A_PLUGINS_ROOT)
36
- : resolve(repoRoot, "c4a-plugins");
32
+ const PLUGINS_ROOT = resolve(pkgRoot, "dist", "plugins");
37
33
  const MARKETPLACE_NAME = "c4a";
38
34
  const PLUGIN_NAME = "context";
39
35
 
@@ -47,50 +43,27 @@ interface CommandSource {
47
43
  const INTERNAL_PROCEDURES_DIR = "references/internal-procedures";
48
44
 
49
45
  /**
50
- * Rewrite `packaged context:skill-*` references in a command body so agents
51
- * without a packaged-skill registry (Codex / Cursor / Vercel-style) get
52
- * direct file references they can read instead of an unactionable verb.
53
- *
54
- * Claude has a packaged-skill registry and consumes the original phrasing
55
- * verbatim, so this transformer is only applied to non-Claude builds.
46
+ * Rewrite internal `skill-*` procedure references in a command body so
47
+ * non-Claude agent surfaces get direct file references they can read.
56
48
  */
57
- function rewritePackagedSkillReferences(body: string, pathFor: (skill: string) => string): string {
49
+ function rewriteInternalProcedureReferences(body: string, pathFor: (skill: string) => string): string {
58
50
  let out = body;
59
51
 
60
- // Imperative: "Use/Invoke packaged `context:skill-X` [and follow its procedure]" read the file
61
- // The optional trailer is consumed because "Read ... and follow it" already covers it.
62
- out = out.replace(
63
- /\b(?:Invoke|Use|invoke|use) packaged `context:(skill-[a-z-]+)`(?:\s+and follow its procedure)?/g,
64
- (_match, skill: string) => `Read \`${pathFor(skill)}\` in full and follow it`,
65
- );
66
-
67
- // Imperative: "Feed/Pass <stuff> to packaged `context:skill-X`" → pass to procedure file
68
- // Do not inject "do not reconstruct from memory" here; the surrounding sentence
69
- // already carries that warning in its own tail and double-stating it reads redundant.
52
+ // Imperative: "Apply/Use/Invoke the internal `context:skill-X` procedure" -> read the file.
70
53
  out = out.replace(
71
- /\b(Feed|Pass|feed|pass) ([^.`]*?) to packaged `context:(skill-[a-z-]+)`/g,
72
- (_match, verb: string, mid: string, skill: string) =>
73
- `${verb} ${mid} to the procedure in \`${pathFor(skill)}\` (read it in full first if you have not already)`,
54
+ /\b(Apply|Use|Invoke|apply|use|invoke) the internal `(?:context:)?(skill-[a-z-]+)` procedure/g,
55
+ (_match, verb: string, skill: string) => `${verb} the procedure in \`${pathFor(skill)}\``,
74
56
  );
75
57
 
76
- // Imperative: "Apply packaged `context:skill-X` <rules>" apply the procedure for those rules.
58
+ // Imperative: "invoke the internal `skill-X` procedure" in sentence middles.
77
59
  out = out.replace(
78
- /\b(Apply|apply) packaged `context:(skill-[a-z-]+)`/g,
79
- (_match, verb: string, skill: string) => `${verb} the procedure in \`${pathFor(skill)}\` for`,
60
+ /\binvoke the internal `(?:context:)?(skill-[a-z-]+)` procedure/g,
61
+ (_match, skill: string) => `invoke the procedure in \`${pathFor(skill)}\``,
80
62
  );
81
63
 
82
- // "run `context:skill-X`" (no "packaged") consult the procedure file
64
+ // Descriptive bare internal procedure references also become file paths for non-Claude builds.
83
65
  out = out.replace(
84
- /\brun `context:(skill-[a-z-]+)`/g,
85
- (_match, skill: string) => `consult the procedure in \`${pathFor(skill)}\``,
86
- );
87
-
88
- // Anything left is a descriptive bare reference (e.g. "stop before invoking
89
- // `context:skill-X`"); substitute the file path so the agent can resolve it.
90
- // The wildcard form `context:skill-*` (with literal asterisk) stays untouched
91
- // because the [a-z-]+ class does not match `*`.
92
- out = out.replace(
93
- /`context:(skill-[a-z-]+)`/g,
66
+ /`(?:context:)?(skill-[a-z-]+)`/g,
94
67
  (_match, skill: string) => `\`${pathFor(skill)}\``,
95
68
  );
96
69
 
@@ -109,7 +82,7 @@ function cursorCommandSkillPath(skill: string): string {
109
82
  }
110
83
 
111
84
  function cursorCommandFileName(slug: string): string {
112
- return slug === "context" ? "context.md" : `context-${slug}.md`;
85
+ return `context-${slug}.md`;
113
86
  }
114
87
 
115
88
  function rewriteClaudeSlashCommandsForCursor(body: string): string {
@@ -119,26 +92,26 @@ function rewriteClaudeSlashCommandsForCursor(body: string): string {
119
92
  slug === "context" ? "/context" : `/context-${slug}`
120
93
  )
121
94
  .replace(/^## Your [Tt]ask$/gm, "## Workflow")
122
- .replace(/\bPackaged skill invoked by\b/g, "Internal procedure invoked by")
123
95
  .replace(/\bnot a user slash command\b/g, "not a user command");
124
96
  }
125
97
 
126
98
  /**
127
- * Scan a generated build root for residual packaged-skill references that
128
- * should have been rewritten in agent-facing entry files (Codex / Vercel
129
- * public skills, Cursor commands).
99
+ * Scan a generated build root for residual unresolved internal procedure
100
+ * references in agent-facing entry files (Codex / Vercel public skills,
101
+ * Cursor commands).
130
102
  *
131
- * Skips internal skill bodies — directories named `internal-procedures` (the
132
- * codex/vercel embed point) and any directory whose name starts with `skill-`
133
- * (the cursor-build internal skills tree, mirrored from `plugin/skills/`).
134
- * Cross-skill mentions inside those bodies are descriptive ("the next stage
135
- * handles X") and stay untouched.
103
+ * Skips internal procedure bodies — directories named `internal-procedures`
104
+ * (the Codex/Vercel embed point) and directories whose name starts with
105
+ * `skill-` (the cursor-build internal skills tree, mirrored from
106
+ * `plugin/skills/`). Cross-skill mentions inside those bodies are descriptive
107
+ * ("the next stage handles X") and stay in the source skill style.
136
108
  *
137
109
  * Throws on any leak so future commands or rewrite-pattern gaps fail the
138
110
  * build instead of silently shipping unactionable verbs.
139
111
  */
140
- async function verifyNoPackagedSkillLeak(root: string, label: string): Promise<void> {
112
+ async function verifyNoInternalProcedureReferenceLeak(root: string, label: string): Promise<void> {
141
113
  const offenders: string[] = [];
114
+ const legacyProcedureTokenPattern = new RegExp("`context:" + "skill-[a-z-*]+`", "g");
142
115
  const stack: string[] = [root];
143
116
  while (stack.length > 0) {
144
117
  const current = stack.pop()!;
@@ -146,13 +119,16 @@ async function verifyNoPackagedSkillLeak(root: string, label: string): Promise<v
146
119
  for (const entry of entries) {
147
120
  const path = join(current, entry.name);
148
121
  if (entry.isDirectory()) {
149
- if (entry.name === "internal-procedures" || entry.name.startsWith("skill-")) continue;
122
+ if (entry.name === INTERNAL_PROCEDURES_DIR.split("/").at(-1) || entry.name.startsWith("skill-")) continue;
150
123
  stack.push(path);
151
124
  continue;
152
125
  }
153
126
  if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
154
127
  const content = await readFile(path, "utf8");
155
- const matches = content.match(/`context:skill-[a-z-]+`/g);
128
+ const matches = [
129
+ ...(content.match(/`skill-[a-z-*]+`/g) ?? []),
130
+ ...(content.match(legacyProcedureTokenPattern) ?? []),
131
+ ];
156
132
  if (matches && matches.length > 0) {
157
133
  offenders.push(`${path}: ${[...new Set(matches)].join(", ")}`);
158
134
  }
@@ -160,7 +136,7 @@ async function verifyNoPackagedSkillLeak(root: string, label: string): Promise<v
160
136
  }
161
137
  if (offenders.length > 0) {
162
138
  throw new Error(
163
- `${label} build still contains unrewritten packaged skill references in agent-facing entry files — extend rewritePackagedSkillReferences() to cover the new phrasing:\n${offenders.join("\n")}`,
139
+ `${label} build still contains unresolved internal procedure references in agent-facing entry files — extend rewriteInternalProcedureReferences() to cover the new phrasing:\n${offenders.join("\n")}`,
164
140
  );
165
141
  }
166
142
  }
@@ -178,10 +154,14 @@ function rewriteClaudePluginRoot(content: string, levelsAboveSiblingsRoot: numbe
178
154
  }
179
155
 
180
156
  function rewriteFlattenedProcedureReferences(content: string, skill: string): string {
181
- return content.replace(
157
+ const localReferences = content.replace(
182
158
  /(?<![\w./-])references\/([A-Za-z0-9._/-]+\.md)/g,
183
159
  `${skill}/references/$1`,
184
160
  );
161
+ return localReferences.replace(
162
+ /(?<![\w./-])((?:\.\.\/)*)(skill-[a-z-]+)\/SKILL\.md/g,
163
+ (_match, prefix: string, procedure: string) => `${prefix}${procedure}.md`,
164
+ );
185
165
  }
186
166
 
187
167
  function depthOfFileBelowSiblingsRoot(filePath: string, siblingsRoot: string): number {
@@ -307,7 +287,6 @@ function quotedFrontmatterValue(frontmatter: string, key: string, fileName: stri
307
287
  }
308
288
 
309
289
  function titleFromSlug(slug: string): string {
310
- if (slug === "context") return "Router";
311
290
  return slug
312
291
  .split("-")
313
292
  .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
@@ -315,29 +294,16 @@ function titleFromSlug(slug: string): string {
315
294
  }
316
295
 
317
296
  function skillNameForCommand(slug: string): string {
318
- return slug === "context" ? "context-router" : `context-${slug}`;
297
+ return `context-${slug}`;
319
298
  }
320
299
 
321
300
  function codexSkillNameForCommand(slug: string): string {
322
- return slug === "context" ? "router" : slug;
323
- }
324
-
325
- function claudeCommandForSlug(slug: string): string {
326
- return slug === "context" ? "/context:context" : `/context:${slug}`;
301
+ return slug;
327
302
  }
328
303
 
329
304
  const CURSOR_COMMAND_SUMMARIES: Record<string, string> = {
330
- align: "Review raw material and confirm the Node tree before compiling knowledge.",
331
- capture: "Capture documents, source code, notes, inbox files, or refreshed sources into the workspace.",
332
- compile: "Turn confirmed aligned sources into source-linked knowledge through draft and semantic review.",
333
- context: "Route a natural-language C4A request to the right Context command.",
334
- drop: "Plan and apply source retraction with semantic decisions and archive safety.",
335
- extract: "Preview extraction output for a file without writing workspace state.",
336
- init: "Choose workspace layout, language, and focus, then create the C4A workspace.",
337
- ops: "Run operational package tasks such as local build/export, with future publish kept under one entry.",
338
- purge: "Permanently delete archived dropped-source artifacts after explicit confirmation.",
339
- query: "Answer from the local knowledge workspace with citations and gap handling.",
340
- status: "Show workspace state, pending work, cache health, and the next useful command.",
305
+ init: "Initialize a Context knowledge workspace.",
306
+ continue: "Continue the Context workflow from the current workspace state.",
341
307
  };
342
308
 
343
309
  function cursorCommandSummary(command: CommandSource): string {
@@ -349,10 +315,9 @@ function stripHtmlComments(markdown: string): string {
349
315
  }
350
316
 
351
317
  function publicSkillBody(command: CommandSource, publicName: string): string {
352
- const claudeCommand = claudeCommandForSlug(command.slug);
353
- const rewrittenBody = rewritePackagedSkillReferences(command.body, publicEntrySkillPath)
318
+ const rewrittenBody = rewriteInternalProcedureReferences(command.body, publicEntrySkillPath)
354
319
  .replace(/^## Your [Tt]ask$/gm, "## Workflow");
355
- return `---\nname: ${publicName}\ndescription: >\n ${command.description} Equivalent to Claude ${claudeCommand}; use the local \`context\` CLI for workspace writes.\ntools:\n - Bash\n---\n\n# ${command.title}\n\nPublic C4A Context entry for agents that expose skills instead of Claude slash commands.\n\n- Public entry: \`${publicName}\`\n- Claude equivalent: \`${claudeCommand}\`\n- CLI primitive prefix: \`context ...\`\n- Internal procedures live under \`${INTERNAL_PROCEDURES_DIR}/\`; read each referenced file in full before following that step.\n\n---\n\n${rewrittenBody.trimEnd()}\n`;
320
+ return `---\nname: ${publicName}\ndescription: >\n ${command.description} Use the local \`context\` CLI for workspace writes.\ntools:\n - Bash\n---\n\n# ${command.title}\n\nPublic Context entry for agents that expose skills instead of slash commands.\n\n- Public entry: \`${publicName}\`\n- 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.\n- CLI primitive prefix: \`context ...\`\n- Internal procedures live under \`${INTERNAL_PROCEDURES_DIR}/\`; read each referenced file in full before following that step.\n\n---\n\n${rewrittenBody.trimEnd()}\n`;
356
321
  }
357
322
 
358
323
  async function readCommands(): Promise<CommandSource[]> {
@@ -385,8 +350,8 @@ async function renderManifest(input: {
385
350
  await writeFile(input.outputPath, rendered, "utf8");
386
351
 
387
352
  const parsed = JSON.parse(rendered) as Record<string, unknown>;
388
- if (parsed.name !== "context") {
389
- throw new Error(`${input.label} plugin.json name must be "context", got "${String(parsed.name)}"`);
353
+ if (parsed.name !== PLUGIN_NAME) {
354
+ throw new Error(`${input.label} plugin.json name must be "${PLUGIN_NAME}", got "${String(parsed.name)}"`);
390
355
  }
391
356
  if (parsed.version !== input.version) {
392
357
  throw new Error(`${input.label} plugin.json version mismatch: ${String(parsed.version)} vs ${input.version}`);
@@ -454,7 +419,7 @@ async function writePublicSkills(
454
419
  const skillRoot = join(skillsRoot, publicName);
455
420
  await mkdir(skillRoot, { recursive: true });
456
421
  await writeFile(join(skillRoot, "SKILL.md"), publicSkillBody(command, publicName), "utf8");
457
- if (command.body.includes("context:skill-")) {
422
+ if (/`(?:context:)?skill-[a-z-]+`/.test(command.body)) {
458
423
  const referencesRoot = join(skillRoot, INTERNAL_PROCEDURES_DIR);
459
424
  await mkdir(referencesRoot, { recursive: true });
460
425
  for (const skill of internalSkillNames) {
@@ -475,6 +440,12 @@ async function writePublicSkills(
475
440
  );
476
441
  }
477
442
  }
443
+ await rewriteMarkdownFiles(referencesRoot, (content) =>
444
+ content.replace(
445
+ /(?<![\w./-])((?:\.\.\/)*)(skill-[a-z-]+)\/SKILL\.md/g,
446
+ (_match, prefix: string, procedure: string) => `${prefix}${procedure}.md`,
447
+ )
448
+ );
478
449
  }
479
450
  }
480
451
  }
@@ -494,18 +465,18 @@ async function buildCodex(version: string, commands: readonly CommandSource[]):
494
465
  await copyAssetsIfPresent(out);
495
466
  await writePublicSkills(out, commands, codexSkillNameForCommand);
496
467
  await writeGeneratedGuards(out, "AGENTS.md", "Codex plugin build");
497
- await verifyNoPackagedSkillLeak(out, "codex");
468
+ await verifyNoInternalProcedureReferenceLeak(out, "codex");
498
469
  await verifyNoClaudePluginRootLeak(out, "codex");
499
470
  }
500
471
 
501
472
  async function buildVercel(commands: readonly CommandSource[]): Promise<void> {
502
- // Vercel-style standalone skills live directly under c4a-plugins/skills/.
503
- // No plugin manifest, no per-build README; the top-level c4a-plugins/README.md
473
+ // Vercel-style standalone skills live directly under dist/plugins/skills/.
474
+ // No plugin manifest, no per-build README; the top-level dist/plugins/README.md
504
475
  // owns onboarding for this install path.
505
476
  const skillsRoot = join(PLUGINS_ROOT, "skills");
506
477
  await resetDir(skillsRoot);
507
478
  await writePublicSkills(PLUGINS_ROOT, commands, skillNameForCommand);
508
- await verifyNoPackagedSkillLeak(skillsRoot, "vercel");
479
+ await verifyNoInternalProcedureReferenceLeak(skillsRoot, "vercel");
509
480
  await verifyNoClaudePluginRootLeak(skillsRoot, "vercel");
510
481
  }
511
482
 
@@ -518,7 +489,7 @@ async function writeCursorCommands(outRoot: string, commands: readonly CommandSo
518
489
  const raw = await readFile(sourcePath, "utf8");
519
490
  const { frontmatter } = parseFrontmatter(raw, `${command.slug}.md`);
520
491
  const rewrittenBody = rewriteClaudeSlashCommandsForCursor(
521
- rewritePackagedSkillReferences(command.body, cursorCommandSkillPath),
492
+ rewriteInternalProcedureReferences(command.body, cursorCommandSkillPath),
522
493
  );
523
494
  const body = stripHtmlComments(rewrittenBody).trimStart();
524
495
  const file = `---\n${frontmatter}\n---\n\n${cursorCommandSummary(command)}\n\n---\n\n${body.trimEnd()}\n`;
@@ -569,35 +540,10 @@ async function buildCursor(version: string, commands: readonly CommandSource[]):
569
540
  "utf8",
570
541
  );
571
542
  await rewriteMarkdownFiles(out, rewriteClaudeSlashCommandsForCursor);
572
- await verifyNoPackagedSkillLeak(out, "cursor");
543
+ await verifyNoInternalProcedureReferenceLeak(out, "cursor");
573
544
  await verifyNoClaudePluginRootLeak(out, "cursor");
574
545
  }
575
546
 
576
- async function ensurePluginsRoot(): Promise<void> {
577
- try {
578
- const info = await stat(PLUGINS_ROOT);
579
- if (!info.isDirectory()) {
580
- throw new Error(`c4a-plugins exists but is not a directory: ${PLUGINS_ROOT}`);
581
- }
582
- } catch (err) {
583
- const code = (err as NodeJS.ErrnoException).code;
584
- if (code !== "ENOENT") throw err;
585
- throw new Error(
586
- `c4a-plugins/ not found at ${PLUGINS_ROOT}. ` +
587
- `Run: git clone https://github.com/context4ai/context.git c4a-plugins ` +
588
- `(from the c4a repo root) before building plugins.`
589
- );
590
- }
591
- try {
592
- await stat(join(PLUGINS_ROOT, ".git"));
593
- } catch {
594
- throw new Error(
595
- `c4a-plugins/ exists but is not a git repo. Expected remote: ` +
596
- `https://github.com/context4ai/context.git`
597
- );
598
- }
599
- }
600
-
601
547
  async function writeMarketplaceManifests(version: string): Promise<void> {
602
548
  const claudeMarketplace = {
603
549
  name: MARKETPLACE_NAME,
@@ -605,7 +551,7 @@ async function writeMarketplaceManifests(version: string): Promise<void> {
605
551
  plugins: [{
606
552
  name: PLUGIN_NAME,
607
553
  source: "./claude",
608
- description: "Context For AI — local knowledge workspace. Capture docs, extract code structure, compile into an interlinked wiki with source-traced facts.",
554
+ description: "Local knowledge workspace. Initialize a project and use next-step guidance to maintain it.",
609
555
  }],
610
556
  };
611
557
  const cursorMarketplace = {
@@ -615,7 +561,7 @@ async function writeMarketplaceManifests(version: string): Promise<void> {
615
561
  plugins: [{
616
562
  name: PLUGIN_NAME,
617
563
  source: "./cursor",
618
- description: "Turn project sources into a local, source-linked knowledge workspace your agent can maintain and query.",
564
+ description: "Maintain a project-local knowledge workspace through init and continue-step guidance.",
619
565
  }],
620
566
  };
621
567
  const codexMarketplace = {
@@ -688,7 +634,8 @@ async function main(): Promise<void> {
688
634
  const version = pkg.version;
689
635
  if (!version) throw new Error("package.json is missing `version`");
690
636
 
691
- await ensurePluginsRoot();
637
+ const targetLabel = "dist/plugins";
638
+ await resetDir(PLUGINS_ROOT);
692
639
 
693
640
  const commands = await readCommands();
694
641
  await buildClaude(version);
@@ -698,11 +645,11 @@ async function main(): Promise<void> {
698
645
  await writeMarketplaceManifests(version);
699
646
  await writePluginsTopLevelDocs();
700
647
 
701
- process.stdout.write(`c4a-plugins/claude generated (version=${version})\n`);
702
- process.stdout.write(`c4a-plugins/codex generated (version=${version}, publicSkills=${commands.length})\n`);
703
- process.stdout.write(`c4a-plugins/cursor generated (version=${version}, publicSkills=${commands.length})\n`);
704
- process.stdout.write(`c4a-plugins/skills generated (publicSkills=${commands.length})\n`);
705
- process.stdout.write(`c4a-plugins/{marketplace.json,README.md,README_CN.md,VERSION} written\n`);
648
+ process.stdout.write(`${targetLabel}/claude generated (version=${version})\n`);
649
+ process.stdout.write(`${targetLabel}/codex generated (version=${version}, publicSkills=${commands.length})\n`);
650
+ process.stdout.write(`${targetLabel}/cursor generated (version=${version}, publicSkills=${commands.length})\n`);
651
+ process.stdout.write(`${targetLabel}/skills generated (publicSkills=${commands.length})\n`);
652
+ process.stdout.write(`${targetLabel}/{marketplace.json,README.md,README_CN.md,VERSION} written\n`);
706
653
  }
707
654
 
708
655
  main().catch((err) => {
@@ -1,71 +0,0 @@
1
- ---
2
- description: "Align raw material into a finalized Node structure and block ownership."
3
- argument-hint: ""
4
- allowed-tools: Bash(context:*)
5
- ---
6
-
7
- ## Your Task
8
-
9
- Run the CLI-guided align workflow. `/context:align` is the user entrypoint; the CLI owns route, stage, validation, workflow payload storage, and the canonical next write. The agent owns semantic Node/Section grouping and any user-facing questions.
10
-
11
- If `$ARGUMENTS` starts with `code`, run `context align code [slug]`, report the dry-run projection plan, and stop. This route is CLI-owned and does not enter the prose align workflow.
12
-
13
- ### Step 1 — Scan
14
-
15
- Run `context align scan --format json`.
16
-
17
- Use the returned `workflow.next-action-envelope.v2` as the source of truth:
18
-
19
- - Follow top-level `next_action.kind` and `next_action.command` for every write.
20
- - Use only the returned `next_action.command` for the next required step. When it points at `read-plan`, run that one command first.
21
- - Treat `allowed_actions[]` as permission for read-only insertions such as `show_view`; do not choose a different write path from it.
22
- - Treat `agent_hints[]`, when present, as a temporary mirror or diagnostic only. If it conflicts with `next_action`, follow `next_action`.
23
- - Read workflow payload views only through returned `context workflow show` commands.
24
- - If the host truncates scan stdout but the preview includes top-level `next_action.command`, run that command. If `next_action` is not visible, rerun the scan command; do not recover host tool-result files.
25
-
26
- For protocol discovery, prefer narrow commands:
27
-
28
- - `context schema workflow.next-action-envelope.v2 --view minimal --format json`
29
- - `context protocol show align-compile --format json`
30
- - `context schema align-structure-intent --view minimal --format json` — includes required fields, enums, section kind priority/triggers, mount matrix, and a minimal authoring example; use full schema only for extended notes.
31
-
32
- ### Step 2 — Read Evidence Through The Single Evidence Path
33
-
34
- If scan returns a `read-plan` command, run it and then follow the next command returned by that view. The normal path is:
35
-
36
- - `read-plan` summarizes source size, active source set, navigation/placeholder sources, and the next evidence command.
37
- - `source-bundle` returns the selected source text with `@c4a` block annotations. Read it, then write the requested align JSON yourself, normally `align-structure-intent`; do not pipe the bundle text into `context align validate`.
38
- - If `source-bundle` omits text for budget, `read_scope_complete: false`, `page.has_more: true`, or the final `source-bundle:end` annotation is missing, run its `next_action.command` before authoring.
39
- - If the next command contains `--read-cursor`, treat it as opaque continuation state. Do not decode it and do not replace it with hand-written `--source` / `--window` / `--range` / `--heading` selectors.
40
- - `blocks`, `windows`, `block-index`, `source-mapping`, and `pending-relation-refs` are detail views only. Use them when the read-plan/source-bundle next action or `how_to_explore[]` asks for a narrow follow-up.
41
-
42
- When a view returns `page.next_command`, follow that command to continue the same semantic view. Use `--source`, `--heading`, `--window`, `--range`, or `--token-budget` only as view filters; do not inspect workflow files, cache files, host tool-results, or stdout fragments with generic tools.
43
-
44
- If a detail view returns `align-blocks-read-incomplete`, `page.has_more`, or `truncated: true`, the response is a partial read. Return to the read-plan/source-bundle continuation instead of treating that partial JSON page as the complete source.
45
-
46
- ### Step 3 — Produce The Semantic Payload
47
-
48
- Reuse existing knowledge before inventing new Nodes: use `context mdrive glossary match <name>` and `context mdrive node list --format json` for term/entity reuse.
49
-
50
- Apply packaged `context:skill-align-workflow` Node classification gates and align intent procedure. Keep generated payloads on stdin. Prefer heredocs for small payloads; if payload staging is needed for large or parallel writes, use the workspace AGENTS.md scratch path (`.context/.tmp/agent-payloads/<run-id>/...` in embedded workspaces, `.tmp/agent-payloads/<run-id>/...` in root-layout workspaces) and redirect stdin from it. Never reuse fixed `/tmp/c4a-*` names and never place scratch payloads under CLI-managed `.tmp/context-cli/`, `output/`, `archive/`, `knowledge/`, or `raw/` truth directories.
51
-
52
- Use CLI diagnostics instead of static prompt rules:
53
-
54
- - `diagnostics.automatic_ownership_adjustments[]` explains mechanical structural-block demotions and the explicit ownership override shape.
55
- - `pending-relation-refs` lists explicit Parent/Children/Related markdown links. Reuse existing target Nodes when present; keep unresolved target slug hints deferred instead of writing dangling `contains_parent` / `domain_gate.child_refs`. A relation/placeholder source may still be preserved as a no-write Node with root-level `planned_sections: []`; preserve it before default skip when an explicit retrieval need, graph need, or atomic/concrete title gives the page standalone retrieval value, even if every child ref is unresolved. Never put `planned_sections` inside `domain_gate`. If it is kept without graph support, keep supporting blocks `context_only` with `visible_to`. If you skip the source and emit no Node for it, still cover its coverable blocks with an `ownership_groups[]` rule, usually source-wide `ignored` for pure placeholders. `ignored` disposes unused material and does not support the placeholder by itself. Unresolved children stay pending rather than becoming graph edges.
56
- - Validation diagnostics identify contiguity, citation eligibility, ownership, and mount-matrix problems.
57
- - `views[]` and `diagnostics` distinguish citable evidence from supporting context; do not infer citation eligibility from raw ownership prose.
58
-
59
- ### Step 4 — Validate And Submit
60
-
61
- When the envelope asks for `validate_align_decision`, submit the payload matching `next_action.input_schema`, normally the `align-structure-intent` you authored after reading evidence, to `context align validate --input - --format json` or the exact returned command. If validate returns blocking diagnostics, repair the payload and rerun validate. If validate returns a `submit_structure_decision` next_action, execute that command with the same validated payload.
62
-
63
- After a finalize command succeeds, do not submit finalize again to confirm it. Use returned `payloads.*.show_command` values, or `context workflow show --payload finalized-ownership --unwrap --format json`, for read-only confirmation; then follow `next_action.command`, normally `context compile scan --format json`.
64
-
65
- If finalize reports node reclassification hints, treat finalized ownership as the source of truth. `context status` reports finalized node types, not the originally submitted proposal.
66
-
67
- For any other write kind, execute the top-level `next_action.command` exactly. If the command rejects the payload, follow the returned `next_action` and `reason_code`; do not infer a route fallback from memory.
68
-
69
- ### Final Report
70
-
71
- Report in the user's conversation language. Summarize finalized Node counts and meaningful warnings. Do not surface workflow payload digests, scope ids, block hashes, snapshot digests, or absolute paths.
@@ -1,113 +0,0 @@
1
- ---
2
- description: "Capture URLs, local Markdown, source code, stdin path lists, inbox/refresh sources, or conversation notes as Context sources."
3
- argument-hint: "[url | ./path.md [./more.md...] | --code [paths...] | --aspect <name...> | --stdin | --inbox | --refresh | note]"
4
- allowed-tools: Bash(context:*, bun:*, brew:*, curl:*, sh:*, scoop:*, choco:*, lark-cli:*), WebFetch
5
- ---
6
-
7
- <!--
8
- This command has no companion skill. Its protocol (argument routing +
9
- missing-dependency install flow) lives inline here per the slash-command
10
- length exemption for self-contained slash commands.
11
- -->
12
-
13
- ## Your Task
14
-
15
- Capture is entirely CLI-driven — your role is to route the right `context capture` invocation and relay its output. Never hand-write captured source snapshots: the CLI owns normalisation (NFC, BOM strip, line endings) and the `content_hash` contract, so any manual edit breaks idempotency.
16
-
17
- ### Code capture diagnostics
18
-
19
- Do not run hand-written dependency preflight commands before `context capture --code`. The CLI owns TypeScript runner/plugin resolution and returns structured `agent_hints[]` when the runner is missing or misconfigured.
20
-
21
- If `context capture --code ...` fails with install or runner hints, surface the CLI's `agent_hints[]` install command exactly as printed. Ask the user once whether to run that command on their behalf; global installs touch shared state, so explicit confirmation is required before invoking `Bash`. If approved, run the exact command from `agent_hints[0].command`, then retry the original `context capture --code ...` invocation. If declined, leave the command visible so the user can run it manually. Do not inline extraction packages, do not hand-write code snapshots, and do not continue with partial capture.
22
-
23
- Invocation note: code capture does not run through `npx`. The default code aspect uses the `@c4a/extract` runner and `@c4a/extract-ts` plugin bundled into the installed `@c4a/context-cli`, then records the bundled runner identity in the user-cache manifest. Only non-default runner/plugin packages configured in `aspects/code/aspect.yaml` need to be resolvable from the same global install that provides `context`; when they are missing, the CLI returns structured install hints.
24
-
25
- ### Route by argument
26
-
27
- Before choosing a local Markdown capture route, honor the surrounding task context. Driver documents such as run instructions, handbooks, READMEs, plans, feedback issues, corpus/index/manifests, and batch lists are not Context sources unless the user explicitly asks to ingest them. Capture only ingest targets that are already explicit in the user request; if they are missing, ask one clarification instead of capturing the driver document.
28
-
29
- - `$ARGUMENTS` is one or more `http://` / `https://` targets and/or local `.md` source documents to ingest → `context capture $ARGUMENTS` (Feishu docx/wiki URLs need `lark-cli`; URL and mixed batches are supported). Do not write an Agent-side URL loop.
30
- - User provides a long newline-separated URL list or local `.md` source document list to ingest → pass it to `context capture --stdin` with a direct heredoc. Mixed URL + local `.md` batches are supported when the user intentionally provides both.
31
- - `$ARGUMENTS` contains `--inbox` → `context capture --inbox`.
32
- - `$ARGUMENTS` contains `--refresh` → `context capture --refresh`. This refreshes active Feishu URL sources and local Markdown sources whose stored origin file still exists; code sources use `context capture --code`.
33
- - User asks for code capture with explicit `--module` flags → run `context capture --code $ARGUMENTS`, preserving code flags such as `--module`, `--version`, `--version-from`, and `--no-runner-cache`.
34
- - User asks to refresh/re-capture an already configured code source → run `context capture --code` unless the user explicitly wants to change package selection or version flags. The CLI reuses stored `capture_config`, appends a new snapshot only when code/version content changes, and never overwrites prior snapshots.
35
- - User asks to run a configured custom aspect capture → run `context capture --aspect <name...> --format json`. Prefer configured aspect names. If an automation script already supplies a path, it must point to an installed aspect directory in the current workspace and the CLI will treat it as that aspect name. Do not use `context capture --aspect code`; code capture remains `context capture --code` because it owns target path, `--module`, version, and runner-cache flags.
36
- - User provides one or more code target paths, or asks for code capture without explicit `--module` flags → run `context capture --code $ARGUMENTS --format json` directly. The CLI preflights every target first; if any target is ambiguous it returns candidates without writing, otherwise it captures all selected code targets serially.
37
- - If the CLI returns candidate packages, ask the user which package paths to capture.
38
- - Then run `context capture --code <original-target-if-present>` with one repeated `--module <path>` for every selected package. The CLI derives and stores path filtering silently from that selection.
39
- - User asks to record conversation material, a decision, a revision intent, or a temporary observation → use note capture:
40
- - Classify once as `revision`, `decision`, or `brainstorm`; temporary observations are `brainstorm`. If unclear, ask one clarification.
41
- - For `revision` or `decision`, require an existing target. If missing, run `context query --intent node_lookup --query "<user words>"` and ask the user to confirm a Node or Section before writing.
42
- - Write the body to `context capture --note --intent <intent> --anchor <node-slug>[#<section-id>] --input -` for anchored notes, or omit `--anchor` for brainstorm.
43
- - For `revision`, organize the stdin Markdown with headings: `旧上下文`, `修改意图`, `新内容`, `验证条件`.
44
- - For `decision`, organize the stdin Markdown with headings: `议题`, `选项`, `决议`, `理由`.
45
- - After capture, run `context status --view summary --format json` and base the user-facing next step on `next_step.command` / `workflow.next_step`.
46
-
47
- For stdin batches, use this shape:
48
-
49
- ```bash
50
- context capture --stdin <<'EOF'
51
- https://example.feishu.cn/wiki/abc
52
- docs/a.md
53
- docs/b.md
54
- EOF
55
- ```
56
-
57
- Do not pipe the heredoc through another command, and do not discover files with `find` / `ls` when the user already supplied the paths.
58
-
59
- ### Output Handling
60
-
61
- Report the CLI output verbatim. If the CLI reports `N sources changed`, suggest the right next step:
62
-
63
- - Run `context status --view summary --format json` and use its `next_step.command` / `workflow.next_step`.
64
- - If JSON status reports `incremental.pending_align.status: "pending"` with `count > 0`, suggest `/context:align` even when a previous finalized align workflow or prose `workflow.next_step` says compile. Newly captured structure work must be routed through align before compile.
65
- - If status says aligned knowledge is missing or alignment is required → suggest `/context:align`.
66
- - If status says compile work is pending for Markdown / evidence-backed knowledge → suggest `/context:compile`. Mention `/context:align` only if the user wants to revise the structure.
67
- - If the capture was code-only and status reports pending code projection, suggest the CLI-owned code route: `context compile --aspect code <source-slug>`, followed by `context compile close` when the CLI asks for close.
68
-
69
- Never suggest prose compile or hand-built code knowledge for a code-only source. Code snapshots become active knowledge only through `context compile --aspect code`, which materializes package/category/symbol Nodes deterministically.
70
-
71
- If capture is rejected with `agent_hints[].code = "workflow-cross-family-rejected"`, do **not** run `context workflow abandon ...` automatically. First run or ask the user to run `context workflow status --format json` and explain that another workflow is active in this workspace. Continue that workflow when it is the intended task; ask the user before abandoning it when the user wants to discard that in-progress work. If the user expected a different repository/workspace, change to the confirmed workspace root before retrying capture.
72
-
73
- ## Final Report
74
-
75
- Report in the user's conversation language. Translate section headings into the user's language instead of copying the English labels below verbatim. Optimize for human readability: use document titles instead of source ids, package names instead of `aspect:code:*` strings, and human-readable kind labels ("local markdown", "Feishu doc", "code package") instead of internal tokens. Do not surface content hashes, snapshot digests, workflow payload ids, or absolute file paths.
76
-
77
- Stable structure:
78
-
79
- 1. Completion headline. Single line with the action verb plus core counts: how many sources were captured this round, broken down by `new` / `updated` / `unchanged`. Capture data from `context capture ... --format json` `result.summary` (or per-source statuses when no aggregate is returned).
80
- 2. Per-source list grouped by status. Show each captured source under one of three groups (`new` / `updated` / `unchanged`); within each group list the document title (`source.title`), kind label, and a short delta indicator for updated sources (for example added/removed line counts when the CLI returns them; otherwise "content changed"). Cache-hit code packages belong in `unchanged`. Omit groups that are empty.
81
- 3. Pending workflow signals. When `context status --view summary --format json` reports follow-up work tied to this capture (sources pending align, sources pending compile, refreshed sources pending recompile, code sources pending projection), summarize each as a single line naming the work and which sources are affected. Omit the section entirely when there is no pending follow-up.
82
- 4. Next step. Single command suggestion driven by status: `/context:align` when structure work is pending, `/context:compile` when prose compile work is pending, `context compile --aspect code <slug>` when code projection is pending, or `context compile --aspect <name>` when a custom aspect projection is pending. If nothing is pending, say so explicitly.
83
-
84
- Do not include raw CLI diagnostics, agent_hints content, schema names, or workflow payload identifiers in the report. Those belong in earlier troubleshooting output, not in the completion summary.
85
-
86
- ## Reference
87
-
88
- ### Missing Dependency Recovery
89
-
90
- If the CLI returns `agent_hints[]` with `code: "capture-code-typescript-plugin-missing"`, stop and surface the hint. Ask the user once for permission to run `agent_hints[0].command` (the CLI has already picked the correct package manager — `npm install -g` or `bun install -g` — based on how `context` itself was installed). If approved, run that exact command via `Bash` and then retry the original capture; if declined, leave the command visible for manual install. Never substitute a different package manager or version.
91
-
92
- If the CLI prints a missing-dependency error like `lark-cli not installed`, walk the user through installation:
93
-
94
- 1. Ask once up-front whether to proceed with install. If no → stop and tell the user to install manually from the tool's official README, then re-run.
95
- 2. `WebFetch` the tool's official README (for `lark-cli` that's `https://github.com/larksuite/cli/blob/main/README.md#quick-start-ai-agent`).
96
- 3. For each command the README prescribes for the user's platform, show the command then call `Bash`. The host's per-tool permission prompt is the user's confirmation surface; don't add extra y/n questions between commands.
97
- 4. Stop on any failure; surface stderr verbatim.
98
- 5. After success, tell the user to re-run their original `/context:*` command themselves.
99
-
100
- ### Language Policy
101
-
102
- Your prose to the user follows the user's conversation language. CLI commands, flag names, URLs, env-var names, binary names, source-ids stay English.
103
-
104
- ### Invariants
105
-
106
- - Captured source snapshots are immutable post-write — the CLI only ever appends new snapshots.
107
- - The source registry is authoritative; derived index files are not Agent workflow inputs.
108
- - Local `.md` source identity follows the captured file's stable origin path, not its H1/title. If the user edits the title but captures the same path again, the CLI appends a new snapshot to the same `local:*` source.
109
- - In `--format json`, code capture runner cache state is authoritative in `result.runner.cacheMode`: `prepared` means a workspace runner was prepared, `cached` means workspace cache hit, and `bypass` means `--no-runner-cache` used a temporary runner directory instead of the workspace runner cache.
110
- - Aspect snapshots default to `evidence.mode: none`. Prose-like custom aspects must opt in with `evidence: { mode: block }` in `aspects/<name>/aspect.yaml` before they generate evidence manifests. Invalid `evidence.mode` values are reported as `evidence-policy-invalid`; they are not silently treated as `none`.
111
- - Code aspect snapshots ship with `evidence.mode: none`; symbols/files/edges are indexed inside the code bucket. Do not ask users to inspect or repair a code `.evidence` manifest.
112
- - Code aspect capture writes raw code snapshots first. Materialize them with `context compile --aspect code <slug>` (or no slug for all actionable code sources) before prose align needs to attach documentation to code Nodes.
113
- - On duplicate capture of the same URL: identical `content_hash` → CLI skips with `unchanged`; different hash → CLI appends a new snapshot.