maestro-flow 0.4.10 → 0.4.12

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 (354) hide show
  1. package/.agents/agents/cli-explore-agent.md +187 -0
  2. package/.agents/agents/cross-role-reviewer.md +173 -0
  3. package/.agents/agents/impeccable-agent.md +101 -0
  4. package/.agents/agents/role-design-author.md +218 -0
  5. package/.agents/agents/team-supervisor.md +145 -0
  6. package/.agents/agents/team-worker.md +239 -0
  7. package/.agents/agents/ui-design-agent.md +272 -0
  8. package/.agents/agents/workflow-analyzer.md +117 -0
  9. package/.agents/agents/workflow-codebase-mapper.md +79 -0
  10. package/.agents/agents/workflow-collab-planner.md +145 -0
  11. package/.agents/agents/workflow-debugger.md +105 -0
  12. package/.agents/agents/workflow-executor.md +134 -0
  13. package/.agents/agents/workflow-external-researcher.md +88 -0
  14. package/.agents/agents/workflow-integration-checker.md +85 -0
  15. package/.agents/agents/workflow-nyquist-auditor.md +87 -0
  16. package/.agents/agents/workflow-phase-researcher.md +87 -0
  17. package/.agents/agents/workflow-plan-checker.md +92 -0
  18. package/.agents/agents/workflow-planner.md +197 -0
  19. package/.agents/agents/workflow-project-researcher.md +76 -0
  20. package/.agents/agents/workflow-research-synthesizer.md +72 -0
  21. package/.agents/agents/workflow-reviewer.md +84 -0
  22. package/.agents/agents/workflow-roadmapper.md +83 -0
  23. package/.agents/agents/workflow-verifier.md +122 -0
  24. package/.agents/skills/codify-to-knowhow/SKILL.md +169 -0
  25. package/.agents/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  26. package/.agents/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  27. package/.agents/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  28. package/.agents/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  29. package/.agents/skills/learn-decompose/SKILL.md +118 -0
  30. package/.agents/skills/learn-follow/SKILL.md +129 -0
  31. package/.agents/skills/learn-investigate/SKILL.md +154 -0
  32. package/.agents/skills/learn-retro/SKILL.md +159 -0
  33. package/.agents/skills/learn-second-opinion/SKILL.md +124 -0
  34. package/.agents/skills/maestro/SKILL.md +258 -0
  35. package/.agents/skills/maestro-amend/SKILL.md +165 -0
  36. package/.agents/skills/maestro-analyze/SKILL.md +161 -0
  37. package/.agents/skills/maestro-blueprint/SKILL.md +132 -0
  38. package/.agents/skills/maestro-brainstorm/SKILL.md +134 -0
  39. package/.agents/skills/maestro-collab/SKILL.md +174 -0
  40. package/.agents/skills/maestro-composer/SKILL.md +181 -0
  41. package/.agents/skills/maestro-execute/SKILL.md +133 -0
  42. package/.agents/skills/maestro-fork/SKILL.md +88 -0
  43. package/.agents/skills/maestro-guard/SKILL.md +103 -0
  44. package/.agents/skills/maestro-help/SKILL.md +300 -0
  45. package/.agents/skills/maestro-help/index/catalog.json +202 -0
  46. package/.agents/skills/maestro-help/phases/01-parse-intent.md +122 -0
  47. package/.agents/skills/maestro-help/phases/02-search-present.md +183 -0
  48. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +213 -0
  49. package/.agents/skills/maestro-impeccable/SKILL.md +251 -0
  50. package/.agents/skills/maestro-init/SKILL.md +80 -0
  51. package/.agents/skills/maestro-learn/SKILL.md +142 -0
  52. package/.agents/skills/maestro-merge/SKILL.md +66 -0
  53. package/.agents/skills/maestro-milestone-audit/SKILL.md +72 -0
  54. package/.agents/skills/maestro-milestone-complete/SKILL.md +79 -0
  55. package/.agents/skills/maestro-milestone-release/SKILL.md +98 -0
  56. package/.agents/skills/maestro-overlay/SKILL.md +180 -0
  57. package/.agents/skills/maestro-plan/SKILL.md +182 -0
  58. package/.agents/skills/maestro-player/SKILL.md +177 -0
  59. package/.agents/skills/maestro-quick/SKILL.md +67 -0
  60. package/.agents/skills/maestro-ralph/SKILL.md +756 -0
  61. package/.agents/skills/maestro-ralph-execute/SKILL.md +273 -0
  62. package/.agents/skills/maestro-roadmap/SKILL.md +131 -0
  63. package/.agents/skills/maestro-tools-execute/SKILL.md +119 -0
  64. package/.agents/skills/maestro-tools-register/SKILL.md +159 -0
  65. package/.agents/skills/maestro-ui-codify/SKILL.md +82 -0
  66. package/.agents/skills/maestro-update/SKILL.md +178 -0
  67. package/.agents/skills/maestro-verify/SKILL.md +111 -0
  68. package/.agents/skills/manage-codebase-rebuild/SKILL.md +77 -0
  69. package/.agents/skills/manage-codebase-refresh/SKILL.md +59 -0
  70. package/.agents/skills/manage-harvest/SKILL.md +96 -0
  71. package/.agents/skills/manage-issue/SKILL.md +75 -0
  72. package/.agents/skills/manage-issue-discover/SKILL.md +83 -0
  73. package/.agents/skills/manage-knowhow/SKILL.md +79 -0
  74. package/.agents/skills/manage-knowhow-capture/SKILL.md +81 -0
  75. package/.agents/skills/manage-learn/SKILL.md +67 -0
  76. package/.agents/skills/manage-status/SKILL.md +54 -0
  77. package/.agents/skills/manage-wiki/SKILL.md +64 -0
  78. package/.agents/skills/quality-auto-test/SKILL.md +138 -0
  79. package/.agents/skills/quality-debug/SKILL.md +122 -0
  80. package/.agents/skills/quality-refactor/SKILL.md +69 -0
  81. package/.agents/skills/quality-retrospective/SKILL.md +79 -0
  82. package/.agents/skills/quality-review/SKILL.md +130 -0
  83. package/.agents/skills/quality-sync/SKILL.md +53 -0
  84. package/.agents/skills/quality-test/SKILL.md +119 -0
  85. package/.agents/skills/security-audit/SKILL.md +157 -0
  86. package/.agents/skills/skill-iter-tune/SKILL.md +384 -0
  87. package/.agents/skills/skill-iter-tune/phases/01-setup.md +144 -0
  88. package/.agents/skills/skill-iter-tune/phases/02-execute.md +292 -0
  89. package/.agents/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  90. package/.agents/skills/skill-iter-tune/phases/04-improve.md +186 -0
  91. package/.agents/skills/skill-iter-tune/phases/05-report.md +166 -0
  92. package/.agents/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  93. package/.agents/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  94. package/.agents/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  95. package/.agents/skills/spec-add/SKILL.md +70 -0
  96. package/.agents/skills/spec-load/SKILL.md +73 -0
  97. package/.agents/skills/spec-remove/SKILL.md +53 -0
  98. package/.agents/skills/spec-setup/SKILL.md +50 -0
  99. package/.agents/skills/team-coordinate/SKILL.md +268 -0
  100. package/.agents/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  101. package/.agents/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  102. package/.agents/skills/team-coordinate/roles/coordinator/commands/monitor.md +358 -0
  103. package/.agents/skills/team-coordinate/roles/coordinator/role.md +365 -0
  104. package/.agents/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  105. package/.agents/skills/team-coordinate/specs/pipelines.md +97 -0
  106. package/.agents/skills/team-coordinate/specs/quality-gates.md +112 -0
  107. package/.agents/skills/team-coordinate/specs/role-spec-template.md +198 -0
  108. package/.agents/skills/team-executor/SKILL.md +191 -0
  109. package/.agents/skills/team-executor/roles/executor/commands/monitor.md +239 -0
  110. package/.agents/skills/team-executor/roles/executor/role.md +171 -0
  111. package/.agents/skills/team-executor/specs/session-schema.md +264 -0
  112. package/.agents/skills/team-lifecycle-v4/SKILL.md +211 -0
  113. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +96 -0
  114. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  115. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  116. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  117. package/.agents/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  118. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  119. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  120. package/.agents/skills/team-lifecycle-v4/roles/executor/role.md +69 -0
  121. package/.agents/skills/team-lifecycle-v4/roles/planner/role.md +87 -0
  122. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  123. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  124. package/.agents/skills/team-lifecycle-v4/roles/reviewer/role.md +71 -0
  125. package/.agents/skills/team-lifecycle-v4/roles/supervisor/role.md +194 -0
  126. package/.agents/skills/team-lifecycle-v4/roles/tester/role.md +89 -0
  127. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +97 -0
  128. package/.agents/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  129. package/.agents/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  130. package/.agents/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  131. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  132. package/.agents/skills/team-lifecycle-v4/templates/epics.md +196 -0
  133. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  134. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  135. package/.agents/skills/team-quality-assurance/SKILL.md +149 -0
  136. package/.agents/skills/team-quality-assurance/roles/analyst/role.md +90 -0
  137. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  138. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  139. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +250 -0
  140. package/.agents/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  141. package/.agents/skills/team-quality-assurance/roles/executor/role.md +68 -0
  142. package/.agents/skills/team-quality-assurance/roles/generator/role.md +70 -0
  143. package/.agents/skills/team-quality-assurance/roles/scout/role.md +77 -0
  144. package/.agents/skills/team-quality-assurance/roles/strategist/role.md +73 -0
  145. package/.agents/skills/team-quality-assurance/specs/pipelines.md +115 -0
  146. package/.agents/skills/team-quality-assurance/specs/team-config.json +131 -0
  147. package/.agents/skills/team-review/SKILL.md +149 -0
  148. package/.agents/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  149. package/.agents/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  150. package/.agents/skills/team-review/roles/coordinator/commands/monitor.md +224 -0
  151. package/.agents/skills/team-review/roles/coordinator/role.md +132 -0
  152. package/.agents/skills/team-review/roles/fixer/role.md +78 -0
  153. package/.agents/skills/team-review/roles/reviewer/role.md +70 -0
  154. package/.agents/skills/team-review/roles/scanner/role.md +81 -0
  155. package/.agents/skills/team-review/specs/dimensions.md +82 -0
  156. package/.agents/skills/team-review/specs/finding-schema.json +82 -0
  157. package/.agents/skills/team-review/specs/pipelines.md +102 -0
  158. package/.agents/skills/team-review/specs/team-config.json +27 -0
  159. package/.agents/skills/team-tech-debt/SKILL.md +130 -0
  160. package/.agents/skills/team-tech-debt/roles/assessor/role.md +79 -0
  161. package/.agents/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  162. package/.agents/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  163. package/.agents/skills/team-tech-debt/roles/coordinator/commands/monitor.md +209 -0
  164. package/.agents/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  165. package/.agents/skills/team-tech-debt/roles/executor/role.md +78 -0
  166. package/.agents/skills/team-tech-debt/roles/planner/role.md +71 -0
  167. package/.agents/skills/team-tech-debt/roles/scanner/role.md +92 -0
  168. package/.agents/skills/team-tech-debt/roles/validator/role.md +80 -0
  169. package/.agents/skills/team-tech-debt/specs/pipelines.md +47 -0
  170. package/.agents/skills/team-tech-debt/specs/team-config.json +129 -0
  171. package/.agents/skills/team-testing/SKILL.md +145 -0
  172. package/.agents/skills/team-testing/roles/analyst/role.md +105 -0
  173. package/.agents/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  174. package/.agents/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  175. package/.agents/skills/team-testing/roles/coordinator/commands/monitor.md +257 -0
  176. package/.agents/skills/team-testing/roles/coordinator/role.md +134 -0
  177. package/.agents/skills/team-testing/roles/executor/role.md +101 -0
  178. package/.agents/skills/team-testing/roles/generator/role.md +100 -0
  179. package/.agents/skills/team-testing/roles/strategist/role.md +85 -0
  180. package/.agents/skills/team-testing/specs/pipelines.md +101 -0
  181. package/.agents/skills/team-testing/specs/team-config.json +93 -0
  182. package/.agents/skills/wiki-connect/SKILL.md +64 -0
  183. package/.agents/skills/wiki-digest/SKILL.md +70 -0
  184. package/.agents/skills/workflow-skill-designer/SKILL.md +498 -0
  185. package/.agents/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  186. package/.agents/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  187. package/.agents/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  188. package/.agents/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  189. package/.agy/agents/cli-explore-agent.md +1 -3
  190. package/.agy/agents/cross-role-reviewer.md +170 -0
  191. package/.agy/agents/role-design-author.md +215 -0
  192. package/.agy/agents/ui-design-agent.md +1 -18
  193. package/.agy/agents/workflow-analyzer.md +1 -1
  194. package/.agy/agents/workflow-external-researcher.md +1 -1
  195. package/.agy/skills/maestro/SKILL.md +63 -27
  196. package/.agy/skills/maestro-analyze/SKILL.md +30 -4
  197. package/.agy/skills/maestro-blueprint/SKILL.md +132 -0
  198. package/.agy/skills/maestro-brainstorm/SKILL.md +119 -103
  199. package/.agy/skills/maestro-help/SKILL.md +48 -14
  200. package/.agy/skills/maestro-help/index/catalog.json +29 -11
  201. package/.agy/skills/maestro-help/phases/01-parse-intent.md +1 -1
  202. package/.agy/skills/maestro-help/phases/02-search-present.md +6 -4
  203. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  204. package/.agy/skills/maestro-init/SKILL.md +3 -3
  205. package/.agy/skills/maestro-milestone-audit/SKILL.md +5 -3
  206. package/.agy/skills/maestro-milestone-complete/SKILL.md +7 -5
  207. package/.agy/skills/maestro-plan/SKILL.md +14 -4
  208. package/.agy/skills/maestro-ralph/SKILL.md +368 -162
  209. package/.agy/skills/maestro-ralph-execute/SKILL.md +81 -67
  210. package/.agy/skills/maestro-roadmap/SKILL.md +42 -81
  211. package/.agy/skills/quality-auto-test/SKILL.md +1 -1
  212. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  213. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  214. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  215. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  216. package/.agy/skills/team-lifecycle-v4/templates/epics.md +2 -2
  217. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  218. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  219. package/.claude/agents/cli-explore-agent.md +1 -3
  220. package/.claude/agents/cross-role-reviewer.md +171 -0
  221. package/.claude/agents/role-design-author.md +216 -0
  222. package/.claude/agents/ui-design-agent.md +1 -18
  223. package/.claude/agents/workflow-analyzer.md +1 -1
  224. package/.claude/agents/workflow-external-researcher.md +1 -1
  225. package/.claude/commands/maestro-analyze.md +30 -4
  226. package/.claude/commands/maestro-blueprint.md +130 -0
  227. package/.claude/commands/maestro-brainstorm.md +132 -116
  228. package/.claude/commands/maestro-init.md +3 -3
  229. package/.claude/commands/maestro-milestone-audit.md +5 -3
  230. package/.claude/commands/maestro-milestone-complete.md +7 -5
  231. package/.claude/commands/maestro-plan.md +14 -4
  232. package/.claude/commands/maestro-ralph-execute.md +81 -67
  233. package/.claude/commands/maestro-ralph.md +368 -162
  234. package/.claude/commands/maestro-roadmap.md +42 -81
  235. package/.claude/commands/maestro.md +63 -27
  236. package/.claude/commands/quality-auto-test.md +1 -1
  237. package/.claude/skills/maestro-help/SKILL.md +48 -14
  238. package/.claude/skills/maestro-help/index/catalog.json +29 -11
  239. package/.claude/skills/maestro-help/phases/01-parse-intent.md +1 -1
  240. package/.claude/skills/maestro-help/phases/02-search-present.md +6 -4
  241. package/.claude/skills/maestro-help/phases/03-workflow-guide.md +60 -33
  242. package/.claude/skills/team-lifecycle-v4/roles/analyst/role.md +1 -1
  243. package/.claude/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  244. package/.claude/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  245. package/.claude/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  246. package/.claude/skills/team-lifecycle-v4/templates/epics.md +2 -2
  247. package/.claude/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  248. package/.claude/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  249. package/.codex/skills/maestro/SKILL.md +84 -41
  250. package/.codex/skills/maestro-amend/SKILL.md +157 -0
  251. package/.codex/skills/maestro-analyze/SKILL.md +71 -23
  252. package/.codex/skills/maestro-blueprint/SKILL.md +122 -0
  253. package/.codex/skills/maestro-brainstorm/SKILL.md +135 -45
  254. package/.codex/skills/maestro-composer/SKILL.md +1 -1
  255. package/.codex/skills/maestro-execute/SKILL.md +13 -4
  256. package/.codex/skills/maestro-help/SKILL.md +28 -18
  257. package/.codex/skills/maestro-help/catalog.json +29 -11
  258. package/.codex/skills/maestro-init/SKILL.md +7 -7
  259. package/.codex/skills/maestro-plan/SKILL.md +27 -9
  260. package/.codex/skills/maestro-ralph/SKILL.md +740 -491
  261. package/.codex/skills/maestro-roadmap/SKILL.md +55 -72
  262. package/.codex/skills/maestro-update/SKILL.md +169 -0
  263. package/.codex/skills/maestro-verify/SKILL.md +11 -2
  264. package/.codex/skills/manage-codebase-rebuild/SKILL.md +2 -2
  265. package/.codex/skills/manage-harvest/SKILL.md +10 -2
  266. package/.codex/skills/quality-retrospective/SKILL.md +9 -2
  267. package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +2 -2
  268. package/.codex/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +2 -2
  269. package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +1 -1
  270. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +3 -3
  271. package/.codex/skills/team-lifecycle-v4/templates/epics.md +2 -2
  272. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +3 -3
  273. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +2 -2
  274. package/README.md +8 -8
  275. package/README.zh-CN.md +8 -8
  276. package/dashboard/dist-server/dashboard/src/server/routes/settings.js +3 -3
  277. package/dashboard/dist-server/dashboard/src/server/routes/settings.js.map +1 -1
  278. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  279. package/dist/src/agents/cli-agent-runner.js +13 -7
  280. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  281. package/dist/src/commands/install-backend.d.ts +12 -0
  282. package/dist/src/commands/install-backend.d.ts.map +1 -1
  283. package/dist/src/commands/install-backend.js +144 -0
  284. package/dist/src/commands/install-backend.js.map +1 -1
  285. package/dist/src/commands/spec.d.ts.map +1 -1
  286. package/dist/src/commands/spec.js +8 -1
  287. package/dist/src/commands/spec.js.map +1 -1
  288. package/dist/src/core/component-defs.d.ts +6 -0
  289. package/dist/src/core/component-defs.d.ts.map +1 -1
  290. package/dist/src/core/component-defs.js +97 -0
  291. package/dist/src/core/component-defs.js.map +1 -1
  292. package/dist/src/tools/spec-init.d.ts +16 -2
  293. package/dist/src/tools/spec-init.d.ts.map +1 -1
  294. package/dist/src/tools/spec-init.js +58 -187
  295. package/dist/src/tools/spec-init.js.map +1 -1
  296. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  297. package/dist/src/tools/spec-loader.js +16 -16
  298. package/dist/src/tools/spec-loader.js.map +1 -1
  299. package/dist/src/tools/spec-seeds.d.ts +33 -0
  300. package/dist/src/tools/spec-seeds.d.ts.map +1 -0
  301. package/dist/src/tools/spec-seeds.js +200 -0
  302. package/dist/src/tools/spec-seeds.js.map +1 -0
  303. package/dist/src/tools/spec-writer.d.ts.map +1 -1
  304. package/dist/src/tools/spec-writer.js +7 -9
  305. package/dist/src/tools/spec-writer.js.map +1 -1
  306. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts +11 -0
  307. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts.map +1 -0
  308. package/dist/src/tui/install-ui/ExtraMcpConfig.js +61 -0
  309. package/dist/src/tui/install-ui/ExtraMcpConfig.js.map +1 -0
  310. package/dist/src/tui/install-ui/InstallConfirm.d.ts +3 -0
  311. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  312. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  313. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  314. package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
  315. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  316. package/dist/src/tui/install-ui/InstallExecution.js +14 -2
  317. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  318. package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
  319. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  320. package/dist/src/tui/install-ui/InstallFlow.js +16 -3
  321. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  322. package/dist/src/tui/install-ui/InstallHub.d.ts +2 -0
  323. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  324. package/dist/src/tui/install-ui/InstallHub.js +8 -0
  325. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  326. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  327. package/dist/src/tui/install-ui/InstallResult.js +3 -1
  328. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  329. package/dist/src/utils/update-notices.js +31 -0
  330. package/dist/src/utils/update-notices.js.map +1 -1
  331. package/package.json +5 -2
  332. package/templates/business-test-report.json +1 -1
  333. package/templates/index.json +1 -1
  334. package/templates/roadmap.md +15 -9
  335. package/templates/state.json +18 -17
  336. package/workflows/analyze.md +79 -11
  337. package/workflows/auto-test.md +6 -6
  338. package/workflows/blueprint.md +431 -0
  339. package/workflows/brainstorm.md +603 -496
  340. package/workflows/business-test.md +7 -7
  341. package/workflows/codebase-rebuild.md +4 -4
  342. package/workflows/harvest.md +184 -10
  343. package/workflows/init.md +9 -8
  344. package/workflows/maestro.md +1 -1
  345. package/workflows/milestone-audit.md +12 -4
  346. package/workflows/milestone-complete.md +11 -6
  347. package/workflows/plan.md +88 -22
  348. package/workflows/roadmap-common.md +1 -1
  349. package/workflows/roadmap.md +13 -3
  350. package/workflows/spec-generate.md +24 -13
  351. package/workflows/ui-design.md +2 -2
  352. package/workflows/ui-style.md +1 -1
  353. package/.agy/agents/conceptual-planning-agent.md +0 -244
  354. package/.claude/agents/conceptual-planning-agent.md +0 -245
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: security-audit
3
+ description: OWASP Top 10 and STRIDE security auditing with supply chain analysis
4
+ argument-hint: "[quick|standard|deep] [--scope <path>]"
5
+ allowed-tools:
6
+ - read_file
7
+ - write_file
8
+ - shell
9
+ - find_files
10
+ - search
11
+ - delegate_subagent
12
+ - ask_user
13
+ ---
14
+ <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
15
+
16
+ <purpose>
17
+ Systematic security audit covering OWASP Top 10, dependency supply chain, secrets detection,
18
+ CI/CD pipeline review, and optional STRIDE threat modeling. Three tiers control depth vs speed.
19
+ </purpose>
20
+
21
+ <context>
22
+ $ARGUMENTS — Parse tier and scope:
23
+ - Tier: `quick` (default) | `standard` | `deep`
24
+ - `--scope <path>`: Limit scan to directory (default: project root)
25
+
26
+ **Tier coverage:**
27
+
28
+ | Tier | OWASP | Dependencies | Secrets | CI/CD | STRIDE | Git History |
29
+ |------|-------|-------------|---------|-------|--------|-------------|
30
+ | quick | ✓ | ✓ | — | — | — | — |
31
+ | standard | ✓ | ✓ | ✓ | ✓ | — | — |
32
+ | deep | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
33
+ </context>
34
+
35
+ <execution>
36
+
37
+ **Phase 1: Reconnaissance**
38
+
39
+ 1. Detect tech stack from package.json / go.mod / requirements.txt / Cargo.toml
40
+ 2. Identify entry points: HTTP handlers, API routes, CLI parsers, WebSocket handlers
41
+ 3. List authentication/authorization modules
42
+ 4. Map data flow: user input → processing → storage → output
43
+
44
+ **Phase 2: OWASP Top 10 Scan** (all tiers)
45
+
46
+ For each category, scan relevant source files:
47
+
48
+ | # | Category | What to check |
49
+ |---|----------|--------------|
50
+ | A01 | Broken Access Control | Missing auth middleware, direct object references, path traversal |
51
+ | A02 | Cryptographic Failures | Weak algorithms, hardcoded keys, missing TLS, plaintext storage |
52
+ | A03 | Injection | SQL concatenation, shell exec with user input, template injection |
53
+ | A04 | Insecure Design | Missing rate limits, no CSRF tokens, predictable tokens |
54
+ | A05 | Security Misconfiguration | Debug mode, default credentials, verbose errors, open CORS |
55
+ | A06 | Vulnerable Components | Known CVEs in dependencies |
56
+ | A07 | Auth Failures | Weak password rules, missing brute-force protection, session fixation |
57
+ | A08 | Data Integrity | Deserialization of untrusted data, unsigned updates |
58
+ | A09 | Logging Failures | Missing audit logs, logging sensitive data |
59
+ | A10 | SSRF | Unvalidated URLs in server-side requests |
60
+
61
+ Use `Grep` for pattern matching (e.g., `eval(`, `exec(`, `innerHTML`, `dangerouslySetInnerHTML`,
62
+ `sql.*\+.*req\.`, `process\.env` without validation).
63
+
64
+ **Phase 3: Dependency Audit** (all tiers)
65
+
66
+ ```bash
67
+ # Node.js
68
+ npm audit --json 2>/dev/null || true
69
+ # Check lockfile integrity
70
+ test -f package-lock.json && echo "lockfile present" || echo "WARNING: no lockfile"
71
+ ```
72
+
73
+ Check for:
74
+ - Known vulnerabilities (CVE references)
75
+ - Lockfile presence and integrity
76
+ - Typosquatting risk on critical dependencies (manually check suspicious names)
77
+
78
+ **Phase 4: Secrets Detection** (standard + deep)
79
+
80
+ ```bash
81
+ # Current codebase
82
+ grep -rn --include="*.ts" --include="*.js" --include="*.json" --include="*.env*" \
83
+ -E "(password|secret|api.?key|token|credential).*=.*['\"][^'\"]{8,}" . || true
84
+ ```
85
+
86
+ Check `.env.example` for leaked values. Check `.gitignore` for missing `.env` patterns.
87
+
88
+ **Phase 5: CI/CD Audit** (standard + deep)
89
+
90
+ Scan `.github/workflows/*.yml` for:
91
+ - Overly permissive `permissions:` (write-all, contents: write)
92
+ - Unpinned action versions (`uses: actions/checkout@main` vs `@v4.1.0`)
93
+ - Secrets in logs (missing `mask` or `add-mask`)
94
+ - Pull request trigger with `pull_request_target` (code injection risk)
95
+
96
+ **Phase 6: STRIDE Threat Modeling** (deep only)
97
+
98
+ For each critical module identified in Phase 1:
99
+
100
+ | Threat | Question |
101
+ |--------|----------|
102
+ | **S**poofing | Can identity be faked? Is auth per-request? |
103
+ | **T**ampering | Can data be modified in transit/storage? Integrity checks? |
104
+ | **R**epudiation | Are actions logged with user identity? |
105
+ | **I**nformation Disclosure | Can unauthorized data be accessed? |
106
+ | **D**enial of Service | Resource limits? Rate limiting? |
107
+ | **E**levation of Privilege | Can roles be escalated? Input validation on role fields? |
108
+
109
+ **Phase 7: Git History Archaeology** (deep only)
110
+
111
+ ```bash
112
+ # Search for previously committed secrets
113
+ git log --all --diff-filter=D --name-only --pretty=format: -- "*.env" "*.key" "*.pem" 2>/dev/null | head -20
114
+ git log -p --all -S "password" --since="1 year ago" -- "*.ts" "*.js" 2>/dev/null | head -50
115
+ ```
116
+
117
+ **Phase 8: Report**
118
+
119
+ Output severity matrix:
120
+
121
+ ```
122
+ === Security Audit ({tier}) ===
123
+
124
+ CRITICAL ({count}):
125
+ - [A03] SQL injection in {file}:{line} — {description}
126
+ Fix: {remediation}
127
+
128
+ HIGH ({count}):
129
+ ...
130
+
131
+ MEDIUM ({count}):
132
+ ...
133
+
134
+ LOW ({count}):
135
+ ...
136
+
137
+ Summary: {total} findings ({critical} critical, {high} high, {medium} medium, {low} low)
138
+ ```
139
+
140
+ Emit completion status:
141
+ ```
142
+ --- COMPLETION STATUS ---
143
+ STATUS: DONE|DONE_WITH_CONCERNS
144
+ CONCERNS: {count} critical findings require immediate action
145
+ NEXT: /quality-review
146
+ --- END STATUS ---
147
+ ```
148
+ </execution>
149
+
150
+ <success_criteria>
151
+ - [ ] Tech stack identified and entry points mapped
152
+ - [ ] OWASP Top 10 categories all checked (tier-appropriate)
153
+ - [ ] Dependency audit completed with CVE listing
154
+ - [ ] Severity matrix produced with file:line references
155
+ - [ ] Each finding includes remediation suggestion
156
+ - [ ] Completion status block emitted
157
+ </success_criteria>
@@ -0,0 +1,384 @@
1
+ ---
2
+ name: skill-iter-tune
3
+ description: Iterative skill tuning via execute-evaluate-improve feedback loop. Uses ccw cli Claude to execute skill, Gemini to evaluate quality, and Agent to apply improvements. Iterates until quality threshold or max iterations. Triggers on "skill iter tune", "iterative skill tuning", "tune skill".
4
+ allowed-tools: invoke_skill, delegate_subagent, ask_user, create_task, update_task, list_tasks, read_file, write_file, edit_file, shell, find_files, search
5
+ ---
6
+ <!-- Open-standard mirror generated by scripts/build-agents-standard.mjs — do not edit; re-run after editing .claude/ source. -->
7
+
8
+
9
+ # Skill Iter Tune
10
+
11
+ Iterative skill refinement through execute-evaluate-improve feedback loops. Each iteration runs the skill via Claude, evaluates output via Gemini, and applies improvements via Agent.
12
+
13
+ ## Architecture Overview
14
+
15
+ ```
16
+ ┌──────────────────────────────────────────────────────────────────────────┐
17
+ │ Skill Iter Tune Orchestrator (SKILL.md) │
18
+ │ → Parse input → Setup workspace → Iteration Loop → Final Report │
19
+ └────────────────────────────┬─────────────────────────────────────────────┘
20
+
21
+ ┌───────────────────┼───────────────────────────────────┐
22
+ ↓ ↓ ↓
23
+ ┌──────────┐ ┌─────────────────────────────┐ ┌──────────┐
24
+ │ Phase 1 │ │ Iteration Loop (2→3→4) │ │ Phase 5 │
25
+ │ Setup │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │ Report │
26
+ │ │─────→│ │ P2 │→ │ P3 │→ │ P4 │ │────→│ │
27
+ │ Backup + │ │ │Exec │ │Eval │ │Impr │ │ │ History │
28
+ │ Init │ │ └─────┘ └─────┘ └─────┘ │ │ Summary │
29
+ └──────────┘ │ ↑ │ │ └──────────┘
30
+ │ └───────────────┘ │
31
+ │ (if score < threshold │
32
+ │ AND iter < max) │
33
+ └─────────────────────────────┘
34
+ ```
35
+
36
+ ### Chain Mode Extension
37
+
38
+ ```
39
+ Chain Mode (execution_mode === "chain"):
40
+
41
+ Phase 2 runs per-skill in chain_order:
42
+ Skill A → ccw cli → artifacts/skill-A/
43
+ ↓ (artifacts as input)
44
+ Skill B → ccw cli → artifacts/skill-B/
45
+ ↓ (artifacts as input)
46
+ Skill C → ccw cli → artifacts/skill-C/
47
+
48
+ Phase 3 evaluates entire chain output + per-skill scores
49
+ Phase 4 improves weakest skill(s) in chain
50
+ ```
51
+
52
+ ## Key Design Principles
53
+
54
+ 1. **Iteration Loop**: Phases 2-3-4 repeat until quality threshold, max iterations, or convergence
55
+ 2. **Two-Tool Pipeline**: Claude (write/execute) + Gemini (analyze/evaluate) = complementary perspectives
56
+ 3. **Pure Orchestrator**: SKILL.md coordinates only — execution detail lives in phase files
57
+ 4. **Progressive Phase Loading**: Phase docs read only when that phase executes
58
+ 5. **Skill Versioning**: Each iteration snapshots skill state before execution
59
+ 6. **Convergence Detection**: Stop early if score stalls (no improvement in 2 consecutive iterations)
60
+
61
+ ## Interactive Preference Collection
62
+
63
+ ```javascript
64
+ // ★ Auto mode detection
65
+ const autoYes = /\b(-y|--yes)\b/.test($ARGUMENTS)
66
+
67
+ if (autoYes) {
68
+ workflowPreferences = {
69
+ autoYes: true,
70
+ maxIterations: 5,
71
+ qualityThreshold: 80,
72
+ executionMode: 'single'
73
+ }
74
+ } else {
75
+ const prefResponse = ask_user({
76
+ questions: [
77
+ {
78
+ question: "选择迭代调优配置:",
79
+ header: "Tune Config",
80
+ multiSelect: false,
81
+ options: [
82
+ { label: "Quick (3 iter, 70)", description: "快速迭代,适合小幅改进" },
83
+ { label: "Standard (5 iter, 80) (Recommended)", description: "平衡方案,适合多数场景" },
84
+ { label: "Thorough (8 iter, 90)", description: "深度优化,适合生产级 skill" }
85
+ ]
86
+ }
87
+ ]
88
+ })
89
+
90
+ const configMap = {
91
+ "Quick": { maxIterations: 3, qualityThreshold: 70 },
92
+ "Standard": { maxIterations: 5, qualityThreshold: 80 },
93
+ "Thorough": { maxIterations: 8, qualityThreshold: 90 }
94
+ }
95
+ const selected = Object.keys(configMap).find(k =>
96
+ prefResponse["Tune Config"].startsWith(k)
97
+ ) || "Standard"
98
+ workflowPreferences = { autoYes: false, ...configMap[selected] }
99
+
100
+ // ★ Mode selection: chain vs single
101
+ const modeResponse = ask_user({
102
+ questions: [{
103
+ question: "选择调优模式:",
104
+ header: "Tune Mode",
105
+ multiSelect: false,
106
+ options: [
107
+ { label: "Single invoke_skill(Recommended)", description: "独立调优每个 skill,适合单一 skill 优化" },
108
+ { label: "Skill Chain", description: "按链序执行,前一个 skill 的产出作为后一个的输入" }
109
+ ]
110
+ }]
111
+ });
112
+ workflowPreferences.executionMode = modeResponse["Tune Mode"].startsWith("Skill Chain")
113
+ ? "chain" : "single";
114
+ }
115
+ ```
116
+
117
+ ## Input Processing
118
+
119
+ ```
120
+ $ARGUMENTS → Parse:
121
+ ├─ Skill path(s): first arg, comma-separated for multiple
122
+ │ e.g., ".claude/skills/my-skill" or "my-skill" (auto-prefixed)
123
+ │ Chain mode: order preserved as chain_order
124
+ ├─ Test scenario: --scenario "description" or remaining text
125
+ └─ Flags: --max-iterations=N, --threshold=N, -y/--yes
126
+ ```
127
+
128
+ ## Execution Flow
129
+
130
+ > **⚠️ COMPACT DIRECTIVE**: Context compression MUST check track_tasks phase status.
131
+ > The phase currently marked `in_progress` is the active execution phase — preserve its FULL content.
132
+ > Only compress phases marked `completed` or `pending`.
133
+
134
+ ### Phase 1: Setup (one-time)
135
+
136
+ Read and execute: `Ref: phases/01-setup.md`
137
+
138
+ - Parse skill paths, validate existence
139
+ - Create workspace at `.workflow/.scratchpad/skill-iter-tune-{ts}/`
140
+ - Backup original skill files
141
+ - Initialize iteration-state.json
142
+
143
+ Output: `workDir`, `targetSkills[]`, `testScenario`, initialized state
144
+
145
+ ### Iteration Loop
146
+
147
+ ```javascript
148
+ // Orchestrator iteration loop
149
+ while (true) {
150
+ // Increment iteration
151
+ state.current_iteration++;
152
+ state.iterations.push({
153
+ round: state.current_iteration,
154
+ status: 'pending',
155
+ execution: null,
156
+ evaluation: null,
157
+ improvement: null
158
+ });
159
+
160
+ // Update track_tasks
161
+ update_task(iterationTask, {
162
+ subject: `Iteration ${state.current_iteration}/${state.max_iterations}`,
163
+ status: 'in_progress',
164
+ activeForm: `Running iteration ${state.current_iteration}`
165
+ });
166
+
167
+ // === Phase 2: Execute ===
168
+ // Read: phases/02-execute.md
169
+ // Single mode: one ccw cli call for all skills
170
+ // Chain mode: sequential ccw cli per skill in chain_order, passing artifacts
171
+ // Snapshot skill → construct prompt → ccw cli --tool claude --mode write
172
+ // Collect artifacts
173
+
174
+ // === Phase 3: Evaluate ===
175
+ // Read: phases/03-evaluate.md
176
+ // Construct eval prompt → ccw cli --tool gemini --mode analysis
177
+ // Parse score → write iteration-N-eval.md → check termination
178
+
179
+ // Check termination
180
+ if (shouldTerminate(state)) {
181
+ break; // → Phase 5
182
+ }
183
+
184
+ // === Phase 4: Improve ===
185
+ // Read: phases/04-improve.md
186
+ // Agent applies suggestions → write iteration-N-changes.md
187
+
188
+ // Update track_tasks with score
189
+ // Continue loop
190
+ }
191
+ ```
192
+
193
+ ### Phase 2: Execute invoke_skill(per iteration)
194
+
195
+ Read and execute: `Ref: phases/02-execute.md`
196
+
197
+ - Snapshot skill → `iteration-{N}/skill-snapshot/`
198
+ - Build execution prompt from skill content + test scenario
199
+ - Execute: `ccw cli -p "..." --tool claude --mode write --cd "${iterDir}/artifacts"`
200
+ - Collect artifacts
201
+
202
+ ### Phase 3: Evaluate Quality (per iteration)
203
+
204
+ Read and execute: `Ref: phases/03-evaluate.md`
205
+
206
+ - Build evaluation prompt with skill + artifacts + criteria + history
207
+ - Execute: `ccw cli -p "..." --tool gemini --mode analysis`
208
+ - Parse 5-dimension score (Clarity, Completeness, Correctness, Effectiveness, Efficiency)
209
+ - Write `iteration-{N}-eval.md`
210
+ - Check termination: score >= threshold | iter >= max | convergence | error limit
211
+
212
+ ### Phase 4: Apply Improvements (per iteration, skipped on termination)
213
+
214
+ Read and execute: `Ref: phases/04-improve.md`
215
+
216
+ - Read evaluation suggestions
217
+ - Launch general-purpose Agent to apply changes
218
+ - Write `iteration-{N}-changes.md`
219
+ - Update state
220
+
221
+ ### Phase 5: Final Report (one-time)
222
+
223
+ Read and execute: `Ref: phases/05-report.md`
224
+
225
+ - Generate comprehensive report with score progression table
226
+ - Write `final-report.md`
227
+ - Display summary to user
228
+
229
+ **Phase Reference Documents** (read on-demand when phase executes):
230
+
231
+ | Phase | Document | Purpose | Compact |
232
+ |-------|----------|---------|---------|
233
+ | 1 | [phases/01-setup.md](phases/01-setup.md) | Initialize workspace and state | track_tasks 驱动 |
234
+ | 2 | [phases/02-execute.md](phases/02-execute.md) | Execute skill via ccw cli Claude | track_tasks 驱动 + 🔄 sentinel |
235
+ | 3 | [phases/03-evaluate.md](phases/03-evaluate.md) | Evaluate via ccw cli Gemini | track_tasks 驱动 + 🔄 sentinel |
236
+ | 4 | [phases/04-improve.md](phases/04-improve.md) | Apply improvements via Agent | track_tasks 驱动 + 🔄 sentinel |
237
+ | 5 | [phases/05-report.md](phases/05-report.md) | Generate final report | track_tasks 驱动 |
238
+
239
+ **Compact Rules**:
240
+ 1. **track_tasks `in_progress`** → 保留完整内容,禁止压缩
241
+ 2. **track_tasks `completed`** → 可压缩为摘要
242
+ 3. **🔄 sentinel fallback** → 若 compact 后仅存 sentinel 而无完整 Step 协议,立即 `read_file()` 恢复
243
+
244
+ ## Core Rules
245
+
246
+ 1. **Start Immediately**: First action is preference collection → Phase 1 setup
247
+ 2. **Progressive Loading**: Read phase doc ONLY when that phase is about to execute
248
+ 3. **Snapshot Before Execute**: Always snapshot skill state before each iteration
249
+ 4. **Background CLI**: ccw cli runs in background, wait for hook callback before proceeding
250
+ 5. **Parse Every Output**: Extract structured JSON from CLI outputs for state updates
251
+ 6. **DO NOT STOP**: Continuous iteration until termination condition met
252
+ 7. **Single State Source**: `iteration-state.json` is the only source of truth
253
+
254
+ ## Data Flow
255
+
256
+ ```
257
+ User Input (skill paths + test scenario)
258
+ ↓ (+ execution_mode + chain_order if chain mode)
259
+
260
+ Phase 1: Setup
261
+ ↓ workDir, targetSkills[], testScenario, iteration-state.json
262
+
263
+ ┌─→ Phase 2: Execute (ccw cli claude)
264
+ │ ↓ artifacts/ (skill execution output)
265
+ │ ↓
266
+ │ Phase 3: Evaluate (ccw cli gemini)
267
+ │ ↓ score, dimensions[], suggestions[], iteration-N-eval.md
268
+ │ ↓
269
+ │ [Terminate?]─── YES ──→ Phase 5: Report → final-report.md
270
+ │ ↓ NO
271
+ │ ↓
272
+ │ Phase 4: Improve (Agent)
273
+ │ ↓ modified skill files, iteration-N-changes.md
274
+ │ ↓
275
+ └───┘ next iteration
276
+ ```
277
+
278
+ ## track_tasks Pattern
279
+
280
+ ```javascript
281
+ // Initial state
282
+ create_task({ subject: "Phase 1: Setup workspace", activeForm: "Setting up workspace" })
283
+ create_task({ subject: "Iteration Loop", activeForm: "Running iterations" })
284
+ create_task({ subject: "Phase 5: Final Report", activeForm: "Generating report" })
285
+
286
+ // Chain mode: create per-skill tracking tasks
287
+ if (state.execution_mode === 'chain') {
288
+ for (const skillName of state.chain_order) {
289
+ create_task({
290
+ subject: `Chain: ${skillName}`,
291
+ activeForm: `Tracking ${skillName}`,
292
+ description: `Skill chain member position ${state.chain_order.indexOf(skillName) + 1}`
293
+ })
294
+ }
295
+ }
296
+
297
+ // During iteration N
298
+ // Single mode: one score per iteration (existing behavior)
299
+ // Chain mode: per-skill status updates
300
+ if (state.execution_mode === 'chain') {
301
+ // After each skill executes in Phase 2:
302
+ update_task(chainSkillTask, {
303
+ subject: `Chain: ${skillName} — Iter ${N} executed`,
304
+ activeForm: `${skillName} iteration ${N}`
305
+ })
306
+ // After Phase 3 evaluates:
307
+ update_task(chainSkillTask, {
308
+ subject: `Chain: ${skillName} — Score ${chainScores[skillName]}/100`,
309
+ activeForm: `${skillName} scored`
310
+ })
311
+ } else {
312
+ // Single mode (existing)
313
+ create_task({
314
+ subject: `Iteration ${N}: Score ${score}/100`,
315
+ activeForm: `Iteration ${N} complete`,
316
+ description: `Strengths: ... | Weaknesses: ... | Suggestions: ${count}`
317
+ })
318
+ }
319
+
320
+ // Completed — collapse
321
+ update_task(iterLoop, {
322
+ subject: `Iteration Loop (${totalIters} iters, final: ${finalScore})`,
323
+ status: 'completed'
324
+ })
325
+ ```
326
+
327
+ ## Termination Logic
328
+
329
+ ```javascript
330
+ function shouldTerminate(state) {
331
+ // 1. Quality threshold met
332
+ if (state.latest_score >= state.quality_threshold) {
333
+ return { terminate: true, reason: 'quality_threshold_met' };
334
+ }
335
+ // 2. Max iterations reached
336
+ if (state.current_iteration >= state.max_iterations) {
337
+ return { terminate: true, reason: 'max_iterations_reached' };
338
+ }
339
+ // 3. Convergence: ≤2 points improvement over last 2 iterations
340
+ if (state.score_trend.length >= 3) {
341
+ const last3 = state.score_trend.slice(-3);
342
+ if (last3[2] - last3[0] <= 2) {
343
+ state.converged = true;
344
+ return { terminate: true, reason: 'convergence_detected' };
345
+ }
346
+ }
347
+ // 4. Error limit
348
+ if (state.error_count >= state.max_errors) {
349
+ return { terminate: true, reason: 'error_limit_reached' };
350
+ }
351
+ return { terminate: false };
352
+ }
353
+ ```
354
+
355
+ ## Error Handling
356
+
357
+ | Phase | Error | Recovery |
358
+ |-------|-------|----------|
359
+ | 2: Execute | CLI timeout/crash | Retry once with simplified prompt, then skip |
360
+ | 3: Evaluate | CLI fails | Retry once, then use score 50 with warning |
361
+ | 3: Evaluate | JSON parse fails | Extract score heuristically, save raw output |
362
+ | 4: Improve | Agent fails | Rollback from `iteration-{N}/skill-snapshot/` |
363
+ | Any | 3+ consecutive errors | Terminate with error report |
364
+
365
+ **Error Budget**: Each phase gets 1 retry. 3 consecutive failed iterations triggers termination.
366
+
367
+ ## Coordinator Checklist
368
+
369
+ ### Pre-Phase Actions
370
+ - [ ] Read iteration-state.json for current state
371
+ - [ ] Verify workspace directory exists
372
+ - [ ] Check error count hasn't exceeded limit
373
+
374
+ ### Per-Iteration Actions
375
+ - [ ] Increment current_iteration in state
376
+ - [ ] Create iteration-{N} subdirectory
377
+ - [ ] Update track_tasks with iteration status
378
+ - [ ] After Phase 3: check termination before Phase 4
379
+ - [ ] After Phase 4: write state, proceed to next iteration
380
+
381
+ ### Post-Workflow Actions
382
+ - [ ] Execute Phase 5 (Report)
383
+ - [ ] Display final summary to user
384
+ - [ ] Update all track_tasks tasks to completed
@@ -0,0 +1,144 @@
1
+ # Phase 1: Setup
2
+
3
+ Initialize workspace, backup skills, parse inputs.
4
+
5
+ ## Objective
6
+
7
+ - Parse skill path(s) and test scenario from user input
8
+ - Validate all skill paths exist and contain SKILL.md
9
+ - Create isolated workspace directory structure
10
+ - Backup original skill files
11
+ - Initialize iteration-state.json
12
+
13
+ ## Execution
14
+
15
+ ### Step 1.1: Parse Input
16
+
17
+ Parse `$ARGUMENTS` to extract skill paths and test scenario.
18
+
19
+ ```javascript
20
+ // Parse skill paths (first argument or comma-separated)
21
+ const args = $ARGUMENTS.trim();
22
+ const pathMatch = args.match(/^([^\s]+)/);
23
+ const rawPaths = pathMatch ? pathMatch[1].split(',') : [];
24
+
25
+ // Parse test scenario
26
+ const scenarioMatch = args.match(/(?:--scenario|--test)\s+"([^"]+)"/);
27
+ const scenarioText = scenarioMatch ? scenarioMatch[1] : args.replace(rawPaths.join(','), '').trim();
28
+
29
+ // Record chain order (preserves input order for chain mode)
30
+ const chainOrder = rawPaths.map(p => p.startsWith('.claude/') ? p.split('/').pop() : p);
31
+
32
+ // If no scenario, ask user
33
+ if (!scenarioText) {
34
+ const response = ask_user({
35
+ questions: [{
36
+ question: "Please describe the test scenario for evaluating this skill:",
37
+ header: "Test Scenario",
38
+ multiSelect: false,
39
+ options: [
40
+ { label: "General quality test", description: "Evaluate overall skill quality with a generic task" },
41
+ { label: "Specific scenario", description: "I'll describe a specific test case" }
42
+ ]
43
+ }]
44
+ });
45
+ // Use response to construct testScenario
46
+ }
47
+ ```
48
+
49
+ ### Step 1.2: Validate Skill Paths
50
+
51
+ ```javascript
52
+ const targetSkills = [];
53
+ for (const rawPath of rawPaths) {
54
+ const skillPath = rawPath.startsWith('.claude/') ? rawPath : `.claude/skills/${rawPath}`;
55
+
56
+ // Validate SKILL.md exists
57
+ const skillFiles = find_files(`${skillPath}/SKILL.md`);
58
+ if (skillFiles.length === 0) {
59
+ throw new Error(`Skill not found at: ${skillPath} -- SKILL.md missing`);
60
+ }
61
+
62
+ // Collect all skill files
63
+ const allFiles = find_files(`${skillPath}/**/*.md`);
64
+ targetSkills.push({
65
+ name: skillPath.split('/').pop(),
66
+ path: skillPath,
67
+ files: allFiles.map(f => f.replace(skillPath + '/', '')),
68
+ primary_file: 'SKILL.md'
69
+ });
70
+ }
71
+ ```
72
+
73
+ ### Step 1.3: Create Workspace
74
+
75
+ ```javascript
76
+ const ts = Date.now();
77
+ const workDir = `.workflow/.scratchpad/skill-iter-tune-${ts}`;
78
+
79
+ shell(`mkdir -p "${workDir}/backups" "${workDir}/iterations"`);
80
+ ```
81
+
82
+ ### Step 1.4: Backup Original Skills
83
+
84
+ ```javascript
85
+ for (const skill of targetSkills) {
86
+ shell(`cp -r "${skill.path}" "${workDir}/backups/${skill.name}"`);
87
+ }
88
+ ```
89
+
90
+ ### Step 1.5: Initialize State
91
+
92
+ Write `iteration-state.json` with initial state:
93
+
94
+ ```javascript
95
+ const initialState = {
96
+ status: 'running',
97
+ started_at: new Date().toISOString(),
98
+ updated_at: new Date().toISOString(),
99
+ target_skills: targetSkills,
100
+ test_scenario: {
101
+ description: scenarioText,
102
+ // Parse --requirements and --input-args from $ARGUMENTS if provided
103
+ // e.g., --requirements "clear output,no errors" --input-args "my-skill --scenario test"
104
+ requirements: parseListArg(args, '--requirements') || [],
105
+ input_args: parseStringArg(args, '--input-args') || '',
106
+ success_criteria: parseStringArg(args, '--success-criteria') || 'Produces correct, high-quality output'
107
+ },
108
+ execution_mode: workflowPreferences.executionMode || 'single',
109
+ chain_order: workflowPreferences.executionMode === 'chain'
110
+ ? targetSkills.map(s => s.name)
111
+ : [],
112
+ current_iteration: 0,
113
+ max_iterations: workflowPreferences.maxIterations,
114
+ quality_threshold: workflowPreferences.qualityThreshold,
115
+ latest_score: 0,
116
+ score_trend: [],
117
+ converged: false,
118
+ iterations: [],
119
+ errors: [],
120
+ error_count: 0,
121
+ max_errors: 3,
122
+ work_dir: workDir,
123
+ backup_dir: `${workDir}/backups`
124
+ };
125
+
126
+ write_file(`${workDir}/iteration-state.json`, JSON.stringify(initialState, null, 2));
127
+
128
+ // Chain mode: create per-skill tracking tasks
129
+ if (initialState.execution_mode === 'chain') {
130
+ for (const skill of targetSkills) {
131
+ create_task({
132
+ subject: `Chain: ${skill.name}`,
133
+ activeForm: `Tracking ${skill.name}`,
134
+ description: `Skill chain member: ${skill.path} | Position: ${targetSkills.indexOf(skill) + 1}/${targetSkills.length}`
135
+ });
136
+ }
137
+ }
138
+ ```
139
+
140
+ ## Output
141
+
142
+ - **Variables**: `workDir`, `targetSkills[]`, `testScenario`, `chainOrder` (chain mode)
143
+ - **Files**: `iteration-state.json`, `backups/` directory with skill copies
144
+ - **track_tasks**: Mark Phase 1 completed, start Iteration Loop. Chain mode: per-skill tracking tasks created