agentic-flow-kit 1.8.2 → 2.0.0

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 (936) hide show
  1. package/README.md +113 -148
  2. package/bin/flow-kit.mjs +5 -2
  3. package/locales/en/installer.json +25 -0
  4. package/locales/en/overrides/.agents/commands/deploy.md +52 -0
  5. package/locales/en/overrides/.agents/commands/maintain.md +76 -0
  6. package/locales/en/overrides/.agents/commands/new-task.md +89 -0
  7. package/locales/en/overrides/.agents/commands/pipeline-run.md +56 -0
  8. package/locales/en/overrides/.agents/commands/pr-review.md +30 -0
  9. package/locales/en/overrides/.agents/commands/review.md +93 -0
  10. package/locales/en/overrides/.agents/commands/stages.md +256 -0
  11. package/locales/en/overrides/.agents/notes/pr-review-cost-discipline.md +48 -0
  12. package/locales/en/overrides/.agents/notes/process-order-rule.md +21 -0
  13. package/locales/en/overrides/.agents/notes/runtime-env.local.example.md +21 -0
  14. package/locales/en/overrides/.agents/pipelines/_TEMPLATE.md +75 -0
  15. package/locales/en/overrides/.agents/pipelines/pipeline-closing.md +28 -0
  16. package/locales/en/overrides/.agents/roles/implementer.md +28 -0
  17. package/locales/en/overrides/.agents/roles/independent-reviewer.md +39 -0
  18. package/locales/en/overrides/.agents/roles/pr-adjudicator.md +27 -0
  19. package/locales/en/overrides/.agents/roles/pr-finder.md +51 -0
  20. package/locales/en/overrides/.agents/roles/pr-verifier.md +44 -0
  21. package/locales/en/overrides/.agents/roles/ui-verifier.md +22 -0
  22. package/locales/en/overrides/.agents/roles/wiki-compiler.md +47 -0
  23. package/locales/en/overrides/.agents/skills/arena/SKILL.md +50 -0
  24. package/locales/en/overrides/.agents/skills/autonomous-run/SKILL.md +45 -0
  25. package/locales/en/overrides/.agents/skills/blast-radius/SKILL.md +53 -0
  26. package/locales/en/overrides/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
  27. package/locales/en/overrides/.agents/skills/dev-tour/SKILL.md +98 -0
  28. package/locales/en/overrides/.agents/skills/dream/SKILL.md +63 -0
  29. package/locales/en/overrides/.agents/skills/eval/SKILL.md +42 -0
  30. package/locales/en/overrides/.agents/skills/interrogate/SKILL.md +49 -0
  31. package/locales/en/overrides/.agents/skills/number-vetting/SKILL.md +35 -0
  32. package/locales/en/overrides/.agents/skills/page-refactor/SKILL.md +192 -0
  33. package/locales/en/overrides/.agents/skills/papercut-fix/SKILL.md +92 -0
  34. package/locales/en/overrides/.agents/skills/pause-safely/SKILL.md +31 -0
  35. package/locales/en/overrides/.agents/skills/perf/SKILL.md +42 -0
  36. package/locales/en/overrides/.agents/skills/review-method/SKILL.md +92 -0
  37. package/locales/en/overrides/.agents/skills/session-resume/SKILL.md +69 -0
  38. package/locales/en/overrides/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
  39. package/locales/en/overrides/.agents/skills/show-me-your-work/SKILL.md +57 -0
  40. package/locales/en/overrides/.agents/skills/tfs-pr/SKILL.md +95 -0
  41. package/locales/en/overrides/.agents/skills/verify-ui/SKILL.md +116 -0
  42. package/locales/en/overrides/.agents/skills/visual-parity/SKILL.md +35 -0
  43. package/locales/en/overrides/.agents/skills/why/SKILL.md +56 -0
  44. package/locales/en/overrides/.agents/skills/wiki/SKILL.md +53 -0
  45. package/locales/en/overrides/.claude/agents/implementer.md +9 -0
  46. package/locales/en/overrides/.claude/agents/independent-reviewer.md +10 -0
  47. package/locales/en/overrides/.claude/agents/pr-adjudicator.md +10 -0
  48. package/locales/en/overrides/.claude/agents/pr-finder.md +10 -0
  49. package/locales/en/overrides/.claude/agents/pr-verifier.md +10 -0
  50. package/locales/en/overrides/.claude/agents/ui-verifier.md +10 -0
  51. package/locales/en/overrides/.claude/agents/wiki-compiler.md +10 -0
  52. package/locales/en/overrides/.claude/commands/wf-deploy.md +8 -0
  53. package/locales/en/overrides/.claude/commands/wf-maintain.md +8 -0
  54. package/locales/en/overrides/.claude/commands/wf-new-task.md +8 -0
  55. package/locales/en/overrides/.claude/commands/wf-pipeline-run.md +8 -0
  56. package/locales/en/overrides/.claude/commands/wf-pr-review.md +8 -0
  57. package/locales/en/overrides/.claude/commands/wf-review.md +8 -0
  58. package/locales/en/overrides/.claude/commands/wf-stages.md +8 -0
  59. package/locales/en/overrides/.cline/agents/implementer.yml +13 -0
  60. package/locales/en/overrides/.cline/agents/independent-reviewer.yml +11 -0
  61. package/locales/en/overrides/.cline/agents/pr-adjudicator.yml +11 -0
  62. package/locales/en/overrides/.cline/agents/pr-finder.yml +11 -0
  63. package/locales/en/overrides/.cline/agents/pr-verifier.yml +11 -0
  64. package/locales/en/overrides/.cline/agents/ui-verifier.yml +8 -0
  65. package/locales/en/overrides/.cline/agents/wiki-compiler.yml +14 -0
  66. package/locales/en/overrides/.cline/workflows/wf-deploy.md +8 -0
  67. package/locales/en/overrides/.cline/workflows/wf-maintain.md +8 -0
  68. package/locales/en/overrides/.cline/workflows/wf-new-task.md +8 -0
  69. package/locales/en/overrides/.cline/workflows/wf-pipeline-run.md +8 -0
  70. package/locales/en/overrides/.cline/workflows/wf-pr-review.md +8 -0
  71. package/locales/en/overrides/.cline/workflows/wf-review.md +8 -0
  72. package/locales/en/overrides/.cline/workflows/wf-stages.md +8 -0
  73. package/locales/en/overrides/.codebuddy/CODEBUDDY.md +7 -0
  74. package/locales/en/overrides/.codebuddy/agents/implementer.md +9 -0
  75. package/locales/en/overrides/.codebuddy/agents/independent-reviewer.md +10 -0
  76. package/locales/en/overrides/.codebuddy/agents/pr-adjudicator.md +10 -0
  77. package/locales/en/overrides/.codebuddy/agents/pr-finder.md +10 -0
  78. package/locales/en/overrides/.codebuddy/agents/pr-verifier.md +10 -0
  79. package/locales/en/overrides/.codebuddy/agents/ui-verifier.md +11 -0
  80. package/locales/en/overrides/.codebuddy/agents/wiki-compiler.md +10 -0
  81. package/locales/en/overrides/.codebuddy/commands/wf-deploy.md +8 -0
  82. package/locales/en/overrides/.codebuddy/commands/wf-maintain.md +8 -0
  83. package/locales/en/overrides/.codebuddy/commands/wf-new-task.md +8 -0
  84. package/locales/en/overrides/.codebuddy/commands/wf-pipeline-run.md +8 -0
  85. package/locales/en/overrides/.codebuddy/commands/wf-pr-review.md +8 -0
  86. package/locales/en/overrides/.codebuddy/commands/wf-review.md +8 -0
  87. package/locales/en/overrides/.codebuddy/commands/wf-stages.md +8 -0
  88. package/locales/en/overrides/.codebuddy/rules/backend-scope.md +5 -0
  89. package/locales/en/overrides/.codebuddy/rules/frontend-scope.md +5 -0
  90. package/locales/en/overrides/.codebuddy/skills/tfs-pr/SKILL.md +6 -0
  91. package/locales/en/overrides/.commandcode/agents/implementer.md +10 -0
  92. package/locales/en/overrides/.commandcode/agents/independent-reviewer.md +9 -0
  93. package/locales/en/overrides/.commandcode/agents/pr-adjudicator.md +9 -0
  94. package/locales/en/overrides/.commandcode/agents/pr-finder.md +9 -0
  95. package/locales/en/overrides/.commandcode/agents/pr-verifier.md +9 -0
  96. package/locales/en/overrides/.commandcode/agents/ui-verifier.md +10 -0
  97. package/locales/en/overrides/.commandcode/agents/wiki-compiler.md +10 -0
  98. package/locales/en/overrides/.commandcode/commands/wf-deploy.md +7 -0
  99. package/locales/en/overrides/.commandcode/commands/wf-maintain.md +7 -0
  100. package/locales/en/overrides/.commandcode/commands/wf-new-task.md +7 -0
  101. package/locales/en/overrides/.commandcode/commands/wf-pipeline-run.md +7 -0
  102. package/locales/en/overrides/.commandcode/commands/wf-pr-review.md +7 -0
  103. package/locales/en/overrides/.commandcode/commands/wf-review.md +7 -0
  104. package/locales/en/overrides/.commandcode/commands/wf-stages.md +7 -0
  105. package/locales/en/overrides/.opencode/agents/implementer.md +51 -0
  106. package/locales/en/overrides/.opencode/agents/independent-reviewer.md +18 -0
  107. package/locales/en/overrides/.opencode/agents/pr-adjudicator.md +18 -0
  108. package/locales/en/overrides/.opencode/agents/pr-finder.md +18 -0
  109. package/locales/en/overrides/.opencode/agents/pr-verifier.md +18 -0
  110. package/locales/en/overrides/.opencode/agents/ui-verifier.md +45 -0
  111. package/locales/en/overrides/.opencode/agents/wiki-compiler.md +51 -0
  112. package/locales/en/overrides/.opencode/commands/wf-deploy.md +7 -0
  113. package/locales/en/overrides/.opencode/commands/wf-maintain.md +7 -0
  114. package/locales/en/overrides/.opencode/commands/wf-new-task.md +7 -0
  115. package/locales/en/overrides/.opencode/commands/wf-pipeline-run.md +7 -0
  116. package/locales/en/overrides/.opencode/commands/wf-pr-review.md +7 -0
  117. package/locales/en/overrides/.opencode/commands/wf-review.md +7 -0
  118. package/locales/en/overrides/.opencode/commands/wf-stages.md +7 -0
  119. package/locales/en/overrides/.pi/agents/implementer.md +11 -0
  120. package/locales/en/overrides/.pi/agents/independent-reviewer.md +12 -0
  121. package/locales/en/overrides/.pi/agents/pr-adjudicator.md +12 -0
  122. package/locales/en/overrides/.pi/agents/pr-finder.md +11 -0
  123. package/locales/en/overrides/.pi/agents/pr-verifier.md +11 -0
  124. package/locales/en/overrides/.pi/agents/ui-verifier.md +11 -0
  125. package/locales/en/overrides/.pi/agents/wiki-compiler.md +11 -0
  126. package/locales/en/overrides/.qoder/agents/implementer.md +9 -0
  127. package/locales/en/overrides/.qoder/agents/independent-reviewer.md +10 -0
  128. package/locales/en/overrides/.qoder/agents/pr-adjudicator.md +10 -0
  129. package/locales/en/overrides/.qoder/agents/pr-finder.md +10 -0
  130. package/locales/en/overrides/.qoder/agents/pr-verifier.md +10 -0
  131. package/locales/en/overrides/.qoder/agents/ui-verifier.md +10 -0
  132. package/locales/en/overrides/.qoder/agents/wiki-compiler.md +10 -0
  133. package/locales/en/overrides/.qoder/commands/wf-deploy.md +8 -0
  134. package/locales/en/overrides/.qoder/commands/wf-maintain.md +8 -0
  135. package/locales/en/overrides/.qoder/commands/wf-new-task.md +8 -0
  136. package/locales/en/overrides/.qoder/commands/wf-pipeline-run.md +8 -0
  137. package/locales/en/overrides/.qoder/commands/wf-pr-review.md +8 -0
  138. package/locales/en/overrides/.qoder/commands/wf-review.md +8 -0
  139. package/locales/en/overrides/.qoder/commands/wf-stages.md +8 -0
  140. package/locales/en/overrides/.qwen/agents/implementer.md +10 -0
  141. package/locales/en/overrides/.qwen/agents/independent-reviewer.md +10 -0
  142. package/locales/en/overrides/.qwen/agents/pr-adjudicator.md +10 -0
  143. package/locales/en/overrides/.qwen/agents/pr-finder.md +10 -0
  144. package/locales/en/overrides/.qwen/agents/pr-verifier.md +10 -0
  145. package/locales/en/overrides/.qwen/agents/ui-verifier.md +10 -0
  146. package/locales/en/overrides/.qwen/agents/wiki-compiler.md +13 -0
  147. package/locales/en/overrides/.qwen/commands/wf-deploy.md +7 -0
  148. package/locales/en/overrides/.qwen/commands/wf-maintain.md +7 -0
  149. package/locales/en/overrides/.qwen/commands/wf-new-task.md +7 -0
  150. package/locales/en/overrides/.qwen/commands/wf-pipeline-run.md +7 -0
  151. package/locales/en/overrides/.qwen/commands/wf-pr-review.md +7 -0
  152. package/locales/en/overrides/.qwen/commands/wf-review.md +7 -0
  153. package/locales/en/overrides/.qwen/commands/wf-stages.md +7 -0
  154. package/locales/en/overrides/.trae/agents/implementer.md +9 -0
  155. package/locales/en/overrides/.trae/agents/independent-reviewer.md +10 -0
  156. package/locales/en/overrides/.trae/agents/pr-adjudicator.md +10 -0
  157. package/locales/en/overrides/.trae/agents/pr-finder.md +10 -0
  158. package/locales/en/overrides/.trae/agents/pr-verifier.md +10 -0
  159. package/locales/en/overrides/.trae/agents/ui-verifier.md +10 -0
  160. package/locales/en/overrides/.trae/agents/wiki-compiler.md +10 -0
  161. package/locales/en/overrides/.trae/commands/wf-deploy.md +8 -0
  162. package/locales/en/overrides/.trae/commands/wf-maintain.md +8 -0
  163. package/locales/en/overrides/.trae/commands/wf-new-task.md +8 -0
  164. package/locales/en/overrides/.trae/commands/wf-pipeline-run.md +8 -0
  165. package/locales/en/overrides/.trae/commands/wf-pr-review.md +8 -0
  166. package/locales/en/overrides/.trae/commands/wf-review.md +8 -0
  167. package/locales/en/overrides/.trae/commands/wf-stages.md +8 -0
  168. package/locales/en/overrides/.trae/rules/backend-scope.md +5 -0
  169. package/locales/en/overrides/.trae/rules/frontend-scope.md +5 -0
  170. package/locales/en/overrides/.zcode/agents/implementer.md +8 -0
  171. package/locales/en/overrides/.zcode/agents/independent-reviewer.md +8 -0
  172. package/locales/en/overrides/.zcode/agents/ui-verifier.md +8 -0
  173. package/locales/en/overrides/.zcode/agents/wiki-compiler.md +8 -0
  174. package/locales/en/overrides/AGENTS.md +52 -0
  175. package/locales/en/overrides/CLAUDE.md +20 -0
  176. package/locales/en/overrides/wiki/INDEX.md +33 -0
  177. package/locales/en/overrides/wiki/drafts-archive/README.md +6 -0
  178. package/locales/en/overrides/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
  179. package/locales/en/overrides/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
  180. package/locales/en/overrides/workflow/INDEX.md +13 -0
  181. package/locales/en/overrides/workflow/README.md +67 -0
  182. package/locales/en/overrides/workflow/archive/README.md +3 -0
  183. package/locales/en/overrides/workflow/delegations.md +4 -0
  184. package/locales/en/overrides/workflow/effective-policy.md +4 -0
  185. package/locales/en/overrides/workflow/gate-cost.md +4 -0
  186. package/locales/en/overrides/workflow/incidents/_TEMPLATE.md +49 -0
  187. package/locales/en/overrides/workflow/intents/_TEMPLATE.md +43 -0
  188. package/locales/en/overrides/workflow/metrics.md +4 -0
  189. package/locales/en/overrides/workflow/papercuts.md +3 -0
  190. package/locales/en/overrides/workflow/plans/_TEMPLATE.md +47 -0
  191. package/locales/en/overrides/workflow/regression-checklist.md +3 -0
  192. package/locales/en/overrides/workflow/specs/_TEMPLATE.md +86 -0
  193. package/locales/en/overrides/workflow/verify-evidence.md +4 -0
  194. package/locales/zh-CN/installer.json +25 -0
  195. package/package.json +23 -36
  196. package/schemas/install-manifest.schema.json +24 -0
  197. package/schemas/project-profile.schema.json +28 -0
  198. package/src/cli/args.mjs +41 -0
  199. package/src/cli/main.mjs +72 -0
  200. package/src/commands/add-host.mjs +29 -0
  201. package/src/commands/doctor.mjs +80 -0
  202. package/src/commands/install.mjs +149 -0
  203. package/src/commands/upgrade.mjs +30 -0
  204. package/src/git/config.mjs +61 -0
  205. package/src/hosts/registry.mjs +26 -0
  206. package/src/i18n.mjs +32 -0
  207. package/src/install/apply.mjs +124 -0
  208. package/src/install/manifest.mjs +40 -0
  209. package/src/install/plan.mjs +83 -0
  210. package/src/render/tokens.mjs +58 -0
  211. package/templates/engine/.agents/board/dev-tour.html +1940 -0
  212. package/templates/engine/.agents/board/index.html +835 -0
  213. package/templates/engine/.agents/commands/deploy.md +52 -0
  214. package/templates/engine/.agents/commands/maintain.md +76 -0
  215. package/templates/engine/.agents/commands/new-task.md +89 -0
  216. package/templates/engine/.agents/commands/pipeline-run.md +56 -0
  217. package/templates/engine/.agents/commands/pr-review.md +30 -0
  218. package/templates/engine/.agents/commands/review.md +93 -0
  219. package/templates/engine/.agents/commands/stages.md +256 -0
  220. package/templates/engine/.agents/config/commit-msg-rules.json +7 -0
  221. package/templates/engine/.agents/config/engine.json +11 -0
  222. package/templates/engine/.agents/config/gate-budgets.json +5 -0
  223. package/templates/engine/.agents/config/mechanism-registry.md +62 -0
  224. package/templates/engine/.agents/config/model-roles.json +26 -0
  225. package/templates/engine/.agents/config/model-roles.local.example.json +7 -0
  226. package/templates/engine/.agents/config/pr-review.json +67 -0
  227. package/templates/engine/.agents/config/principles.md +32 -0
  228. package/templates/engine/.agents/config/workflow-enums.txt +25 -0
  229. package/templates/engine/.agents/hooks/check-architecture.mjs +168 -0
  230. package/templates/engine/.agents/hooks/check-audit-fields.mjs +56 -0
  231. package/templates/engine/.agents/hooks/check-commit-plan-ref.mjs +84 -0
  232. package/templates/engine/.agents/hooks/check-confirm-order.mjs +281 -0
  233. package/templates/engine/.agents/hooks/check-delete-guard.mjs +63 -0
  234. package/templates/engine/.agents/hooks/check-notify-guard.mjs +55 -0
  235. package/templates/engine/.agents/hooks/commit-check.cjs +208 -0
  236. package/templates/engine/.agents/hooks/gates.json +33 -0
  237. package/templates/engine/.agents/hooks/local-pre-commit.mjs +27 -0
  238. package/templates/engine/.agents/hooks/pre-shell-check.cjs +361 -0
  239. package/templates/engine/.agents/hooks/pre-write-check.cjs +220 -0
  240. package/templates/engine/.agents/notes/gate-diet.md +75 -0
  241. package/templates/engine/.agents/notes/pr-review-cost-discipline.md +48 -0
  242. package/templates/engine/.agents/notes/process-order-rule.md +21 -0
  243. package/templates/engine/.agents/notes/runtime-env.local.example.md +21 -0
  244. package/templates/engine/.agents/pipelines/_TEMPLATE.md +75 -0
  245. package/templates/engine/.agents/pipelines/pipeline-closing.md +28 -0
  246. package/templates/engine/.agents/pipelines//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +16 -0
  247. package/templates/engine/.agents/roles/implementer.md +28 -0
  248. package/templates/engine/.agents/roles/independent-reviewer.md +39 -0
  249. package/templates/engine/.agents/roles/pr-adjudicator.md +27 -0
  250. package/templates/engine/.agents/roles/pr-finder.md +51 -0
  251. package/templates/engine/.agents/roles/pr-verifier.md +44 -0
  252. package/templates/engine/.agents/roles/ui-verifier.md +22 -0
  253. package/templates/engine/.agents/roles/wiki-compiler.md +47 -0
  254. package/templates/engine/.agents/scripts/agg-delegations.mjs +439 -0
  255. package/templates/engine/.agents/scripts/agg-judgments.mjs +301 -0
  256. package/templates/engine/.agents/scripts/agg-kb-usage.mjs +196 -0
  257. package/templates/engine/.agents/scripts/append-compensation.mjs +109 -0
  258. package/templates/engine/.agents/scripts/archive-sweep.mjs +229 -0
  259. package/templates/engine/.agents/scripts/auto-tour.mjs +77 -0
  260. package/templates/engine/.agents/scripts/board-port.mjs +17 -0
  261. package/templates/engine/.agents/scripts/check-doc-body-drift.mjs +102 -0
  262. package/templates/engine/.agents/scripts/check-engine-artifacts.mjs +54 -0
  263. package/templates/engine/.agents/scripts/check-hook-wiring.mjs +75 -0
  264. package/templates/engine/.agents/scripts/check-lane-surface.mjs +393 -0
  265. package/templates/engine/.agents/scripts/check-ledger-doc-presence.mjs +71 -0
  266. package/templates/engine/.agents/scripts/check-ledger-invariant.mjs +873 -0
  267. package/templates/engine/.agents/scripts/check-local-gate-config.mjs +95 -0
  268. package/templates/engine/.agents/scripts/check-local-gates.mjs +248 -0
  269. package/templates/engine/.agents/scripts/check-loop-kit.mjs +550 -0
  270. package/templates/engine/.agents/scripts/check-loop-rev-semantics.mjs +59 -0
  271. package/templates/engine/.agents/scripts/check-loop-sections/s01-pairing.mjs +116 -0
  272. package/templates/engine/.agents/scripts/check-loop-sections/s03x-regr-evidence.mjs +38 -0
  273. package/templates/engine/.agents/scripts/check-loop-sections/s08-acceptance.mjs +130 -0
  274. package/templates/engine/.agents/scripts/check-loop-sections/s15-fingerprint.mjs +152 -0
  275. package/templates/engine/.agents/scripts/check-loop-sections/s23-convergence-audit.mjs +182 -0
  276. package/templates/engine/.agents/scripts/check-loop-sections/s29-regr-enforcer.mjs +69 -0
  277. package/templates/engine/.agents/scripts/check-loop.mjs +131 -0
  278. package/templates/engine/.agents/scripts/check-regression-consistency.mjs +252 -0
  279. package/templates/engine/.agents/scripts/check-schema-residue.mjs +144 -0
  280. package/templates/engine/.agents/scripts/check-scope-range.mjs +156 -0
  281. package/templates/engine/.agents/scripts/check-scope.mjs +121 -0
  282. package/templates/engine/.agents/scripts/check-scripts-syntax.mjs +138 -0
  283. package/templates/engine/.agents/scripts/check-secrets-lite.mjs +239 -0
  284. package/templates/engine/.agents/scripts/check-secrets.mjs +104 -0
  285. package/templates/engine/.agents/scripts/check-test-impact-map.mjs +107 -0
  286. package/templates/engine/.agents/scripts/ci-assert-frontend-deps.mjs +42 -0
  287. package/templates/engine/.agents/scripts/ci-commit-hygiene.mjs +86 -0
  288. package/templates/engine/.agents/scripts/ci-install-gitleaks.mjs +75 -0
  289. package/templates/engine/.agents/scripts/ci-push-before.mjs +49 -0
  290. package/templates/engine/.agents/scripts/closeout.mjs +127 -0
  291. package/templates/engine/.agents/scripts/compact-ledgers.mjs +70 -0
  292. package/templates/engine/.agents/scripts/confirm-doc.mjs +737 -0
  293. package/templates/engine/.agents/scripts/delegation-presence.mjs +38 -0
  294. package/templates/engine/.agents/scripts/dev-tour-model.mjs +1398 -0
  295. package/templates/engine/.agents/scripts/dream-run.mjs +283 -0
  296. package/templates/engine/.agents/scripts/ensure-board.mjs +187 -0
  297. package/templates/engine/.agents/scripts/failure-attribution.mjs +11 -0
  298. package/templates/engine/.agents/scripts/fill-intent.mjs +60 -0
  299. package/templates/engine/.agents/scripts/fill-plan.mjs +105 -0
  300. package/templates/engine/.agents/scripts/fill-spec.mjs +72 -0
  301. package/templates/engine/.agents/scripts/gen-dev-tour.mjs +191 -0
  302. package/templates/engine/.agents/scripts/gen-effective-policy.mjs +113 -0
  303. package/templates/engine/.agents/scripts/gen-engine-map.mjs +292 -0
  304. package/templates/engine/.agents/scripts/gen-narrative-claims.mjs +275 -0
  305. package/templates/engine/.agents/scripts/gen-verify-evidence.mjs +115 -0
  306. package/templates/engine/.agents/scripts/gen-wiki-board.mjs +221 -0
  307. package/templates/engine/.agents/scripts/gen-workflow-index.mjs +201 -0
  308. package/templates/engine/.agents/scripts/gen-workflow-metrics.mjs +692 -0
  309. package/templates/engine/.agents/scripts/git-merge-jsonl.mjs +62 -0
  310. package/templates/engine/.agents/scripts/judgment-ledger.mjs +68 -0
  311. package/templates/engine/.agents/scripts/kb-cache-evict.mjs +50 -0
  312. package/templates/engine/.agents/scripts/kb-search.mjs +423 -0
  313. package/templates/engine/.agents/scripts/lane-surface-audit.mjs +145 -0
  314. package/templates/engine/.agents/scripts/ledger-loader.mjs +77 -0
  315. package/templates/engine/.agents/scripts/ledger-shards.mjs +346 -0
  316. package/templates/engine/.agents/scripts/metrics-core.mjs +131 -0
  317. package/templates/engine/.agents/scripts/pipeline-run.mjs +964 -0
  318. package/templates/engine/.agents/scripts/policy.mjs +250 -0
  319. package/templates/engine/.agents/scripts/pr-create.mjs +54 -0
  320. package/templates/engine/.agents/scripts/pr-review.mjs +1551 -0
  321. package/templates/engine/.agents/scripts/quote-grounding.mjs +233 -0
  322. package/templates/engine/.agents/scripts/regen-ledgers.mjs +59 -0
  323. package/templates/engine/.agents/scripts/rewrite-file.mjs +135 -0
  324. package/templates/engine/.agents/scripts/rule-budget.mjs +246 -0
  325. package/templates/engine/.agents/scripts/stage-gates.mjs +812 -0
  326. package/templates/engine/.agents/scripts/test-impact-lib.mjs +451 -0
  327. package/templates/engine/.agents/scripts/test-impact.mjs +105 -0
  328. package/templates/engine/.agents/scripts/trust-mode.mjs +130 -0
  329. package/templates/engine/.agents/scripts/verify-scope.mjs +163 -0
  330. package/templates/engine/.agents/scripts/verify-wiki-consistency.mjs +264 -0
  331. package/templates/engine/.agents/scripts/verify.mjs +847 -0
  332. package/templates/engine/.agents/scripts/warn-format.mjs +57 -0
  333. package/templates/engine/.agents/scripts/wf-journal.mjs +230 -0
  334. package/templates/engine/.agents/scripts/workflow-board-server.mjs +696 -0
  335. package/templates/engine/.agents/scripts/workflow-enums.mjs +70 -0
  336. package/templates/engine/.agents/scripts/workflows-check.mjs +260 -0
  337. package/templates/engine/.agents/settings.json +33 -0
  338. package/templates/engine/.agents/skills/arena/SKILL.md +50 -0
  339. package/templates/engine/.agents/skills/autonomous-run/SKILL.md +45 -0
  340. package/templates/engine/.agents/skills/blast-radius/SKILL.md +53 -0
  341. package/templates/engine/.agents/skills/csharp-quality-gates/SKILL.md +109 -0
  342. package/templates/engine/.agents/skills/csharp-quality-gates/scripts/quality-gates.mjs +430 -0
  343. package/templates/engine/.agents/skills/dev-tour/SKILL.md +98 -0
  344. package/templates/engine/.agents/skills/dream/SKILL.md +63 -0
  345. package/templates/engine/.agents/skills/eval/SKILL.md +42 -0
  346. package/templates/engine/.agents/skills/eval/scripts/eval-score.mjs +59 -0
  347. package/templates/engine/.agents/skills/interrogate/SKILL.md +49 -0
  348. package/templates/engine/.agents/skills/interrogate/scripts/interrogate-plan.mjs +72 -0
  349. package/templates/engine/.agents/skills/number-vetting/SKILL.md +35 -0
  350. package/templates/engine/.agents/skills/page-refactor/SKILL.md +192 -0
  351. package/templates/engine/.agents/skills/page-refactor/references/templates.md +989 -0
  352. package/templates/engine/.agents/skills/papercut-fix/SKILL.md +92 -0
  353. package/templates/engine/.agents/skills/papercut-fix/references/response-template.md +81 -0
  354. package/templates/engine/.agents/skills/pause-safely/SKILL.md +31 -0
  355. package/templates/engine/.agents/skills/perf/SKILL.md +42 -0
  356. package/templates/engine/.agents/skills/review-method/SKILL.md +92 -0
  357. package/templates/engine/.agents/skills/review-method/golden-set.md +61 -0
  358. package/templates/engine/.agents/skills/session-resume/SKILL.md +69 -0
  359. package/templates/engine/.agents/skills/session-resume/scripts/worktree-audit.mjs +110 -0
  360. package/templates/engine/.agents/skills/shipyard-workflow-closeout/SKILL.md +109 -0
  361. package/templates/engine/.agents/skills/show-me-your-work/SKILL.md +57 -0
  362. package/templates/engine/.agents/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
  363. package/templates/engine/.agents/skills/show-me-your-work/scripts/decision-log.mjs +24 -0
  364. package/templates/engine/.agents/skills/tfs-pr/SKILL.md +95 -0
  365. package/templates/engine/.agents/skills/tfs-pr/scripts/tfs-pr.mjs +947 -0
  366. package/templates/engine/.agents/skills/verify-ui/SKILL.md +116 -0
  367. package/templates/engine/.agents/skills/verify-ui/features/.gitkeep +0 -0
  368. package/templates/engine/.agents/skills/verify-ui/scripts/gen-verify-feature.mjs +114 -0
  369. package/templates/engine/.agents/skills/visual-parity/SKILL.md +35 -0
  370. package/templates/engine/.agents/skills/why/SKILL.md +56 -0
  371. package/templates/engine/.agents/skills/why/scripts/why-evidence.mjs +74 -0
  372. package/templates/engine/.agents/skills/wiki/SKILL.md +53 -0
  373. package/templates/engine/.agents/tests/auto-tour.test.mjs +82 -0
  374. package/templates/engine/.agents/tests/dev-tour-model.test.mjs +452 -0
  375. package/templates/engine/.agents/tests/fill-plan-lite.test.mjs +46 -0
  376. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.md +14 -0
  377. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-bare-mid-path.model.json +179 -0
  378. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.md +21 -0
  379. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-fake-path-guard.model.json +194 -0
  380. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.md +20 -0
  381. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-h3-batches.model.json +207 -0
  382. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.md +24 -0
  383. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-issues.model.json +225 -0
  384. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.md +15 -0
  385. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-l1-single-file.model.json +160 -0
  386. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.md +29 -0
  387. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layer-word-unique.model.json +266 -0
  388. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.md +17 -0
  389. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-layers-fallback.model.json +207 -0
  390. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.md +39 -0
  391. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-numbered-steps.model.json +359 -0
  392. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.md +16 -0
  393. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-path-guess.model.json +131 -0
  394. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.md +29 -0
  395. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-table-rows.model.json +190 -0
  396. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.md +39 -0
  397. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-task-checkboxes.model.json +362 -0
  398. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.md +24 -0
  399. package/templates/engine/.agents/tests/fixtures/dev-tour/plan-union-label.model.json +224 -0
  400. package/templates/engine/.agents/tests/tools/gen-synthetic-plan.mjs +108 -0
  401. package/templates/git/.gitattributes +22 -0
  402. package/templates/git/.githooks/commit-msg +72 -0
  403. package/templates/git/.githooks/post-commit +62 -0
  404. package/templates/git/.githooks/pre-commit +197 -0
  405. package/templates/git/.githooks/pre-merge-commit +28 -0
  406. package/templates/git/.githooks/pre-push +201 -0
  407. package/templates/git/.gitignore.engine +11 -0
  408. package/templates/hosts/claude/CLAUDE.md +55 -0
  409. package/templates/hosts/claude/agents/implementer.md +7 -0
  410. package/templates/hosts/claude/agents/independent-reviewer.md +8 -0
  411. package/templates/hosts/claude/agents/pr-adjudicator.md +8 -0
  412. package/templates/hosts/claude/agents/pr-finder.md +8 -0
  413. package/templates/hosts/claude/agents/pr-verifier.md +8 -0
  414. package/templates/hosts/claude/agents/ui-verifier.md +8 -0
  415. package/templates/hosts/claude/agents/wiki-compiler.md +8 -0
  416. package/templates/hosts/claude/commands/wf-deploy.md +10 -0
  417. package/templates/hosts/claude/commands/wf-maintain.md +10 -0
  418. package/templates/hosts/claude/commands/wf-new-task.md +10 -0
  419. package/templates/hosts/claude/commands/wf-pipeline-run.md +10 -0
  420. package/templates/hosts/claude/commands/wf-pr-review.md +10 -0
  421. package/templates/hosts/claude/commands/wf-review.md +10 -0
  422. package/templates/hosts/claude/commands/wf-stages.md +10 -0
  423. package/templates/hosts/claude/settings.json +57 -0
  424. package/templates/hosts/cline/agents/implementer.yml +15 -0
  425. package/templates/hosts/cline/agents/independent-reviewer.yml +20 -0
  426. package/templates/hosts/cline/agents/pr-adjudicator.yml +18 -0
  427. package/templates/hosts/cline/agents/pr-finder.yml +19 -0
  428. package/templates/hosts/cline/agents/pr-verifier.yml +18 -0
  429. package/templates/hosts/cline/agents/ui-verifier.yml +17 -0
  430. package/templates/hosts/cline/agents/wiki-compiler.yml +20 -0
  431. package/templates/hosts/cline/hooks/PreToolUse.cjs +260 -0
  432. package/templates/hosts/cline/workflows/wf-deploy.md +8 -0
  433. package/templates/hosts/cline/workflows/wf-maintain.md +8 -0
  434. package/templates/hosts/cline/workflows/wf-new-task.md +8 -0
  435. package/templates/hosts/cline/workflows/wf-pipeline-run.md +8 -0
  436. package/templates/hosts/cline/workflows/wf-pr-review.md +8 -0
  437. package/templates/hosts/cline/workflows/wf-review.md +8 -0
  438. package/templates/hosts/cline/workflows/wf-stages.md +8 -0
  439. package/templates/hosts/codebuddy/CODEBUDDY.md +7 -0
  440. package/templates/hosts/codebuddy/agents/implementer.md +9 -0
  441. package/templates/hosts/codebuddy/agents/independent-reviewer.md +10 -0
  442. package/templates/hosts/codebuddy/agents/pr-adjudicator.md +10 -0
  443. package/templates/hosts/codebuddy/agents/pr-finder.md +10 -0
  444. package/templates/hosts/codebuddy/agents/pr-verifier.md +10 -0
  445. package/templates/hosts/codebuddy/agents/ui-verifier.md +11 -0
  446. package/templates/hosts/codebuddy/agents/wiki-compiler.md +10 -0
  447. package/templates/hosts/codebuddy/commands/wf-deploy.md +10 -0
  448. package/templates/hosts/codebuddy/commands/wf-maintain.md +10 -0
  449. package/templates/hosts/codebuddy/commands/wf-new-task.md +10 -0
  450. package/templates/hosts/codebuddy/commands/wf-pipeline-run.md +10 -0
  451. package/templates/hosts/codebuddy/commands/wf-pr-review.md +10 -0
  452. package/templates/hosts/codebuddy/commands/wf-review.md +10 -0
  453. package/templates/hosts/codebuddy/commands/wf-stages.md +10 -0
  454. package/templates/hosts/codebuddy/rules/backend-scope.md +5 -0
  455. package/templates/hosts/codebuddy/rules/frontend-scope.md +5 -0
  456. package/templates/hosts/codebuddy/settings.json +31 -0
  457. package/templates/hosts/codebuddy/skills/tfs-pr/SKILL.md +6 -0
  458. package/templates/hosts/commandcode/agents/implementer.md +10 -0
  459. package/templates/hosts/commandcode/agents/independent-reviewer.md +9 -0
  460. package/templates/hosts/commandcode/agents/pr-adjudicator.md +9 -0
  461. package/templates/hosts/commandcode/agents/pr-finder.md +9 -0
  462. package/templates/hosts/commandcode/agents/pr-verifier.md +9 -0
  463. package/templates/hosts/commandcode/agents/ui-verifier.md +11 -0
  464. package/templates/hosts/commandcode/agents/wiki-compiler.md +10 -0
  465. package/templates/hosts/commandcode/commands/wf-deploy.md +9 -0
  466. package/templates/hosts/commandcode/commands/wf-maintain.md +9 -0
  467. package/templates/hosts/commandcode/commands/wf-new-task.md +9 -0
  468. package/templates/hosts/commandcode/commands/wf-pipeline-run.md +9 -0
  469. package/templates/hosts/commandcode/commands/wf-pr-review.md +9 -0
  470. package/templates/hosts/commandcode/commands/wf-review.md +9 -0
  471. package/templates/hosts/commandcode/commands/wf-stages.md +9 -0
  472. package/templates/hosts/commandcode/settings.json +59 -0
  473. package/templates/hosts/opencode/agents/implementer.md +51 -0
  474. package/templates/hosts/opencode/agents/independent-reviewer.md +18 -0
  475. package/templates/hosts/opencode/agents/pr-adjudicator.md +18 -0
  476. package/templates/hosts/opencode/agents/pr-finder.md +18 -0
  477. package/templates/hosts/opencode/agents/pr-verifier.md +18 -0
  478. package/templates/hosts/opencode/agents/ui-verifier.md +45 -0
  479. package/templates/hosts/opencode/agents/wiki-compiler.md +51 -0
  480. package/templates/hosts/opencode/commands/wf-deploy.md +7 -0
  481. package/templates/hosts/opencode/commands/wf-maintain.md +7 -0
  482. package/templates/hosts/opencode/commands/wf-new-task.md +7 -0
  483. package/templates/hosts/opencode/commands/wf-pipeline-run.md +7 -0
  484. package/templates/hosts/opencode/commands/wf-pr-review.md +7 -0
  485. package/templates/hosts/opencode/commands/wf-review.md +7 -0
  486. package/templates/hosts/opencode/commands/wf-stages.md +7 -0
  487. package/templates/hosts/pi/agents/implementer.md +10 -0
  488. package/templates/hosts/pi/agents/independent-reviewer.md +11 -0
  489. package/templates/hosts/pi/agents/pr-adjudicator.md +11 -0
  490. package/templates/hosts/pi/agents/pr-finder.md +10 -0
  491. package/templates/hosts/pi/agents/pr-verifier.md +10 -0
  492. package/templates/hosts/pi/agents/ui-verifier.md +10 -0
  493. package/templates/hosts/pi/agents/wiki-compiler.md +10 -0
  494. package/templates/hosts/pi/extensions/lib/gates-core.cjs +196 -0
  495. package/templates/hosts/pi/extensions/shipyard-gates.ts +95 -0
  496. package/templates/hosts/pi/settings.json +5 -0
  497. package/templates/hosts/qoder/agents/implementer.md +9 -0
  498. package/templates/hosts/qoder/agents/independent-reviewer.md +10 -0
  499. package/templates/hosts/qoder/agents/pr-adjudicator.md +10 -0
  500. package/templates/hosts/qoder/agents/pr-finder.md +10 -0
  501. package/templates/hosts/qoder/agents/pr-verifier.md +10 -0
  502. package/templates/hosts/qoder/agents/ui-verifier.md +10 -0
  503. package/templates/hosts/qoder/agents/wiki-compiler.md +10 -0
  504. package/templates/hosts/qoder/commands/wf-deploy.md +8 -0
  505. package/templates/hosts/qoder/commands/wf-maintain.md +8 -0
  506. package/templates/hosts/qoder/commands/wf-new-task.md +8 -0
  507. package/templates/hosts/qoder/commands/wf-pipeline-run.md +8 -0
  508. package/templates/hosts/qoder/commands/wf-pr-review.md +8 -0
  509. package/templates/hosts/qoder/commands/wf-review.md +8 -0
  510. package/templates/hosts/qoder/commands/wf-stages.md +8 -0
  511. package/templates/hosts/qoder/settings.json +63 -0
  512. package/templates/hosts/qwen/agents/implementer.md +8 -0
  513. package/templates/hosts/qwen/agents/independent-reviewer.md +8 -0
  514. package/templates/hosts/qwen/agents/pr-adjudicator.md +8 -0
  515. package/templates/hosts/qwen/agents/pr-finder.md +8 -0
  516. package/templates/hosts/qwen/agents/pr-verifier.md +8 -0
  517. package/templates/hosts/qwen/agents/ui-verifier.md +8 -0
  518. package/templates/hosts/qwen/agents/wiki-compiler.md +11 -0
  519. package/templates/hosts/qwen/commands/wf-deploy.md +9 -0
  520. package/templates/hosts/qwen/commands/wf-maintain.md +9 -0
  521. package/templates/hosts/qwen/commands/wf-new-task.md +9 -0
  522. package/templates/hosts/qwen/commands/wf-pipeline-run.md +9 -0
  523. package/templates/hosts/qwen/commands/wf-pr-review.md +9 -0
  524. package/templates/hosts/qwen/commands/wf-review.md +9 -0
  525. package/templates/hosts/qwen/commands/wf-stages.md +9 -0
  526. package/templates/hosts/qwen/settings.json +59 -0
  527. package/templates/hosts/trae/agents/implementer.md +9 -0
  528. package/templates/hosts/trae/agents/independent-reviewer.md +10 -0
  529. package/templates/hosts/trae/agents/pr-adjudicator.md +10 -0
  530. package/templates/hosts/trae/agents/pr-finder.md +10 -0
  531. package/templates/hosts/trae/agents/pr-verifier.md +10 -0
  532. package/templates/hosts/trae/agents/ui-verifier.md +10 -0
  533. package/templates/hosts/trae/agents/wiki-compiler.md +10 -0
  534. package/templates/hosts/trae/commands/wf-deploy.md +8 -0
  535. package/templates/hosts/trae/commands/wf-maintain.md +8 -0
  536. package/templates/hosts/trae/commands/wf-new-task.md +8 -0
  537. package/templates/hosts/trae/commands/wf-pipeline-run.md +8 -0
  538. package/templates/hosts/trae/commands/wf-pr-review.md +8 -0
  539. package/templates/hosts/trae/commands/wf-review.md +8 -0
  540. package/templates/hosts/trae/commands/wf-stages.md +8 -0
  541. package/templates/hosts/trae/hooks.json +17 -0
  542. package/templates/hosts/trae/rules/backend-scope.md +5 -0
  543. package/templates/hosts/trae/rules/frontend-scope.md +5 -0
  544. package/templates/hosts/zcode/agents/implementer.md +8 -0
  545. package/templates/hosts/zcode/agents/independent-reviewer.md +8 -0
  546. package/templates/hosts/zcode/agents/ui-verifier.md +8 -0
  547. package/templates/hosts/zcode/agents/wiki-compiler.md +8 -0
  548. package/templates/hosts/zcode/config.json +31 -0
  549. package/templates/hosts/zcode/workflows/code-review.dwf.ts +428 -0
  550. package/templates/hosts/zcode/workflows/fullchain-flow-test.dwf.ts +898 -0
  551. package/templates/profiles/dotnet/.agents/config/lane-surfaces.txt +33 -0
  552. package/templates/profiles/dotnet/.agents/config/rule-budgets.txt +84 -0
  553. package/templates/profiles/dotnet/.agents/config/test-impact-map.json +590 -0
  554. package/templates/profiles/dotnet/.agents/config/workflow-modules.txt +18 -0
  555. package/templates/profiles/dotnet/.agents/hooks/commit-check.config.json +18 -0
  556. package/templates/profiles/dotnet/.agents/hooks/delete-guard-allowlist.txt +28 -0
  557. package/templates/profiles/dotnet/.agents/notes/runtime-env.md +178 -0
  558. package/templates/profiles/dotnet/AGENTS.md +52 -0
  559. package/templates/profiles/empty/.agents/config/lane-surfaces.txt +12 -0
  560. package/templates/profiles/empty/.agents/config/rule-budgets.txt +3 -0
  561. package/templates/profiles/empty/.agents/config/test-impact-map.json +8 -0
  562. package/templates/profiles/empty/.agents/config/workflow-modules.txt +2 -0
  563. package/templates/profiles/empty/.agents/hooks/commit-check.config.json +5 -0
  564. package/templates/profiles/empty/.agents/hooks/delete-guard-allowlist.txt +2 -0
  565. package/templates/profiles/empty/.agents/notes/runtime-env.md +44 -0
  566. package/templates/profiles/empty/AGENTS.md +52 -0
  567. package/templates/profiles/node/.agents/config/lane-surfaces.txt +12 -0
  568. package/templates/profiles/node/.agents/config/rule-budgets.txt +3 -0
  569. package/templates/profiles/node/.agents/config/test-impact-map.json +8 -0
  570. package/templates/profiles/node/.agents/config/workflow-modules.txt +2 -0
  571. package/templates/profiles/node/.agents/hooks/commit-check.config.json +5 -0
  572. package/templates/profiles/node/.agents/hooks/delete-guard-allowlist.txt +2 -0
  573. package/templates/profiles/node/.agents/notes/runtime-env.md +44 -0
  574. package/templates/profiles/node/AGENTS.md +52 -0
  575. package/templates/scaffold/wiki/INDEX.md +33 -0
  576. package/templates/scaffold/wiki/drafts-archive/README.md +7 -0
  577. package/templates/scaffold/wiki//344/272/247/345/223/201/351/234/200/346/261/202/.gitkeep +0 -0
  578. package/templates/scaffold/wiki//345/274/200/345/217/221/346/226/271/346/241/210/.gitkeep +0 -0
  579. package/templates/scaffold/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +22 -0
  580. package/templates/scaffold/wiki//346/265/213/350/257/225/346/212/245/345/221/212/.gitkeep +0 -0
  581. package/templates/scaffold/wiki//347/224/250/346/210/267/345/212/237/350/203/275/.gitkeep +0 -0
  582. package/templates/scaffold/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +230 -0
  583. package/templates/scaffold/wiki//351/241/271/347/233/256/350/247/204/350/214/203/.gitkeep +0 -0
  584. package/templates/scaffold/workflow/INDEX.md +13 -0
  585. package/templates/scaffold/workflow/README.md +67 -0
  586. package/templates/scaffold/workflow/archive/README.md +3 -0
  587. package/templates/scaffold/workflow/delegations.d/.gitkeep +0 -0
  588. package/templates/scaffold/workflow/delegations.md +4 -0
  589. package/templates/scaffold/workflow/effective-policy.md +4 -0
  590. package/templates/scaffold/workflow/evidence/.gitkeep +0 -0
  591. package/templates/scaffold/workflow/gate-cost.md +4 -0
  592. package/templates/scaffold/workflow/gate-metrics.d/.gitkeep +0 -0
  593. package/templates/scaffold/workflow/incidents/_TEMPLATE.md +49 -0
  594. package/templates/scaffold/workflow/intents/_TEMPLATE.md +43 -0
  595. package/templates/scaffold/workflow/metrics.md +4 -0
  596. package/templates/scaffold/workflow/papercuts.d/.gitkeep +0 -0
  597. package/templates/scaffold/workflow/papercuts.md +3 -0
  598. package/templates/scaffold/workflow/plans/_TEMPLATE.md +47 -0
  599. package/templates/scaffold/workflow/regression-checklist.d/.gitkeep +0 -0
  600. package/templates/scaffold/workflow/regression-checklist.md +3 -0
  601. package/templates/scaffold/workflow/research/.gitkeep +0 -0
  602. package/templates/scaffold/workflow/reviews.d/.gitkeep +0 -0
  603. package/templates/scaffold/workflow/specs/_TEMPLATE.md +87 -0
  604. package/templates/scaffold/workflow/verify-evidence/.gitkeep +0 -0
  605. package/templates/scaffold/workflow/verify-evidence.md +4 -0
  606. package/LICENSE +0 -21
  607. package/modules/gates/README.md +0 -25
  608. package/modules/gates/dotnet-ca/README.md +0 -24
  609. package/modules/gates/dotnet-ca/check-architecture.sh +0 -150
  610. package/modules/gates/dotnet-ca/local-pre-commit.line +0 -1
  611. package/modules/gates/generated-readonly/README.md +0 -13
  612. package/modules/gates/generated-readonly/check-generated.mjs +0 -61
  613. package/modules/gates/generated-readonly/local-pre-commit.line +0 -1
  614. package/modules/gates/node-layer/README.md +0 -9
  615. package/modules/gates/node-layer/check-node-layer.mjs +0 -29
  616. package/modules/gates/node-layer/local-pre-commit.line +0 -1
  617. package/modules/gates/py-import/README.md +0 -9
  618. package/modules/gates/py-import/check-py-import.mjs +0 -30
  619. package/modules/gates/py-import/local-pre-commit.line +0 -1
  620. package/modules/gates/test-protect/README.md +0 -23
  621. package/modules/gates/test-protect/check-test-protect.mjs +0 -64
  622. package/modules/gates/test-protect/local-pre-commit.line +0 -1
  623. package/modules/hosts/README.md +0 -57
  624. package/modules/hosts/claude/agents/implementer.md +0 -51
  625. package/modules/hosts/claude/agents/independent-reviewer.md +0 -49
  626. package/modules/hosts/claude/agents/ui-verifier.md +0 -48
  627. package/modules/hosts/claude/commands/wf-build.md +0 -69
  628. package/modules/hosts/claude/commands/wf-deploy.md +0 -58
  629. package/modules/hosts/claude/commands/wf-design.md +0 -49
  630. package/modules/hosts/claude/commands/wf-gate-checklist.md +0 -77
  631. package/modules/hosts/claude/commands/wf-maintain.md +0 -76
  632. package/modules/hosts/claude/commands/wf-new-task.md +0 -102
  633. package/modules/hosts/claude/commands/wf-pipeline-run.md +0 -35
  634. package/modules/hosts/claude/commands/wf-plan.md +0 -40
  635. package/modules/hosts/claude/commands/wf-review.md +0 -49
  636. package/modules/hosts/claude/commands/wf-sync-hosts.md +0 -64
  637. package/modules/hosts/claude/commands/wf-test.md +0 -68
  638. package/modules/hosts/codex/agents/implementer.md +0 -51
  639. package/modules/hosts/codex/agents/independent-reviewer.md +0 -49
  640. package/modules/hosts/codex/agents/ui-verifier.md +0 -48
  641. package/modules/hosts/codex/commands/wf-build.md +0 -69
  642. package/modules/hosts/codex/commands/wf-deploy.md +0 -58
  643. package/modules/hosts/codex/commands/wf-design.md +0 -49
  644. package/modules/hosts/codex/commands/wf-gate-checklist.md +0 -77
  645. package/modules/hosts/codex/commands/wf-maintain.md +0 -76
  646. package/modules/hosts/codex/commands/wf-new-task.md +0 -102
  647. package/modules/hosts/codex/commands/wf-pipeline-run.md +0 -35
  648. package/modules/hosts/codex/commands/wf-plan.md +0 -40
  649. package/modules/hosts/codex/commands/wf-review.md +0 -49
  650. package/modules/hosts/codex/commands/wf-sync-hosts.md +0 -64
  651. package/modules/hosts/codex/commands/wf-test.md +0 -68
  652. package/modules/hosts/codex/skills/flow-kit/SKILL.md +0 -14
  653. package/modules/hosts/cursor/agents/implementer.md +0 -51
  654. package/modules/hosts/cursor/agents/independent-reviewer.md +0 -49
  655. package/modules/hosts/cursor/agents/ui-verifier.md +0 -48
  656. package/modules/hosts/cursor/commands/wf-build.md +0 -69
  657. package/modules/hosts/cursor/commands/wf-deploy.md +0 -58
  658. package/modules/hosts/cursor/commands/wf-design.md +0 -49
  659. package/modules/hosts/cursor/commands/wf-gate-checklist.md +0 -77
  660. package/modules/hosts/cursor/commands/wf-maintain.md +0 -76
  661. package/modules/hosts/cursor/commands/wf-new-task.md +0 -102
  662. package/modules/hosts/cursor/commands/wf-pipeline-run.md +0 -35
  663. package/modules/hosts/cursor/commands/wf-plan.md +0 -40
  664. package/modules/hosts/cursor/commands/wf-review.md +0 -49
  665. package/modules/hosts/cursor/commands/wf-sync-hosts.md +0 -64
  666. package/modules/hosts/cursor/commands/wf-test.md +0 -68
  667. package/modules/hosts/omp/agents/implementer.md +0 -52
  668. package/modules/hosts/omp/agents/independent-reviewer.md +0 -50
  669. package/modules/hosts/omp/agents/ui-verifier.md +0 -49
  670. package/modules/hosts/opencode/agents/implementer.md +0 -59
  671. package/modules/hosts/opencode/agents/independent-reviewer.md +0 -53
  672. package/modules/hosts/opencode/agents/ui-verifier.md +0 -52
  673. package/modules/hosts/opencode/commands/wf-build.md +0 -69
  674. package/modules/hosts/opencode/commands/wf-deploy.md +0 -58
  675. package/modules/hosts/opencode/commands/wf-design.md +0 -49
  676. package/modules/hosts/opencode/commands/wf-gate-checklist.md +0 -77
  677. package/modules/hosts/opencode/commands/wf-maintain.md +0 -76
  678. package/modules/hosts/opencode/commands/wf-new-task.md +0 -102
  679. package/modules/hosts/opencode/commands/wf-pipeline-run.md +0 -35
  680. package/modules/hosts/opencode/commands/wf-plan.md +0 -40
  681. package/modules/hosts/opencode/commands/wf-review.md +0 -49
  682. package/modules/hosts/opencode/commands/wf-sync-hosts.md +0 -64
  683. package/modules/hosts/opencode/commands/wf-test.md +0 -68
  684. package/modules/hosts/trae/agents/implementer.md +0 -52
  685. package/modules/hosts/trae/agents/independent-reviewer.md +0 -51
  686. package/modules/hosts/trae/agents/ui-verifier.md +0 -50
  687. package/modules/hosts/trae/commands/wf-build.md +0 -70
  688. package/modules/hosts/trae/commands/wf-deploy.md +0 -59
  689. package/modules/hosts/trae/commands/wf-design.md +0 -50
  690. package/modules/hosts/trae/commands/wf-gate-checklist.md +0 -78
  691. package/modules/hosts/trae/commands/wf-maintain.md +0 -77
  692. package/modules/hosts/trae/commands/wf-new-task.md +0 -103
  693. package/modules/hosts/trae/commands/wf-pipeline-run.md +0 -36
  694. package/modules/hosts/trae/commands/wf-plan.md +0 -41
  695. package/modules/hosts/trae/commands/wf-review.md +0 -50
  696. package/modules/hosts/trae/commands/wf-sync-hosts.md +0 -65
  697. package/modules/hosts/trae/commands/wf-test.md +0 -69
  698. package/modules/hosts/trae/hooks/post-edit-check.cjs +0 -98
  699. package/modules/hosts/trae/hooks/pre-shell-check.cjs +0 -192
  700. package/modules/hosts/trae/hooks/resolve-shell.cjs +0 -30
  701. package/modules/hosts/trae/hooks.json +0 -29
  702. package/modules/hosts/trae/rules/beautify-input-chinese.md +0 -6
  703. package/modules/hosts/trae/rules/git-commit-message.md +0 -10
  704. package/modules/hosts/trae/rules/project-workflow.md +0 -14
  705. package/modules/hosts/zcode/agents/implementer.md +0 -51
  706. package/modules/hosts/zcode/agents/independent-reviewer.md +0 -49
  707. package/modules/hosts/zcode/agents/ui-verifier.md +0 -48
  708. package/src/add-gate.mjs +0 -116
  709. package/src/add-gate.test.mjs +0 -103
  710. package/src/add-host.mjs +0 -68
  711. package/src/cli.mjs +0 -169
  712. package/src/doctor.mjs +0 -629
  713. package/src/executor.mjs +0 -262
  714. package/src/executor.test.mjs +0 -295
  715. package/src/fresh-init.test.mjs +0 -64
  716. package/src/gate-dotnet-ca.test.mjs +0 -124
  717. package/src/gates.test.mjs +0 -143
  718. package/src/init.mjs +0 -382
  719. package/src/init.test.mjs +0 -163
  720. package/src/instance-ref.test.mjs +0 -62
  721. package/src/jscpd-drift.test.mjs +0 -144
  722. package/src/pack.test.mjs +0 -24
  723. package/src/profiles.mjs +0 -183
  724. package/src/render.mjs +0 -132
  725. package/src/rule-budget.test.mjs +0 -103
  726. package/src/run-tests.mjs +0 -56
  727. package/src/stack-profile.test.mjs +0 -95
  728. package/src/sync-hosts.mjs +0 -257
  729. package/src/sync-hosts.test.mjs +0 -291
  730. package/src/sync.mjs +0 -228
  731. package/src/sync.test.mjs +0 -452
  732. package/src/trae-hooks.test.mjs +0 -127
  733. package/src/validate.mjs +0 -77
  734. package/src/validate.test.mjs +0 -95
  735. package/templates/.gitattributes +0 -17
  736. package/templates/AGENTS.md +0 -57
  737. package/templates/_agents/board/index.html +0 -676
  738. package/templates/_agents/commands/build.md +0 -84
  739. package/templates/_agents/commands/deploy.md +0 -66
  740. package/templates/_agents/commands/design.md +0 -63
  741. package/templates/_agents/commands/gate-checklist.md +0 -91
  742. package/templates/_agents/commands/maintain.md +0 -90
  743. package/templates/_agents/commands/new-task.md +0 -110
  744. package/templates/_agents/commands/pipeline-run.md +0 -43
  745. package/templates/_agents/commands/plan.md +0 -48
  746. package/templates/_agents/commands/review.md +0 -62
  747. package/templates/_agents/commands/sync-hosts.md +0 -77
  748. package/templates/_agents/commands/test.md +0 -87
  749. package/templates/_agents/control-surfaces.txt +0 -53
  750. package/templates/_agents/engine-lock.json +0 -342
  751. package/templates/_agents/hooks/check-index-incremental.mjs +0 -48
  752. package/templates/_agents/hooks/check-pairing-incremental.mjs +0 -66
  753. package/templates/_agents/hooks/check-wiki-ledger.mjs +0 -30
  754. package/templates/_agents/hooks/commit-check.cjs +0 -193
  755. package/templates/_agents/hooks/local-pre-commit +0 -6
  756. package/templates/_agents/lane-surfaces.txt +0 -17
  757. package/templates/_agents/level-hints.txt +0 -30
  758. package/templates/_agents/loop/papercut-debt/DESIGN.md +0 -112
  759. package/templates/_agents/mechanism-registry.md +0 -27
  760. package/templates/_agents/metric-claims.txt +0 -81
  761. package/templates/_agents/notes/engine-internals.md +0 -17
  762. package/templates/_agents/notes/runtime-env.md +0 -18
  763. package/templates/_agents/roles/implementer.md +0 -47
  764. package/templates/_agents/roles/independent-reviewer.md +0 -45
  765. package/templates/_agents/roles/ui-verifier.md +0 -44
  766. package/templates/_agents/rule-budgets.txt +0 -18
  767. package/templates/_agents/scripts/agg-delegations.cjs +0 -302
  768. package/templates/_agents/scripts/agg-delegations.test.mjs +0 -282
  769. package/templates/_agents/scripts/agg-gate-stats.mjs +0 -113
  770. package/templates/_agents/scripts/agg-gate-stats.test.mjs +0 -95
  771. package/templates/_agents/scripts/agg-judgments.mjs +0 -156
  772. package/templates/_agents/scripts/agg-judgments.test.mjs +0 -93
  773. package/templates/_agents/scripts/archive-sweep.mjs +0 -235
  774. package/templates/_agents/scripts/archive-sweep.test.mjs +0 -129
  775. package/templates/_agents/scripts/check-attribution.mjs +0 -37
  776. package/templates/_agents/scripts/check-convergence.mjs +0 -124
  777. package/templates/_agents/scripts/check-engine-integrity.mjs +0 -220
  778. package/templates/_agents/scripts/check-engine-integrity.test.mjs +0 -215
  779. package/templates/_agents/scripts/check-funnel.mjs +0 -56
  780. package/templates/_agents/scripts/check-hygiene.mjs +0 -167
  781. package/templates/_agents/scripts/check-hygiene.test.mjs +0 -182
  782. package/templates/_agents/scripts/check-index-incremental.test.mjs +0 -73
  783. package/templates/_agents/scripts/check-lane-surface.mjs +0 -238
  784. package/templates/_agents/scripts/check-lane-surface.test.mjs +0 -302
  785. package/templates/_agents/scripts/check-ledger-invariant.mjs +0 -527
  786. package/templates/_agents/scripts/check-ledger-invariant.test.mjs +0 -639
  787. package/templates/_agents/scripts/check-loop-rev.test.mjs +0 -336
  788. package/templates/_agents/scripts/check-loop-unit.test.mjs +0 -103
  789. package/templates/_agents/scripts/check-loop.mjs +0 -1958
  790. package/templates/_agents/scripts/check-loop.sh +0 -6
  791. package/templates/_agents/scripts/check-loop.test.mjs +0 -3875
  792. package/templates/_agents/scripts/check-metric-claims.mjs +0 -277
  793. package/templates/_agents/scripts/check-prejudgment.mjs +0 -64
  794. package/templates/_agents/scripts/check-registry.mjs +0 -45
  795. package/templates/_agents/scripts/check-scope.mjs +0 -96
  796. package/templates/_agents/scripts/check-scope.test.mjs +0 -96
  797. package/templates/_agents/scripts/check-scripts-syntax.mjs +0 -61
  798. package/templates/_agents/scripts/check-scripts-syntax.test.mjs +0 -72
  799. package/templates/_agents/scripts/check-spec-verif.mjs +0 -47
  800. package/templates/_agents/scripts/check-stage-index.mjs +0 -40
  801. package/templates/_agents/scripts/check-stage-index.test.mjs +0 -77
  802. package/templates/_agents/scripts/closeout-l1.mjs +0 -217
  803. package/templates/_agents/scripts/closeout-l1.test.mjs +0 -105
  804. package/templates/_agents/scripts/commit-check-trigger.test.mjs +0 -205
  805. package/templates/_agents/scripts/compact-ledgers.mjs +0 -97
  806. package/templates/_agents/scripts/compact-ledgers.test.mjs +0 -162
  807. package/templates/_agents/scripts/confirm-doc.mjs +0 -603
  808. package/templates/_agents/scripts/confirm-doc.test.mjs +0 -1103
  809. package/templates/_agents/scripts/doctor.test.mjs +0 -770
  810. package/templates/_agents/scripts/draft-sediment.mjs +0 -178
  811. package/templates/_agents/scripts/draft-sediment.test.mjs +0 -272
  812. package/templates/_agents/scripts/edit-face-check.mjs +0 -109
  813. package/templates/_agents/scripts/edit-face-check.test.mjs +0 -99
  814. package/templates/_agents/scripts/ensure-board.mjs +0 -185
  815. package/templates/_agents/scripts/fill-intent.mjs +0 -91
  816. package/templates/_agents/scripts/fill-intent.test.mjs +0 -113
  817. package/templates/_agents/scripts/fill-plan.mjs +0 -79
  818. package/templates/_agents/scripts/fill-plan.test.mjs +0 -224
  819. package/templates/_agents/scripts/fill-spec.mjs +0 -70
  820. package/templates/_agents/scripts/fill-spec.test.mjs +0 -266
  821. package/templates/_agents/scripts/fixture-scripts.mjs +0 -153
  822. package/templates/_agents/scripts/fixture-scripts.test.mjs +0 -112
  823. package/templates/_agents/scripts/gate-checklist.mjs +0 -209
  824. package/templates/_agents/scripts/gate-checklist.test.mjs +0 -201
  825. package/templates/_agents/scripts/gate-seg.mjs +0 -54
  826. package/templates/_agents/scripts/gate-seg.test.mjs +0 -112
  827. package/templates/_agents/scripts/gen-effective-policy.mjs +0 -107
  828. package/templates/_agents/scripts/gen-effective-policy.test.mjs +0 -100
  829. package/templates/_agents/scripts/gen-verify-evidence.mjs +0 -107
  830. package/templates/_agents/scripts/gen-verify-evidence.test.mjs +0 -84
  831. package/templates/_agents/scripts/gen-wiki-board.mjs +0 -276
  832. package/templates/_agents/scripts/gen-wiki-board.test.mjs +0 -249
  833. package/templates/_agents/scripts/gen-workflow-dashboard.mjs +0 -251
  834. package/templates/_agents/scripts/gen-workflow-dashboard.test.mjs +0 -188
  835. package/templates/_agents/scripts/gen-workflow-index.mjs +0 -201
  836. package/templates/_agents/scripts/gen-workflow-index.test.mjs +0 -152
  837. package/templates/_agents/scripts/gen-workflow-metrics.mjs +0 -334
  838. package/templates/_agents/scripts/gen-workflow-metrics.test.mjs +0 -224
  839. package/templates/_agents/scripts/git-merge-jsonl.mjs +0 -63
  840. package/templates/_agents/scripts/git-merge-jsonl.test.mjs +0 -125
  841. package/templates/_agents/scripts/judgment-ledger.mjs +0 -65
  842. package/templates/_agents/scripts/judgment-ledger.test.mjs +0 -129
  843. package/templates/_agents/scripts/kb-cache-evict.mjs +0 -50
  844. package/templates/_agents/scripts/kb-cache-evict.test.mjs +0 -104
  845. package/templates/_agents/scripts/kb-search.mjs +0 -413
  846. package/templates/_agents/scripts/kb-search.test.mjs +0 -299
  847. package/templates/_agents/scripts/lane-surface-audit.mjs +0 -143
  848. package/templates/_agents/scripts/lane-surface-audit.test.mjs +0 -93
  849. package/templates/_agents/scripts/ledger-doc-chain.test.mjs +0 -166
  850. package/templates/_agents/scripts/ledger-loader.mjs +0 -108
  851. package/templates/_agents/scripts/ledger-loader.test.mjs +0 -131
  852. package/templates/_agents/scripts/ledger-prune.mjs +0 -96
  853. package/templates/_agents/scripts/ledger-prune.test.mjs +0 -120
  854. package/templates/_agents/scripts/ledger-shards.mjs +0 -344
  855. package/templates/_agents/scripts/ledger-shards.test.mjs +0 -356
  856. package/templates/_agents/scripts/ledger-ts-monotonic.test.mjs +0 -135
  857. package/templates/_agents/scripts/level-criteria.mjs +0 -231
  858. package/templates/_agents/scripts/level-criteria.test.mjs +0 -281
  859. package/templates/_agents/scripts/mechanism-retire-watch.mjs +0 -183
  860. package/templates/_agents/scripts/mechanism-retire-watch.test.mjs +0 -114
  861. package/templates/_agents/scripts/papercut-debt-controller.mjs +0 -141
  862. package/templates/_agents/scripts/papercut-debt-controller.test.mjs +0 -127
  863. package/templates/_agents/scripts/papercut-debt-sensor.mjs +0 -170
  864. package/templates/_agents/scripts/papercut-debt-sensor.test.mjs +0 -146
  865. package/templates/_agents/scripts/pipeline-run-docs.mjs +0 -76
  866. package/templates/_agents/scripts/pipeline-run-run.mjs +0 -63
  867. package/templates/_agents/scripts/pipeline-run.mjs +0 -867
  868. package/templates/_agents/scripts/pipeline-run.test.mjs +0 -517
  869. package/templates/_agents/scripts/policy.mjs +0 -281
  870. package/templates/_agents/scripts/pre-push.test.mjs +0 -105
  871. package/templates/_agents/scripts/resolve-merge-conflicts.mjs +0 -110
  872. package/templates/_agents/scripts/resolve-merge-conflicts.test.mjs +0 -87
  873. package/templates/_agents/scripts/rewrite-file.mjs +0 -133
  874. package/templates/_agents/scripts/rewrite-file.test.mjs +0 -148
  875. package/templates/_agents/scripts/rule-budget.mjs +0 -96
  876. package/templates/_agents/scripts/rule-budget.test.mjs +0 -118
  877. package/templates/_agents/scripts/run-tests.mjs +0 -99
  878. package/templates/_agents/scripts/run-tests.test.mjs +0 -105
  879. package/templates/_agents/scripts/solidify-task.mjs +0 -107
  880. package/templates/_agents/scripts/solidify-task.test.mjs +0 -129
  881. package/templates/_agents/scripts/stage-gates.mjs +0 -343
  882. package/templates/_agents/scripts/stage-gates.test.mjs +0 -105
  883. package/templates/_agents/scripts/trust-mode.mjs +0 -67
  884. package/templates/_agents/scripts/trust-mode.test.mjs +0 -110
  885. package/templates/_agents/scripts/verify-wiki-consistency.mjs +0 -253
  886. package/templates/_agents/scripts/verify-wiki-consistency.test.mjs +0 -123
  887. package/templates/_agents/scripts/verify.mjs +0 -210
  888. package/templates/_agents/scripts/verify.test.mjs +0 -358
  889. package/templates/_agents/scripts/wf-journal.mjs +0 -231
  890. package/templates/_agents/scripts/wf-journal.test.mjs +0 -216
  891. package/templates/_agents/scripts/wiki-search.mjs +0 -19
  892. package/templates/_agents/scripts/wiki-search.test.mjs +0 -57
  893. package/templates/_agents/scripts/workflow-board-server.mjs +0 -393
  894. package/templates/_agents/scripts/workflow-board-server.test.mjs +0 -201
  895. package/templates/_agents/scripts/workflow-enums.mjs +0 -70
  896. package/templates/_agents/scripts/workflow-enums.test.mjs +0 -118
  897. package/templates/_agents/scripts/workflows-check.mjs +0 -260
  898. package/templates/_agents/scripts/workflows-check.test.mjs +0 -278
  899. package/templates/_agents/scripts-test-exempt.txt +0 -16
  900. package/templates/_agents/skills/papercut-fix/SKILL.md +0 -60
  901. package/templates/_agents/skills/papercut-fix/references/response-template.md +0 -81
  902. package/templates/_agents/skills/review-method/SKILL.md +0 -55
  903. package/templates/_agents/skills/verify-ui/SKILL.md +0 -61
  904. package/templates/_agents/skills/wiki/SKILL.md +0 -106
  905. package/templates/_agents/workflow-enums.txt +0 -26
  906. package/templates/_agents/workflow-modules.txt +0 -11
  907. package/templates/_agents/workflows/_TEMPLATE.md +0 -75
  908. package/templates/_agents/workflows/pipeline-closing.md +0 -28
  909. package/templates/_agents/workflows//347/244/272/344/276/213-/345/271/266/350/241/214/345/256/236/347/216/260/350/257/204/345/256/241.md +0 -16
  910. package/templates/_githooks/commit-msg +0 -17
  911. package/templates/_githooks/post-commit +0 -10
  912. package/templates/_githooks/pre-commit +0 -126
  913. package/templates/_githooks/pre-merge-commit +0 -29
  914. package/templates/_githooks/pre-push +0 -136
  915. package/templates/_github/workflows/kit-ci.yml +0 -49
  916. package/templates/wiki/INDEX.md +0 -73
  917. package/templates/wiki/drafts-archive/README.md +0 -3
  918. package/templates/wiki//344/272/247/345/223/201/351/234/200/346/261/202/README.md +0 -3
  919. package/templates/wiki//345/274/200/345/217/221/346/226/271/346/241/210/README.md +0 -3
  920. package/templates/wiki//346/225/260/346/215/256/347/273/264/346/212/244/README.md +0 -3
  921. package/templates/wiki//346/265/213/350/257/225/346/212/245/345/221/212/README.md +0 -3
  922. package/templates/wiki//347/224/250/346/210/267/345/212/237/350/203/275/README.md +0 -3
  923. package/templates/wiki//347/237/245/350/257/206/346/262/211/346/267/200/346/200/273/350/247/210.html +0 -77
  924. package/templates/wiki//351/241/271/347/233/256/350/247/204/350/214/203/README.md +0 -3
  925. package/templates/wiki//351/241/271/347/233/256/350/256/241/345/210/222/README.md +0 -3
  926. package/templates/workflow/README.md +0 -90
  927. package/templates/workflow/delegations.md +0 -29
  928. package/templates/workflow/incidents/_TEMPLATE.md +0 -51
  929. package/templates/workflow/intents/_TEMPLATE.md +0 -46
  930. package/templates/workflow/papercuts.md +0 -9
  931. package/templates/workflow/plans/_TEMPLATE.md +0 -47
  932. package/templates/workflow/regression-checklist.md +0 -23
  933. package/templates/workflow/specs/_TEMPLATE.md +0 -80
  934. /package/templates/{_agents → engine/.agents}/board/marked.min.js +0 -0
  935. /package/templates/{_agents/workflows → engine/.agents/pipelines}/steps//347/244/272/344/276/213-/351/203/250/347/275/262/351/252/214/350/257/201.md" +0 -0
  936. /package/templates/{_agents → engine/.agents}/scripts/git-core.mjs +0 -0
@@ -1,124 +0,0 @@
1
- #!/usr/bin/env node
2
- // gate-dotnet-ca.test.mjs — dotnet-ca 门禁模块判定回归(2026-09-27 host-gates-p1,incident 三件套「防复发验证」落点)
3
- // 方法:fixture 临时 git 仓构造 CONFIG 指向的最小目录树,复制包源 check-architecture.sh 并按场景改 CONFIG,
4
- // spawn sh 跑门禁断言 exit 码与输出。三场景对位三个 P1:
5
- // ①豁免清单多值生效(P1-B1:旧 tr ':' '|' 造 "A|B" BRE 字面量永不命中)
6
- // ②CONTROLLERS_DIR 缺失 fail-closed(P1-B3:旧 2>/dev/null 静默放行)
7
- // ③csproj 缺失 fail-closed(随 B3:旧 glob 展开失败静默放行)
8
- // 用法:node src/gate-dotnet-ca.test.mjs(npm test 随跑)
9
- import fs from 'node:fs';
10
- import os from 'node:os';
11
- import path from 'node:path';
12
- import { spawnSync } from 'node:child_process';
13
- import { fileURLToPath } from 'node:url';
14
-
15
- let pass = 0;
16
- let fail = 0;
17
- const check = (desc, cond, detail = '') => {
18
- if (cond) { pass++; console.log(`PASS ${desc}`); }
19
- else { fail++; console.log(`FAIL ${desc}${detail ? `\n${detail}` : ''}`); }
20
- };
21
-
22
- const PKG_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
23
- const GATE_SRC = path.join(PKG_ROOT, 'modules', 'gates', 'dotnet-ca', 'check-architecture.sh');
24
-
25
- // mkfixture:最小 dotnet 目录树(Application/API/Domain/Infrastructure/Controllers)+ 可覆盖 CONFIG
26
- function mkfixture(configOverride = {}) {
27
- const root = fs.mkdtempSync(path.join(os.tmpdir(), 'gate-ca-test-'));
28
- const dirs = {
29
- APP_DIR: 'backend/src/App.Application',
30
- API_DIR: 'backend/src/App.API',
31
- DBCTX_FILE: 'backend/src/App.Infrastructure/Data/AppDbContext.cs',
32
- DOMAIN_ENTITIES_DIR: 'backend/src/App.Domain/Entities',
33
- CONTROLLERS_DIR: 'backend/src/App.API/Controllers',
34
- };
35
- for (const rel of Object.values(dirs)) fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true }); // 文件型键取父目录;目录型键随后显式建
36
- fs.mkdirSync(path.join(root, dirs.APP_DIR), { recursive: true });
37
- fs.mkdirSync(path.join(root, dirs.API_DIR), { recursive: true });
38
- fs.mkdirSync(path.join(root, dirs.DOMAIN_ENTITIES_DIR), { recursive: true });
39
- fs.mkdirSync(path.join(root, dirs.CONTROLLERS_DIR), { recursive: true });
40
- fs.writeFileSync(path.join(root, dirs.DBCTX_FILE), 'class AppDbContext { }\n');
41
- const cfg = {
42
- ...Object.fromEntries(Object.entries(dirs).map(([k, v]) => [k, v])),
43
- DBCTX_CLASS: 'AppDbContext',
44
- INFRA_USING: 'using App.Infrastructure',
45
- EXEMPT_CTRL: 'ExemptedA:ExemptedB',
46
- SHARED_TYPES: '',
47
- ...configOverride,
48
- };
49
- // 包源脚本 CONFIG 段替换:按「^KEY=" 任意到行尾」整行重写(值含 / 且行尾带注释——不用值内正则);
50
- // EXEMPT_CTRL/SHARED_TYPES 行尾有注释,重写时保留注释语义(测试值自带说明则省略)
51
- let script = fs.readFileSync(GATE_SRC, 'utf8');
52
- for (const [k, v] of Object.entries(cfg)) {
53
- script = script.replace(new RegExp(`^${k}=.*$`, 'm'), `${k}="${v}"`);
54
- }
55
- const scriptPath = path.join(root, 'check-architecture.sh');
56
- fs.writeFileSync(scriptPath, script);
57
- // fixture 需为 git 仓(脚本首行 git rev-parse --show-toplevel)
58
- spawnSync('git', ['init', '-q', '.'], { cwd: root });
59
- return { root, scriptPath, dirs };
60
- }
61
- const runGate = (root, scriptPath) => spawnSync('sh', [scriptPath], { cwd: root, encoding: 'utf8' });
62
- // ctrlWrite:往 fixture 的 Controllers 目录写文件(目录可能尚未创建)
63
- const ctrlWrite = (root, dirs, name, content) => {
64
- fs.mkdirSync(path.join(root, dirs.CONTROLLERS_DIR), { recursive: true });
65
- fs.writeFileSync(path.join(root, dirs.CONTROLLERS_DIR, name), content);
66
- };
67
- // addCsproj:补干净 csproj(fail-closed 后红线 1 先查 csproj——不写则走不到目标断言)
68
- const addCsproj = (root, dirs) => fs.writeFileSync(path.join(root, dirs.APP_DIR, 'App.Application.csproj'), '<Project Sdk="Microsoft.NET.Sdk" />\n');
69
-
70
- // ---- ① 豁免清单多值(P1-B1)----
71
- {
72
- const { root, scriptPath, dirs } = mkfixture();
73
- addCsproj(root, dirs);
74
- // API 层两处 DbContext 引用:一个在豁免 Controller 文件、一个在普通 Controller——豁免只应放过前者
75
- ctrlWrite(root, dirs, 'ExemptedAController.cs', '// AppDbContext 直接引用(豁免)\n');
76
- ctrlWrite(root, dirs, 'OrdersController.cs', '// AppDbContext 直接引用(应拦)\n');
77
- const r = runGate(root, scriptPath);
78
- check('①多值豁免生效:ExemptedA 文件行不出现、Orders 行出现(违例 exit 1)',
79
- r.status === 1 && !r.stderr.includes('ExemptedAController') && r.stderr.includes('OrdersController'),
80
- `exit=${r.status}\n${r.stdout}\n${r.stderr}`);
81
- fs.rmSync(root, { recursive: true, force: true });
82
- }
83
- // ①附:干净树(豁免命中全部 DbContext 引用)→ 红线 3 不拦(整体 exit 0 需其余红线干净)
84
- {
85
- const { root, scriptPath, dirs } = mkfixture();
86
- addCsproj(root, dirs);
87
- ctrlWrite(root, dirs, 'ExemptedAController.cs', '// AppDbContext\n');
88
- ctrlWrite(root, dirs, 'ExemptedBController.cs', '// AppDbContext\n');
89
- const r = runGate(root, scriptPath);
90
- check('①两个豁免 Controller 全命中 → 红线 3 零输出 exit 0', r.status === 0 && !r.stderr, `exit=${r.status}\n${r.stderr}`);
91
- fs.rmSync(root, { recursive: true, force: true });
92
- }
93
-
94
- // ---- ② CONTROLLERS_DIR 缺失 fail-closed(P1-B3)----
95
- {
96
- const { root, scriptPath, dirs } = mkfixture({ CONTROLLERS_DIR: 'backend/src/App.API/NotThere' });
97
- addCsproj(root, dirs);
98
- const r = runGate(root, scriptPath);
99
- check('②Controllers 目录缺失 → fail-closed exit 1 点名目标(旧代码静默放行)',
100
- r.status === 1 && r.stderr.includes('NotThere') && r.stderr.includes('fail-closed'),
101
- `exit=${r.status}\n${r.stderr}`);
102
- fs.rmSync(root, { recursive: true, force: true });
103
- }
104
-
105
- // ---- ③ csproj 缺失 fail-closed(随 B3)----
106
- {
107
- const { root, scriptPath } = mkfixture();
108
- // Application 目录存在但无 .csproj(glob 展开失败形态)
109
- const r = runGate(root, scriptPath);
110
- check('③Application 无 csproj → fail-closed exit 1(旧代码静默放行)',
111
- r.status === 1 && r.stderr.includes('csproj') && r.stderr.includes('fail-closed'),
112
- `exit=${r.status}\n${r.stderr}`);
113
- fs.rmSync(root, { recursive: true, force: true });
114
- }
115
- // ③附:有 csproj 且干净 → 过红线 1
116
- {
117
- const { root, scriptPath, dirs } = mkfixture();
118
- fs.writeFileSync(path.join(root, dirs.APP_DIR, 'App.Application.csproj'), '<Project Sdk="Microsoft.NET.Sdk" />\n');
119
- const r = runGate(root, scriptPath);
120
- check('③干净 csproj 存在 → 整体 exit 0', r.status === 0, `exit=${r.status}\n${r.stderr}`); fs.rmSync(root, { recursive: true, force: true });
121
- }
122
-
123
- console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
124
- process.exit(fail ? 1 : 0);
@@ -1,143 +0,0 @@
1
- #!/usr/bin/env node
2
- // 三个可选门禁:临时 git 仓库里暂存违规 / 干净文件,断言退出码。
3
- import { spawnSync } from 'node:child_process';
4
- import fs from 'node:fs';
5
- import os from 'node:os';
6
- import path from 'node:path';
7
- import { fileURLToPath } from 'node:url';
8
-
9
- const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
10
- const git = process.platform === 'win32' ? 'git.exe' : 'git';
11
- let pass = 0;
12
- let fail = 0;
13
- const check = (name, cond, detail = '') => {
14
- if (cond) { pass++; console.log(`PASS ${name}`); }
15
- else { fail++; console.log(`FAIL ${name}${detail ? `\n ${detail}` : ''}`); }
16
- };
17
-
18
- function repo() {
19
- const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'fk-gate-'));
20
- spawnSync(git, ['init', '-q'], { cwd: dir });
21
- spawnSync(git, ['config', 'user.email', 't@t'], { cwd: dir });
22
- spawnSync(git, ['config', 'user.name', 't'], { cwd: dir });
23
- return dir;
24
- }
25
- function stage(dir, rel, text) {
26
- const abs = path.join(dir, rel);
27
- fs.mkdirSync(path.dirname(abs), { recursive: true });
28
- fs.writeFileSync(abs, text);
29
- spawnSync(git, ['add', '--', rel], { cwd: dir });
30
- }
31
- function run(script, dir, env = {}) {
32
- return spawnSync(process.execPath, [path.join(ROOT, script)], {
33
- cwd: dir, encoding: 'utf8', env: { ...process.env, ...env },
34
- });
35
- }
36
-
37
- {
38
- const dir = repo();
39
- stage(dir, 'src/app.mjs', "import { x } from '../tests/helper.mjs';\n");
40
- const bad = run('modules/gates/node-layer/check-node-layer.mjs', dir);
41
- check('node-layer 引用 tests → exit 1', bad.status === 1 && bad.stderr.includes('src/app.mjs'), bad.stderr);
42
- fs.rmSync(dir, { recursive: true, force: true });
43
- }
44
- {
45
- const dir = repo();
46
- stage(dir, 'src/app.mjs', "import { x } from './util.mjs';\n");
47
- const ok = run('modules/gates/node-layer/check-node-layer.mjs', dir);
48
- check('node-layer 只引 src 内文件 → exit 0', ok.status === 0, ok.stderr);
49
- fs.rmSync(dir, { recursive: true, force: true });
50
- }
51
- {
52
- const dir = repo();
53
- stage(dir, 'src/app.mjs', "import { x } from '../tests/helper.mjs';\n");
54
- fs.writeFileSync(path.join(dir, 'src/app.mjs'), "import { x } from './util.mjs';\n");
55
- const bad = run('modules/gates/node-layer/check-node-layer.mjs', dir);
56
- check('node-layer 暂存违规、工作区已改回 → exit 1', bad.status === 1 && bad.stderr.includes('src/app.mjs'), bad.stderr);
57
- fs.rmSync(dir, { recursive: true, force: true });
58
- }
59
- {
60
- const dir = repo();
61
- stage(dir, 'src/app.mjs', "import { x } from './util.mjs';\n");
62
- fs.writeFileSync(path.join(dir, 'src/app.mjs'), "import { x } from '../tests/helper.mjs';\n");
63
- const ok = run('modules/gates/node-layer/check-node-layer.mjs', dir);
64
- check('node-layer 暂存干净、工作区违规 → exit 0', ok.status === 0, ok.stderr);
65
- fs.rmSync(dir, { recursive: true, force: true });
66
- }
67
- {
68
- const dir = repo();
69
- stage(dir, 'pkg/mod.py', 'from tests.unit import helper\n');
70
- const bad = run('modules/gates/py-import/check-py-import.mjs', dir);
71
- check('py-import 业务文件 import tests → exit 1', bad.status === 1 && bad.stderr.includes('pkg/mod.py'), bad.stderr);
72
- fs.rmSync(dir, { recursive: true, force: true });
73
- }
74
- {
75
- const dir = repo();
76
- stage(dir, 'tests/test_mod.py', 'from tests.unit import helper\n');
77
- const ok = run('modules/gates/py-import/check-py-import.mjs', dir);
78
- check('py-import 测试目录自身 → exit 0', ok.status === 0, ok.stderr);
79
- fs.rmSync(dir, { recursive: true, force: true });
80
- }
81
- {
82
- const dir = repo();
83
- stage(dir, 'pkg/mod.py', 'from tests.unit import helper\n');
84
- fs.writeFileSync(path.join(dir, 'pkg/mod.py'), 'import pkg.local\n');
85
- const bad = run('modules/gates/py-import/check-py-import.mjs', dir);
86
- check('py-import 暂存违规、工作区已改回 → exit 1', bad.status === 1 && bad.stderr.includes('pkg/mod.py'), bad.stderr);
87
- fs.rmSync(dir, { recursive: true, force: true });
88
- }
89
- {
90
- const dir = repo();
91
- stage(dir, 'pkg/mod.py', 'import pkg.local\n');
92
- fs.writeFileSync(path.join(dir, 'pkg/mod.py'), 'from tests.unit import helper\n');
93
- const ok = run('modules/gates/py-import/check-py-import.mjs', dir);
94
- check('py-import 暂存干净、工作区违规 → exit 0', ok.status === 0, ok.stderr);
95
- fs.rmSync(dir, { recursive: true, force: true });
96
- }
97
- {
98
- const dir = repo();
99
- const body = 'before\n<!-- GENERATED:BEGIN -->\nsecret\n<!-- GENERATED:END -->\nafter\n';
100
- stage(dir, 'doc.md', body);
101
- spawnSync(git, ['-c', 'user.email=t@t', '-c', 'user.name=t', 'commit', '-qm', 'base'], { cwd: dir });
102
- const next = body.replace('secret', 'edited');
103
- stage(dir, 'doc.md', next);
104
- const bad = run('modules/gates/generated-readonly/check-generated.mjs', dir);
105
- check('generated 区被改 → exit 1', bad.status === 1 && bad.stderr.includes('GENERATED'), bad.stderr);
106
- const allowed = run('modules/gates/generated-readonly/check-generated.mjs', dir, { FLOW_KIT_ALLOW_GENERATED: '1' });
107
- check('FLOW_KIT_ALLOW_GENERATED=1 → exit 0', allowed.status === 0, allowed.stderr);
108
- fs.writeFileSync(path.join(dir, 'doc.md'), 'before\nafter\n');
109
- const still = run('modules/gates/generated-readonly/check-generated.mjs', dir);
110
- check('generated 暂存改区、工作区删掉标记 → exit 1', still.status === 1 && still.stderr.includes('GENERATED'), still.stderr);
111
- fs.rmSync(dir, { recursive: true, force: true });
112
- }
113
- {
114
- const dir = repo();
115
- const body = 'before\n<!-- GENERATED:BEGIN -->\nsecret\n<!-- GENERATED:END -->\nafter\n';
116
- stage(dir, 'doc.md', body);
117
- spawnSync(git, ['-c', 'user.email=t@t', '-c', 'user.name=t', 'commit', '-qm', 'base'], { cwd: dir });
118
- stage(dir, 'doc.md', body.replace('before', 'before2'));
119
- fs.writeFileSync(path.join(dir, 'doc.md'), body.replace('secret', 'edited'));
120
- const ok = run('modules/gates/generated-readonly/check-generated.mjs', dir);
121
- check('generated 暂存改区外、工作区改区内 → exit 0', ok.status === 0, ok.stderr);
122
- fs.rmSync(dir, { recursive: true, force: true });
123
- }
124
- {
125
- const dir = repo();
126
- stage(dir, 'src/app.mjs', 'export const fix = 1;\n');
127
- stage(dir, 'tests/app.test.mjs', "import { fix } from '../src/app.mjs';\n");
128
- const bad = run('modules/gates/test-protect/check-test-protect.mjs', dir);
129
- check('test-protect 测试与代码同框 → exit 1', bad.status === 1 && bad.stderr.includes('test-protect'), bad.stderr);
130
- const allowed = run('modules/gates/test-protect/check-test-protect.mjs', dir, { FLOW_KIT_ALLOW_TEST_EDIT: '1' });
131
- check('test-protect FLOW_KIT_ALLOW_TEST_EDIT=1 → exit 0', allowed.status === 0, allowed.stderr);
132
- fs.rmSync(dir, { recursive: true, force: true });
133
- }
134
- {
135
- const dir = repo();
136
- stage(dir, 'tests/app.test.mjs', "import { fix } from '../src/app.mjs';\n");
137
- const ok = run('modules/gates/test-protect/check-test-protect.mjs', dir);
138
- check('test-protect 纯测试提交 → exit 0', ok.status === 0, ok.stderr);
139
- fs.rmSync(dir, { recursive: true, force: true });
140
- }
141
-
142
- console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
143
- process.exit(fail ? 1 : 0);
package/src/init.mjs DELETED
@@ -1,382 +0,0 @@
1
- // flow-kit init:无参数 → 交互确认环节;带参数 → 直接执行。
2
- // 渲染模板树 + 宿主适配层 → 生成 owned 基线配置 → 挂 git 钩子 → 写 kit.json → 跑生成器与 doctor
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import readline from 'node:readline';
6
- import { execSync, spawnSync } from 'node:child_process';
7
- import { renderTree, renderContent, sha256, scriptTrusted, listTree } from './render.mjs';
8
- import { HOSTS, STACKS, STACK_ALIASES, settingsJson, commitCheckConfig, pickStackVars, isOwned, srcTemplatePath, TEMPLATE_DRIFT_EXCLUDE } from './profiles.mjs';
9
- import { doctor, GATE_TRUST_DEFAULT } from './doctor.mjs';
10
-
11
- function fail(msg) {
12
- console.error(`❌ ${msg}`);
13
- process.exit(1);
14
- }
15
-
16
- function runNode(target, script, args = []) {
17
- const r = spawnSync(process.execPath, [script, ...args], { cwd: target, encoding: 'utf8' });
18
- return { ok: r.status === 0, out: `${r.stdout || ''}${r.stderr || ''}` };
19
- }
20
-
21
- // makePrompt:行队列式问答(比逐次 rl.question 稳——管道/EOF 提前关闭时不会抛错,安全回退默认值或取消)
22
- // ask(question, def):def 为默认值(空输入 / EOF 回退);无 def 时空输入返回 ''(用于必须显式确认的问句)
23
- function makePrompt() {
24
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: false });
25
- const lines = [];
26
- const waiters = [];
27
- let ended = false;
28
- rl.on('line', (l) => { const w = waiters.shift(); if (w) w(l.trim()); else lines.push(l.trim()); });
29
- rl.on('close', () => { ended = true; while (waiters.length) waiters.shift()(''); });
30
- return {
31
- ask(question, def) {
32
- return new Promise((resolve) => {
33
- process.stdout.write(def ? `${question}(直接回车=${def}):` : `${question}:`);
34
- const fin = (a) => resolve(a || def || '');
35
- const l = lines.shift();
36
- if (l !== undefined) fin(l);
37
- else if (ended) fin('');
38
- else waiters.push(fin);
39
- });
40
- },
41
- close() { rl.close(); },
42
- };
43
- }
44
-
45
- // ---- TUI 风格:hand-rolled ANSI(零依赖纪律);NO_COLOR / 非 TTY 自动降级纯文本 ----
46
- const RAW = !process.env.NO_COLOR && process.stdout.isTTY;
47
- const paint = (code, s) => (RAW ? `\x1b[${code}m${s}\x1b[0m` : String(s));
48
- const bold = (s) => paint('1', s);
49
- const dim = (s) => paint('2', s);
50
- const cyan = (s) => paint('36', s);
51
-
52
- // normalizeStack:ts/js 用户口径归一为 node 栈;其余小写透传(STACKS 校验兜底未知值)
53
- export function normalizeStack(s) {
54
- const t = String(s || '').trim().toLowerCase();
55
- return STACK_ALIASES[t] || t;
56
- }
57
-
58
- // parseChoices:序号/名称/混输多选解析(逗号/全角逗号/空白分隔,去重保序);
59
- // 空输入 → [def](EOF/直接回车安全回退默认);含非法 token 返回 null(调用方就地重问);
60
- // map 用于输入侧归一(如 ts→node),序号先于 map 解析。
61
- export function parseChoices(input, names, def, map = (x) => x) {
62
- const text = String(input || '').trim();
63
- if (!text) return [def];
64
- const out = [];
65
- for (const tok of text.split(/[,,\s]+/).filter(Boolean)) {
66
- const i = /^\d+$/.test(tok) ? Number(tok) - 1 : names.indexOf(map(tok.toLowerCase()));
67
- if (!Number.isInteger(i) || i < 0 || i >= names.length) return null;
68
- if (!out.includes(names[i])) out.push(names[i]);
69
- }
70
- return out;
71
- }
72
-
73
- // ---- AGENTS.md 骨架探测与追加补齐 ----
74
- // 标记随模板渲染落盘:新装/补齐后的 AGENTS.md 都含它,探测以此为准(不猜标题——避免误伤项目自写的同名「AI工作流」节)
75
- const SKELETON_MARKER = '<!-- flow-kit:agents-skeleton -->';
76
- export function hasAgentsSkeleton(text) {
77
- return String(text || '').includes(SKELETON_MARKER);
78
- }
79
- // mergeAgents:原内容在上(尾部空白折叠),空行分隔,含标记的完整骨架在下
80
- export function menuMark(i) {
81
- return String(i + 1);
82
- }
83
-
84
- export function mergeAgents(existing, incoming) {
85
- const head = String(existing || '').replace(/\s+$/, '');
86
- const tail = String(incoming || '').trim();
87
- return head ? `${head}\n\n${tail}\n` : `${tail}\n`;
88
- }
89
-
90
- // 交互确认环节:序号菜单问答(宿主多选 → 技术栈 → 看板端口)→ 已选 recap → 显式确认
91
- // (EOF / 非 y 一律取消,不装;makePrompt 行式语义不变——管道/EOF 安全回退默认)
92
- async function interactive() {
93
- const p = makePrompt();
94
- const hostNames = Object.keys(HOSTS);
95
- const stackNames = Object.keys(STACKS);
96
- const stackLabel = (n) => (n === 'node' ? 'node(ts/js)' : n);
97
- const menu = (names) => ' ' + names.map((n, i) => dim(`${menuMark(i)} ${stackLabel(n)}`)).join(dim(' '));
98
-
99
- console.log(bold(cyan('▶ flow-kit init')) + dim(' · AI 闭环工作流 + wiki 知识层脚手架'));
100
- console.log(dim(' 安装到当前目录:.agents/ · .githooks/ · workflow/ · wiki/ · AGENTS.md · .github/workflows/kit-ci.yml(CI 远端门,非 GitHub 装户可删)(已存在的文件保守跳过;AGENTS.md 无工作流骨架时文末追加补齐)'));
101
- try {
102
- let hosts;
103
- for (;;) {
104
- console.log(`\n${cyan('── 1/3 · agent 宿主')} ${dim('· 可多选')}`);
105
- console.log(menu(hostNames));
106
- const picked = parseChoices(await p.ask(dim(' 序号或名称,逗号分隔(直接回车 = zcode)')), hostNames, hostNames[0]);
107
- if (picked) { hosts = picked; break; }
108
- console.log(dim(' ⚠️ 没认出这个组合——序号或名称再来一次(如 1,3 或 zcode,trae)'));
109
- }
110
- let stack;
111
- for (;;) {
112
- console.log(`\n${cyan('── 2/3 · 技术栈')} ${dim('· 决定编译检查与自检验命令初值')}`);
113
- console.log(menu(stackNames));
114
- const picked = parseChoices(await p.ask(dim(' 序号或名称(直接回车 = none;ts/js 自动归一 node)')), stackNames, 'none', normalizeStack);
115
- if (picked) { stack = picked[0]; break; }
116
- console.log(dim(' ⚠️ 没认出——序号或名称再来一次'));
117
- }
118
- console.log(`\n${cyan('── 3/3 · workflow 看板端口')}`);
119
- let boardPort = '';
120
- for (;;) {
121
- boardPort = (await p.ask(dim(' 直接回车 = 8933'))) || '8933';
122
- if (/^(0|[1-9]\d*)$/.test(String(boardPort)) && Number(boardPort) >= 1 && Number(boardPort) <= 65535) break;
123
- console.log(dim(' ⚠️ 端口须为 1-65535 整数——再来一次'));
124
- }
125
-
126
- console.log(`\n ${bold(`宿主 ${hosts.join('、')}`)}${dim(' | ')}${bold(`技术栈 ${stack}`)}${dim(' | ')}${bold(`端口 ${boardPort}`)}`);
127
- const yes = await p.ask(dim(' 确认安装到当前目录?(y/n,回车取消)'));
128
- if (!/^(y|yes)$/i.test(yes)) {
129
- console.log('已取消(未做任何改动)');
130
- process.exit(0);
131
- }
132
- return { hosts: hosts.join(','), stack, boardPort, dir: process.cwd(), force: false };
133
- } finally {
134
- p.close();
135
- }
136
- }
137
-
138
- export async function init(args, pkgRoot) {
139
- let opt;
140
- if (args.length === 0) {
141
- opt = await interactive();
142
- } else {
143
- opt = { hosts: 'zcode', stack: 'none', boardPort: '8933', dir: process.cwd(), force: false };
144
- for (let i = 0; i < args.length; i++) {
145
- const a = args[i];
146
- const next = () => {
147
- const v = args[++i];
148
- if (v === undefined) fail(`选项 ${a} 缺少值`);
149
- return v;
150
- };
151
- if (a === '--hosts') opt.hosts = next();
152
- else if (a === '--stack') opt.stack = next();
153
- else if (a === '--board-port') opt.boardPort = next();
154
- else if (a === '--dir') opt.dir = next();
155
- else if (a === '--force') opt.force = true;
156
- else fail(`未知选项:${a}(flow-kit init --help 看全部)`);
157
- }
158
- }
159
-
160
- opt.stack = normalizeStack(opt.stack);
161
- if (!STACKS[opt.stack]) fail(`未知技术栈:${opt.stack}(可选 dotnet | node(ts/js) | python | go | none——对应编译检查与自检验命令初值)`);
162
- // 端口校验(2026-09-27 p2-batch1):任意字符串曾直进 vars 渲染进 AGENTS.md(AI 每会话必读面)——1-65535 整数 fail-fast
163
- if (!/^(0|[1-9]\d*)$/.test(String(opt.boardPort)) || Number(opt.boardPort) < 1 || Number(opt.boardPort) > 65535) {
164
- fail(`--board-port 须为 1-65535 整数(现「${opt.boardPort}」)`);
165
- }
166
- const hosts = opt.hosts.split(',').map((s) => s.trim()).filter(Boolean);
167
- for (const h of hosts) {
168
- if (!HOSTS[h]) fail(`未知宿主:${h}(可选 ${Object.keys(HOSTS).join(' | ')})`);
169
- }
170
-
171
- const target = path.resolve(opt.dir);
172
- if (!fs.existsSync(target)) fail(`目标目录不存在:${target}`);
173
- const kitPath = path.join(target, '.agents', 'kit.json');
174
- if (fs.existsSync(kitPath) && !opt.force) {
175
- fail(`${target} 已安装 agentic-flow-kit(.agents/kit.json 存在)。重装/修复用 --force;升级将由 flow-kit sync 提供。`);
176
- }
177
-
178
- const vars = { BOARD_PORT: String(opt.boardPort), ...pickStackVars(opt.stack) };
179
-
180
- console.log(`${bold(cyan('▶ flow-kit init'))}${dim(' → ')}${target}`);
181
- console.log(` 宿主:${hosts.join(', ')} | 技术栈:${opt.stack} | 看板端口:${opt.boardPort}`);
182
-
183
- // 1) 模板树(保守:已存在文件跳过,--force 覆盖;p2-batch1:--force 下已存在 owned 仍跳过——
184
- // 「项目自持」两态模型在重装路径的对齐,实测曾静默丢用户自定义「项目适配区」内容。
185
- // 保护集 = 包源模板树内 isOwned 为真的 rel,现场枚举单源不另抄清单)
186
- const protectSet = opt.force
187
- ? new Set(listTree(path.join(pkgRoot, 'templates')).filter((rel) => isOwned(rel)))
188
- : null;
189
- const t = renderTree(path.join(pkgRoot, 'templates'), target, vars, { force: opt.force, protectSet });
190
- for (const rel of t.protectedSkipped || []) {
191
- console.log(` 跳过(owned 项目自持,--force 不覆盖):${rel}——如需重置请手动删除后重跑`);
192
- }
193
-
194
- // 1.5) AGENTS.md 特例:已存在且无骨架标记 → 文末追加补齐(原内容保留);带标记 → 保守跳过。
195
- // 门槛含 protectedSkipped(p2-batch1 复核 P1-2):--force 下 owned 保护跳过也属「已存在不覆盖」,
196
- // 无骨架时同样要追加(追加本就是非覆盖语义,与保护不冲突)——否则自带 AGENTS.md 的装户经
197
- // --force 重装永远拿不到工作流骨架且无感知
198
- let agentsMergedSha = null;
199
- if (t.skipped.includes('AGENTS.md') || (t.protectedSkipped || []).includes('AGENTS.md')) {
200
- const agentsAbs = path.join(target, 'AGENTS.md');
201
- const existing = fs.readFileSync(agentsAbs, 'utf8');
202
- if (hasAgentsSkeleton(existing)) {
203
- t.skipped = t.skipped.filter((r) => r !== 'AGENTS.md'); // 专属提示已报,不进末尾「未覆盖」汇总重复列
204
- console.log(' 跳过(已存在且含工作流骨架):AGENTS.md');
205
- } else {
206
- const incoming = renderContent(fs.readFileSync(path.join(pkgRoot, 'templates', 'AGENTS.md'), 'utf8'), vars);
207
- fs.writeFileSync(agentsAbs, mergeAgents(existing, incoming));
208
- // LF 归一记账(init-p1-batch P1-4):用户 CRLF 原文 + LF 追加的混合文件与 doctor §6.6 / sync ownedSha 同口径
209
- agentsMergedSha = sha256(Buffer.from(fs.readFileSync(agentsAbs, 'utf8').replace(/\r\n/g, '\n'), 'utf8'));
210
- t.skipped = t.skipped.filter((r) => r !== 'AGENTS.md');
211
- console.log(' AGENTS.md 已存在但无工作流骨架——文末追加补齐(原内容保留,「项目适配区」照常自填)');
212
- }
213
- }
214
-
215
- // 2) 宿主适配层
216
- const hostResults = {};
217
- for (const h of hosts) {
218
- hostResults[h] = renderTree(path.join(pkgRoot, 'modules', 'hosts', h), path.join(target, HOSTS[h].dir), vars, { force: opt.force });
219
- }
220
- // 换 --hosts 重装:旧宿主目录脱账提示(kit.json 只记新宿主,孤儿对 doctor §4.5 不可见——审查 P2-1 附带)
221
- if (fs.existsSync(kitPath)) {
222
- try {
223
- const oldHosts = (JSON.parse(fs.readFileSync(kitPath, 'utf8')).options?.hosts) || [];
224
- const removed = oldHosts.filter((h) => HOSTS[h] && !hosts.includes(h));
225
- for (const h of removed) {
226
- console.log(` ⚠️ 旧宿主 ${HOSTS[h].dir}/ 不在新 --hosts 清单——其文件已脱账(成静默孤儿),如弃用请手动删除目录`);
227
- }
228
- } catch { /* 旧台账不可读(--force 重装修复场景),跳过提示 */ }
229
- }
230
-
231
- // 3) 生成的 owned 基线配置(引擎按固定路径读取;存在则跳过,永不覆盖;技术栈命令由项目在文件内自填)
232
- const generated = {
233
- '.agents/settings.json': settingsJson(opt.stack),
234
- '.agents/hooks/commit-check.config.json': commitCheckConfig(opt.stack),
235
- };
236
- const ownedGenerated = [];
237
- for (const [rel, content] of Object.entries(generated)) {
238
- const p = path.join(target, rel);
239
- if (fs.existsSync(p)) { console.log(` 跳过(已存在):${rel}`); continue; }
240
- fs.mkdirSync(path.dirname(p), { recursive: true });
241
- fs.writeFileSync(p, content);
242
- ownedGenerated.push({ rel, sha256: sha256(Buffer.from(content, 'utf8')) });
243
- }
244
-
245
- // 4) .gitignore 追加(缺哪条补哪条)。2026-10-05 起七个宿主一律 localOnly:false,
246
- // 宿主目录不再自动进 .gitignore——补 .agents/cache/ 运行时缓存与 .agents/judgments.jsonl
247
- // 判定流水(2026-10-13 judgment-ledger 回灌 B4:check-loop 每次真实运行追加的本机运行判定,
248
- // 各机各自产生不跨机共享,月度聚合经 agg-judgments.mjs)。
249
- const giPath = path.join(target, '.gitignore');
250
- const giNeed = ['.agents/cache/', '.agents/judgments.jsonl', ...(hosts.filter((h) => HOSTS[h].localOnly).map((h) => `${HOSTS[h].dir}/`))];
251
- let giText = fs.existsSync(giPath) ? fs.readFileSync(giPath, 'utf8') : '';
252
- const giAdd = giNeed.filter((l) => !giText.split(/\r?\n/).some((x) => x.trim() === l));
253
- if (giAdd.length) {
254
- giText = (giText.endsWith('\n') || giText === '' ? giText : giText + '\n') + '# agentic-flow-kit\n' + giAdd.join('\n') + '\n';
255
- fs.writeFileSync(giPath, giText);
256
- console.log(` .gitignore 追加:${giAdd.join('、')}`);
257
- }
258
-
259
- // 5) git 钩子挂载
260
- try {
261
- execSync('git rev-parse --git-dir', { cwd: target, stdio: 'pipe' });
262
- execSync('git config core.hooksPath .githooks', { cwd: target, stdio: 'pipe' });
263
- console.log(' 已挂载 git 钩子:core.hooksPath=.githooks(pre-commit / pre-push / commit-msg / post-commit / pre-merge-commit)');
264
- try {
265
- execSync('git config merge.ours.driver true', { cwd: target, stdio: 'pipe' });
266
- console.log(' 已启用 merge.ours driver(.gitattributes 的 merge=ours 生效)');
267
- } catch { /* 可选配置,失败不阻断 */ }
268
- try {
269
- // 台账并集合并 driver(2026-10-12 ledger-merge-driver):确认台账是尾部追加形态,多人/多 worktree
270
- // 并行时默认合并会给文本冲突,人工「整取一侧」会静默丢确认行。配了 driver 后合并 = 并集去重。
271
- // 本机态配置不跨机共享(与 core.hooksPath 同款性质)——漏配则退化为文本冲突,不静默丢数据。
272
- execSync('git config merge.jsonl-union.driver "node .agents/scripts/git-merge-jsonl.mjs %O %A %B"', { cwd: target, stdio: 'pipe' });
273
- console.log(' 已启用 merge.jsonl-union driver(台账 .agents/*.jsonl 合并走并集去重,不再文本冲突)');
274
- } catch { /* 可选配置,失败不阻断 */ }
275
- } catch {
276
- console.log(' ⚠️ 目标不是 git 仓库——钩子未挂载;git init 后手动执行:git config core.hooksPath .githooks');
277
- }
278
-
279
- // 6) 生成器首跑(幂等):workflow/INDEX.md 活跃层索引 + wiki 速览计数与看板 DATA
280
- // 先于 kit.json 记账(init-p1-batch P1-2:生成器会重写 owned 起步文档,先跑后记账则 doctor §6.6 对账即绿,
281
- // fresh init 不再必现 owned FAIL / exit 1);执行前过供应链防线(P1-3)——目标侧脚本与包源渲染值
282
- // sha 一致才执行(目标目录预置脚本不可信,「已存在保守跳过」语义下预置件会被原样保留)
283
- const guardRun = (rel) => {
284
- const g = scriptTrusted({ pkgRoot, target, rel, vars });
285
- if (!g.ok) {
286
- console.log(` ⚠️ 跳过执行 ${rel}——${g.note}(供应链防线:只执行与包源渲染值一致的目标侧脚本)`);
287
- return false;
288
- }
289
- return true;
290
- };
291
- if (guardRun('.agents/scripts/gen-workflow-index.mjs')) {
292
- const genIndex = runNode(target, '.agents/scripts/gen-workflow-index.mjs');
293
- console.log(genIndex.ok ? ' 已生成 workflow/INDEX.md(活跃层索引)' : ` ⚠️ gen-workflow-index 失败:${genIndex.out.split('\n')[0]}`);
294
- }
295
- if (guardRun('.agents/scripts/gen-wiki-board.mjs')) {
296
- const genBoard = runNode(target, '.agents/scripts/gen-wiki-board.mjs');
297
- console.log(genBoard.ok ? ' 已生成 wiki 速览计数与知识沉淀总览 DATA' : ` ⚠️ gen-wiki-board 失败:${genBoard.out.split('\n')[0]}`);
298
- }
299
-
300
- // 7) kit.json:managed(模板/适配层,升级可覆盖)与 owned(基线配置+起步文档,升级不动)台账
301
- // owned 的生成器目标按生成后盘面重记(P1-2);记账一律 LF 归一 sha(P1-4——render 写盘已归一,
302
- // 生成器重写目标与用户合并文件两侧同口径,跨 checkout 字节稳定)
303
- const shaText = (p) => sha256(Buffer.from(fs.readFileSync(p, 'utf8').replace(/\r\n/g, '\n'), 'utf8'));
304
- const GEN_TARGETS = TEMPLATE_DRIFT_EXCLUDE; // 单源挪 profiles(2026-10-06 template-downstream):模板感知排除面与生成器重记面同集
305
- const managed = [
306
- ...t.written.filter((f) => !isOwned(f.rel)),
307
- // 宿主文件渲染时相对宿主根,入台账须还原为项目根相对路径
308
- ...hosts.flatMap((h) => hostResults[h].written.map((f) => ({ ...f, rel: `${HOSTS[h].dir}/${f.rel}` }))),
309
- ];
310
- const owned = [...t.written.filter((f) => isOwned(f.rel)), ...ownedGenerated]
311
- .map((f) => (GEN_TARGETS.has(f.rel) && fs.existsSync(path.join(target, f.rel))
312
- ? { ...f, sha256: shaText(path.join(target, f.rel)) }
313
- : f));
314
- // protectedSkipped 件按盘面 LF 归一 sha 补记(p2-batch1 复核 P2-3):--force 重装受保护 owned
315
- // 不补记会让 doctor §6.6 的漂移可见性静默消失(台账缺口对体检不可见)
316
- for (const rel of t.protectedSkipped || []) {
317
- if (!isOwned(rel) || !fs.existsSync(path.join(target, rel))) continue;
318
- if (rel === 'AGENTS.md' && agentsMergedSha) continue; // 追加特例已记(agentsMergedSha),避免台账重复条目(复核收口 P2)
319
- if (owned.some((f) => f.rel === rel)) continue;
320
- owned.push({ rel, sha256: shaText(path.join(target, rel)) });
321
- }
322
- if (agentsMergedSha) owned.push({ rel: 'AGENTS.md', sha256: agentsMergedSha });
323
- // 模板下发感知初始锚(2026-10-06 template-downstream):有包源模板对应的 owned 条目记
324
- // srcSha256=包源模板原始文件 LF 归一 sha——锚记「见过的源」而非「期望盘面」(装户渲染/定制与锚正交);
325
- // GEN_TARGETS 是生成器重写目标,不期望被跟随,排除出感知面(防「拉取了也被重写」的单周期无谓出账)
326
- const ownedFinal = owned.map((f) => {
327
- if (GEN_TARGETS.has(f.rel)) return f;
328
- const src = srcTemplatePath(pkgRoot, f.rel);
329
- return src ? { ...f, srcSha256: shaText(src) } : f;
330
- });
331
- const pkg = JSON.parse(fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8'));
332
- fs.mkdirSync(path.dirname(kitPath), { recursive: true });
333
- fs.writeFileSync(kitPath, `${JSON.stringify({
334
- kit: 'agentic-flow-kit',
335
- version: pkg.version,
336
- // policyVersion 12(2026-10-13 B6b-2 回灌对齐源仓 v12):新装即带全锚——v9–v12 = incidentRegrSince /
337
- // specVerifSince / attributionSince / convergenceSince / convergenceHardSince / reviewerSince
338
- // (§21–26 六段 + §3x 防复发证据门 + 复核上下文子检)。新装空台账零回溯:各段锚前存量豁免、空仓零
339
- // 噪声;v1–v11 存量装户不受影响(缺键 → 对应消费段整体跳过)。
340
- policyVersion: 12,
341
- // 新装默认只跑硬规则。缺省(旧台账无此字段)在 check-loop 里仍是全量,避免升级后卫生检查突然消失。
342
- audit: false,
343
- // 门禁信任档(2026-10-12 gate-trust-level):默认 'project' —— gate 安装锚失配只 WARN,
344
- // 装户对门有最终所有权(1.7.11 起现状,此处只是把隐式默认显式命名)。多仓/组织场景改 'org'
345
- // 即让失配升 FAIL(doctor exit 1),对齐 managed policy 的组织级强制。
346
- // ⚠️ 默认值取 gateTrustOf / GATE_TRUST_DEFAULT 而非字面量:判据单源在 doctor.mjs(§6.6b 消费),
347
- // 两处各写一份字符串即漂移面(N3 教训)。
348
- gateTrust: GATE_TRUST_DEFAULT,
349
- createdAt: new Date().toISOString(),
350
- options: { hosts, stack: opt.stack, boardPort: String(opt.boardPort) },
351
- managed,
352
- owned: ownedFinal,
353
- }, null, 2)}\n`);
354
- console.log(` kit.json 台账:managed ${managed.length} 份 | owned ${ownedFinal.length} 份(版本 ${pkg.version})`);
355
-
356
- // 生效规则视图种子(2026-10-13 verify-gates 回灌):verify.mjs `effective-policy` 门 --check 对缺文件
357
- // 判漂移(红)——源仓等价物是该生成物随生成器同笔入库;kit 新装由 init 首跑种子,保证 fresh 装户
358
- // 首个 verify 不被卡。**必须在 kit.json 落盘之后**:渲染读 loadKitPolicy(.agents/kit.json 的
359
- // policyVersion),先跑会按回落 v1 种子、装完即与 v12 视图漂移(fresh 实测)。本文件不入 owned 台账
360
- // (生成器重写面,非模板渲染件),不受 P1-2「先跑后记账」约束;视图日期 = 安装日,--check 按磁盘
361
- // 视图日期重渲染,跨锚日字节稳定。
362
- if (guardRun('.agents/scripts/gen-effective-policy.mjs')) {
363
- const genPolicy = runNode(target, '.agents/scripts/gen-effective-policy.mjs');
364
- console.log(genPolicy.ok ? ' 已生成 workflow/effective-policy.md(生效规则视图——policy 变更后重生成并随同提交)' : ` ⚠️ gen-effective-policy 失败:${genPolicy.out.split('\n')[0]}`);
365
- }
366
-
367
- // 8) 自检(kit.json 已按生成后盘面记账——doctor §6.6 应全绿,fresh init 以 exit 0 收场)
368
- // 输出语义(p2-batch1 P2-4):doctor 打印在异步端口回调里、晚于本横幅——脚本化消费方按退出码判定
369
- console.log('▶ flow-kit doctor(安装产物已就位;体检 FAIL 时本命令 exit 1,产物无损——按 FAIL 项处置)');
370
- doctor(['--dir', target], pkgRoot);
371
-
372
- if (t.skipped.length) console.log(` 跳过(已存在,未覆盖):${t.skipped.join('、')}`);
373
- for (const h of hosts) if (hostResults[h].skipped.length) console.log(` 跳过(${h} 已存在):${hostResults[h].skipped.join('、')}`);
374
- console.log('\n✅ 安装完成。下一步:');
375
- if (opt.stack === 'none') {
376
- console.log(' 1. 技术栈未配置(none):填 AGENTS.md「项目适配区」构建/测试命令 + .agents/hooks/commit-check.config.json 的 builds(编译检查)+ settings.json allow(自检验命令权限)');
377
- } else {
378
- console.log(' 1. 按需微调 AGENTS.md「项目适配区」与 .agents/hooks/commit-check.config.json(已按技术栈预填初值)');
379
- }
380
- console.log(' 2. 按项目模块改 .agents/workflow-modules.txt 词表与 .agents/rule-budgets.txt 预算');
381
- console.log(' 3. 第一个任务从 .agents/commands/new-task.md 流程发起(立 intent → 与用户确认)');
382
- }