@xulthekl/team-flow 0.22.4

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 (405) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.agents/skills +1 -0
  3. package/.claude/always/phase-guard.md +3 -0
  4. package/.claude-plugin/marketplace.json +20 -0
  5. package/.claude-plugin/plugin.json +31 -0
  6. package/.codex-plugin/plugin.json +45 -0
  7. package/.codexignore +6 -0
  8. package/.cursor-plugin/marketplace.json +17 -0
  9. package/.cursor-plugin/plugin.json +31 -0
  10. package/.github/copilot-instructions.md +15 -0
  11. package/.github/dependabot.yml +10 -0
  12. package/.github/plugin/marketplace.json +42 -0
  13. package/.github/workflows/ci.yml +98 -0
  14. package/.github/workflows/hol-plugin-scanner.yml +17 -0
  15. package/.opencode/INSTALL.md +61 -0
  16. package/.opencode/plugins/team-flow.js +70 -0
  17. package/AGENTS.md +280 -0
  18. package/CHANGELOG.md +635 -0
  19. package/CONTRIBUTING.md +115 -0
  20. package/GEMINI.md +14 -0
  21. package/HANDOFF.md +219 -0
  22. package/INSTALL.md +810 -0
  23. package/LICENSE +21 -0
  24. package/README.md +185 -0
  25. package/SECURITY.md +37 -0
  26. package/agents/bug-investigator.md +180 -0
  27. package/agents/change-split-auditor.md +257 -0
  28. package/agents/code-reviewer.md +171 -0
  29. package/agents/cross-change-consistency-checker.md +215 -0
  30. package/agents/prd-completeness-reviewer.md +197 -0
  31. package/agents/prototype-builder.md +230 -0
  32. package/agents/prototype-env-scout.md +156 -0
  33. package/agents/prototype-reviewer.md +226 -0
  34. package/assets/icon.svg +6 -0
  35. package/dist/index.d.ts +13 -0
  36. package/dist/index.js +5 -0
  37. package/dist/parsing/change-parser.d.ts +12 -0
  38. package/dist/parsing/change-parser.js +54 -0
  39. package/dist/parsing/requirement-blocks.d.ts +31 -0
  40. package/dist/parsing/requirement-blocks.js +192 -0
  41. package/dist/schema/base.d.ts +7 -0
  42. package/dist/schema/base.js +1 -0
  43. package/dist/schema/change.d.ts +25 -0
  44. package/dist/schema/change.js +1 -0
  45. package/dist/schema/index.d.ts +3 -0
  46. package/dist/schema/index.js +1 -0
  47. package/dist/schema/spec.d.ts +11 -0
  48. package/dist/schema/spec.js +1 -0
  49. package/dist/validation/constants.d.ts +42 -0
  50. package/dist/validation/constants.js +42 -0
  51. package/dist/validation/tokenizer.d.ts +17 -0
  52. package/dist/validation/tokenizer.js +173 -0
  53. package/dist/validation/types.d.ts +40 -0
  54. package/dist/validation/types.js +1 -0
  55. package/dist/validation/validator.d.ts +21 -0
  56. package/dist/validation/validator.js +489 -0
  57. package/docs/README_en.md +358 -0
  58. package/docs/artifact-contract.md +96 -0
  59. package/docs/decision-points.md +88 -0
  60. package/docs/e2e-integration-design.md +207 -0
  61. package/docs/examples/README.md +25 -0
  62. package/docs/examples/add-dark-mode/README.md +13 -0
  63. package/docs/examples/add-dark-mode/design.md +49 -0
  64. package/docs/examples/add-dark-mode/execution-contract.md +56 -0
  65. package/docs/examples/add-dark-mode/proposal.md +46 -0
  66. package/docs/examples/add-dark-mode/specs/ui-theme/spec.md +35 -0
  67. package/docs/examples/add-dark-mode/tasks.md +26 -0
  68. package/docs/examples/refactor-auth-boundary/README.md +15 -0
  69. package/docs/examples/refactor-auth-boundary/design.md +41 -0
  70. package/docs/examples/refactor-auth-boundary/execution-contract.md +61 -0
  71. package/docs/examples/refactor-auth-boundary/proposal.md +47 -0
  72. package/docs/examples/refactor-auth-boundary/specs/auth-boundary/spec.md +45 -0
  73. package/docs/examples/refactor-auth-boundary/tasks.md +25 -0
  74. package/docs/plans/2026-07-07-fix-batch-design.md +68 -0
  75. package/docs/plans/2026-07-20-001-refactor-skill-collaboration-protocol-plan.md +128 -0
  76. package/docs/platform-matrix.md +45 -0
  77. package/docs/prototype-design-research.md +206 -0
  78. package/docs/release-checklist.md +96 -0
  79. package/docs/showcase.html +699 -0
  80. package/docs/skill-rename-v0.8.0.md +49 -0
  81. package/docs/state-machine.md +162 -0
  82. package/gemini-extension.json +6 -0
  83. package/hooks/hooks-cursor.json +8 -0
  84. package/hooks/hooks.json +26 -0
  85. package/hooks/pre-tool-use-guard +116 -0
  86. package/hooks/session-start +14 -0
  87. package/llms.txt +51 -0
  88. package/package.json +48 -0
  89. package/plugin.json +27 -0
  90. package/prd/v1/plan.md +443 -0
  91. package/prd/v1/prd.md +580 -0
  92. package/scripts/check-update.mjs +91 -0
  93. package/scripts/check-version-consistency.mjs +345 -0
  94. package/scripts/ensure-branch.mjs +71 -0
  95. package/scripts/get-config +31 -0
  96. package/scripts/guard/checks/artifacts-exist.mjs +36 -0
  97. package/scripts/guard/checks/contract-current.mjs +33 -0
  98. package/scripts/guard/checks/contract-fresh.mjs +17 -0
  99. package/scripts/guard/checks/dp-gate-passed.mjs +35 -0
  100. package/scripts/guard/checks/dp3-approved.mjs +22 -0
  101. package/scripts/guard/checks/execution-plan-ready.mjs +40 -0
  102. package/scripts/guard/checks/execution-reviews-passed.mjs +36 -0
  103. package/scripts/guard/checks/schema-valid.mjs +63 -0
  104. package/scripts/guard/checks/specs-merged.mjs +51 -0
  105. package/scripts/guard/checks/tasks-complete.mjs +31 -0
  106. package/scripts/guard/checks/tests-passing.mjs +31 -0
  107. package/scripts/guard/design-token-guard.mjs +237 -0
  108. package/scripts/guard/guard.mjs +205 -0
  109. package/scripts/infer-workflow.mjs +136 -0
  110. package/scripts/install-amazon-q.mjs +9 -0
  111. package/scripts/install-cline.mjs +9 -0
  112. package/scripts/install-continue.mjs +9 -0
  113. package/scripts/install-cursor.mjs +265 -0
  114. package/scripts/install-git-hooks.mjs +82 -0
  115. package/scripts/install-kiro.mjs +9 -0
  116. package/scripts/install-pi.mjs +9 -0
  117. package/scripts/install-qoder.mjs +9 -0
  118. package/scripts/install-qwen.mjs +9 -0
  119. package/scripts/install-roocode.mjs +9 -0
  120. package/scripts/install-windsurf.mjs +9 -0
  121. package/scripts/install-zcode.mjs +265 -0
  122. package/scripts/lib/cmd-audit.mjs +127 -0
  123. package/scripts/lib/cmd-checkpoint.mjs +118 -0
  124. package/scripts/lib/cmd-config.mjs +88 -0
  125. package/scripts/lib/cmd-doctor.mjs +267 -0
  126. package/scripts/lib/cmd-execution.mjs +206 -0
  127. package/scripts/lib/cmd-handoff.mjs +94 -0
  128. package/scripts/lib/cmd-inject.mjs +310 -0
  129. package/scripts/lib/cmd-install-amazon-q.mjs +11 -0
  130. package/scripts/lib/cmd-install-cline.mjs +11 -0
  131. package/scripts/lib/cmd-install-continue.mjs +11 -0
  132. package/scripts/lib/cmd-install-cursor.mjs +14 -0
  133. package/scripts/lib/cmd-install-kiro.mjs +11 -0
  134. package/scripts/lib/cmd-install-pi.mjs +11 -0
  135. package/scripts/lib/cmd-install-qoder.mjs +11 -0
  136. package/scripts/lib/cmd-install-qwen.mjs +11 -0
  137. package/scripts/lib/cmd-install-roocode.mjs +11 -0
  138. package/scripts/lib/cmd-install-windsurf.mjs +11 -0
  139. package/scripts/lib/cmd-install-workbuddy.mjs +359 -0
  140. package/scripts/lib/cmd-install-zcode.mjs +14 -0
  141. package/scripts/lib/cmd-isolate.mjs +37 -0
  142. package/scripts/lib/cmd-list.mjs +71 -0
  143. package/scripts/lib/cmd-runtime.mjs +85 -0
  144. package/scripts/lib/cmd-solutions.mjs +71 -0
  145. package/scripts/lib/cmd-state.mjs +231 -0
  146. package/scripts/lib/cmd-sync.mjs +102 -0
  147. package/scripts/lib/cmd-validate.mjs +105 -0
  148. package/scripts/lib/cmd-version.mjs +148 -0
  149. package/scripts/lib/config-loader.mjs +107 -0
  150. package/scripts/lib/execution-plan.mjs +492 -0
  151. package/scripts/lib/execution-recommendation.mjs +221 -0
  152. package/scripts/lib/hash.mjs +74 -0
  153. package/scripts/lib/install.mjs +267 -0
  154. package/scripts/lib/platform-runtime-inventory.mjs +27 -0
  155. package/scripts/lib/platforms.mjs +165 -0
  156. package/scripts/lib/prototype-sync.mjs +192 -0
  157. package/scripts/lib/sdd-overlay.mjs +262 -0
  158. package/scripts/lib/shell-quote.mjs +4 -0
  159. package/scripts/lib/solutions-capture.mjs +102 -0
  160. package/scripts/lib/solutions-index-gen.mjs +112 -0
  161. package/scripts/lib/solutions-inject.mjs +77 -0
  162. package/scripts/lib/solutions-promote.mjs +145 -0
  163. package/scripts/lib/spec-paths.mjs +85 -0
  164. package/scripts/lib/state-loader.mjs +154 -0
  165. package/scripts/lint/lint-skills.mjs +149 -0
  166. package/scripts/lint/rules/behavior-consistency.mjs +56 -0
  167. package/scripts/lint/rules/dp-trigger-points.mjs +60 -0
  168. package/scripts/lint/rules/exception-handling.mjs +59 -0
  169. package/scripts/lint/rules/no-contradictory-instructions.mjs +67 -0
  170. package/scripts/lint/rules/no-redundant-checks.mjs +50 -0
  171. package/scripts/lint/rules/token-rules.mjs +122 -0
  172. package/scripts/review-package +44 -0
  173. package/scripts/task-brief +40 -0
  174. package/scripts/team-flow.mjs +164 -0
  175. package/scripts/token-baseline.mjs +158 -0
  176. package/scripts/validate-artifacts +96 -0
  177. package/scripts/verify-marketplace-release.mjs +59 -0
  178. package/skills/architecture-design/SKILL.md +140 -0
  179. package/skills/architecture-design/chapters/ch01-4a-domains.md +27 -0
  180. package/skills/architecture-design/chapters/ch02-change-cascade.md +27 -0
  181. package/skills/architecture-design/chapters/ch03-architecture-outputs.md +25 -0
  182. package/skills/architecture-design/chapters/ch04-entity-to-aggregate.md +27 -0
  183. package/skills/architecture-design/chapters/ch05-cqrs.md +32 -0
  184. package/skills/architecture-design/chapters/ch06-integration.md +54 -0
  185. package/skills/architecture-design/cheatsheet.md +51 -0
  186. package/skills/architecture-design/glossary.md +23 -0
  187. package/skills/architecture-design/patterns.md +32 -0
  188. package/skills/bug-investigator/SKILL.md +77 -0
  189. package/skills/build-executor/SKILL.md +163 -0
  190. package/skills/build-executor/implementer-prompt.md +162 -0
  191. package/skills/build-executor/references/execution-modes.md +86 -0
  192. package/skills/build-executor/task-reviewer-prompt.md +195 -0
  193. package/skills/ce-brainstorm/SKILL.md +415 -0
  194. package/skills/ce-brainstorm/references/agents/slack-researcher.md +127 -0
  195. package/skills/ce-brainstorm/references/blindspot-pass.md +70 -0
  196. package/skills/ce-brainstorm/references/brainstorm-sections.md +285 -0
  197. package/skills/ce-brainstorm/references/handoff.md +168 -0
  198. package/skills/ce-brainstorm/references/html-rendering.md +634 -0
  199. package/skills/ce-brainstorm/references/markdown-rendering.md +241 -0
  200. package/skills/ce-brainstorm/references/model-tiers.md +9 -0
  201. package/skills/ce-brainstorm/references/prd-mapping.md +71 -0
  202. package/skills/ce-brainstorm/references/product-pressure-test.md +42 -0
  203. package/skills/ce-brainstorm/references/reasoning-elevation.md +63 -0
  204. package/skills/ce-brainstorm/references/settled-decisions.md +45 -0
  205. package/skills/ce-brainstorm/references/synthesis-summary.md +282 -0
  206. package/skills/ce-brainstorm/references/universal-brainstorming.md +73 -0
  207. package/skills/ce-brainstorm/references/verdict-routing.md +26 -0
  208. package/skills/ce-brainstorm/references/visual-probes.md +158 -0
  209. package/skills/ce-brainstorm/scripts/visual-probe-server.js +418 -0
  210. package/skills/ce-compound/SKILL.md +114 -0
  211. package/skills/ce-compound/assets/resolution-template.md +94 -0
  212. package/skills/ce-compound/references/agents/best-practices-researcher.md +115 -0
  213. package/skills/ce-compound/references/agents/data-integrity-guardian.md +68 -0
  214. package/skills/ce-compound/references/agents/framework-docs-researcher.md +93 -0
  215. package/skills/ce-compound/references/agents/pattern-recognition-specialist.md +55 -0
  216. package/skills/ce-compound/references/agents/performance-oracle.md +108 -0
  217. package/skills/ce-compound/references/agents/security-sentinel.md +91 -0
  218. package/skills/ce-compound/references/agents/session-historian.md +83 -0
  219. package/skills/ce-compound/references/concepts-vocabulary.md +78 -0
  220. package/skills/ce-compound/references/full-mode-workflow.md +413 -0
  221. package/skills/ce-compound/references/grounding-validation.md +84 -0
  222. package/skills/ce-compound/references/lightweight-mode.md +53 -0
  223. package/skills/ce-compound/references/output-standards.md +182 -0
  224. package/skills/ce-compound/references/promotion-rules.md +38 -0
  225. package/skills/ce-compound/references/schema.yaml +231 -0
  226. package/skills/ce-compound/references/three-tier-index.md +55 -0
  227. package/skills/ce-compound/references/v0.5-upgrade.md +32 -0
  228. package/skills/ce-compound/references/write-flow.md +36 -0
  229. package/skills/ce-compound/references/yaml-schema.md +118 -0
  230. package/skills/ce-compound/scripts/session-history/discover-sessions.sh +130 -0
  231. package/skills/ce-compound/scripts/session-history/extract-errors.py +254 -0
  232. package/skills/ce-compound/scripts/session-history/extract-metadata.py +456 -0
  233. package/skills/ce-compound/scripts/session-history/extract-skeleton.py +575 -0
  234. package/skills/ce-compound/scripts/validate-doc-claims.py +346 -0
  235. package/skills/ce-compound/scripts/validate-frontmatter.py +137 -0
  236. package/skills/ce-ideate/SKILL.md +402 -0
  237. package/skills/ce-ideate/references/agents/issue-intelligence-analyst.md +200 -0
  238. package/skills/ce-ideate/references/agents/learnings-researcher.md +247 -0
  239. package/skills/ce-ideate/references/agents/slack-researcher.md +127 -0
  240. package/skills/ce-ideate/references/agents/web-researcher.md +121 -0
  241. package/skills/ce-ideate/references/divergent-ideation.md +89 -0
  242. package/skills/ce-ideate/references/html-rendering.md +634 -0
  243. package/skills/ce-ideate/references/ideation-sections.md +191 -0
  244. package/skills/ce-ideate/references/markdown-rendering.md +238 -0
  245. package/skills/ce-ideate/references/post-ideation-workflow.md +167 -0
  246. package/skills/ce-ideate/references/universal-ideation.md +107 -0
  247. package/skills/ce-ideate/references/web-research-cache.md +56 -0
  248. package/skills/ce-plan/SKILL.md +137 -0
  249. package/skills/ce-plan/references/agents/agent-native-planning-strategist.md +62 -0
  250. package/skills/ce-plan/references/agents/architecture-strategist.md +46 -0
  251. package/skills/ce-plan/references/agents/best-practices-researcher.md +114 -0
  252. package/skills/ce-plan/references/agents/data-integrity-guardian.md +68 -0
  253. package/skills/ce-plan/references/agents/data-migration-reviewer.md +103 -0
  254. package/skills/ce-plan/references/agents/deployment-verification-agent.md +157 -0
  255. package/skills/ce-plan/references/agents/framework-docs-researcher.md +93 -0
  256. package/skills/ce-plan/references/agents/git-history-analyzer.md +40 -0
  257. package/skills/ce-plan/references/agents/learnings-researcher.md +247 -0
  258. package/skills/ce-plan/references/agents/pattern-recognition-specialist.md +55 -0
  259. package/skills/ce-plan/references/agents/performance-oracle.md +108 -0
  260. package/skills/ce-plan/references/agents/repo-research-analyst.md +258 -0
  261. package/skills/ce-plan/references/agents/security-sentinel.md +91 -0
  262. package/skills/ce-plan/references/agents/slack-researcher.md +127 -0
  263. package/skills/ce-plan/references/agents/spec-flow-analyzer.md +80 -0
  264. package/skills/ce-plan/references/agents/web-researcher.md +121 -0
  265. package/skills/ce-plan/references/approach-altitude.md +55 -0
  266. package/skills/ce-plan/references/change-splitting.md +65 -0
  267. package/skills/ce-plan/references/completion-contract.md +33 -0
  268. package/skills/ce-plan/references/core-principles.md +40 -0
  269. package/skills/ce-plan/references/deepening-workflow.md +263 -0
  270. package/skills/ce-plan/references/dependency-graph.md +36 -0
  271. package/skills/ce-plan/references/html-rendering.md +634 -0
  272. package/skills/ce-plan/references/intake-routing.md +189 -0
  273. package/skills/ce-plan/references/markdown-rendering.md +238 -0
  274. package/skills/ce-plan/references/plan-handoff.md +150 -0
  275. package/skills/ce-plan/references/plan-sections.md +427 -0
  276. package/skills/ce-plan/references/plan-structure.md +120 -0
  277. package/skills/ce-plan/references/planning-modes.md +69 -0
  278. package/skills/ce-plan/references/reasoning-elevation.md +63 -0
  279. package/skills/ce-plan/references/research-workflow.md +165 -0
  280. package/skills/ce-plan/references/review-and-write.md +127 -0
  281. package/skills/ce-plan/references/settled-decisions.md +45 -0
  282. package/skills/ce-plan/references/synthesis-summary.md +418 -0
  283. package/skills/ce-plan/references/universal-planning.md +168 -0
  284. package/skills/ce-proof/SKILL.md +346 -0
  285. package/skills/ce-strategy/SKILL.md +97 -0
  286. package/skills/ce-strategy/references/interview.md +143 -0
  287. package/skills/ce-strategy/references/strategy-template.md +89 -0
  288. package/skills/code-reviewer/SKILL.md +84 -0
  289. package/skills/code-reviewer/code-reviewer-prompt.md +195 -0
  290. package/skills/contract-builder/SKILL.md +72 -0
  291. package/skills/design-system/SKILL.md +75 -0
  292. package/skills/design-system/references/agents/design-system-architect.md +138 -0
  293. package/skills/design-system/references/creation-flow.md +170 -0
  294. package/skills/design-system/references/preview-template.html +319 -0
  295. package/skills/design-system/references/token-derivation.md +115 -0
  296. package/skills/design-system/references/variant-schema.md +60 -0
  297. package/skills/e2e/SKILL.md +56 -0
  298. package/skills/e2e/references/test-verifier.md +40 -0
  299. package/skills/need-explorer/SKILL.md +79 -0
  300. package/skills/prototype/SKILL.md +98 -0
  301. package/skills/prototype/references/agents/design-system-architect.md +122 -0
  302. package/skills/prototype/references/checklist.md +82 -0
  303. package/skills/prototype/references/craft/accessibility-baseline.md +71 -0
  304. package/skills/prototype/references/craft/anti-ai-slop.md +87 -0
  305. package/skills/prototype/references/craft/laws-of-ux.md +60 -0
  306. package/skills/prototype/references/craft/state-coverage.md +81 -0
  307. package/skills/prototype/references/craft/typography-hierarchy.md +50 -0
  308. package/skills/prototype/references/layouts.md +223 -0
  309. package/skills/prototype/references/orchestration-flow.md +101 -0
  310. package/skills/prototype/references/prototype-scaffold/assets/design-tokens.css +19 -0
  311. package/skills/prototype/references/prototype-scaffold/components/button.html +3 -0
  312. package/skills/prototype/references/prototype-scaffold/design-system.md +7 -0
  313. package/skills/prototype/references/prototype-scaffold/flow.md +11 -0
  314. package/skills/prototype/references/prototype-scaffold/index.html +20 -0
  315. package/skills/prototype/references/prototype-scaffold/pages/index.html +11 -0
  316. package/skills/prototype/references/template.html +396 -0
  317. package/skills/release-archivist/SKILL.md +166 -0
  318. package/skills/release-archivist/references/closing-procedures.md +81 -0
  319. package/skills/session-handoff/SKILL.md +110 -0
  320. package/skills/session-handoff/references/context-extraction.md +70 -0
  321. package/skills/session-handoff/references/handoff-template.md +90 -0
  322. package/skills/session-handoff/references/skill-recommendation.md +43 -0
  323. package/skills/spec-merger/SKILL.md +66 -0
  324. package/skills/spec-writer/SKILL.md +149 -0
  325. package/skills/workflow-bootstrap/SKILL.md +148 -0
  326. package/skills/workflow-bootstrap/references/agents/codebase-recon-analyst.md +121 -0
  327. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +80 -0
  328. package/skills/workflow-bootstrap/scripts/recon-probe.sh +328 -0
  329. package/skills/workflow-feedback/SKILL.md +120 -0
  330. package/skills/workflow-feedback/references/category-guide.md +121 -0
  331. package/skills/workflow-feedback/references/feedback-template.md +73 -0
  332. package/skills/workflow-feedback/references/review-mode.md +92 -0
  333. package/skills/workflow-orchestrator/SKILL.md +94 -0
  334. package/skills/workflow-orchestrator/references/feedback-loops.md +56 -0
  335. package/skills/workflow-orchestrator/references/s1-path-router.md +81 -0
  336. package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +96 -0
  337. package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +50 -0
  338. package/skills/workflow-orchestrator/references/s4-split-validate.md +108 -0
  339. package/skills/workflow-orchestrator/references/s5-monitoring.md +61 -0
  340. package/skills/workflow-orchestrator/references/state-model.md +185 -0
  341. package/skills/workflow-start/SKILL.md +147 -0
  342. package/skills/workflow-start/references/routing-rules.md +155 -0
  343. package/src/index.ts +16 -0
  344. package/src/parsing/change-parser.ts +79 -0
  345. package/src/parsing/requirement-blocks.ts +244 -0
  346. package/src/schema/base.ts +8 -0
  347. package/src/schema/change.ts +29 -0
  348. package/src/schema/index.ts +3 -0
  349. package/src/schema/spec.ts +12 -0
  350. package/src/validation/constants.ts +53 -0
  351. package/src/validation/tokenizer.ts +180 -0
  352. package/src/validation/types.ts +47 -0
  353. package/src/validation/validator.ts +552 -0
  354. package/templates/abandonment-summary.md +29 -0
  355. package/templates/design.md +37 -0
  356. package/templates/execution-contract.md +99 -0
  357. package/templates/plan.md +86 -0
  358. package/templates/prd.md +468 -0
  359. package/templates/proposal.md +37 -0
  360. package/templates/spec.md +31 -0
  361. package/templates/tasks.md +47 -0
  362. package/tests/e2e.test.mjs +266 -0
  363. package/tests/lib/cmd-audit.test.mjs +202 -0
  364. package/tests/lib/cmd-checkpoint.test.mjs +98 -0
  365. package/tests/lib/cmd-config.test.mjs +101 -0
  366. package/tests/lib/cmd-doctor.test.mjs +450 -0
  367. package/tests/lib/cmd-execution.test.mjs +647 -0
  368. package/tests/lib/cmd-handoff.test.mjs +137 -0
  369. package/tests/lib/cmd-inject.test.mjs +218 -0
  370. package/tests/lib/cmd-install-workbuddy.test.mjs +113 -0
  371. package/tests/lib/cmd-install-zcode.test.mjs +42 -0
  372. package/tests/lib/cmd-isolate.test.mjs +68 -0
  373. package/tests/lib/cmd-list.test.mjs +127 -0
  374. package/tests/lib/cmd-runtime.test.mjs +83 -0
  375. package/tests/lib/cmd-state-missing.test.mjs +65 -0
  376. package/tests/lib/cmd-state.test.mjs +365 -0
  377. package/tests/lib/cmd-sync-paths.test.mjs +84 -0
  378. package/tests/lib/cmd-validate-paths.test.mjs +90 -0
  379. package/tests/lib/config-loader.test.mjs +175 -0
  380. package/tests/lib/ensure-branch.test.mjs +59 -0
  381. package/tests/lib/execution-control-plane.test.mjs +168 -0
  382. package/tests/lib/execution-plan.test.mjs +474 -0
  383. package/tests/lib/guard-specs-merged.test.mjs +108 -0
  384. package/tests/lib/guard-tests-passing.test.mjs +112 -0
  385. package/tests/lib/guard-transitions.test.mjs +262 -0
  386. package/tests/lib/guard.test.mjs +611 -0
  387. package/tests/lib/hash.test.mjs +138 -0
  388. package/tests/lib/infer-workflow.test.mjs +161 -0
  389. package/tests/lib/install-git-hooks.test.mjs +20 -0
  390. package/tests/lib/marketplace-release-docs.test.mjs +31 -0
  391. package/tests/lib/minimality-discipline.test.mjs +37 -0
  392. package/tests/lib/model-profiles-docs.test.mjs +33 -0
  393. package/tests/lib/node20-compatibility.test.mjs +73 -0
  394. package/tests/lib/node20-test-entry.test.mjs +17 -0
  395. package/tests/lib/platform-runtime-distribution.test.mjs +150 -0
  396. package/tests/lib/raw-mode-smoke.test.mjs +42 -0
  397. package/tests/lib/sdd-overlay.test.mjs +118 -0
  398. package/tests/lib/spec-paths.test.mjs +80 -0
  399. package/tests/lib/state-loader.test.mjs +251 -0
  400. package/tests/lib/token-baseline.test.mjs +72 -0
  401. package/tests/lib/token-rules.test.mjs +94 -0
  402. package/tests/lib/verify-marketplace-release.test.mjs +128 -0
  403. package/tests/tsconfig.json +12 -0
  404. package/token-baseline.json +95 -0
  405. package/tsconfig.json +14 -0
@@ -0,0 +1,418 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync, spawn } from "node:child_process"
3
+ import fs from "node:fs"
4
+ import http from "node:http"
5
+ import path from "node:path"
6
+ import { fileURLToPath } from "node:url"
7
+
8
+ const scriptPath = fileURLToPath(import.meta.url)
9
+ const DEFAULT_HOST = "127.0.0.1"
10
+ const DEFAULT_URL_HOST = "localhost"
11
+ const IDLE_TIMEOUT_MS = Number(process.env.CE_VISUAL_PROBE_IDLE_TIMEOUT_MS) || 30 * 60 * 1000
12
+ const LIFECYCLE_CHECK_MS = Number(process.env.CE_VISUAL_PROBE_LIFECYCLE_CHECK_MS) || 60 * 1000
13
+
14
+ function usage() {
15
+ return [
16
+ "Usage:",
17
+ " node visual-probe-server.js start --root <dir> [--host 127.0.0.1] [--port 0] [--foreground] [--owner-pid <pid>]",
18
+ " node visual-probe-server.js stop --root <dir>",
19
+ " node visual-probe-server.js status --root <dir>",
20
+ ].join("\n")
21
+ }
22
+
23
+ function parseArgs(argv) {
24
+ const command = argv[2]
25
+ const options = {
26
+ command,
27
+ host: DEFAULT_HOST,
28
+ port: 0,
29
+ foreground: false,
30
+ }
31
+
32
+ for (let i = 3; i < argv.length; i++) {
33
+ const arg = argv[i]
34
+ if (arg === "--root") {
35
+ options.root = argv[++i]
36
+ } else if (arg === "--host") {
37
+ options.host = argv[++i]
38
+ } else if (arg === "--port") {
39
+ options.port = Number(argv[++i])
40
+ } else if (arg === "--foreground") {
41
+ options.foreground = true
42
+ } else if (arg === "--owner-pid") {
43
+ options.ownerPid = Number(argv[++i])
44
+ } else {
45
+ throw new Error(`Unknown argument: ${arg}`)
46
+ }
47
+ }
48
+
49
+ if (!["start", "serve", "stop", "status"].includes(command)) {
50
+ throw new Error(usage())
51
+ }
52
+ if (!options.root) {
53
+ throw new Error("--root is required")
54
+ }
55
+ if (!Number.isInteger(options.port) || options.port < 0 || options.port > 65535) {
56
+ throw new Error("--port must be an integer from 0 to 65535")
57
+ }
58
+ if (options.ownerPid !== undefined && (!Number.isInteger(options.ownerPid) || options.ownerPid <= 1)) {
59
+ throw new Error("--owner-pid must be an integer greater than 1")
60
+ }
61
+
62
+ options.root = path.resolve(options.root)
63
+ options.screensDir = path.join(options.root, "screens")
64
+ options.stateDir = path.join(options.root, "state")
65
+ options.pidFile = path.join(options.stateDir, "server.pid")
66
+ options.infoFile = path.join(options.stateDir, "display-info.json")
67
+ options.logFile = path.join(options.stateDir, "server.log")
68
+ return options
69
+ }
70
+
71
+ function ensureDirs(options) {
72
+ fs.mkdirSync(options.screensDir, { recursive: true })
73
+ fs.mkdirSync(options.stateDir, { recursive: true })
74
+ }
75
+
76
+ function jsonOut(value) {
77
+ process.stdout.write(`${JSON.stringify(value)}\n`)
78
+ }
79
+
80
+ function readJson(filePath) {
81
+ return JSON.parse(fs.readFileSync(filePath, "utf8"))
82
+ }
83
+
84
+ function processAlive(pid) {
85
+ if (!pid || !Number.isInteger(pid)) return false
86
+ try {
87
+ process.kill(pid, 0)
88
+ return true
89
+ } catch (error) {
90
+ return error?.code === "EPERM"
91
+ }
92
+ }
93
+
94
+ function processArgs(pid) {
95
+ try {
96
+ return execFileSync("ps", ["-p", String(pid), "-o", "args="], {
97
+ encoding: "utf8",
98
+ stdio: ["ignore", "pipe", "ignore"],
99
+ }).trim()
100
+ } catch {
101
+ return null
102
+ }
103
+ }
104
+
105
+ function ownsServerProcess(options, pid) {
106
+ const args = processArgs(pid)
107
+ // Process-command inspection is best-effort; when unavailable, fall back to
108
+ // PID-file behavior so stop still works on platforms without a compatible ps.
109
+ if (args === null) return true
110
+ return args.includes(scriptPath) && args.includes("serve") && args.includes(options.root)
111
+ }
112
+
113
+ function resolveOwnerPid() {
114
+ const parentPid = process.ppid
115
+ if (!parentPid || parentPid <= 1) return null
116
+ try {
117
+ const grandparent = Number(execFileSync("ps", ["-o", "ppid=", "-p", String(parentPid)], {
118
+ encoding: "utf8",
119
+ stdio: ["ignore", "pipe", "ignore"],
120
+ }).trim())
121
+ if (Number.isInteger(grandparent) && grandparent > 1) return grandparent
122
+ } catch {
123
+ // Fall back to the direct parent when grandparent lookup is unavailable.
124
+ }
125
+ return parentPid
126
+ }
127
+
128
+ function readPid(options) {
129
+ if (!fs.existsSync(options.pidFile)) return null
130
+ const pid = Number(fs.readFileSync(options.pidFile, "utf8").trim())
131
+ return Number.isInteger(pid) ? pid : null
132
+ }
133
+
134
+ function getRunningInfo(options) {
135
+ const pid = readPid(options)
136
+ if (!processAlive(pid)) return null
137
+ if (!ownsServerProcess(options, pid)) return null
138
+ if (!fs.existsSync(options.infoFile)) return null
139
+ return readJson(options.infoFile)
140
+ }
141
+
142
+ function newestScreen(options) {
143
+ if (!fs.existsSync(options.screensDir)) return null
144
+ const files = fs.readdirSync(options.screensDir)
145
+ .filter((file) => file.endsWith(".html"))
146
+ .map((file) => {
147
+ const filePath = path.join(options.screensDir, file)
148
+ return { filePath, mtimeMs: fs.statSync(filePath).mtimeMs }
149
+ })
150
+ .sort((a, b) => b.mtimeMs - a.mtimeMs)
151
+ return files[0]?.filePath ?? null
152
+ }
153
+
154
+ function isFullDocument(html) {
155
+ const trimmed = html.trimStart().toLowerCase()
156
+ return trimmed.startsWith("<!doctype") || trimmed.startsWith("<html")
157
+ }
158
+
159
+ function screenVersion(options) {
160
+ const screen = newestScreen(options)
161
+ if (!screen) return { screen: null, mtimeMs: 0 }
162
+ return {
163
+ screen: path.basename(screen),
164
+ mtimeMs: fs.statSync(screen).mtimeMs,
165
+ }
166
+ }
167
+
168
+ function refreshScript(options) {
169
+ const initialVersion = JSON.stringify(screenVersion(options))
170
+ return `<script>
171
+ (function(){
172
+ var currentVersion = ${initialVersion};
173
+ function key(version) {
174
+ return String(version && version.screen) + ":" + String(version && version.mtimeMs);
175
+ }
176
+ async function checkForVisualProbeUpdate() {
177
+ try {
178
+ var response = await fetch("/version", { cache: "no-store" });
179
+ if (!response.ok) return;
180
+ var nextVersion = await response.json();
181
+ if (key(nextVersion) !== key(currentVersion)) {
182
+ window.location.reload();
183
+ }
184
+ } catch (error) {
185
+ // Keep the current sketch visible if the transient version check fails.
186
+ }
187
+ }
188
+ setInterval(checkForVisualProbeUpdate, 1000);
189
+ })();
190
+ </script>`
191
+ }
192
+
193
+ function wrapFragment(options, content) {
194
+ return `<!doctype html>
195
+ <html>
196
+ <head>
197
+ <meta charset="utf-8">
198
+ <meta name="viewport" content="width=device-width, initial-scale=1">
199
+ <title>CE Brainstorm Visual Probe</title>
200
+ <style>
201
+ body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; background: #f7f7f8; color: #1f2328; }
202
+ header { padding: 10px 18px; border-bottom: 1px solid #d8dee4; background: #fff; color: #57606a; font-size: 13px; }
203
+ main { padding: 24px; }
204
+ </style>
205
+ </head>
206
+ <body>
207
+ <header>CE Brainstorm Visual Probe - directional sketch, reply in chat</header>
208
+ <main>${content}</main>
209
+ ${refreshScript(options)}
210
+ </body>
211
+ </html>`
212
+ }
213
+
214
+ function injectRefresh(options, html) {
215
+ if (html.includes("</body>")) {
216
+ return html.replace("</body>", `${refreshScript(options)}\n</body>`)
217
+ }
218
+ return `${html}\n${refreshScript(options)}`
219
+ }
220
+
221
+ function renderPage(options) {
222
+ const screen = newestScreen(options)
223
+ if (!screen) {
224
+ return wrapFragment(options, "<h1>Waiting for a visual probe...</h1><p>The agent will update this page when a sketch is ready.</p>")
225
+ }
226
+ const html = fs.readFileSync(screen, "utf8")
227
+ return isFullDocument(html) ? injectRefresh(options, html) : wrapFragment(options, html)
228
+ }
229
+
230
+ function safeFileResponse(options, req, res) {
231
+ const name = decodeURIComponent(req.url.slice("/files/".length))
232
+ const filePath = path.join(options.screensDir, path.basename(name))
233
+ if (!fs.existsSync(filePath)) {
234
+ res.writeHead(404)
235
+ res.end("Not found")
236
+ return
237
+ }
238
+ res.writeHead(200, { "Content-Type": contentType(filePath) })
239
+ res.end(fs.readFileSync(filePath))
240
+ }
241
+
242
+ function contentType(filePath) {
243
+ const ext = path.extname(filePath).toLowerCase()
244
+ if (ext === ".svg") return "image/svg+xml"
245
+ if (ext === ".png") return "image/png"
246
+ if (ext === ".jpg" || ext === ".jpeg") return "image/jpeg"
247
+ if (ext === ".gif") return "image/gif"
248
+ if (ext === ".html") return "text/html; charset=utf-8"
249
+ if (ext === ".css") return "text/css; charset=utf-8"
250
+ if (ext === ".js") return "text/javascript; charset=utf-8"
251
+ return "application/octet-stream"
252
+ }
253
+
254
+ async function start(options) {
255
+ ensureDirs(options)
256
+ options.ownerPid = options.ownerPid ?? resolveOwnerPid()
257
+ const running = getRunningInfo(options)
258
+ if (running) {
259
+ jsonOut({ ...running, status: "running" })
260
+ return
261
+ }
262
+
263
+ fs.rmSync(options.pidFile, { force: true })
264
+ fs.rmSync(options.infoFile, { force: true })
265
+
266
+ if (options.foreground) {
267
+ await serve(options)
268
+ return
269
+ }
270
+
271
+ const logFd = fs.openSync(options.logFile, "a")
272
+ const child = spawn(process.execPath, [
273
+ scriptPath,
274
+ "serve",
275
+ "--root",
276
+ options.root,
277
+ "--host",
278
+ options.host,
279
+ "--port",
280
+ String(options.port),
281
+ ...(options.ownerPid ? ["--owner-pid", String(options.ownerPid)] : []),
282
+ ], {
283
+ detached: true,
284
+ stdio: ["ignore", logFd, logFd],
285
+ })
286
+ child.unref()
287
+ fs.closeSync(logFd)
288
+
289
+ const started = await waitForInfo(options, child.pid)
290
+ if (!started) {
291
+ throw new Error(`Server failed to start. See ${options.logFile}`)
292
+ }
293
+ jsonOut({ ...started, status: "started" })
294
+ }
295
+
296
+ async function waitForInfo(options, pid) {
297
+ for (let i = 0; i < 100; i++) {
298
+ if (fs.existsSync(options.infoFile)) return readJson(options.infoFile)
299
+ if (pid && !processAlive(pid)) return null
300
+ await new Promise((resolve) => setTimeout(resolve, 50))
301
+ }
302
+ return null
303
+ }
304
+
305
+ async function serve(options) {
306
+ ensureDirs(options)
307
+
308
+ let lastActivity = Date.now()
309
+ const touch = () => {
310
+ lastActivity = Date.now()
311
+ }
312
+
313
+ const server = http.createServer((req, res) => {
314
+ if (req.method === "GET" && req.url === "/") {
315
+ touch()
316
+ res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" })
317
+ res.end(renderPage(options))
318
+ return
319
+ }
320
+ if (req.method === "GET" && req.url === "/version") {
321
+ res.writeHead(200, {
322
+ "Content-Type": "application/json; charset=utf-8",
323
+ "Cache-Control": "no-store",
324
+ })
325
+ res.end(`${JSON.stringify(screenVersion(options))}\n`)
326
+ return
327
+ }
328
+ if (req.method === "GET" && req.url.startsWith("/files/")) {
329
+ touch()
330
+ safeFileResponse(options, req, res)
331
+ return
332
+ }
333
+ res.writeHead(404)
334
+ res.end("Not found")
335
+ })
336
+
337
+ server.listen(options.port, options.host, () => {
338
+ const address = server.address()
339
+ const port = typeof address === "object" && address ? address.port : options.port
340
+ const info = {
341
+ status: "running",
342
+ root: options.root,
343
+ host: options.host,
344
+ port,
345
+ url: `http://${DEFAULT_URL_HOST}:${port}`,
346
+ screen_dir: options.screensDir,
347
+ state_dir: options.stateDir,
348
+ pid: process.pid,
349
+ owner_pid: options.ownerPid ?? null,
350
+ }
351
+ fs.writeFileSync(options.pidFile, `${process.pid}\n`)
352
+ fs.writeFileSync(options.infoFile, `${JSON.stringify(info, null, 2)}\n`)
353
+ console.log(JSON.stringify(info))
354
+ })
355
+
356
+ const idleTimer = setInterval(() => {
357
+ if (options.ownerPid && !processAlive(options.ownerPid)) {
358
+ server.close(() => process.exit(0))
359
+ } else if (Date.now() - lastActivity > IDLE_TIMEOUT_MS) {
360
+ server.close(() => process.exit(0))
361
+ }
362
+ }, LIFECYCLE_CHECK_MS)
363
+ idleTimer.unref()
364
+ }
365
+
366
+ async function stop(options) {
367
+ const pid = readPid(options)
368
+ if (!processAlive(pid)) {
369
+ fs.rmSync(options.pidFile, { force: true })
370
+ jsonOut({ status: "stopped", root: options.root })
371
+ return
372
+ }
373
+ if (!ownsServerProcess(options, pid)) {
374
+ fs.rmSync(options.pidFile, { force: true })
375
+ jsonOut({ status: "stopped", root: options.root })
376
+ return
377
+ }
378
+
379
+ process.kill(pid)
380
+ for (let i = 0; i < 20; i++) {
381
+ if (!processAlive(pid)) break
382
+ await new Promise((resolve) => setTimeout(resolve, 100))
383
+ }
384
+ if (processAlive(pid)) {
385
+ try {
386
+ process.kill(pid, "SIGKILL")
387
+ } catch {
388
+ // Process may have exited between the liveness check and kill.
389
+ }
390
+ }
391
+
392
+ fs.rmSync(options.pidFile, { force: true })
393
+ jsonOut({ status: "stopped", root: options.root })
394
+ }
395
+
396
+ function status(options) {
397
+ const info = getRunningInfo(options)
398
+ if (!info) {
399
+ jsonOut({ status: "stopped", root: options.root })
400
+ return
401
+ }
402
+ jsonOut({ ...info, status: "running" })
403
+ }
404
+
405
+ async function main() {
406
+ try {
407
+ const options = parseArgs(process.argv)
408
+ if (options.command === "start") await start(options)
409
+ else if (options.command === "serve") await serve(options)
410
+ else if (options.command === "stop") await stop(options)
411
+ else if (options.command === "status") status(options)
412
+ } catch (error) {
413
+ console.error(error.message)
414
+ process.exit(1)
415
+ }
416
+ }
417
+
418
+ await main()
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: ce-compound
3
+ description: Document a recently solved problem or durable project vocabulary in docs/solutions/ or CONCEPTS.md. Use when capturing a learning after work.
4
+ argument-hint: "[optional: brief context] [mode:headless] [depth:lightweight|full]"
5
+ ---
6
+
7
+ # /ce-compound
8
+
9
+ Coordinate multiple subagents working in parallel to document a recently solved problem.
10
+
11
+ See `references/v0.5-upgrade.md` for the v0.5 复利贯穿引擎 upgrade details and auto-invoke scenarios.
12
+
13
+ ## Purpose
14
+
15
+ Capture problem solutions while context is fresh, creating structured documentation in `docs/solutions/` with YAML frontmatter. Each documented solution compounds your team's knowledge — the first fix takes research; document it, and the next occurrence takes minutes. See `references/three-tier-index.md` for the three-tier index architecture. See `references/write-flow.md` for write flow and eviction rules. See `references/promotion-rules.md` for change→product promotion rules.
16
+
17
+ ## When to Use
18
+
19
+ ```bash
20
+ /ce-compound # Document the most recent fix
21
+ /ce-compound [brief context] # Provide additional context hint
22
+ /ce-compound mode:headless # Non-interactive run for automations
23
+ /ce-compound mode:headless depth:lightweight [context]
24
+ /ce-compound mode:headless depth:full [context]
25
+ ```
26
+
27
+ **One learning per run.** Run the skill once per learning, sequentially. Do not batch several learnings through one run.
28
+
29
+ If invoked to bootstrap `CONCEPTS.md` from scratch, redirect to `ce-compound-refresh` and exit.
30
+
31
+ ## Mode Detection
32
+
33
+ Enter headless mode when the arguments contain `mode:headless`, or the invocation makes non-interactive intent unmistakable. `depth:lightweight` routes to Lightweight Mode; `depth:full` or no depth token routes to Full Mode. Strip `mode:` and `depth:` tokens before treating the remainder as context.
34
+
35
+ | Mode | When | Behavior |
36
+ |------|------|----------|
37
+ | **Interactive** (default) | No headless signal | Auto-pick Full vs Lightweight; prompt for Discoverability Check consent; end with plain summary |
38
+ | **Headless** | `mode:headless` or clear non-interactive intent | No blocking questions; default to Full; report gaps without editing instruction files; structured terminal report |
39
+
40
+ **Mode selection (Full vs Lightweight) — decide it, don't ask it.** Default to Full. Choose Lightweight only under real context pressure. State the chosen mode in the first line of output.
41
+
42
+ ## Session Context
43
+
44
+ Before Phase 1, resolve: **Git branch** (`git rev-parse --abbrev-ref HEAD`) and **Repo root** (`git rev-parse --show-toplevel`). Non-zero exits are normal — skip branch filtering or fall back to working directory.
45
+
46
+ ## Support Files
47
+
48
+ Read on-demand at the step that needs them — do not bulk-load at skill start.
49
+
50
+ - `references/schema.yaml` — canonical frontmatter fields and enum values
51
+ - `references/yaml-schema.md` — category mapping from problem_type to directory
52
+ - `references/concepts-vocabulary.md` — CONCEPTS.md format and inclusion rules
53
+ - `references/grounding-validation.md` — flag adjudication rules and semantic validator prompt
54
+ - `references/agents/session-historian.md` — session-history synthesis prompt
55
+ - `references/v0.5-upgrade.md` — v0.5 upgrade table and auto-invoke scenarios
56
+ - `references/three-tier-index.md` — three-tier index architecture and file format
57
+ - `references/write-flow.md` — write flow, eviction rules, CLI commands
58
+ - `references/promotion-rules.md` — promotion check rules (change→product)
59
+ - `references/full-mode-workflow.md` — **Full Mode detailed phases (0.5→1→2→2.4→2.45→2.5→Discoverability→3)**
60
+ - `references/lightweight-mode.md` — **Lightweight Mode detailed steps**
61
+ - `references/output-standards.md` — success output formats, categories, common mistakes, specialized prompts
62
+ - `assets/resolution-template.md` — section structure for new docs
63
+ - `scripts/session-history/` — session discovery and extraction scripts
64
+ - `scripts/validate-frontmatter.py` — frontmatter parser-safety validator
65
+ - `scripts/validate-doc-claims.py` — mechanical claims validator
66
+
67
+ When spawning subagents, pass the relevant file contents into the task prompt.
68
+
69
+ ## Core Workflow
70
+
71
+ **Read `references/full-mode-workflow.md` (Full) or `references/lightweight-mode.md` (Lightweight) before executing.** The steps below are the imperative summary; the references contain the complete operational detail.
72
+
73
+ ### Full Mode
74
+
75
+ 1. **Phase 0.5 — Auto Memory Scan**: Check auto-memory block for relevant notes; pass as supplementary context.
76
+ 2. **Phase 1 — Research**: Generate run dir. Launch Context Analyzer, Solution Extractor, Related Docs Finder in parallel. Then run session-history probe (automatic, two-stage: cheap discovery always runs; expensive synthesis only on relevance hit). Each subagent writes to `{run_dir}/` artifact and returns only the path.
77
+ 3. **Phase 2 — Assembly & Write**: Wait for all Phase 1 inputs. Collect artifacts. Check overlap (high→update existing, moderate/low→create new). Incorporate session history. Assemble doc from `assets/resolution-template.md`. Validate YAML frontmatter. Write file. Run `scripts/validate-frontmatter.py`.
78
+ 4. **Phase 2.4 — Vocabulary Capture**: Read `references/concepts-vocabulary.md`. Scan for qualifying domain terms. Create/update `CONCEPTS.md` silently.
79
+ 5. **Phase 2.45 — Grounding Validation**: Run `scripts/validate-doc-claims.py` (mechanical). Dispatch semantic grounding validator subagent (Full only). Adjudicate flags per `references/grounding-validation.md`.
80
+ 6. **Phase 2.5 — Selective Refresh Check**: Decide whether to invoke/recommend `ce-compound-refresh` with narrow scope. Never a default follow-up.
81
+ 7. **Discoverability Check**: Assess whether instruction files surface `docs/solutions/` (and `CONCEPTS.md` if it exists). Interactive Full: edit after consent. Headless: report gap only.
82
+ 8. **Phase 3 — Optional Enhancement**: Dispatch specialized reviewers by problem type (skip in headless). See `references/output-standards.md` for prompt list.
83
+
84
+ ### Lightweight Mode
85
+
86
+ Single-pass, no subagents. Read `references/lightweight-mode.md` for the full 8-step sequence: extract → classify → write minimal doc → vocabulary capture (update-only) → read-only discoverability → mechanical claims check → frontmatter check → skip Phase 3.
87
+
88
+ ## Guardrails
89
+
90
+ - **One deliverable**: `docs/solutions/[category]/[filename].md`. Subagents write only scratch artifacts under `<run-dir>/`; only the orchestrator writes product files.
91
+ - **Ground claims in source**: Read the defining line before asserting code behavior. Cite PR numbers over SHAs. Soften unverifiable claims.
92
+ - **Overlap before create**: High overlap → update existing doc. Do not create duplicates.
93
+ - **Headless never edits instruction files**: Report gaps; do not apply edits.
94
+ - **No "What's next?" menu**: End the turn after the summary.
95
+
96
+ ## Preconditions
97
+
98
+ Problem has been solved (not in-progress). Solution has been verified working. Non-trivial problem (not simple typo or obvious error).
99
+
100
+ ## Output
101
+
102
+ See `references/output-standards.md` for complete output formats (headless lightweight, headless full, interactive, failure), categories, common mistakes table, and the compounding philosophy.
103
+
104
+ **Headless**: structured terminal report ending with `Documentation complete` (or `Documentation skipped`).
105
+ **Interactive**: subagent results, grounding validation, files written, refresh recommendation. End the turn.
106
+
107
+ ## Auto-Invoke
108
+
109
+ Trigger phrases: "that worked", "it's fixed", "working now", "problem solved". Manual override: `/ce-compound [context]`.
110
+
111
+ ## Related Commands
112
+
113
+ - `/research [topic]` — deep investigation (searches docs/solutions/ for patterns)
114
+ - `/ce-plan` — planning workflow (references documented solutions)
@@ -0,0 +1,94 @@
1
+ # Resolution Templates
2
+
3
+ Choose the template matching the problem_type track (see `references/schema.yaml`).
4
+
5
+ ---
6
+
7
+ ## Bug Track Template
8
+
9
+ Use for: `build_error`, `test_failure`, `runtime_error`, `performance_issue`, `database_issue`, `security_issue`, `ui_bug`, `integration_issue`, `logic_error`
10
+
11
+ <!-- YAML safety: array items (symptoms, applies_when, tags, related_components) starting with ` [ * & ! | > % @ ? or containing ": " must be wrapped in double quotes. See references/yaml-schema.md > "YAML Safety Rules". -->
12
+
13
+ ```markdown
14
+ ---
15
+ title: [Clear problem title]
16
+ date: [YYYY-MM-DD]
17
+ category: [docs/solutions subdirectory]
18
+ module: [Module or area]
19
+ problem_type: [schema enum]
20
+ component: [schema enum]
21
+ symptoms:
22
+ - [Observable symptom 1]
23
+ root_cause: [schema enum]
24
+ resolution_type: [schema enum]
25
+ severity: [schema enum]
26
+ tags: [keyword-one, keyword-two]
27
+ ---
28
+
29
+ # [Clear problem title]
30
+
31
+ ## Problem
32
+ [1-2 sentence description of the issue and user-visible impact]
33
+
34
+ ## Symptoms
35
+ - [Observable symptom or error]
36
+
37
+ ## What Didn't Work
38
+ - [Attempted fix and why it failed]
39
+
40
+ ## Solution
41
+ [The fix that worked, including code snippets when useful]
42
+
43
+ ## Why This Works
44
+ [Root cause explanation and why the fix addresses it]
45
+
46
+ ## Prevention
47
+ - [Concrete practice, test, or guardrail]
48
+
49
+ ## Related Issues
50
+ - [Related docs or issues, if any]
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Knowledge Track Template
56
+
57
+ Use for: `best_practice`, `documentation_gap`, `workflow_issue`, `developer_experience`
58
+
59
+ <!-- YAML safety: array items (symptoms, applies_when, tags, related_components) starting with ` [ * & ! | > % @ ? or containing ": " must be wrapped in double quotes. See references/yaml-schema.md > "YAML Safety Rules". -->
60
+
61
+ ```markdown
62
+ ---
63
+ title: [Clear, descriptive title]
64
+ date: [YYYY-MM-DD]
65
+ category: [docs/solutions subdirectory]
66
+ module: [Module or area]
67
+ problem_type: [schema enum]
68
+ component: [schema enum]
69
+ severity: [schema enum]
70
+ applies_when:
71
+ - [Condition where this applies]
72
+ tags: [keyword-one, keyword-two]
73
+ ---
74
+
75
+ # [Clear, descriptive title]
76
+
77
+ ## Context
78
+ [What situation, gap, or friction prompted this guidance]
79
+
80
+ ## Guidance
81
+ [The practice, pattern, or recommendation with code examples when useful]
82
+
83
+ ## Why This Matters
84
+ [Rationale and impact of following or not following this guidance]
85
+
86
+ ## When to Apply
87
+ - [Conditions or situations where this applies]
88
+
89
+ ## Examples
90
+ [Concrete before/after or usage examples showing the practice in action]
91
+
92
+ ## Related
93
+ - [Related docs or issues, if any]
94
+ ```