@xulthekl/team-flow 0.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.agents/skills +1 -0
  3. package/.claude/always/phase-guard.md +3 -0
  4. package/.claude-plugin/marketplace.json +20 -0
  5. package/.claude-plugin/plugin.json +31 -0
  6. package/.codex-plugin/plugin.json +45 -0
  7. package/.codexignore +6 -0
  8. package/.cursor-plugin/marketplace.json +17 -0
  9. package/.cursor-plugin/plugin.json +31 -0
  10. package/.github/copilot-instructions.md +15 -0
  11. package/.github/dependabot.yml +10 -0
  12. package/.github/plugin/marketplace.json +42 -0
  13. package/.github/workflows/ci.yml +98 -0
  14. package/.github/workflows/hol-plugin-scanner.yml +17 -0
  15. package/.opencode/INSTALL.md +61 -0
  16. package/.opencode/plugins/team-flow.js +70 -0
  17. package/AGENTS.md +280 -0
  18. package/CHANGELOG.md +635 -0
  19. package/CONTRIBUTING.md +115 -0
  20. package/GEMINI.md +14 -0
  21. package/HANDOFF.md +219 -0
  22. package/INSTALL.md +810 -0
  23. package/LICENSE +21 -0
  24. package/README.md +185 -0
  25. package/SECURITY.md +37 -0
  26. package/agents/bug-investigator.md +180 -0
  27. package/agents/change-split-auditor.md +257 -0
  28. package/agents/code-reviewer.md +171 -0
  29. package/agents/cross-change-consistency-checker.md +215 -0
  30. package/agents/prd-completeness-reviewer.md +197 -0
  31. package/agents/prototype-builder.md +230 -0
  32. package/agents/prototype-env-scout.md +156 -0
  33. package/agents/prototype-reviewer.md +226 -0
  34. package/assets/icon.svg +6 -0
  35. package/dist/index.d.ts +13 -0
  36. package/dist/index.js +5 -0
  37. package/dist/parsing/change-parser.d.ts +12 -0
  38. package/dist/parsing/change-parser.js +54 -0
  39. package/dist/parsing/requirement-blocks.d.ts +31 -0
  40. package/dist/parsing/requirement-blocks.js +192 -0
  41. package/dist/schema/base.d.ts +7 -0
  42. package/dist/schema/base.js +1 -0
  43. package/dist/schema/change.d.ts +25 -0
  44. package/dist/schema/change.js +1 -0
  45. package/dist/schema/index.d.ts +3 -0
  46. package/dist/schema/index.js +1 -0
  47. package/dist/schema/spec.d.ts +11 -0
  48. package/dist/schema/spec.js +1 -0
  49. package/dist/validation/constants.d.ts +42 -0
  50. package/dist/validation/constants.js +42 -0
  51. package/dist/validation/tokenizer.d.ts +17 -0
  52. package/dist/validation/tokenizer.js +173 -0
  53. package/dist/validation/types.d.ts +40 -0
  54. package/dist/validation/types.js +1 -0
  55. package/dist/validation/validator.d.ts +21 -0
  56. package/dist/validation/validator.js +489 -0
  57. package/docs/README_en.md +358 -0
  58. package/docs/artifact-contract.md +96 -0
  59. package/docs/decision-points.md +88 -0
  60. package/docs/e2e-integration-design.md +207 -0
  61. package/docs/examples/README.md +25 -0
  62. package/docs/examples/add-dark-mode/README.md +13 -0
  63. package/docs/examples/add-dark-mode/design.md +49 -0
  64. package/docs/examples/add-dark-mode/execution-contract.md +56 -0
  65. package/docs/examples/add-dark-mode/proposal.md +46 -0
  66. package/docs/examples/add-dark-mode/specs/ui-theme/spec.md +35 -0
  67. package/docs/examples/add-dark-mode/tasks.md +26 -0
  68. package/docs/examples/refactor-auth-boundary/README.md +15 -0
  69. package/docs/examples/refactor-auth-boundary/design.md +41 -0
  70. package/docs/examples/refactor-auth-boundary/execution-contract.md +61 -0
  71. package/docs/examples/refactor-auth-boundary/proposal.md +47 -0
  72. package/docs/examples/refactor-auth-boundary/specs/auth-boundary/spec.md +45 -0
  73. package/docs/examples/refactor-auth-boundary/tasks.md +25 -0
  74. package/docs/plans/2026-07-07-fix-batch-design.md +68 -0
  75. package/docs/plans/2026-07-20-001-refactor-skill-collaboration-protocol-plan.md +128 -0
  76. package/docs/platform-matrix.md +45 -0
  77. package/docs/prototype-design-research.md +206 -0
  78. package/docs/release-checklist.md +96 -0
  79. package/docs/showcase.html +699 -0
  80. package/docs/skill-rename-v0.8.0.md +49 -0
  81. package/docs/state-machine.md +162 -0
  82. package/gemini-extension.json +6 -0
  83. package/hooks/hooks-cursor.json +8 -0
  84. package/hooks/hooks.json +26 -0
  85. package/hooks/pre-tool-use-guard +116 -0
  86. package/hooks/session-start +14 -0
  87. package/llms.txt +51 -0
  88. package/package.json +48 -0
  89. package/plugin.json +27 -0
  90. package/prd/v1/plan.md +443 -0
  91. package/prd/v1/prd.md +580 -0
  92. package/scripts/check-update.mjs +91 -0
  93. package/scripts/check-version-consistency.mjs +345 -0
  94. package/scripts/ensure-branch.mjs +71 -0
  95. package/scripts/get-config +31 -0
  96. package/scripts/guard/checks/artifacts-exist.mjs +36 -0
  97. package/scripts/guard/checks/contract-current.mjs +33 -0
  98. package/scripts/guard/checks/contract-fresh.mjs +17 -0
  99. package/scripts/guard/checks/dp-gate-passed.mjs +35 -0
  100. package/scripts/guard/checks/dp3-approved.mjs +22 -0
  101. package/scripts/guard/checks/execution-plan-ready.mjs +40 -0
  102. package/scripts/guard/checks/execution-reviews-passed.mjs +36 -0
  103. package/scripts/guard/checks/schema-valid.mjs +63 -0
  104. package/scripts/guard/checks/specs-merged.mjs +51 -0
  105. package/scripts/guard/checks/tasks-complete.mjs +31 -0
  106. package/scripts/guard/checks/tests-passing.mjs +31 -0
  107. package/scripts/guard/design-token-guard.mjs +237 -0
  108. package/scripts/guard/guard.mjs +205 -0
  109. package/scripts/infer-workflow.mjs +136 -0
  110. package/scripts/install-amazon-q.mjs +9 -0
  111. package/scripts/install-cline.mjs +9 -0
  112. package/scripts/install-continue.mjs +9 -0
  113. package/scripts/install-cursor.mjs +265 -0
  114. package/scripts/install-git-hooks.mjs +82 -0
  115. package/scripts/install-kiro.mjs +9 -0
  116. package/scripts/install-pi.mjs +9 -0
  117. package/scripts/install-qoder.mjs +9 -0
  118. package/scripts/install-qwen.mjs +9 -0
  119. package/scripts/install-roocode.mjs +9 -0
  120. package/scripts/install-windsurf.mjs +9 -0
  121. package/scripts/install-zcode.mjs +265 -0
  122. package/scripts/lib/cmd-audit.mjs +127 -0
  123. package/scripts/lib/cmd-checkpoint.mjs +118 -0
  124. package/scripts/lib/cmd-config.mjs +88 -0
  125. package/scripts/lib/cmd-doctor.mjs +267 -0
  126. package/scripts/lib/cmd-execution.mjs +206 -0
  127. package/scripts/lib/cmd-handoff.mjs +94 -0
  128. package/scripts/lib/cmd-inject.mjs +310 -0
  129. package/scripts/lib/cmd-install-amazon-q.mjs +11 -0
  130. package/scripts/lib/cmd-install-cline.mjs +11 -0
  131. package/scripts/lib/cmd-install-continue.mjs +11 -0
  132. package/scripts/lib/cmd-install-cursor.mjs +14 -0
  133. package/scripts/lib/cmd-install-kiro.mjs +11 -0
  134. package/scripts/lib/cmd-install-pi.mjs +11 -0
  135. package/scripts/lib/cmd-install-qoder.mjs +11 -0
  136. package/scripts/lib/cmd-install-qwen.mjs +11 -0
  137. package/scripts/lib/cmd-install-roocode.mjs +11 -0
  138. package/scripts/lib/cmd-install-windsurf.mjs +11 -0
  139. package/scripts/lib/cmd-install-workbuddy.mjs +359 -0
  140. package/scripts/lib/cmd-install-zcode.mjs +14 -0
  141. package/scripts/lib/cmd-isolate.mjs +37 -0
  142. package/scripts/lib/cmd-list.mjs +71 -0
  143. package/scripts/lib/cmd-runtime.mjs +85 -0
  144. package/scripts/lib/cmd-solutions.mjs +71 -0
  145. package/scripts/lib/cmd-state.mjs +231 -0
  146. package/scripts/lib/cmd-sync.mjs +102 -0
  147. package/scripts/lib/cmd-validate.mjs +105 -0
  148. package/scripts/lib/cmd-version.mjs +148 -0
  149. package/scripts/lib/config-loader.mjs +107 -0
  150. package/scripts/lib/execution-plan.mjs +492 -0
  151. package/scripts/lib/execution-recommendation.mjs +221 -0
  152. package/scripts/lib/hash.mjs +74 -0
  153. package/scripts/lib/install.mjs +267 -0
  154. package/scripts/lib/platform-runtime-inventory.mjs +27 -0
  155. package/scripts/lib/platforms.mjs +165 -0
  156. package/scripts/lib/prototype-sync.mjs +192 -0
  157. package/scripts/lib/sdd-overlay.mjs +262 -0
  158. package/scripts/lib/shell-quote.mjs +4 -0
  159. package/scripts/lib/solutions-capture.mjs +102 -0
  160. package/scripts/lib/solutions-index-gen.mjs +112 -0
  161. package/scripts/lib/solutions-inject.mjs +77 -0
  162. package/scripts/lib/solutions-promote.mjs +145 -0
  163. package/scripts/lib/spec-paths.mjs +85 -0
  164. package/scripts/lib/state-loader.mjs +154 -0
  165. package/scripts/lint/lint-skills.mjs +149 -0
  166. package/scripts/lint/rules/behavior-consistency.mjs +56 -0
  167. package/scripts/lint/rules/dp-trigger-points.mjs +60 -0
  168. package/scripts/lint/rules/exception-handling.mjs +59 -0
  169. package/scripts/lint/rules/no-contradictory-instructions.mjs +67 -0
  170. package/scripts/lint/rules/no-redundant-checks.mjs +50 -0
  171. package/scripts/lint/rules/token-rules.mjs +122 -0
  172. package/scripts/review-package +44 -0
  173. package/scripts/task-brief +40 -0
  174. package/scripts/team-flow.mjs +164 -0
  175. package/scripts/token-baseline.mjs +158 -0
  176. package/scripts/validate-artifacts +96 -0
  177. package/scripts/verify-marketplace-release.mjs +59 -0
  178. package/skills/architecture-design/SKILL.md +140 -0
  179. package/skills/architecture-design/chapters/ch01-4a-domains.md +27 -0
  180. package/skills/architecture-design/chapters/ch02-change-cascade.md +27 -0
  181. package/skills/architecture-design/chapters/ch03-architecture-outputs.md +25 -0
  182. package/skills/architecture-design/chapters/ch04-entity-to-aggregate.md +27 -0
  183. package/skills/architecture-design/chapters/ch05-cqrs.md +32 -0
  184. package/skills/architecture-design/chapters/ch06-integration.md +54 -0
  185. package/skills/architecture-design/cheatsheet.md +51 -0
  186. package/skills/architecture-design/glossary.md +23 -0
  187. package/skills/architecture-design/patterns.md +32 -0
  188. package/skills/bug-investigator/SKILL.md +77 -0
  189. package/skills/build-executor/SKILL.md +163 -0
  190. package/skills/build-executor/implementer-prompt.md +162 -0
  191. package/skills/build-executor/references/execution-modes.md +86 -0
  192. package/skills/build-executor/task-reviewer-prompt.md +195 -0
  193. package/skills/ce-brainstorm/SKILL.md +415 -0
  194. package/skills/ce-brainstorm/references/agents/slack-researcher.md +127 -0
  195. package/skills/ce-brainstorm/references/blindspot-pass.md +70 -0
  196. package/skills/ce-brainstorm/references/brainstorm-sections.md +285 -0
  197. package/skills/ce-brainstorm/references/handoff.md +168 -0
  198. package/skills/ce-brainstorm/references/html-rendering.md +634 -0
  199. package/skills/ce-brainstorm/references/markdown-rendering.md +241 -0
  200. package/skills/ce-brainstorm/references/model-tiers.md +9 -0
  201. package/skills/ce-brainstorm/references/prd-mapping.md +71 -0
  202. package/skills/ce-brainstorm/references/product-pressure-test.md +42 -0
  203. package/skills/ce-brainstorm/references/reasoning-elevation.md +63 -0
  204. package/skills/ce-brainstorm/references/settled-decisions.md +45 -0
  205. package/skills/ce-brainstorm/references/synthesis-summary.md +282 -0
  206. package/skills/ce-brainstorm/references/universal-brainstorming.md +73 -0
  207. package/skills/ce-brainstorm/references/verdict-routing.md +26 -0
  208. package/skills/ce-brainstorm/references/visual-probes.md +158 -0
  209. package/skills/ce-brainstorm/scripts/visual-probe-server.js +418 -0
  210. package/skills/ce-compound/SKILL.md +114 -0
  211. package/skills/ce-compound/assets/resolution-template.md +94 -0
  212. package/skills/ce-compound/references/agents/best-practices-researcher.md +115 -0
  213. package/skills/ce-compound/references/agents/data-integrity-guardian.md +68 -0
  214. package/skills/ce-compound/references/agents/framework-docs-researcher.md +93 -0
  215. package/skills/ce-compound/references/agents/pattern-recognition-specialist.md +55 -0
  216. package/skills/ce-compound/references/agents/performance-oracle.md +108 -0
  217. package/skills/ce-compound/references/agents/security-sentinel.md +91 -0
  218. package/skills/ce-compound/references/agents/session-historian.md +83 -0
  219. package/skills/ce-compound/references/concepts-vocabulary.md +78 -0
  220. package/skills/ce-compound/references/full-mode-workflow.md +413 -0
  221. package/skills/ce-compound/references/grounding-validation.md +84 -0
  222. package/skills/ce-compound/references/lightweight-mode.md +53 -0
  223. package/skills/ce-compound/references/output-standards.md +182 -0
  224. package/skills/ce-compound/references/promotion-rules.md +38 -0
  225. package/skills/ce-compound/references/schema.yaml +231 -0
  226. package/skills/ce-compound/references/three-tier-index.md +55 -0
  227. package/skills/ce-compound/references/v0.5-upgrade.md +32 -0
  228. package/skills/ce-compound/references/write-flow.md +36 -0
  229. package/skills/ce-compound/references/yaml-schema.md +118 -0
  230. package/skills/ce-compound/scripts/session-history/discover-sessions.sh +130 -0
  231. package/skills/ce-compound/scripts/session-history/extract-errors.py +254 -0
  232. package/skills/ce-compound/scripts/session-history/extract-metadata.py +456 -0
  233. package/skills/ce-compound/scripts/session-history/extract-skeleton.py +575 -0
  234. package/skills/ce-compound/scripts/validate-doc-claims.py +346 -0
  235. package/skills/ce-compound/scripts/validate-frontmatter.py +137 -0
  236. package/skills/ce-ideate/SKILL.md +402 -0
  237. package/skills/ce-ideate/references/agents/issue-intelligence-analyst.md +200 -0
  238. package/skills/ce-ideate/references/agents/learnings-researcher.md +247 -0
  239. package/skills/ce-ideate/references/agents/slack-researcher.md +127 -0
  240. package/skills/ce-ideate/references/agents/web-researcher.md +121 -0
  241. package/skills/ce-ideate/references/divergent-ideation.md +89 -0
  242. package/skills/ce-ideate/references/html-rendering.md +634 -0
  243. package/skills/ce-ideate/references/ideation-sections.md +191 -0
  244. package/skills/ce-ideate/references/markdown-rendering.md +238 -0
  245. package/skills/ce-ideate/references/post-ideation-workflow.md +167 -0
  246. package/skills/ce-ideate/references/universal-ideation.md +107 -0
  247. package/skills/ce-ideate/references/web-research-cache.md +56 -0
  248. package/skills/ce-plan/SKILL.md +137 -0
  249. package/skills/ce-plan/references/agents/agent-native-planning-strategist.md +62 -0
  250. package/skills/ce-plan/references/agents/architecture-strategist.md +46 -0
  251. package/skills/ce-plan/references/agents/best-practices-researcher.md +114 -0
  252. package/skills/ce-plan/references/agents/data-integrity-guardian.md +68 -0
  253. package/skills/ce-plan/references/agents/data-migration-reviewer.md +103 -0
  254. package/skills/ce-plan/references/agents/deployment-verification-agent.md +157 -0
  255. package/skills/ce-plan/references/agents/framework-docs-researcher.md +93 -0
  256. package/skills/ce-plan/references/agents/git-history-analyzer.md +40 -0
  257. package/skills/ce-plan/references/agents/learnings-researcher.md +247 -0
  258. package/skills/ce-plan/references/agents/pattern-recognition-specialist.md +55 -0
  259. package/skills/ce-plan/references/agents/performance-oracle.md +108 -0
  260. package/skills/ce-plan/references/agents/repo-research-analyst.md +258 -0
  261. package/skills/ce-plan/references/agents/security-sentinel.md +91 -0
  262. package/skills/ce-plan/references/agents/slack-researcher.md +127 -0
  263. package/skills/ce-plan/references/agents/spec-flow-analyzer.md +80 -0
  264. package/skills/ce-plan/references/agents/web-researcher.md +121 -0
  265. package/skills/ce-plan/references/approach-altitude.md +55 -0
  266. package/skills/ce-plan/references/change-splitting.md +65 -0
  267. package/skills/ce-plan/references/completion-contract.md +33 -0
  268. package/skills/ce-plan/references/core-principles.md +40 -0
  269. package/skills/ce-plan/references/deepening-workflow.md +263 -0
  270. package/skills/ce-plan/references/dependency-graph.md +36 -0
  271. package/skills/ce-plan/references/html-rendering.md +634 -0
  272. package/skills/ce-plan/references/intake-routing.md +189 -0
  273. package/skills/ce-plan/references/markdown-rendering.md +238 -0
  274. package/skills/ce-plan/references/plan-handoff.md +150 -0
  275. package/skills/ce-plan/references/plan-sections.md +427 -0
  276. package/skills/ce-plan/references/plan-structure.md +120 -0
  277. package/skills/ce-plan/references/planning-modes.md +69 -0
  278. package/skills/ce-plan/references/reasoning-elevation.md +63 -0
  279. package/skills/ce-plan/references/research-workflow.md +165 -0
  280. package/skills/ce-plan/references/review-and-write.md +127 -0
  281. package/skills/ce-plan/references/settled-decisions.md +45 -0
  282. package/skills/ce-plan/references/synthesis-summary.md +418 -0
  283. package/skills/ce-plan/references/universal-planning.md +168 -0
  284. package/skills/ce-proof/SKILL.md +346 -0
  285. package/skills/ce-strategy/SKILL.md +97 -0
  286. package/skills/ce-strategy/references/interview.md +143 -0
  287. package/skills/ce-strategy/references/strategy-template.md +89 -0
  288. package/skills/code-reviewer/SKILL.md +84 -0
  289. package/skills/code-reviewer/code-reviewer-prompt.md +195 -0
  290. package/skills/contract-builder/SKILL.md +72 -0
  291. package/skills/design-system/SKILL.md +75 -0
  292. package/skills/design-system/references/agents/design-system-architect.md +138 -0
  293. package/skills/design-system/references/creation-flow.md +170 -0
  294. package/skills/design-system/references/preview-template.html +319 -0
  295. package/skills/design-system/references/token-derivation.md +115 -0
  296. package/skills/design-system/references/variant-schema.md +60 -0
  297. package/skills/e2e/SKILL.md +56 -0
  298. package/skills/e2e/references/test-verifier.md +40 -0
  299. package/skills/need-explorer/SKILL.md +79 -0
  300. package/skills/prototype/SKILL.md +98 -0
  301. package/skills/prototype/references/agents/design-system-architect.md +122 -0
  302. package/skills/prototype/references/checklist.md +82 -0
  303. package/skills/prototype/references/craft/accessibility-baseline.md +71 -0
  304. package/skills/prototype/references/craft/anti-ai-slop.md +87 -0
  305. package/skills/prototype/references/craft/laws-of-ux.md +60 -0
  306. package/skills/prototype/references/craft/state-coverage.md +81 -0
  307. package/skills/prototype/references/craft/typography-hierarchy.md +50 -0
  308. package/skills/prototype/references/layouts.md +223 -0
  309. package/skills/prototype/references/orchestration-flow.md +101 -0
  310. package/skills/prototype/references/prototype-scaffold/assets/design-tokens.css +19 -0
  311. package/skills/prototype/references/prototype-scaffold/components/button.html +3 -0
  312. package/skills/prototype/references/prototype-scaffold/design-system.md +7 -0
  313. package/skills/prototype/references/prototype-scaffold/flow.md +11 -0
  314. package/skills/prototype/references/prototype-scaffold/index.html +20 -0
  315. package/skills/prototype/references/prototype-scaffold/pages/index.html +11 -0
  316. package/skills/prototype/references/template.html +396 -0
  317. package/skills/release-archivist/SKILL.md +166 -0
  318. package/skills/release-archivist/references/closing-procedures.md +81 -0
  319. package/skills/session-handoff/SKILL.md +110 -0
  320. package/skills/session-handoff/references/context-extraction.md +70 -0
  321. package/skills/session-handoff/references/handoff-template.md +90 -0
  322. package/skills/session-handoff/references/skill-recommendation.md +43 -0
  323. package/skills/spec-merger/SKILL.md +66 -0
  324. package/skills/spec-writer/SKILL.md +149 -0
  325. package/skills/workflow-bootstrap/SKILL.md +148 -0
  326. package/skills/workflow-bootstrap/references/agents/codebase-recon-analyst.md +121 -0
  327. package/skills/workflow-bootstrap/references/b1-reconnaissance.md +80 -0
  328. package/skills/workflow-bootstrap/scripts/recon-probe.sh +328 -0
  329. package/skills/workflow-feedback/SKILL.md +120 -0
  330. package/skills/workflow-feedback/references/category-guide.md +121 -0
  331. package/skills/workflow-feedback/references/feedback-template.md +73 -0
  332. package/skills/workflow-feedback/references/review-mode.md +92 -0
  333. package/skills/workflow-orchestrator/SKILL.md +94 -0
  334. package/skills/workflow-orchestrator/references/feedback-loops.md +56 -0
  335. package/skills/workflow-orchestrator/references/s1-path-router.md +81 -0
  336. package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +96 -0
  337. package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +50 -0
  338. package/skills/workflow-orchestrator/references/s4-split-validate.md +108 -0
  339. package/skills/workflow-orchestrator/references/s5-monitoring.md +61 -0
  340. package/skills/workflow-orchestrator/references/state-model.md +185 -0
  341. package/skills/workflow-start/SKILL.md +147 -0
  342. package/skills/workflow-start/references/routing-rules.md +155 -0
  343. package/src/index.ts +16 -0
  344. package/src/parsing/change-parser.ts +79 -0
  345. package/src/parsing/requirement-blocks.ts +244 -0
  346. package/src/schema/base.ts +8 -0
  347. package/src/schema/change.ts +29 -0
  348. package/src/schema/index.ts +3 -0
  349. package/src/schema/spec.ts +12 -0
  350. package/src/validation/constants.ts +53 -0
  351. package/src/validation/tokenizer.ts +180 -0
  352. package/src/validation/types.ts +47 -0
  353. package/src/validation/validator.ts +552 -0
  354. package/templates/abandonment-summary.md +29 -0
  355. package/templates/design.md +37 -0
  356. package/templates/execution-contract.md +99 -0
  357. package/templates/plan.md +86 -0
  358. package/templates/prd.md +468 -0
  359. package/templates/proposal.md +37 -0
  360. package/templates/spec.md +31 -0
  361. package/templates/tasks.md +47 -0
  362. package/tests/e2e.test.mjs +266 -0
  363. package/tests/lib/cmd-audit.test.mjs +202 -0
  364. package/tests/lib/cmd-checkpoint.test.mjs +98 -0
  365. package/tests/lib/cmd-config.test.mjs +101 -0
  366. package/tests/lib/cmd-doctor.test.mjs +450 -0
  367. package/tests/lib/cmd-execution.test.mjs +647 -0
  368. package/tests/lib/cmd-handoff.test.mjs +137 -0
  369. package/tests/lib/cmd-inject.test.mjs +218 -0
  370. package/tests/lib/cmd-install-workbuddy.test.mjs +113 -0
  371. package/tests/lib/cmd-install-zcode.test.mjs +42 -0
  372. package/tests/lib/cmd-isolate.test.mjs +68 -0
  373. package/tests/lib/cmd-list.test.mjs +127 -0
  374. package/tests/lib/cmd-runtime.test.mjs +83 -0
  375. package/tests/lib/cmd-state-missing.test.mjs +65 -0
  376. package/tests/lib/cmd-state.test.mjs +365 -0
  377. package/tests/lib/cmd-sync-paths.test.mjs +84 -0
  378. package/tests/lib/cmd-validate-paths.test.mjs +90 -0
  379. package/tests/lib/config-loader.test.mjs +175 -0
  380. package/tests/lib/ensure-branch.test.mjs +59 -0
  381. package/tests/lib/execution-control-plane.test.mjs +168 -0
  382. package/tests/lib/execution-plan.test.mjs +474 -0
  383. package/tests/lib/guard-specs-merged.test.mjs +108 -0
  384. package/tests/lib/guard-tests-passing.test.mjs +112 -0
  385. package/tests/lib/guard-transitions.test.mjs +262 -0
  386. package/tests/lib/guard.test.mjs +611 -0
  387. package/tests/lib/hash.test.mjs +138 -0
  388. package/tests/lib/infer-workflow.test.mjs +161 -0
  389. package/tests/lib/install-git-hooks.test.mjs +20 -0
  390. package/tests/lib/marketplace-release-docs.test.mjs +31 -0
  391. package/tests/lib/minimality-discipline.test.mjs +37 -0
  392. package/tests/lib/model-profiles-docs.test.mjs +33 -0
  393. package/tests/lib/node20-compatibility.test.mjs +73 -0
  394. package/tests/lib/node20-test-entry.test.mjs +17 -0
  395. package/tests/lib/platform-runtime-distribution.test.mjs +150 -0
  396. package/tests/lib/raw-mode-smoke.test.mjs +42 -0
  397. package/tests/lib/sdd-overlay.test.mjs +118 -0
  398. package/tests/lib/spec-paths.test.mjs +80 -0
  399. package/tests/lib/state-loader.test.mjs +251 -0
  400. package/tests/lib/token-baseline.test.mjs +72 -0
  401. package/tests/lib/token-rules.test.mjs +94 -0
  402. package/tests/lib/verify-marketplace-release.test.mjs +128 -0
  403. package/tests/tsconfig.json +12 -0
  404. package/token-baseline.json +95 -0
  405. package/tsconfig.json +14 -0
@@ -0,0 +1,89 @@
1
+ # Strategy Template
2
+
3
+ Loaded by `SKILL.md` after the interview is complete. Fill it in using the captured answers and write to `STRATEGY.md`.
4
+
5
+ ## Rules for filling in
6
+
7
+ - Use the user's own language where possible. Do not paraphrase into generic PM-speak.
8
+ - Each section stays compact. The whole doc should read in under 5 minutes.
9
+ - Section order is locked. Do not add new top-level sections.
10
+ - Optional sections: delete entirely if unused. Do not leave empty headers.
11
+ - Set `last_updated` in the YAML frontmatter to today's ISO date (YYYY-MM-DD). Do not duplicate the date in prose.
12
+ - Set `name` in the frontmatter to the product or initiative name (the same value used in the H1 title).
13
+
14
+ ## Template
15
+
16
+ The block below is the literal file to write (minus this line and the fences). Replace every `{{placeholder}}` with the captured answer. Delete any optional section whose placeholder wasn't answered.
17
+
18
+ ~~~markdown
19
+ ---
20
+ name: {{product_name}}
21
+ last_updated: {{YYYY-MM-DD}}
22
+ ---
23
+
24
+ # {{product_name}} Strategy
25
+
26
+ ## Target problem
27
+
28
+ {{1-2 sentence diagnosis. Names the user situation and the crux that makes it hard. No solution language.}}
29
+
30
+ ## Our approach
31
+
32
+ {{1-2 sentence guiding policy. What this product commits to, so that the target problem becomes tractable.}}
33
+
34
+ ## Who it's for
35
+
36
+ **Primary:** {{Persona name}} - {{one-sentence JTBD, e.g. "They're hiring {{product_name}} to..."}}
37
+
38
+ <!-- Duplicate the block above for additional personas only if truly necessary. Fewer is better. -->
39
+
40
+ ## Key metrics
41
+
42
+ - **{{metric 1 name}}** - {{one-line definition; where it's measured}}
43
+ - **{{metric 2 name}}** - {{...}}
44
+ - **{{metric 3 name}}** - {{...}}
45
+
46
+ <!-- 3-5 total. Stop at 5. -->
47
+
48
+ ## Tracks
49
+
50
+ ### {{Track 1 name}}
51
+
52
+ {{One line: what this track is - the investment area, not a feature list.}}
53
+
54
+ _Why it serves the approach:_ {{one line}}
55
+
56
+ <!-- Duplicate the block above for 2-4 tracks total. If you can't keep it to 4, something is wrong - fold related tracks together. -->
57
+
58
+ ## Milestones
59
+
60
+ - **{{YYYY-MM-DD}}** - {{milestone}}
61
+
62
+ <!-- Optional. Delete the section if unused. Only externally visible milestones: launches, fundraises, conferences, renewals. -->
63
+
64
+ ## Not working on
65
+
66
+ - {{one line per item}}
67
+
68
+ <!-- Optional. Delete the section if unused. Use only for things the team keeps being tempted by. -->
69
+
70
+ ## Marketing
71
+
72
+ **One-liner:** {{single-sentence pitch}}
73
+
74
+ **Key message:** {{2-3 lines if useful}}
75
+
76
+ <!-- Optional. Delete the section if unused. -->
77
+ ~~~
78
+
79
+ ## Post-write checklist
80
+
81
+ Before confirming the write, scan the draft for:
82
+
83
+ - [ ] Frontmatter present at the top with `name` and `last_updated` keys.
84
+ - [ ] `last_updated` carries today's date in ISO format (YYYY-MM-DD).
85
+ - [ ] No section has more than 4 sentences except Tracks (where each track has its own short block).
86
+ - [ ] No placeholders remain (`{{...}}`).
87
+ - [ ] Optional sections with no content have been deleted, not left empty.
88
+ - [ ] Metric count is between 3 and 5. Track count is between 2 and 4.
89
+ - [ ] Target problem and Our approach are connected - one clearly responds to the other.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: code-reviewer
3
+ description: Review completed implementation batches for spec compliance and code quality. Invoke after execution batches complete, before merging, or when a review gate is reached in the workflow.
4
+ ---
5
+
6
+ # Code Reviewer
7
+
8
+ Two responsibilities: requesting review (dispatching a reviewer subagent) and receiving review (acting on feedback with technical rigor). **Review early, review often. Verify before implementing feedback.**
9
+
10
+ ## Part 1: Requesting Review
11
+
12
+ **Mandatory after**: each task in SDD, each planned execution wave, each major feature, before merge.
13
+ **Optional**: when stuck, before refactoring, after fixing complex bugs.
14
+
15
+ ### Procedure
16
+ 1. Get SHAs: `BASE_SHA=$(git rev-parse HEAD~1)` and `HEAD_SHA=$(git rev-parse HEAD)`
17
+ 2. Dispatch `general-purpose` subagent using template at `skills/code-reviewer/code-reviewer-prompt.md`
18
+ 3. Fill placeholders: `[DESCRIPTION]` (what was built), `[PLAN_OR_REQUIREMENTS]` (contract/spec reference), `[BASE_SHA]`, `[HEAD_SHA]`, `[WAVE_ID]`, and a distinct `[REVIEW_REPORT_FILE]`.
19
+ 4. Require the reviewer to write a non-empty persisted review report at `[REVIEW_REPORT_FILE]`, then record that exact path in the wave receipt: `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution review <change-dir> --wave <id> --base <sha> --head <sha> --report <review-report-path> --verdict <pass|fail>`.
20
+ 5. Act on feedback: Critical/Important findings require a `fail` receipt, focused repair, re-review, and replacement `pass` receipt before a dependent wave or closing can proceed. Note Minor for later, push back with reasoning if reviewer is wrong.
21
+
22
+ ### Minimality And Scope
23
+
24
+ For unrequested complexity, cite the missing task requirement and diff line.
25
+ Use Important for merge-blocking complexity and Minor for safe,
26
+ behavior-neutral redundancy; never score by line count.
27
+
28
+ ## Part 2: Receiving Review Feedback
29
+
30
+ ### The Response Pattern
31
+ 1. READ feedback without reacting
32
+ 2. UNDERSTAND and restate requirement
33
+ 3. VERIFY against codebase reality
34
+ 4. EVALUATE: technically sound for THIS codebase?
35
+ 5. RESPOND: technical acknowledgment or reasoned pushback
36
+ 6. IMPLEMENT: one item at a time, test each
37
+
38
+ ### Severity Levels
39
+
40
+ | Level | Meaning | Action |
41
+ |-------|---------|--------|
42
+ | Critical | Bugs, security, data loss, broken functionality | Fix immediately |
43
+ | Important | Architecture problems, missing features, poor error handling, test gaps | Fix before next batch |
44
+ | Minor | Code style, optimization, documentation polish | Note for later |
45
+
46
+ ### Forbidden Responses
47
+ Never: performative agreement ("You're right!", "Great point!"), blind implementation before verification, thanking the reviewer. Instead: restate the requirement, ask clarifying questions, push back with reasoning, or just fix it (actions > words).
48
+
49
+ ### Handling Unclear Feedback
50
+ If any item is unclear → STOP. Do not implement anything yet. Ask for clarification on unclear items. Partial understanding = wrong implementation.
51
+
52
+ ### Source-Specific Rules
53
+
54
+ **From user**: Trusted — implement after understanding. Still ask if scope unclear. No performative agreement.
55
+
56
+ **From external reviewer**: Before implementing, check: technically correct for this codebase? breaks existing functionality? reason for current implementation? works on all platforms? reviewer understands full context? If suggestion seems wrong, push back with technical reasoning.
57
+
58
+ ### When to Push Back
59
+ Suggestion breaks existing functionality, reviewer lacks context, violates YAGNI, technically incorrect for this stack, legacy/compatibility reasons, conflicts with user's architectural decisions. Push back with technical reasoning, not defensiveness.
60
+
61
+ ### Implementation Order
62
+ 1. Clarify unclear items first
63
+ 2. Fix blocking issues (breaks, security)
64
+ 3. Fix simple issues (typos, imports)
65
+ 4. Fix complex issues (refactoring, logic)
66
+ 5. Test each fix individually, verify no regressions
67
+
68
+ ## Common Mistakes
69
+
70
+ | Mistake | Fix |
71
+ |---------|-----|
72
+ | Performative agreement | State requirement or just act |
73
+ | Blind implementation | Verify against codebase first |
74
+ | Batch without testing | One at a time, test each |
75
+ | Proceeding without a wave receipt | Record `pass`/`fail` via `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution review` before the next dependent wave |
76
+ | Assuming reviewer is right | Check if breaks things |
77
+ | Avoiding pushback | Technical correctness > comfort |
78
+ | Partial implementation | Clarify all items first |
79
+
80
+ ## Exception Handling
81
+
82
+ - **Parse failures**: Report specific file, request regenerated review package
83
+ - **Missing files**: Regenerate via `scripts/review-package`. Empty diff = nothing to review
84
+ - **User interruption**: Re-read review report on resume, continue from next unreviewed batch
@@ -0,0 +1,195 @@
1
+ # Code Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a code reviewer subagent.
4
+
5
+ **Purpose:** Review completed work against requirements and code quality standards before it cascades into more work.
6
+
7
+ ```
8
+ Subagent (general-purpose):
9
+ description: "Review code changes"
10
+ prompt: |
11
+ You are a Senior Code Reviewer with expertise in software architecture,
12
+ design patterns, and best practices. Your job is to review completed work
13
+ against its plan or requirements and identify issues before they cascade.
14
+
15
+ ## What Was Implemented
16
+
17
+ [DESCRIPTION]
18
+
19
+ ## Requirements / Plan
20
+
21
+ [PLAN_OR_REQUIREMENTS]
22
+
23
+ ## Git Range to Review
24
+
25
+ **Base:** [BASE_SHA]
26
+ **Head:** [HEAD_SHA]
27
+
28
+ **Planned wave ID:** [WAVE_ID]
29
+
30
+ ```bash
31
+ git diff --stat [BASE_SHA]..[HEAD_SHA]
32
+ git diff [BASE_SHA]..[HEAD_SHA]
33
+ ```
34
+
35
+ ## Read-Only Review
36
+
37
+ Your review is read-only on this checkout. Do not mutate the working tree, the index, HEAD, or branch state in any way. Use tools like `git show`, `git diff`, and `git log` to inspect history. If you need a working copy of a different revision, check it out into a separate temporary directory (e.g. `git worktree add /tmp/review-[SHA] [SHA]`) — never move HEAD on this checkout.
38
+
39
+ ## What to Check
40
+
41
+ **Spec/Contract alignment:**
42
+ - Does the implementation match the spec / execution contract requirements?
43
+ - Are deviations justified improvements, or problematic departures?
44
+ - Is all planned functionality present?
45
+
46
+ ## Minimality And Scope
47
+
48
+ For every unrequested dependency, configuration surface, abstraction, or unrelated refactor, cite the missing task requirement and diff line. Treat
49
+ merge-blocking complexity as Important and behavior-neutral redundancy as Minor. Do not use line count as evidence, and do not recommend removing
50
+ required tests, validation, security, or error handling.
51
+
52
+ **Code quality:**
53
+ - Clean separation of concerns?
54
+ - Proper error handling?
55
+ - Type safety where applicable?
56
+ - DRY without premature abstraction?
57
+ - Edge cases handled?
58
+
59
+ **Architecture:**
60
+ - Sound design decisions?
61
+ - Reasonable scalability and performance?
62
+ - Security concerns?
63
+ - Integrates cleanly with surrounding code?
64
+
65
+ **Testing:**
66
+ - Tests verify real behavior, not mocks?
67
+ - Edge cases covered?
68
+ - Integration tests where they matter?
69
+ - All tests passing?
70
+
71
+ **Production readiness:**
72
+ - Migration strategy if schema changed?
73
+ - Backward compatibility considered?
74
+ - Documentation complete?
75
+ - No obvious bugs?
76
+
77
+ ## Calibration
78
+
79
+ Categorize issues by actual severity. Not everything is Critical.
80
+ Acknowledge what was done well before listing issues — accurate praise
81
+ helps the implementer trust the rest of the feedback.
82
+
83
+ If you find significant deviations from the plan, flag them specifically
84
+ so the implementer can confirm whether the deviation was intentional.
85
+ If you find issues with the plan itself rather than the implementation,
86
+ say so.
87
+
88
+ ## Output Format
89
+
90
+ Write your full verdict to [REVIEW_REPORT_FILE]. This review report path
91
+ must point to a non-empty, persisted review report before the controller
92
+ records a receipt. Include the wave ID, base SHA, head SHA, and that review
93
+ report path. End with the exact receipt command:
94
+
95
+ ```bash
96
+ npx --yes --package @xulthekl/team-flow@0.22.4 tf execution review <change-dir> --wave [WAVE_ID] --base [BASE_SHA] --head [HEAD_SHA] --report [REVIEW_REPORT_FILE] --verdict <pass|fail>
97
+ ```
98
+
99
+ Use `fail` when any Critical or Important finding remains. A repair needs
100
+ a fresh review and replacement `pass` receipt before any dependent wave or
101
+ closing transition.
102
+
103
+ ### Strengths
104
+ [What's well done? Be specific.]
105
+
106
+ ### Issues
107
+
108
+ #### Critical (Must Fix)
109
+ [Bugs, security issues, data loss risks, broken functionality]
110
+
111
+ #### Important (Should Fix)
112
+ [Architecture problems, missing features, poor error handling, test gaps]
113
+
114
+ #### Minor (Nice to Have)
115
+ [Code style, optimization opportunities, documentation polish]
116
+
117
+ For each issue:
118
+ - File:line reference
119
+ - What's wrong
120
+ - Why it matters
121
+ - How to fix (if not obvious)
122
+
123
+ ### Recommendations
124
+ [Improvements for code quality, architecture, or process]
125
+
126
+ ### Assessment
127
+
128
+ **Ready to merge?** [Yes | No | With fixes]
129
+
130
+ **Reasoning:** [1-2 sentence technical assessment]
131
+
132
+ ## Critical Rules
133
+
134
+ **DO:**
135
+ - Categorize by actual severity
136
+ - Be specific (file:line, not vague)
137
+ - Explain WHY each issue matters
138
+ - Acknowledge strengths
139
+ - Give a clear verdict
140
+
141
+ **DON'T:**
142
+ - Say "looks good" without checking
143
+ - Mark nitpicks as Critical
144
+ - Give feedback on code you didn't actually read
145
+ - Be vague ("improve error handling")
146
+ - Avoid giving a clear verdict
147
+ ```
148
+
149
+ **Placeholders:**
150
+ - `[DESCRIPTION]` — brief summary of what was built
151
+ - `[PLAN_OR_REQUIREMENTS]` — what it should do (execution-contract.md file path, spec file path, or requirements)
152
+ - `[BASE_SHA]` — starting commit
153
+ - `[HEAD_SHA]` — ending commit
154
+ - `[WAVE_ID]` — planned execution wave under review
155
+ - `[REVIEW_REPORT_FILE]` — REQUIRED: distinct, persisted, non-empty review report path stored in the execution receipt
156
+
157
+ **Reviewer returns:** Strengths, Issues (Critical / Important / Minor), Recommendations, Assessment
158
+
159
+ ## Example Output
160
+
161
+ ```
162
+ ### Strengths
163
+ - Clean database schema with proper migrations (db.ts:15-42)
164
+ - Comprehensive test coverage (18 tests, all edge cases)
165
+ - Good error handling with fallbacks (summarizer.ts:85-92)
166
+
167
+ ### Issues
168
+
169
+ #### Important
170
+ 1. **Missing help text in CLI wrapper**
171
+ - File: index-conversations:1-31
172
+ - Issue: No --help flag, users won't discover --concurrency
173
+ - Fix: Add --help case with usage examples
174
+
175
+ 2. **Date validation missing**
176
+ - File: search.ts:25-27
177
+ - Issue: Invalid dates silently return no results
178
+ - Fix: Validate ISO format, throw error with example
179
+
180
+ #### Minor
181
+ 1. **Progress indicators**
182
+ - File: indexer.ts:130
183
+ - Issue: No "X of Y" counter for long operations
184
+ - Impact: Users don't know how long to wait
185
+
186
+ ### Recommendations
187
+ - Add progress reporting for user experience
188
+ - Consider config file for excluded projects (portability)
189
+
190
+ ### Assessment
191
+
192
+ **Ready to merge: With fixes**
193
+
194
+ **Reasoning:** Core implementation is solid with good architecture and tests. Important issues (help text, date validation) are easily fixed and don't affect core functionality.
195
+ ```
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: contract-builder
3
+ description: Convert approved planning artifacts into an execution contract. Invoke when the user wants to start building, asks to move from planning to implementation, or when execution-contract.md is missing or stale.
4
+ ---
5
+
6
+ # Contract Builder
7
+
8
+ Converts planning artifacts into a single execution handshake: `execution-contract.md`. Load the baseline with `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime asset read templates/execution-contract.md`.
9
+
10
+ Read before generating: `proposal.md`, `specs/`, `design.md`, `tasks.md`, then load `docs/artifact-contract.md` with `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime asset read docs/artifact-contract.md`.
11
+
12
+ **Architecture Design Outputs (v0.9 §26)**: 若 `architecture/` 目录存在,同时读取 `architecture/architecture.md` / `database.md` / `api.md`,作为执行契约的架构约束补充输入——确保 execution-contract.md 的 Implementation Constraints 段包含架构设计的关键约束(聚合边界/CQRS 分流/API 契约/schema 变更)。`architecture/` 不存在时跳过。
13
+
14
+ ## Artifact Mapping
15
+
16
+ | Source | Extract |
17
+ |--------|---------|
18
+ | `proposal.md` → `## Why` + `## What Changes` | Intent Lock (problem + scope) |
19
+ | `proposal.md` → `## Scope > ### Out of Scope` | Scope Fence |
20
+ | `specs/` → each `### Requirement:` | Approved Requirements, Scenarios, Test Obligations |
21
+ | `design.md` → `## Decisions` | Architecture, Interface, Dependency Constraints |
22
+ | `architecture/` → `architecture.md` / `database.md` / `api.md` (v0.9 §26) | Architecture Constraints (聚合边界/CQRS/API契约/schema变更) |
23
+ | `tasks.md` → numbered task groups | Execution Batches, Completion Definitions, Review Timing |
24
+
25
+ ## Cross-Check: Requirement Coverage
26
+
27
+ Before finalizing:
28
+ 1. List every SHALL/MUST from `specs/`
29
+ 2. Verify each is reflected in Approved Behavior, has a test obligation, and appears in at least one batch
30
+ 3. Flag unmapped requirements in Escalation Rules
31
+ 4. Note cross-batch dependencies
32
+
33
+ ## Contract Structure
34
+
35
+ Must make obvious: approved behavior, out-of-scope, constraints, batches, test obligations, review gates, and conditions that force a rewind to planning. Prefer compression over repeating planning details.
36
+
37
+ ## Approval Model (DP-3)
38
+
39
+ After drafting: summarize handoff rules, identify ambiguity, flag unmapped requirements, ask user to approve explicitly. After approval:
40
+ ```bash
41
+ npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_3_result "approved: <summary>"
42
+ npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_3_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
43
+ ```
44
+ DP-3 is a hard gate — no implementation without this record.
45
+
46
+ ## Stale Contract Detection
47
+
48
+ Refresh if: scope changed in proposal, requirements changed in specs, constraints changed in design, batches changed materially in tasks, or the contract no longer matches intent.
49
+
50
+ ## Hotfix Mode
51
+
52
+ Generate minimal contract: Intent Lock (one sentence), Task List (numbered), Approval Gate (DP-3). Skip Scope Fence, Build Rules, Review Gates, Test Evidence. Still requires DP-3 approval.
53
+
54
+ ## Guardrails
55
+
56
+ - Do not continue to implementation if ambiguity remains
57
+ - Do not approve the contract on the user's behalf
58
+ - Do not skip the contract because planning docs look complete
59
+ - Flag unmapped requirements; do not silently drop them
60
+
61
+ ## Post-Generation
62
+
63
+ Run `npx --yes --package @xulthekl/team-flow@0.22.4 tf state init <change-dir>` to create `.team-flow.yaml` with hashes.
64
+
65
+ For hotfix, after writing the minimal contract, run `npx --yes --package @xulthekl/team-flow@0.22.4 tf state init <change-dir>` or `npx --yes --package @xulthekl/team-flow@0.22.4 tf state rebuild <change-dir>` so `contract_hash` is recorded. DP-3 remains mandatory before build.
66
+
67
+ ## Exception Handling
68
+
69
+ - **Parse failures**: Report specific file and section. Suggest re-running `spec-writer`.
70
+ - **Missing files**: List every missing artifact. Route back to `spec-writer`.
71
+ - **User interruption**: Re-read all artifacts on resume; check contract staleness via content comparison.
72
+ - **Validation failure**: Flag unmapped requirements in Escalation Rules and approval summary.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: design-system
3
+ description: >-
4
+ 设计系统独立创建与维护 skill。通过用户主导的交互流程(LLM 推荐+用户确认)创建
5
+ 项目级 design-system(base 品牌共享层 + B端/C端变体),产出确定性 token 体系 +
6
+ 预览画廊。支持独立调用或 prototype skill 内部编排调用。当用户需要创建设计系统、
7
+ 迭代设计系统、或原型流程发现设计系统缺失时使用。
8
+ 不适用于:原型绘制(用 prototype)、纯架构设计(用 architecture-design)。
9
+ ---
10
+
11
+ # Design System(设计系统 skill)
12
+
13
+ 独立创建与维护项目级设计系统。用户主导,LLM 推荐+检查。确定性 token 派生(同输入=同输出)。零外部依赖。
14
+
15
+ ## Use This Skill When
16
+ - 用户说「设计一套设计系统」「创建 design system」「设计系统」
17
+ - prototype skill 发现设计系统缺失(verdict: needs_design_system)
18
+ - 需要迭代现有设计系统(PRD 升版、新增端)
19
+
20
+ Do NOT invoke for:
21
+ - 原型绘制(用 /team-flow:prototype)
22
+ - 纯架构设计(用 /team-flow:architecture-design)
23
+
24
+ ## 交互创建流程(6 步)
25
+
26
+ ### Step 1: 需求收集(≤5 个预填推荐问题)
27
+ 用 AskUserQuestion 收集 5 个维度(预填 LLM 推荐值,用户原样确认或调整):
28
+ 1. 品牌调性(封闭词汇:professional_minimal / warm_approachable / technical_dense / editorial / brutalist)
29
+ 2. 品牌主色(用户给 hex 或"帮我选"→按调性推荐)
30
+ 3. 展示字体(serif_display / sans_display / mono_accent)
31
+ 4. 信息密度(compact / balanced / spacious)
32
+ 5. 目标端(b_end / c_end / both)
33
+
34
+ **规则**:封闭词汇外的值 → 追问"你是指…?"(不猜测)。每个默认值报告选择原因。详见 `references/creation-flow.md`。
35
+
36
+ ### Step 2: 确定性 Token 派生
37
+ 按调性→调色板→token 映射表确定性生成:A1-identity(8 必选)+ A2-derived(color-mix 公式)+ B-slot 别名 + 5 方向调色板(50-900 阶梯)。详见 `references/token-derivation.md`。
38
+
39
+ ### Step 3: 草稿生成
40
+ 按目标端生成:base.md(品牌共享:colors/logo/voice/anti-patterns)+ 变体文件(b-end.md / c-end.md:typography/spacing/layout/components/motion)。详见 `references/variant-schema.md`。
41
+
42
+ ### Step 4: 预览生成
43
+ 生成 `preview.html`(自包含 HTML 画廊:色板+排版+间距+组件+明暗切换)。用 `references/preview-template.html` 模板填充 token 值。
44
+
45
+ ### Step 5: 用户评审 + 确认
46
+ 呈现:token 摘要表 + 预览路径 + 默认值透明报告。AskUserQuestion:确认 / 调整 / 重新来。
47
+
48
+ ### Step 6: 落盘 + guard 校验
49
+ 写入 `.team-flow/design-system/`,运行 `scripts/guard/design-token-guard.mjs` 校验。
50
+
51
+ ## 存储位置
52
+ ```
53
+ .team-flow/design-system/
54
+ ├── base.md # 品牌共享层
55
+ ├── b-end.md # B 端变体(可选)
56
+ ├── c-end.md # C 端变体(可选)
57
+ └── preview.html # token 预览画廊
58
+ ```
59
+
60
+ ## 迭代模式(iterate)
61
+ 已有 design-system → 读取 → 合并增量 → 变更履历 → 预览 → 确认 → 写入。
62
+
63
+ ## 迁移兼容
64
+ 检测旧 `prototype/design-system.md` → 提示迁移到 `.team-flow/design-system/base.md`(一次性)。
65
+
66
+ ## 执行引擎
67
+ 内部子代理 `references/agents/design-system-architect.md`(唯一写者,两阶段落盘:confirmed:false 草案 → 人工确认 → confirmed:true 写入)。
68
+
69
+ ## 配置
70
+ ```json
71
+ {
72
+ "prototype.designSystem": ".team-flow/design-system/b-end.md",
73
+ "prototype.designSystemBase": ".team-flow/design-system/base.md"
74
+ }
75
+ ```
@@ -0,0 +1,138 @@
1
+ **Note: The current year is 2026.** Use this when assessing recency.
2
+
3
+ You are a Design System Architect. You are dispatched by the `design-system` skill to **create or iterate** the project-level `.team-flow/design-system/base.md` — the single source of truth for design tokens, components, and anti-patterns (compounded back via prototype-sync). The orchestrating design-system skill **never writes `base.md` itself — you are the sole writer**. You run in two phases: first produce a **draft** (`confirmed: false`) for orchestrator review + human confirmation; then, re-dispatched with `confirmed: true`, **you yourself write the official path**. The orchestrator only reviews, confirms, and re-dispatches — it does not Write/Edit `base.md`.
4
+
5
+ ### 文件结构:base + variant
6
+
7
+ architect 写入的文件采用 **base + variant** 结构:
8
+ - **`.team-flow/design-system/base.md`**:基础设计系统(全量 token + 组件规范 + anti-patterns),是所有 variant 的公共底座。
9
+ - **`.team-flow/design-system/variants/<name>.md`**(可选):品牌/主题变体文件,只覆写差异 token(如暗色主题、子品牌色板),继承 base 未覆写部分。
10
+ - architect 在 `confirmed: true` 阶段写入 base.md;如需 variant,同时写入对应 variant 文件。
11
+
12
+ The plugin stays **generic**: do NOT hardcode any specific company/product brand. Derive tokens deterministically from the project's stated tone/brand input; when none is given, fall back to a neutral default and record the assumption.
13
+
14
+ ## Invocation Contract
15
+
16
+ The dispatch prompt provides:
17
+ - `mode: create | iterate`.
18
+ - `confirmed: false | true`(v0.15.0 两阶段落盘):
19
+ - `false`(默认,草案阶段):只产草案(写 scratch 草稿路径或返回 response),**不写正式 `.team-flow/design-system/base.md`**。
20
+ - `true`(人工已确认):把已确认的草案**写入正式 `.team-flow/design-system/base.md`**(你是唯一写者)。
21
+ - `design_system_path`: 正式目标路径(`confirmed: true` 时写入此处,默认 `.team-flow/design-system/base.md`)。
22
+ - `draft`(`confirmed: true` 时传入):上一阶段已确认的草案内容/路径。
23
+ - `create` inputs (as available): project tone/brand hints, PRD path (to read product domain & voice), existing scaffold `.team-flow/design-system/base.md`.
24
+ - `iterate` inputs: the existing `.team-flow/design-system/base.md`, plus the incoming increments (new components / tokens / anti-patterns) and their source change-id.
25
+
26
+ ## The 9-段 Schema + palette
27
+
28
+ Every `.team-flow/design-system/base.md` follows this schema (9 sections + a 5-direction palette):
29
+
30
+ | 段 | 内容 |
31
+ |----|------|
32
+ | `color` | primary / secondary / neutral / semantic(success/warning/danger) |
33
+ | `typography` | font-family / scale(1.25 比例)/ line-height |
34
+ | `spacing` | 4 / 8 / 12 / 16 / 24 阶梯(基于 4 基数) |
35
+ | `layout` | 栅格 12 列 / 断点 sm/md/lg / 容器 max-width |
36
+ | `components` | button / input / card / table 规范(见 components/) |
37
+ | `motion` | duration 150–300ms / easing standard |
38
+ | `voice` | 文案语气(专业、简洁) |
39
+ | `brand` | logo / 品牌主色 |
40
+ | `anti-patterns` | 禁止内联样式漂移 / 禁止非 token 颜色 |
41
+ | `palette`(5 方向确定性调色板) | neutral / primary / success / warning / danger,各含 50–900 阶梯 |
42
+ | `aliases`(B-slot 别名层,v0.18.0) | `--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`——组件引用 B-slot 永远可解析 |
43
+ | `extensions`(C-extension 待提升清单,v0.18.0) | 品牌专有 token 名单制;提升路径:C→B(≥2 品牌需要)→A2(有全局默认值) |
44
+
45
+ ### Token 四层模型(v0.18.0,参照 open-design token-schema)
46
+
47
+ | 层 | 语义 | 完整性 |
48
+ |----|------|--------|
49
+ | **A1-identity** | 品牌即 token:`--bg` `--surface` `--fg` `--muted` `--border` `--accent` `--font-display` `--font-body`(8 必选) | 缺 = guard 失败 |
50
+ | **A1-structure** | 字号阶梯 `--text-xs~4xl` / 行高 / 字距 / section 间距 / 容器 / 栅格(16 项) | 缺 = guard 失败 |
51
+ | **A2-derived** | 必选但有默认公式:`--accent-hover: color-mix(in oklab, var(--accent), black 8%)` / `--accent-active: ... black 14%` / `--focus-ring: ... accent transparent 70%` / `--elev-raised: ... fg transparent 92%` / `--success` `--warn` `--danger` / `--font-mono` / `--space-1~12` / `--radius-sm/md/lg/pill` / `--motion-fast/base` / `--ease-standard`(21 项) | 缺 = guard 失败 |
52
+ | **B-slot** | 可选别名层:`--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`(4 项) | 组件引用永远可解析 |
53
+
54
+ > **完整性约束**:每份 design-tokens.css 必须声明全部 A1+A2+B-slot token——agent 把单份 `:root` 块粘进单个 `<style>`,无全局级联,缺一个 token 规则悄悄失效。可运行 `node scripts/guard/design-token-guard.mjs` 校验。
55
+
56
+ ## Methodology
57
+
58
+ ### Mode: create(首次创建)
59
+
60
+ When the project has no `.team-flow/design-system/base.md`:
61
+
62
+ 1. Read available inputs (PRD voice/domain, brand hints, the prototype scaffold `design-system.md` as a structural template).
63
+ 2. Produce a **complete** 9-段 schema + aliases + extensions:
64
+ - **palette first, deterministically**: derive the 5-direction palette (neutral / primary / success / warning / danger), each with 50–900 steps, from the brand primary / product tone. "确定性" = the same input yields the same palette (rule-based derivation, not random). With no brand input, use a neutral default palette and note it as an assumption.
65
+ - **A2 派生状态色**(v0.18.0):用 `color-mix(in oklab, ...)` 公式派生 accent-hover(black 8%) / accent-active(black 14%) / focus-ring(accent 30%) / elev-raised(fg 8%)。不手写固定 hex。
66
+ - **B-slot 别名层**(v0.18.0):`--fg-2 → var(--fg)` / `--meta → var(--muted)` / `--border-soft → var(--border)` / `--surface-warm → var(--surface)`。
67
+ - **C-extension 清单**(v0.18.0):如有品牌专有 token,列入 `extensions` 段(名单制),标注提升路径。
68
+ - Fill color / typography / spacing / layout / motion / voice / brand / anti-patterns consistently with the palette.
69
+ - `components` references the reusable components the prototype will need (button/input/card/table at minimum), all token-bound.
70
+ - `anti-patterns` MUST include "禁止内联样式漂移" and "禁止非 token 颜色".
71
+ 3. **`confirmed: false`**:Deliver the draft(写 scratch 草稿路径或返回 response),**不写正式路径**。Orchestrator 评审 + 人工确认后,**带 `confirmed: true` 重新派发你**,由你写入正式 `.team-flow/design-system/base.md`(主代理不写)。
72
+ 4. **`confirmed: true`**:把传入的已确认草案 `Write` 到正式 `.team-flow/design-system/base.md`,然后执行 **预览生成步骤**,返回 `status: done` + deliverable = 正式路径。
73
+
74
+ #### 预览生成步骤(confirmed: true 后自动执行)
75
+
76
+ 写入 base.md 后,立即生成 `.team-flow/design-system/preview.html`:
77
+ 1. 读取 `references/preview-template.html` 模板。
78
+ 2. 将模板中 `:root` 块的占位 token 值替换为本次确认的派生值(A1 + A2 + palette)。
79
+ 3. `Write` 到 `.team-flow/design-system/preview.html`。
80
+ 4. 在 structured handoff 的 summary 中注明预览文件路径,供人工浏览器打开验证。
81
+
82
+ ### Mode: iterate(增量更新)
83
+
84
+ When prototype-sync (or a change) introduces new components / tokens / anti-patterns:
85
+
86
+ 1. Read the existing `.team-flow/design-system/base.md`.
87
+ 2. **Merge** (not overwrite) the incoming increments: new components into `components`, new tokens into the relevant section + palette, new anti-patterns into `anti-patterns`.
88
+ 3. Keep token consistency — a new component must reference existing tokens; if it needs a new token, add the token to the palette/section too (no orphan tokens).
89
+ 4. Append a **变更履历** entry: 时间 / 变更内容 / 来源 change-id.
90
+ 5. **`confirmed: false`**:Deliver the merged draft(草稿路径或 response)for orchestrator review + human confirmation,**不写正式路径**。
91
+ 6. **`confirmed: true`**:把已确认的合并草案 `Write` 到正式 `.team-flow/design-system/base.md`(你是唯一写者),然后执行**预览生成步骤**(同上)。
92
+
93
+ ## Output Format
94
+
95
+ ```markdown
96
+ ## Design System Draft — {create | iterate}
97
+
98
+ ### Mode: {create | iterate}
99
+ ### Target path: {.team-flow/design-system/base.md}
100
+
101
+ ### design-system.md (draft content)
102
+ {完整 9 段 schema + palette + aliases + extensions 的 markdown 内容,含 A2 派生色公式和 B-slot 别名层,可直接落盘}
103
+
104
+ ### 变更履历 (iterate only)
105
+ | 时间 | 变更内容 | 来源 change |
106
+ |------|---------|------------|
107
+ | {ISO date} | {新增 button 变体 / 新 token / 新 anti-pattern} | {change-id} |
108
+
109
+ ### Assumptions
110
+ - {e.g., 无品牌输入,采用中性默认调色板}
111
+ ```
112
+
113
+ ## Tool Guidance
114
+
115
+ - Use `Read` for the existing base.md / PRD / scaffold; `Glob` to scan existing `components/` and `variants/`.
116
+ - **`Write` 权限按 `confirmed` 阶段使用**:`confirmed: false` → 只写 scratch 草稿路径(或仅返回 response),**绝不写正式 `.team-flow/design-system/base.md`**;`confirmed: true` → 写正式路径 + 生成 preview.html(你是唯一写者,主代理不写)。
117
+ - Keep everything token-based and offline-friendly (产物必须零外部依赖).
118
+
119
+ ## Red Lines
120
+
121
+ - Do NOT hardcode company/product brand — stay generic; derive from input or use a documented neutral default.
122
+ - Do NOT skip the palette or any of the 9 sections on `create`.
123
+ - On `iterate`, MERGE and record 变更履历 — never overwrite existing content silently.
124
+ - **`confirmed: false` 阶段绝不写正式 `.team-flow/design-system/base.md`**——只产草案;正式落盘只在 `confirmed: true`(人工已确认)阶段由你自己执行。主代理全程不 Write/Edit base.md。
125
+
126
+ ## Structured Handoff(强制,主代理据此编排)
127
+
128
+ 你的 final response 必须是如下结构化交接(JSON 风格描述即可,主代理据此编排):
129
+ {
130
+ status: "done" | "done_with_questions" | "blocked",
131
+ deliverable: <design-system 草案绝对路径或草案内容>,
132
+ preview: <preview.html 绝对路径(confirmed:true 时)| null>,
133
+ blockers: [ { question, why_blocking, options[] } ], # 阻断项:无法继续、必须主代理裁决
134
+ outstanding_questions: [ { question, default_assumption } ], # 非阻断:已按默认假设继续,回主代理批量确认
135
+ summary: <3-5 行 gist>
136
+ }
137
+ 规则:非阻断疑问(如品牌主色未给→用中性默认、某 motion 时长不确定)→ 按 default_assumption 继续跑完,记入 outstanding_questions(status=done_with_questions);
138
+ 阻断疑问(如 iterate 模式但现有 base.md 缺失、无法定位任何输入)→ 立即停止,返回 status=blocked + blockers[],绝不强行猜测。你不能调用 AskUserQuestion。