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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +115 -123
  2. package/babel.cjs +257 -0
  3. package/cli.js +51018 -96457
  4. package/docs/quickstart.md +85 -0
  5. package/package.json +3 -1
  6. package/plugin/.claude-plugin/plugin.json.template +1 -1
  7. package/plugin/.codex-plugin/plugin.json.template +5 -5
  8. package/plugin/.cursor-plugin/plugin.json.template +1 -1
  9. package/plugin/README.md +105 -85
  10. package/plugin/README_CN.md +92 -84
  11. package/plugin/commands/continue.md +34 -0
  12. package/plugin/commands/init.md +13 -130
  13. package/plugin/skills/skill-continue-workflow/SKILL.md +172 -0
  14. package/plugin/skills/skill-init-workspace/SKILL.md +74 -0
  15. package/plugin/skills/skill-package-output/SKILL.md +167 -0
  16. package/plugin/skills/skill-prose-align/SKILL.md +296 -0
  17. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  18. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  19. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  20. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  21. package/plugin/skills/skill-prose-compile/SKILL.md +265 -0
  22. package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  23. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  24. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  25. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  26. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  27. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  28. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  29. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  30. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  31. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  32. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  33. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  34. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  35. package/plugin/skills/skill-review-gate/SKILL.md +98 -0
  36. package/plugin/skills/skill-source-scope/SKILL.md +402 -0
  37. package/plugin/skills/skill-source-scope/references/capture-source.md +171 -0
  38. package/plugins/.agents/plugins/marketplace.json +20 -0
  39. package/plugins/.claude-plugin/marketplace.json +13 -0
  40. package/plugins/.cursor-plugin/marketplace.json +17 -0
  41. package/plugins/README.md +150 -0
  42. package/plugins/README_CN.md +136 -0
  43. package/plugins/VERSION +1 -0
  44. package/plugins/assets/icon.svg +3 -0
  45. package/plugins/assets/logo.svg +3 -0
  46. package/plugins/assets/workflow-en.png +0 -0
  47. package/plugins/assets/workflow.png +0 -0
  48. package/plugins/claude/.claude-plugin/plugin.json +16 -0
  49. package/plugins/claude/.generated +1 -0
  50. package/plugins/claude/CLAUDE.md +5 -0
  51. package/plugins/claude/README.md +5 -0
  52. package/plugins/claude/commands/continue.md +34 -0
  53. package/plugins/claude/commands/init.md +21 -0
  54. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +172 -0
  55. package/plugins/claude/skills/skill-init-workspace/SKILL.md +74 -0
  56. package/plugins/claude/skills/skill-package-output/SKILL.md +167 -0
  57. package/plugins/claude/skills/skill-prose-align/SKILL.md +296 -0
  58. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  59. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  60. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  61. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  62. package/plugins/claude/skills/skill-prose-compile/SKILL.md +265 -0
  63. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  64. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  65. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  66. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  67. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  68. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  69. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  70. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  71. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  72. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  73. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  74. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  75. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  76. package/plugins/claude/skills/skill-review-gate/SKILL.md +98 -0
  77. package/plugins/claude/skills/skill-source-scope/SKILL.md +402 -0
  78. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +171 -0
  79. package/plugins/codex/.codex-plugin/plugin.json +38 -0
  80. package/plugins/codex/.generated +1 -0
  81. package/plugins/codex/AGENTS.md +5 -0
  82. package/plugins/codex/README.md +5 -0
  83. package/plugins/codex/assets/icon.svg +3 -0
  84. package/plugins/codex/assets/logo.svg +3 -0
  85. package/plugins/codex/assets/workflow-en.png +0 -0
  86. package/plugins/codex/assets/workflow.png +0 -0
  87. package/plugins/codex/skills/continue/SKILL.md +47 -0
  88. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  89. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +74 -0
  90. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +167 -0
  91. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  92. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  93. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  94. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  95. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +296 -0
  96. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  97. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  98. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  99. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  100. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  101. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  102. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  103. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  104. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  105. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  106. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  107. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  108. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  109. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +265 -0
  110. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +98 -0
  111. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  112. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +402 -0
  113. package/plugins/codex/skills/init/SKILL.md +34 -0
  114. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +172 -0
  115. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +74 -0
  116. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +167 -0
  117. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  118. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  119. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  120. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  121. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +296 -0
  122. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  123. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  124. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  125. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  126. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  127. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  128. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  129. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  130. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  131. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  132. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  133. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  134. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  135. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +265 -0
  136. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +98 -0
  137. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  138. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +402 -0
  139. package/plugins/cursor/.cursor-plugin/plugin.json +29 -0
  140. package/plugins/cursor/.generated +1 -0
  141. package/plugins/cursor/AGENTS.md +5 -0
  142. package/plugins/cursor/README.md +13 -0
  143. package/plugins/cursor/assets/icon.svg +3 -0
  144. package/plugins/cursor/assets/logo.svg +3 -0
  145. package/plugins/cursor/assets/workflow-en.png +0 -0
  146. package/plugins/cursor/assets/workflow.png +0 -0
  147. package/plugins/cursor/commands/context-continue.md +38 -0
  148. package/plugins/cursor/commands/context-init.md +25 -0
  149. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +172 -0
  150. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +74 -0
  151. package/plugins/cursor/skills/skill-package-output/SKILL.md +167 -0
  152. package/plugins/cursor/skills/skill-prose-align/SKILL.md +296 -0
  153. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  154. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  155. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  156. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  157. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +265 -0
  158. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  159. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  160. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  161. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  162. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  163. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  164. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  165. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  166. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  167. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  168. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  169. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  170. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  171. package/plugins/cursor/skills/skill-review-gate/SKILL.md +98 -0
  172. package/plugins/cursor/skills/skill-source-scope/SKILL.md +402 -0
  173. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +171 -0
  174. package/plugins/skills/context-continue/SKILL.md +47 -0
  175. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  176. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +74 -0
  177. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +167 -0
  178. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  179. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  180. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  181. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  182. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +296 -0
  183. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  184. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  185. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  186. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  187. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  188. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  189. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  190. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  191. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  192. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  193. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  194. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  195. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  196. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +265 -0
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +98 -0
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +402 -0
  200. package/plugins/skills/context-init/SKILL.md +34 -0
  201. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +172 -0
  202. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +74 -0
  203. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +167 -0
  204. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  205. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  206. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  207. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  208. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +296 -0
  209. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  210. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  211. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  212. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  213. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  214. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  215. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  216. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  217. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  218. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  219. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  220. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  221. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  222. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +265 -0
  223. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +98 -0
  224. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  225. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +402 -0
  226. package/scripts/build-plugin.ts +70 -126
  227. package/plugin/commands/align.md +0 -71
  228. package/plugin/commands/capture.md +0 -113
  229. package/plugin/commands/compile.md +0 -103
  230. package/plugin/commands/context.md +0 -35
  231. package/plugin/commands/drop.md +0 -38
  232. package/plugin/commands/extract.md +0 -18
  233. package/plugin/commands/purge.md +0 -22
  234. package/plugin/commands/query.md +0 -22
  235. package/plugin/commands/status.md +0 -25
  236. package/plugin/skills/skill-align-workflow/SKILL.md +0 -110
  237. package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +0 -60
  238. package/plugin/skills/skill-align-workflow/references/density-profile.md +0 -16
  239. package/plugin/skills/skill-align-workflow/references/gates.md +0 -162
  240. package/plugin/skills/skill-compile-close/SKILL.md +0 -127
  241. package/plugin/skills/skill-compile-draft/SKILL.md +0 -175
  242. package/plugin/skills/skill-compile-draft/references/action-domain-gates.md +0 -34
  243. package/plugin/skills/skill-compile-draft/references/notes.md +0 -34
  244. package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +0 -71
  245. package/plugin/skills/skill-compile-draft/references/structural-challenges.md +0 -76
  246. package/plugin/skills/skill-compile-judge/SKILL.md +0 -112
  247. package/plugin/skills/skill-context-query/SKILL.md +0 -233
  248. package/plugin/skills/skill-drop/SKILL.md +0 -189
  249. package/plugin/skills/skill-semantic-reconcile/SKILL.md +0 -136
  250. package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +0 -31
  251. package/plugin/skills/skill-semantic-reconcile/references/mode-semantics.md +0 -41
  252. package/plugin/skills/skill-semantic-reconcile/references/scope-review-and-omit.md +0 -60
  253. package/plugin/skills/skill-semantic-reconcile/references/temporal-and-evidence.md +0 -58
  254. package/plugin/skills/skill-semantic-reconcile/references/user-confirmation.md +0 -71
  255. package/scripts/build-aspect-runtime.ts +0 -45
  256. package/templates/aspect-runtime/aspectRunnerSdk.js +0 -776
  257. package/templates/aspects/README.md +0 -517
  258. package/templates/aspects/code/README.md +0 -48
  259. package/templates/aspects/code/aspect.yaml +0 -21
  260. package/templates/aspects/design-system/README.md +0 -26
  261. package/templates/aspects/graphql/README.md +0 -24
  262. package/templates/aspects/openapi/README.md +0 -24
@@ -1,71 +0,0 @@
1
- # Refresh and update
2
-
3
- Consult this reference when **any** of the following holds:
4
-
5
- - `existing.sections[]` is non-empty (Node already has active knowledge; this is a refresh, not a first compile).
6
- - `incremental.status` is `unchanged` or `full-context` (non-default incremental signals).
7
- - `incremental.locator_only_changes[]` is non-empty (locator-only deltas without content changes).
8
-
9
- For first compile of a fresh Node with `incremental.status === "changed-only"`, skip this file.
10
-
11
- ## Incremental status handling
12
-
13
- | `incremental.status` | What to do |
14
- |---|---|
15
- | `changed-only` (default) | Normal path — main SKILL.md procedure applies as written. |
16
- | `unchanged` | Emit exactly one `skip` action with a brief reason. Do not iterate snippets. |
17
- | `full-context` | Draft from the full fallback. **Preserve `unknown_inputs[]` reasons** in any abort/retry explanation so the caller sees why the fallback was needed. |
18
-
19
- The CLI may deterministically skip unchanged output or update locator-only evidence before writing. **Do not force rewrites to bypass fingerprint skip** — those skips are part of the protocol, not a problem to route around.
20
-
21
- ## Locator-only changes
22
-
23
- `incremental.locator_only_changes[]` entries always carry `agent_action: "none"` and `handled_by: "compile-close"`. **Do not emit a draft action for those Sections** unless the same Section also appears in `changed_blocks[]` with a real content change.
24
-
25
- ## Reconciling with `existing.sections[]`
26
-
27
- When `existing.sections[]` is non-empty, every `section-N` id you read here is a potential `update` / `supersede` / `deprecate` target. Walk the existing Sections in order and decide:
28
-
29
- | Raw evidence vs existing Section | op |
30
- |---|---|
31
- | Raw still supports the existing claim unchanged | Emit nothing (or one summarising `skip`) |
32
- | Raw clarifies or rephrases without changing meaning | `update` — same `section-N` stays active |
33
- | Raw changes meaning (new spec value, reversed decision) | `supersede` — old flips to `deprecated`; new gets fresh `section-N+k` |
34
- | Raw removes the supporting evidence | `deprecate` with `reason` |
35
-
36
- ### `supersede` vs `update` semantics
37
-
38
- `supersede` preserves the audit trail so readers see the prior policy — **critical for specs / decisions / principles**. Use `supersede` whenever the new statement *replaces* the old one's content; use `update` only for typo / wording fixes / detail additions that do not change meaning.
39
-
40
- `deprecate` is for "old rule removed without replacement". It needs a `reason`.
41
-
42
- ### `update` / `supersede.new` mechanics
43
-
44
- - `update` keeps the same `section-N` id; provide `source_block_ids[]` / `source_refs[]` for changed evidence and omit `content` when the new cited raw should be mirrored. Include `content` only for an intentional reader-surface rewrite. Do not include `kind` unless the kind itself is changing.
45
- - `supersede.new` is a fresh Section; it needs `kind` plus citation evidence. Omit `content` when cited raw should be mirrored; include `content` only for an intentional reader-surface rewrite. It may carry `summary`, `refers_to_nodes[]`, and `confidence` per the same rules as `add`.
46
- - `deprecate` only needs `target_section_id` and `reason`. Do not pass `content`, `source_block_ids[]`, or `source_refs[]`.
47
-
48
- ## Output schema (refresh ops)
49
-
50
- ```jsonc
51
- {
52
- "actions": [
53
- { "op": "update", "target_section_id": "section-3",
54
- "summary": "...",
55
- "refers_to_nodes": null,
56
- "source_block_ids": ["c0d4e5f61728"] },
57
- { "op": "supersede", "target_section_id": "section-5",
58
- "reason": "raw published a new retention value",
59
- "new": { "kind": "spec", "summary": "...",
60
- "refers_to_nodes": ["..."],
61
- "source_block_ids": ["9d1e2f3a4b5c"] } },
62
- { "op": "deprecate", "target_section_id": "section-2", "reason": "..." }
63
- ]
64
- }
65
- ```
66
-
67
- ## How this slots into the main procedure
68
-
69
- - **Step 1 — Sanity-check**: when `existing.sections[]` is non-empty, read every `section-N` id and `status` (active vs deprecated) before classifying snippets. When `incremental.status` is `unchanged`, short-circuit with one `skip`.
70
- - **Step 2 — Classify**: still walk the kind priority chain for each citation-eligible snippet; the reconciliation table above governs which `op` to emit for snippets that map to an existing Section.
71
- - **Step 5 — Self-verify**: every `update` / `supersede` / `deprecate` targets a known `section-N` from `existing.sections[]`. If not, return here.
@@ -1,76 +0,0 @@
1
- # Structural and ownership challenges
2
-
3
- Consult this reference when the cited evidence **cannot be written as a Section under the current align structure**:
4
-
5
- - The evidence describes a coherent process that should be its own `action` Node (not a Section here).
6
- - The evidence implies a missing `depends_on` edge between Nodes.
7
- - The evidence belongs under a different parent Node.
8
- - A finalized shared-block split leaves this Node with only secondary, non-citable evidence.
9
- - A visible `context_only` or secondary-shared block contains facts that need citation, requiring an ownership upgrade.
10
-
11
- In these cases, do **not** force the content into a Section. Emit a challenge action instead; the CLI stores it as a workflow payload and compile-close exposes it as debt until an align resolution handles it.
12
-
13
- ## When to challenge vs. when to skip
14
-
15
- | Situation | Action |
16
- |---|---|
17
- | Evidence is a repeatable procedure with steps that clearly warrant a sub-Action | `structure_challenge` with `kind: missing_action_node` |
18
- | Evidence depends on a Node that the current align graph does not link to this Node | `structure_challenge` with `kind: missing_depends_on_edge` |
19
- | Evidence belongs under a different parent | `structure_challenge` with `kind: wrong_parent` |
20
- | A finalized shared block split removed all primary evidence from this Node | `structure_challenge` with `kind: wrong_shared_block_split` |
21
- | The Node should not exist (its evidence belongs elsewhere) | `structure_challenge` with `kind: extra_action_node` |
22
- | A `context_only` or secondary-shared block holds facts this Node needs to cite | `pending_ownership_challenge` with `requested_role: "shared"` or `"owned"` |
23
-
24
- Supported `structure_challenge.kind` values: `missing_action_node`, `extra_action_node`, `wrong_shared_block_split`, `missing_depends_on_edge`, `wrong_parent`.
25
-
26
- `pending_ownership_challenge.requested_role` is `owned` (the Node should be sole author) or `shared` (the Node should join an existing owners list).
27
-
28
- ## Required fields
29
-
30
- ```jsonc
31
- {
32
- "op": "structure_challenge",
33
- "challenge_id": "ch_0001",
34
- "kind": "missing_action_node",
35
- "node_slug": "<matches node.slug>",
36
- "action_tag": "rollout-runbook",
37
- "summary": "The cited evidence is a repeatable procedure.",
38
- "source_ref": "src-1#ops L40-55@c0d4e5f61728",
39
- "reason": "Align must review structure before compile writes process prose."
40
- }
41
- ```
42
-
43
- ```jsonc
44
- {
45
- "op": "structure_challenge",
46
- "challenge_id": "ch_0002",
47
- "kind": "wrong_shared_block_split",
48
- "node_slug": "<matches node.slug>",
49
- "unresolved_target": "rollout-runbook",
50
- "reason": "The finalized shared block split leaves this Node with only secondary, non-citable evidence."
51
- }
52
- ```
53
-
54
- ```jsonc
55
- {
56
- "op": "pending_ownership_challenge",
57
- "challenge_id": "och_0001",
58
- "node_slug": "<matches node.slug>",
59
- "block_id": "2f4b8c1e9a03",
60
- "requested_role": "shared",
61
- "reason": "A visible context_only or secondary shared block contains facts that need citation."
62
- }
63
- ```
64
-
65
- Different `kind` values demand different sub-fields. On shape errors, follow the CLI's top-level diagnostics / `expected_shape` / returned repair `next_action` instead of guessing. `agent_hints[]`, when present, is only a cutover mirror and must not be the source of truth.
66
-
67
- ## What these are NOT
68
-
69
- - **Not a substitute for `skip`** when raw simply has no write-worthy fact for this Node.
70
- - **Not a Section.** Challenges never appear in active knowledge; they only travel through workflow state.
71
- - **Not a free upgrade path.** `request_full_text` may expose visible evidence text for inspection, but it does not change citation eligibility. If you need to cite secondary content, emit `pending_ownership_challenge` — do not paraphrase the secondary content into a Section.
72
-
73
- ## How this slots into the main procedure
74
-
75
- - **Step 3 — Build actions**: when evidence implies a missing Action, missing `depends_on`, wrong parent, or needed ownership upgrade, emit the corresponding challenge instead of writing a Section.
76
- - **Step 5 — Self-verify**: no Section write cites a `context_only` or secondary-shared block; if any did, replace the Section with a `pending_ownership_challenge`.
@@ -1,112 +0,0 @@
1
- ---
2
- name: skill-compile-judge
3
- description: >
4
- Packaged skill invoked by `/context:compile`; not a user slash command. Consumes the budget-safe compile prepare summary
5
- and candidate detail views, judges each draft action's raw evidence support and relation to listed candidates,
6
- and emits a compile.judge-decisions.v2 document for `context reconcile review`.
7
- tools:
8
- - Bash
9
- ---
10
-
11
- # skill-compile-judge — judge compile support and relation
12
-
13
- Decide whether each prepared compile item is supported by cited raw evidence
14
- and how it relates to the candidate Sections listed by the CLI. Emit judge
15
- decisions only; the CLI reviews, applies, and writes every workspace change.
16
-
17
- ## TL;DR — Non-negotiables
18
-
19
- - Invoke this skill only when the active prepare summary contains `judge_handoff` or the returned diagnostics explicitly ask for compile support/relation judgment. A `review_reconcile_decisions` envelope by itself is not enough: if the command is accepting safe defaults or the remaining work is compact `{ item_id, accept_default: true }`, follow that review path instead. If the active envelope asks for `patch_compile_draft`, `continue_compile_cycle`, or another action, stop and follow that `next_action.command` instead.
20
- - Input is the budget-safe compile prepare summary. If `page.has_more` is true, follow `next_command` until every prepare item is listed.
21
- - The summary is an index: use `item_detail_command` only when the full proposed content, raw evidence, or source_ref details are needed.
22
- - For items with candidates, load only that item's candidate detail view with `context workflow show --payload prepare --view candidates --item-id <item-id> --unwrap --format json`.
23
- - Do not inspect workspace storage directly or run ad-hoc scripts to reconstruct candidates. Use only `items[]`, `evidence[]`, raw/source_ref diagnostics, `candidates[]`, `previous_decisions[]`, and `judge_handoff`.
24
- - Output exactly one JSON or YAML document with `schema_version: "compile.judge-decisions.v2"` and `decisions[]`.
25
- - Keep one decision per `judge_handoff.items[].item_id`, preserving prepare order. Do not emit decisions for mechanical safe-default items that the caller will pass through `--accept-safe-defaults`.
26
- - For support, output `support_verdict: supported | weak | unsupported` plus `support_reason`.
27
- - For relation, output `relation_verdict: new | duplicate | supersede | conflict | merge_into` plus `relation_reason`.
28
- - Compare only the candidates listed on that item. Do not perform workspace-wide BM25, grep, or source-file searches.
29
- - Fill `compared_section_ids` with every visible candidate Section id you inspected and set `compared_count` to the total candidate count inspected across pages. If candidates are paged, continue until `compared_count >= candidate_total` before final output.
30
- - Escape hatch: when an item has no candidates, `relation_verdict: new` with `compared_section_ids: []` and `compared_count: 0` is valid and expected.
31
- - For `duplicate`, `supersede`, `conflict`, or `merge_into`, set `target_section_id` to the matched candidate Section id.
32
- - Same `source_ref` can support different Section kinds only when the semantic role differs. Detect and explain same-source-ref multi-kind cases instead of treating them as automatic duplicates.
33
- - Raw/source_ref diagnostics are mechanical evidence checks, not a keyword gate. A supported judge verdict comes from the cited raw evidence semantically covering the claim.
34
- - Evidence-boundary errors remain blocking evidence issues. Section kind precision, example formatting, and summary style are advisory unless the active CLI `next_action` explicitly blocks on them.
35
- - Weak support is a warning-level verdict, not permission to invent missing facts. Unsupported support should normally pair with `conflict` or a later user question rather than a write decision.
36
-
37
- <reference>
38
-
39
- ## Output Shape
40
-
41
- ```yaml
42
- schema_version: "compile.judge-decisions.v2"
43
- mode: compile
44
- decisions:
45
- - item_id: claim-001
46
- support_verdict: supported
47
- support_reason: "The cited raw block explicitly states the same invoice handling behavior."
48
- relation_verdict: new
49
- relation_reason: "No listed candidate covers this claim."
50
- compared_section_ids: []
51
- compared_count: 0
52
- ```
53
-
54
- For a relation against an existing candidate:
55
-
56
- ```yaml
57
- schema_version: "compile.judge-decisions.v2"
58
- mode: compile
59
- decisions:
60
- - item_id: claim-002
61
- support_verdict: supported
62
- support_reason: "The cited evidence covers the correction."
63
- relation_verdict: supersede
64
- relation_reason: "section-3 states the older behavior and should be replaced."
65
- target_section_id: section-3
66
- compared_section_ids: [section-3, section-7]
67
- compared_count: 2
68
- ```
69
-
70
- ## Verdict Meanings
71
-
72
- | field | value | Meaning |
73
- |---|---|---|
74
- | `support_verdict` | `supported` | Cited raw evidence covers the claim. |
75
- | `support_verdict` | `weak` | The evidence plausibly supports an ordinary summary, but review may ask for confirmation. |
76
- | `support_verdict` | `unsupported` | The claim adds facts or boundaries not present in cited raw evidence. |
77
- | `relation_verdict` | `new` | No listed candidate already covers the proposed knowledge. |
78
- | `relation_verdict` | `duplicate` | A listed candidate already covers the same claim. |
79
- | `relation_verdict` | `supersede` | A listed candidate is stale or wrong and should be replaced by the new claim. |
80
- | `relation_verdict` | `conflict` | The prepared claim and candidate disagree and need user resolution. |
81
- | `relation_verdict` | `merge_into` | The prepared claim should update or refine one listed candidate. |
82
-
83
- </reference>
84
-
85
- <procedures>
86
-
87
- ### Step 1 — Load Prepare Summary And Candidate Details
88
-
89
- Use the caller-provided compact prepare output. For every item with candidates,
90
- load its candidate detail view before judging relation. Do not infer missing
91
- candidates from memory or bypass the candidate detail view.
92
-
93
- ### Step 2 — Judge Support
94
-
95
- For each item, read the proposed content and cited evidence. Use
96
- Use raw/source_ref diagnostics only as evidence pointers; final support is your
97
- semantic verdict from the cited raw evidence.
98
-
99
- ### Step 3 — Judge Relation
100
-
101
- Compare the proposed claim against each listed candidate. Track every
102
- visible candidate Section id in `compared_section_ids`, and set
103
- `compared_count` to the total candidate count inspected across pages. If the
104
- candidate list is empty, emit `new` with an empty compared list and
105
- `compared_count: 0`.
106
-
107
- ### Step 4 — Emit Judge Decisions
108
-
109
- Return only the `compile.judge-decisions.v2` document. The caller passes it
110
- directly to `context reconcile review --decisions -`.
111
-
112
- </procedures>
@@ -1,233 +0,0 @@
1
- ---
2
- name: skill-context-query
3
- description: >
4
- Packaged skill invoked by `/context:query`; not a user slash command.
5
- Uses structure-first strategy: inspect orientation, resolve unknown Nodes with node_lookup,
6
- open known Nodes with node_view, then query Section details with section_search. Always
7
- cite Node slug and Section id.
8
- Activates when `/context:query` is invoked or when an agent needs to
9
- answer a question using local Context workspace knowledge with citations.
10
- tools:
11
- - Bash
12
- ---
13
-
14
- # skill-context-query — structure-first knowledge exploration with citations
15
-
16
- Answer user questions by exploring the local Context workspace structure first,
17
- then retrieving specific content within that structure. The CLI is the only source
18
- of local knowledge; never read workspace files directly.
19
-
20
- ## TL;DR — Non-negotiables
21
-
22
- - **Structure first**: When problem is vague, don't do semantic search; inspect `orientation`, use `node_lookup` only to find a slug, and use `node_view` to open a known Node.
23
- - **CLI only**: Use only `context query` output as evidence. Never Read/Glob/Grep/Write workspace files.
24
- - **Route by intent**: Classify problem intent (vague / clear Node / relationship / detail) and choose the right command; see Query Route table below.
25
- - **Orientation is navigation**: `context query --intent orientation` returns a budgeted `[Slug Map]` plus optional `[Summary]` hints for scope choice only; it is not direct answer evidence.
26
- - **Cite structure**: Every conclusion cites `[node/slug]` or `[node/section]`. If evidence does not support a claim, mark as gap.
27
- - **Expand raw when needed**: Query summaries help recall and scope choice; factual answers should rely on returned Section content or CLI-provided raw/source_ref expansion commands when a hit is marked raw-assisted or raw-expandable.
28
- - **Handle diagnostics**: If CLI returns `select`, `miss`, `broad`, `raw-only`, or `truncated`, follow the hint: show user structure to choose from, ask for narrower scope, or suggest workflow.
29
-
30
- <reference>
31
-
32
- ## Evidence Shape
33
-
34
- Primary evidence comes from the default `context query` output. Treat each
35
- returned row as a small evidence card.
36
-
37
- | Column / text | Use |
38
- |---|---|
39
- | `node` | Required citation handle for Section rows |
40
- | `section` | Required citation handle for Section rows |
41
- | `kind` | Section kind; use it to avoid overstating description/spec/warning content |
42
- | `content` | Evidence text for answer claims |
43
- | `refers_to_nodes` | Optional supplemental anchors when present |
44
- | `slug` | Candidate handle when the output is asking you to choose a Node |
45
- | `message` | Miss, broad-query, blocked, or narrowing guidance |
46
- | `raw_expand_command` / `raw_evidence_preview` | Pointer to expand raw/source_ref evidence when the hit needs factual confirmation |
47
- | `visibility` / `visible:` footer | Completeness signal for `node_view`; when `complete=true` / `visible: complete`, the shown Node Sections are exhaustive and there is no pagination |
48
-
49
- Supplemental context can come from:
50
-
51
- ```text
52
- context query --intent node_view --scope <slug>
53
- context query --intent impact_analysis --scope <slug>
54
- context query --intent node_view --refers-to <slug>
55
- context query --intent section_search --scope <slug> --query "<keywords>"
56
- ```
57
-
58
- ## Query Route Decision Table
59
-
60
- Choose the `context query` command based on problem intent. **Structure queries take priority.**
61
-
62
- | Problem intent | Primary command | When to use |
63
- |---|---|---|
64
- | **Vague question, no Node named** User asks "what is X" / "what are the X types" | `context query --intent orientation` or `context query --intent node_lookup --query "<keyword>"` | User unsure which Node to focus on; show structure first |
65
- | **Node explicitly named** User mentions a specific service/system | `context query --intent node_view --scope <slug>` | User wants to open a specific known Node |
66
- | **Relationship / impact** User asks what depends on X / impact of changing X | `context query --intent impact_analysis --scope <slug>` | User asks about how a Node connects to others |
67
- | **Detail within known scope** (only after Node chosen) User asks for specific feature/behavior within chosen Node | `context query --intent section_search --scope <slug> --query "<detail>"` | User wants specific detail within an already-chosen Node |
68
- | **Very specific fact** (fallback, rarely needed) User asks for exact implementation location | `context query "$ARGUMENTS"` | Semantic fallback when structure queries don't suffice |
69
- | **Archive / reconciliation** User asks "find duplicates" / "check coverage" | `context query --intent recall --profile <reconcile-dedupe\|reconcile-support\|reconcile-refresh> --query "..."` | Only when user explicitly asks for audit/reconciliation |
70
-
71
- ## Orientation output and budget
72
-
73
- `context query --intent orientation` is a navigation surface, not answer evidence.
74
-
75
- - JSON output keeps full Node `summary` fields when present.
76
- - Text output targets about 2000 tokens total. It prints `[Slug Map]` first, then `[Summary]`.
77
- - `[Slug Map]` uses finalized structure relationships and is for choosing the next `--scope <slug>`. If the workspace is too large, deeper layers are folded first.
78
- - `[Summary]` is truncated before the map. If output is still over budget, the command prints a continuation note. Drill down with scoped queries; there is no page-token pagination.
79
- - Use `context query --intent node_view --scope <slug>` for a Node overview, or `context query --intent section_search --scope <slug> --query "<keywords>"` for details inside that Node.
80
- - Use `context query --intent orientation --tag <tag>` or `context query --intent orientation --domain <slug>` to reduce the map before choosing a scope.
81
- - When `slug` and `title` are equivalent after normalization (for example `payment-api` and `Payment API`), text output shows only the slug.
82
-
83
- ## BM25 Search Strategy
84
-
85
- When using `section_search`, `recall`, or `node_lookup`, the CLI uses BM25 (keyword-based, not embedding-based) for matching. BM25 requires explicit keyword coverage, so queries must be precise:
86
-
87
- - **Mix bilingual keywords**: Include both Chinese and English terms when querying—e.g., `"<chinese-term> <english-equivalent>"`, `"<product-name> <alternate-name>"`
88
- - **Include synonyms & aliases**: BM25 is keyword-literal, so if your query doesn't match Section content exactly, try related terms
89
- - **Use specific terminology**: Add version numbers, API names, or domain-specific terms to narrow results
90
- - **Scope to reduce noise**: Use `--scope <slug>` to focus on a single Node; broad queries may be blocked or produce low-quality matches
91
-
92
- Query intents that use BM25:
93
- - `context query --intent node_lookup --query "<short-keyword>"` — find candidate Nodes from slug, title, summary, aliases, and tags when direct slug/title/alias matching does not resolve the query
94
- - `context query --intent section_search --scope <slug> --query "<keywords>"` — find Section details using keyword matching within a known Node
95
- - `context query --intent recall --profile <profile> --query "<keywords>"` — archive audit and reconciliation queries using keyword matching
96
-
97
- Do NOT use BM25 strategy for:
98
- - `context query --intent node_view --scope <slug>` or `--node <slug>` — uses structure, not keywords
99
- - `context query --intent orientation` — uses structure, not keywords
100
- - `context query --intent impact_analysis` — uses structure, not keywords
101
-
102
- ## Answer citation shape
103
-
104
- Use compact citations keyed to evidence type:
105
-
106
- ```text
107
- Node identity/title: <claim> [slug]
108
- Section claim: <claim> [node/section]
109
- Relationship/edge: X → Y [relationship_type]
110
- Multiple sources: <claim> [node/section, node/section]
111
- ```
112
-
113
- If multiple Sections support the same claim, cite the strongest one or two.
114
- Summarize what each cited Section supports; do not list citations without explanation.
115
-
116
- ## Gap shape
117
-
118
- Use a visible gap when the CLI evidence cannot support the requested fact:
119
-
120
- ```text
121
- Gap: local knowledge did not return evidence for <missing point>.
122
- ```
123
-
124
- If the likely cause is stale workflow state, suggest the relevant context
125
- workflow (`/context:align` or `/context:compile`) only when the CLI output or
126
- the user's wording indicates newly captured material is not yet knowledge.
127
-
128
- </reference>
129
-
130
- <procedures>
131
-
132
- ### Step 1 — Classify Problem Intent
133
-
134
- Determine what the user is trying to learn. Choose the appropriate command from the Query Route table above.
135
-
136
- **Classification:**
137
-
138
- - **Vague problem** — user unsure which Node to focus on
139
- - Indicators: asks "what is X", "what are the X types", "how to understand X", or question without Node anchor
140
- - Action: Run `context query --intent orientation` to show available Nodes and structure; then pick a Node or ask for narrower scope
141
- - **Note**: `node_lookup` resolves unknown Node names; `node_view` opens known Node structure; orientation always works regardless of workspace content
142
-
143
- - **Node explicitly named** — user mentions a specific service/system/concept
144
- - Indicators: user names a specific Node or system, "tell me about X", "show me X"
145
- - Action: Run `context query --intent node_view --scope <slug>` to explore that Node
146
-
147
- - **Relationship / impact** — user asks how Nodes relate or what breaks if X changes
148
- - Indicators: "what depends on X", "impact of X", "relationship between X and Y"
149
- - Action: Run `context query --intent impact_analysis --scope <slug>` to show dependencies/relationships
150
-
151
- - **Detail within known scope** — user already chose a Node, now asking for specific detail
152
- - Indicators: (comes after Node is selected) user asks "how does X handle [feature]", "what features does X support"
153
- - Action: Run `context query --intent section_search --scope <slug> --query "<detail-keywords>"` — use BM25 keywords for precise matching
154
-
155
- - **Archive / reconciliation** — user explicitly asks for dedup/audit/coverage
156
- - Indicators: "find duplicates", "check source coverage"
157
- - Action: Run `context query --intent recall --profile <reconcile-*> --query "..."`
158
- - ❌ Never use for ordinary questions
159
-
160
- ### Step 2 — Execute Query And Interpret Response
161
-
162
- Run the command from Step 1. Read the CLI output carefully.
163
-
164
- **Route based on response:**
165
-
166
- - ❌ **Command fails** → Report error and stop
167
- - ❌ **`miss`** (no knowledge found) → Report no local knowledge and stop
168
- - ⚠️ **`select`** (multiple candidate Nodes) → Show candidates to user; ask which Node to focus on
169
- - Then: loop back to Step 1 with chosen Node scope
170
- - ⚠️ **`broad` / `blocked` recall** → Ask user for narrower scope (specific Node, term, version)
171
- - Then: loop back to Step 1
172
- - ⚠️ **`raw-only` / `uncompiled`** → Say "raw source found but not yet in compiled knowledge"
173
- - Only suggest `/context:align` + `/context:compile` if user wants it compiled
174
- - ⚠️ **`truncated`** (entries cut off) → Mark answer as "non-exhaustive"
175
- - Proceed to Step 3; ask for narrowing only if user needs complete inventory
176
- - ✓ **`node_view` says `visible: complete` / `visibility.complete=true`** → Do not run `section_search` merely to check completeness; use `section_search` only when you need keyword narrowing or ranking inside the Node
177
- - ✓ **Entries returned** → Proceed to Step 3
178
-
179
- ### Step 3 — Compose Answer From Returned Structure
180
-
181
- Use only the returned Node/Section structure and content. Do not synthesize beyond what was returned.
182
-
183
- **Response structure:**
184
-
185
- 1. **Start with core answer** — what the structure directly shows
186
- 2. **Cite every claim** — `[node/slug]` for Node identity, `[node/section]` for facts
187
- 3. **Include "Used nodes:" line** — if question named specific Nodes: "Using nodes: `<slug>`, `<slug>`"
188
- 4. **Mark gaps** — if user asked for something not in returned structure: "Gap: no evidence for X"
189
- 5. **Note truncation** — if CLI said `truncated`: "Non-exhaustive result — further narrowing available"
190
-
191
- **Example for structure-first query:**
192
- ```
193
- User asks: "What systems handle X in our architecture?"
194
-
195
- Better query (structure-first):
196
- context query --intent orientation # Shows all available Nodes
197
-
198
- Returns several candidate Nodes matching the question.
199
-
200
- Response:
201
- "Systems that handle X:
202
- - **<Node Title 1>** [<slug-1>] — responsibility and scope
203
- - **<Node Title 2>** [<slug-2>] — responsibility and scope
204
-
205
- To dive deeper into any system, ask me for more details or let me know which Node you want to explore."
206
- ```
207
-
208
- **Why show structure first?** Even when you know keywords, structure queries reveal the full landscape.
209
- Agents should explore Nodes first, then use section_search for details within a chosen Node.
210
-
211
- ### Step 4 — Explore Further When Requested
212
-
213
- Once Node scope is clear, user may ask for deeper exploration.
214
-
215
- **Supplemental query triggers:**
216
-
217
- - User asks about Node's relationships/dependencies → `context query --intent impact_analysis --scope <slug>`
218
- - User asks for full Node content after partial answer → `context query --intent node_view --scope <slug>`
219
- - User asks specific detail within chosen Node → `context query --intent section_search --scope <slug> --query "<keywords>"`
220
- - **Use BM25 strategy**: mix Chinese and English keywords for better matching (e.g., mix synonym or translated forms of the search term)
221
- - User names another Node in `refers_to_nodes` and asks about its relationship → `context query --intent node_view --refers-to <slug>`
222
-
223
- **BM25 tips for supplemental queries:**
224
- - When searching for a detail, include both native and translated forms of terms
225
- - If first query is too broad, add more specific keywords or domain terminology instead of generic terms
226
- - Scope helps narrow BM25 results: `--scope <slug> --query "<specific-term> <synonym>"` is more precise than an unscoped broad query
227
-
228
- **Safety:**
229
- - ❌ Do NOT auto-fetch all `refers_to_nodes`; only query if user asks
230
- - ❌ Do NOT read workspace files to discover new Nodes
231
- - ✓ Only supplement with slugs already in returned structure or user's explicit question
232
-
233
- </procedures>