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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/README.md +115 -123
  2. package/babel.cjs +257 -0
  3. package/cli.js +51018 -96457
  4. package/docs/quickstart.md +85 -0
  5. package/package.json +3 -1
  6. package/plugin/.claude-plugin/plugin.json.template +1 -1
  7. package/plugin/.codex-plugin/plugin.json.template +5 -5
  8. package/plugin/.cursor-plugin/plugin.json.template +1 -1
  9. package/plugin/README.md +105 -85
  10. package/plugin/README_CN.md +92 -84
  11. package/plugin/commands/continue.md +34 -0
  12. package/plugin/commands/init.md +13 -130
  13. package/plugin/skills/skill-continue-workflow/SKILL.md +172 -0
  14. package/plugin/skills/skill-init-workspace/SKILL.md +74 -0
  15. package/plugin/skills/skill-package-output/SKILL.md +167 -0
  16. package/plugin/skills/skill-prose-align/SKILL.md +296 -0
  17. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  18. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  19. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  20. package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  21. package/plugin/skills/skill-prose-compile/SKILL.md +265 -0
  22. package/plugin/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  23. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  24. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  25. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  26. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  27. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  28. package/plugin/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  29. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  30. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  31. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  32. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  33. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  34. package/plugin/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  35. package/plugin/skills/skill-review-gate/SKILL.md +98 -0
  36. package/plugin/skills/skill-source-scope/SKILL.md +402 -0
  37. package/plugin/skills/skill-source-scope/references/capture-source.md +171 -0
  38. package/plugins/.agents/plugins/marketplace.json +20 -0
  39. package/plugins/.claude-plugin/marketplace.json +13 -0
  40. package/plugins/.cursor-plugin/marketplace.json +17 -0
  41. package/plugins/README.md +150 -0
  42. package/plugins/README_CN.md +136 -0
  43. package/plugins/VERSION +1 -0
  44. package/plugins/assets/icon.svg +3 -0
  45. package/plugins/assets/logo.svg +3 -0
  46. package/plugins/assets/workflow-en.png +0 -0
  47. package/plugins/assets/workflow.png +0 -0
  48. package/plugins/claude/.claude-plugin/plugin.json +16 -0
  49. package/plugins/claude/.generated +1 -0
  50. package/plugins/claude/CLAUDE.md +5 -0
  51. package/plugins/claude/README.md +5 -0
  52. package/plugins/claude/commands/continue.md +34 -0
  53. package/plugins/claude/commands/init.md +21 -0
  54. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +172 -0
  55. package/plugins/claude/skills/skill-init-workspace/SKILL.md +74 -0
  56. package/plugins/claude/skills/skill-package-output/SKILL.md +167 -0
  57. package/plugins/claude/skills/skill-prose-align/SKILL.md +296 -0
  58. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  59. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  60. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  61. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  62. package/plugins/claude/skills/skill-prose-compile/SKILL.md +265 -0
  63. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  64. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  65. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  66. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  67. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  68. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  69. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  70. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  71. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  72. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  73. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  74. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  75. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  76. package/plugins/claude/skills/skill-review-gate/SKILL.md +98 -0
  77. package/plugins/claude/skills/skill-source-scope/SKILL.md +402 -0
  78. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +171 -0
  79. package/plugins/codex/.codex-plugin/plugin.json +38 -0
  80. package/plugins/codex/.generated +1 -0
  81. package/plugins/codex/AGENTS.md +5 -0
  82. package/plugins/codex/README.md +5 -0
  83. package/plugins/codex/assets/icon.svg +3 -0
  84. package/plugins/codex/assets/logo.svg +3 -0
  85. package/plugins/codex/assets/workflow-en.png +0 -0
  86. package/plugins/codex/assets/workflow.png +0 -0
  87. package/plugins/codex/skills/continue/SKILL.md +47 -0
  88. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  89. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +74 -0
  90. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +167 -0
  91. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  92. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  93. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  94. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  95. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +296 -0
  96. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  97. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  98. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  99. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  100. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  101. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  102. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  103. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  104. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  105. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  106. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  107. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  108. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  109. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +265 -0
  110. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +98 -0
  111. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  112. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +402 -0
  113. package/plugins/codex/skills/init/SKILL.md +34 -0
  114. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +172 -0
  115. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +74 -0
  116. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +167 -0
  117. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  118. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  119. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  120. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  121. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +296 -0
  122. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  123. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  124. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  125. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  126. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  127. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  128. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  129. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  130. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  131. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  132. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  133. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  134. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  135. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +265 -0
  136. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +98 -0
  137. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  138. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +402 -0
  139. package/plugins/cursor/.cursor-plugin/plugin.json +29 -0
  140. package/plugins/cursor/.generated +1 -0
  141. package/plugins/cursor/AGENTS.md +5 -0
  142. package/plugins/cursor/README.md +13 -0
  143. package/plugins/cursor/assets/icon.svg +3 -0
  144. package/plugins/cursor/assets/logo.svg +3 -0
  145. package/plugins/cursor/assets/workflow-en.png +0 -0
  146. package/plugins/cursor/assets/workflow.png +0 -0
  147. package/plugins/cursor/commands/context-continue.md +38 -0
  148. package/plugins/cursor/commands/context-init.md +25 -0
  149. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +172 -0
  150. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +74 -0
  151. package/plugins/cursor/skills/skill-package-output/SKILL.md +167 -0
  152. package/plugins/cursor/skills/skill-prose-align/SKILL.md +296 -0
  153. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  154. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  155. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  156. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  157. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +265 -0
  158. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  159. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  160. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  161. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  162. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  163. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  164. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  165. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  166. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  167. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  168. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  169. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  170. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  171. package/plugins/cursor/skills/skill-review-gate/SKILL.md +98 -0
  172. package/plugins/cursor/skills/skill-source-scope/SKILL.md +402 -0
  173. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +171 -0
  174. package/plugins/skills/context-continue/SKILL.md +47 -0
  175. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +172 -0
  176. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +74 -0
  177. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +167 -0
  178. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  179. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  180. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  181. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  182. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +296 -0
  183. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  184. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  185. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  186. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  187. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  188. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  189. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  190. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  191. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  192. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  193. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  194. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  195. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  196. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +265 -0
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +98 -0
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +402 -0
  200. package/plugins/skills/context-init/SKILL.md +34 -0
  201. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +172 -0
  202. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +74 -0
  203. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +167 -0
  204. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +91 -0
  205. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +30 -0
  206. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +235 -0
  207. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +243 -0
  208. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +296 -0
  209. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +132 -0
  210. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +52 -0
  211. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +48 -0
  212. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +85 -0
  213. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +73 -0
  214. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +413 -0
  215. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +123 -0
  216. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +81 -0
  217. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +55 -0
  218. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +93 -0
  219. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +79 -0
  220. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +111 -0
  221. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +194 -0
  222. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +265 -0
  223. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +98 -0
  224. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +171 -0
  225. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +402 -0
  226. package/scripts/build-plugin.ts +70 -126
  227. package/plugin/commands/align.md +0 -71
  228. package/plugin/commands/capture.md +0 -113
  229. package/plugin/commands/compile.md +0 -103
  230. package/plugin/commands/context.md +0 -35
  231. package/plugin/commands/drop.md +0 -38
  232. package/plugin/commands/extract.md +0 -18
  233. package/plugin/commands/purge.md +0 -22
  234. package/plugin/commands/query.md +0 -22
  235. package/plugin/commands/status.md +0 -25
  236. package/plugin/skills/skill-align-workflow/SKILL.md +0 -110
  237. package/plugin/skills/skill-align-workflow/references/candidate-resolution.md +0 -60
  238. package/plugin/skills/skill-align-workflow/references/density-profile.md +0 -16
  239. package/plugin/skills/skill-align-workflow/references/gates.md +0 -162
  240. package/plugin/skills/skill-compile-close/SKILL.md +0 -127
  241. package/plugin/skills/skill-compile-draft/SKILL.md +0 -175
  242. package/plugin/skills/skill-compile-draft/references/action-domain-gates.md +0 -34
  243. package/plugin/skills/skill-compile-draft/references/notes.md +0 -34
  244. package/plugin/skills/skill-compile-draft/references/refresh-and-update.md +0 -71
  245. package/plugin/skills/skill-compile-draft/references/structural-challenges.md +0 -76
  246. package/plugin/skills/skill-compile-judge/SKILL.md +0 -112
  247. package/plugin/skills/skill-context-query/SKILL.md +0 -233
  248. package/plugin/skills/skill-drop/SKILL.md +0 -189
  249. package/plugin/skills/skill-semantic-reconcile/SKILL.md +0 -136
  250. package/plugin/skills/skill-semantic-reconcile/references/leakage-and-ownership.md +0 -31
  251. package/plugin/skills/skill-semantic-reconcile/references/mode-semantics.md +0 -41
  252. package/plugin/skills/skill-semantic-reconcile/references/scope-review-and-omit.md +0 -60
  253. package/plugin/skills/skill-semantic-reconcile/references/temporal-and-evidence.md +0 -58
  254. package/plugin/skills/skill-semantic-reconcile/references/user-confirmation.md +0 -71
  255. package/scripts/build-aspect-runtime.ts +0 -45
  256. package/templates/aspect-runtime/aspectRunnerSdk.js +0 -776
  257. package/templates/aspects/README.md +0 -517
  258. package/templates/aspects/code/README.md +0 -48
  259. package/templates/aspects/code/aspect.yaml +0 -21
  260. package/templates/aspects/design-system/README.md +0 -26
  261. package/templates/aspects/graphql/README.md +0 -24
  262. package/templates/aspects/openapi/README.md +0 -24
@@ -0,0 +1,235 @@
1
+ # Node Classification Gates
2
+
3
+ Use these gates before every structure draft and before authoring the align
4
+ payload described by the current schema view.
5
+ Align owns Node type, tag, graph, planned Section, and ownership classification. It does **not** write Section prose.
6
+
7
+ Current schema mapping:
8
+
9
+ - Treat the action checklist, domain checklist, and inference tables as private
10
+ working notes unless the current schema view explicitly exposes matching
11
+ fields.
12
+ - In `context.structure.v1`, persist the outcome through `node_type`, `tags`,
13
+ `summary`, `ownership`, `sections[].source_refs`, `edges[]`, and
14
+ `unresolved[]`.
15
+ - Do not add unknown gate fields to the payload just because this procedure uses
16
+ them for reasoning.
17
+
18
+ ## Node Type Order
19
+
20
+ Answer in this order and stop at the first match:
21
+
22
+ 1. **Action?** A large executable event / process with both:
23
+ - scale: can support `planned_sections` with at least two distinct Section kinds, or contains at least one child Action;
24
+ - process evidence: explicit steps, phases, trigger -> handling -> result, role collaboration, or repeatable plan. Parallel lists such as "three API modes" are not process evidence.
25
+ Single-section exceptions are allowed only when the collection route and
26
+ source evidence give the record its own lifecycle or tracking identity:
27
+ product `user-story`, test `scenario`, or incident `action-item` /
28
+ incident record. These still need source-backed acceptance, lifecycle,
29
+ scenario, or tracking evidence; otherwise keep the material as a Section
30
+ under the owning Node.
31
+ 2. **Entity?** A concrete independent subject with retrieval value: deployable code, product/application/system, library/module/CLI/symbol, or an atomic term/pattern.
32
+ 3. **Domain?** A container/scope that groups at least one child Node.
33
+ 4. Otherwise do not create a Node; leave the material for compile as a Section under the owning Node.
34
+
35
+ Good examples:
36
+
37
+ | Type | Examples |
38
+ |---|---|
39
+ | `domain` | "X business domain", "Y technical area", "Z research topic" |
40
+ | `entity` concrete | `@acme/api-server`, `@acme/ui-kit` `Button`, "X sub-application" |
41
+ | `entity` term | "X identifier", "Y business metric", idempotency |
42
+ | `action` | "user submits X request end-to-end flow", "operator executes Y change flow", "team Z release flow" |
43
+
44
+ ## Title and Source Heading Rules
45
+
46
+ Classify the Node by the evidence referent, not by the source file title, heading, or local section title. A source title is ordinary evidence just like body prose. It has no automatic right to become `node.title`, `aliases[]`, or `slug`.
47
+
48
+ After choosing `node_type`, choose the title to fit that type:
49
+
50
+ | Final type | Title shape |
51
+ |---|---|
52
+ | `entity` concrete | The concrete product, service, library, module, CLI, symbol, application, or system name. |
53
+ | `entity` term | The atomic concept or pattern name, without extra scope/process suffixes. |
54
+ | `domain` | The grouping scope that owns child Nodes. |
55
+ | `action` | The executable process / runbook / flow name that passed the Action Gate. |
56
+
57
+ Scope/process words in a source title are warning signals when proposed as an Entity title, not hard classification rules. Re-check the type/title when a proposed Entity title contains words such as "方案", "架构", "体系", "演练", "流程", "策略", "能力", "机制", "framework", "architecture", "system", "strategy", "process", or "drill". Keep the wording only when evidence shows it is the formal name of a concrete object or an atomic term.
58
+
59
+ Do not promote broad architecture/system/方案 content to `domain` just because it sounds like a scope. When the source has writable Sections but no resolvable current/existing child Nodes, use an Entity such as `[system]` or `[application]` and put the architecture facts in Sections. Use `domain` only when it groups child Nodes through supported `edges[]`.
60
+
61
+ Relation-only sources should not force title copying or dangling graph edges. Decide placeholder handling in this order:
62
+
63
+ 1. If resolved current/existing child Nodes make the page a real grouping scope, keep the relation evidence as supported `edges[]` only when the Domain also has at least one source-backed planned Section.
64
+ 2. If an explicit user-facing retrieval need or graph need makes the source/page identity valuable, and the title names an atomic concept or concrete object, keep that identity in `unresolved[]` until it has source-backed section evidence, a valid generated `parent_index` view with source-backed `contains` edges to child views, or a compile-time `skip` decision. Do not submit root-level `planned_sections: []` or ordinary source-bound `sections: []`.
65
+ 3. Otherwise, skip navigation-only / placeholder-only material; keep a short
66
+ `unresolved[]` note only when the deferred relation remains useful.
67
+
68
+ Do not create a hidden domain-gate object. A kept placeholder needs support:
69
+ source refs, approved graph support, or explicit user-confirmed retrieval value.
70
+ For Domain placeholders, write only resolved current/existing children as typed
71
+ `edges[]`; if all children are unresolved/deferred relation clues, keep those
72
+ target hints in `unresolved[]`. If the source names only an atomic concept and
73
+ that term is useful on its own, prefer a concise term Entity title without
74
+ scope/process suffixes.
75
+
76
+ For no-write placeholder summaries, describe only the preserved page identity and unresolved navigation clues. Do not say the Node "provides navigation/links/relations to X" unless those targets are resolved graph children or rendered links; say the source contains deferred navigation clues instead.
77
+
78
+ ## Entity Tag Rules
79
+
80
+ Use `tags` to state what the Entity is. Legal combinations:
81
+
82
+ | Case | Tags |
83
+ |---|---|
84
+ | Runtime/code object | one A tag: `app`, `service`, `lib`, `cli`, `module`, or `symbol` |
85
+ | Product-analysis object | one B tag: `application` or `system` |
86
+ | Code + product object | one A tag plus one B tag |
87
+ | Pure term / pattern | only `term` |
88
+
89
+ `term` is mutually exclusive with A/B tags. React is `[lib]`, not `[lib, term]`; if a separate term entry is useful, create another Entity tagged `[term]` and let the structure plan express the relation as a typed edge or unresolved relation with `source_refs[]`.
90
+
91
+ ## Action Gate
92
+
93
+ Use `node_type: action` only after the Node Type Order says action. Fill the
94
+ action reasoning checklist in your working notes; persist only fields accepted by
95
+ the current structure schema.
96
+
97
+ The action probe uses five booleans as a reasoning checklist, but the semantic
98
+ bar is:
99
+
100
+ | Field | Meaning | Evidence rule |
101
+ |---|---|---|
102
+ | `has_steps_or_phases` | Process evidence exists: steps, phases, trigger -> handling -> result, role collaboration, or repeatable plan. | Hard requirement; support it from span evidence. |
103
+ | `has_actor_or_role` | A user, system, operator, service, or role performs the work. | May be inferred; record the source. |
104
+ | `has_outcome_or_goal` | The process has a target result, acceptance condition, or operational goal. | May be inferred; record the source. |
105
+ | `is_repeatable_or_planned` | The work is repeatable, scheduled, policy-like, or intentionally planned. | May be inferred; record the source. |
106
+ | `queries_answerable_with_refs` | The Node can answer how/when/who/what-to-do questions from cited spans. | May be inferred; record the source. |
107
+
108
+ Do not emit an Action for a single sentence, a one-off conclusion, a short operation, or a parallel enumeration. Those become Sections under the owning Entity or Domain. The only single-Section Action exceptions are source-backed `user-story`, `scenario`, and incident/action-item records with lifecycle, acceptance, or tracking identity.
109
+
110
+ Action anti-examples:
111
+
112
+ | Candidate | Correct routing |
113
+ |---|---|
114
+ | "migrate to X tool" as one conclusion | `decision` Section under the owning Entity |
115
+ | "component X usage" as one sentence | `description` + maybe `example` under X |
116
+ | "submit -> validate -> generate" as one unexpanded sentence | `spec` Section under X/Y |
117
+ | "three API call modes" | `comparison`, `spec`, or `description` Section; not Action |
118
+
119
+ ## Fake Entity Gate
120
+
121
+ A relationship-style title is only suspicious by itself. Downgrade or change type when at least **two** signals are true:
122
+
123
+ 1. Title contains relationship language such as "X impact on Y", "Y under X", "Y side of X", "X migration", or "X collection".
124
+ 2. No legal Entity tag fits.
125
+ 3. The Node does not stand alone away from its upstream Node.
126
+
127
+ Repairs:
128
+
129
+ | Pattern | Repair |
130
+ |---|---|
131
+ | "X impact on Y" | Section under X plus a typed edge or unresolved relation to Y when the evidence supports it |
132
+ | "Y under X condition" | Section under Y; X is a condition in the Section body |
133
+ | "X subsystem migration" | Action only if it clears the Action Gate; otherwise `decision` Section under X |
134
+ | "X error collection" / "X FAQ collection" | `faq` / `incident` Sections under X |
135
+
136
+ ## Domain Gate
137
+
138
+ Use `node_type: domain` only for a scope that groups child Nodes. Keep this
139
+ domain reasoning checklist in working notes and persist supported relations through current
140
+ `edges[]` or `unresolved[]`:
141
+
142
+ | Field | Meaning |
143
+ |---|---|
144
+ | `scope_refs[]` | Source refs that describe the scope boundary or grouping. |
145
+ | `child_refs[]` | Working-note candidate ids, local refs, or final slugs for children in the scope; persist valid ones as `edges[]`. |
146
+ | `grouping_reason` | Why these children belong together under this domain. |
147
+
148
+ If a domain has no resolvable child refs, no clear grouping reason, or only one same-file child without a broader scope, do not emit a Domain. For navigation-only / placeholder-only sources with only deferred children, skip the Node after ruling out standalone retrieval or graph value for an atomic-term or concrete Entity; keep only useful unresolved relation notes. Emit an Entity only when evidence names an atomic term or concrete object and choose its Entity tag yourself. The CLI rejects invalid Domain gates; it does not auto-downgrade a Domain or choose fallback tags.
149
+
150
+ Scope-name titles such as "X 业务域", "Y 领域", "business domain", or "technical area" are a warning sign when proposed as Entity. Keep them as Entity only when the subject is an atomic term or concrete object; otherwise use Domain with supported child edges or unresolved relation hints.
151
+
152
+ ## Edge Gate
153
+
154
+ Use a typed edge only when all four checks pass:
155
+
156
+ 1. Both `from` and `to` nodes exist in the current structure or approved
157
+ knowledge.
158
+ 2. The relation type is in the current closed set (`is_a`, `contains`,
159
+ `depends_on`, `corresponds_to`, `causes`, `triggers`, `prerequisite`,
160
+ `applies_to`, `verified_by`, `supersedes`).
161
+ 3. `source_refs[]` cite evidence for the relation itself, not just for one
162
+ endpoint.
163
+ 4. The relation is stronger than a vague "related" hint.
164
+
165
+ If any check fails, write an `unresolved[]` item instead of an edge.
166
+
167
+ If the source sentence states the relation with uncertainty, keep the edge only
168
+ when the uncertainty is source-authored and preserved through
169
+ `confidence: possible` or `confidence: hypothesis`. Do not use `confidence` for
170
+ Agent uncertainty. If you are uncertain whether the evidence supports the
171
+ relation, write `unresolved[]` instead.
172
+
173
+ ## Inference Sources
174
+
175
+ Inference sources are working notes for the action reasoning checklist; do not
176
+ persist this object unless the current schema explicitly exposes it:
177
+
178
+ ```yaml
179
+ inference_sources:
180
+ actor:
181
+ source_type: explicit-span
182
+ source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
183
+ rationale: "The span names the operator role."
184
+ outcome_or_goal:
185
+ source_type: inferred-from-span
186
+ source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
187
+ rationale: "The span describes recovery as the expected result."
188
+ repeatability_or_plan:
189
+ source_type: heading-and-span
190
+ source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
191
+ rationale: "The runbook heading and ordered list indicate planned reuse."
192
+ answerability:
193
+ source_type: explicit-span
194
+ source_refs: ["file:docs/runbook.md#span:steps L10-18@<span-hash>"]
195
+ rationale: "The steps answer how the operation is performed."
196
+ ```
197
+
198
+ Allowed `source_type` values:
199
+
200
+ | Value | Use when |
201
+ |---|---|
202
+ | `explicit-span` | The evidence span directly states the signal. |
203
+ | `heading-and-span` | The heading plus span text together support the signal. |
204
+ | `ref-node` | An existing or same-decision Node reference supplies the signal. Include `ref_nodes`. |
205
+ | `inferred-from-span` | The signal is inferred from span content. Keep the rationale short and concrete. |
206
+
207
+ Each source must include `rationale` when inferred and at least one of `source_refs[]` or `ref_nodes[]`.
208
+
209
+ ## Final Reflection
210
+
211
+ - Entity cannot pick a legal tag, or depends on its upstream title to make sense -> write it as a Section under the upstream Node or change type before submit.
212
+ - Action only supports one Section -> write it as a Section instead of an Action, unless it is a source-backed `user-story`, `scenario`, or incident/action-item record with lifecycle, acceptance, or tracking identity. The discriminator is scale or record identity, not the presence of "step" words.
213
+ - Action "steps" are parallel options/configs -> route to Entity `comparison` / `spec` / `description`.
214
+ - Domain has no children -> delete it or merge it into a larger Domain.
215
+
216
+ ## Current CLI Quality Diagnostics
217
+
218
+ Current `context.structure.v1` validation preserves the old Node quality
219
+ checks as deterministic diagnostics:
220
+
221
+ | Diagnostic | Meaning | Required response |
222
+ |---|---|---|
223
+ | `schema.section_kind_invalid` | A planned Section uses a kind outside the current prose kind set. | Replace it with a kind from the schema view; do not invent local kind names. |
224
+ | `schema.section_kind_mount_invalid` | A planned Section kind cannot be mounted on the chosen `node_type`. | Choose a kind allowed by the mount matrix, or reclassify the Node before confirming structure. |
225
+ | `tags.term_conflict` | An Entity uses `term` together with concrete runtime/product tags such as `lib`, `service`, `application`, or `system`. | Split the term from the concrete object, or remove the conflicting tag before staging. |
226
+ | `node.description_dominates` | A non-Action Node has at least half of its planned Sections as `description`. | Re-run kind precision. Keep it only when source evidence is genuinely narrative; otherwise split into `example`, `spec`, `comparison`, `faq`, `incident`, `decision`, `warning`, or `principle`. |
227
+ | `node.thin_concrete_entity` | A concrete Entity has one Section and no child Nodes. | Keep it only when it has stable standalone retrieval value; otherwise merge it into the owning Node. |
228
+ | `node.term_expanded_beyond_definition` | A `term` Entity has grown past a compact definition or owns children. | Move rules, procedures, designs, and examples to the owning Node; keep the term entry narrow. |
229
+ | `node.action_too_thin` | An Action has fewer than two distinct planned Section kinds and no child Action. | Downgrade it to a Section under the owning Node unless evidence supports a repeatable process or a source-backed `user-story`, `scenario`, or incident/action-item record with lifecycle, acceptance, or tracking identity. |
230
+ | `node.domain_without_children` | A Domain has no source-backed `contains` child edge. | Add supported children, keep an explicitly confirmed no-write placeholder, or reclassify the Node. |
231
+ | `edge.confidence_invalid` | An edge declares a confidence value outside the current schema. | Use only `possible` or `hypothesis`, or omit the field for source-certain relations. |
232
+ | `edge.confidence_required` | The cited relation sentence contains source-level uncertainty such as "可能", "疑似", "may", or "might". | Preserve source-authored uncertainty with `confidence: possible` / `confidence: hypothesis`, or move the relation to `unresolved[]`. |
233
+
234
+ Warnings are not automatic blockers, but they are not suggestions to ignore.
235
+ Resolve them or include the user-confirmed rationale when confirming structure.
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: structure-planning
3
+ description: "Internal procedure for the current align gate. Reads CLI-guided align evidence, applies semantic Node classification gates, and emits context.structure.v1 payloads for CLI validation/stage."
4
+ ---
5
+
6
+ # Structure Planning Procedure
7
+
8
+ ## TL;DR
9
+
10
+ Run `context run align:<type>:<source>:<collection> --view read-plan --format json`, follow the top-level `next_action.command` to read the CLI-selected evidence path, produce a `context.structure.v1` structure payload, and continue following top-level `next_action`. The CLI owns route, validation, repair commands, and stage guards; this skill owns only semantic classification and source-bound structure judgment.
11
+
12
+ <reference>
13
+
14
+ ## Canonical Data
15
+
16
+ - The current phase view result is authoritative. Branch on `next_action.kind`,
17
+ execute `next_action.command`, and treat listed views as detail reads rather
18
+ than a checklist.
19
+ - `allowed_actions[]` describes capabilities on the current view result; it is
20
+ not a menu of alternate write paths and does not override `next_action`.
21
+ - `agent_hints[]`, when present, are diagnostics. Do not prefer them over
22
+ top-level `next_action`.
23
+ - Schema names and enum values come from
24
+ `context run align:<type>:<source>:<collection> --view schema --format json`. Use
25
+ that schema as the authoring contract for `context.structure.v1`.
26
+ - Existing approved knowledge and `knowledge/structure.yaml` are the lookup
27
+ registry exposed through current CLI/status/query views. Do not read
28
+ `knowledge/**` or create a separate registry file.
29
+ - Code projection Nodes are reusable knowledge handles. When document evidence belongs on a code symbol, reuse the code slug instead of creating a parallel document Node.
30
+ - Validation diagnostics are the mechanical structure ownership source of
31
+ truth. Non-content spans such as navigation references, placeholders, front
32
+ matter, marker quotes, embed tags, and embedded assets should not become
33
+ reader-facing Sections unless the evidence itself is the cited knowledge.
34
+ - When relation hints are present, inspect them before finalizing graph
35
+ structure. Use existing/current matches for typed `edges[]`; keep unresolved
36
+ target ref/title hints deferred in `unresolved[]` and do not write dangling
37
+ parent, child, or edge refs. Ordinary source-bound views require at least one
38
+ source-backed planned section. The only empty-section exception is a generated
39
+ parent index view: it must use `generated: parent_index`, `sections: []`, and
40
+ source-backed `contains` edges to child views. For navigation-only /
41
+ placeholder-only sources, keep useful source/page identities as `unresolved[]`
42
+ notes until there is source-backed section evidence, a supported edge target,
43
+ a valid parent-index container, or a later compile `skip` decision. If a
44
+ placeholder/relation source is skipped entirely, leave its relation clues in
45
+ `unresolved[]` only when they still matter; otherwise omit them.
46
+ - `views[]` and diagnostics distinguish citable evidence from supporting context. Do not promote supporting/context-only material into cited Sections unless a later ownership correction makes it citation-eligible.
47
+ - Keep cache-friendly prompt order: fixed protocol/schema first, existing knowledge lookup second, source evidence views third, current semantic payload last. Preserve CLI JSON order and do not add timestamps, random ids, scratch paths, or host paths to generated payloads.
48
+ - Structure digests and snapshot hashes are stale guards. Follow returned
49
+ `next_action.command` and do not invent digest values.
50
+ - Node type, tag, fake-Entity, `domain`, and `action` gates are in `structure-planning/references/gates.md`.
51
+ - Coarse reading density and neutral signal rules are in `structure-planning/references/density-profile.md`.
52
+ - Candidate anomaly handling, stable references, duplicate handling, and
53
+ conflict handling are in
54
+ `structure-planning/references/candidate-resolution.md`.
55
+
56
+ </reference>
57
+
58
+ <procedures>
59
+
60
+ Use this only inside the current align gate.
61
+
62
+ ### Step 1 — Start From The Envelope
63
+
64
+ Run `context run align:<type>:<source>:<collection> --view read-plan --format json`.
65
+ Confirm the response is the current prose align view result, then identify
66
+ `next_action`, available views, source metadata, and diagnostics.
67
+
68
+ If the host truncates a view result but the preview includes top-level
69
+ `next_action.command`, run that command. If `next_action` is not visible, rerun
70
+ the current view command; do not recover host tool-result files.
71
+
72
+ If no current phase view result is present, stop and surface the CLI output; do
73
+ not reconstruct an align route from prior prompt memory.
74
+
75
+ ### Step 2 — Follow The Evidence Read Path
76
+
77
+ Run the returned `next_action.command`. For structural align work this is
78
+ normally `read-plan`; after that, follow the evidence view's `next_action.command`
79
+ or `next_command`.
80
+
81
+ `read-plan` is the navigation surface. It chooses whether the next evidence read
82
+ is `source-index`, `span-detail`, `span-text`, or another current evidence view.
83
+ Read those views and then author the requested
84
+ `context.structure.v1` payload yourself. Never pipe evidence text into validate.
85
+
86
+ If an evidence view is truncated, `page.has_more: true`, or the CLI returns a
87
+ `next_command`, run that command before authoring.
88
+
89
+ Read evidence through semantic CLI views, not shell parsing. Follow `page.next_command` for pagination. If the command contains `--read-cursor`, treat it as opaque continuation state and run it exactly; do not replace it with hand-written `--source`, `--heading`, `--window`, or `--range` selectors. Use `--source`, `--heading`, `--window`, `--range`, and `--token-budget` as view filters only. `--unwrap` removes workflow metadata; it does not expand a compact view into full detail.
90
+
91
+ If an evidence view returns `page.has_more`, `truncated: true`, or a
92
+ view-specific incomplete-read diagnostic, treat that response as a partial
93
+ read. Do not decide source-wide ownership or dense planned Sections from
94
+ headings alone; continue the current detail view only when `page.next_command`
95
+ is explicitly needed, otherwise return to the CLI-designated navigation view.
96
+
97
+ ### Step 3 — Reuse Existing Knowledge
98
+
99
+ Query existing knowledge for reusable names before proposing new term/service/system/action Nodes. Exact title/slug/alias hits should usually become references to the existing Node, not duplicate candidates.
100
+
101
+ When a code projection Node already represents the object, reuse its slug for prose evidence and plan only prose-owned Sections for the current source evidence.
102
+
103
+ ### Step 4 — Route Collection, Then Classify Semantic Structure
104
+
105
+ Before choosing Node type or Section kind, route each evidence unit to its
106
+ internal collection. The phase `<collection>` is only the entry profile for the
107
+ current run; it is not a cap on what this structure may contain. A mixed source
108
+ can produce multiple `views[]` in one confirmed structure when source evidence
109
+ supports them.
110
+
111
+ Use collection routing first:
112
+
113
+ - product intent, user story, requirement, roadmap, or product scenario ->
114
+ `product`;
115
+ - architecture, service/module/system design, runtime dependency, code-adjacent
116
+ prose -> `architecture`; if an existing code projection already owns the
117
+ object, reuse its NodeRef/ViewRef instead of creating a `codegraph` prose
118
+ view;
119
+ - SOP, runbook, operation drill, workflow, or how-to procedure -> `sop`;
120
+ - FAQ, question/answer, support notes -> `faq` only when the evidence is an
121
+ independent FAQ page or cross-cutting support knowledge; a single Q&A or
122
+ scattered support note stays as a `faq` Section under the owning view;
123
+ - standards, policy, rules, conventions, reusable constraints -> `standards`;
124
+ - decision record, trade-off, migration conclusion -> `decision` only when it
125
+ is an independent decision record with owner/date/lifecycle or cross-cutting
126
+ decision scope; one-off conclusions stay as `decision` Sections under the
127
+ owning view;
128
+ - incident, postmortem, outage, fault timeline, action item -> `incident` only
129
+ when it has incident identity, timeline, follow-up, or tracking lifecycle;
130
+ isolated warnings/failures/action items stay as `incident` or `warning`
131
+ Sections under the owning view;
132
+ - test plan, validation scenario, acceptance case -> `test`;
133
+
134
+ Do not route prose align views to `codegraph` or `feats`: `codegraph` is
135
+ produced by code extraction / AST projection, and `feats` is reserved for the
136
+ dedicated feature workflow. For section-vs-collection overlap, keep a local
137
+ `faq`, `decision`, or `incident` as a Section kind under the owning view unless
138
+ the source is independently queryable across the package and has its own
139
+ lifecycle, ownership, timeline, or cross-cutting scope.
140
+
141
+ After collection routing, apply `structure-planning/references/gates.md` before
142
+ authoring Nodes: classify Node type in order (`action` scale + process evidence,
143
+ then concrete/term `entity`, then child-bearing `domain`), reject fake Entities
144
+ only when at least two suspicious signals match, keep `term` separate from
145
+ concrete tags, and provide required gate evidence.
146
+
147
+ Preserve shared-source intent when the same source span legitimately supports
148
+ multiple views. Do not copy the span text into multiple rewritten bodies; cite
149
+ the same CLI `source_ref` in each supported view and let structure-summary mark
150
+ the shared evidence.
151
+
152
+ Source titles and headings are ordinary evidence, not structural authority. Choose titles and summaries that fit the final Node type and the CLI-provided generation policy.
153
+
154
+ For `node.title` and `node.summary`, follow the workspace/source language
155
+ surfaced by the current view or the user's instruction. In Chinese workspaces,
156
+ translate descriptive scaffold words such as architecture, strategy, lifecycle,
157
+ overview, scheduling, high availability, and warning into Chinese while
158
+ preserving product names, code identifiers, CLI flags, slugs, source_ref tokens,
159
+ and citation tokens exactly when needed. Do not copy an English source title
160
+ into `node.title` merely because the source is English.
161
+
162
+ Do not classify a broad architecture/system/方案 source as `domain` just because the title sounds like a scope. If it has writable Sections but no resolvable current/existing child Nodes, use an `entity` tag such as `system` or `application`; reserve `domain` for grouping child Nodes through typed `edges[]` with supported child targets.
163
+
164
+ For large or batched payloads, use
165
+ `structure-planning/references/density-profile.md` and
166
+ `structure-planning/references/candidate-resolution.md` as judgment aids.
167
+ They do not create additional workflow stages or alternate payloads.
168
+
169
+ ### Step 5 — Build The Payload Requested By `next_action`
170
+
171
+ Use `context run align:<type>:<source>:<collection> --view schema --format json` to
172
+ shape the payload. Treat that schema as the authoring contract.
173
+
174
+ Produce one `context.structure.v1` document with semantic Nodes, planned
175
+ Sections, typed edges, unresolved items, lifecycle state, sources, and evidence
176
+ snapshot hash. Section identities are part of the structure gate: choose stable
177
+ section ids such as `overview`, `behavior`, `constraints`, or a source-backed
178
+ domain-specific name when the evidence supports it.
179
+
180
+ Use only CLI-provided `source_refs[]` for section and edge evidence. Do not
181
+ invent heading/range/window selectors inside the structure. Treat source heading
182
+ changes as section-planning signals: sibling sub-headings under a shared parent
183
+ may stay in one Section when they form one coherent semantic topic; headings
184
+ with no shared parent should usually split unless you intentionally want one
185
+ Section to span them. If a semantic section would require non-contiguous or
186
+ cross-source evidence, split it during align or return the issue to the
187
+ structure gate. Current compile writes approved knowledge by mirroring source
188
+ spans; it does not use rewritten multi-ref sections to compress unrelated
189
+ evidence.
190
+
191
+ When the cited source sentence itself is uncertain, preserve that uncertainty on
192
+ the edge with `confidence: possible` or `confidence: hypothesis`. This is only
193
+ for source-authored uncertainty such as "可能", "疑似", "may", or "might". If
194
+ you are unsure whether the source supports the relation, do not add an uncertain
195
+ edge; move the relation to `unresolved[]`.
196
+
197
+ No-write/navigation-only/placeholder-only material should become `unresolved`
198
+ at align time when it has retrieval or graph value but lacks source-backed
199
+ section evidence. Do not turn relation-only navigation into a factual Section.
200
+ Do not submit `sections: []` for an ordinary source-bound view. Use
201
+ `sections: []` only for a generated parent index view, and only when it has
202
+ `generated: parent_index` plus source-backed `contains` edges to child views.
203
+ If the relationship matters but evidence or a target node is missing, keep it
204
+ unresolved instead of writing a dangling edge.
205
+
206
+ Emit `depends_on` edges only when cited source refs explicitly say one Node
207
+ consumes, requires, calls, is configured by, or is downstream of another Node as
208
+ a prerequisite, capability provider, upstream input, runtime dependency, or
209
+ data-flow source. Direction is consumer/downstream -> provider/upstream. Do not
210
+ create `depends_on` for parent/child containment, `Related`/`See also` lists,
211
+ sibling co-occurrence, shared table membership, name similarity, or a plain
212
+ mention without a dependency predicate. `edges[].source_refs[]` must include the
213
+ source ref that states the dependency; if the relationship matters but evidence
214
+ is missing, leave the edge unresolved instead of guessing.
215
+
216
+ Prefer the strongest source-backed `section_kind` using the current schema's `section_kind_priority` and `section_kind_triggers`; avoid planning an entire dense source as `description` when the evidence clearly contains fenced examples, comparison tables, Q&A, decisions, specs, warnings, or principles. Use `example` for fenced command/config/code or literal sample blocks, not ordinary scenario prose. Use `incident` only for dated or timestamped failure evidence with impact scope plus root cause, mitigation, or handling record. Use `decision` only when the source surfaces two or more alternatives or options plus the chosen path and rationale. Treat kind precision as a drafting quality preference, not a reason to block an otherwise source-backed write. Keep only raw-backed semantic decisions in the payload; leave mechanical repair and patch routing to CLI diagnostics.
217
+
218
+ There is no parallel candidate-body authoring path. Emit only the
219
+ `context.structure.v1` payload accepted by the current schema view.
220
+
221
+ ### Step 6 — Validate And Submit
222
+
223
+ Before staging, run `context run align:<type>:<source>:<collection> --validate --input - --format json` with the `context.structure.v1` payload. If validate returns blocking diagnostics, repair the exact paths it reports and rerun validate. After validation, show the structure to the user with the structure summary and `structure_report.path`. If validation returns `confirmation_blockers[]` or `will_block_confirmation`, repair those blockers before asking the user to confirm. If you stage a draft structure first, the stage result is still a human review gate: show the returned report/summary and ask the user to inspect it before confirming. Only write `lifecycle.state: confirmed` only after explicit confirmation; then run `context run align:<type>:<source>:<collection> --confirm --format json` or pass an explicit file with `--confirm --input <structure.yaml> --format json`.
224
+
225
+ After stage succeeds, do not rerun the same write command to confirm success.
226
+ Use `context status --format json` or the returned result for read-only
227
+ confirmation; then continue with the returned `next_action.command`, normally
228
+ `context run compile:<type>:<source>:<collection> --view read-plan --format json`.
229
+
230
+ If any write is rejected, follow the returned `next_action` and `reason_code`.
231
+ Do not retry by guessing direct/batched stages, forcing route bypasses, or
232
+ editing CLI-managed files.
233
+
234
+ ### Step 7 — Self-verify
235
+
236
+ - [ ] All writes followed top-level `next_action.command`. If not, return to **Step 1**.
237
+ - [ ] Evidence was read through returned `next_action.command`, `next_command`, or current CLI schema/view commands only. If not, return to **Step 2**.
238
+ - [ ] Node classification used the semantic gates in `structure-planning/references/gates.md`. If not, return to **Step 4**.
239
+ - [ ] URL/reference ownership followed CLI diagnostics, not static prompt rules. If not, return to **Step 5**.
240
+ - [ ] The requested align payload passed `context run align:<type>:<source>:<collection> --validate --input - --format json` before stage. If not, return to **Step 6**.
241
+ - [ ] No `sources/`, `unapproved/`, `knowledge/`, `dist/`, `.tmp`, host tool-results, or CLI-managed files were read or written with generic tools. If violated, restart from **Step 1**.
242
+
243
+ </procedures>