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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/README.md +115 -123
  2. package/babel.cjs +257 -0
  3. package/cli.js +64438 -96584
  4. package/docs/quickstart.md +85 -0
  5. package/package.json +3 -1
  6. package/plugin/.claude-plugin/plugin.json.template +1 -1
  7. package/plugin/.codex-plugin/plugin.json.template +5 -5
  8. package/plugin/.cursor-plugin/plugin.json.template +1 -1
  9. package/plugin/README.md +105 -86
  10. package/plugin/README_CN.md +92 -85
  11. package/plugin/commands/continue.md +34 -0
  12. package/plugin/commands/init.md +13 -130
  13. package/plugin/skills/skill-continue-workflow/SKILL.md +172 -0
  14. package/plugin/skills/skill-init-workspace/SKILL.md +74 -0
  15. package/plugin/skills/skill-package-output/SKILL.md +167 -0
  16. package/plugin/skills/skill-prose-align/SKILL.md +296 -0
  17. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  18. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  19. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  20. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  21. package/plugin/skills/skill-prose-compile/SKILL.md +265 -0
  22. package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  23. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  24. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  25. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  26. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  27. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  28. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  29. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  30. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  31. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  32. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  33. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  34. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  35. package/plugin/skills/skill-review-gate/SKILL.md +98 -0
  36. package/plugin/skills/skill-source-scope/SKILL.md +406 -0
  37. package/plugin/skills/skill-source-scope/references/capture-source.md +180 -0
  38. package/plugins/.agents/plugins/marketplace.json +20 -0
  39. package/plugins/.claude-plugin/marketplace.json +13 -0
  40. package/plugins/.cursor-plugin/marketplace.json +17 -0
  41. package/plugins/README.md +150 -0
  42. package/plugins/README_CN.md +136 -0
  43. package/plugins/VERSION +1 -0
  44. package/plugins/assets/icon.svg +3 -0
  45. package/plugins/assets/logo.svg +3 -0
  46. package/plugins/assets/workflow-en.png +0 -0
  47. package/plugins/assets/workflow.png +0 -0
  48. package/plugins/claude/.claude-plugin/plugin.json +16 -0
  49. package/plugins/claude/.generated +1 -0
  50. package/plugins/claude/CLAUDE.md +5 -0
  51. package/plugins/claude/README.md +5 -0
  52. package/plugins/claude/commands/continue.md +34 -0
  53. package/plugins/claude/commands/init.md +21 -0
  54. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +172 -0
  55. package/plugins/claude/skills/skill-init-workspace/SKILL.md +74 -0
  56. package/plugins/claude/skills/skill-package-output/SKILL.md +167 -0
  57. package/plugins/claude/skills/skill-prose-align/SKILL.md +296 -0
  58. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  59. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  60. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  61. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  62. package/plugins/claude/skills/skill-prose-compile/SKILL.md +265 -0
  63. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  64. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  65. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  66. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  67. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  68. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  69. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  70. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  71. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  72. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  73. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  74. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  75. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  76. package/plugins/claude/skills/skill-review-gate/SKILL.md +98 -0
  77. package/plugins/claude/skills/skill-source-scope/SKILL.md +406 -0
  78. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +180 -0
  79. package/plugins/codex/.codex-plugin/plugin.json +38 -0
  80. package/plugins/codex/.generated +1 -0
  81. package/plugins/codex/AGENTS.md +5 -0
  82. package/plugins/codex/README.md +5 -0
  83. package/plugins/codex/assets/icon.svg +3 -0
  84. package/plugins/codex/assets/logo.svg +3 -0
  85. package/plugins/codex/assets/workflow-en.png +0 -0
  86. package/plugins/codex/assets/workflow.png +0 -0
  87. package/plugins/codex/skills/continue/SKILL.md +47 -0
  88. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  89. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +74 -0
  90. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +167 -0
  91. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  92. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  93. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  94. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  95. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +296 -0
  96. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  97. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  98. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  99. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  100. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  101. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  102. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  103. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  104. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  105. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  106. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  107. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  108. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  109. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +265 -0
  110. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +98 -0
  111. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  112. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +406 -0
  113. package/plugins/codex/skills/init/SKILL.md +34 -0
  114. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +172 -0
  115. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +74 -0
  116. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +167 -0
  117. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  118. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  119. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  120. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  121. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +296 -0
  122. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  123. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  124. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  125. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  126. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  127. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  128. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  129. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  130. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  131. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  132. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  133. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  134. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  135. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +265 -0
  136. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +98 -0
  137. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  138. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +406 -0
  139. package/plugins/cursor/.cursor-plugin/plugin.json +29 -0
  140. package/plugins/cursor/.generated +1 -0
  141. package/plugins/cursor/AGENTS.md +5 -0
  142. package/plugins/cursor/README.md +13 -0
  143. package/plugins/cursor/assets/icon.svg +3 -0
  144. package/plugins/cursor/assets/logo.svg +3 -0
  145. package/plugins/cursor/assets/workflow-en.png +0 -0
  146. package/plugins/cursor/assets/workflow.png +0 -0
  147. package/plugins/cursor/commands/context-continue.md +38 -0
  148. package/plugins/cursor/commands/context-init.md +25 -0
  149. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +172 -0
  150. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +74 -0
  151. package/plugins/cursor/skills/skill-package-output/SKILL.md +167 -0
  152. package/plugins/cursor/skills/skill-prose-align/SKILL.md +296 -0
  153. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  154. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  155. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  156. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  157. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +265 -0
  158. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  159. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  160. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  161. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  162. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  163. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  164. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  165. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  166. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  167. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  168. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  169. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  170. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  171. package/plugins/cursor/skills/skill-review-gate/SKILL.md +98 -0
  172. package/plugins/cursor/skills/skill-source-scope/SKILL.md +406 -0
  173. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +180 -0
  174. package/plugins/skills/context-continue/SKILL.md +47 -0
  175. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  176. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +74 -0
  177. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +167 -0
  178. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  179. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  180. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  181. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  182. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +296 -0
  183. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  184. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  185. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  186. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  187. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  188. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  189. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  190. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  191. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  192. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  193. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  194. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  195. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  196. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +265 -0
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +98 -0
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +406 -0
  200. package/plugins/skills/context-init/SKILL.md +34 -0
  201. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +172 -0
  202. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +74 -0
  203. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +167 -0
  204. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  205. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  206. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  207. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  208. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +296 -0
  209. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  210. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  211. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  212. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  213. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  214. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  215. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  216. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  217. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  218. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  219. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  220. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  221. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  222. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +265 -0
  223. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +98 -0
  224. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +180 -0
  225. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +406 -0
  226. package/scripts/build-plugin.ts +70 -123
  227. package/plugin/commands/align.md +0 -71
  228. package/plugin/commands/capture.md +0 -113
  229. package/plugin/commands/compile.md +0 -112
  230. package/plugin/commands/context.md +0 -36
  231. package/plugin/commands/drop.md +0 -38
  232. package/plugin/commands/extract.md +0 -18
  233. package/plugin/commands/ops.md +0 -47
  234. package/plugin/commands/purge.md +0 -22
  235. package/plugin/commands/query.md +0 -22
  236. package/plugin/commands/status.md +0 -25
  237. package/plugin/skills/skill-align-workflow/SKILL.md +0 -110
  238. package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +0 -60
  239. package/plugin/skills/skill-align-workflow/references/density-profile.md +0 -16
  240. package/plugin/skills/skill-align-workflow/references/gates.md +0 -162
  241. package/plugin/skills/skill-compile-close/SKILL.md +0 -127
  242. package/plugin/skills/skill-compile-draft/SKILL.md +0 -175
  243. package/plugin/skills/skill-compile-draft/references/action-domain-gates.md +0 -34
  244. package/plugin/skills/skill-compile-draft/references/notes.md +0 -34
  245. package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +0 -71
  246. package/plugin/skills/skill-compile-draft/references/structural-challenges.md +0 -76
  247. package/plugin/skills/skill-compile-judge/SKILL.md +0 -112
  248. package/plugin/skills/skill-context-query/SKILL.md +0 -236
  249. package/plugin/skills/skill-drop/SKILL.md +0 -189
  250. package/plugin/skills/skill-semantic-reconcile/SKILL.md +0 -136
  251. package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +0 -31
  252. package/plugin/skills/skill-semantic-reconcile/references/mode-semantics.md +0 -41
  253. package/plugin/skills/skill-semantic-reconcile/references/scope-review-and-omit.md +0 -60
  254. package/plugin/skills/skill-semantic-reconcile/references/temporal-and-evidence.md +0 -58
  255. package/plugin/skills/skill-semantic-reconcile/references/user-confirmation.md +0 -71
  256. package/scripts/build-aspect-runtime.ts +0 -45
  257. package/templates/aspect-runtime/aspectRunnerSdk.js +0 -776
  258. package/templates/aspects/README.md +0 -517
  259. package/templates/aspects/code/README.md +0 -48
  260. package/templates/aspects/code/aspect.yaml +0 -21
  261. package/templates/aspects/design-system/README.md +0 -26
  262. package/templates/aspects/graphql/README.md +0 -24
  263. package/templates/aspects/openapi/README.md +0 -24
package/README.md CHANGED
@@ -1,172 +1,164 @@
1
1
  # @c4a/context-cli
2
2
 
3
- Local knowledge workspace CLI for [c4a — Context For AI](https://github.com/context4ai/c4a).
3
+ Local knowledge workspace CLI for Context projects.
4
4
 
5
- `@c4a/context-cli` is the **CLI** package — the `context` executable plus its source-of-truth plugin templates. Plugin install trees are distributed separately through the [context4ai/context](https://github.com/context4ai/context) repo (Claude / Codex / Cursor / Vercel-style skills), generated by `bun run build:plugin` from `plugin/` source.
5
+ `@c4a/context-cli` is the **CLI** package — the `context` executable plus global agent plugin installer. The V1 workflow uses a globally installed CLI/plugin for agent commands, while each knowledge workspace keeps only project state and SDK dependency metadata.
6
6
 
7
7
  This package ships:
8
8
 
9
- 1. **`context` CLI** — a Node/Bun-compatible executable that captures documents, extracts code structure, and manages a local context workspace.
10
- 2. **`plugin/` source** — human-maintained command/skill/manifest sources that `scripts/build-plugin.ts` compiles into the four plugin install trees in the `context4ai/context` repo.
9
+ 1. **`context` CLI** — a Node/Bun-compatible executable that manages project-local context workspaces, repo sources, extraction, review, package build, verify, and status guidance.
10
+ 2. **Global plugin installer** — `context plugin install` installs and refreshes the package-bundled plugin marketplace globally for Claude and Codex. It materializes the Codex plugin copy under `~/.codex/plugins/cache/c4a/context/local/`. The public plugin entrypoints are `init` and `continue`; `continue` is agent guidance, not a CLI primitive.
11
+ 3. **`plugin/` source** — human-maintained command/skill/manifest sources that `scripts/build-plugin.ts` compiles into installable marketplace trees.
11
12
 
12
- The split follows a simple rule: mechanical work is the CLI's job; synthesis work (knowledge alignment, compilation, knowledge-side drop cleanup) is the agent's job. The CLI never calls an LLM. Naming surfaces are deliberately separate: `/context:*` is a Claude slash command, Cursor exposes prefixed command entries such as `/context-align` / `/context-compile`, `Context: ...` / `context-*` is a public skill entry for skill-only agents, `context ...` is the CLI primitive, and `context:skill-*` is an internal procedure invoked by the workflow.
13
+ The split follows a simple rule: mechanical work is the CLI's job; synthesis work is the agent's job. The CLI never calls an LLM. Naming surfaces are deliberately separate: `/context:init` and `/context:continue` are Claude slash commands, Cursor exposes prefixed entries such as `/context-init` / `/context-continue`, `Context: ...` / `context-*` is a public skill entry for skill-only agents, and `context ...` is the CLI primitive. There is no `context continue` CLI command.
13
14
 
14
- ## Install
15
+ Agent-facing dialogue follows the user's current conversation language. CLI
16
+ commands, flags, ids, status values, JSONL keys, and `source_ref` tokens remain
17
+ stable protocol text and are not translated.
15
18
 
16
- ```bash
17
- # 1. Install the CLI globally (required by every plugin path; `context` must be on PATH).
18
- bun install -g @c4a/context-cli
19
- context --version
20
-
21
- # 2. Install the plugin for your editor.
22
- # Claude Code:
23
- claude /plugin marketplace add context4ai/context
24
- claude /plugin install context@c4a
19
+ ## Global Plugin + Project Workspace
25
20
 
26
- # Codex CLI:
27
- codex marketplace add context4ai/context
21
+ ```bash
22
+ # Install or refresh global agent commands/skills.
23
+ bunx @c4a/context-cli plugin install
28
24
 
29
- # Cursor:
30
- # Dashboard → Settings → Plugins → Import → https://github.com/context4ai/context
25
+ # Create a standalone context project.
26
+ context init context
31
27
 
32
- # Vercel-style skills (Windsurf / OpenCode / Cline / Copilot etc.):
33
- npx skills add github:context4ai/context context-align
28
+ cd context
29
+ bun install
30
+ /context:continue
34
31
  ```
35
32
 
36
- All four plugin paths point at the [context4ai/context](https://github.com/context4ai/context) repo (generated from this package's `plugin/` source). They are independent of the npm CLI — the CLI is a hard prerequisite the plugin commands call out to via `$PATH`.
33
+ The global plugin calls `context ...` from the current project root.
34
+ Agent commands follow CLI `next:` hints: they execute safe mechanical steps and
35
+ stop at `Human gate:` / placeholder next steps, source registration, source scope
36
+ selection, review, package output choice, or source-repo operations outside the
37
+ CLI. Agents must not infer repo sources or extraction scope from the surrounding
38
+ monorepo.
37
39
 
38
- When installed as a Claude Code plugin, the `postinstall` hook checks whether the `context` bin is already on PATH. If not, it prints the two commands you can run yourself (`bun install -g @c4a/context-cli` for registry installs, or `bun link` for a local build). It never spawns an install on your behalf — that would silently substitute a registry build for a local tarball / file: / github: plugin install.
40
+ After `bun install`, the workspace has an installed SDK manual:
39
41
 
40
- For local checkout development, link installs, or branch-specific plugin testing, see [DEVELOPMENT.md](./DEVELOPMENT.md).
42
+ ```text
43
+ node_modules/@c4a/context/docs/README.md
44
+ node_modules/@c4a/context/docs/guides/agent-guide.md
45
+ node_modules/@c4a/context/docs/reference/project-api.md
46
+ node_modules/@c4a/context/docs/reference/package-templates.md
47
+ ```
41
48
 
42
- ## Quick tour
49
+ Template examples ship at:
43
50
 
44
- ```bash
45
- # Initialize a workspace in the current project
46
- context init my-product --with-all-aspects
47
-
48
- # Dedicated knowledge repo: use the current directory as the data root
49
- context init my-kb --layout root --language English --minimal
50
-
51
- # Start without aspects; append them later when needed
52
- context init my-kb --no-aspects
53
- context init --with-aspects code,openapi
54
-
55
- # Capture material as sources (CLI does the ingestion)
56
- context capture https://example.feishu.cn/docx/<token>
57
- context capture ./docs/design.md
58
- context capture --inbox
59
- context capture --code packages/extract --plan --format json
60
- context capture --code --module packages/extract --version-from package
61
- context capture --code # refresh existing code capture config
62
- context compile code <source-slug>
63
- context compile close
64
-
65
- # In Claude Code, align → compile → drop are agent-driven
66
- /context:align # agent classifies raw into a Node tree; user confirms
67
- /context:compile # agent writes Section-level actions for each Node; CLI renders
68
- /context:query "page perf 工具有哪些?" # answer with cited Node/Section evidence (BM25 + structure, no RAG)
69
- /context:drop feishu:doc:xxx --reason "obsolete"
70
- /context:status
51
+ ```text
52
+ node_modules/@c4a/context/templates/package-templates/
71
53
  ```
72
54
 
73
- ## Production Agent Contract
55
+ Agents should read these files instead of probing `node_modules/@c4a/context/dist`
56
+ with temporary scripts.
74
57
 
75
- For production Agent workflows, `context` is a semantic service. A local path is valid when it is the external capture input (`context capture ./docs/design.md`) or another user-supplied source target. Agent-authored workflow payloads use stdin plus CLI-owned payload handles, not scratch files. After capture succeeds, continue with the returned `source_id`, `block_id`, `source_ref`, `node_slug`, Section id, workflow payload name, scope id, digest, or query text.
58
+ For local checkout development and link installs, see [DEVELOPMENT.md](./DEVELOPMENT.md).
76
59
 
77
- Workspace language is also part of the Agent contract. `config.yaml` can set `workspace.language` or `defaults.compile_language`; align and compile expose this as `generation_policy` in `align-segments` and NodeContext. Agents should generate Node titles, summaries, Section prose, and user-facing reports in that language while preserving product names, code identifiers, flags, slugs, `source_ref` values, and exact quoted evidence.
60
+ ## Project-local quick tour
78
61
 
79
- Do not treat the workspace storage tree as the protocol. Agent-facing workflows should not read, list, grep, cat, or derive state from `.context/**`, `raw/**`, `knowledge/**`, `output/**`, archives, cache roots, or rendered Markdown files. Use `context workflow status/show` for workflow payloads, `context source ...` for source metadata, `context mdrive ...` and `context query` for knowledge, and `context status` / `context doctor` / `context verify` for semantic diagnostics.
62
+ ```bash
63
+ # Create a standalone context project.
64
+ bunx @c4a/context-cli init context
65
+ cd context
66
+ bun install
67
+
68
+ # Or initialize the current directory as the project root.
69
+ bunx @c4a/context-cli init . --name my-product-context
70
+ bun install
71
+
72
+ # Register a local repo source when the agent-guided next step asks for it.
73
+ # The ref should be a pinned commit SHA.
74
+ context source add repo sample-lib --local ../sample-lib
75
+
76
+ # In a monorepo, register the chosen package/subdirectory as the source.
77
+ # Do not register the parent monorepo and use extractTs.include as a package selector.
78
+ context source add repo sample-lib --local ../packages/sample-lib
79
+
80
+ # Optional overrides when origin / HEAD cannot be inferred:
81
+ context source add repo sample-lib \
82
+ --local ../sample-lib \
83
+ --remote https://git.example.com/sample-lib.git \
84
+ --ref <commit-sha>
85
+
86
+ # Check source readiness. The CLI reports diagnostics and hints only;
87
+ # it does not clone, checkout, reset, or otherwise mutate the source repo.
88
+ context source ensure
89
+
90
+ # Inspect declared phases and let status suggest the next step.
91
+ context status
92
+ context run --list
93
+ context run extract:sample-lib:codegraph --dry-run
94
+ ```
80
95
 
81
- Agent-facing output should be stable by construction: shared protocol/schema/lookup context comes before task-specific objects, JSON key order is deterministic, and default output does not add current timestamps, random ids, storage paths, or host absolute paths. Existing knowledge is the registry. Use `context mdrive glossary list|match`, `context mdrive node list`, and `context query` to reuse term/service/system/action/domain handles; do not create or read a separate dynamic registry file.
96
+ The current project-local protocol uses `src/index.ts`, `sources/`, `unapproved/`, `knowledge/`,
97
+ `README.md`, `AGENTS.md`, and `package.json`. `dist/` contains generated package
98
+ outputs and is rebuilt from approved knowledge and templates.
99
+ Runtime scratch lives under `.tmp/context-runtime/` and is ignored. It may contain run logs, review HTML, previews, locks, and cache files; it is not the committed state source. Committed state is the combination of source registries and document snapshots under `sources/`, `unapproved/entities.jsonl`, approved Markdown under `knowledge/`, project code under `src/`, and project guidance in `README.md` / `AGENTS.md`.
82
100
 
83
- `source_ref` is an opaque citation token. Copy it into citations and decisions exactly as printed; do not parse it or dereference it as a file path. Human/report views may show clickable files for user inspection. Developer/debug-only `context debug ...` commands may expose storage paths for diagnostics, but those values are not production Agent workflow inputs.
101
+ ## Current Workflow Model
84
102
 
85
- Code knowledge uses a code-first route. `context capture --code` records a raw code snapshot; `context compile code <source-slug>` materializes it into package/category/symbol Nodes such as `pkg`, `pkg/components`, and `pkg/symbol/button`. Package roots and category files are navigation surfaces, while concrete symbol Nodes carry code-owned Sections and can later retain doc-owned examples or manual notes. Agents should address these Nodes by slug and query metadata (`source_id`, `source_type`, `evidence_kind`, `source_ref`, `code_projection_status`) rather than by source file paths.
103
+ The project-local workflow is status-driven. Register sources, declare phases in
104
+ `src/index.ts`, then let `context status` and phase views route each gate:
86
105
 
87
- ## Developer Storage Layout
106
+ | Gate | Current surface |
107
+ |---|---|
108
+ | Source setup | `context source add repo/file/lark`, `context source ensure`, and project source declarations. |
109
+ | Document capture | Declared `capture:file:<source>` / `capture:lark:<source>` phases through `context run` after the source read gate. |
110
+ | Prose structure | `alignProse` phases through `context run align:<type>:<source>:<collection> --view/--validate/--stage`, producing confirmed `unapproved/structure.yaml`. |
111
+ | Source-bound prose compile | `compileProse` phases through `context run compile:<type>:<source>:<collection> --view/--validate/--stage`, producing review candidates from confirmed structure. |
112
+ | Review/apply | `context review html` and `context review apply` own approval, rejection, scoped quick decisions, and source-mirrored approved Markdown materialization. |
113
+ | Close/verify/build | `context close`, `context verify`, `context build`, package templates, OKF indexes, and generated `knowledge-query` skills own final package readiness. |
88
114
 
89
- The following tree describes the CLI-owned storage implementation for developers and operators. It is not the production Agent workflow contract.
115
+ Do not simulate lifecycle or retraction work by deleting files under `sources/`,
116
+ `knowledge/`, `unapproved/`, `dist/`, or `.tmp`. Status and plugin guidance must
117
+ route users back to the gate that owns the fix.
90
118
 
91
- Embedded layout (default):
119
+ ## Agent Contract
92
120
 
93
- ```
94
- .context/
95
- ├── config.yaml # workspace name, schema version, aspects
96
- ├── raw/ # immutable captured source bodies (CLI-owned; metadata lives in _sources.yaml)
97
- │ ├── _sources.yaml # authoritative source registry
98
- │ ├── feishu/<date>-<slug>…md
99
- │ ├── local/<date>-<slug>…md
100
- │ └── aspect/code/<source-slug>/<snapshot-id>/
101
- ├── output/ # workflow scratch only; root contains directories, not files
102
- │ ├── align/ # align proposal/review/debug scratch
103
- │ ├── compile/ # compile context/draft/prepare/review scratch
104
- │ ├── drop/ # drop plan/prepare/review scratch
105
- │ └── archive/ # archived workflow scratch
106
- ├── .cache/ # ignored internal cache, including current align binding
107
- ├── knowledge/ # synthesized articles (CLI-rendered, agent-directed)
108
- │ ├── _index.md # workspace index (derivable, rebuilt by compile close)
109
- │ ├── changelog.md # append-only compile / drop log (derivable from git)
110
- │ ├── domain/ entity/ action/ # one directory per Node type
111
- ├── archive/ # dropped but restorable raw / knowledge artifacts
112
- └── aspects/<name>/README.md # per-aspect maintainer guides
113
- ```
121
+ For project workflows, `context` is a semantic service. Agents should call the CLI and use returned source names, phase ids, candidate ids, package names, diagnostics, and `source_ref` values. They should not derive state by walking runtime cache directories.
114
122
 
115
- Root layout (`context init --layout root`) uses the same tree directly in the current directory: `config.yaml`, `raw/`, `output/`, `knowledge/`, `archive/`, `aspects/`, and `inbox/` live at repo root. Root layout is intended for dedicated knowledge repositories; initialization refuses to run if those C4A-owned entries already exist.
116
-
117
- `context init` also creates `AGENTS.md` inside the C4A data root (`.context/` in embedded layout, current directory in root layout) and, when absent, a same-directory `CLAUDE.md` symlink pointing to `AGENTS.md`. Existing files are kept.
118
-
119
- Data model: Node (`domain` / `entity` / `action`) + Section (ten kinds, mounted by node type) + derived traversal edges. Named concept-layer subjects are modeled as `entity` nodes with the `term` tag when their core content is a stable 1-3 sentence definition. Routing schemes, durable rules, data-shape descriptions, procedures, and design choices live inside the matching domain/entity/action Sections such as `spec`, `principle`, `decision`, `comparison`, or `warning`. `mdrive node list` and `mdrive query` expose a `node_class` (`domain`, `action`, `concrete_entity`, `term`) so glossary-style terms stay visible without flattening them into concrete services/systems.
123
+ `source_ref` is an opaque citation token. Copy it into citations and decisions exactly as printed; do not parse it or dereference it as a file path. Human/report views may show source locations for inspection, but those values are not production workflow inputs.
120
124
 
121
125
  ## Commands
122
126
 
123
- Workflow payload exploration uses a single Agent-facing query protocol:
124
-
125
- - `--view` selects the semantic view, such as `source-refs`, `coverage-summary`, `coverage`, or `blocks`.
126
- - `--token-budget <n>` controls the returned context window size. Budgeted views report `token_budget`, `token_used`, `shown_count`, `total`, `omitted_count`, `truncated`, `selection_policy`, `item_id_field`, and `how_to_explore[]`.
127
- - `--source`, `--heading`, `--node`, `--type`, `--status`, `--candidate-id`, and `--item-id` only narrow a view. Agents should follow `how_to_explore[]` when `truncated: true` instead of piping JSON through shell tools or manually slicing payloads.
128
- - Citation-eligible entries appear in `items[]`; background-only entries appear in `context_items[]` when budget allows, with `context_omitted_count` reporting omitted background.
129
-
130
127
  | Command | Role | Notes |
131
128
  |---|---|---|
132
- | `context init [name]` | CLI | Create or append an embedded `.context/` workspace or a root-layout workspace; copy aspect templates and write `AGENTS.md`. |
133
- | `context capture <url \| ./path.md [./more.md...] \| --stdin \| --inbox \| --refresh \| --code [path]>` | CLI | Ingest external documents or code into the source registry. Feishu URLs use `lark-cli`; local `.md` files can be captured one at a time, as variadic paths, or as newline-separated paths from stdin. `--code` snapshots TypeScript packages/symbols/edges through the code aspect. For Agent interaction, run `context capture --code <path> --plan --format json` first, show only package name / module path / version, then capture with repeated `--module <path>`. After capture, continue with source ids and semantic handles, not storage paths. |
134
- | `context extract <path>` | CLI | Read-only developer/debug print of an extraction; never writes workspace files and is not part of the production Agent workflow. |
135
- | `context debug <workflow\|source\|workspace\|storage\|command\|snapshot> ...` | CLI | Developer/debug-only path diagnostics. Output is storage-coupled and not a production Agent workflow input. |
136
- | `context align scan \| coarse-read --input - \| ops --input - \| validate --input - \| finalize --validated \| finalize --input - \| code [slug]` | CLI | Workflow helpers driven by the `/context:align` skill pipeline. `scan` returns workflow payload names, scopes, digests, route envelope, and budget-safe inspect commands; agents inspect `align-segments` through `context workflow show --payload align-segments --view blocks --token-budget 2000 --unwrap --format json`, then narrow with `--source`, `--heading`, or CLI-provided `how_to_explore[]`. `--unwrap` only removes the workflow metadata envelope. Validate before finalize; successful validate stores an `align-validated-decision` payload and returns the preferred `context align finalize --validated --payload-digest <digest>` command. `finalize --input -` remains for compatibility and advanced repair. Batched `coarse-read` / `ops` are only used when `next_action.command` asks for them. `code` is a dry-run deterministic code projection route and does not enter prose align. `context schema <name>` prints the exact align workflow input schemas. |
137
- | `context compile scan \| context <slug> [--view source-refs] \| cycle <slug> --input - --accept-safe-defaults \| draft <slug> --input - --prepare \| close \| code [source-slug]` | CLI | `code` is the deterministic code projection route: it turns captured code snapshots into package/category/symbol knowledge Nodes and does not enter prose draft/reconcile. Workflow helpers driven by the `/context:compile` skill pipeline handle prose/doc knowledge. `scan` returns the incremental compile workset, resume point, and budget-safe source-ref prefetch commands. `context <slug> --view source-refs --token-budget 2000` is a budgeted projection of `NodeContext.raw_snippets[]` for copying citation handles into draft `source_refs[]`; it is not a separate data source. Coverage payloads are inspected with `context workflow show --payload coverage-candidates --view coverage-summary --token-budget 2000 --unwrap --format json` and narrowed with `--view coverage --type <issue-type>` or `--node <slug>`. `cycle <slug>` is the low-friction per-node path: it validates the submitted draft, prepares reconcile, accepts mechanically safe defaults, and applies only when no semantic judgment remains (`status: applied` / `partial-applied` / `review-required`). Manual `draft <slug> --prepare → reconcile review/apply` remains the fallback for questions and unsupported evidence. `--delegated` is a one-time, workflow-level authorization recorded on the initial scan/context/draft/cycle command; it lets the CLI auto-accept low-risk weak source support but never bypasses unsupported evidence, type drift, schema errors, or destructive gates. Normal handoff uses stdin and current workflow payloads; digest flags are optional stale guards, not values agents need to extract. `--save-input` is only an explicit debug scratch copy, not workspace truth. |
138
- | `context workflow show --payload <name> --view <view> [--token-budget <n>]` | CLI | Inspect workflow payloads through semantic views. High-frequency views are `node-context --view source-refs`, `coverage-candidates --view coverage-summary`, `coverage-candidates --view coverage`, and `align-segments --view blocks`. Follow returned `how_to_explore[]` commands for narrowing or budget expansion. |
139
- | `context mdrive <group> <verb>` | CLI | Knowledge primitive shell: node / section / edge / query / verify / glossary / workspace. Node/query results include `node_class` to distinguish concrete entities from term definitions. `context mdrive verify workspace --experimental` adds heuristic quality warnings for very thin concrete entities and terms that have grown beyond definition shape; these are warnings, not entity-count limits. `context mdrive query --stats-only` prints only workspace counts; run `context mdrive --help` for subcommands. |
140
- | `context drop <source-id\|url> --plan [--save-output [file]]` / `context drop --apply-plan --reason <text> --yes` | CLI | Plans and applies source retraction through the current drop workflow. `drop --plan` stores the canonical `drop-plan` workflow payload; `--save-output` is only an optional human-readable scratch copy, not a later input. `reconcile prepare --mode drop` reads the current workflow plan, `reconcile review --decisions -` stores the ready review when semantic decisions are needed, and `drop --apply-plan` consumes the current workflow plan/review without plan or decisions files. |
141
- | `context purge [--yes]` | CLI | Permanently deletes every archive under `archive/` after a summary + confirmation; active `raw/` and `knowledge/` are not modified. |
142
- | `context verify` | CLI | Whole-workspace verify (schema, Section mount matrix, contains acyclicity, dropped-source references, dangling `src-N`, body ad-hoc headings, domain-inline-child, duplicate slug). |
143
- | `context doctor` | CLI | Workspace diagnostics for current workflow, align output, knowledge, caches, evidence, coverage, semantic ledger, and archive state. |
144
- | `context status [--format json\|table]` | CLI | Workspace overview + next-action suggestions. |
145
- | `context query "<question>" [--intent <intent>] [--scope <slug>] [--evidence code\|prose\|all] [--tag <tag>] [--domain <slug>]` | CLI | Local knowledge query with hit/miss/select protocol. Intents: `orientation` (workspace map, supports `--tag` / `--domain` filters and a token-budgeted Slug Map + Summary), `node_lookup` (BM25 candidate Nodes from query text), `node_view` (open a known Node by slug), `section_search` (BM25 inside a chosen Node), `impact_analysis` (structural relations), `recall` (archive / reconciliation audit). Code package/category scopes search their contains subtree; concrete symbol scopes can return both code-owned and doc-owned Sections. JSON hits expose `source_id`, `source_type`, `evidence_kind`, `source_ref`, and code projection metadata when present. Without `--intent`, the CLI infers from the flags supplied. BM25 only — no vector embeddings. |
146
- | `/context:query <question>`, `/context:align`, `/context:compile`, `/context:capture`, `/context:drop`, `/context:status`, `/context:purge` | Agent | Skill-driven wrappers around the CLI. Read flows (`query`, `status`) answer directly with cited evidence; write flows (`align`, `compile`, `capture`, `drop`, `purge`) produce structured JSON/YAML per skill contract and confirm destructive steps with the user. |
147
- | `/context:context <free text>` | Agent | Fuzzy router over the above. |
148
-
149
- CLI commands that require a workspace exit with a workspace-not-found error if run outside a directory tree containing either embedded `.context/` layout or root layout; `context init` is the only command that creates one.
129
+ | `context plugin path` | CLI | Print the bundled plugin marketplace root. Installed packages normally use `dist/plugins`; source checkouts use the same path after build. |
130
+ | `context plugin install [--agent claude\|codex\|all] [--dry-run]` | CLI | Install or refresh the bundled plugin marketplace globally for Claude and/or Codex. It replaces existing `context` marketplace entries and Codex cache owned by this package before reinstalling. |
131
+ | `context plugin status [--agent claude\|codex\|all]` | CLI | Inspect bundled plugin path and agent CLI availability. |
132
+ | `context init [project-dir] [--name <name>] [--dev]` | CLI | Create a project-local context workspace. Defaults to `context/`; use `.` to initialize the current directory. Use `--dev` for local checkout testing before `@c4a/context` is published. |
133
+ | `context source add repo <name> --local <repo-or-subdir> [--remote <url>] [--ref <sha>]` | CLI | Register a repo source and pin it to a commit. Local paths may point at a monorepo subdirectory; the CLI stores the git root plus subpath, and materializes the source view to the subdirectory. Remote and ref are inferred from local origin / HEAD when omitted. Short SHAs are resolved to full commits when the local repo is available. |
134
+ | `context source ensure [name]` | CLI | Validate and materialize local source symlinks. Missing remotes only produce hints; the CLI does not clone or checkout automatically. |
135
+ | `context source list|get <name>` | CLI | Inspect the repo source registry and readiness metadata. |
136
+ | `context source inspect [name]` | CLI | Detect module/package boundaries in registered repo sources without extraction. Use this before extracting monorepo roots; it prints package names, paths, versions when available, and suggested source registration commands. |
137
+ | `context run --list` | CLI | List phases declared by `src/index.ts`. |
138
+ | `context run <phase-id> [--dry-run]` | CLI | Inspect or run one declared phase. Dry run prints reads/writes and, for extract phases when sources are ready, a resolved preview with modules, file counts, symbol counts, candidate estimates, and module error hints. It does not mutate project files. |
139
+ | `context review html [collection] [--open]` | CLI | Render the local self-contained HTML review surface under `.tmp/context-runtime/review/`, emit a clickable `file://` URL, and optionally open it with the system browser. |
140
+ | `context review list [collection]` | CLI | List draft candidates for CLI-oriented review. |
141
+ | `context review apply <payload-file>` | CLI | Apply copied review decisions; approved entities materialize to `knowledge/`, rejected entities remain in `unapproved/entities.jsonl`. |
142
+ | `context review approve|reject <candidate-id> --collection <collection>` / `--all` | CLI | Scoped quick marking for a single draft candidate when the user explicitly authorizes an automated or quick path. |
143
+ | `context build` | CLI | Build declared project packages from approved knowledge into `dist/<package-name>/`. |
144
+ | `context verify [--format table\|json]` | CLI | Validate the project skeleton, registry, unapproved ledger, approved Markdown, source refs, and package outputs. |
145
+ | `context status [--format json\|table]` | CLI | Workspace overview + a canonical `next:` hint. Agent plugins expose this workflow as `/context:continue`; do not add or call `context continue`. |
146
+
147
+ Commands that require a project exit with a workspace-not-found error if run outside a directory tree containing a `package.json` `context.project=true` / `context.entry` marker. `context init` is the command that creates one.
150
148
 
151
149
  ## Development
152
150
 
153
- Source lives at [`packages/context-cli/`](./src) in the c4a monorepo.
151
+ Source lives at [`packages/context-cli/`](./src) in this workspace.
154
152
 
155
153
  ```bash
156
- bun run --filter @c4a/context-cli build # bundle CLI + render plugin.json
154
+ ./start.sh link # local checkout: build CLI, link global context, register SDK for init --dev
155
+ bun run --filter @c4a/context-cli build # bundle CLI + render dist/plugins
157
156
  bun run --filter @c4a/context-cli test # unit + integration tests
158
157
  bun run --filter @c4a/context-cli typecheck
159
158
  bun run --filter @c4a/context-cli lint
160
159
  ```
161
160
 
162
- The build chains `scripts/build-plugin.ts`, which reads the human-maintained `plugin/` source and generates self-contained install trees into the nested `c4a-plugins/` directory at the c4a repo root. That directory is an independent git repo (remote: [`context4ai/context`](https://github.com/context4ai/context)) and is `.gitignore`d by c4a. Before running `build:plugin` locally for the first time, clone it:
163
-
164
- ```bash
165
- cd /path/to/c4a
166
- git clone https://github.com/context4ai/context.git c4a-plugins
167
- ```
168
-
169
- Plugin marketplace releases are pushed from `c4a-plugins/`, separate from the npm tarball that `@c4a/context-cli` publishes. Do not edit generated build trees directly.
161
+ The package build writes installable plugin trees to `dist/plugins`, which is shipped in the npm tarball. `context plugin install` resolves that package-bundled path at runtime and installs it globally for Claude / Codex. For Codex, the installer also copies `dist/plugins/codex` into `~/.codex/plugins/cache/c4a/context/local/`, matching Codex's local-plugin cache convention. Do not edit generated build trees directly.
170
162
 
171
163
  ## License
172
164