minimal-agent 0.8.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +14 -12
  2. package/package.json +34 -1
  3. package/plugins/cron-runner/.claude-plugin/plugin.json +5 -0
  4. package/plugins/cron-runner/commands/cron.md +26 -0
  5. package/plugins/cron-runner/commands/crons.md +7 -0
  6. package/plugins/cron-runner/plugin.js +34 -0
  7. package/plugins/cron-runner/src/commands.js +348 -0
  8. package/plugins/cron-runner/src/cronTime.js +148 -0
  9. package/plugins/cron-runner/src/lock.js +68 -0
  10. package/plugins/cron-runner/src/runs.js +89 -0
  11. package/plugins/cron-runner/src/scheduleEngine.js +72 -0
  12. package/plugins/cron-runner/src/scheduler.js +355 -0
  13. package/plugins/cron-runner/src/schema.js +140 -0
  14. package/plugins/cron-runner/src/service.js +167 -0
  15. package/plugins/cron-runner/src/store.js +298 -0
  16. package/plugins/cron-runner/src/types.js +1 -0
  17. package/plugins/workflow-runner/commands/workflow.md +4 -4
  18. package/plugins/workflow-runner/commands/workflows.md +1 -1
  19. package/plugins/workflow-runner/plugin.js +3 -1
  20. package/plugins/workflow-runner/src/agentCommon.js +249 -51
  21. package/plugins/workflow-runner/src/dslManifest.js +72 -0
  22. package/plugins/workflow-runner/src/expressions.js +198 -15
  23. package/plugins/workflow-runner/src/index.js +40 -8
  24. package/plugins/workflow-runner/src/jsonPayload.js +1 -1
  25. package/plugins/workflow-runner/src/loader.js +286 -72
  26. package/plugins/workflow-runner/src/multimodal.js +37 -0
  27. package/plugins/workflow-runner/src/recovery.js +49 -39
  28. package/plugins/workflow-runner/src/runner.js +802 -287
  29. package/plugins/workflow-runner/src/stepExecutors/agent.js +157 -39
  30. package/plugins/workflow-runner/src/stepExecutors/assert.js +16 -3
  31. package/plugins/workflow-runner/src/stepExecutors/llm.js +60 -111
  32. package/plugins/workflow-runner/src/stepExecutors/skill.js +47 -47
  33. package/plugins/workflow-runner/src/stepExecutors/tool.js +76 -10
  34. package/plugins/workflow-runner/src/stepExecutors/verify.js +27 -10
  35. package/plugins/workflow-runner/src/taskIdentity.js +296 -0
  36. package/plugins/workflow-runner/src/types.js +19 -9
  37. package/plugins/workflow-runner/src/workflowState.js +516 -33
  38. package/skills/adversarial-review/SKILL.md +0 -1
  39. package/skills/ai-image/SKILL.md +89 -0
  40. package/skills/ai-image/scripts/generate.mjs +497 -0
  41. package/skills/ai-image/scripts/generate_from_plan.mjs +469 -0
  42. package/skills/ai-image/scripts/generate_from_plan_test.mjs +223 -0
  43. package/skills/ai-image/scripts/generate_test.mjs +74 -0
  44. package/skills/browser-automation/SKILL.md +47 -0
  45. package/skills/docx/SKILL.md +25 -3
  46. package/skills/docx/scripts/office/helpers/__pycache__/__init__.cpython-314.pyc +0 -0
  47. package/skills/docx/scripts/office/helpers/__pycache__/merge_runs.cpython-314.pyc +0 -0
  48. package/skills/docx/scripts/office/helpers/__pycache__/simplify_redlines.cpython-314.pyc +0 -0
  49. package/skills/docx/scripts/office/validators/__pycache__/__init__.cpython-314.pyc +0 -0
  50. package/skills/docx/scripts/office/validators/__pycache__/base.cpython-314.pyc +0 -0
  51. package/skills/docx/scripts/office/validators/__pycache__/docx.cpython-314.pyc +0 -0
  52. package/skills/docx/scripts/office/validators/__pycache__/pptx.cpython-314.pyc +0 -0
  53. package/skills/docx/scripts/office/validators/__pycache__/redlining.cpython-314.pyc +0 -0
  54. package/skills/docx/scripts/opc_check.py +253 -0
  55. package/skills/image-gen-openrouter/SKILL.md +10 -2
  56. package/skills/image-stats/SKILL.md +65 -0
  57. package/skills/image-stats/scripts/__pycache__/image_stats.cpython-314.pyc +0 -0
  58. package/skills/image-stats/scripts/__pycache__/image_stats_test.cpython-314.pyc +0 -0
  59. package/skills/image-stats/scripts/image_stats.py +368 -0
  60. package/skills/image-stats/scripts/image_stats_test.py +181 -0
  61. package/skills/pptx/SKILL.md +123 -95
  62. package/skills/pptx/design.md +82 -0
  63. package/skills/pptx/examples/README.md +29 -0
  64. package/skills/pptx/examples/hybrid_example.mjs +107 -0
  65. package/skills/pptx/examples/hybrid_example.pptx +0 -0
  66. package/skills/pptx/pptxgenjs.md +41 -0
  67. package/skills/pptx/scripts/deck_helpers.mjs +224 -0
  68. package/skills/pptx/scripts/layout_lint.py +293 -0
  69. package/skills/pptx/scripts/layout_lint_test.py +160 -0
  70. package/skills/pptx/scripts/opc_check.py +339 -0
  71. package/skills/pptx/scripts/svg_fallback.mjs +145 -0
  72. package/skills/pptx/svg.md +67 -0
  73. package/skills/tts-zh/SKILL.md +19 -2
  74. package/skills/ui-design/SKILL.md +158 -0
  75. package/skills/ui-design/claude_design.md +309 -0
  76. package/skills/ui-design/evals/evals.json +254 -0
  77. package/skills/ui-design/references/aesthetic-direction.md +83 -0
  78. package/skills/ui-design/references/claude-design-protocol.md +36 -0
  79. package/skills/ui-design/references/design-context.md +53 -0
  80. package/skills/ui-design/references/design-execution-playbook.md +82 -0
  81. package/skills/ui-design/references/export-pptx.md +124 -0
  82. package/skills/ui-design/references/layout-composition.md +654 -0
  83. package/skills/ui-design/references/preview-feedback.md +37 -0
  84. package/skills/ui-design/references/source-image-layout.md +189 -0
  85. package/skills/ui-design/references/starter-components.md +78 -0
  86. package/skills/ui-design/references/vi-aegis-vector.md +144 -0
  87. package/skills/ui-design/references/vi-amber-prism.md +133 -0
  88. package/skills/ui-design/references/vi-aqua-glass.md +200 -0
  89. package/skills/ui-design/references/vi-comfort-vision.md +147 -0
  90. package/skills/ui-design/references/vi-ember-prism.md +140 -0
  91. package/skills/ui-design/references/vi-nebula-console.md +151 -0
  92. package/skills/ui-design/references/vi-obsidian-optics.md +139 -0
  93. package/skills/ui-design/references/vi-obsidian-xui.md +143 -0
  94. package/skills/ui-design/references/vi-precision-horizon-dark.md +117 -0
  95. package/skills/ui-design/references/vi-precision-horizon.md +215 -0
  96. package/skills/ui-design/references/vi-solar-relay.md +130 -0
  97. package/skills/ui-design/references/vi-template-workflow.md +48 -0
  98. package/skills/ui-design/references/vi-verdant-grid.md +141 -0
  99. package/skills/ui-design/references/vi-violet-meridian.md +172 -0
  100. package/skills/ui-design/scripts/__pycache__/assemble_material.cpython-314.pyc +0 -0
  101. package/skills/ui-design/scripts/__pycache__/assemble_material_test.cpython-314.pyc +0 -0
  102. package/skills/ui-design/scripts/__pycache__/chart_sanity_check.cpython-314.pyc +0 -0
  103. package/skills/ui-design/scripts/__pycache__/check_language_policy.cpython-314.pyc +0 -0
  104. package/skills/ui-design/scripts/__pycache__/check_ui_artifact.cpython-314.pyc +0 -0
  105. package/skills/ui-design/scripts/__pycache__/check_ui_artifact_pptx_test.cpython-314.pyc +0 -0
  106. package/skills/ui-design/scripts/__pycache__/deck_pages_check.cpython-314.pyc +0 -0
  107. package/skills/ui-design/scripts/__pycache__/deck_pages_check_test.cpython-314.pyc +0 -0
  108. package/skills/ui-design/scripts/__pycache__/deck_visual_style_check.cpython-314.pyc +0 -0
  109. package/skills/ui-design/scripts/__pycache__/deck_visual_style_check_test.cpython-314.pyc +0 -0
  110. package/skills/ui-design/scripts/__pycache__/design_budget_check.cpython-314.pyc +0 -0
  111. package/skills/ui-design/scripts/__pycache__/design_budget_check_test.cpython-314.pyc +0 -0
  112. package/skills/ui-design/scripts/__pycache__/design_repair_hints.cpython-314.pyc +0 -0
  113. package/skills/ui-design/scripts/__pycache__/design_repair_hints_test.cpython-314.pyc +0 -0
  114. package/skills/ui-design/scripts/__pycache__/design_style_check.cpython-314.pyc +0 -0
  115. package/skills/ui-design/scripts/__pycache__/design_style_check_test.cpython-314.pyc +0 -0
  116. package/skills/ui-design/scripts/__pycache__/draft_coverage_check.cpython-314.pyc +0 -0
  117. package/skills/ui-design/scripts/__pycache__/extract_source_assets.cpython-314.pyc +0 -0
  118. package/skills/ui-design/scripts/__pycache__/extract_source_assets_test.cpython-314.pyc +0 -0
  119. package/skills/ui-design/scripts/__pycache__/generated_image_review_collect.cpython-314.pyc +0 -0
  120. package/skills/ui-design/scripts/__pycache__/generated_image_review_collect_test.cpython-314.pyc +0 -0
  121. package/skills/ui-design/scripts/__pycache__/image_plan_lint.cpython-314.pyc +0 -0
  122. package/skills/ui-design/scripts/__pycache__/image_plan_lint_test.cpython-314.pyc +0 -0
  123. package/skills/ui-design/scripts/__pycache__/image_prompt_rewrite.cpython-314.pyc +0 -0
  124. package/skills/ui-design/scripts/__pycache__/image_prompt_rewrite_test.cpython-314.pyc +0 -0
  125. package/skills/ui-design/scripts/__pycache__/layout_balance.cpython-314.pyc +0 -0
  126. package/skills/ui-design/scripts/__pycache__/layout_balance_test.cpython-314.pyc +0 -0
  127. package/skills/ui-design/scripts/__pycache__/normalize_design_json.cpython-314.pyc +0 -0
  128. package/skills/ui-design/scripts/__pycache__/normalize_design_json_test.cpython-314.pyc +0 -0
  129. package/skills/ui-design/scripts/__pycache__/plan_source_layout.cpython-314.pyc +0 -0
  130. package/skills/ui-design/scripts/__pycache__/plan_source_layout_test.cpython-314.pyc +0 -0
  131. package/skills/ui-design/scripts/__pycache__/resolve_source_hint.cpython-314.pyc +0 -0
  132. package/skills/ui-design/scripts/__pycache__/resolve_source_hint_test.cpython-314.pyc +0 -0
  133. package/skills/ui-design/scripts/__pycache__/resolve_source_input.cpython-314.pyc +0 -0
  134. package/skills/ui-design/scripts/__pycache__/resolve_source_input_test.cpython-314.pyc +0 -0
  135. package/skills/ui-design/scripts/__pycache__/scaffold_ui_artifact.cpython-314.pyc +0 -0
  136. package/skills/ui-design/scripts/__pycache__/source_usage_check.cpython-314.pyc +0 -0
  137. package/skills/ui-design/scripts/__pycache__/source_usage_check_test.cpython-314.pyc +0 -0
  138. package/skills/ui-design/scripts/__pycache__/text_readability_pixel.cpython-314.pyc +0 -0
  139. package/skills/ui-design/scripts/__pycache__/visual_quality_gate.cpython-314.pyc +0 -0
  140. package/skills/ui-design/scripts/__pycache__/visual_quality_gate_test.cpython-314.pyc +0 -0
  141. package/skills/ui-design/scripts/assemble_material.py +217 -0
  142. package/skills/ui-design/scripts/assemble_material_test.py +149 -0
  143. package/skills/ui-design/scripts/browser_check_ui_artifact.mjs +221 -0
  144. package/skills/ui-design/scripts/chart_sanity_check.py +261 -0
  145. package/skills/ui-design/scripts/chart_sanity_check_test.py +165 -0
  146. package/skills/ui-design/scripts/check_language_policy.py +351 -0
  147. package/skills/ui-design/scripts/check_ui_artifact.py +435 -0
  148. package/skills/ui-design/scripts/check_ui_artifact_pptx_test.py +251 -0
  149. package/skills/ui-design/scripts/deck_pages_check.py +158 -0
  150. package/skills/ui-design/scripts/deck_pages_check_test.py +134 -0
  151. package/skills/ui-design/scripts/deck_visual_style_check.py +767 -0
  152. package/skills/ui-design/scripts/deck_visual_style_check_test.py +713 -0
  153. package/skills/ui-design/scripts/design_budget_check.py +271 -0
  154. package/skills/ui-design/scripts/design_budget_check_test.py +183 -0
  155. package/skills/ui-design/scripts/design_repair_hints.py +162 -0
  156. package/skills/ui-design/scripts/design_repair_hints_test.py +54 -0
  157. package/skills/ui-design/scripts/design_style_check.py +397 -0
  158. package/skills/ui-design/scripts/design_style_check_test.py +233 -0
  159. package/skills/ui-design/scripts/draft_coverage_check.py +184 -0
  160. package/skills/ui-design/scripts/draft_coverage_check_test.py +131 -0
  161. package/skills/ui-design/scripts/export_pptx_from_html.mjs +2367 -0
  162. package/skills/ui-design/scripts/extract_source_assets.py +607 -0
  163. package/skills/ui-design/scripts/extract_source_assets_test.py +256 -0
  164. package/skills/ui-design/scripts/generated_image_review_collect.py +206 -0
  165. package/skills/ui-design/scripts/generated_image_review_collect_test.py +91 -0
  166. package/skills/ui-design/scripts/image_plan_lint.py +571 -0
  167. package/skills/ui-design/scripts/image_plan_lint_test.py +515 -0
  168. package/skills/ui-design/scripts/image_prompt_rewrite.py +713 -0
  169. package/skills/ui-design/scripts/image_prompt_rewrite_test.py +966 -0
  170. package/skills/ui-design/scripts/layout_balance.py +881 -0
  171. package/skills/ui-design/scripts/layout_balance_test.py +927 -0
  172. package/skills/ui-design/scripts/normalize_design_json.py +272 -0
  173. package/skills/ui-design/scripts/normalize_design_json_test.py +119 -0
  174. package/skills/ui-design/scripts/plan_source_layout.py +1450 -0
  175. package/skills/ui-design/scripts/plan_source_layout_test.py +1136 -0
  176. package/skills/ui-design/scripts/resolve_source_input.py +270 -0
  177. package/skills/ui-design/scripts/resolve_source_input_test.py +98 -0
  178. package/skills/ui-design/scripts/scaffold_ui_artifact.py +377 -0
  179. package/skills/ui-design/scripts/source_usage_check.py +581 -0
  180. package/skills/ui-design/scripts/source_usage_check_test.py +427 -0
  181. package/skills/ui-design/scripts/text_readability_pixel.py +340 -0
  182. package/skills/ui-design/scripts/text_readability_pixel_test.py +219 -0
  183. package/skills/ui-design/scripts/visual_quality_gate.py +301 -0
  184. package/skills/ui-design/scripts/visual_quality_gate_test.py +233 -0
  185. package/skills/ui-design/tests/e2e/prompts/deck.md +19 -0
  186. package/skills/ui-design/tests/e2e/prompts/webpage.md +17 -0
  187. package/skills/ui-design/tests/e2e/render_check.mjs +101 -0
  188. package/skills/ui-design/tests/e2e/rubric.json +54 -0
  189. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/browser-check.json +49 -0
  190. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/language-check.txt +12 -0
  191. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/checks/static-check.txt +15 -0
  192. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/outputs/index.html +837 -0
  193. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/prompt.md +12 -0
  194. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/review.md +21 -0
  195. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/screenshots/desktop.png +0 -0
  196. package/skills/ui-design/tests/e2e/runs/aegis-vector-preview-1/screenshots/mobile.png +0 -0
  197. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/outputs/homepage.html +373 -0
  198. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/outputs/platform.html +378 -0
  199. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/prompt.md +13 -0
  200. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/review.md +26 -0
  201. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/browser-check.json +49 -0
  202. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/desktop.png +0 -0
  203. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/homepage/mobile.png +0 -0
  204. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/browser-check.json +49 -0
  205. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/desktop.png +0 -0
  206. package/skills/ui-design/tests/e2e/runs/amber-prism-screenshot-check-1/screenshots/platform/mobile.png +0 -0
  207. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/checks/static-check.txt +2 -0
  208. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/outputs/index.html +656 -0
  209. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/prompt.md +12 -0
  210. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-1/render_check.mjs +67 -0
  211. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/checks/static-check.txt +2 -0
  212. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/outputs/index.html +587 -0
  213. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/prompt.md +12 -0
  214. package/skills/ui-design/tests/e2e/runs/aqua-glass-iteration-2/review.md +36 -0
  215. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/browser-check.json +49 -0
  216. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/language-check.txt +8 -0
  217. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/checks/static-check.txt +16 -0
  218. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/outputs/index.html +739 -0
  219. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/prompt.md +11 -0
  220. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/review.md +22 -0
  221. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/screenshots/desktop.png +0 -0
  222. package/skills/ui-design/tests/e2e/runs/aqua-glass-volcano-refresh-1/screenshots/mobile.png +0 -0
  223. package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/checks/browser-check.json +52 -0
  224. package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/outputs/index.html +641 -0
  225. package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/screenshots/desktop.png +0 -0
  226. package/skills/ui-design/tests/e2e/runs/comfort-vision-preview-1/screenshots/mobile.png +0 -0
  227. package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/outputs/index.html +467 -0
  228. package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/browser-check.json +49 -0
  229. package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/desktop.png +0 -0
  230. package/skills/ui-design/tests/e2e/runs/ember-prism-red-preview-1/screenshots/mobile.png +0 -0
  231. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/outputs/homepage.html +373 -0
  232. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/outputs/platform.html +378 -0
  233. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/prompt.md +13 -0
  234. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/review.md +26 -0
  235. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/browser-check.json +49 -0
  236. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/desktop.png +0 -0
  237. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/homepage/mobile.png +0 -0
  238. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/browser-check.json +49 -0
  239. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/desktop.png +0 -0
  240. package/skills/ui-design/tests/e2e/runs/ember-prism-screenshot-check-1/screenshots/platform/mobile.png +0 -0
  241. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/browser-check.json +49 -0
  242. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/language-check.txt +4 -0
  243. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/checks/static-check.txt +2 -0
  244. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/execution_notes.md +10 -0
  245. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/outputs/index.html +587 -0
  246. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/prompt.md +14 -0
  247. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/review.md +13 -0
  248. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/screenshots/desktop.png +0 -0
  249. package/skills/ui-design/tests/e2e/runs/empty-agent-protocol-check/screenshots/mobile.png +0 -0
  250. package/skills/ui-design/tests/e2e/runs/iteration-1/deck/checks/browser-check.json +24 -0
  251. package/skills/ui-design/tests/e2e/runs/iteration-1/deck/checks/static-check.txt +2 -0
  252. package/skills/ui-design/tests/e2e/runs/iteration-1/deck/execution_notes.md +21 -0
  253. package/skills/ui-design/tests/e2e/runs/iteration-1/deck/outputs/deck.html +451 -0
  254. package/skills/ui-design/tests/e2e/runs/iteration-1/deck/screenshots/slide-01.png +0 -0
  255. package/skills/ui-design/tests/e2e/runs/iteration-1/deck/screenshots/slide-02.png +0 -0
  256. package/skills/ui-design/tests/e2e/runs/iteration-1/review.md +79 -0
  257. package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/checks/browser-check.json +26 -0
  258. package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/checks/static-check.txt +2 -0
  259. package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/execution_notes.md +20 -0
  260. package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/outputs/index.html +534 -0
  261. package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/screenshots/desktop.png +0 -0
  262. package/skills/ui-design/tests/e2e/runs/iteration-1/webpage/screenshots/mobile.png +0 -0
  263. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/browser-check.json +64 -0
  264. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/language-check.txt +7 -0
  265. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/quick-validate.txt +1 -0
  266. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/static-console.txt +2 -0
  267. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/checks/static-homepage.txt +2 -0
  268. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/outputs/console.html +600 -0
  269. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/outputs/homepage.html +556 -0
  270. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/prompt.md +29 -0
  271. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/review.md +57 -0
  272. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/console-desktop.png +0 -0
  273. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/console-mobile.png +0 -0
  274. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/homepage-desktop.png +0 -0
  275. package/skills/ui-design/tests/e2e/runs/nebula-console-iteration-1/screenshots/homepage-mobile.png +0 -0
  276. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/browser-check.json +33 -0
  277. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/language-check.txt +6 -0
  278. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/quick-validate.txt +1 -0
  279. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/checks/static-check.txt +2 -0
  280. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/outputs/index.html +682 -0
  281. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/prompt.md +13 -0
  282. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/review.md +59 -0
  283. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/screenshots/desktop.png +0 -0
  284. package/skills/ui-design/tests/e2e/runs/obsidian-optics-iteration-1/screenshots/mobile.png +0 -0
  285. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/outputs/page-01.html +466 -0
  286. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/outputs/page-02.html +433 -0
  287. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/prompt.md +13 -0
  288. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/browser-check.json +49 -0
  289. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/desktop.png +0 -0
  290. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-01/mobile.png +0 -0
  291. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/browser-check.json +49 -0
  292. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/desktop.png +0 -0
  293. package/skills/ui-design/tests/e2e/runs/obsidian-xui-screenshot-check-1/screenshots/page-02/mobile.png +0 -0
  294. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/browser-check.json +49 -0
  295. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/language-check.txt +3 -0
  296. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/checks/static-check.txt +2 -0
  297. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/execution_notes.md +24 -0
  298. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/outputs/index.html +723 -0
  299. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/prompt.md +15 -0
  300. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/review.md +26 -0
  301. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/screenshots/desktop.png +0 -0
  302. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-1/screenshots/mobile.png +0 -0
  303. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/browser-dark.json +49 -0
  304. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/browser-light.json +49 -0
  305. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/language-check.txt +11 -0
  306. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/static-dark.txt +2 -0
  307. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/checks/static-light.txt +3 -0
  308. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/execution_notes.md +23 -0
  309. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/outputs/dark.html +392 -0
  310. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/outputs/light.html +476 -0
  311. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/prompt.md +23 -0
  312. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/review.md +41 -0
  313. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/dark/desktop.png +0 -0
  314. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/dark/mobile.png +0 -0
  315. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/light/desktop.png +0 -0
  316. package/skills/ui-design/tests/e2e/runs/precision-horizon-iteration-2/screenshots/light/mobile.png +0 -0
  317. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/browser-check.json +54 -0
  318. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/language-check.txt +5 -0
  319. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/quick-validate.txt +1 -0
  320. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/checks/static-check.txt +2 -0
  321. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/outputs/index.html +765 -0
  322. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/prompt.md +15 -0
  323. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/review.md +59 -0
  324. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/screenshots/desktop.png +0 -0
  325. package/skills/ui-design/tests/e2e/runs/solar-relay-iteration-1/screenshots/mobile.png +0 -0
  326. package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/outputs/index.html +508 -0
  327. package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/browser-check.json +49 -0
  328. package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/desktop.png +0 -0
  329. package/skills/ui-design/tests/e2e/runs/verdant-grid-preview-1/screenshots/mobile.png +0 -0
  330. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/browser-check.json +54 -0
  331. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/language-check.txt +6 -0
  332. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/quick-validate.txt +1 -0
  333. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/checks/static-check.txt +2 -0
  334. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/outputs/index.html +788 -0
  335. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/prompt.md +14 -0
  336. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/review.md +60 -0
  337. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/screenshots/desktop.png +0 -0
  338. package/skills/ui-design/tests/e2e/runs/violet-meridian-iteration-1/screenshots/mobile.png +0 -0
  339. package/skills/video-compose/SKILL.md +8 -1
  340. package/skills/web-crawler/SKILL.md +70 -0
  341. package/skills/web-crawler/scripts/crawl.mjs +538 -0
  342. package/skills/web-crawler/scripts/crawl.test.mjs +204 -0
  343. package/skills/xlsx/SKILL.md +12 -0
  344. package/skills/xlsx/scripts/opc_check.py +253 -0
  345. package/src/advisorState.js +22 -0
  346. package/src/askBridge.js +97 -3
  347. package/src/bootstrap/workingDir.js +12 -1
  348. package/src/cli/args.js +17 -1
  349. package/src/cli/configMenu.js +236 -0
  350. package/src/cli/configWizard.js +7 -5
  351. package/src/cli/print.js +37 -4
  352. package/src/cli/streamJson.js +77 -24
  353. package/src/cli/wizards/advisorWizard.js +147 -0
  354. package/src/cli/wizards/fieldForm.js +149 -0
  355. package/src/cli/wizards/imageWizard.js +60 -0
  356. package/src/cli/wizards/openRouterWizard.js +23 -0
  357. package/src/cli/wizards/providerPresets.js +95 -0
  358. package/src/cli/wizards/providerWizard.js +219 -0
  359. package/src/cli/wizards/searchWizard.js +23 -0
  360. package/src/cli/wizards/ttsWizard.js +34 -0
  361. package/src/config/configFile.js +441 -83
  362. package/src/config/configService.js +446 -0
  363. package/src/config.js +24 -64
  364. package/src/context/agentHome.js +9 -0
  365. package/src/context/archive.js +7 -2
  366. package/src/context/compact.js +8 -5
  367. package/src/context/contextLock.js +81 -0
  368. package/src/context/persistContext.js +30 -11
  369. package/src/context/reactiveCompact.js +4 -2
  370. package/src/context/recentDirs.js +21 -61
  371. package/src/context/sessionPath.js +97 -23
  372. package/src/context/sessionRegistry.js +303 -24
  373. package/src/context/tokenCounter.js +18 -0
  374. package/src/context/workspaceIndex.js +731 -0
  375. package/src/infra/verification.js +28 -15
  376. package/src/llm/client.js +394 -159
  377. package/src/llm/providers/anthropicFormat.js +241 -0
  378. package/src/llm/providers/openaiFormat.js +190 -0
  379. package/src/loop.js +219 -32
  380. package/src/main.js +61 -11
  381. package/src/messageQueue.js +97 -0
  382. package/src/multimodal.js +203 -0
  383. package/src/plugin-sdk.js +15 -0
  384. package/src/plugins/commandRouter.js +3 -0
  385. package/src/plugins/hookEngine.js +5 -1
  386. package/src/plugins/pluginLifecycle.js +28 -0
  387. package/src/plugins/pluginLoader.js +2 -1
  388. package/src/plugins/pluginRunner.js +49 -21
  389. package/src/plugins/transcript.js +4 -3
  390. package/src/prompts/pluginList.js +5 -5
  391. package/src/prompts/projectInstructions.js +3 -3
  392. package/src/prompts/promptAssembly.js +133 -144
  393. package/src/prompts/skillList.js +12 -22
  394. package/src/prompts/system.js +0 -1
  395. package/src/session/runAgentTurn.js +70 -0
  396. package/src/session/runTurn.js +41 -6
  397. package/src/toolGate.js +17 -0
  398. package/src/tools/advisor/advisor.js +379 -0
  399. package/src/tools/agent/agent.js +555 -0
  400. package/src/tools/agent/agentTypes.js +59 -0
  401. package/src/tools/agent/coordinator.js +93 -0
  402. package/src/tools/agent/worktree.js +270 -0
  403. package/src/tools/ask/ask.js +7 -2
  404. package/src/tools/bash/bash.js +112 -18
  405. package/src/tools/download/download.js +144 -0
  406. package/src/tools/edit/edit.js +1 -0
  407. package/src/tools/edit/multi-edit.js +1 -0
  408. package/src/tools/genimage/genimage.js +242 -0
  409. package/src/tools/genspeech/genspeech.js +67 -0
  410. package/src/tools/glob/glob.js +1 -0
  411. package/src/tools/grep/grep.js +3 -0
  412. package/src/tools/grep/rgPath.js +2 -0
  413. package/src/tools/index.js +25 -2
  414. package/src/tools/read/read.js +1 -0
  415. package/src/tools/shared/killTree.js +52 -0
  416. package/src/tools/toolProgressBridge.js +48 -0
  417. package/src/tools/webbrowser/agentBrowserPath.js +258 -0
  418. package/src/tools/webbrowser/browser.js +59 -42
  419. package/src/tools/webbrowser/browserControl.js +118 -0
  420. package/src/tools/webbrowser/browserDaemon.js +97 -0
  421. package/src/tools/webbrowser/browserService.js +27 -0
  422. package/src/tools/webbrowser/browserStream.js +119 -0
  423. package/src/tools/webbrowser/webbrowser.js +699 -130
  424. package/src/tools/webfetch/webfetch.js +1 -0
  425. package/src/tools/websearch/websearch.js +134 -51
  426. package/src/tools/write/write.js +1 -0
  427. package/src/ui/App.js +249 -22
  428. package/src/ui/AskQuestion.js +29 -10
  429. package/src/ui/InputBox.js +104 -12
  430. package/src/ui/LiveArea.js +112 -19
  431. package/src/ui/MessageList.js +100 -14
  432. package/src/ui/ModelPicker.js +56 -0
  433. package/src/ui/QueuedMessagesBanner.js +14 -0
  434. package/src/ui/Root.js +18 -10
  435. package/src/ui/SessionPicker.js +102 -0
  436. package/src/ui/StatusLine.js +13 -4
  437. package/src/ui/WorkspacePicker.js +55 -0
  438. package/src/ui/figures.js +44 -0
  439. package/src/ui/hooks/askSlot.js +82 -0
  440. package/src/ui/hooks/useChat.js +358 -64
  441. package/src/ui/hooks/usePasteHandler.js +11 -1
  442. package/src/ui/hooks/useTextBuffer.js +1 -3
  443. package/src/ui/liveViewport.js +5 -1
  444. package/src/ui/markdown.js +206 -0
  445. package/src/ui/textBuffer.js +0 -7
  446. package/src/ui/theme.js +32 -0
  447. package/src/utils/debugLog.js +0 -4
  448. package/src/utils/resourcePaths.js +2 -2
  449. package/src/utils/stripThink.js +50 -0
  450. package/src/web/browserBridge.js +447 -0
  451. package/src/web/protocol.js +19 -0
  452. package/workflows/adaptive-research.yaml +13 -5
  453. package/workflows/book-review-short.yaml +36 -10
  454. package/workflows/e2e-write-greet.yaml +6 -2
  455. package/workflows/illustrate.yaml +227 -0
  456. package/workflows/plan.yaml +460 -179
  457. package/workflows/ppt.yaml +1659 -0
  458. package/workflows/ralph-loop.yaml +199 -0
  459. package/workflows/schema.json +81 -23
  460. package/workflows/webppt.yaml +496 -0
  461. package/workflows/word.yaml +710 -0
  462. package/workflows/youtube-shorts.yaml +46 -15
  463. package/MINIMAL-TRACE.md +0 -77
  464. package/plugins/HOW-TO-WRITE-A-PLUGIN.md +0 -186
  465. package/plugins/ralph-wiggum/.claude-plugin/plugin.json +0 -9
  466. package/plugins/ralph-wiggum/README.md +0 -197
  467. package/plugins/ralph-wiggum/commands/cancel-ralph.md +0 -18
  468. package/plugins/ralph-wiggum/commands/help.md +0 -137
  469. package/plugins/ralph-wiggum/commands/ralph-loop.md +0 -85
  470. package/plugins/ralph-wiggum/hooks/hooks.json +0 -15
  471. package/plugins/ralph-wiggum/hooks/stop-hook.sh +0 -191
  472. package/plugins/ralph-wiggum/plugin.js +0 -280
  473. package/plugins/ralph-wiggum/src/goalState.js +0 -258
  474. package/plugins/ralph-wiggum/src/sentinels.js +0 -76
  475. package/plugins/ralph-wiggum/src/stopHookRunner.js +0 -104
  476. package/plugins/ralph-wiggum/src/verificationGate.js +0 -202
  477. package/plugins/workflow-runner/src/miniReAct.js +0 -223
  478. package/plugins/workflow-runner/src/voteHelpers.js +0 -110
  479. package/skills/config/SKILL.md +0 -123
  480. package/skills/frontend-design/LICENSE.txt +0 -177
  481. package/skills/frontend-design/SKILL.md +0 -42
  482. package/src/ui/ProgressPanel.js +0 -54
  483. package/src/ui/StreamingBlock.js +0 -11
  484. package/src/ui/ToolStatus.js +0 -11
@@ -7,32 +7,40 @@ description: |
7
7
  去做任意视频流水线(横屏长视频、广告片、教程片都行)。
8
8
  version: "0.1"
9
9
 
10
+ # 声明产物:new-task 启动清理残留 / completed 报实际产物 / 同任务 resume 重写不被
11
+ # 内核「覆盖前先 Read」守卫挡(见 CLAUDE.md 任务身份语义)
12
+ artifacts:
13
+ - "./assets/script.json"
14
+ - "./out/shorts.mp4"
15
+
10
16
  inputs:
11
17
  - name: topic
12
18
  type: string
13
19
  required: true
14
- description: "视频主题(中文)"
20
+ greedy: true
21
+ description: "视频主题(中文,可一句话自然语言;命令行整句进 topic,不被空格拆碎)"
15
22
  - name: openrouter_key
16
23
  type: string
17
24
  required: false
18
- description: "OpenRouter API key;不填则用 OPENROUTER_API_KEY 环境变量"
25
+ description: "【高级·用 --input openrouter_key=...】OpenRouter API key;不填则用 OPENROUTER_API_KEY 环境变量"
19
26
  - name: aspect
20
27
  type: enum
21
28
  values: ["9:16", "16:9", "1:1", "4:5"]
22
29
  default: "9:16"
23
- description: "图片与视频宽高比"
30
+ description: "【高级·用 --input aspect=...】图片与视频宽高比"
24
31
  - name: width
25
32
  type: number
26
33
  default: 1080
27
- description: "视频输出宽度"
34
+ description: "【高级·用 --input width=N】视频输出宽度"
28
35
  - name: height
29
36
  type: number
30
37
  default: 1920
31
- description: "视频输出高度"
38
+ description: "【高级·用 --input height=N】视频输出高度"
32
39
 
33
40
  steps:
34
41
  # ---------- 1. 用 LLM 写 5 幕脚本(强制 5 幕以便后续 loop 用静态数组) ----------
35
42
  - id: write_script
43
+ title: "1/11·写五幕脚本"
36
44
  llm: |
37
45
  你是短视频文案策划。请为主题"${inputs.topic}"写一个 **正好 5 幕** 的竖屏短视频。
38
46
  每一幕包含:
@@ -48,13 +56,17 @@ steps:
48
56
 
49
57
  # ---------- 2. 把 LLM 输出落盘为 script.json ----------
50
58
  - id: write_script_json
59
+ title: "2/11·脚本落盘 script.json"
51
60
  tool: Write
61
+ artifacts:
62
+ - "./assets/script.json"
52
63
  args:
53
64
  file_path: "./assets/script.json"
54
65
  content: "${script_json_text}"
55
66
 
56
67
  # ---------- 3. 解析 script.json,拆出 prompts.txt / narrations.txt(每行一个) ----------
57
68
  - id: parse_script
69
+ title: "3/11·解析脚本拆分文案"
58
70
  tool: Bash
59
71
  args:
60
72
  command: |
@@ -69,44 +81,57 @@ steps:
69
81
  content: parse_log
70
82
 
71
83
  - id: assert_script_parsed
72
- type: assert
73
- condition: 'fileExists("./assets/prompts.txt") && fileExists("./assets/narrations.txt")'
84
+ title: "4/11·校验脚本拆分产物"
85
+ type: verify
86
+ checks:
87
+ - 'file_exists:./assets/prompts.txt'
88
+ - 'file_exists:./assets/narrations.txt'
74
89
  onFail: "脚本解析失败:./assets/prompts.txt 或 ./assets/narrations.txt 不存在"
75
90
 
76
91
  # ---------- 4. 生成 5 张配图(loop 静态数组 + 每轮先读对应一行 prompt) ----------
92
+ # ⚠️ Bash 引号 footgun:${i} 是引擎插值(shell 之前发生)。曾写 1 基算术
93
+ # `sed -n '$((${i}+1))p'`——shell 单引号内不做算术展开,sed 收到字面 $((0+1))p
94
+ # 直接报错。正解:loop 直接用 1 基序号,sed 行号即 ${i}。
77
95
  - id: gen_images
96
+ title: "5/11·生成五张配图"
78
97
  type: loop
79
- over: "[0, 1, 2, 3, 4]"
98
+ over: "[1, 2, 3, 4, 5]"
80
99
  as: i
81
100
  do:
82
101
  - id: read_prompt
102
+ title: "读第 ${i} 行画面提示词"
83
103
  tool: Bash
84
104
  args:
85
- command: "sed -n '$((${i}+1))p' ./assets/prompts.txt"
105
+ command: 'sed -n "${i}p" ./assets/prompts.txt'
86
106
  capture:
87
107
  content: prompt_text
88
108
  - id: gen_one_image
109
+ title: "生成第 ${i} 张配图"
89
110
  skill: image-gen-openrouter
90
111
  input: 'prompt=${prompt_text} output=./assets/img_${i}.png aspect=${inputs.aspect} key=${inputs.openrouter_key}'
91
112
 
92
- # ---------- 5. 生成 5 段 TTS 音频 ----------
113
+ # ---------- 5. 生成 5 段 TTS 音频(1 基序号,理由同 gen_images) ----------
93
114
  - id: gen_audio
115
+ title: "6/11·生成五段配音"
94
116
  type: loop
95
- over: "[0, 1, 2, 3, 4]"
117
+ over: "[1, 2, 3, 4, 5]"
96
118
  as: i
97
119
  do:
98
120
  - id: read_narration
121
+ title: "读第 ${i} 句旁白"
99
122
  tool: Bash
100
123
  args:
101
- command: "sed -n '$((${i}+1))p' ./assets/narrations.txt"
124
+ command: 'sed -n "${i}p" ./assets/narrations.txt'
102
125
  capture:
103
126
  content: narration_text
104
127
  - id: gen_one_tts
128
+ title: "合成第 ${i} 段语音"
105
129
  skill: tts-zh
106
130
  input: 'text=${narration_text} output=./assets/audio_${i}.mp3'
107
131
 
108
132
  # ---------- 6. 探测各段音频时长,逗号串联 ----------
109
133
  - id: probe_durations
134
+ title: "7/11·探测音频时长"
110
135
  tool: Bash
111
136
  args:
112
137
  command: |
@@ -119,6 +144,7 @@ steps:
119
144
 
120
145
  # ---------- 7. 合并所有 TTS 段成一条音轨 ----------
121
146
  - id: merge_audio
147
+ title: "8/11·合并音轨"
122
148
  tool: Bash
123
149
  args:
124
150
  command: |
@@ -133,6 +159,7 @@ steps:
133
159
 
134
160
  # ---------- 8. 读 narrations_json(前面 parse_script 已写好),作 SRT 文本输入 ----------
135
161
  - id: read_narrations_json
162
+ title: "9/11·读取旁白清单"
136
163
  tool: Read
137
164
  args:
138
165
  file_path: "./assets/narrations_json.txt"
@@ -141,18 +168,22 @@ steps:
141
168
 
142
169
  # ---------- 9. 生成 SRT 字幕 ----------
143
170
  - id: make_srt
171
+ title: "10/11·生成字幕"
144
172
  skill: subtitle-srt
145
173
  input: 'texts=${narrations_json} durations=${durations} output=./assets/subs.srt'
146
174
 
147
175
  # ---------- 10. 合成最终 mp4 ----------
148
176
  - id: compose_video
177
+ title: "11/11·合成最终视频"
149
178
  skill: video-compose
150
179
  input: 'images_glob=./assets/img_*.png audio=./assets/audio.mp3 srt=./assets/subs.srt output=./out/shorts.mp4 width=${inputs.width} height=${inputs.height}'
151
180
 
152
- # ---------- 11. 守门 assert ----------
181
+ # ---------- 11. 守门 verify(升级自 assert) ----------
153
182
  - id: verify_output
154
- type: assert
155
- condition: 'fileExists("./out/shorts.mp4")'
183
+ title: "完成·守门校验"
184
+ type: verify
185
+ checks:
186
+ - 'file_exists:./out/shorts.mp4'
156
187
  onFail: "最终视频 ./out/shorts.mp4 未生成,请检查 video-compose 日志"
157
188
 
158
189
  __meta:
package/MINIMAL-TRACE.md DELETED
@@ -1,77 +0,0 @@
1
- # MINIMAL-TRACE —— 用最短路径读懂 agent 主循环
2
-
3
- > 教学导读。本项目首要目标是「讲透一个 agent 从输入 → 工具循环 → 落盘」。
4
- > 但 `src/loop.ts` 已含不少**生产硬化**(4 种压缩 / 反应式自救 / 并行事件队列 / 截断警告…),
5
- > 初学者直接读会被淹没。这篇带你**第一遍只看主干**,把硬化层全部圈出来跳过。
6
-
7
- ## 一句话本质
8
-
9
- ```
10
- 用户输入 → 调 LLM → LLM 想调工具就执行 → 结果喂回 → 再调 LLM → … → 不调工具了,输出最终回答
11
- ```
12
-
13
- 整个 agent 就是这个循环。它写在 `src/loop.ts::runQuery`(一个 `async function*`,逐步 `yield` 事件给 UI)。
14
-
15
- ## 最小可读路径(第一遍只看这 6 步)
16
-
17
- 打开 `src/loop.ts`,找到 `runQuery`,顺着看这几段——**只看主干,遇到下面「进阶层」列出的东西先跳过**:
18
-
19
- 1. **用户消息入栈**:把 `{ role:'user', content: userInput }` push 进 `history`,`yield` 一个 `user_message_committed` 让 UI 先把它显示出来。`history` 是一个会被原地 mutate 的数组(调用方和 loop 共享同一引用)。
20
-
21
- 2. **进入 `while (turn < maxTurns)`**:每一轮 = 一次「调 LLM(可能带工具)」。`maxTurns`(默认 50)是失控保护。
22
-
23
- 3. **调 LLM、把流式响应拼成一条 assistant 消息**:`for await (const ev of chat({...}))` 逐块消费——`text_delta` 累积成答案文本并 `yield {type:'text'}`;`tool_call_delta` 累积成工具调用(OpenAI 协议下工具调用也是分片返回的,用 `mergeToolCallDelta` 合并)。循环结束后组装出 `assistantMsg` 推入 `history`、`yield assistant_message`。
24
-
25
- 4. **没有工具调用 → 这一轮就是最终回答,结束**:`if (toolCallsByIndex.length === 0)` → `yield {type:'turn_done'}` 然后 `return`。这是循环的正常出口。
26
-
27
- 5. **有工具调用 → 逐个执行、把结果按顺序回填 `history`**:对每个工具调用,`yield tool_start` → 调 `executeToolFn(name, argsJson, signal)` → `yield tool_end`,再把结果作为 `{ role:'tool', tool_call_id }` 消息 push 回 `history`。**关键**:tool 消息必须严格按 assistant 的 `tool_calls` 顺序回填(OpenAI 协议要求一一对应)。
28
-
29
- 6. **回到 `while` 顶部继续下一轮**:模型这次能看到上一轮的工具结果,于是接着推理——要么再调工具,要么给出最终答案(回到第 4 步出口)。
30
-
31
- 读完这 6 步,你就掌握了 agent 的全部本质。下面的都是「让它在生产环境不出岔子」的加固,第一遍可以完全不看。
32
-
33
- ## 进阶层(第一遍请跳过)
34
-
35
- 这些都是 `runQuery` 里为了**健壮/体验**加的料,每个解决一个具体问题,但都不影响你理解主循环:
36
-
37
- | 你会看到 | 它解决什么 | 第一遍 |
38
- |---|---|---|
39
- | `autoCompactIfNeeded`(每轮开头) | 上下文快撑爆时,把旧对话压成摘要,防止超 contextWindow | 跳过 |
40
- | `reactiveCompactIfApplicable`(catch 里) | 真撞上 prompt-too-long 时,压缩历史后**同轮重发**自救 | 跳过 |
41
- | `snipCompactIfNeeded`(压缩失败兜底) | 连压缩都失败时,硬砍最老消息释放空间再继续 | 跳过 |
42
- | `microCompact`(回填 tool 结果时) | 把单个超长工具输出就地压短,省 token | 跳过 |
43
- | `allConcurrencySafe` 分支 + 事件队列 | 本轮工具**全是只读**才并行执行,否则串行(杜绝并行写同一文件) | 跳过 |
44
- | `lastFinishReason === 'length'` 警告 | 模型答案被 max_tokens 截断时提醒用户「这是半截」 | 跳过 |
45
- | `reasoningContent / reasoning / reasoning_details` | 累积思维链(DeepSeek-R1 / MiniMax 等),下一轮原样回传防「失忆」 | 跳过 |
46
- | `error` 事件的 `code`(llm_error / max_turns / …) | 让 `-p --output-format json` 把终结原因映射成稳定的 stop_reason(给宿主 spawn 用) | 跳过 |
47
- | `options.chat` / `options.executeTool` | 依赖注入:测试时传 stub,零进程污染;生产走真实模块单例 | 跳过 |
48
-
49
- ## 时序图(主干)
50
-
51
- ```
52
- 用户输入
53
- │
54
- ▼
55
- runQuery ──push user 消息──► history
56
- │
57
- ├─◄─────────────────────────┐ (每轮 turn)
58
- ▼ │
59
- chat(LLM) ──流式 text / tool_call──► 拼成 assistant 消息 → history
60
- │ │
61
- ├── 无 tool_calls ──► turn_done ──► return(最终回答)
62
- │ │
63
- └── 有 tool_calls │
64
- │ │
65
- ▼ │
66
- executeTool ×N ──► tool 结果 → history ──┘(回到下一轮,模型看到结果再推理)
67
- ```
68
-
69
- ## 延伸阅读(按需,第几步用到再看)
70
-
71
- - **`src/types.ts`** —— 类型字典。先看 `Message`(4 种 role)、`ToolCall`、`LlmStreamEvent`(LLM 流式块)、`LoopEvent`(loop 给 UI 的事件)。读主循环前先扫一遍这四个就够。
72
- - **`src/llm/client.ts`** —— `chat()` 的实现:把 provider 的 SSE 流解析成 `LlmStreamEvent`。对应主干第 3 步。
73
- - **`src/tools/index.ts`** —— `ALL_TOOLS`(工具清单)+ `executeTool()`:参数防线(JSON.parse → Zod 校验 → 调 `tool.call()`,**工具失败不抛异常**,把 error 喂回 LLM 让它重试)。对应主干第 5 步。
74
- - **`src/context/compact.ts`** —— 自动压缩入口(进阶层)。想搞懂「上下文怎么不撑爆」再看。
75
- - **`src/loop.ts`** —— 主角本身。读完本文按上面 6 步对照源码,再回头看进阶层。
76
-
77
- > 一句话给初学者:**先把 6 步主干跑通,把进阶层当黑盒**;等你能复述「输入怎么变成最终回答」了,再一个个揭开硬化层——每揭开一个,你就多懂一点「为什么生产级 agent 不只是一个 while 循环」。
@@ -1,186 +0,0 @@
1
- # How to Write a minimal-agent Plugin
2
-
3
- minimal-agent 的插件系统遵循 **drop-in** 原则:把目录扔进 `plugins/`,命令立即可用,**`src/` 一行不改**。
4
-
5
- ## 两种契约
6
-
7
- ### 1. 纯声明式(Anthropic 兼容,零 TS)
8
-
9
- 最小可用插件 = 一个 frontmatter 模板。框架替你拼 prompt 喂给 LLM。
10
-
11
- ```
12
- plugins/hello-bot/
13
- ├── .claude-plugin/
14
- │ └── plugin.json
15
- └── commands/
16
- └── hi.md
17
- ```
18
-
19
- **`.claude-plugin/plugin.json`**
20
-
21
- ```json
22
- {
23
- "name": "hello-bot",
24
- "version": "0.1.0",
25
- "description": "Greets the user"
26
- }
27
- ```
28
-
29
- **`commands/hi.md`**
30
-
31
- ```markdown
32
- ---
33
- description: "Greet the user"
34
- argument-hint: "<name>"
35
- ---
36
-
37
- 你好 $ARGUMENTS!欢迎使用 minimal-agent。
38
- ```
39
-
40
- **效果**:用户输入 `/hi 世界` → LLM 收到 `你好 世界!欢迎使用 minimal-agent。\n\n用户参数: 世界`。
41
-
42
- 支持的占位符:
43
- - `$ARGUMENTS` / `${ARGUMENTS}` —— 用户在命令名后的全部文本
44
- - `${CLAUDE_PLUGIN_ROOT}` —— 该插件目录的绝对路径(用于引用插件资源)
45
-
46
- ### 2. 声明式 + `plugin.ts`(富插件)
47
-
48
- 当模板不够(要跑循环 / 做 TS 校验 / 启动子进程 / 状态机),加一个 `plugin.ts`:
49
-
50
- ```
51
- plugins/echo-bot/
52
- ├── .claude-plugin/plugin.json
53
- ├── commands/echo.md # 仍要存在!frontmatter 用于 listAvailableCommands
54
- └── plugin.ts # PluginApi default export
55
- ```
56
-
57
- **`plugin.ts`**
58
-
59
- ```typescript
60
- import {
61
- runQuery,
62
- type PluginApi,
63
- type LoopEvent,
64
- } from '../../src/plugin-sdk.ts';
65
-
66
- const api: PluginApi = {
67
- async *runCommand(commandName, args, ctx): AsyncGenerator<LoopEvent> {
68
- if (commandName === 'echo') {
69
- // 直接 yield 自定义事件
70
- yield { type: 'text', delta: `你输入了:${args}` };
71
- yield { type: 'turn_done' };
72
- return;
73
- }
74
-
75
- // 或者改写 prompt 后丢给 LLM
76
- yield* runQuery(`请把以下内容重复 3 遍:${args}`, {
77
- provider: ctx.provider,
78
- history: ctx.history,
79
- signal: ctx.signal,
80
- });
81
- },
82
- };
83
-
84
- export default api;
85
- ```
86
-
87
- **框架行为**:命中 `/echo abc` 时,`pluginRunner` 优先调用 `runCommand('echo', 'abc', ctx)`,不再走声明式 fallback。你完全接管事件流。
88
-
89
- ## `plugin-sdk.ts` 暴露的全部 API
90
-
91
- **唯一稳定 import 路径**:`from '../../src/plugin-sdk.ts'`(相对你的 `plugin.ts`)。
92
-
93
- | 名称 | 类型 | 用途 |
94
- |------|------|------|
95
- | `runQuery(input, opts)` | function | 标准 T-A-O-R 循环,AsyncGenerator |
96
- | `chat(messages, provider, opts)` | function | 单次非流式 LLM 调用 |
97
- | `executeTool(name, argsJson, ctx)` | function | 框架级工具调用入口 |
98
- | `getToolByName(name)` | function | 取 Tool 定义 |
99
- | `ALL_TOOLS` | const | 所有内置工具数组 |
100
- | `getWorkingDir()` | function | 当前锁定的工作目录 |
101
- | `getResourceSearchPaths(name, importMetaUrl)` | function | 双源资源路径(cwd + packageRoot) |
102
- | `triggerHook(event, payload)` | function | 触发框架级 hook |
103
- | `createSessionState()` | function | 新建 SessionState |
104
- | `Message` / `Provider` / `LoopEvent` / `LlmStreamEvent` | type | 协议类型 |
105
- | `Tool` / `ToolCall` / `ToolResult` | type | 工具协议类型 |
106
- | `PluginApi` / `PluginContext` | type | 你的 plugin.ts 契约 |
107
- | `ResourceName` / `HookEventName` / `HookDecision` / `SessionState` | type | 杂项 |
108
-
109
- **不要**绕开 `plugin-sdk.ts` 直接 import `src/loop.ts` / `src/llm/client.ts` 等内部路径 —— 那些路径不是稳定 API,框架重构时会破坏你的插件。
110
-
111
- ## `PluginContext`
112
-
113
- `runCommand` 收到的 ctx:
114
-
115
- ```typescript
116
- interface PluginContext {
117
- provider: Provider; // 当前 LLM provider 配置
118
- history: Message[]; // 对话历史(你可以读 / 修改 / 替换)
119
- signal?: AbortSignal; // 用户 ESC / Ctrl+C 时触发
120
- sessionState?: SessionState; // 可选共享 session 状态
121
- maxTurns?: number; // 工具循环最大轮数(runQuery 透传用)
122
- }
123
- ```
124
-
125
- ## 事件 (`LoopEvent`)
126
-
127
- 你的 `runCommand` 必须 yield `LoopEvent`,UI 据此渲染。常用的有:
128
-
129
- | type | 字段 | 用途 |
130
- |------|------|------|
131
- | `text` | `delta: string` | 流式文本片段 |
132
- | `assistant_message` | (无) | 一次完整 assistant 消息已 push 进 history |
133
- | `tool_start` | `toolName`, `argsPreview` | 工具开始执行 |
134
- | `tool_end` | (无) | 工具结束 |
135
- | `turn_done` | (无) | 整轮交互结束 |
136
- | `interrupted` | (无) | 用户中断 |
137
- | `error` | `error: string` | 红色错误提示 |
138
- | `plugin_progress` | `pluginId`, `current`, `max?`, `message?` | 循环进度条(替代旧的 plugin_start / plugin_iteration) |
139
-
140
- 通常做法:复杂插件直接 `yield* runQuery(...)` 透传所有事件,自己额外 yield `plugin_progress` 做进度展示。
141
-
142
- ## 工作目录与持久化
143
-
144
- - 状态写到 `getWorkingDir()/.minimal-agent-<your-plugin-id>/` 下,避免污染主 context 目录
145
- - `/new` 命令会自动清这些 `.minimal-agent*` 目录,你不用管 cleanup
146
- - 跨平台:Windows 没 bash,hooks/*.sh 静默跳过;其它 .ts 代码完全平台无关
147
-
148
- ## 命令默认值
149
-
150
- 框架**不再**注入命令默认参数(旧版 `COMMAND_DEFAULTS` 已删除)。如果你的命令需要默认值(如 `--max-iterations 50`),自己在 `plugin.ts` 里解析 args 时兜底。这样默认值的语义属于插件契约,不属于框架。
151
-
152
- ## 测试
153
-
154
- - 把测试放在 `plugins/<id>/test/*.test.ts`
155
- - `bunfig.toml` 的 `[test].root = ["./test", "./plugins"]` 让 `bun test` 自动发现
156
- - 测试里 mock LLM / 工具时,用 `mock.module('../../../src/loop.ts', ...)` 等绝对到 src 的相对路径
157
-
158
- ## 参考实现
159
-
160
- - **声明式 + plugin.ts 简单例**:`plugins/workflow-runner/plugin.ts`(~25 行接管 `/workflow` 与 `/workflows`)
161
- - **重型循环例**:`plugins/ralph-wiggum/plugin.ts`(~270 行 do-while loop + FSM + sentinel + verification + stop-hook)
162
-
163
- ## Transcript 与 Hook:当前状态
164
-
165
- 框架提供了两套基础设施 —— 都**就绪、有测试、可独立调用**,但**主循环 `src/loop.ts` 不自动触发**:
166
-
167
- | 模块 | 暴露 | 当前主循环触发? |
168
- |------|------|------|
169
- | `src/plugins/transcript.ts` | `initTranscript / appendUserMessage / appendAssistantMessage / appendToolResult` | 否 |
170
- | `src/plugins/hookEngine.ts` | `loadHooks / triggerHook('UserPromptSubmit' \| 'PreToolUse' \| 'PostToolUse' \| 'SessionStart' \| 'SessionEnd', payload)` | 否 |
171
-
172
- **插件如何使用**:
173
- - 想写自己的 JSONL transcript → 在 `runCommand` 内 `import { initTranscript, appendUserMessage } from '../../src/plugin-sdk.ts'` 自己调
174
- - 想响应 hook 事件 → 在 `runCommand` 内 `triggerHook('PreToolUse', { tool_name, ... })` 自己调;ralph-wiggum 走的就是这条路(vendored stop-hook 执行器在 `plugins/ralph-wiggum/src/stopHookRunner.ts`)
175
-
176
- **为什么不在主循环自动触发**:当前没有 Anthropic 风格 `hooks/*.sh` 的真实用例驱动;自动触发会改主循环热路径但不解决实际问题。等真有跨插件的全局 hook 需求时再接也不迟。届时只需在 `src/loop.ts` 的 user/assistant/tool 三处 push 点加 `appendXxx` 与 `triggerHook` 调用即可,**不影响插件契约**。
177
-
178
- ## 不支持的 Anthropic 字段
179
-
180
- minimal-agent 的插件契约是 Anthropic 上游的**子集**。当前未实现的字段:
181
-
182
- - `mcp-servers/` —— MCP 服务器配置
183
- - `agents/` —— 子 agent 定义
184
- - `skills/` 在插件目录下 —— minimal-agent 的 skill 系统是独立顶层目录
185
-
186
- 未实现字段在 plugin.json 中存在不会报错,但被忽略。
@@ -1,9 +0,0 @@
1
- {
2
- "name": "ralph-wiggum",
3
- "version": "1.0.0",
4
- "description": "Implementation of the Ralph Wiggum technique - continuous self-referential AI loops for interactive iterative development. Run Claude in a while-true loop with the same prompt until task completion.",
5
- "author": {
6
- "name": "Daisy Hollman",
7
- "email": "daisy@anthropic.com"
8
- }
9
- }
@@ -1,197 +0,0 @@
1
- # Ralph Wiggum Plugin
2
-
3
- Implementation of the Ralph Wiggum technique for iterative, self-referential AI development loops in Minimal Agent.
4
-
5
- ## What is Ralph?
6
-
7
- Ralph is a development methodology based on continuous AI agent loops. As Geoffrey Huntley describes it: **"Ralph is a Bash loop"** - a simple `while true` that repeatedly feeds an AI agent a prompt file, allowing it to iteratively improve its work until completion.
8
-
9
- The technique is named after Ralph Wiggum from The Simpsons, embodying the philosophy of persistent iteration despite setbacks.
10
-
11
- ### Core Concept
12
-
13
- This plugin implements Ralph using a **Stop hook** that intercepts Minimal Agent's exit attempts:
14
-
15
- ```bash
16
- # You run ONCE:
17
- /ralph-loop "Your task description" --completion-promise "DONE"
18
-
19
- # Then Claude Code automatically:
20
- # 1. Works on the task
21
- # 2. Tries to exit
22
- # 3. Stop hook blocks exit
23
- # 4. Stop hook feeds the SAME prompt back
24
- # 5. Repeat until completion
25
- ```
26
-
27
- The loop happens **inside your current session** - you don't need external bash loops. The Stop hook in `hooks/stop-hook.sh` creates the self-referential feedback loop by blocking normal session exit.
28
-
29
- This creates a **self-referential feedback loop** where:
30
- - The prompt never changes between iterations
31
- - Claude's previous work persists in files
32
- - Each iteration sees modified files and git history
33
- - Claude autonomously improves by reading its own past work in files
34
-
35
- ## Quick Start
36
-
37
- ```bash
38
- /ralph-loop "Build a REST API for todos. Requirements: CRUD operations, input validation, tests. Output <promise>COMPLETE</promise> when done." --completion-promise "COMPLETE" --max-iterations 50
39
- ```
40
-
41
- Claude will:
42
- - Implement the API iteratively
43
- - Run tests and see failures
44
- - Fix bugs based on test output
45
- - Iterate until all requirements met
46
- - Output the completion promise when done
47
-
48
- ## Commands
49
-
50
- ### /ralph-loop
51
-
52
- Start a Ralph loop in your current session.
53
-
54
- **Usage:**
55
- ```bash
56
- /ralph-loop "<prompt>" --max-iterations <n> --completion-promise "<text>"
57
- ```
58
-
59
- **Options:**
60
- - `--max-iterations <n>` - Stop after N iterations (default: 50, hard cap: 200)
61
- - `--completion-promise <text>` - Phrase that signals completion (natively active; default: DONE / COMPLETE / GOAL_COMPLETE)
62
- - `--verify "<CHECK>"` - Completion gate run after the promise tag. All checks must pass before the loop exits. Repeatable.
63
- - `shell:<cmd>` — exit code 0 = pass (Windows: `cmd /c`, others: `bash -c`)
64
- - `file_exists:<path>` — file must exist
65
- - `file_contains:<file>:<regex>` — file content matches regex
66
- - `test_count:<min>` — `bun test` pass count ≥ min
67
-
68
- Example:
69
- ```bash
70
- /ralph-loop "Implement and test cache layer" \
71
- --verify "shell:bun test" \
72
- --verify "file_exists:dist/index.js"
73
- ```
74
-
75
- ### /cancel-ralph
76
-
77
- Cancel the active Ralph loop.
78
-
79
- **Usage:**
80
- ```bash
81
- /cancel-ralph
82
- ```
83
-
84
- ## Prompt Writing Best Practices
85
-
86
- ### 1. Clear Completion Criteria
87
-
88
- ❌ Bad: "Build a todo API and make it good."
89
-
90
- ✅ Good:
91
- ```markdown
92
- Build a REST API for todos.
93
-
94
- When complete:
95
- - All CRUD endpoints working
96
- - Input validation in place
97
- - Tests passing (coverage > 80%)
98
- - README with API docs
99
- - Output: <promise>COMPLETE</promise>
100
- ```
101
-
102
- ### 2. Incremental Goals
103
-
104
- ❌ Bad: "Create a complete e-commerce platform."
105
-
106
- ✅ Good:
107
- ```markdown
108
- Phase 1: User authentication (JWT, tests)
109
- Phase 2: Product catalog (list/search, tests)
110
- Phase 3: Shopping cart (add/remove, tests)
111
-
112
- Output <promise>COMPLETE</promise> when all phases done.
113
- ```
114
-
115
- ### 3. Self-Correction
116
-
117
- ❌ Bad: "Write code for feature X."
118
-
119
- ✅ Good:
120
- ```markdown
121
- Implement feature X following TDD:
122
- 1. Write failing tests
123
- 2. Implement feature
124
- 3. Run tests
125
- 4. If any fail, debug and fix
126
- 5. Refactor if needed
127
- 6. Repeat until all green
128
- 7. Output: <promise>COMPLETE</promise>
129
- ```
130
-
131
- Tag lessons inline with `<learning>…</learning>` — the driver archives them to `learnings.md` automatically, so subsequent iterations inherit the hard-won knowledge without repeating mistakes.
132
-
133
- ### 4. Escape Hatches
134
-
135
- Always use `--max-iterations` as a safety net to prevent infinite loops on impossible tasks:
136
-
137
- ```bash
138
- # Recommended: Always set a reasonable iteration limit
139
- /ralph-loop "Try to implement feature X" --max-iterations 20
140
-
141
- # In your prompt, include what to do if stuck:
142
- # "After 15 iterations, if not complete:
143
- # - Document what's blocking progress
144
- # - List what was attempted
145
- # - Suggest alternative approaches"
146
- ```
147
-
148
- Claude can also signal early exit using two distinct tags:
149
- - `<PROMISE>NEED_REPLAN</PROMISE>` — current approach is unworkable; loop returns to PLAN with the same goal
150
- - `<PROMISE>NEED_GOAL_REVISION</PROMISE>` — the goal itself is unreachable; loop stops cleanly for human review. Use this when no approach can work, not just the current one.
151
-
152
- **Note**: The `--completion-promise` uses exact string matching and is natively active (no external stop-hook required). It signals Claude's intent to complete; use `--verify` checks for objective verification of that intent.
153
-
154
- ## Philosophy
155
-
156
- Ralph embodies several key principles:
157
-
158
- ### 1. Iteration > Perfection
159
- Don't aim for perfect on first try. Let the loop refine the work.
160
-
161
- ### 2. Failures Are Data
162
- "Deterministically bad" means failures are predictable and informative. Use them to tune prompts.
163
-
164
- ### 3. Operator Skill Matters
165
- Success depends on writing good prompts, not just having a good model.
166
-
167
- ### 4. Persistence Wins
168
- Keep trying until success. The loop handles retry logic automatically.
169
-
170
- ## When to Use Ralph
171
-
172
- **Good for:**
173
- - Well-defined tasks with clear success criteria
174
- - Tasks requiring iteration and refinement (e.g., getting tests to pass)
175
- - Greenfield projects where you can walk away
176
- - Tasks with automatic verification (tests, linters)
177
-
178
- **Not good for:**
179
- - Tasks requiring human judgment or design decisions
180
- - One-shot operations
181
- - Tasks with unclear success criteria
182
- - Production debugging (use targeted debugging instead)
183
-
184
- ## Real-World Results
185
-
186
- - Successfully generated 6 repositories overnight in Y Combinator hackathon testing
187
- - One $50k contract completed for $297 in API costs
188
- - Created entire programming language ("cursed") over 3 months using this approach
189
-
190
- ## Learn More
191
-
192
- - Original technique: https://ghuntley.com/ralph/
193
- - Ralph Orchestrator: https://github.com/mikeyobrien/ralph-orchestrator
194
-
195
- ## For Help
196
-
197
- Run `/help` in Claude Code for detailed command reference and examples.
@@ -1,18 +0,0 @@
1
- ---
2
- description: "Cancel active Ralph Wiggum loop"
3
- allowed-tools: ["Bash(test -f .minimal-agent/ralph-loop.local.md:*)", "Bash(rm .minimal-agent/ralph-loop.local.md)", "Read(.minimal-agent/ralph-loop.local.md)"]
4
- hide-from-slash-command-tool: "true"
5
- ---
6
-
7
- # Cancel Ralph
8
-
9
- To cancel the Ralph loop:
10
-
11
- 1. Check if `.minimal-agent/ralph-loop.local.md` exists using Bash: `test -f .minimal-agent/ralph-loop.local.md && echo "EXISTS" || echo "NOT_FOUND"`
12
-
13
- 2. **If NOT_FOUND**: Say "No active Ralph loop found."
14
-
15
- 3. **If EXISTS**:
16
- - Read `.minimal-agent/ralph-loop.local.md` to get the current iteration number from the `iteration:` field
17
- - Remove the file using Bash: `rm .minimal-agent/ralph-loop.local.md`
18
- - Report: "Cancelled Ralph loop (was at iteration N)" where N is the iteration value