@c4a/context-cli 0.6.1 → 0.6.3

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 (246) hide show
  1. package/README.md +77 -12
  2. package/README.zh-CN.md +202 -0
  3. package/cli.js +74066 -45247
  4. package/docs/context-debug-event-v1.schema.json +29 -0
  5. package/docs/context-debug-replay-v1.schema.json +33 -0
  6. package/docs/debug-tracing.md +86 -0
  7. package/docs/quickstart.md +23 -5
  8. package/package.json +8 -3
  9. package/plugins/README.md +60 -118
  10. package/plugins/README_CN.md +51 -102
  11. package/plugins/VERSION +1 -1
  12. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude/commands/continue.md +61 -10
  14. package/plugins/claude/commands/init.md +26 -11
  15. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  16. package/plugins/codex/skills/continue/SKILL.md +61 -11
  17. package/plugins/codex/skills/init/SKILL.md +28 -14
  18. package/plugins/cursor/.cursor-plugin/plugin.json +2 -3
  19. package/plugins/cursor/README.md +2 -2
  20. package/plugins/cursor/commands/context-continue.md +61 -10
  21. package/plugins/cursor/commands/context-init.md +26 -11
  22. package/plugins/skills/context-continue/SKILL.md +61 -11
  23. package/plugins/skills/context-init/SKILL.md +28 -14
  24. package/providers/context/actions/accept-package-templates.yaml +5 -0
  25. package/providers/context/actions/align-next.yaml +6 -0
  26. package/providers/context/actions/apply-managed-review.yaml +5 -0
  27. package/providers/context/actions/apply-structure-confirmation.yaml +5 -0
  28. package/providers/context/actions/build-next.yaml +5 -0
  29. package/providers/context/actions/capture-next.yaml +5 -0
  30. package/providers/context/actions/close-approved-knowledge.yaml +5 -0
  31. package/providers/context/actions/compile-next.yaml +5 -0
  32. package/providers/context/actions/configure-code-extraction.yaml +5 -0
  33. package/providers/context/actions/configure-document-capture.yaml +5 -0
  34. package/providers/context/actions/configure-package-output.yaml +5 -0
  35. package/providers/context/actions/configure-prose-lifecycle.yaml +5 -0
  36. package/providers/context/actions/extract-next.yaml +5 -0
  37. package/providers/context/actions/inspect-document-classification.yaml +5 -0
  38. package/providers/context/actions/inspect-repository-recovery.yaml +6 -0
  39. package/providers/context/actions/inspect-review.yaml +5 -0
  40. package/providers/context/actions/inspect-structure.yaml +5 -0
  41. package/providers/context/actions/maintain-evidence.yaml +6 -0
  42. package/providers/context/actions/materialize-context-view.yaml +8 -0
  43. package/providers/context/actions/reconcile-review-identities.yaml +5 -0
  44. package/providers/context/actions/register-source-batch.yaml +7 -0
  45. package/providers/context/actions/repair-project-entry.yaml +5 -0
  46. package/providers/context/actions/repair-verification.yaml +5 -0
  47. package/providers/context/actions/repair-workspace-state.yaml +5 -0
  48. package/providers/context/actions/restore-repository-sources.yaml +7 -0
  49. package/providers/context/codes.yaml +41 -0
  50. package/providers/context/graphs/workspace.yaml +536 -0
  51. package/providers/context/manifest.json +700 -0
  52. package/providers/context/provider.yaml +12 -0
  53. package/providers/context/resources/diagnostics/projection-stale.md +13 -0
  54. package/providers/context/resources/diagnostics/verification.md +21 -0
  55. package/providers/context/resources/diagnostics/workspace-state.md +27 -0
  56. package/providers/context/resources/dialogue/code-extraction.md +34 -0
  57. package/providers/context/resources/dialogue/document-capture.md +29 -0
  58. package/providers/context/resources/dialogue/document-classification.md +33 -0
  59. package/providers/context/resources/dialogue/evidence-maintenance.md +26 -0
  60. package/providers/context/resources/dialogue/human-gates.md +34 -0
  61. package/providers/context/resources/dialogue/knowledge-review.md +27 -0
  62. package/providers/context/resources/dialogue/package-output.md +30 -0
  63. package/providers/context/resources/dialogue/repository-source-recovery.md +23 -0
  64. package/providers/context/resources/dialogue/source-boundary.md +29 -0
  65. package/providers/context/resources/dialogue/structure-confirmation.md +44 -0
  66. package/providers/context/resources/manuals/guides/lark-resources.md +121 -0
  67. package/providers/context/resources/manuals/guides/package-outputs.md +267 -0
  68. package/providers/context/resources/manuals/reference/package-templates.md +378 -0
  69. package/providers/context/resources/manuals/reference/project-api.md +825 -0
  70. package/providers/context/resources/manuals/reference/template-variables.md +248 -0
  71. package/providers/context/resources/procedures/close-and-build.md +23 -0
  72. package/providers/context/resources/procedures/code-extraction.md +50 -0
  73. package/providers/context/resources/procedures/document-capture.md +49 -0
  74. package/providers/context/resources/procedures/document-classification.md +22 -0
  75. package/providers/context/resources/procedures/evidence-maintenance.md +20 -0
  76. package/providers/context/resources/procedures/knowledge-review.md +34 -0
  77. package/providers/context/resources/procedures/package-output.md +37 -0
  78. package/providers/context/resources/procedures/project-configuration.md +21 -0
  79. package/providers/context/resources/procedures/prose-align.md +68 -0
  80. package/providers/context/resources/procedures/prose-compile.md +23 -0
  81. package/providers/context/resources/procedures/repository-source-recovery.md +43 -0
  82. package/providers/context/resources/procedures/source-boundary.md +48 -0
  83. package/{plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md → providers/context/resources/procedures/source-capture-detailed.md} +54 -19
  84. package/providers/context/resources/procedures/verify-and-repair.md +31 -0
  85. package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/candidate-resolution.md +17 -2
  86. package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/density-profile.md +11 -0
  87. package/{plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/gates.md +13 -0
  88. package/{plugins/cursor/skills/skill-prose-align/references/internal-procedures → providers/context/resources/semantic/align}/structure-planning.md +62 -12
  89. package/providers/context/resources/semantic/compile/index.md +31 -0
  90. package/providers/context/resources/views/package-current.yaml +6 -0
  91. package/providers/context/resources/views/review-current.yaml +6 -0
  92. package/providers/context/resources/views/source-boundary.yaml +6 -0
  93. package/providers/context/resources/views/source-current.yaml +6 -0
  94. package/providers/context/resources/views/structure-current.yaml +6 -0
  95. package/providers/context/resources/views/verification-current.yaml +6 -0
  96. package/providers/context/resources/views/workspace-current.yaml +6 -0
  97. package/providers/context/schemas/evidence-maintenance-input.schema.json +30 -0
  98. package/providers/context/schemas/prose-structure-batch.schema.json +35 -0
  99. package/providers/context/schemas/repository-source-recovery.schema.json +40 -0
  100. package/providers/context/schemas/source-batch-input.schema.json +189 -0
  101. package/providers/context/scripts/render-context-view.mjs +21 -0
  102. package/plugins/claude/skills/skill-continue-workflow/SKILL.md +0 -235
  103. package/plugins/claude/skills/skill-init-workspace/SKILL.md +0 -74
  104. package/plugins/claude/skills/skill-package-output/SKILL.md +0 -180
  105. package/plugins/claude/skills/skill-prose-align/SKILL.md +0 -322
  106. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  107. package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  108. package/plugins/claude/skills/skill-prose-compile/SKILL.md +0 -287
  109. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  110. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  111. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  112. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  113. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  114. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  115. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  116. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  117. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  118. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  119. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  120. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  121. package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  122. package/plugins/claude/skills/skill-review-gate/SKILL.md +0 -138
  123. package/plugins/claude/skills/skill-source-scope/SKILL.md +0 -525
  124. package/plugins/claude/skills/skill-source-scope/references/capture-source.md +0 -201
  125. package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +0 -235
  126. package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +0 -74
  127. package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +0 -180
  128. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  129. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  130. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  131. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  132. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +0 -322
  133. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  134. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  135. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  136. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  137. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  138. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  139. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  140. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  141. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  142. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  143. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  144. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  145. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  146. package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +0 -287
  147. package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +0 -138
  148. package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +0 -525
  149. package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +0 -235
  150. package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +0 -74
  151. package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +0 -180
  152. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  153. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  154. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  155. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +0 -322
  156. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  157. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  158. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  159. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  160. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  161. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  162. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  163. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  164. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  165. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  166. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  167. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  168. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  169. package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +0 -287
  170. package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +0 -138
  171. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  172. package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +0 -525
  173. package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +0 -235
  174. package/plugins/cursor/skills/skill-init-workspace/SKILL.md +0 -74
  175. package/plugins/cursor/skills/skill-package-output/SKILL.md +0 -180
  176. package/plugins/cursor/skills/skill-prose-align/SKILL.md +0 -322
  177. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  178. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  179. package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  180. package/plugins/cursor/skills/skill-prose-compile/SKILL.md +0 -287
  181. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  182. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  183. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  184. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  185. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  186. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  187. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  188. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  189. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  190. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  191. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  192. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  193. package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  194. package/plugins/cursor/skills/skill-review-gate/SKILL.md +0 -138
  195. package/plugins/cursor/skills/skill-source-scope/SKILL.md +0 -525
  196. package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +0 -201
  197. package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +0 -235
  198. package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +0 -74
  199. package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +0 -180
  200. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  201. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  202. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  203. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  204. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +0 -322
  205. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  206. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  207. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  208. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  209. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  210. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  211. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  212. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  213. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  214. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  215. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  216. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  217. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  218. package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +0 -287
  219. package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +0 -138
  220. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  221. package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +0 -525
  222. package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +0 -235
  223. package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +0 -74
  224. package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +0 -180
  225. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
  226. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
  227. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
  228. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
  229. package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +0 -322
  230. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
  231. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
  232. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
  233. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
  234. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
  235. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
  236. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
  237. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
  238. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
  239. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
  240. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
  241. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
  242. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
  243. package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +0 -287
  244. package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +0 -138
  245. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
  246. package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +0 -525
@@ -1,235 +0,0 @@
1
- ---
2
- name: skill-continue-workflow
3
- description: >
4
- Internal procedure invoked by the public Context continuation entry; not a user slash command.
5
- Runs the status-driven Context process, executes safe mechanical next steps,
6
- and delegates human gates to source, review, and package procedures.
7
- tools:
8
- - Bash
9
- ---
10
-
11
- # skill-continue-workflow
12
-
13
- Continue an existing Context workspace from its current state.
14
-
15
- ## TL;DR
16
-
17
- - Use this only inside an initialized Context workspace. If the user is starting
18
- a new knowledge workspace or a new batch from a raw project/repo root, do not
19
- run `context status` first; use the init workflow and complete setup before
20
- returning here.
21
- - If `context status` reports `workspace-not-found` with a configured
22
- `context.workspaceDir`, stop. If the directory exists, enter it and rerun
23
- status. If it does not exist, ask whether to initialize it through the init
24
- workflow; do not treat the host repository root as the workspace.
25
- - There is no `context continue` CLI command. Start with `context status`.
26
- - `context status` and CLI diagnostics are the source of truth.
27
- - If the user explicitly authorizes fully managed operation in the current
28
- conversation, start and continue that loop with `context status --managed
29
- --format json`, then execute its managed `command_plan`. This authority is
30
- conversation-only: do not write it into `defineProject`, project files, or
31
- reuse it in a later conversation.
32
- - Inspect `declarationGraph` and `configurationGaps`. Before structure
33
- confirmation they are configuration warnings; after confirmation, a missing
34
- compile route is a hard gate. Never substitute a compile phase from another
35
- collection.
36
- - Treat `unclassifiedDocumentTargets`, `pendingStructureTargets`, and nonterminal
37
- `structureBatch.slots` as unfinished workspace work even when the
38
- current approved package is ready. A build closes only the active snapshots;
39
- it does not prevent a later captured source from entering its own structure
40
- round.
41
- - Confirm structure per canonical source + collection slot, but batch Review
42
- across the declared round. When candidates exist and
43
- `pendingStructureTargets` is non-empty, follow the pending align route before
44
- opening Review; deterministic close later merges every active slot.
45
- - Execute safe mechanical `next:` steps; stop at semantic choices and human
46
- gates.
47
- - Delegate source/scope decisions to
48
- `skill-source-scope.md`.
49
- - Delegate review to `skill-review-gate.md`.
50
- - Delegate package output choices to
51
- `skill-package-output.md`.
52
- - Delegate document investigation and structure confirmation to
53
- `skill-prose-align.md`.
54
- - Delegate source-bound prose compile requests to
55
- `skill-prose-compile.md`.
56
- - Do not inspect `.tmp`, `unapproved/`, `knowledge/`, `dist/`, or
57
- `node_modules/@c4a/context/dist` with ad hoc scripts to decide project state.
58
- - Only run commands surfaced by the current status route, current phase view,
59
- review gate, verify/build gate, or package guidance. Do not invent alternate
60
- lifecycle commands from memory.
61
-
62
- <reference>
63
-
64
- ## Safe Mechanical Commands
65
-
66
- These can run when already implied by current status and no placeholder/human
67
- choice remains:
68
-
69
- | State / hint | Allowed action |
70
- |---|---|
71
- | source already declared | `context source ensure`, `context source list`, `context source get` |
72
- | declared phase that does not read new source body or require a semantic choice | `context run <phase-id>` |
73
- | prose align evidence read | `context run align:<type>:<source>:<collection> --view <view>` |
74
- | prose structure validation | `context run align:<type>:<source>:<collection> --validate --input <structure.yaml>` |
75
- | prose compile evidence read | `context run compile:<type>:<source>:<collection> --view <view>` |
76
- | prose compile action validation | `context run compile:<type>:<source>:<collection> --validate --input <compile-actions.yaml>` |
77
- | copied review payload supplied by user | `context review apply <payload-file>` |
78
- | close required after review | `context close --format json` |
79
- | package already declared and close is clean | `context build` |
80
- | validation requested | `context verify` |
81
-
82
- Capture phases are not safe mechanical commands by default. `capture:file:*`
83
- and `capture:lark:*` read local or remote source bodies and update committed
84
- snapshots, so they require the source read-permission gate unless the current
85
- turn already contains explicit user confirmation for that exact source.
86
- An explicit request to capture, ingest, fetch, read, or include the exact
87
- file/Lark path or URL is that confirmation; do not ask again after registration.
88
- Mere mention, source discussion, or a register-only request is not confirmation,
89
- and an explicit refusal always overrides inferred permission.
90
-
91
- ## Human Gates
92
-
93
- In ordinary mode, follow every gate below. In explicit current-conversation
94
- managed mode, the CLI may resolve classification, extraction scope, structure
95
- confirmation, Review, and package-output choices without pausing. It still
96
- must not infer a source boundary, read an unapproved source body, perform an
97
- external repository/system operation, or bypass validation/verify errors.
98
-
99
- Stop and ask, or wait for user input, for:
100
-
101
- - `Human gate:` in CLI output.
102
- - placeholders such as `<name>`, `<repo-or-subdir>`, `<phase-id>`, `<collection>`.
103
- - missing source selection.
104
- - source boundary/name decisions, because they affect `knowledge/` paths and
105
- `source_ref` prefixes.
106
- - source repo operations: clone, checkout, reset, fetch, install, build, test.
107
- - source scope, package/subdirectory, symbol group, or glob choices.
108
- - file/Lark capture or refresh, including capture preview, until the user has
109
- confirmed which local path or remote document may be read.
110
- - review approval/rejection decisions.
111
- - document structure confirmation, section ownership, edge confirmation,
112
- rewrite intent, conflict, weak-evidence, or cross-document organization
113
- choices unless they are being handled through prose align/compile evidence
114
- views and validation.
115
- - package output type or template choices.
116
-
117
- When a human gate has a fixed small option set, use the host's native
118
- multi-choice tool when available (Claude Code `AskUserQuestion`, Codex's
119
- available native user-input tool such as `request_user_input` when exposed,
120
- Cursor Plan Mode `AskQuestion`). If unavailable, fall back to Markdown `A/B/C`
121
- choices. Each option must include the effect of choosing it.
122
-
123
- </reference>
124
-
125
- <procedures>
126
-
127
- ### Step 0 — Confirm Workspace Exists
128
-
129
- If the current task is to create a new Context workspace, or the user has not
130
- identified an initialized Context workspace root for this turn, do not continue
131
- with this workflow. Initialize through the public Context init entry or
132
- `context init` first, run the setup command printed by init, then return to this workflow from the
133
- created workspace.
134
-
135
- ### Step 1 — Read Status
136
-
137
- Run:
138
-
139
- ```bash
140
- context status
141
- ```
142
-
143
- Use `context status --managed --format json` instead only when the current
144
- conversation explicitly contains fully managed authorization. Keep `--managed`
145
- on commands returned by that status loop; otherwise never add it.
146
-
147
- Use the output as evidence. Explain status and next step in the user's language;
148
- do not forward a long raw transcript unless requested.
149
-
150
- ### Step 2 — Route The State
151
-
152
- 1. If status says `missing-source`, `needs-capture-phase`, `needs-capture`,
153
- `needs-extract-phase`, or `ready-to-extract`,
154
- source boundary/name is unclear, source scope is unclear, or an extract
155
- phase needs first-run scope confirmation, follow
156
- `skill-source-scope.md`.
157
- When `routing.configuration` is present, make only that declared project
158
- configuration change and rerun status. Otherwise follow
159
- `routing.command_plan`: run `immediate` items directly and wait for current-
160
- conversation confirmation before `after-human-confirmation` items.
161
- For mixed sources, status intentionally returns `ready-to-extract` before
162
- `captured-ready-to-investigate` while all document snapshots are captured,
163
- document structure is untouched, and code extraction is missing, pending,
164
- or stale. Explain that code is processed first, then follow the exact
165
- extraction preview/rerun command.
166
- 2. If status says `captured-ready-to-classify`, run every immediate
167
- collection-neutral investigation command, summarize evidence across all
168
- targets, and ask the user to confirm the proposed mainline collection(s)
169
- before editing `src/index.ts`. If status says `needs-prose-configuration`, apply only the generic
170
- `routing.configuration` change in `src/index.ts`, rerun status, and do not
171
- create a new workspace. If status says `captured-ready-to-investigate` or `needs-structure`, or the
172
- user asks to split, merge, classify, relate, or semantically organize
173
- document evidence before draft pages exist, follow
174
- `skill-prose-align.md`.
175
- 3. If status says `needs-prose-compile` or `structure-ready`, or the user asks
176
- to turn confirmed structure into source-bound draft pages, follow
177
- `skill-prose-compile.md`.
178
- 4. If the latest phase result has `next_action.human_gate=false`, follow its
179
- command and do not invent a Review gate. This includes
180
- `continue_compile_batch` and `continue-codegraph-batch`: finish the whole
181
- prepared round first. If status says
182
- `compile-ready-for-review`, or the latest result has
183
- `next_action.human_gate=true`, follow
184
- `skill-review-gate.md`.
185
- 5. If status says `compile-close-needed`, run `context close --format json`
186
- unless CLI diagnostics require human repair, then return to **Step 1**.
187
- 6. If status says `ready-to-build`, `built`, `needs-package-output`, or approved knowledge exists but
188
- package output is not chosen or declared,
189
- follow `skill-package-output.md`.
190
- `built` is terminal only when both `unclassifiedDocumentTargets` and
191
- `pendingStructureTargets` are empty. Use `structureBatch` for the complete
192
- multi-source round: evidence Views are parallel-safe; stage, confirm, Review
193
- apply, and close mutations are serial.
194
- 7. If the next command is safe per [Safe Mechanical Commands](#safe-mechanical-commands),
195
- run it and return to **Step 1**.
196
- 8. If the next command crosses a [Human Gate](#human-gates), ask or wait; do not
197
- guess.
198
-
199
- ### Step 3 — Execute Safely
200
-
201
- Before editing `src/index.ts` or package templates, read:
202
-
203
- ```text
204
- node_modules/@c4a/context/docs/guides/agent-guide.md
205
- node_modules/@c4a/context/docs/guides/package-outputs.md
206
- node_modules/@c4a/context/docs/reference/project-api.md
207
- node_modules/@c4a/context/docs/reference/package-templates.md
208
- ```
209
-
210
- Do not write one-off scripts to parse source packages, count extracted symbols,
211
- or sample candidates. Use `context source inspect` and the extract no-write
212
- preview command.
213
-
214
- ### Step 4 — Report
215
-
216
- Report only the meaningful state transition: commands run, current status,
217
- human gate reached, and the precise user decision needed next. Never present
218
- `context build`, `context verify`, or file counts as proof that a deliverable is
219
- usable; inspect generated package structure when package output is involved.
220
-
221
- ### Step 5 — Self-verify Checklist
222
-
223
- - [ ] `context status` (or explicitly authorized `context status --managed`) was
224
- run first. If not, return to **Step 1**.
225
- - [ ] No human gate was crossed without either direct user confirmation or the
226
- current conversation's managed authorization. If not, stop and report the
227
- protocol error.
228
- - [ ] No ad hoc file/script probing replaced CLI views. If not, discard that
229
- conclusion and use the CLI view.
230
-
231
- </procedures>
232
- If top-level `state`, `next`, or `routing.command_plan` contradicts
233
- `draftCandidates`, `pendingReview`, `close.state`, package freshness, or verify
234
- counts, stop instead of rerunning a completed phase. Report
235
- `status-route-conflict` and preserve the detailed status output for diagnosis.
@@ -1,74 +0,0 @@
1
- ---
2
- name: skill-init-workspace
3
- description: >
4
- Internal procedure invoked by the public Context init entry; not a user slash command.
5
- Initializes a Context knowledge workspace, executes only safe setup follow-up,
6
- then hands off to the next-step workflow until the first human gate.
7
- tools:
8
- - Bash
9
- ---
10
-
11
- # skill-init-workspace
12
-
13
- Initialize a Context workspace. The CLI creates files; the agent follows safe
14
- setup hints and stops before source/scope choices.
15
-
16
- ## TL;DR
17
-
18
- - Use `context init`; do not add any extra project-local agent setup.
19
- - If init prints the standard setup `next:` command, run it instead of only
20
- repeating it.
21
- - After the setup command succeeds, enter the workspace and read `AGENTS.md`
22
- before running `context status`.
23
- - After setup, use `skill-continue-workflow.md`
24
- for status-driven continuation.
25
- - Stop at source registration, extraction scope, review, package output, or any
26
- external repo operation that needs user choice.
27
- - Explain in the user's conversation language. Keep CLI commands, flags, paths,
28
- status values, JSONL keys, and copied CLI tokens unchanged.
29
-
30
- <procedures>
31
-
32
- ### Step 1 — Run Init
33
-
34
- 1. If the user gave no directory, run `context init`.
35
- 2. If the user gave a directory, run `context init <project-dir>`.
36
- 3. If the user supplied a project name option, pass it as `--name <name>`.
37
- 4. Read the CLI feedback block and preserve the project root path.
38
-
39
- ### Step 2 — Execute Safe Setup
40
-
41
- 1. If CLI prints `next: cd "<project-root>" && bun install`,
42
- execute that command.
43
- 2. If install fails, report the failure and stop.
44
- 3. If setup succeeds, read `<project-root>/AGENTS.md`.
45
- 4. After reading `AGENTS.md`, run `context status` from `<project-root>` and
46
- treat that output as the current workspace state.
47
-
48
- ### Step 3 — Handoff Or Stop
49
-
50
- 1. If status is ready for a safe mechanical step, continue with
51
- `skill-continue-workflow.md`.
52
- 2. If status is `missing-source`, `Human gate:`, or contains placeholders such as
53
- `<name>`, `<repo-or-subdir>`, `<phase-id>`, or `<collection>`, ask for the
54
- missing human choice and stop. For missing sources, ask for the knowledge
55
- source boundary first; do not ask for a raw source name as an isolated
56
- parameter.
57
- 3. Do not infer repo source, source boundary, source name, package, or
58
- extraction scope from cwd, parent directories, package names, monorepo
59
- layout, or git remote.
60
-
61
- ### Step 4 — Report
62
-
63
- Summarize what was initialized, what setup command ran, current status, and the
64
- human choice needed next. Do not paste a long raw CLI transcript unless the user
65
- asks for exact output.
66
-
67
- ### Step 5 — Self-verify Checklist
68
-
69
- - [ ] Safe setup was executed when CLI provided the standard setup `next:`. If
70
- not, return to **Step 2**.
71
- - [ ] No repo source or extraction scope was inferred. If not, stop and ask the
72
- user to confirm the source boundary and scope.
73
-
74
- </procedures>
@@ -1,180 +0,0 @@
1
- ---
2
- name: skill-package-output
3
- description: >
4
- Internal procedure invoked by the public Context continuation entry; not a user slash command.
5
- Explains package output choices, prefers kb packages, declares selected
6
- package builders, builds, and inspects generated package structure.
7
- tools:
8
- - Bash
9
- ---
10
-
11
- # skill-package-output
12
-
13
- Choose and build a package output from approved knowledge.
14
-
15
- ## TL;DR
16
-
17
- - Package output is a human choice. Do not add package builders just because an
18
- example exists.
19
- - In explicitly authorized current-conversation fully managed mode, resolve
20
- this choice from the user's stated deliverable: use an agent knowledge-base
21
- package for an Agent-facing knowledge workspace, an LLM text bundle only
22
- when a text/RAG bundle was requested, and skip only when the user asked to
23
- keep approved Markdown without a package. Do not persist this preference.
24
- - Recommend an agent knowledge-base package first for agent consumption.
25
- - Present an LLM text bundle as an alternative for a single text/RAG import
26
- bundle.
27
- - Do not use `kbPackage()` or `llmsPackage()` as user-facing option labels.
28
- Mention those API names only after the user chooses an output shape.
29
- - Do not offer `both` as a shortcut. Add one output, build, inspect, then ask
30
- before adding another.
31
- - Build happens after review and deterministic close. If status says
32
- `compile-close-needed`, run `context close --format json` before build.
33
- - Package templates may customize navigation and query guidance, but coverage,
34
- gap, scope, or known-limit claims must cite approved knowledge,
35
- `knowledge/structure.yaml`, or `context-build-inventory.json`.
36
- - Generated package structure, not `context build` alone, proves usability.
37
-
38
- <reference>
39
-
40
- ## Output Shapes
41
-
42
- Recommended first output:
43
-
44
- ```text
45
- dist/<name>-kb/
46
- ├── AGENTS.md
47
- ├── skills/
48
- │ └── knowledge-query/
49
- │ └── SKILL.md
50
- └── wikis/
51
- ├── index.md
52
- ├── <group>/
53
- │ ├── index.md
54
- │ └── ...
55
- └── ...
56
- ```
57
-
58
- Alternative:
59
-
60
- ```text
61
- dist/<name>-llms/
62
- └── llms.txt
63
- ```
64
-
65
- </reference>
66
-
67
- <procedures>
68
-
69
- ### Step 1 — Read Package Docs
70
-
71
- Before editing package declarations or templates, read:
72
-
73
- ```text
74
- node_modules/@c4a/context/docs/guides/package-outputs.md
75
- node_modules/@c4a/context/docs/reference/package-templates.md
76
- ```
77
-
78
- ### Step 2 — Explain The Choice
79
-
80
- Explain in the user's conversation language:
81
-
82
- - an agent knowledge-base package creates copied approved knowledge pages and
83
- reusable query guidance under `dist/<name>-kb/`;
84
- - the default `knowledge-query` skill teaches agents how to query and cite those
85
- copied approved knowledge pages;
86
- - the kb template must keep `wikis/index.md` as the OKF bundle entry page;
87
- - the default `wikis/index.md` is intentionally shallow: it describes the
88
- bundle and links to next-level directories;
89
- - `context build` maps internal production collections into OKF roots and
90
- generates child directory indexes such as `<okf-root>/<group>/index.md`, so
91
- users can browse from OKF root -> group -> page; `wikis/index.md` is the
92
- required default OKF root entry, while selected `guides/`, `rules/`, or
93
- `feats/` roots get their own indexes too;
94
- - the exact mapping is `codegraph`/`business`/`product` -> `wikis/`,
95
- `architecture`/`sop`/`faq`/`decision`/`incident` -> `guides/`,
96
- `standards`/`test` -> `rules/`, and `feats` -> `feats/`;
97
- - `wikis/` is the structured entity-and-relationship layer; guides and rules
98
- may explain, operationalize, or constrain it, but co-location does not prove
99
- a relationship;
100
- - an LLM text bundle creates one text/RAG import bundle under
101
- `dist/<name>-llms/`;
102
- - the user can customize `src/package-templates/kb/` before build;
103
- - template variables and examples are documented in
104
- `node_modules/@c4a/context/docs/reference/template-variables.md`;
105
- - build writes a package inventory such as `context-build-inventory.json`, which
106
- templates may cite when describing package coverage. Its edge section reports
107
- the structural edge contract and the evidence status from `context verify`;
108
- - the user can skip package output for now and keep only `knowledge/`.
109
-
110
- Outside managed mode, ask which single output to create first using the host's
111
- native multi-choice tool when available. Use semantic option labels:
112
-
113
- - Agent knowledge-base package: for agents to query and cite approved knowledge pages.
114
- - LLM text bundle: for one text/RAG import bundle.
115
- - Skip package output for now: keep approved Markdown only.
116
-
117
- ### Step 3 — Declare The Selected Package
118
-
119
- After the user chooses, read the template variable guide if the template needs
120
- navigation changes:
121
-
122
- ```text
123
- node_modules/@c4a/context/docs/reference/template-variables.md
124
- ```
125
-
126
- Then edit `src/index.ts` and package templates according to the SDK docs. For
127
- kb output, prefer a clear package name such as `<source-name>-kb`.
128
-
129
- ### Step 4 — Build And Inspect
130
-
131
- If status says close is required, run:
132
-
133
- ```bash
134
- context close --format json
135
- ```
136
-
137
- Do not build from unclosed approved knowledge.
138
-
139
- Run:
140
-
141
- ```bash
142
- context build
143
- ```
144
-
145
- Inspect the generated `dist/<name>-kb/` or `dist/<name>-llms/` structure against
146
- [Output Shapes](#output-shapes). For kb packages, inspect every selected
147
- OKF root that appears in `context-build-inventory.json`, not only
148
- `wikis/`.
149
- If templates are placeholders or knowledge pages are thin, say that plainly and
150
- stop for user direction.
151
-
152
- If build reports that a template path collides with copied knowledge, do not
153
- retry blindly. Explain that template files and selected knowledge cannot render
154
- to the same path, then rename the template file or ask whether to exclude that
155
- knowledge path.
156
-
157
- If build reports a template-boundary diagnostic, repair the template by
158
- referencing approved knowledge, `knowledge/structure.yaml`, or
159
- `context-build-inventory.json` for coverage/gap/scope/known-limit statements.
160
- Do not patch `dist/` as the durable fix; edit the template under
161
- `src/package-templates/`.
162
-
163
- ### Step 5 — Self-verify Checklist
164
-
165
- - [ ] The user selected the package output, or explicit current-conversation
166
- managed mode resolved it from the stated deliverable. If not, return to
167
- **Step 2**.
168
- - [ ] Only one output was added first. If not, ask before continuing with more.
169
- - [ ] A kb package template contains `wikis/index.md` and at least one
170
- `SKILL.md`.
171
- - [ ] For kb output, the generated OKF root indexes link to next-level
172
- directories, and child directory indexes exist when selected knowledge has
173
- subdirectories.
174
- - [ ] Template paths do not collide with copied knowledge paths.
175
- - [ ] Template coverage/gap/scope/known-limit claims cite approved knowledge,
176
- `knowledge/structure.yaml`, or build inventory.
177
- - [ ] Generated structure was inspected after build. If not, return to
178
- **Step 4**.
179
-
180
- </procedures>
@@ -1,91 +0,0 @@
1
- # Candidate Resolution Rules
2
-
3
- Use these rules after reading the current align evidence views and before
4
- authoring `context.structure.v1`. They define how current anomaly diagnostics
5
- map to supported structure outcomes.
6
-
7
- ## Anomaly Signals
8
-
9
- Anomaly diagnostics are mechanical warnings. Do not ignore them and do not treat
10
- them as recommendations.
11
-
12
- For each anomaly, choose one current outcome and record the reasoning in the
13
- structure payload or user-facing explanation:
14
-
15
- | Outcome | Use When |
16
- |---|---|
17
- | Accept the correction | The anomaly points to a real structure fix. Apply a concrete node, section, edge, or ownership correction supported by source refs. |
18
- | Dismiss with rationale | The warning is mechanically true but semantically harmless. Keep the structure and state why in the confirmation summary. |
19
- | Keep unresolved | The warning changes structure but source evidence is insufficient. Add an `unresolved[]` item instead of guessing. |
20
-
21
- Known anomaly kinds:
22
-
23
- | Kind | Meaning | Required handling |
24
- |---|---|---|
25
- | Missing evidence | A proposed node, section, or edge has no source-backed evidence. | Add source refs, remove it, or keep the issue unresolved. |
26
- | Structure churn | A node was renamed, split, merged, replaced, or rejected during investigation. | Confirm the final id/title/target with the user or keep the ambiguity unresolved. |
27
- | Duplicate evidence | The same source ref appears more than once for the same semantic role. | Deduplicate it or explain why the repeated ref supports different roles. |
28
- | Broad review needed | The CLI collapsed many anomalies or reports aggregate risk. | Review the affected structure broadly; do not finalize solely from ordering. |
29
-
30
- ## Stable References
31
-
32
- Use stable `node_ref`, `view_ref`, and `section_ref` values from the current
33
- `context.structure.v1` payload for in-payload references. A NodeRef should be
34
- safe, lower-case, and path-shaped, such as `entity/rspack` or
35
- `domain/build-tooling`. `slug` and `path` are derived fields in the current
36
- flow; do not invent alternate reference aliases.
37
-
38
- When an edge or section points at knowledge:
39
-
40
- - use the schema ref that matches the target layer:
41
- `node_ref` for a conceptual Node, `view_ref` for a collection view, and
42
- `section_ref` for a planned section;
43
- - ensure the target NodeRef, ViewRef, or SectionRef exists in the current
44
- structure or approved knowledge;
45
- - keep relation hints unresolved when the target does not exist;
46
- - follow CLI diagnostics if a ref is unknown or stale.
47
-
48
- Do not create alternate alias fields or non-schema candidate ledger fields.
49
- They are not part of the current structure contract.
50
-
51
- ## Visible Labels And Audit Rationale
52
-
53
- Humans need to understand merge, reject, rename, and replacement choices
54
- without decoding temporary ids. Keep that discipline in the current structure
55
- flow through current fields:
56
-
57
- - use `title` and `summary` to name the final node in user-facing language;
58
- - explain renamed/split/merged candidates in the confirmation summary, not by
59
- adding non-schema label fields;
60
- - when a relation or rename cannot be settled from evidence, put the visible
61
- title/target clue in `unresolved[]`;
62
- - when asking the user, phrase the choice with business labels ("Rspack build
63
- tool page" vs "Webpack page"), not with source refs or internal section ids.
64
-
65
- NodeRef is the stable conceptual identity. ViewRef is the collection-specific
66
- view identity and is the durable approved-page identity. SectionRef is the
67
- stable planned-section identity under a ViewRef. Package paths are derived from
68
- the approved ViewRef plus containment/slug; do not treat paths as an alternate
69
- identity contract. Visible labels help humans review the choice, but they do
70
- not authorize a different NodeRef, ViewRef, edge, or section ownership without
71
- source-backed evidence and user confirmation.
72
-
73
- ## Duplicate And Conflict Handling
74
-
75
- - Exact duplicate structure -> keep one node/section/edge and explain the
76
- duplicate in the confirmation summary.
77
- - Same topic but different evidence boundary -> keep separate sections only
78
- when each section has a distinct source-backed role.
79
- - Conflicting facts -> ask the user or keep an `unresolved[]` item. Do not
80
- pick a winner from title order or source order.
81
- - Replacement or rename -> ask the user when it changes NodeRef, ViewRef,
82
- containment, slug, or the derived approved path. These are durable user-facing
83
- identities, not disposable labels.
84
-
85
- ## Self-verify
86
-
87
- - [ ] Every accepted node, section, and edge has source-backed support.
88
- - [ ] Every unresolved relation or conflict is explicit in `unresolved[]`.
89
- - [ ] No non-schema candidate ledger fields or alias fields appear in the payload.
90
- - [ ] NodeRef, ViewRef, and SectionRef values, not temporary labels or paths,
91
- are used for current references.
@@ -1,30 +0,0 @@
1
- # Evidence Density Selection
2
-
3
- Use density as a private reading and section-planning strategy. It is not a
4
- separate payload, not a quality score, and not a workflow stage. Persist only
5
- current `context.structure.v1` fields such as `nodes[]`, `sections[]`,
6
- `source_refs[]`, `edges[]`, and `unresolved[]`.
7
-
8
- Apply this reference when a captured source is long, dense, fragmented, or hard
9
- to split into stable planned sections. Use the current CLI evidence views
10
- (`read-plan`, `source-index`, `span-detail`, `span-text`) to inspect material;
11
- do not invent a separate coarse-read artifact.
12
-
13
- | Profile | Use When | Agent Behavior |
14
- |---|---|---|
15
- | `macro` | A long source has many headings, sections, or broad topic shifts. | Create section proposals around major headings and preserve document-level anchors so later passes do not flatten scope. |
16
- | `meso` | Default for normal product, design, or operational documents with several related sections. | Produce section proposals for meaningful local units and preserve evidence anchors. |
17
- | `micro` | The source is fragmented, note-like, or dense with short independent claims. | Keep section proposals narrow and avoid bundling unrelated blocks into one candidate. |
18
- | `single_pass` | The source is short enough that one read can safely discover all relevant structure. | Keep anchors minimal and avoid over-segmentation, but still validate the resulting structure. |
19
-
20
- Treat Markdown heading changes as section-planning hints, not hard boundaries.
21
- Sibling sub-headings under a shared parent can remain in one planned section
22
- when they form one coherent semantic topic for that parent. Headings with no
23
- shared parent should usually split unless you intentionally want one section to
24
- span them. When a dense source has many headings, split by heading first, then
25
- merge adjacent or sibling groups only when the merged section is still one
26
- coherent fact group.
27
-
28
- Do not let density alone choose `node_type`, `tags`, `section.kind`, or body
29
- content. Action/domain gates are decided from source evidence and the current
30
- schema, not from density metadata.