@skj1724/oh-my-opencode 3.17.16 → 3.18.1
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.
- package/dist/agents/atlas/default-prompt-sections.d.ts +6 -6
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +6 -6
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +6 -6
- package/dist/agents/env-context.d.ts +1 -7
- package/dist/agents/metis.d.ts +9 -9
- package/dist/agents/momus.d.ts +11 -8
- package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
- package/dist/agents/prometheus/high-accuracy-mode.d.ts +1 -1
- package/dist/agents/prometheus/identity-constraints.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/cli/index.js +9 -6
- package/dist/config/schema/i18n.d.ts +21 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +3 -0
- package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
- package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +3 -3
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/builtin-commands/templates/stop-continuation.d.ts +1 -1
- package/dist/hooks/atlas/system-reminder-templates.d.ts +2 -2
- package/dist/index.js +3887 -3791
- package/dist/oh-my-opencode.schema.json +10 -0
- package/dist/tools/delegate-task/background-continuation.d.ts +1 -1
- package/dist/tools/delegate-task/constants.d.ts +2 -2
- package/dist/tools/delegate-task/resolve-metadata-model.d.ts +3 -2
- package/dist/tools/delegate-task/sync-continuation.d.ts +1 -1
- package/dist/tools/delegate-task/types.d.ts +1 -4
- package/package.json +2 -2
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* The markdown template structure for work plans generated by Prometheus.
|
|
5
5
|
* Includes TL;DR, context, objectives, verification strategy, TODOs, and success criteria.
|
|
6
6
|
*/
|
|
7
|
-
export declare const PROMETHEUS_PLAN_TEMPLATE = "## \u8BA1\u5212\u7ED3\u6784\n\n\u751F\u6210\u8BA1\u5212\u5230: `.sisyphus/plans/{name}.md`\n\n```markdown\n# {\u8BA1\u5212\u6807\u9898}\n\n## TL;DR\n\n> **\u5FEB\u901F\u6458\u8981**: [1-2 \u53E5\u8BDD\u6982\u62EC\u6838\u5FC3\u76EE\u6807\u548C\u65B9\u6848]\n>\n> **\u4EA4\u4ED8\u7269**: [\u5177\u4F53\u8F93\u51FA\u7684\u8981\u70B9\u5217\u8868]\n> - [\u4EA7\u51FA 1]\n> - [\u4EA7\u51FA 2]\n>\n> **\u9884\u4F30\u5DE5\u4F5C\u91CF**: [Quick | Short | Medium | Large | XL]\n> **\u5E76\u884C\u6267\u884C**: [YES - N \u4E2A wave | NO - \u4E32\u884C]\n> **\u5173\u952E\u8DEF\u5F84**: [Task X \u2192 Task Y \u2192 Task Z]\n\n---\n\n## Context\uFF08\u4E0A\u4E0B\u6587\uFF09\n\n### \u539F\u59CB\u9700\u6C42\n[\u7528\u6237\u7684\u521D\u59CB\u63CF\u8FF0]\n\n### Interview Summary\uFF08\u8BBF\u8C08\u6458\u8981\uFF09\n**\u5173\u952E\u8BA8\u8BBA**:\n- [\u8981\u70B9 1]: [\u7528\u6237\u7684\u51B3\u5B9A/\u504F\u597D]\n- [\u8981\u70B9 2]: [\u5546\u5B9A\u7684\u65B9\u6848]\n\n**\u7814\u7A76\u7ED3\u8BBA**:\n- [\u53D1\u73B0 1]: [\u5F71\u54CD]\n- [\u53D1\u73B0 2]: [\u5EFA\u8BAE]\n\n### Metis Review\n**\u5DF2\u8BC6\u522B\u7684\u7F3A\u53E3**\uFF08\u5DF2\u89E3\u51B3\uFF09:\n- [\u7F3A\u53E3 1]: [\u5982\u4F55\u89E3\u51B3]\n- [\u7F3A\u53E3 2]: [\u5982\u4F55\u89E3\u51B3]\n\n---\n\n## Work Objectives\uFF08\u5DE5\u4F5C\u76EE\u6807\uFF09\n\n### Core Objective\uFF08\u6838\u5FC3\u76EE\u6807\uFF09\n[1-2 \u53E5\u8BDD\uFF1A\u6211\u4EEC\u8981\u5B9E\u73B0\u4EC0\u4E48]\n\n### Concrete Deliverables\uFF08\u5177\u4F53\u4EA4\u4ED8\u7269\uFF09\n- [\u5177\u4F53\u6587\u4EF6/\u7AEF\u70B9/\u529F\u80FD]\n\n### Definition of Done\uFF08\u5B8C\u6210\u5B9A\u4E49\uFF09\n- [ ] [\u53EF\u9A8C\u8BC1\u7684\u6761\u4EF6 + \u547D\u4EE4]\n\n### Must Have\uFF08\u5FC5\u987B\u6709\uFF09\n[\u4E0D\u53EF\u534F\u5546\u7684\u9700\u6C42]\n\n### Must NOT Have\uFF08\u7981\u6B62\u9879\uFF0CGuardrails\uFF09\n- [Metis \u5BA1\u67E5\u4E2D\u660E\u786E\u6392\u9664\u7684\u5185\u5BB9]\n- [\u9700\u8981\u907F\u514D\u7684 AI slop \u6A21\u5F0F]\n- [\u8303\u56F4\u8FB9\u754C]\n\n---\n\n## Verification Strategy\uFF08\u9A8C\u8BC1\u7B56\u7565\uFF09(MANDATORY)\n\n> **ZERO HUMAN INTERVENTION** - \u6240\u6709\u9A8C\u8BC1\u5747\u7531 agent \u6267\u884C\u3002\u65E0\u4F8B\u5916\u3002\n> \u7981\u6B62\u4EFB\u4F55\u9700\u8981\"\u7528\u6237\u624B\u52A8\u6D4B\u8BD5/\u786E\u8BA4\"\u7684\u9A8C\u6536\u6807\u51C6\u3002\n\n### Test Decision\uFF08\u6D4B\u8BD5\u51B3\u7B56\uFF09\n- **Infrastructure exists**: [YES/NO]\n- **Automated tests**: [TDD / Tests-after / None]\n- **Framework**: [bun test / vitest / jest / pytest / none]\n- **If TDD**: \u6BCF\u4E2A\u4EFB\u52A1\u9075\u5FAA RED\uFF08\u5931\u8D25\u6D4B\u8BD5\uFF09\u2192 GREEN\uFF08\u6700\u5C0F\u5B9E\u73B0\uFF09\u2192 REFACTOR\n\n### QA Policy\n\u6BCF\u4E2A\u4EFB\u52A1\u5FC5\u987B\u5305\u542B agent \u6267\u884C\u7684 QA \u573A\u666F\uFF08\u89C1\u4E0B\u65B9 TODO \u6A21\u677F\uFF09\u3002\n\u8BC1\u636E\u4FDD\u5B58\u81F3 `.sisyphus/evidence/task-{N}-{scenario-slug}.{ext}`\u3002\n\n- **Frontend/UI**: \u4F7F\u7528 Playwright (playwright skill) - \u5BFC\u822A\u3001\u4EA4\u4E92\u3001\u65AD\u8A00 DOM\u3001\u622A\u56FE\n- **TUI/CLI**: \u4F7F\u7528 interactive_bash (tmux) - \u8FD0\u884C\u547D\u4EE4\u3001\u53D1\u9001\u6309\u952E\u3001\u9A8C\u8BC1\u8F93\u51FA\n- **API/Backend**: \u4F7F\u7528 Bash (curl) - \u53D1\u9001\u8BF7\u6C42\u3001\u65AD\u8A00\u72B6\u6001\u7801\u548C\u54CD\u5E94\u5B57\u6BB5\n- **Library/Module**: \u4F7F\u7528 Bash (bun/node REPL) - \u5BFC\u5165\u3001\u8C03\u7528\u51FD\u6570\u3001\u6BD4\u8F83\u8F93\u51FA\n\n---\n\n## Execution Strategy\uFF08\u6267\u884C\u7B56\u7565\uFF09\n\n### Parallel Execution Waves\uFF08\u5E76\u884C\u6267\u884C Wave\uFF09\n\n> \u901A\u8FC7\u5C06\u72EC\u7ACB\u4EFB\u52A1\u5206\u7EC4\u4E3A\u5E76\u884C wave \u6765\u6700\u5927\u5316\u541E\u5410\u91CF\u3002\n> \u6BCF\u4E2A wave \u5B8C\u6210\u540E\u624D\u5F00\u59CB\u4E0B\u4E00\u4E2A\u3002\n> \u76EE\u6807\uFF1A\u6BCF\u4E2A wave 5-8 \u4E2A\u4EFB\u52A1\u3002\u5C11\u4E8E 3 \u4E2A\uFF08\u9664\u6700\u7EC8 wave \u5916\uFF09= \u62C6\u5206\u4E0D\u8DB3\u3002\n\n```\nWave 1 (\u7ACB\u5373\u542F\u52A8 - \u57FA\u7840 + \u811A\u624B\u67B6):\n\u251C\u2500\u2500 Task 1: \u9879\u76EE\u811A\u624B\u67B6 + \u914D\u7F6E [quick]\n\u251C\u2500\u2500 Task 2: Design system tokens [quick]\n\u251C\u2500\u2500 Task 3: \u7C7B\u578B\u5B9A\u4E49 [quick]\n\u251C\u2500\u2500 Task 4: Schema \u5B9A\u4E49 [quick]\n\u251C\u2500\u2500 Task 5: \u5B58\u50A8\u63A5\u53E3 + \u5185\u5B58\u5B9E\u73B0 [quick]\n\u251C\u2500\u2500 Task 6: Auth \u4E2D\u95F4\u4EF6 [quick]\n\u2514\u2500\u2500 Task 7: Client \u6A21\u5757 [quick]\n\nWave 2 (Wave 1 \u4E4B\u540E - \u6838\u5FC3\u6A21\u5757, MAX PARALLEL):\n\u251C\u2500\u2500 Task 8: \u6838\u5FC3\u4E1A\u52A1\u903B\u8F91 (\u4F9D\u8D56: 3, 5, 7) [deep]\n\u251C\u2500\u2500 Task 9: API \u7AEF\u70B9 (\u4F9D\u8D56: 4, 5) [unspecified-high]\n\u251C\u2500\u2500 Task 10: \u8F85\u52A9\u5B58\u50A8\u5B9E\u73B0 (\u4F9D\u8D56: 5) [unspecified-high]\n\u251C\u2500\u2500 Task 11: Retry/fallback \u903B\u8F91 (\u4F9D\u8D56: 8) [deep]\n\u251C\u2500\u2500 Task 12: UI \u5E03\u5C40 + \u5BFC\u822A (\u4F9D\u8D56: 2) [visual-engineering]\n\u251C\u2500\u2500 Task 13: API client + hooks (\u4F9D\u8D56: 4) [quick]\n\u2514\u2500\u2500 Task 14: Telemetry \u4E2D\u95F4\u4EF6 (\u4F9D\u8D56: 5, 10) [unspecified-high]\n\nWave 3 (Wave 2 \u4E4B\u540E - \u96C6\u6210 + UI):\n\u251C\u2500\u2500 Task 15: \u4E3B\u8DEF\u7531\u7EC4\u5408\u6A21\u5757 (\u4F9D\u8D56: 6, 11, 14) [deep]\n\u251C\u2500\u2500 Task 16: UI \u6570\u636E\u53EF\u89C6\u5316 (\u4F9D\u8D56: 12, 13) [visual-engineering]\n\u251C\u2500\u2500 Task 17: \u90E8\u7F72\u914D\u7F6E A (\u4F9D\u8D56: 15) [quick]\n\u251C\u2500\u2500 Task 18: \u90E8\u7F72\u914D\u7F6E B (\u4F9D\u8D56: 15) [quick]\n\u251C\u2500\u2500 Task 19: \u90E8\u7F72\u914D\u7F6E C (\u4F9D\u8D56: 15) [quick]\n\u2514\u2500\u2500 Task 20: UI \u8BF7\u6C42\u65E5\u5FD7 + \u6784\u5EFA (\u4F9D\u8D56: 16) [visual-engineering]\n\nWave FINAL (\u6240\u6709\u4EFB\u52A1\u5B8C\u6210\u540E \u2014 4 \u4E2A\u5E76\u884C\u5BA1\u67E5, \u7136\u540E\u7528\u6237\u786E\u8BA4):\n\u251C\u2500\u2500 Task F1: \u8BA1\u5212\u5408\u89C4\u5BA1\u8BA1 (oracle)\n\u251C\u2500\u2500 Task F2: \u4EE3\u7801\u8D28\u91CF\u5BA1\u67E5 (unspecified-high)\n\u251C\u2500\u2500 Task F3: \u771F\u5B9E QA (unspecified-high)\n\u251C\u2500\u2500 Task F4: \u8303\u56F4\u4FDD\u771F\u5EA6\u68C0\u67E5 (deep)\n-> \u5C55\u793A\u7ED3\u679C -> \u83B7\u5F97\u7528\u6237\u660E\u786E\u786E\u8BA4\n\nCritical Path: Task 1 \u2192 Task 5 \u2192 Task 8 \u2192 Task 11 \u2192 Task 15 \u2192 Task 21 \u2192 F1-F4 \u2192 user okay\nParallel Speedup: ~70% faster than sequential\nMax Concurrent: 7 (Waves 1 & 2)\n```\n\n### Dependency Matrix\uFF08\u4F9D\u8D56\u77E9\u9635\uFF09(\u7B80\u5316\u7248 - \u5728\u751F\u6210\u7684\u5B8C\u6574\u8BA1\u5212\u4E2D\u5C55\u793A\u6240\u6709\u4EFB\u52A1)\n\n- **1-7**: - - 8-14, 1\n- **8**: 3, 5, 7 - 11, 15, 2\n- **11**: 8 - 15, 2\n- **14**: 5, 10 - 15, 2\n- **15**: 6, 11, 14 - 17-19, 21, 3\n- **21**: 15 - 23, 24, 4\n\n> \u8FD9\u662F\u7B80\u5316\u7248\u4F9B\u53C2\u8003\u3002\u4F60\u751F\u6210\u7684\u5B8C\u6574\u8BA1\u5212\u5FC5\u987B\u5305\u542B\u6240\u6709\u4EFB\u52A1\u7684\u5B8C\u6574\u77E9\u9635\u3002\n\n### Agent Dispatch Summary\uFF08Agent \u8C03\u5EA6\u6458\u8981\uFF09\n\n- **1**: **7** - T1-T4 \u2192 `quick`, T5 \u2192 `quick`, T6 \u2192 `quick`, T7 \u2192 `quick`\n- **2**: **7** - T8 \u2192 `deep`, T9 \u2192 `unspecified-high`, T10 \u2192 `unspecified-high`, T11 \u2192 `deep`, T12 \u2192 `visual-engineering`, T13 \u2192 `quick`, T14 \u2192 `unspecified-high`\n- **3**: **6** - T15 \u2192 `deep`, T16 \u2192 `visual-engineering`, T17-T19 \u2192 `quick`, T20 \u2192 `visual-engineering`\n- **4**: **4** - T21 \u2192 `deep`, T22 \u2192 `unspecified-high`, T23 \u2192 `deep`, T24 \u2192 `git`\n- **FINAL**: **4** - F1 \u2192 `oracle`, F2 \u2192 `unspecified-high`, F3 \u2192 `unspecified-high`, F4 \u2192 `deep`\n\n---\n\n## TODOs\n\n> \u5B9E\u73B0 + \u6D4B\u8BD5 = \u4E00\u4E2A\u4EFB\u52A1\u3002\u6C38\u4E0D\u5206\u79BB\u3002\n> \u6BCF\u4E2A\u4EFB\u52A1\u5FC5\u987B\u6709: Recommended Agent Profile + Parallelization info + QA Scenarios.\n> **\u6CA1\u6709 QA Scenarios \u7684\u4EFB\u52A1\u662F\u672A\u5B8C\u6210\u7684\u3002\u65E0\u4F8B\u5916\u3002**\n\n- [ ] 1. [\u4EFB\u52A1\u6807\u9898]\n\n **What to do\uFF08\u505A\u4EC0\u4E48\uFF09**:\n - [\u6E05\u6670\u7684\u5B9E\u73B0\u6B65\u9AA4]\n - [\u9700\u8981\u8986\u76D6\u7684\u6D4B\u8BD5\u7528\u4F8B]\n\n **Must NOT do\uFF08\u7981\u6B62\u505A\uFF09**:\n - [\u6765\u81EA guardrails \u7684\u5177\u4F53\u6392\u9664\u9879]\n\n **Recommended Agent Profile\uFF08\u63A8\u8350\u7684 Agent Profile\uFF09**:\n > \u6839\u636E\u4EFB\u52A1\u9886\u57DF\u9009\u62E9 category + skills\u3002\u4E3A\u6BCF\u4E2A\u9009\u62E9\u63D0\u4F9B\u7406\u7531\u3002\n - **Category**: `[visual-engineering | ultrabrain | artistry | quick | unspecified-low | unspecified-high | writing]`\n - Reason: [\u4E3A\u4EC0\u4E48\u6B64 category \u9002\u5408\u4EFB\u52A1\u9886\u57DF]\n - **Skills**: [`skill-1`, `skill-2`]\n - `skill-1`: [\u4E3A\u4EC0\u4E48\u9700\u8981 - \u9886\u57DF\u91CD\u53E0\u8BF4\u660E]\n - `skill-2`: [\u4E3A\u4EC0\u4E48\u9700\u8981 - \u9886\u57DF\u91CD\u53E0\u8BF4\u660E]\n - **Skills Evaluated but Omitted\uFF08\u5DF2\u8BC4\u4F30\u4F46\u672A\u9009\u7528\u7684 Skills\uFF09**:\n - `omitted-skill`: [\u4E3A\u4EC0\u4E48\u9886\u57DF\u4E0D\u91CD\u53E0]\n\n **Parallelization\uFF08\u5E76\u884C\u5316\uFF09**:\n - **Can Run In Parallel**: YES | NO\n - **Parallel Group**: Wave N (with Tasks X, Y) | Sequential\n - **Blocks**: [\u4F9D\u8D56\u6B64\u4EFB\u52A1\u5B8C\u6210\u7684\u4EFB\u52A1]\n - **Blocked By**: [\u6B64\u4EFB\u52A1\u4F9D\u8D56\u7684\u4EFB\u52A1] | None (\u53EF\u7ACB\u5373\u5F00\u59CB)\n\n **References\uFF08\u53C2\u8003\u8D44\u6599\uFF09**(CRITICAL - \u5FC5\u987B\u8BE6\u5C3D):\n\n > \u6267\u884C\u8005\u6CA1\u6709\u6765\u81EA\u8BBF\u8C08\u7684\u4E0A\u4E0B\u6587\u3002\u53C2\u8003\u8D44\u6599\u662F\u5176\u552F\u4E00\u7684\u6307\u5357\u3002\n > \u6BCF\u6761\u53C2\u8003\u5FC5\u987B\u56DE\u7B54: \"\u6211\u5E94\u8BE5\u67E5\u770B\u4EC0\u4E48\uFF0C\u4EE5\u53CA\u4E3A\u4EC0\u4E48\uFF1F\"\n\n **Pattern References\uFF08\u6A21\u5F0F\u53C2\u8003\uFF09**\uFF08\u73B0\u6709\u4EE3\u7801\u89C4\u8303\uFF09:\n - `src/services/auth.ts:45-78` - Authentication flow pattern (JWT \u521B\u5EFA, refresh token \u5904\u7406)\n\n **API/Type References\uFF08API/\u7C7B\u578B\u53C2\u8003\uFF09**\uFF08\u9700\u5B9E\u73B0\u7684\u5951\u7EA6\uFF09:\n - `src/types/user.ts:UserDTO` - \u7528\u6237\u7AEF\u70B9\u54CD\u5E94\u7ED3\u6784\n\n **Test References\uFF08\u6D4B\u8BD5\u53C2\u8003\uFF09**\uFF08\u9075\u5FAA\u7684\u6D4B\u8BD5\u6A21\u5F0F\uFF09:\n - `src/__tests__/auth.test.ts:describe(\"login\")` - \u6D4B\u8BD5\u7ED3\u6784\u548C Mock \u6A21\u5F0F\n\n **External References\uFF08\u5916\u90E8\u53C2\u8003\uFF09**\uFF08\u5E93\u548C\u6846\u67B6\uFF09:\n - Official docs: `https://zod.dev/?id=basic-usage` - Zod \u9A8C\u8BC1\u8BED\u6CD5\n\n **WHY Each Reference Matters\uFF08\u6BCF\u6761\u53C2\u8003\u7684\u91CD\u8981\u6027\u8BF4\u660E\uFF09**:\n - \u4E0D\u8981\u53EA\u5217\u51FA\u6587\u4EF6 - \u89E3\u91CA\u6267\u884C\u8005\u5E94\u8BE5\u63D0\u53D6\u4EC0\u4E48\u6A21\u5F0F/\u4FE1\u606F\n - \u5DEE: `src/utils.ts` (\u6A21\u7CCA\uFF0C\u54EA\u4E2A utils\uFF1F\u4E3A\u4EC0\u4E48\uFF1F)\n - \u597D: `src/utils/validation.ts:sanitizeInput()` - \u4F7F\u7528\u6B64\u6D88\u6BD2\u6A21\u5F0F\u5904\u7406\u7528\u6237\u8F93\u5165\n\n **Acceptance Criteria\uFF08\u9A8C\u6536\u6807\u51C6\uFF09**:\n\n > **\u4EC5\u9650 AGENT \u53EF\u6267\u884C\u7684\u9A8C\u8BC1** - \u7981\u6B62\u4EBA\u5DE5\u64CD\u4F5C\u3002\n > \u6BCF\u6761\u6807\u51C6\u5FC5\u987B\u53EF\u901A\u8FC7\u8FD0\u884C\u547D\u4EE4\u6216\u4F7F\u7528\u5DE5\u5177\u6765\u9A8C\u8BC1\u3002\n\n **If TDD (tests enabled):**\n - [ ] Test file created: src/auth/login.test.ts\n - [ ] bun test src/auth/login.test.ts \u2192 PASS (3 tests, 0 failures)\n\n **QA Scenarios\uFF08QA \u573A\u666F\uFF09(MANDATORY - \u6CA1\u6709\u8FD9\u4E9B\u5219\u4EFB\u52A1\u672A\u5B8C\u6210)**:\n\n > **\u8FD9\u662F\u5FC5\u9009\u9879\u3002\u6CA1\u6709 QA \u573A\u666F\u7684\u4EFB\u52A1\u5C06\u88AB\u62D2\u7EDD\u3002**\n >\n > \u7F16\u5199\u573A\u666F\u6D4B\u8BD5\u4EE5\u9A8C\u8BC1\u4F60\u6784\u5EFA\u7684\u5B9E\u9645\u884C\u4E3A\u3002\n > \u6700\u5C11: \u6BCF\u4E2A\u4EFB\u52A1 1 \u4E2A happy path + 1 \u4E2A\u5931\u8D25/\u8FB9\u754C\u60C5\u51B5\u3002\n > \u6BCF\u4E2A\u573A\u666F = \u5177\u4F53\u5DE5\u5177 + \u5177\u4F53\u6B65\u9AA4 + \u5177\u4F53\u65AD\u8A00 + \u8BC1\u636E\u8DEF\u5F84\u3002\n >\n > **\u6267\u884C agent \u5FC5\u987B\u5728\u5B9E\u73B0\u540E\u8FD0\u884C\u8FD9\u4E9B\u573A\u666F\u3002**\n > **orchestrator \u5C06\u5728\u6807\u8BB0\u4EFB\u52A1\u5B8C\u6210\u524D\u9A8C\u8BC1\u8BC1\u636E\u6587\u4EF6\u662F\u5426\u5B58\u5728\u3002**\n\n \\`\\`\\`\n Scenario: [Happy path - \u4EC0\u4E48\u5E94\u8BE5\u6B63\u5E38\u5DE5\u4F5C]\n Tool: [Playwright / interactive_bash / Bash (curl)]\n Preconditions: [\u7CBE\u786E\u7684\u521D\u59CB\u72B6\u6001]\n Steps:\n 1. [\u7CBE\u786E\u7684\u64CD\u4F5C - \u5177\u4F53\u547D\u4EE4/\u9009\u62E9\u5668/\u7AEF\u70B9\uFF0C\u4E0D\u6A21\u7CCA]\n 2. [\u4E0B\u4E00\u6B65\u64CD\u4F5C - \u5305\u542B\u671F\u671B\u7684\u4E2D\u95F4\u72B6\u6001]\n 3. [\u65AD\u8A00 - \u7CBE\u786E\u7684\u671F\u671B\u503C\uFF0C\u4E0D\u662F\"\u9A8C\u8BC1\u5B83\u80FD\u5DE5\u4F5C\"]\n Expected Result: [\u5177\u4F53\u7684\u3001\u53EF\u89C2\u6D4B\u7684\u3001\u4E8C\u5143 pass/fail]\n Failure Indicators: [\u5177\u4F53\u4EC0\u4E48\u610F\u5473\u7740\u5931\u8D25]\n Evidence: .sisyphus/evidence/task-{N}-{scenario-slug}.{ext}\n\n Scenario: [Failure/edge case - \u4EC0\u4E48\u5E94\u8BE5\u4F18\u96C5\u5730\u5931\u8D25]\n Tool: [\u540C\u4E0A\u683C\u5F0F]\n Preconditions: [\u65E0\u6548\u8F93\u5165 / \u7F3A\u5931\u4F9D\u8D56 / \u9519\u8BEF\u72B6\u6001]\n Steps:\n 1. [\u89E6\u53D1\u9519\u8BEF\u6761\u4EF6]\n 2. [\u65AD\u8A00\u9519\u8BEF\u88AB\u6B63\u786E\u5904\u7406]\n Expected Result: [\u4F18\u96C5\u5931\u8D25 + \u6B63\u786E\u7684\u9519\u8BEF\u4FE1\u606F/\u4EE3\u7801]\n Evidence: .sisyphus/evidence/task-{N}-{scenario-slug}-error.{ext}\n \\`\\`\\`\n\n > **\u5177\u4F53\u6027\u8981\u6C42 - \u6BCF\u4E2A\u573A\u666F\u5FC5\u987B\u5305\u542B:**\n > - **Selectors**: \u5177\u4F53\u7684 CSS \u9009\u62E9\u5668 (`.login-button`, \u800C\u4E0D\u662F\"\u767B\u5F55\u6309\u94AE\")\n > - **Data**: \u5177\u4F53\u7684\u6D4B\u8BD5\u6570\u636E (`\"test@example.com\"`, \u800C\u4E0D\u662F`\"[email]\"`)\n > - **Assertions**: \u7CBE\u786E\u7684\u503C (`text contains \"Welcome back\"`, \u800C\u4E0D\u662F\"\u9A8C\u8BC1\u5B83\u80FD\u5DE5\u4F5C\")\n > - **Timing**: \u76F8\u5173\u7B49\u5F85\u6761\u4EF6 (`timeout: 10s`)\n > - **Negative**: \u6BCF\u4E2A\u4EFB\u52A1\u81F3\u5C11\u4E00\u4E2A\u5931\u8D25/\u9519\u8BEF\u573A\u666F\n >\n > **Anti-patterns\uFF08\u5982\u679C\u573A\u666F\u50CF\u8FD9\u6837\u5219\u662F\u65E0\u6548\u7684\uFF09:**\n > - \u274C \"Verify it works correctly\" - \u600E\u4E48\u505A\uFF1F\"correctly\"\u662F\u4EC0\u4E48\u610F\u601D\uFF1F\n > - \u274C \"Check the API returns data\" - \u4EC0\u4E48\u6570\u636E\uFF1F\u54EA\u4E9B\u5B57\u6BB5\uFF1F\u4EC0\u4E48\u503C\uFF1F\n > - \u274C \"Test the component renders\" - \u5728\u54EA\u91CC\uFF1F\u4EC0\u4E48\u9009\u62E9\u5668\uFF1F\u4EC0\u4E48\u5185\u5BB9\uFF1F\n > - \u274C \u4EFB\u4F55\u6CA1\u6709\u8BC1\u636E\u8DEF\u5F84\u7684\u573A\u666F\n\n **Evidence to Capture\uFF08\u8981\u6355\u83B7\u7684\u8BC1\u636E\uFF09:**\n - [ ] \u6BCF\u4E2A\u8BC1\u636E\u6587\u4EF6\u547D\u540D\u4E3A: task-{N}-{scenario-slug}.{ext}\n - [ ] UI \u622A\u56FE, CLI \u7EC8\u7AEF\u8F93\u51FA, API \u54CD\u5E94\u4F53\n\n **Commit**: YES | NO (groups with N)\n - Message: `type(scope): desc`\n - Files: `path/to/file`\n - Pre-commit: `test command`\n\n---\n\n## Final Verification Wave\uFF08\u6700\u7EC8\u9A8C\u8BC1 Wave\uFF09(MANDATORY \u2014 \u6240\u6709\u5B9E\u73B0\u4EFB\u52A1\u5B8C\u6210\u540E)\n\n> 4 \u4E2A\u5BA1\u67E5 agent \u5E76\u884C\u8FD0\u884C\u3002\u5168\u90E8\u5FC5\u987B\u6279\u51C6\u3002\u6C47\u603B\u7ED3\u679C\u540E\u83B7\u5F97\u7528\u6237\u660E\u786E\u786E\u8BA4\uFF0C\u624D\u80FD\u6807\u8BB0\u5DE5\u4F5C\u5B8C\u6210\u3002\n>\n> **\u9A8C\u8BC1\u540E\u4E0D\u8981\u81EA\u52A8\u7EE7\u7EED\u3002\u7B49\u5F85\u7528\u6237\u660E\u786E\u6279\u51C6\u540E\u518D\u6807\u8BB0\u5DE5\u4F5C\u5B8C\u6210\u3002**\n> **\u5728\u83B7\u5F97\u7528\u6237\u786E\u8BA4\u524D\u4E0D\u8981\u5C06 F1-F4 \u6807\u8BB0\u4E3A\u5DF2\u5B8C\u6210\u3002** \u88AB\u62D2\u7EDD\u6216\u7528\u6237\u53CD\u9988 -> \u4FEE\u590D -> \u91CD\u65B0\u8FD0\u884C -> \u518D\u6B21\u5C55\u793A -> \u7B49\u5F85\u786E\u8BA4\u3002\n\n- [ ] F1. **Plan Compliance Audit** \u2014 `oracle`\n \u4ECE\u5934\u5230\u5C3E\u9605\u8BFB\u8BA1\u5212\u3002\u5BF9\u4E8E\u6BCF\u4E2A \"Must Have\": \u9A8C\u8BC1\u5B9E\u73B0\u5B58\u5728\uFF08\u8BFB\u6587\u4EF6\u3001curl \u7AEF\u70B9\u3001\u8FD0\u884C\u547D\u4EE4\uFF09\u3002\u5BF9\u4E8E\u6BCF\u4E2A \"Must NOT Have\": \u5728\u4EE3\u7801\u5E93\u4E2D\u641C\u7D22\u7981\u6B62\u7684\u6A21\u5F0F \u2014 \u5982\u53D1\u73B0\u5219\u7528 file:line \u62D2\u7EDD\u3002\u68C0\u67E5\u8BC1\u636E\u6587\u4EF6\u662F\u5426\u5B58\u5728\u4E8E .sisyphus/evidence/\u3002\u5BF9\u6BD4\u4EA4\u4ED8\u7269\u4E0E\u8BA1\u5212\u3002\n Output: `Must Have [N/N] | Must NOT Have [N/N] | Tasks [N/N] | VERDICT: APPROVE/REJECT`\n\n- [ ] F2. **Code Quality Review** \u2014 `unspecified-high`\n \u8FD0\u884C `tsc --noEmit` + linter + `bun test`\u3002\u5BA1\u67E5\u6240\u6709\u53D8\u66F4\u6587\u4EF6: `as any`/`@ts-ignore`\u3001\u7A7A\u7684 catch\u3001prod \u4E2D\u7684 console.log\u3001\u6CE8\u91CA\u6389\u7684\u4EE3\u7801\u3001\u672A\u4F7F\u7528\u7684 import\u3002\u68C0\u67E5 AI slop: \u8FC7\u5EA6\u6CE8\u91CA\u3001\u8FC7\u5EA6\u62BD\u8C61\u3001\u901A\u7528\u540D\u79F0 (data/result/item/temp)\u3002\n Output: `Build [PASS/FAIL] | Lint [PASS/FAIL] | Tests [N pass/N fail] | Files [N clean/N issues] | VERDICT`\n\n- [ ] F3. **Real Manual QA** \u2014 `unspecified-high` (+ `playwright` skill \u5982\u6709 UI)\n \u4ECE\u5E72\u51C0\u72B6\u6001\u5F00\u59CB\u3002\u6267\u884C\u6BCF\u4E2A\u4EFB\u52A1\u4E2D\u7684\u6BCF\u4E2A QA \u573A\u666F \u2014 \u9075\u5FAA\u7CBE\u786E\u6B65\u9AA4\uFF0C\u6355\u83B7\u8BC1\u636E\u3002\u6D4B\u8BD5\u8DE8\u4EFB\u52A1\u96C6\u6210\uFF08\u529F\u80FD\u534F\u540C\u5DE5\u4F5C\uFF0C\u800C\u975E\u9694\u79BB\uFF09\u3002\u6D4B\u8BD5\u8FB9\u754C\u60C5\u51B5: \u7A7A\u72B6\u6001\u3001\u65E0\u6548\u8F93\u5165\u3001\u5FEB\u901F\u64CD\u4F5C\u3002\u4FDD\u5B58\u81F3 `.sisyphus/evidence/final-qa/`\u3002\n Output: `Scenarios [N/N pass] | Integration [N/N] | Edge Cases [N tested] | VERDICT`\n\n- [ ] F4. **Scope Fidelity Check** \u2014 `deep`\n \u5BF9\u6BCF\u4E2A\u4EFB\u52A1: \u9605\u8BFB \"What to do\"\uFF0C\u9605\u8BFB\u5B9E\u9645 diff (git log/diff)\u3002\u9A8C\u8BC1 1:1 \u2014 \u89C4\u683C\u4E2D\u7684\u6BCF\u9879\u90FD\u5DF2\u6784\u5EFA\uFF08\u65E0\u9057\u6F0F\uFF09\uFF0C\u8D85\u51FA\u89C4\u683C\u7684\u5185\u5BB9\u672A\u6784\u5EFA\uFF08\u65E0\u8513\u5EF6\uFF09\u3002\u68C0\u67E5 \"Must NOT do\" \u5408\u89C4\u6027\u3002\u68C0\u6D4B\u8DE8\u4EFB\u52A1\u6C61\u67D3: Task N \u89E6\u78B0 Task M \u7684\u6587\u4EF6\u3002\u6807\u8BB0\u672A\u8BA1\u5165\u7684\u53D8\u66F4\u3002\n Output: `Tasks [N/N compliant] | Contamination [CLEAN/N issues] | Unaccounted [CLEAN/N files] | VERDICT`\n\n---\n\n## Commit Strategy\uFF08\u63D0\u4EA4\u7B56\u7565\uFF09\n\n- **1**: `type(scope): desc` - file.ts, npm test\n\n---\n\n## Success Criteria\uFF08\u6210\u529F\u6807\u51C6\uFF09\n\n### Verification Commands\uFF08\u9A8C\u8BC1\u547D\u4EE4\uFF09\n```bash\ncommand # Expected: output\n```\n\n### Final Checklist\uFF08\u6700\u7EC8\u68C0\u67E5\u6E05\u5355\uFF09\n- [ ] All \"Must Have\" present\n- [ ] All \"Must NOT Have\" absent\n- [ ] All tests pass\n```\n\n---\n";
|
|
7
|
+
export declare const PROMETHEUS_PLAN_TEMPLATE = "## Plan Structure\n\nGenerate plan to: `.sisyphus/plans/{name}.md`\n\n```markdown\n# {Plan Title}\n\n## TL;DR\n\n> **Quick Summary**: [1-2 sentences capturing the core objective and approach]\n> \n> **Deliverables**: [Bullet list of concrete outputs]\n> - [Output 1]\n> - [Output 2]\n> \n> **Estimated Effort**: [Quick | Short | Medium | Large | XL]\n> **Parallel Execution**: [YES - N waves | NO - sequential]\n> **Critical Path**: [Task X \u2192 Task Y \u2192 Task Z]\n\n---\n\n## Context\n\n### Original Request\n[User's initial description]\n\n### Interview Summary\n**Key Discussions**:\n- [Point 1]: [User's decision/preference]\n- [Point 2]: [Agreed approach]\n\n**Research Findings**:\n- [Finding 1]: [Implication]\n- [Finding 2]: [Recommendation]\n\n### Metis Review\n**Identified Gaps** (addressed):\n- [Gap 1]: [How resolved]\n- [Gap 2]: [How resolved]\n\n---\n\n## Work Objectives\n\n### Core Objective\n[1-2 sentences: what we're achieving]\n\n### Concrete Deliverables\n- [Exact file/endpoint/feature]\n\n### Definition of Done\n- [ ] [Verifiable condition with command]\n\n### Must Have\n- [Non-negotiable requirement]\n\n### Must NOT Have (Guardrails)\n- [Explicit exclusion from Metis review]\n- [AI slop pattern to avoid]\n- [Scope boundary]\n\n---\n\n## Verification Strategy (MANDATORY)\n\n> **ZERO HUMAN INTERVENTION** - ALL verification is agent-executed. No exceptions.\n> Acceptance criteria requiring \"user manually tests/confirms\" are FORBIDDEN.\n\n### Test Decision\n- **Infrastructure exists**: [YES/NO]\n- **Automated tests**: [TDD / Tests-after / None]\n- **Framework**: [bun test / vitest / jest / pytest / none]\n- **If TDD**: Each task follows RED (failing test) \u2192 GREEN (minimal impl) \u2192 REFACTOR\n\n### QA Policy\nEvery task MUST include agent-executed QA scenarios (see TODO template below).\nEvidence saved to `.sisyphus/evidence/task-{N}-{scenario-slug}.{ext}`.\n\n- **Frontend/UI**: Use Playwright (playwright skill) - Navigate, interact, assert DOM, screenshot\n- **TUI/CLI**: Use interactive_bash (tmux) - Run command, send keystrokes, validate output\n- **API/Backend**: Use Bash (curl) - Send requests, assert status + response fields\n- **Library/Module**: Use Bash (bun/node REPL) - Import, call functions, compare output\n\n---\n\n## Execution Strategy\n\n### Parallel Execution Waves\n\n> Maximize throughput by grouping independent tasks into parallel waves.\n> Each wave completes before the next begins.\n> Target: 5-8 tasks per wave. Fewer than 3 per wave (except final) = under-splitting.\n\n```\nWave 1 (Start Immediately - foundation + scaffolding):\n\u251C\u2500\u2500 Task 1: Project scaffolding + config [quick]\n\u251C\u2500\u2500 Task 2: Design system tokens [quick]\n\u251C\u2500\u2500 Task 3: Type definitions [quick]\n\u251C\u2500\u2500 Task 4: Schema definitions [quick]\n\u251C\u2500\u2500 Task 5: Storage interface + in-memory impl [quick]\n\u251C\u2500\u2500 Task 6: Auth middleware [quick]\n\u2514\u2500\u2500 Task 7: Client module [quick]\n\nWave 2 (After Wave 1 - core modules, MAX PARALLEL):\n\u251C\u2500\u2500 Task 8: Core business logic (depends: 3, 5, 7) [deep]\n\u251C\u2500\u2500 Task 9: API endpoints (depends: 4, 5) [unspecified-high]\n\u251C\u2500\u2500 Task 10: Secondary storage impl (depends: 5) [unspecified-high]\n\u251C\u2500\u2500 Task 11: Retry/fallback logic (depends: 8) [deep]\n\u251C\u2500\u2500 Task 12: UI layout + navigation (depends: 2) [visual-engineering]\n\u251C\u2500\u2500 Task 13: API client + hooks (depends: 4) [quick]\n\u2514\u2500\u2500 Task 14: Telemetry middleware (depends: 5, 10) [unspecified-high]\n\nWave 3 (After Wave 2 - integration + UI):\n\u251C\u2500\u2500 Task 15: Main route combining modules (depends: 6, 11, 14) [deep]\n\u251C\u2500\u2500 Task 16: UI data visualization (depends: 12, 13) [visual-engineering]\n\u251C\u2500\u2500 Task 17: Deployment config A (depends: 15) [quick]\n\u251C\u2500\u2500 Task 18: Deployment config B (depends: 15) [quick]\n\u251C\u2500\u2500 Task 19: Deployment config C (depends: 15) [quick]\n\u2514\u2500\u2500 Task 20: UI request log + build (depends: 16) [visual-engineering]\n\nWave FINAL (After ALL tasks \u2014 4 parallel reviews, then user okay):\n\u251C\u2500\u2500 Task F1: Plan compliance audit (oracle)\n\u251C\u2500\u2500 Task F2: Code quality review (unspecified-high)\n\u251C\u2500\u2500 Task F3: Real manual QA (unspecified-high)\n\u2514\u2500\u2500 Task F4: Scope fidelity check (deep)\n-> Present results -> Get explicit user okay\n\nCritical Path: Task 1 \u2192 Task 5 \u2192 Task 8 \u2192 Task 11 \u2192 Task 15 \u2192 Task 21 \u2192 F1-F4 \u2192 user okay\nParallel Speedup: ~70% faster than sequential\nMax Concurrent: 7 (Waves 1 & 2)\n```\n\n### Dependency Matrix (abbreviated - show ALL tasks in your generated plan)\n\n- **1-7**: - - 8-14, 1\n- **8**: 3, 5, 7 - 11, 15, 2\n- **11**: 8 - 15, 2\n- **14**: 5, 10 - 15, 2\n- **15**: 6, 11, 14 - 17-19, 21, 3\n- **21**: 15 - 23, 24, 4\n\n> This is abbreviated for reference. YOUR generated plan must include the FULL matrix for ALL tasks.\n\n### Agent Dispatch Summary\n\n- **1**: **7** - T1-T4 \u2192 `quick`, T5 \u2192 `quick`, T6 \u2192 `quick`, T7 \u2192 `quick`\n- **2**: **7** - T8 \u2192 `deep`, T9 \u2192 `unspecified-high`, T10 \u2192 `unspecified-high`, T11 \u2192 `deep`, T12 \u2192 `visual-engineering`, T13 \u2192 `quick`, T14 \u2192 `unspecified-high`\n- **3**: **6** - T15 \u2192 `deep`, T16 \u2192 `visual-engineering`, T17-T19 \u2192 `quick`, T20 \u2192 `visual-engineering`\n- **4**: **4** - T21 \u2192 `deep`, T22 \u2192 `unspecified-high`, T23 \u2192 `deep`, T24 \u2192 `git`\n- **FINAL**: **4** - F1 \u2192 `oracle`, F2 \u2192 `unspecified-high`, F3 \u2192 `unspecified-high`, F4 \u2192 `deep`\n\n---\n\n## TODOs\n\n> Implementation + Test = ONE Task. Never separate.\n> EVERY task MUST have: Recommended Agent Profile + Parallelization info + QA Scenarios.\n> **A task WITHOUT QA Scenarios is INCOMPLETE. No exceptions.**\n\n- [ ] 1. [Task Title]\n\n **What to do**:\n - [Clear implementation steps]\n - [Test cases to cover]\n\n **Must NOT do**:\n - [Specific exclusions from guardrails]\n\n **Recommended Agent Profile**:\n > Select category + skills based on task domain. Justify each choice.\n - **Category**: `[visual-engineering | ultrabrain | artistry | quick | unspecified-low | unspecified-high | writing]`\n - Reason: [Why this category fits the task domain]\n - **Skills**: [`skill-1`, `skill-2`]\n - `skill-1`: [Why needed - domain overlap explanation]\n - `skill-2`: [Why needed - domain overlap explanation]\n - **Skills Evaluated but Omitted**:\n - `omitted-skill`: [Why domain doesn't overlap]\n\n **Parallelization**:\n - **Can Run In Parallel**: YES | NO\n - **Parallel Group**: Wave N (with Tasks X, Y) | Sequential\n - **Blocks**: [Tasks that depend on this task completing]\n - **Blocked By**: [Tasks this depends on] | None (can start immediately)\n\n **References** (CRITICAL - Be Exhaustive):\n\n > The executor has NO context from your interview. References are their ONLY guide.\n > Each reference must answer: \"What should I look at and WHY?\"\n\n **Pattern References** (existing code to follow):\n - `src/services/auth.ts:45-78` - Authentication flow pattern (JWT creation, refresh token handling)\n\n **API/Type References** (contracts to implement against):\n - `src/types/user.ts:UserDTO` - Response shape for user endpoints\n\n **Test References** (testing patterns to follow):\n - `src/__tests__/auth.test.ts:describe(\"login\")` - Test structure and mocking patterns\n\n **External References** (libraries and frameworks):\n - Official docs: `https://zod.dev/?id=basic-usage` - Zod validation syntax\n\n **WHY Each Reference Matters** (explain the relevance):\n - Don't just list files - explain what pattern/information the executor should extract\n - Bad: `src/utils.ts` (vague, which utils? why?)\n - Good: `src/utils/validation.ts:sanitizeInput()` - Use this sanitization pattern for user input\n\n **Acceptance Criteria**:\n\n > **AGENT-EXECUTABLE VERIFICATION ONLY** - No human action permitted.\n > Every criterion MUST be verifiable by running a command or using a tool.\n\n **If TDD (tests enabled):**\n - [ ] Test file created: src/auth/login.test.ts\n - [ ] bun test src/auth/login.test.ts \u2192 PASS (3 tests, 0 failures)\n\n **QA Scenarios (MANDATORY - task is INCOMPLETE without these):**\n\n > **This is NOT optional. A task without QA scenarios WILL BE REJECTED.**\n >\n > Write scenario tests that verify the ACTUAL BEHAVIOR of what you built.\n > Minimum: 1 happy path + 1 failure/edge case per task.\n > Each scenario = exact tool + exact steps + exact assertions + evidence path.\n >\n > **The executing agent MUST run these scenarios after implementation.**\n > **The orchestrator WILL verify evidence files exist before marking task complete.**\n\n \\`\\`\\`\n Scenario: [Happy path - what SHOULD work]\n Tool: [Playwright / interactive_bash / Bash (curl)]\n Preconditions: [Exact setup state]\n Steps:\n 1. [Exact action - specific command/selector/endpoint, no vagueness]\n 2. [Next action - with expected intermediate state]\n 3. [Assertion - exact expected value, not \"verify it works\"]\n Expected Result: [Concrete, observable, binary pass/fail]\n Failure Indicators: [What specifically would mean this failed]\n Evidence: .sisyphus/evidence/task-{N}-{scenario-slug}.{ext}\n\n Scenario: [Failure/edge case - what SHOULD fail gracefully]\n Tool: [same format]\n Preconditions: [Invalid input / missing dependency / error state]\n Steps:\n 1. [Trigger the error condition]\n 2. [Assert error is handled correctly]\n Expected Result: [Graceful failure with correct error message/code]\n Evidence: .sisyphus/evidence/task-{N}-{scenario-slug}-error.{ext}\n \\`\\`\\`\n\n > **Specificity requirements - every scenario MUST use:**\n > - **Selectors**: Specific CSS selectors (`.login-button`, not \"the login button\")\n > - **Data**: Concrete test data (`\"test@example.com\"`, not `\"[email]\"`)\n > - **Assertions**: Exact values (`text contains \"Welcome back\"`, not \"verify it works\")\n > - **Timing**: Wait conditions where relevant (`timeout: 10s`)\n > - **Negative**: At least ONE failure/error scenario per task\n >\n > **Anti-patterns (your scenario is INVALID if it looks like this):**\n > - \u274C \"Verify it works correctly\" - HOW? What does \"correctly\" mean?\n > - \u274C \"Check the API returns data\" - WHAT data? What fields? What values?\n > - \u274C \"Test the component renders\" - WHERE? What selector? What content?\n > - \u274C Any scenario without an evidence path\n\n **Evidence to Capture:**\n - [ ] Each evidence file named: task-{N}-{scenario-slug}.{ext}\n - [ ] Screenshots for UI, terminal output for CLI, response bodies for API\n\n **Commit**: YES | NO (groups with N)\n - Message: `type(scope): desc`\n - Files: `path/to/file`\n - Pre-commit: `test command`\n\n---\n\n## Final Verification Wave (MANDATORY \u2014 after ALL implementation tasks)\n\n> 4 review agents run in PARALLEL. ALL must APPROVE. Present consolidated results to user and get explicit \"okay\" before completing.\n>\n> **Do NOT auto-proceed after verification. Wait for user's explicit approval before marking work complete.**\n> **Never mark F1-F4 as checked before getting user's okay.** Rejection or user feedback -> fix -> re-run -> present again -> wait for okay.\n\n- [ ] F1. **Plan Compliance Audit** \u2014 `oracle`\n Read the plan end-to-end. For each \"Must Have\": verify implementation exists (read file, curl endpoint, run command). For each \"Must NOT Have\": search codebase for forbidden patterns \u2014 reject with file:line if found. Check evidence files exist in .sisyphus/evidence/. Compare deliverables against plan.\n Output: `Must Have [N/N] | Must NOT Have [N/N] | Tasks [N/N] | VERDICT: APPROVE/REJECT`\n\n- [ ] F2. **Code Quality Review** \u2014 `unspecified-high`\n Run `tsc --noEmit` + linter + `bun test`. Review all changed files for: `as any`/`@ts-ignore`, empty catches, console.log in prod, commented-out code, unused imports. Check AI slop: excessive comments, over-abstraction, generic names (data/result/item/temp).\n Output: `Build [PASS/FAIL] | Lint [PASS/FAIL] | Tests [N pass/N fail] | Files [N clean/N issues] | VERDICT`\n\n- [ ] F3. **Real Manual QA** \u2014 `unspecified-high` (+ `playwright` skill if UI)\n Start from clean state. Execute EVERY QA scenario from EVERY task \u2014 follow exact steps, capture evidence. Test cross-task integration (features working together, not isolation). Test edge cases: empty state, invalid input, rapid actions. Save to `.sisyphus/evidence/final-qa/`.\n Output: `Scenarios [N/N pass] | Integration [N/N] | Edge Cases [N tested] | VERDICT`\n\n- [ ] F4. **Scope Fidelity Check** \u2014 `deep`\n For each task: read \"What to do\", read actual diff (git log/diff). Verify 1:1 \u2014 everything in spec was built (no missing), nothing beyond spec was built (no creep). Check \"Must NOT do\" compliance. Detect cross-task contamination: Task N touching Task M's files. Flag unaccounted changes.\n Output: `Tasks [N/N compliant] | Contamination [CLEAN/N issues] | Unaccounted [CLEAN/N files] | VERDICT`\n\n---\n\n## Commit Strategy\n\n- **1**: `type(scope): desc` - file.ts, npm test\n\n---\n\n## Success Criteria\n\n### Verification Commands\n```bash\ncommand # Expected: output\n```\n\n### Final Checklist\n- [ ] All \"Must Have\" present\n- [ ] All \"Must NOT Have\" absent\n- [ ] All tests pass\n```\n\n---\n";
|
package/dist/cli/index.js
CHANGED
|
@@ -53770,7 +53770,7 @@ var {
|
|
|
53770
53770
|
// package.json
|
|
53771
53771
|
var package_default = {
|
|
53772
53772
|
name: "@skj1724/oh-my-opencode",
|
|
53773
|
-
version: "3.
|
|
53773
|
+
version: "3.18.1",
|
|
53774
53774
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
53775
53775
|
main: "./dist/index.js",
|
|
53776
53776
|
types: "dist/index.d.ts",
|
|
@@ -53839,7 +53839,7 @@ var package_default = {
|
|
|
53839
53839
|
"jsonc-parser": "^3.3.1",
|
|
53840
53840
|
picocolors: "^1.1.1",
|
|
53841
53841
|
picomatch: "^4.0.2",
|
|
53842
|
-
"posthog-node": "
|
|
53842
|
+
"posthog-node": "5.28.11",
|
|
53843
53843
|
"vscode-jsonrpc": "^8.2.0"
|
|
53844
53844
|
},
|
|
53845
53845
|
devDependencies: {
|
|
@@ -54417,7 +54417,6 @@ var types_PostHogPersistedProperty = /* @__PURE__ */ function(PostHogPersistedPr
|
|
|
54417
54417
|
PostHogPersistedProperty["Surveys"] = "surveys";
|
|
54418
54418
|
PostHogPersistedProperty["RemoteConfig"] = "remote_config";
|
|
54419
54419
|
PostHogPersistedProperty["FlagsEndpointWasHit"] = "flags_endpoint_was_hit";
|
|
54420
|
-
PostHogPersistedProperty["DeviceId"] = "device_id";
|
|
54421
54420
|
return PostHogPersistedProperty;
|
|
54422
54421
|
}({});
|
|
54423
54422
|
|
|
@@ -55255,8 +55254,6 @@ class PostHogCoreStateless {
|
|
|
55255
55254
|
group_properties: groupProperties,
|
|
55256
55255
|
...extraPayload
|
|
55257
55256
|
};
|
|
55258
|
-
if (personProperties.$device_id)
|
|
55259
|
-
requestData.$device_id = personProperties.$device_id;
|
|
55260
55257
|
if (this.evaluationContexts && this.evaluationContexts.length > 0)
|
|
55261
55258
|
requestData.evaluation_contexts = this.evaluationContexts;
|
|
55262
55259
|
const fetchOptions = {
|
|
@@ -56708,7 +56705,7 @@ class ErrorTracking {
|
|
|
56708
56705
|
}
|
|
56709
56706
|
|
|
56710
56707
|
// node_modules/posthog-node/dist/version.mjs
|
|
56711
|
-
var version = "5.
|
|
56708
|
+
var version = "5.28.11";
|
|
56712
56709
|
|
|
56713
56710
|
// node_modules/posthog-node/dist/types.mjs
|
|
56714
56711
|
var FeatureFlagError2 = {
|
|
@@ -74370,6 +74367,11 @@ var WebsearchConfigSchema = exports_external.object({
|
|
|
74370
74367
|
provider: WebsearchProviderSchema.optional()
|
|
74371
74368
|
});
|
|
74372
74369
|
|
|
74370
|
+
// src/config/schema/i18n.ts
|
|
74371
|
+
var I18nConfigSchema = exports_external.object({
|
|
74372
|
+
language: exports_external.string().min(1).optional()
|
|
74373
|
+
});
|
|
74374
|
+
|
|
74373
74375
|
// src/config/schema/oh-my-opencode-config.ts
|
|
74374
74376
|
var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
74375
74377
|
$schema: exports_external.string().optional(),
|
|
@@ -74410,6 +74412,7 @@ var OhMyOpenCodeConfigSchema = exports_external.object({
|
|
|
74410
74412
|
tmux: TmuxConfigSchema.optional(),
|
|
74411
74413
|
sisyphus: SisyphusConfigSchema.optional(),
|
|
74412
74414
|
start_work: StartWorkConfigSchema.optional(),
|
|
74415
|
+
i18n: I18nConfigSchema.optional(),
|
|
74413
74416
|
_migrations: exports_external.array(exports_external.string()).optional()
|
|
74414
74417
|
});
|
|
74415
74418
|
// src/plugin-config.ts
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Internationalization configuration for agent interaction language.
|
|
4
|
+
*
|
|
5
|
+
* Controls the language used for agent prompts and thinking output guidance.
|
|
6
|
+
* When set, agents will be instructed to respond in the specified language.
|
|
7
|
+
*
|
|
8
|
+
* Supported values: IETF BCP 47 format (e.g., "zh-CN", "en-US", "ja-JP", "ko-KR")
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // In ~/.config/opencode/oh-my-opencode.jsonc
|
|
12
|
+
* {
|
|
13
|
+
* "i18n": {
|
|
14
|
+
* "language": "zh-CN"
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
export declare const I18nConfigSchema: z.ZodObject<{
|
|
19
|
+
language: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type I18nConfig = z.infer<typeof I18nConfigSchema>;
|
|
@@ -2106,6 +2106,9 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
|
|
|
2106
2106
|
start_work: z.ZodOptional<z.ZodObject<{
|
|
2107
2107
|
auto_commit: z.ZodDefault<z.ZodBoolean>;
|
|
2108
2108
|
}, z.core.$strip>>;
|
|
2109
|
+
i18n: z.ZodOptional<z.ZodObject<{
|
|
2110
|
+
language: z.ZodOptional<z.ZodString>;
|
|
2111
|
+
}, z.core.$strip>>;
|
|
2109
2112
|
_migrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2110
2113
|
}, z.core.$strip>;
|
|
2111
2114
|
export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HANDOFF_TEMPLATE = "# Handoff \
|
|
1
|
+
export declare const HANDOFF_TEMPLATE = "# Handoff Command\n\n## Purpose\n\nUse /handoff when:\n- The current session context is getting too long and quality is degrading\n- You want to start fresh while preserving essential context from this session\n- The context window is approaching capacity\n\nThis creates a detailed context summary that can be used to continue work in a new session.\n\n---\n\n# PHASE 0: VALIDATE REQUEST\n\nBefore proceeding, confirm:\n- [ ] There is meaningful work or context in this session to preserve\n- [ ] The user wants to create a handoff summary (not just asking about it)\n\nIf the session is nearly empty or has no meaningful context, inform the user there is nothing substantial to hand off.\n\n---\n\n# PHASE 1: GATHER PROGRAMMATIC CONTEXT\n\nExecute these tools to gather concrete data:\n\n1. session_read({ session_id: \"$SESSION_ID\" }) - full session history\n2. todoread() - current task progress\n3. Bash({ command: \"git diff --stat HEAD~10..HEAD\" }) - recent file changes\n4. Bash({ command: \"git status --porcelain\" }) - uncommitted changes\n\nSuggested execution order:\n\n```\nsession_read({ session_id: \"$SESSION_ID\" })\ntodoread()\nBash({ command: \"git diff --stat HEAD~10..HEAD\" })\nBash({ command: \"git status --porcelain\" })\n```\n\nAnalyze the gathered outputs to understand:\n- What the user asked for (exact wording)\n- What work was completed\n- What tasks remain incomplete (include todo state)\n- What decisions were made\n- What files were modified or discussed (include git diff/stat + status)\n- What patterns, constraints, or preferences were established\n\n---\n\n# PHASE 2: EXTRACT CONTEXT\n\nWrite the context summary from first person perspective (\"I did...\", \"I told you...\").\n\nFocus on:\n- Capabilities and behavior, not file-by-file implementation details\n- What matters for continuing the work\n- Avoiding excessive implementation details (variable names, storage keys, constants) unless critical\n- USER REQUESTS (AS-IS) must be verbatim (do not paraphrase)\n- EXPLICIT CONSTRAINTS must be verbatim only (do not invent)\n\nQuestions to consider when extracting:\n- What did I just do or implement?\n- What instructions did I already give which are still relevant (e.g. follow patterns in the codebase)?\n- What files did I tell you are important or that I am working on?\n- Did I provide a plan or spec that should be included?\n- What did I already tell you that is important (libraries, patterns, constraints, preferences)?\n- What important technical details did I discover (APIs, methods, patterns)?\n- What caveats, limitations, or open questions did I find?\n\n---\n\n# PHASE 3: FORMAT OUTPUT\n\nGenerate a handoff summary using this exact format:\n\n```\nHANDOFF CONTEXT\n===============\n\nUSER REQUESTS (AS-IS)\n---------------------\n- [Exact verbatim user requests - NOT paraphrased]\n\nGOAL\n----\n[One sentence describing what should be done next]\n\nWORK COMPLETED\n--------------\n- [First person bullet points of what was done]\n- [Include specific file paths when relevant]\n- [Note key implementation decisions]\n\nCURRENT STATE\n-------------\n- [Current state of the codebase or task]\n- [Build/test status if applicable]\n- [Any environment or configuration state]\n\nPENDING TASKS\n-------------\n- [Tasks that were planned but not completed]\n- [Next logical steps to take]\n- [Any blockers or issues encountered]\n- [Include current todo state from todoread()]\n\nKEY FILES\n---------\n- [path/to/file1] - [brief role description]\n- [path/to/file2] - [brief role description]\n(Maximum 10 files, prioritized by importance)\n- (Include files from git diff/stat and git status)\n\nIMPORTANT DECISIONS\n-------------------\n- [Technical decisions that were made and why]\n- [Trade-offs that were considered]\n- [Patterns or conventions established]\n\nEXPLICIT CONSTRAINTS\n--------------------\n- [Verbatim constraints only - from user or existing AGENTS.md]\n- If none, write: None\n\nCONTEXT FOR CONTINUATION\n------------------------\n- [What the next session needs to know to continue]\n- [Warnings or gotchas to be aware of]\n- [References to documentation if relevant]\n```\n\nRules for the summary:\n- Plain text with bullets\n- No markdown headers with # (use the format above with dashes)\n- No bold, italic, or code fences within content\n- Use workspace-relative paths for files\n- Keep it focused - only include what matters for continuation\n- Pick an appropriate length based on complexity\n- USER REQUESTS (AS-IS) and EXPLICIT CONSTRAINTS must be verbatim only\n\n---\n\n# PHASE 4: PROVIDE INSTRUCTIONS\n\nAfter generating the summary, instruct the user:\n\n```\n---\n\nTO CONTINUE IN A NEW SESSION:\n\n1. Press 'n' in OpenCode TUI to open a new session, or run 'opencode' in a new terminal\n2. Paste the HANDOFF CONTEXT above as your first message\n3. Add your request: \"Continue from the handoff context above. [Your next task]\"\n\nThe new session will have all context needed to continue seamlessly.\n```\n\n---\n\n# IMPORTANT CONSTRAINTS\n\n- DO NOT attempt to programmatically create new sessions (no API available to agents)\n- DO provide a self-contained summary that works without access to this session\n- DO include workspace-relative file paths\n- DO NOT include sensitive information (API keys, credentials, secrets)\n- DO NOT exceed 10 files in the KEY FILES section\n- DO keep the GOAL section to a single sentence or short paragraph\n\n---\n\n# EXECUTE NOW\n\nBegin by gathering programmatic context, then synthesize the handoff summary.\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const INIT_DEEP_TEMPLATE = "# /init-deep\n\n\u751F\u6210\u5C42\u7EA7\u5316\u7684 AGENTS.md \u6587\u4EF6\u3002\u6839\u76EE\u5F55 + \u6309\u590D\u6742\u5EA6\u8BC4\u5206\u7684\u5B50\u76EE\u5F55\u3002\n\n## \u4F7F\u7528\u65B9\u5F0F\n\n```\n/init-deep # \u66F4\u65B0\u6A21\u5F0F\uFF1A\u4FEE\u6539\u73B0\u6709\u6587\u4EF6 + \u5728\u9700\u8981\u65F6\u521B\u5EFA\u65B0\u6587\u4EF6\n/init-deep --create-new # \u8BFB\u53D6\u73B0\u6709\u6587\u4EF6 \u2192 \u5220\u9664\u5168\u90E8 \u2192 \u4ECE\u5934\u91CD\u65B0\u751F\u6210\n/init-deep --max-depth=2 # \u9650\u5236\u76EE\u5F55\u6DF1\u5EA6\uFF08\u9ED8\u8BA4\uFF1A3\uFF09\n```\n\n---\n\n## \u5DE5\u4F5C\u6D41\u7A0B\uFF08\u6982\u89C8\uFF09\n\n1. **\u53D1\u73B0 + \u5206\u6790**\uFF08\u5E76\u53D1\uFF09\n - \u7ACB\u5373\u542F\u52A8\u540E\u53F0 explore agents\n - \u4E3B\u4F1A\u8BDD\uFF1Abash \u76EE\u5F55\u7ED3\u6784 + LSP codemap + \u8BFB\u53D6\u73B0\u6709 AGENTS.md\n2. **\u8BC4\u5206 & \u51B3\u7B56** - \u6839\u636E\u5408\u5E76\u7ED3\u679C\u786E\u5B9A AGENTS.md \u7684\u653E\u7F6E\u4F4D\u7F6E\n3. **\u751F\u6210** - \u5148\u751F\u6210\u6839\u76EE\u5F55\uFF0C\u7136\u540E\u5E76\u884C\u751F\u6210\u5B50\u76EE\u5F55\n4. **\u5BA1\u67E5** - \u53BB\u91CD\u3001\u88C1\u526A\u3001\u9A8C\u8BC1\n\n<critical>\n**\u4E3A\u6240\u6709\u9636\u6BB5\u521B\u5EFA TodoWrite\u3002\u5B9E\u65F6\u6807\u8BB0 in_progress \u2192 completed\u3002**\n```\nTodoWrite([\n { id: \"discovery\", content: \"\u542F\u52A8 explore agents + LSP codemap + \u8BFB\u53D6\u73B0\u6709\u6587\u4EF6\", status: \"pending\", priority: \"high\" },\n { id: \"scoring\", content: \"\u4E3A\u76EE\u5F55\u8BC4\u5206\uFF0C\u786E\u5B9A\u653E\u7F6E\u4F4D\u7F6E\", status: \"pending\", priority: \"high\" },\n { id: \"generate\", content: \"\u751F\u6210 AGENTS.md \u6587\u4EF6\uFF08\u6839\u76EE\u5F55 + \u5B50\u76EE\u5F55\uFF09\", status: \"pending\", priority: \"high\" },\n { id: \"review\", content: \"\u53BB\u91CD\u3001\u9A8C\u8BC1\u3001\u88C1\u526A\", status: \"pending\", priority: \"medium\" }\n])\n```\n</critical>\n\n---\n\n## \u9636\u6BB5 1\uFF1A\u53D1\u73B0 + \u5206\u6790\uFF08\u5E76\u53D1\uFF09\n\n**\u5C06 \"discovery\" \u6807\u8BB0\u4E3A in_progress\u3002**\n\n### \u7ACB\u5373\u542F\u52A8\u540E\u53F0 Explore Agents\n\n\u4E0D\u8981\u7B49\u5F85\u2014\u2014\u8FD9\u4E9B agent \u5F02\u6B65\u8FD0\u884C\uFF0C\u4E0E\u4E3B\u4F1A\u8BDD\u540C\u65F6\u5DE5\u4F5C\u3002\n\n```\n// \u4E00\u6B21\u6027\u542F\u52A8\u5168\u90E8\uFF0C\u7A0D\u540E\u6536\u96C6\u7ED3\u679C\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore project structure\", run_in_background=true, prompt=\"Project structure: PREDICT standard patterns for detected language \u2192 REPORT deviations only\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find entry points\", run_in_background=true, prompt=\"Entry points: FIND main files \u2192 REPORT non-standard organization\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find conventions\", run_in_background=true, prompt=\"Conventions: FIND config files (.eslintrc, pyproject.toml, .editorconfig) \u2192 REPORT project-specific rules\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find anti-patterns\", run_in_background=true, prompt=\"Anti-patterns: FIND 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED' comments \u2192 LIST forbidden patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore build/CI\", run_in_background=true, prompt=\"Build/CI: FIND .github/workflows, Makefile \u2192 REPORT non-standard patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find test patterns\", run_in_background=true, prompt=\"Test patterns: FIND test configs, test structure \u2192 REPORT unique conventions\")\n```\n\n<dynamic-agents>\n**\u52A8\u6001 Agent \u751F\u6210**\uFF1A\u5728 bash \u5206\u6790\u540E\uFF0C\u6839\u636E\u9879\u76EE\u89C4\u6A21\u751F\u6210\u989D\u5916\u7684 explore agents\uFF1A\n\n| \u56E0\u7D20 | \u9608\u503C | \u989D\u5916 Agents |\n|--------|-----------|-------------------|\n| **\u6587\u4EF6\u603B\u6570** | >100 | \u6BCF 100 \u4E2A\u6587\u4EF6 +1 |\n| **\u4EE3\u7801\u603B\u884C\u6570** | >10k | \u6BCF 10k \u884C +1 |\n| **\u76EE\u5F55\u6DF1\u5EA6** | \u22654 | \u6DF1\u5EA6\u63A2\u7D22 +2 |\n| **\u5927\u6587\u4EF6\uFF08>500 \u884C\uFF09** | >10 \u4E2A | \u590D\u6742\u5EA6\u70ED\u70B9 +1 |\n| **Monorepo** | \u68C0\u6D4B\u5230 | \u6BCF\u4E2A package/workspace +1 |\n| **\u591A\u8BED\u8A00** | >1 | \u6BCF\u79CD\u8BED\u8A00 +1 |\n\n```bash\n# \u5148\u6D4B\u91CF\u9879\u76EE\u89C4\u6A21\ntotal_files=$(find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | wc -l)\ntotal_lines=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" -o -name \"*.go\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | tail -1 | awk '{print $1}')\nlarge_files=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | awk '$1 > 500 {count++} END {print count+0}')\nmax_depth=$(find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' | awk -F/ '{print NF}' | sort -rn | head -1)\n```\n\n\u751F\u6210\u793A\u4F8B\uFF1A\n```\n// 500 \u4E2A\u6587\u4EF6\uFF0C50k \u884C\uFF0C\u6DF1\u5EA6 6\uFF0C15 \u4E2A\u5927\u6587\u4EF6 \u2192 \u542F\u52A8 5+5+2+1 = 13 \u4E2A\u989D\u5916 agents\ntask(subagent_type=\"explore\", load_skills=[], description=\"Analyze large files\", run_in_background=true, prompt=\"Large file analysis: FIND files >500 lines, REPORT complexity hotspots\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore deep modules\", run_in_background=true, prompt=\"Deep modules at depth 4+: FIND hidden patterns, internal conventions\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find shared utilities\", run_in_background=true, prompt=\"Cross-cutting concerns: FIND shared utilities across directories\")\n// ... \u6839\u636E\u8BA1\u7B97\u7ED3\u679C\u751F\u6210\u66F4\u591A\n```\n</dynamic-agents>\n\n### \u4E3B\u4F1A\u8BDD\uFF1A\u5E76\u53D1\u5206\u6790\n\n**\u5728\u540E\u53F0 agents \u8FD0\u884C\u65F6**\uFF0C\u4E3B\u4F1A\u8BDD\u6267\u884C\uFF1A\n\n#### 1. Bash \u76EE\u5F55\u7ED3\u6784\u5206\u6790\n```bash\n# \u76EE\u5F55\u6DF1\u5EA6 + \u6587\u4EF6\u6570\u91CF\nfind . -type d -not -path '*/\\.*' -not -path '*/node_modules/*' -not -path '*/venv/*' -not -path '*/dist/*' -not -path '*/build/*' | awk -F/ '{print NF-1}' | sort -n | uniq -c\n\n# \u6BCF\u4E2A\u76EE\u5F55\u7684\u6587\u4EF6\u6570\uFF08\u524D 30 \u4E2A\uFF09\nfind . -type f -not -path '*/\\.*' -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -30\n\n# \u6309\u6269\u5C55\u540D\u7684\u4EE3\u7801\u96C6\u4E2D\u5EA6\nfind . -type f \\( -name \"*.py\" -o -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.js\" -o -name \"*.go\" -o -name \"*.rs\" \\) -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20\n\n# \u73B0\u6709 AGENTS.md / CLAUDE.md\nfind . -type f \\( -name \"AGENTS.md\" -o -name \"CLAUDE.md\" \\) -not -path '*/node_modules/*' 2>/dev/null\n```\n\n#### 2. \u8BFB\u53D6\u73B0\u6709 AGENTS.md\n```\n\u5BF9\u6BCF\u4E2A\u627E\u5230\u7684\u73B0\u6709\u6587\u4EF6\uFF1A\n Read(filePath=file)\n \u63D0\u53D6\uFF1A\u5173\u952E\u6D1E\u5BDF\u3001\u7EA6\u5B9A\u3001\u53CD\u6A21\u5F0F\n \u5B58\u5165 EXISTING_AGENTS map\n```\n\n\u5982\u679C\u6307\u5B9A\u4E86 `--create-new`\uFF1A\u5148\u8BFB\u53D6\u6240\u6709\u73B0\u6709\u6587\u4EF6\uFF08\u4FDD\u7559\u4E0A\u4E0B\u6587\uFF09\u2192 \u7136\u540E\u5220\u9664\u5168\u90E8 \u2192 \u91CD\u65B0\u751F\u6210\u3002\n\n#### 3. LSP Codemap\uFF08\u5982\u53EF\u7528\uFF09\n```\nLspServers() # \u68C0\u67E5\u53EF\u7528\u6027\n\n# \u5165\u53E3\u6587\u4EF6\uFF08\u5E76\u884C\uFF09\nLspDocumentSymbols(filePath=\"src/index.ts\")\nLspDocumentSymbols(filePath=\"main.py\")\n\n# \u5173\u952E\u7B26\u53F7\uFF08\u5E76\u884C\uFF09\nLspWorkspaceSymbols(filePath=\".\", query=\"class\")\nLspWorkspaceSymbols(filePath=\".\", query=\"interface\")\nLspWorkspaceSymbols(filePath=\".\", query=\"function\")\n\n# \u9876\u90E8\u5BFC\u51FA\u7684\u4E2D\u5FC3\u6027\nLspFindReferences(filePath=\"...\", line=X, character=Y)\n```\n\n**LSP \u5907\u7528\u65B9\u6848**\uFF1A\u4E0D\u53EF\u7528\u65F6\uFF0C\u4F9D\u8D56 explore agents + AST-grep\u3002\n\n### \u6536\u96C6\u540E\u53F0\u7ED3\u679C\n\n```\n// \u4E3B\u4F1A\u8BDD\u5206\u6790\u5B8C\u6210\u540E\uFF0C\u6536\u96C6\u6240\u6709 task \u7ED3\u679C\nfor each task_id: background_output(task_id=\"...\")\n```\n\n**\u5408\u5E76\uFF1Abash + LSP + \u73B0\u6709 + explore \u7ED3\u679C\u3002\u5C06 \"discovery\" \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n## \u9636\u6BB5 2\uFF1A\u8BC4\u5206 & \u4F4D\u7F6E\u51B3\u7B56\n\n**\u5C06 \"scoring\" \u6807\u8BB0\u4E3A in_progress\u3002**\n\n### \u8BC4\u5206\u77E9\u9635\n\n| \u56E0\u7D20 | \u6743\u91CD | \u9AD8\u9608\u503C | \u6765\u6E90 |\n|--------|--------|----------------|--------|\n| \u6587\u4EF6\u6570\u91CF | 3x | >20 | bash |\n| \u5B50\u76EE\u5F55\u6570\u91CF | 2x | >5 | bash |\n| \u4EE3\u7801\u6BD4\u4F8B | 2x | >70% | bash |\n| \u72EC\u6709\u6A21\u5F0F | 1x | \u6709\u81EA\u5DF1\u7684\u914D\u7F6E | explore |\n| \u6A21\u5757\u8FB9\u754C | 2x | \u6709 index.ts/__init__.py | bash |\n| \u7B26\u53F7\u5BC6\u5EA6 | 2x | >30 \u4E2A\u7B26\u53F7 | LSP |\n| \u5BFC\u51FA\u6570\u91CF | 2x | >10 \u4E2A\u5BFC\u51FA | LSP |\n| \u5F15\u7528\u4E2D\u5FC3\u6027 | 3x | >20 \u4E2A\u5F15\u7528 | LSP |\n\n### \u51B3\u7B56\u89C4\u5219\n\n| \u5206\u6570 | \u64CD\u4F5C |\n|-------|--------|\n| **\u6839\u76EE\u5F55 (.)** | \u59CB\u7EC8\u521B\u5EFA |\n| **>15** | \u521B\u5EFA AGENTS.md |\n| **8-15** | \u5982\u4E3A\u72EC\u7ACB\u9886\u57DF\u5219\u521B\u5EFA |\n| **<8** | \u8DF3\u8FC7\uFF08\u7531\u7236\u7EA7\u8986\u76D6\uFF09 |\n\n### \u8F93\u51FA\n```\nAGENTS_LOCATIONS = [\n { path: \".\", type: \"root\" },\n { path: \"src/hooks\", score: 18, reason: \"high complexity\" },\n { path: \"src/api\", score: 12, reason: \"distinct domain\" }\n]\n```\n\n**\u5C06 \"scoring\" \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n## \u9636\u6BB5 3\uFF1A\u751F\u6210 AGENTS.md\n\n**\u5C06 \"generate\" \u6807\u8BB0\u4E3A in_progress\u3002**\n\n<critical>\n**\u6587\u4EF6\u5199\u5165\u89C4\u5219**\uFF1A\u5982\u679C\u76EE\u6807\u8DEF\u5F84\u5DF2\u5B58\u5728 AGENTS.md \u2192 \u4F7F\u7528 `Edit` \u5DE5\u5177\u3002\u5982\u679C\u4E0D\u5B58\u5728 \u2192 \u4F7F\u7528 `Write` \u5DE5\u5177\u3002\n\u6C38\u8FDC\u4E0D\u8981\u7528 Write \u8986\u76D6\u5DF2\u5B58\u5728\u7684\u6587\u4EF6\u3002\u59CB\u7EC8\u901A\u8FC7 `Read` \u6216\u53D1\u73B0\u7ED3\u679C\u68C0\u67E5\u662F\u5426\u5B58\u5728\u3002\n</critical>\n\n### \u6839\u76EE\u5F55 AGENTS.md\uFF08\u5B8C\u6574\u6A21\u677F\uFF09\n\n```markdown\n# PROJECT KNOWLEDGE BASE\n\n**Generated:** {TIMESTAMP}\n**Commit:** {SHORT_SHA}\n**Branch:** {BRANCH}\n\n## OVERVIEW\n{1-2 sentences: what + core stack}\n\n## STRUCTURE\n\\`\\`\\`\n{root}/\n\u251C\u2500\u2500 {dir}/ # {non-obvious purpose only}\n\u2514\u2500\u2500 {entry}\n\\`\\`\\`\n\n## WHERE TO LOOK\n| Task | Location | Notes |\n|------|----------|-------|\n\n## CODE MAP\n{From LSP - skip if unavailable or project <10 files}\n\n| Symbol | Type | Location | Refs | Role |\n|--------|------|----------|------|------|\n\n## CONVENTIONS\n{ONLY deviations from standard}\n\n## ANTI-PATTERNS (THIS PROJECT)\n{Explicitly forbidden here}\n\n## UNIQUE STYLES\n{Project-specific}\n\n## COMMANDS\n\\`\\`\\`bash\n{dev/test/build}\n\\`\\`\\`\n\n## NOTES\n{Gotchas}\n```\n\n**\u8D28\u91CF\u95E8\u69DB**\uFF1A50-150 \u884C\uFF0C\u65E0\u901A\u7528\u5EFA\u8BAE\uFF0C\u65E0\u663E\u800C\u6613\u89C1\u7684\u4FE1\u606F\u3002\n\n### \u5B50\u76EE\u5F55 AGENTS.md\uFF08\u5E76\u884C\uFF09\n\n\u4E3A\u6BCF\u4E2A\u4F4D\u7F6E\u542F\u52A8\u5199\u5165\u4EFB\u52A1\uFF1A\n\n```\nfor loc in AGENTS_LOCATIONS (except root):\n task(category=\"writing\", load_skills=[], run_in_background=false, description=\"Generate AGENTS.md\", prompt=\\`\n Generate AGENTS.md for: ${loc.path}\n - Reason: ${loc.reason}\n - 30-80 lines max\n - NEVER repeat parent content\n - Sections: OVERVIEW (1 line), STRUCTURE (if >5 subdirs), WHERE TO LOOK, CONVENTIONS (if different), ANTI-PATTERNS\n \\`)\n```\n\n**\u7B49\u5F85\u5168\u90E8\u5B8C\u6210\u3002\u5C06 \"generate\" \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n## \u9636\u6BB5 4\uFF1A\u5BA1\u67E5 & \u53BB\u91CD\n\n**\u5C06 \"review\" \u6807\u8BB0\u4E3A in_progress\u3002**\n\n\u5BF9\u6BCF\u4E2A\u751F\u6210\u7684\u6587\u4EF6\uFF1A\n- \u79FB\u9664\u901A\u7528\u5EFA\u8BAE\n- \u79FB\u9664\u4E0E\u7236\u7EA7\u91CD\u590D\u7684\u5185\u5BB9\n- \u88C1\u526A\u81F3\u5927\u5C0F\u9650\u5236\u5185\n- \u9A8C\u8BC1\u7535\u62A5\u5F0F\u98CE\u683C\n\n**\u5C06 \"review\" \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n## \u6700\u7EC8\u62A5\u544A\n\n```\n=== init-deep \u5B8C\u6210 ===\n\n\u6A21\u5F0F\uFF1A{update | create-new}\n\n\u6587\u4EF6\uFF1A\n [OK] ./AGENTS.md (\u6839\u76EE\u5F55, {N} \u884C)\n [OK] ./src/hooks/AGENTS.md ({N} \u884C)\n\n\u5206\u6790\u76EE\u5F55\u6570\uFF1A{N}\n\u521B\u5EFA AGENTS.md\uFF1A{N}\n\u66F4\u65B0 AGENTS.md\uFF1A{N}\n\n\u5C42\u7EA7\u7ED3\u6784\uFF1A\n ./AGENTS.md\n \u2514\u2500\u2500 src/hooks/AGENTS.md\n```\n\n---\n\n## \u53CD\u6A21\u5F0F\n\n- **\u9759\u6001 agent \u6570\u91CF**\uFF1A\u5FC5\u987B\u6839\u636E\u9879\u76EE\u89C4\u6A21/\u6DF1\u5EA6\u8C03\u6574 agents \u6570\u91CF\n- **\u987A\u5E8F\u6267\u884C**\uFF1A\u5FC5\u987B\u5E76\u884C\uFF08explore + LSP \u5E76\u53D1\uFF09\n- **\u5FFD\u7565\u73B0\u6709\u6587\u4EF6**\uFF1A\u59CB\u7EC8\u5148\u8BFB\u53D6\u73B0\u6709\u6587\u4EF6\uFF0C\u5373\u4F7F\u4F7F\u7528 --create-new\n- **\u8FC7\u5EA6\u6587\u6863\u5316**\uFF1A\u4E0D\u662F\u6BCF\u4E2A\u76EE\u5F55\u90FD\u9700\u8981 AGENTS.md\n- **\u5197\u4F59**\uFF1A\u5B50\u7EA7\u7EDD\u4E0D\u91CD\u590D\u7236\u7EA7\u5185\u5BB9\n- **\u901A\u7528\u5185\u5BB9**\uFF1A\u79FB\u9664\u9002\u7528\u4E8E\u6240\u6709\u9879\u76EE\u7684\u4EFB\u4F55\u5185\u5BB9\n- **\u5197\u957F\u98CE\u683C**\uFF1A\u7535\u62A5\u5F0F\u98CE\u683C\uFF0C\u5426\u5219\u52FF\u5199";
|
|
1
|
+
export declare const INIT_DEEP_TEMPLATE = "# /init-deep\n\nGenerate hierarchical AGENTS.md files. Root + complexity-scored subdirectories.\n\n## Usage\n\n```\n/init-deep # Update mode: modify existing + create new where warranted\n/init-deep --create-new # Read existing \u2192 remove all \u2192 regenerate from scratch\n/init-deep --max-depth=2 # Limit directory depth (default: 3)\n```\n\n---\n\n## Workflow (High-Level)\n\n1. **Discovery + Analysis** (concurrent)\n - Fire background explore agents immediately\n - Main session: bash structure + LSP codemap + read existing AGENTS.md\n2. **Score & Decide** - Determine AGENTS.md locations from merged findings\n3. **Generate** - Root first, then subdirs in parallel\n4. **Review** - Deduplicate, trim, validate\n\n<critical>\n**TodoWrite ALL phases. Mark in_progress \u2192 completed in real-time.**\n```\nTodoWrite([\n { id: \"discovery\", content: \"Fire explore agents + LSP codemap + read existing\", status: \"pending\", priority: \"high\" },\n { id: \"scoring\", content: \"Score directories, determine locations\", status: \"pending\", priority: \"high\" },\n { id: \"generate\", content: \"Generate AGENTS.md files (root + subdirs)\", status: \"pending\", priority: \"high\" },\n { id: \"review\", content: \"Deduplicate, validate, trim\", status: \"pending\", priority: \"medium\" }\n])\n```\n</critical>\n\n---\n\n## Phase 1: Discovery + Analysis (Concurrent)\n\n**Mark \"discovery\" as in_progress.**\n\n### Fire Background Explore Agents IMMEDIATELY\n\nDon't wait-these run async while main session works.\n\n```\n// Fire all at once, collect results later\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore project structure\", run_in_background=true, prompt=\"Project structure: PREDICT standard patterns for detected language \u2192 REPORT deviations only\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find entry points\", run_in_background=true, prompt=\"Entry points: FIND main files \u2192 REPORT non-standard organization\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find conventions\", run_in_background=true, prompt=\"Conventions: FIND config files (.eslintrc, pyproject.toml, .editorconfig) \u2192 REPORT project-specific rules\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find anti-patterns\", run_in_background=true, prompt=\"Anti-patterns: FIND 'DO NOT', 'NEVER', 'ALWAYS', 'DEPRECATED' comments \u2192 LIST forbidden patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore build/CI\", run_in_background=true, prompt=\"Build/CI: FIND .github/workflows, Makefile \u2192 REPORT non-standard patterns\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find test patterns\", run_in_background=true, prompt=\"Test patterns: FIND test configs, test structure \u2192 REPORT unique conventions\")\n```\n\n<dynamic-agents>\n**DYNAMIC AGENT SPAWNING**: After bash analysis, spawn ADDITIONAL explore agents based on project scale:\n\n| Factor | Threshold | Additional Agents |\n|--------|-----------|-------------------|\n| **Total files** | >100 | +1 per 100 files |\n| **Total lines** | >10k | +1 per 10k lines |\n| **Directory depth** | \u22654 | +2 for deep exploration |\n| **Large files (>500 lines)** | >10 files | +1 for complexity hotspots |\n| **Monorepo** | detected | +1 per package/workspace |\n| **Multiple languages** | >1 | +1 per language |\n\n```bash\n# Measure project scale first\ntotal_files=$(find . -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | wc -l)\ntotal_lines=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" -o -name \"*.go\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | tail -1 | awk '{print $1}')\nlarge_files=$(find . -type f \\( -name \"*.ts\" -o -name \"*.py\" \\) -not -path '*/node_modules/*' -exec wc -l {} + 2>/dev/null | awk '$1 > 500 {count++} END {print count+0}')\nmax_depth=$(find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' | awk -F/ '{print NF}' | sort -rn | head -1)\n```\n\nExample spawning:\n```\n// 500 files, 50k lines, depth 6, 15 large files \u2192 spawn 5+5+2+1 = 13 additional agents\ntask(subagent_type=\"explore\", load_skills=[], description=\"Analyze large files\", run_in_background=true, prompt=\"Large file analysis: FIND files >500 lines, REPORT complexity hotspots\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Explore deep modules\", run_in_background=true, prompt=\"Deep modules at depth 4+: FIND hidden patterns, internal conventions\")\ntask(subagent_type=\"explore\", load_skills=[], description=\"Find shared utilities\", run_in_background=true, prompt=\"Cross-cutting concerns: FIND shared utilities across directories\")\n// ... more based on calculation\n```\n</dynamic-agents>\n\n### Main Session: Concurrent Analysis\n\n**While background agents run**, main session does:\n\n#### 1. Bash Structural Analysis\n```bash\n# Directory depth + file counts\nfind . -type d -not -path '*/\\.*' -not -path '*/node_modules/*' -not -path '*/venv/*' -not -path '*/dist/*' -not -path '*/build/*' | awk -F/ '{print NF-1}' | sort -n | uniq -c\n\n# Files per directory (top 30)\nfind . -type f -not -path '*/\\.*' -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -30\n\n# Code concentration by extension\nfind . -type f \\( -name \"*.py\" -o -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.js\" -o -name \"*.go\" -o -name \"*.rs\" \\) -not -path '*/node_modules/*' | sed 's|/[^/]*$||' | sort | uniq -c | sort -rn | head -20\n\n# Existing AGENTS.md / CLAUDE.md\nfind . -type f \\( -name \"AGENTS.md\" -o -name \"CLAUDE.md\" \\) -not -path '*/node_modules/*' 2>/dev/null\n```\n\n#### 2. Read Existing AGENTS.md\n```\nFor each existing file found:\n Read(filePath=file)\n Extract: key insights, conventions, anti-patterns\n Store in EXISTING_AGENTS map\n```\n\nIf `--create-new`: Read all existing first (preserve context) \u2192 then delete all \u2192 regenerate.\n\n#### 3. LSP Codemap (if available)\n```\nLspServers() # Check availability\n\n# Entry points (parallel)\nLspDocumentSymbols(filePath=\"src/index.ts\")\nLspDocumentSymbols(filePath=\"main.py\")\n\n# Key symbols (parallel)\nLspWorkspaceSymbols(filePath=\".\", query=\"class\")\nLspWorkspaceSymbols(filePath=\".\", query=\"interface\")\nLspWorkspaceSymbols(filePath=\".\", query=\"function\")\n\n# Centrality for top exports\nLspFindReferences(filePath=\"...\", line=X, character=Y)\n```\n\n**LSP Fallback**: If unavailable, rely on explore agents + AST-grep.\n\n### Collect Background Results\n\n```\n// After main session analysis done, collect all task results\nfor each task_id: background_output(task_id=\"...\")\n```\n\n**Merge: bash + LSP + existing + explore findings. Mark \"discovery\" as completed.**\n\n---\n\n## Phase 2: Scoring & Location Decision\n\n**Mark \"scoring\" as in_progress.**\n\n### Scoring Matrix\n\n| Factor | Weight | High Threshold | Source |\n|--------|--------|----------------|--------|\n| File count | 3x | >20 | bash |\n| Subdir count | 2x | >5 | bash |\n| Code ratio | 2x | >70% | bash |\n| Unique patterns | 1x | Has own config | explore |\n| Module boundary | 2x | Has index.ts/__init__.py | bash |\n| Symbol density | 2x | >30 symbols | LSP |\n| Export count | 2x | >10 exports | LSP |\n| Reference centrality | 3x | >20 refs | LSP |\n\n### Decision Rules\n\n| Score | Action |\n|-------|--------|\n| **Root (.)** | ALWAYS create |\n| **>15** | Create AGENTS.md |\n| **8-15** | Create if distinct domain |\n| **<8** | Skip (parent covers) |\n\n### Output\n```\nAGENTS_LOCATIONS = [\n { path: \".\", type: \"root\" },\n { path: \"src/hooks\", score: 18, reason: \"high complexity\" },\n { path: \"src/api\", score: 12, reason: \"distinct domain\" }\n]\n```\n\n**Mark \"scoring\" as completed.**\n\n---\n\n## Phase 3: Generate AGENTS.md\n\n**Mark \"generate\" as in_progress.**\n\n<critical>\n**File Writing Rule**: If AGENTS.md already exists at the target path \u2192 use `Edit` tool. If it does NOT exist \u2192 use `Write` tool.\nNEVER use Write to overwrite an existing file. ALWAYS check existence first via `Read` or discovery results.\n</critical>\n\n### Root AGENTS.md (Full Treatment)\n\n```markdown\n# PROJECT KNOWLEDGE BASE\n\n**Generated:** {TIMESTAMP}\n**Commit:** {SHORT_SHA}\n**Branch:** {BRANCH}\n\n## OVERVIEW\n{1-2 sentences: what + core stack}\n\n## STRUCTURE\n\\`\\`\\`\n{root}/\n\u251C\u2500\u2500 {dir}/ # {non-obvious purpose only}\n\u2514\u2500\u2500 {entry}\n\\`\\`\\`\n\n## WHERE TO LOOK\n| Task | Location | Notes |\n|------|----------|-------|\n\n## CODE MAP\n{From LSP - skip if unavailable or project <10 files}\n\n| Symbol | Type | Location | Refs | Role |\n|--------|------|----------|------|------|\n\n## CONVENTIONS\n{ONLY deviations from standard}\n\n## ANTI-PATTERNS (THIS PROJECT)\n{Explicitly forbidden here}\n\n## UNIQUE STYLES\n{Project-specific}\n\n## COMMANDS\n\\`\\`\\`bash\n{dev/test/build}\n\\`\\`\\`\n\n## NOTES\n{Gotchas}\n```\n\n**Quality gates**: 50-150 lines, no generic advice, no obvious info.\n\n### Subdirectory AGENTS.md (Parallel)\n\nLaunch writing tasks for each location:\n\n```\nfor loc in AGENTS_LOCATIONS (except root):\n task(category=\"writing\", load_skills=[], run_in_background=false, description=\"Generate AGENTS.md\", prompt=\\`\n Generate AGENTS.md for: ${loc.path}\n - Reason: ${loc.reason}\n - 30-80 lines max\n - NEVER repeat parent content\n - Sections: OVERVIEW (1 line), STRUCTURE (if >5 subdirs), WHERE TO LOOK, CONVENTIONS (if different), ANTI-PATTERNS\n \\`)\n```\n\n**Wait for all. Mark \"generate\" as completed.**\n\n---\n\n## Phase 4: Review & Deduplicate\n\n**Mark \"review\" as in_progress.**\n\nFor each generated file:\n- Remove generic advice\n- Remove parent duplicates\n- Trim to size limits\n- Verify telegraphic style\n\n**Mark \"review\" as completed.**\n\n---\n\n## Final Report\n\n```\n=== init-deep Complete ===\n\nMode: {update | create-new}\n\nFiles:\n [OK] ./AGENTS.md (root, {N} lines)\n [OK] ./src/hooks/AGENTS.md ({N} lines)\n\nDirs Analyzed: {N}\nAGENTS.md Created: {N}\nAGENTS.md Updated: {N}\n\nHierarchy:\n ./AGENTS.md\n \u2514\u2500\u2500 src/hooks/AGENTS.md\n```\n\n---\n\n## Anti-Patterns\n\n- **Static agent count**: MUST vary agents based on project size/depth\n- **Sequential execution**: MUST parallel (explore + LSP concurrent)\n- **Ignoring existing**: ALWAYS read existing first, even with --create-new\n- **Over-documenting**: Not every dir needs AGENTS.md\n- **Redundancy**: Child never repeats parent\n- **Generic content**: Remove anything that applies to ALL projects\n- **Verbose style**: Telegraphic or die";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const RALPH_LOOP_TEMPLATE = "
|
|
2
|
-
export declare const ULW_LOOP_TEMPLATE = "
|
|
3
|
-
export declare const CANCEL_RALPH_TEMPLATE = "
|
|
1
|
+
export declare const RALPH_LOOP_TEMPLATE = "You are starting a Ralph Loop - a self-referential development loop that runs until task completion.\n\n## How Ralph Loop Works\n\n1. You will work on the task continuously\n2. When you believe the task is FULLY complete, output: `<promise>{{COMPLETION_PROMISE}}</promise>`\n3. If you don't output the promise, the loop will automatically inject another prompt to continue\n4. Maximum iterations: Configurable (default 100)\n\n## Rules\n\n- Focus on completing the task fully, not partially\n- Don't output the completion promise until the task is truly done\n- Each iteration should make meaningful progress toward the goal\n- If stuck, try different approaches\n- Use todos to track your progress\n\n## Exit Conditions\n\n1. **Completion**: Output your completion promise tag when fully complete\n2. **Max Iterations**: Loop stops automatically at limit\n3. **Cancel**: User runs `/cancel-ralph` command\n\n## Your Task\n\nParse the arguments below and begin working on the task. The format is:\n`\"task description\" [--completion-promise=TEXT] [--max-iterations=N] [--strategy=reset|continue]`\n\nDefault completion promise is \"DONE\" and default max iterations is 100.";
|
|
2
|
+
export declare const ULW_LOOP_TEMPLATE = "You are starting an ULTRAWORK Loop - a self-referential development loop that runs until verified completion.\n\n## How ULTRAWORK Loop Works\n\n1. You will work on the task continuously\n2. When you believe the work is complete, output: `<promise>{{COMPLETION_PROMISE}}</promise>`\n3. That does NOT finish the loop yet. The system will require Oracle verification\n4. The loop only ends after the system confirms Oracle verified the result\n5. The iteration limit is 500 for ultrawork mode, 100 for normal mode\n\n## Rules\n\n- Focus on finishing the task completely\n- After you emit the completion promise, run Oracle verification when instructed\n- Do not treat DONE as final completion until Oracle verifies it\n\n## Exit Conditions\n\n1. **Verified Completion**: Oracle verifies the result and the system confirms it\n2. **Cancel**: User runs `/cancel-ralph`\n\n## Your Task\n\nParse the arguments below and begin working on the task. The format is:\n`\"task description\" [--completion-promise=TEXT] [--strategy=reset|continue]`\n\nDefault completion promise is \"DONE\".";
|
|
3
|
+
export declare const CANCEL_RALPH_TEMPLATE = "Cancel the currently active Ralph Loop.\n\nThis will:\n1. Stop the loop from continuing\n2. Clear the loop state file\n3. Allow the session to end normally\n\nCheck if a loop is active and cancel it. Inform the user of the result.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const REFACTOR_TEMPLATE = "# \u667A\u80FD\u91CD\u6784\u547D\u4EE4\n\n## \u4F7F\u7528\u65B9\u5F0F\n```\n/refactor <\u91CD\u6784\u76EE\u6807> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\n\u53C2\u6570\uFF1A\n \u91CD\u6784\u76EE\u6807\uFF1A\u8981\u91CD\u6784\u7684\u5185\u5BB9\u3002\u53EF\u4E3A\uFF1A\n - \u6587\u4EF6\u8DEF\u5F84\uFF1Asrc/auth/handler.ts\n - \u7B26\u53F7\u540D\u79F0\uFF1A\"AuthService class\"\n - \u6A21\u5F0F\uFF1A\"all functions using deprecated API\"\n - \u63CF\u8FF0\uFF1A\"extract validation logic into separate module\"\n\n\u9009\u9879\uFF1A\n --scope\uFF1A\u91CD\u6784\u8303\u56F4\uFF08\u9ED8\u8BA4\uFF1Amodule\uFF09\n - file\uFF1A\u4EC5\u5355\u4E2A\u6587\u4EF6\n - module\uFF1A\u6A21\u5757/\u76EE\u5F55\u8303\u56F4\n - project\uFF1A\u6574\u4E2A\u4EE3\u7801\u5E93\n\n --strategy\uFF1A\u98CE\u9669\u5BB9\u5FCD\u5EA6\uFF08\u9ED8\u8BA4\uFF1Asafe\uFF09\n - safe\uFF1A\u4FDD\u5B88\u7B56\u7565\uFF0C\u9700\u8981\u6700\u5927\u5316\u7684\u6D4B\u8BD5\u8986\u76D6\u7387\n - aggressive\uFF1A\u5141\u8BB8\u66F4\u5E7F\u6CDB\u7684\u53D8\u66F4\uFF0C\u53EA\u8981\u6709\u8DB3\u591F\u7684\u8986\u76D6\u7387\n```\n\n## \u6B64\u547D\u4EE4\u7684\u529F\u80FD\n\n\u6267\u884C\u667A\u80FD\u7684\u3001\u786E\u5B9A\u6027\u7684\u91CD\u6784\uFF0C\u5168\u9762\u4E86\u89E3\u4EE3\u7801\u5E93\u3002\u4E0E\u76F2\u76EE\u7684\u641C\u7D22\u66FF\u6362\u4E0D\u540C\uFF0C\u6B64\u547D\u4EE4\uFF1A\n\n1. **\u7406\u89E3\u4F60\u7684\u610F\u56FE** - \u5206\u6790\u4F60\u5B9E\u9645\u60F3\u8981\u8FBE\u5230\u7684\u76EE\u6807\n2. **\u6620\u5C04\u4EE3\u7801\u5E93** - \u5728\u4FEE\u6539\u4EFB\u4F55\u5185\u5BB9\u4E4B\u524D\u6784\u5EFA\u786E\u5B9A\u7684 codemap\n3. **\u8BC4\u4F30\u98CE\u9669** - \u8BC4\u4F30\u6D4B\u8BD5\u8986\u76D6\u7387\u5E76\u786E\u5B9A\u9A8C\u8BC1\u7B56\u7565\n4. **\u7CBE\u5FC3\u89C4\u5212** - \u4F7F\u7528 Plan agent \u521B\u5EFA\u8BE6\u7EC6\u8BA1\u5212\n5. **\u7CBE\u786E\u6267\u884C** - \u901A\u8FC7 LSP \u548C AST-grep \u9010\u6B65\u91CD\u6784\n6. **\u6301\u7EED\u9A8C\u8BC1** - \u6BCF\u6B21\u53D8\u66F4\u540E\u8FD0\u884C\u6D4B\u8BD5\uFF0C\u786E\u4FDD\u96F6\u56DE\u5F52\n\n---\n\n# \u9636\u6BB5 0\uFF1A\u610F\u56FE\u95E8\u63A7\uFF08\u5F3A\u5236\u6027\u7B2C\u4E00\u6B65\uFF09\n\n**\u5728\u4EFB\u4F55\u64CD\u4F5C\u4E4B\u524D\uFF0C\u5BF9\u8BF7\u6C42\u8FDB\u884C\u5206\u7C7B\u548C\u9A8C\u8BC1\u3002**\n\n## \u6B65\u9AA4 0.1\uFF1A\u89E3\u6790\u8BF7\u6C42\u7C7B\u578B\n\n| \u4FE1\u53F7 | \u5206\u7C7B | \u64CD\u4F5C |\n|--------|----------------|--------|\n| \u7279\u5B9A\u6587\u4EF6/\u7B26\u53F7 | \u660E\u786E\u7684 | \u8FDB\u5165\u4EE3\u7801\u5E93\u5206\u6790 |\n| \"Refactor X to Y\" | \u6E05\u6670\u7684\u8F6C\u6362 | \u8FDB\u5165\u4EE3\u7801\u5E93\u5206\u6790 |\n| \"Improve\"\u3001\"Clean up\" | \u5F00\u653E\u5F0F | **\u5FC5\u987B\u8BE2\u95EE**\uFF1A\"\u5177\u4F53\u60F3\u8981\u6539\u8FDB\u4EC0\u4E48\uFF1F\" |\n| \u8303\u56F4\u6A21\u7CCA | \u4E0D\u786E\u5B9A | **\u5FC5\u987B\u8BE2\u95EE**\uFF1A\"\u6D89\u53CA\u54EA\u4E9B\u6A21\u5757/\u6587\u4EF6\uFF1F\" |\n| \u7F3A\u5C11\u4E0A\u4E0B\u6587 | \u4E0D\u5B8C\u6574 | **\u5FC5\u987B\u8BE2\u95EE**\uFF1A\"\u671F\u671B\u7684\u7ED3\u679C\u662F\u4EC0\u4E48\uFF1F\" |\n\n## \u6B65\u9AA4 0.2\uFF1A\u9A8C\u8BC1\u7406\u89E3\n\n\u5728\u7EE7\u7EED\u4E4B\u524D\uFF0C\u786E\u8BA4\uFF1A\n- [ ] \u76EE\u6807\u5DF2\u660E\u786E\u8BC6\u522B\n- [ ] \u671F\u671B\u7ED3\u679C\u5DF2\u7406\u89E3\n- [ ] \u8303\u56F4\u5DF2\u5B9A\u4E49\uFF08file/module/project\uFF09\n- [ ] \u53EF\u4EE5\u8868\u8FF0\u6210\u529F\u6807\u51C6\n\n**\u5982\u679C\u4E0A\u8FF0\u4EFB\u4F55\u4E00\u9879\u4E0D\u6E05\u6670\uFF0C\u63D0\u51FA\u6F84\u6E05\u95EE\u9898\uFF1A**\n\n```\n\u6211\u60F3\u786E\u4FDD\u6211\u6B63\u786E\u7406\u89E3\u4E86\u91CD\u6784\u76EE\u6807\u3002\n\n**\u6211\u7406\u89E3\u7684\u5185\u5BB9**\uFF1A[\u89E3\u91CA]\n**\u6211\u4E0D\u786E\u5B9A\u7684\u90E8\u5206**\uFF1A[\u5177\u4F53\u6A21\u7CCA\u4E4B\u5904]\n\n\u6211\u770B\u5230\u7684\u9009\u9879\uFF1A\n1. [\u9009\u9879 A] - [\u542B\u4E49]\n2. [\u9009\u9879 B] - [\u542B\u4E49]\n\n**\u6211\u7684\u5EFA\u8BAE**\uFF1A[\u5E26\u63A8\u7406\u7684\u5EFA\u8BAE]\n\n\u6211\u5E94\u8BE5\u6309 [\u5EFA\u8BAE] \u8FDB\u884C\u5417\uFF0C\u8FD8\u662F\u4F60\u6709\u5176\u4ED6\u504F\u597D\uFF1F\n```\n\n## \u6B65\u9AA4 0.3\uFF1A\u521B\u5EFA\u521D\u59CB Todos\n\n**\u5728\u7406\u89E3\u8BF7\u6C42\u540E\u7ACB\u5373\u521B\u5EFA todos\uFF1A**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: \u4EE3\u7801\u5E93\u5206\u6790 - \u542F\u52A8\u5E76\u884C\u7684 explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: \u6784\u5EFA Codemap - \u6620\u5C04\u4F9D\u8D56\u5173\u7CFB\u548C\u5F71\u54CD\u533A\u57DF\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: \u6D4B\u8BD5\u8BC4\u4F30 - \u5206\u6790\u6D4B\u8BD5\u8986\u76D6\u7387\u5E76\u786E\u5B9A\u9A8C\u8BC1\u7B56\u7565\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: \u8BA1\u5212\u751F\u6210 - \u8C03\u7528 Plan agent \u751F\u6210\u8BE6\u7EC6\u91CD\u6784\u8BA1\u5212\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: \u6267\u884C\u91CD\u6784 - \u9010\u6B65\u8FDB\u884C\u5E76\u6301\u7EED\u9A8C\u8BC1\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: \u6700\u7EC8\u9A8C\u8BC1 - \u5B8C\u6574\u6D4B\u8BD5\u5957\u4EF6\u548C\u56DE\u5F52\u68C0\u67E5\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# \u9636\u6BB5 1\uFF1A\u4EE3\u7801\u5E93\u5206\u6790\uFF08\u5E76\u884C\u63A2\u7D22\uFF09\n\n**\u5C06 phase-1 \u6807\u8BB0\u4E3A in_progress\u3002**\n\n## 1.1\uFF1A\u542F\u52A8\u5E76\u884C Explore Agents\uFF08\u540E\u53F0\uFF09\n\n\u4F7F\u7528 `call_omo_agent` \u540C\u65F6\u542F\u52A8\u6240\u6709\u8FD9\u4E9B agents\uFF1A\n\n```\n// Agent 1: \u627E\u5230\u91CD\u6784\u76EE\u6807\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET].\n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: \u627E\u5230\u76F8\u5173\u4EE3\u7801\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: \u627E\u5230\u76F8\u4F3C\u6A21\u5F0F\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: \u627E\u5230\u6D4B\u8BD5\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: \u67B6\u6784\u4E0A\u4E0B\u6587\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2\uFF1A\u76F4\u63A5\u5DE5\u5177\u63A2\u7D22\uFF08\u540E\u53F0 agents \u8FD0\u884C\u671F\u95F4\uFF09\n\n\u5728\u540E\u53F0 agents \u8FD0\u884C\u65F6\uFF0C\u4F7F\u7528\u76F4\u63A5\u5DE5\u5177\uFF1A\n\n### \u7528\u4E8E\u7CBE\u786E\u5206\u6790\u7684 LSP \u5DE5\u5177\uFF1A\n\n```typescript\n// \u67E5\u627E\u5B9A\u4E49\nLspGotoDefinition(filePath, line, character) // \u5B9A\u4E49\u5728\u54EA\u91CC\uFF1F\n\n// \u67E5\u627E\u6574\u4E2A workspace \u4E2D\u7684\u6240\u6709\u7528\u6CD5\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n// \u83B7\u53D6\u6587\u4EF6\u7ED3\u6784\nLspDocumentSymbols(filePath) // \u5C42\u7EA7\u5927\u7EB2\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\") // \u6309\u540D\u79F0\u641C\u7D22\n\n// \u83B7\u53D6\u5F53\u524D\u8BCA\u65AD\nlsp_diagnostics(filePath) // \u5F00\u59CB\u524D\u7684\u9519\u8BEF\u548C\u8B66\u544A\n```\n\n### \u7528\u4E8E\u6A21\u5F0F\u5206\u6790\u7684 AST-Grep\uFF1A\n\n```typescript\n// \u67E5\u627E\u7ED3\u6784\u6A21\u5F0F\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // \u6216\u76F8\u5173\u6A21\u5F0F\n lang=\"typescript\", // \u6216\u76F8\u5173\u8BED\u8A00\n paths=[\"src/\"]\n)\n\n// \u9884\u89C8\u91CD\u6784\uFF08DRY RUN\uFF09\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // \u59CB\u7EC8\u5148\u9884\u89C8\n)\n```\n\n### \u7528\u4E8E\u6587\u672C\u6A21\u5F0F\u7684 Grep\uFF1A\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3\uFF1A\u6536\u96C6\u540E\u53F0\u7ED3\u679C\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**\u6536\u96C6\u5B8C\u6240\u6709\u7ED3\u679C\u540E\uFF0C\u5C06 phase-1 \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n# \u9636\u6BB5 2\uFF1A\u6784\u5EFA CODEMAP\uFF08\u4F9D\u8D56\u5173\u7CFB\u6620\u5C04\uFF09\n\n**\u5C06 phase-2 \u6807\u8BB0\u4E3A in_progress\u3002**\n\n## 2.1\uFF1A\u6784\u5EFA\u786E\u5B9A\u7684 Codemap\n\n\u57FA\u4E8E\u9636\u6BB5 1 \u7684\u7ED3\u679C\uFF0C\u6784\u5EFA\uFF1A\n\n```\n## CODEMAP: [TARGET]\n\n### \u6838\u5FC3\u6587\u4EF6\uFF08\u76F4\u63A5\u5F71\u54CD\uFF09\n- `path/to/file.ts:L10-L50` - \u4E3B\u8981\u5B9A\u4E49\n- `path/to/file2.ts:L25` - \u5173\u952E\u7528\u6CD5\n\n### \u4F9D\u8D56\u5173\u7CFB\u56FE\n```\n[TARGET]\n\u251C\u2500\u2500 \u5BFC\u5165\u81EA:\n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 \u88AB\u4EE5\u4E0B\u5BFC\u5165:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 \u88AB\u4EE5\u4E0B\u4F7F\u7528:\n \u251C\u2500\u2500 handler.ts (\u76F4\u63A5\u8C03\u7528)\n \u2514\u2500\u2500 service.ts (\u4F9D\u8D56\u6CE8\u5165)\n```\n\n### \u5F71\u54CD\u533A\u57DF\n| \u533A\u57DF | \u98CE\u9669\u7B49\u7EA7 | \u6D89\u53CA\u6587\u4EF6 | \u6D4B\u8BD5\u8986\u76D6\u7387 |\n|------|------------|----------------|---------------|\n| \u6838\u5FC3 | HIGH | 3 \u4E2A\u6587\u4EF6 | 85% \u8986\u76D6 |\n| \u6D88\u8D39\u8005 | MEDIUM | 8 \u4E2A\u6587\u4EF6 | 70% \u8986\u76D6 |\n| \u8FB9\u7F18 | LOW | 2 \u4E2A\u6587\u4EF6 | 50% \u8986\u76D6 |\n\n### \u5DF2\u786E\u7ACB\u7684\u6A21\u5F0F\n- Pattern A: [\u63CF\u8FF0] - \u5728 N \u5904\u4F7F\u7528\n- Pattern B: [\u63CF\u8FF0] - \u5DF2\u5EFA\u7ACB\u7684\u7EA6\u5B9A\n```\n\n## 2.2\uFF1A\u8BC6\u522B\u91CD\u6784\u7EA6\u675F\n\n\u57FA\u4E8E codemap\uFF1A\n- **\u5FC5\u987B\u9075\u5FAA**\uFF1A[\u5DF2\u8BC6\u522B\u7684\u73B0\u6709\u6A21\u5F0F]\n- **\u4E0D\u80FD\u7834\u574F**\uFF1A[\u5173\u952E\u4F9D\u8D56\u5173\u7CFB]\n- **\u53EF\u4EE5\u5B89\u5168\u4FEE\u6539**\uFF1A[\u9694\u79BB\u7684\u4EE3\u7801\u533A\u57DF]\n- **\u9700\u8981\u8FC1\u79FB**\uFF1A[\u7834\u574F\u6027\u53D8\u66F4\u7684\u5F71\u54CD]\n\n**\u5C06 phase-2 \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n# \u9636\u6BB5 3\uFF1A\u6D4B\u8BD5\u8BC4\u4F30\uFF08\u9A8C\u8BC1\u7B56\u7565\uFF09\n\n**\u5C06 phase-3 \u6807\u8BB0\u4E3A in_progress\u3002**\n\n## 3.1\uFF1A\u68C0\u6D4B\u6D4B\u8BD5\u57FA\u7840\u8BBE\u65BD\n\n```bash\n# \u68C0\u67E5\u6D4B\u8BD5\u547D\u4EE4\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# \u6216\u5BF9\u4E8E Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# \u6216\u5BF9\u4E8E Go\nls -la *_test.go\n```\n\n## 3.2\uFF1A\u5206\u6790\u6D4B\u8BD5\u8986\u76D6\u7387\n\n```\n// \u67E5\u627E\u4E0E\u76EE\u6807\u76F8\u5173\u7684\u6240\u6709\u6D4B\u8BD5\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=false, // \u9700\u8981\u540C\u6B65\u83B7\u53D6\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3\uFF1A\u786E\u5B9A\u9A8C\u8BC1\u7B56\u7565\n\n\u57FA\u4E8E\u6D4B\u8BD5\u5206\u6790\uFF1A\n\n| \u8986\u76D6\u7387\u7B49\u7EA7 | \u7B56\u7565 |\n|----------------|----------|\n| HIGH (>80%) | \u6BCF\u6B65\u540E\u8FD0\u884C\u73B0\u6709\u6D4B\u8BD5 |\n| MEDIUM (50-80%) | \u8FD0\u884C\u6D4B\u8BD5 + \u6DFB\u52A0\u5B89\u5168\u65AD\u8A00 |\n| LOW (<50%) | **\u6682\u505C**\uFF1A\u5EFA\u8BAE\u5148\u6DFB\u52A0\u6D4B\u8BD5 |\n| NONE | **\u963B\u6B62**\uFF1A\u62D2\u7EDD\u6FC0\u8FDB\u91CD\u6784 |\n\n**\u5982\u679C\u8986\u76D6\u7387\u4E3A LOW \u6216 NONE\uFF0C\u5411\u7528\u6237\u8BE2\u95EE\uFF1A**\n\n```\n[TARGET] \u7684\u6D4B\u8BD5\u8986\u76D6\u7387\u4E3A [\u7B49\u7EA7]\u3002\n\n**\u98CE\u9669\u8BC4\u4F30**\uFF1A\u6CA1\u6709\u8DB3\u591F\u6D4B\u8BD5\u7684\u91CD\u6784\u662F\u5371\u9669\u7684\u3002\n\n\u9009\u9879\uFF1A\n1. \u5148\u6DFB\u52A0\u6D4B\u8BD5\uFF0C\u518D\u91CD\u6784\uFF08\u63A8\u8350\uFF09\n2. \u683C\u5916\u5C0F\u5FC3\u5730\u8FDB\u884C\uFF0C\u9700\u8981\u624B\u52A8\u9A8C\u8BC1\n3. \u7EC8\u6B62\u91CD\u6784\n\n\u4F60\u503E\u5411\u4E8E\u54EA\u79CD\u65B9\u5F0F\uFF1F\n```\n\n## 3.4\uFF1A\u8BB0\u5F55\u9A8C\u8BC1\u8BA1\u5212\n\n```\n## \u9A8C\u8BC1\u8BA1\u5212\n\n### \u6D4B\u8BD5\u547D\u4EE4\n- \u5355\u5143\u6D4B\u8BD5\uFF1A`bun test` / `npm test` / `pytest` / \u7B49\n- \u96C6\u6210\u6D4B\u8BD5\uFF1A[\u547D\u4EE4\uFF0C\u5982\u5B58\u5728]\n- \u7C7B\u578B\u68C0\u67E5\uFF1A`tsc --noEmit` / `pyright` / \u7B49\n\n### \u9A8C\u8BC1\u68C0\u67E5\u70B9\n\u6BCF\u6B21\u91CD\u6784\u6B65\u9AA4\u540E\uFF1A\n1. lsp_diagnostics \u2192 \u65E0\u65B0\u589E\u9519\u8BEF\n2. \u8FD0\u884C\u6D4B\u8BD5\u547D\u4EE4 \u2192 \u5168\u90E8\u901A\u8FC7\n3. \u7C7B\u578B\u68C0\u67E5 \u2192 \u6E05\u6D01\n\n### \u56DE\u5F52\u6307\u6807\n- [\u5FC5\u987B\u901A\u8FC7\u7684\u7279\u5B9A\u6D4B\u8BD5]\n- [\u5FC5\u987B\u4FDD\u7559\u7684\u884C\u4E3A]\n- [\u4E0D\u80FD\u6539\u53D8\u7684 API \u5951\u7EA6]\n```\n\n**\u5C06 phase-3 \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n# \u9636\u6BB5 4\uFF1A\u8BA1\u5212\u751F\u6210\uFF08PLAN AGENT\uFF09\n\n**\u5C06 phase-4 \u6807\u8BB0\u4E3A in_progress\u3002**\n\n## 4.1\uFF1A\u8C03\u7528 Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2\uFF1A\u5BA1\u67E5\u548C\u9A8C\u8BC1\u8BA1\u5212\n\n\u5728\u6536\u5230 Plan agent \u7684\u8BA1\u5212\u540E\uFF1A\n\n1. **\u9A8C\u8BC1\u5B8C\u6574\u6027**\uFF1A\u6240\u6709\u8BC6\u522B\u7684\u6587\u4EF6\u90FD\u5DF2\u5904\u7406\uFF1F\n2. **\u9A8C\u8BC1\u5B89\u5168\u6027**\uFF1A\u6BCF\u6B65\u90FD\u662F\u53EF\u9006\u7684\uFF1F\n3. **\u9A8C\u8BC1\u987A\u5E8F**\uFF1A\u4F9D\u8D56\u5173\u7CFB\u88AB\u5C0A\u91CD\u4E86\uFF1F\n4. **\u9A8C\u8BC1\u9A8C\u8BC1**\uFF1A\u6D4B\u8BD5\u547D\u4EE4\u662F\u5426\u5DF2\u6307\u5B9A\uFF1F\n\n## 4.3\uFF1A\u6CE8\u518C\u8BE6\u7EC6 Todos\n\n\u5C06 Plan agent \u7684\u8F93\u51FA\u8F6C\u6362\u4E3A\u7EC6\u7C92\u5EA6 todos\uFF1A\n\n```\nTodoWrite([\n // \u8BA1\u5212\u4E2D\u7684\u6BCF\u4E00\u6B65\u90FD\u6210\u4E3A\u4E00\u4E2A todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [\u63CF\u8FF0]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [\u63CF\u8FF0]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... \u4E3A\u6240\u6709\u6B65\u9AA4\u7EE7\u7EED\n])\n```\n\n**\u5C06 phase-4 \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n# \u9636\u6BB5 5\uFF1A\u6267\u884C\u91CD\u6784\uFF08\u786E\u5B9A\u6027\u6267\u884C\uFF09\n\n**\u5C06 phase-5 \u6807\u8BB0\u4E3A in_progress\u3002**\n\n## 5.1\uFF1A\u6267\u884C\u534F\u8BAE\n\n\u5BF9\u4E8E\u6BCF\u4E2A\u91CD\u6784\u6B65\u9AA4\uFF1A\n\n### \u6B65\u9AA4\u524D\n1. \u5C06\u6B65\u9AA4 todo \u6807\u8BB0\u4E3A `in_progress`\n2. \u8BFB\u53D6\u5F53\u524D\u6587\u4EF6\u72B6\u6001\n3. \u9A8C\u8BC1 lsp_diagnostics \u57FA\u7EBF\n\n### \u6267\u884C\u6B65\u9AA4\n\u4F7F\u7528\u9002\u5F53\u7684\u5DE5\u5177\uFF1A\n\n**\u5BF9\u4E8E\u7B26\u53F7\u91CD\u547D\u540D\uFF1A**\n```typescript\nlsp_prepare_rename(filePath, line, character) // \u9A8C\u8BC1\u91CD\u547D\u540D\u662F\u5426\u53EF\u884C\nlsp_rename(filePath, line, character, newName) // \u6267\u884C\u91CD\u547D\u540D\n```\n\n**\u5BF9\u4E8E\u6A21\u5F0F\u8F6C\u6362\uFF1A**\n```typescript\n// \u5148\u9884\u89C8\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// \u5982\u679C\u9884\u89C8\u770B\u8D77\u6765\u6CA1\u95EE\u9898\uFF0C\u6267\u884C\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**\u5BF9\u4E8E\u7ED3\u6784\u53D8\u66F4\uFF1A**\n```typescript\n// \u4F7F\u7528 Edit \u5DE5\u5177\u8FDB\u884C\u7CBE\u786E\u4FEE\u6539\nedit(filePath, oldString, newString)\n```\n\n### \u6B65\u9AA4\u540E\u9A8C\u8BC1\uFF08\u5F3A\u5236\uFF09\n\n```typescript\n// 1. \u68C0\u67E5\u8BCA\u65AD\nlsp_diagnostics(filePath) // \u5FC5\u987B\u6E05\u6D01\u6216\u4E0E\u57FA\u7EBF\u76F8\u540C\n\n// 2. \u8FD0\u884C\u6D4B\u8BD5\nbash(\"bun test\") // \u6216\u9002\u5F53\u7684\u6D4B\u8BD5\u547D\u4EE4\n\n// 3. \u7C7B\u578B\u68C0\u67E5\nbash(\"tsc --noEmit\") // \u6216\u9002\u5F53\u7684\u7C7B\u578B\u68C0\u67E5\n```\n\n### \u6B65\u9AA4\u5B8C\u6210\n1. \u5982\u679C\u9A8C\u8BC1\u901A\u8FC7 \u2192 \u5C06\u6B65\u9AA4 todo \u6807\u8BB0\u4E3A `completed`\n2. \u5982\u679C\u9A8C\u8BC1\u5931\u8D25 \u2192 **\u505C\u6B62\u5E76\u4FEE\u590D**\n\n## 5.2\uFF1A\u5931\u8D25\u6062\u590D\u534F\u8BAE\n\n\u5982\u679C\u4EFB\u4F55\u9A8C\u8BC1\u5931\u8D25\uFF1A\n\n1. **\u7ACB\u5373\u505C\u6B62**\n2. **\u56DE\u6EDA**\u5931\u8D25\u7684\u53D8\u66F4\n3. **\u8BCA\u65AD**\u95EE\u9898\u6240\u5728\n4. **\u9009\u9879**\uFF1A\n - \u4FEE\u590D\u95EE\u9898\u5E76\u91CD\u8BD5\n - \u8DF3\u8FC7\u6B64\u6B65\u9AA4\uFF08\u5982\u53EF\u9009\uFF09\n - \u54A8\u8BE2 oracle agent\n - \u5411\u7528\u6237\u5BFB\u6C42\u6307\u5BFC\n\n**\u6C38\u8FDC\u4E0D\u8981\u5728\u6D4B\u8BD5\u5931\u8D25\u7684\u60C5\u51B5\u4E0B\u7EE7\u7EED\u4E0B\u4E00\u6B65\u3002**\n\n## 5.3\uFF1A\u63D0\u4EA4\u68C0\u67E5\u70B9\n\n\u5728\u6BCF\u7EC4\u903B\u8F91\u53D8\u66F4\u4E4B\u540E\uFF1A\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**\u6240\u6709\u91CD\u6784\u6B65\u9AA4\u5B8C\u6210\u540E\uFF0C\u5C06 phase-5 \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n# \u9636\u6BB5 6\uFF1A\u6700\u7EC8\u9A8C\u8BC1\uFF08\u56DE\u5F52\u68C0\u67E5\uFF09\n\n**\u5C06 phase-6 \u6807\u8BB0\u4E3A in_progress\u3002**\n\n## 6.1\uFF1A\u5B8C\u6574\u6D4B\u8BD5\u5957\u4EF6\n\n```bash\n# \u8FD0\u884C\u5B8C\u6574\u6D4B\u8BD5\u5957\u4EF6\nbun test # \u6216 npm test, pytest, go test, \u7B49\n```\n\n## 6.2\uFF1A\u7C7B\u578B\u68C0\u67E5\n\n```bash\n# \u5B8C\u6574\u7C7B\u578B\u68C0\u67E5\ntsc --noEmit # \u6216\u7B49\u6548\u547D\u4EE4\n```\n\n## 6.3\uFF1ALint \u68C0\u67E5\n\n```bash\n# \u8FD0\u884C linter\neslint . # \u6216\u7B49\u6548\u547D\u4EE4\n```\n\n## 6.4\uFF1A\u6784\u5EFA\u9A8C\u8BC1\uFF08\u5982\u9002\u7528\uFF09\n\n```bash\n# \u786E\u4FDD\u6784\u5EFA\u4ECD\u7136\u6B63\u5E38\nbun run build # \u6216 npm run build, \u7B49\n```\n\n## 6.5\uFF1A\u6700\u7EC8\u8BCA\u65AD\n\n```typescript\n// \u68C0\u67E5\u6240\u6709\u53D8\u66F4\u7684\u6587\u4EF6\nfor (file of changedFiles) {\n lsp_diagnostics(file) // \u5FC5\u987B\u5168\u90E8\u6E05\u6D01\n}\n```\n\n## 6.6\uFF1A\u751F\u6210\u6458\u8981\n\n```markdown\n## \u91CD\u6784\u5B8C\u6210\n\n### \u53D8\u66F4\u5185\u5BB9\n- [\u6240\u505A\u53D8\u66F4\u5217\u8868]\n\n### \u4FEE\u6539\u7684\u6587\u4EF6\n- `path/to/file.ts` - [\u53D8\u66F4\u5185\u5BB9]\n- `path/to/file2.ts` - [\u53D8\u66F4\u5185\u5BB9]\n\n### \u9A8C\u8BC1\u7ED3\u679C\n- \u6D4B\u8BD5\uFF1A\u5DF2\u901A\u8FC7\uFF08X/Y \u901A\u8FC7\uFF09\n- \u7C7B\u578B\u68C0\u67E5\uFF1A\u6E05\u6D01\n- Lint\uFF1A\u6E05\u6D01\n- \u6784\u5EFA\uFF1A\u6210\u529F\n\n### \u672A\u68C0\u6D4B\u5230\u56DE\u5F52\n\u6240\u6709\u73B0\u6709\u6D4B\u8BD5\u5747\u901A\u8FC7\u3002\u65E0\u65B0\u589E\u9519\u8BEF\u3002\n```\n\n**\u5C06 phase-6 \u6807\u8BB0\u4E3A completed\u3002**\n\n---\n\n# \u5173\u952E\u89C4\u5219\n\n## \u7981\u6B62\u4E8B\u9879\n- \u53D8\u66F4\u540E\u8DF3\u8FC7 lsp_diagnostics \u68C0\u67E5\n- \u5728\u6D4B\u8BD5\u5931\u8D25\u7684\u60C5\u51B5\u4E0B\u7EE7\u7EED\n- \u4E0D\u4E86\u89E3\u5F71\u54CD\u5C31\u8FDB\u884C\u4FEE\u6539\n- \u4F7F\u7528 `as any`\u3001`@ts-ignore`\u3001`@ts-expect-error`\n- \u5220\u9664\u6D4B\u8BD5\u4F7F\u5176\u901A\u8FC7\n- \u63D0\u4EA4\u6709\u95EE\u9898\u7684\u4EE3\u7801\n- \u4E0D\u4E86\u89E3\u73B0\u6709\u6A21\u5F0F\u5C31\u91CD\u6784\n\n## \u5FC5\u505A\u4E8B\u9879\n- \u6539\u524D\u5148\u7406\u89E3\n- \u5E94\u7528\u524D\u5148\u9884\u89C8\uFF08ast_grep dryRun=true\uFF09\n- \u6BCF\u6B21\u53D8\u66F4\u540E\u9A8C\u8BC1\n- \u9075\u5FAA\u73B0\u6709\u4EE3\u7801\u5E93\u6A21\u5F0F\n- \u5B9E\u65F6\u66F4\u65B0 todos\n- \u5728\u903B\u8F91\u68C0\u67E5\u70B9\u63D0\u4EA4\n- \u7ACB\u5373\u62A5\u544A\u95EE\u9898\n\n## \u4E2D\u6B62\u6761\u4EF6\n\u5982\u679C\u53D1\u751F\u4EE5\u4E0B\u4EFB\u4F55\u60C5\u51B5\uFF0C**\u505C\u6B62\u5E76\u54A8\u8BE2\u7528\u6237**\uFF1A\n- \u76EE\u6807\u4EE3\u7801\u7684\u6D4B\u8BD5\u8986\u76D6\u7387\u4E3A\u96F6\n- \u53D8\u66F4\u4F1A\u7834\u574F public API\n- \u91CD\u6784\u8303\u56F4\u4E0D\u6E05\u6670\n- \u8FDE\u7EED 3 \u6B21\u9A8C\u8BC1\u5931\u8D25\n- \u7528\u6237\u5B9A\u4E49\u7684\u7EA6\u675F\u88AB\u8FDD\u53CD\n\n---\n\n# \u5DE5\u5177\u4F7F\u7528\u7406\u5FF5\n\n\u4F60\u5DF2\u4E86\u89E3\u8FD9\u4E9B\u5DE5\u5177\u3002\u8BF7\u660E\u667A\u5730\u4F7F\u7528\u5B83\u4EEC\uFF1A\n\n## LSP \u5DE5\u5177\n\u5229\u7528 LSP \u5DE5\u5177\u8FDB\u884C\u7CBE\u786E\u5206\u6790\u3002\u5173\u952E\u6A21\u5F0F\uFF1A\n- **\u6539\u524D\u5148\u7406\u89E3**\uFF1A\u4F7F\u7528 `LspGotoDefinition` \u7406\u89E3\u4E0A\u4E0B\u6587\n- **\u5F71\u54CD\u5206\u6790**\uFF1A\u4FEE\u6539\u524D\u4F7F\u7528 `LspFindReferences` \u6620\u5C04\u6240\u6709\u7528\u6CD5\n- **\u5B89\u5168\u91CD\u6784**\uFF1A\u7B26\u53F7\u91CD\u547D\u540D\u4F7F\u7528 `lsp_prepare_rename` \u2192 `lsp_rename`\n- **\u6301\u7EED\u9A8C\u8BC1**\uFF1A\u6BCF\u6B21\u53D8\u66F4\u540E\u4F7F\u7528 `lsp_diagnostics`\n\n## AST-Grep\n\u4F7F\u7528 `ast_grep_search` \u548C `ast_grep_replace` \u8FDB\u884C\u7ED3\u6784\u8F6C\u6362\u3002\n**\u5173\u952E**\uFF1A\u59CB\u7EC8\u5148\u7528 `dryRun=true` \u9884\u89C8\uFF0C\u5BA1\u67E5\u540E\u518D\u6267\u884C\u3002\n\n## Agents\n- `explore`\uFF1A\u5E76\u884C\u4EE3\u7801\u5E93\u6A21\u5F0F\u53D1\u73B0\n- `plan`\uFF1A\u8BE6\u7EC6\u91CD\u6784\u8BA1\u5212\u751F\u6210\n- `oracle`\uFF1A\u7528\u4E8E\u590D\u6742\u67B6\u6784\u51B3\u7B56\u548C\u8C03\u8BD5\u7684\u53EA\u8BFB\u54A8\u8BE2\n- `librarian`\uFF1A\u9047\u5230\u5F03\u7528\u65B9\u6CD5\u6216\u5E93\u8FC1\u79FB\u4EFB\u52A1\u65F6**\u4E3B\u52A8\u4F7F\u7528**\u3002\u67E5\u8BE2\u5B98\u65B9\u6587\u6863\u548C\u5F00\u6E90\u793A\u4F8B\u4EE5\u83B7\u53D6\u73B0\u4EE3\u66FF\u4EE3\u65B9\u6848\u3002\n\n## \u5F03\u7528\u4EE3\u7801\u4E0E\u5E93\u8FC1\u79FB\n\u5728\u91CD\u6784\u8FC7\u7A0B\u4E2D\u9047\u5230\u5F03\u7528\u7684\u65B9\u6CD5/API \u65F6\uFF1A\n1. \u542F\u52A8 `librarian` \u67E5\u627E\u63A8\u8350\u7684\u73B0\u4EE3\u66FF\u4EE3\u65B9\u6848\n2. **\u9664\u975E\u7528\u6237\u660E\u786E\u8981\u6C42\u8FC1\u79FB\uFF0C\u5426\u5219\u4E0D\u8981\u81EA\u52A8\u5347\u7EA7\u5230\u6700\u65B0\u7248\u672C**\n3. \u5982\u679C\u7528\u6237\u8981\u6C42\u5E93\u8FC1\u79FB\uFF0C\u5728\u8FDB\u884C\u66F4\u6539\u4E4B\u524D\u4F7F\u7528 `librarian` \u83B7\u53D6\u6700\u65B0\u7684 API \u6587\u6863\n\n---\n\n**\u8BB0\u4F4F\uFF1A\u6CA1\u6709\u6D4B\u8BD5\u7684\u91CD\u6784\u662F\u9C81\u83BD\u7684\u3002\u6CA1\u6709\u7406\u89E3\u7684\u91CD\u6784\u662F\u7834\u574F\u6027\u7684\u3002\u6B64\u547D\u4EE4\u786E\u4FDD\u4F60\u4E24\u8005\u90FD\u4E0D\u4F1A\u505A\u3002**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
|
|
1
|
+
export declare const REFACTOR_TEMPLATE = "# Intelligent Refactor Command\n\n## Usage\n```\n/refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\nArguments:\n refactoring-target: What to refactor. Can be:\n - File path: src/auth/handler.ts\n - Symbol name: \"AuthService class\"\n - Pattern: \"all functions using deprecated API\"\n - Description: \"extract validation logic into separate module\"\n\nOptions:\n --scope: Refactoring scope (default: module)\n - file: Single file only\n - module: Module/directory scope\n - project: Entire codebase\n\n --strategy: Risk tolerance (default: safe)\n - safe: Conservative, maximum test coverage required\n - aggressive: Allow broader changes with adequate coverage\n```\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file/symbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules/files?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file/module/project)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n```\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n```\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using `call_omo_agent`:\n\n```\n// Agent 1: Find the refactoring target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET]. \n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: Find related code\ncall_omo_agent(\n subagent_type=\"explore\", \n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: Find similar patterns\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: Find tests\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: Architecture context\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n```typescript\n// Find definition(s)\nLspGotoDefinition(filePath, line, character) // Where is it defined?\n\n// Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n// Get file structure\nLspDocumentSymbols(filePath) // Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\") // Search by name\n\n// Get current diagnostics\nlsp_diagnostics(filePath) // Errors, warnings before we start\n```\n\n### AST-Grep for Pattern Analysis:\n\n```typescript\n// Find structural patterns\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // or relevant pattern\n lang=\"typescript\", // or relevant language\n paths=[\"src/\"]\n)\n\n// Preview refactoring (DRY RUN)\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // ALWAYS preview first\n)\n```\n\n### Grep for Text Patterns:\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3: Collect Background Results\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n```\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- `path/to/file.ts:L10-L50` - Primary definition\n- `path/to/file2.ts:L25` - Key usage\n\n### Dependency Graph\n```\n[TARGET] \n\u251C\u2500\u2500 imports from: \n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 imported by:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 used by:\n \u251C\u2500\u2500 handler.ts (direct call)\n \u2514\u2500\u2500 service.ts (dependency injection)\n```\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n```\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n```bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n```\n\n## 3.2: Analyze Test Coverage\n\n```\n// Find all tests related to target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=false, // Need this synchronously\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (<50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n```\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n```\n\n## 3.4: Document Verification Plan\n\n```\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: `bun test` / `npm test` / `pytest` / etc.\n- Integration: [command if exists]\n- Type check: `tsc --noEmit` / `pyright` / etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics \u2192 zero new errors\n2. Run test command \u2192 all pass\n3. Type check \u2192 clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n```\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n```\nTodoWrite([\n // Each step from the plan becomes a todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... continue for all steps\n])\n```\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as `in_progress`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n```typescript\nlsp_prepare_rename(filePath, line, character) // Validate rename is possible\nlsp_rename(filePath, line, character, newName) // Execute rename\n```\n\n**For Pattern Transformations:**\n```typescript\n// Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**For Structural Changes:**\n```typescript\n// Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n```\n\n### Post-Step Verification (MANDATORY)\n\n```typescript\n// 1. Check diagnostics\nlsp_diagnostics(filePath) // Must be clean or same as baseline\n\n// 2. Run tests\nbash(\"bun test\") // Or appropriate test command\n\n// 3. Type check\nbash(\"tsc --noEmit\") // Or appropriate type check\n```\n\n### Step Completion\n1. If verification passes \u2192 Mark step todo as `completed`\n2. If verification fails \u2192 **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n - Fix the issue and retry\n - Skip this step (if optional)\n - Consult oracle agent for help\n - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n```bash\n# Run complete test suite\nbun test # or npm test, pytest, go test, etc.\n```\n\n## 6.2: Type Check\n\n```bash\n# Full type check\ntsc --noEmit # or equivalent\n```\n\n## 6.3: Lint Check\n\n```bash\n# Run linter\neslint . # or equivalent\n```\n\n## 6.4: Build Verification (if applicable)\n\n```bash\n# Ensure build still works\nbun run build # or npm run build, etc.\n```\n\n## 6.5: Final Diagnostics\n\n```typescript\n// Check all changed files\nfor (file of changedFiles) {\n lsp_diagnostics(file) // Must all be clean\n}\n```\n\n## 6.6: Generate Summary\n\n```markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- `path/to/file.ts` - [what changed]\n- `path/to/file2.ts` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X/Y passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n```\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use `as any`, `@ts-ignore`, `@ts-expect-error`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: `LspGotoDefinition` to grasp context\n- **Impact analysis**: `LspFindReferences` to map all usages before modification\n- **Safe refactoring**: `lsp_prepare_rename` \u2192 `lsp_rename` for symbol renames\n- **Continuous verification**: `lsp_diagnostics` after every change\n\n## AST-Grep\nUse `ast_grep_search` and `ast_grep_replace` for structural transformations.\n**Critical**: Always `dryRun=true` first, review, then execute.\n\n## Agents\n- `explore`: Parallel codebase pattern discovery\n- `plan`: Detailed refactoring plan generation\n- `oracle`: Read-only consultation for complex architectural decisions and debugging\n- `librarian`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods/APIs during refactoring:\n1. Fire `librarian` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use `librarian` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const REMOVE_AI_SLOPS_TEMPLATE = "#
|
|
1
|
+
export declare const REMOVE_AI_SLOPS_TEMPLATE = "# Remove AI Slops Command\n\n## What this command does\nAnalyzes all files changed in the current branch (compared to parent commit), removes AI-generated code smells in parallel, then critically reviews the changes to ensure safety and behavior preservation. Fixes any issues found during review.\n\n## Step 0: Task Planning\n\nUse TodoWrite to create the task list:\n1. Get changed files from branch\n2. Run ai-slop-remover on each file in parallel\n3. Critically review all changes\n4. Fix any issues found\n\n## Role Definition\nYou are a senior code quality engineer specialized in identifying and removing AI-generated code patterns while preserving original functionality. You have deep expertise in code review, refactoring safety, and behavioral preservation.\n\n## Process\n\n### Phase 1: Identify Changed Files\nDetect the repository base branch dynamically, then get all changed files in the current branch:\n```bash\nBASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo \"main\")\ngit diff $(git merge-base \"$BASE_BRANCH\" HEAD)..HEAD --name-only\n```\n\nIf `git symbolic-ref refs/remotes/origin/HEAD` is unavailable, detect the base branch at runtime using the repo's configured remote default branch. Only fall back to `main` as a last resort.\n\n### Phase 2: Parallel AI Slop Removal\nFor each changed file, spawn an agent in parallel using the Task tool with the ai-slop-remover skill:\n\n```\ntask(category=\"quick\", load_skills=[\"ai-slop-remover\"], run_in_background=true, description=\"Remove AI slops from {filename}\", prompt=\"Remove AI slops from: {file_path}\")\n```\n\n**CRITICAL**: Launch ALL agents in a SINGLE message with multiple Task tool calls for maximum parallelism.\n\nBefore running ai-slop-remover on each file, save a file-specific rollback artifact that captures only the delta introduced by the slop-removal pass. Use a safe pattern such as generating a per-file patch and reverse-applying it if review fails.\n\nDo NOT use `git checkout -- {file_path}` or any rollback that discards pre-existing branch changes in the file.\n\n### Phase 3: Critical Review\nAfter all ai-slop-remover agents complete, perform a critical review with the following checklist:\n\n**Safety Verification**:\n- [ ] No functional logic was accidentally removed\n- [ ] All error handling is preserved\n- [ ] Type hints remain correct and complete\n- [ ] Import statements are still valid\n- [ ] No breaking changes to public APIs\n\n**Behavior Preservation**:\n- [ ] Return values unchanged\n- [ ] Side effects unchanged\n- [ ] Exception behavior unchanged\n- [ ] Edge case handling preserved\n\n**Code Quality**:\n- [ ] Removed changes are genuinely AI slop (not intentional patterns)\n- [ ] Remaining code follows project conventions\n- [ ] No orphaned code or dead references\n\n### Phase 4: Fix Issues\nIf any issues are found during critical review:\n1. Identify the specific problem\n2. Explain why it's a problem\n3. Revert only the ai-slop-remover delta using the saved per-file patch or an equivalent reverse-apply workflow\n4. If remaining ai-slops are found after reverting, remove them by editing the file yourself - with parallel tool calls, per-file\n5. Verify the fix doesn't introduce new issues\n\n## Output Format\n\n### Summary Report\n```\n## AI Slop Removal Summary\n\n### Files Processed\n- file1.py: X changes\n- file2.py: Y changes\n\n### Critical Review Results\n- Safety: PASS/FAIL\n- Behavior: PASS/FAIL\n- Quality: PASS/FAIL\n\n### Issues Found & Fixed\n1. [Issue description] -> [Fix applied]\n\n### Final Status\n[CLEAN / ISSUES FIXED / REQUIRES ATTENTION]\n```\n\n## Quality Assurance\n- NEVER remove code that serves a functional purpose\n- ALWAYS verify changes compile/parse correctly\n- ALWAYS preserve test coverage\n- If uncertain about a change, err on the side of keeping the original code";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const START_WORK_TEMPLATE = "
|
|
1
|
+
export declare const START_WORK_TEMPLATE = "You are starting a Sisyphus work session.\n\n## ARGUMENTS\n\n- `/start-work [plan-name] [--worktree <path>]`\n - `plan-name` (optional): name or partial match of the plan to start\n - `--worktree <path>` (optional): absolute path to an existing git worktree to work in\n - If specified and valid: hook pre-sets worktree_path in boulder.json\n - If specified but invalid: you must run `git worktree add <path> <branch>` first\n - If omitted: work directly in the current project directory (no worktree)\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Prometheus-generated plan files at `.sisyphus/plans/`\n\n2. **Check for active boulder state**: Read `.sisyphus/boulder.json` if it exists\n\n3. **Decision logic**:\n - If `.sisyphus/boulder.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Worktree Setup** (ONLY when `--worktree` was explicitly specified and `worktree_path` not already set in boulder.json):\n 1. `git worktree list --porcelain` - see available worktrees\n 2. Create: `git worktree add <absolute-path> <branch-or-HEAD>`\n 3. Update boulder.json to add `\"worktree_path\": \"<absolute-path>\"`\n 4. All work happens inside that worktree directory\n\n5. **Create/Update boulder.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\",\n \"worktree_path\": \"/absolute/path/to/git/worktree\"\n }\n ```\n\n6. **Read the plan file** and start executing tasks according to atlas workflow\n\n## OUTPUT FORMAT\n\nWhen listing plans for selection:\n```\nAvailable Work Plans\n\nCurrent Time: {ISO timestamp}\nSession ID: {current session id}\n\n1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks\n2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks\n\nWhich plan would you like to work on? (Enter number or plan name)\n```\n\nWhen resuming existing work:\n```\nResuming Work Session\n\nActive Plan: {plan-name}\nProgress: {completed}/{total} tasks\nSessions: {count} (appending current session)\nWorktree: {worktree_path}\n\nReading plan and continuing from last incomplete task...\n```\n\nWhen auto-selecting single plan:\n```\nStarting Work Session\n\nPlan: {plan-name}\nSession ID: {session_id}\nStarted: {timestamp}\nWorktree: {worktree_path}\n\nReading plan and beginning execution...\n```\n\n## CRITICAL\n\n- The session_id is injected by the hook - use it directly\n- Always update boulder.json BEFORE starting work\n- If worktree_path is set in boulder.json, all work happens inside that worktree directory\n- Read the FULL plan file before delegating any tasks\n- Follow atlas delegation protocols (7-section format)\n\n## TASK BREAKDOWN (MANDATORY)\n\nAfter reading the plan file, you MUST decompose every plan task into granular, implementation-level sub-steps and register ALL of them as task/todo items BEFORE starting any work.\n\n**How to break down**:\n- Each plan checkbox item (e.g., `- [ ] Add user authentication`) must be split into concrete, actionable sub-tasks\n- Sub-tasks should be specific enough that each one touches a clear set of files/functions\n- Include: file to modify, what to change, expected behavior, and how to verify\n- Do NOT leave any task vague - \"implement feature X\" is NOT acceptable; \"add validateToken() to src/auth/middleware.ts that checks JWT expiry and returns 401\" IS acceptable\n\n**Example breakdown**:\nPlan task: `- [ ] Add rate limiting to API`\n\u2192 Todo items:\n 1. Create `src/middleware/rate-limiter.ts` with sliding window algorithm (max 100 req/min per IP)\n 2. Add RateLimiter middleware to `src/app.ts` router chain, before auth middleware\n 3. Add rate limit headers (X-RateLimit-Limit, X-RateLimit-Remaining) to response in `rate-limiter.ts`\n 4. Add test: verify 429 response after exceeding limit in `src/middleware/rate-limiter.test.ts`\n 5. Add test: verify headers are present on normal responses\n\nRegister these as task/todo items so progress is tracked and visible throughout the session.\n\n## WORKTREE COMPLETION\n\nWhen working in a worktree (`worktree_path` is set in boulder.json) and ALL plan tasks are complete:\n1. Commit all remaining changes in the worktree\n2. **Sync .sisyphus state back**: Copy `.sisyphus/` from the worktree to the main repo before removal.\n This is CRITICAL when `.sisyphus/` is gitignored - state written during worktree execution would otherwise be lost.\n ```bash\n cp -r <worktree-path>/.sisyphus/* <main-repo>/.sisyphus/ 2>/dev/null || true\n ```\n3. Switch to the main working directory (the original repo, NOT the worktree)\n4. Merge the worktree branch into the current branch: `git merge <worktree-branch>`\n5. If merge succeeds, clean up: `git worktree remove <worktree-path>`\n6. Remove the boulder.json state\n\nThis is the DEFAULT behavior when `--worktree` was used. Skip merge only if the user explicitly instructs otherwise (e.g., asks to create a PR instead).";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const STOP_CONTINUATION_TEMPLATE = "
|
|
1
|
+
export declare const STOP_CONTINUATION_TEMPLATE = "Stop all continuation mechanisms for the current session.\n\nThis command will:\n1. Stop the todo-continuation-enforcer from automatically continuing incomplete tasks\n2. Cancel any active Ralph Loop\n3. Clear the boulder state for the current project\n\nAfter running this command:\n- The session will not auto-continue when idle\n- You can manually continue work when ready\n- The stop state is per-session and clears when the session ends\n\nUse this when you need to pause automated continuation and take manual control.";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const DIRECT_WORK_REMINDER: string;
|
|
2
2
|
export declare const BOULDER_CONTINUATION_PROMPT: string;
|
|
3
|
-
export declare const VERIFICATION_REMINDER = "**SUBAGENT
|
|
4
|
-
export declare const VERIFICATION_REMINDER_GEMINI = "**SUBAGENT
|
|
3
|
+
export declare const VERIFICATION_REMINDER = "**THE SUBAGENT JUST CLAIMED THIS TASK IS DONE. THEY ARE PROBABLY LYING.**\n\nSubagents say \"done\" when code has errors, tests pass trivially, logic is wrong,\nor they quietly added features nobody asked for. This happens EVERY TIME.\nAssume the work is broken until YOU prove otherwise.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (before running anything)**\n\nDo NOT run tests yet. Read the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat -- ':!node_modules'\")` - see exactly which files changed. Any file outside expected scope = scope creep.\n2. `Read` EVERY changed file - no exceptions, no skimming.\n3. For EACH file, critically ask:\n - Does this code ACTUALLY do what the task required? (Re-read the task, compare line by line)\n - Any stubs, TODOs, placeholders, hardcoded values? (`Grep` for TODO, FIXME, HACK, xxx)\n - Logic errors? Trace the happy path AND the error path in your head.\n - Anti-patterns? (`Grep` for `as any`, `@ts-ignore`, empty catch, console.log in changed files)\n - Scope creep? Did the subagent touch things or add features NOT in the task spec?\n4. Cross-check every claim:\n - Said \"Updated X\" - READ X. Actually updated, or just superficially touched?\n - Said \"Added tests\" - READ the tests. Do they test REAL behavior or just `expect(true).toBe(true)`?\n - Said \"Follows patterns\" - OPEN a reference file. Does it ACTUALLY match?\n\n**If you cannot explain what every changed line does, you have NOT reviewed it.**\n\n**PHASE 2: RUN AUTOMATED CHECKS (targeted, then broad)**\n\nNow that you understand the code, verify mechanically:\n1. `lsp_diagnostics` on EACH changed file - ZERO new errors\n2. Run tests for changed modules FIRST, then full suite\n3. Build/typecheck - exit 0\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. The code has bugs that tests don't cover. Fix the code.\n\n**PHASE 3: HANDS-ON QA - ACTUALLY RUN IT (MANDATORY for user-facing changes)**\n\nTests and linters CANNOT catch: visual bugs, wrong CLI output, broken user flows, API response shape issues.\n\n**If this task produced anything a user would SEE or INTERACT with, you MUST launch it and verify yourself.**\n\n- **Frontend/UI**: `/playwright` skill - load the page, click through the flow, check console. Verify: page loads, interactions work, console clean, responsive.\n- **TUI/CLI**: `interactive_bash` - run the command, try good input, try bad input, try --help. Verify: command runs, output correct, error messages helpful, edge inputs handled.\n- **API/Backend**: `Bash` with curl - hit the endpoint, check response body, send malformed input. Verify: returns 200, body correct, error cases return proper errors.\n- **Config/Build**: Actually start the service or import the config. Verify: loads without error, backward compatible.\n\nThis is NOT optional \"if applicable\". If the deliverable is user-facing and you did not run it, you are shipping untested work.\n\n**PHASE 4: GATE DECISION - Should you proceed to the next task?**\n\nAnswer honestly:\n1. Can I explain what EVERY changed line does? (If no - back to Phase 1)\n2. Did I SEE it work with my own eyes? (If user-facing and no - back to Phase 3)\n3. Am I confident nothing existing is broken? (If no - run broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO. Investigate until CERTAIN.\n\n- **All 3 YES** - Proceed: mark task complete, move to next.\n- **Any NO** - Reject: resume session with `session_id`, fix the specific issue.\n- **Unsure** - Reject: \"unsure\" = \"no\". Investigate until you have a definitive answer.\n\n**DO NOT proceed to the next task until all 4 phases are complete and the gate passes.**";
|
|
4
|
+
export declare const VERIFICATION_REMINDER_GEMINI = "**THE SUBAGENT HAS FINISHED. THEIR WORK IS EXTREMELY SUSPICIOUS.**\n\nThe subagent CLAIMS this task is done. Based on thousands of executions, subagent claims are FALSE more often than true.\nThey ROUTINELY:\n- Ship code with syntax errors they didn't bother to check\n- Create stub implementations with TODOs and call it \"done\"\n- Write tests that pass trivially (testing nothing meaningful)\n- Implement logic that does NOT match what was requested\n- Add features nobody asked for and call it \"improvement\"\n- Report \"all tests pass\" when they didn't run any tests\n\n**This is NOT a theoretical warning. This WILL happen on this task. Assume the work is BROKEN.**\n\n**YOU MUST VERIFY WITH ACTUAL TOOL CALLS. NOT REASONING. TOOL CALLS.**\nThinking \"it looks correct\" is NOT verification. Running `lsp_diagnostics` IS.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (DO NOT SKIP - DO NOT RUN TESTS YET)**\n\nRead the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat -- ':!node_modules'\")` - see exactly which files changed.\n2. `Read` EVERY changed file - no exceptions, no skimming.\n3. For EACH file:\n - Does this code ACTUALLY do what the task required? RE-READ the task spec.\n - Any stubs, TODOs, placeholders? `Grep` for TODO, FIXME, HACK, xxx\n - Anti-patterns? `Grep` for `as any`, `@ts-ignore`, empty catch\n - Scope creep? Did the subagent add things NOT in the task spec?\n4. Cross-check EVERY claim against actual code.\n\n**If you cannot explain what every changed line does, GO BACK AND READ AGAIN.**\n\n**PHASE 2: RUN AUTOMATED CHECKS**\n\n1. `lsp_diagnostics` on EACH changed file - ZERO new errors. ACTUALLY RUN THIS.\n2. Run tests for changed modules, then full suite. ACTUALLY RUN THESE.\n3. Build/typecheck - exit 0.\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. Fix the code.\n\n**PHASE 3: HANDS-ON QA (MANDATORY for user-facing changes)**\n\n- **Frontend/UI**: `/playwright`\n- **TUI/CLI**: `interactive_bash`\n- **API/Backend**: `Bash` with curl\n\n**If user-facing and you did not run it, you are shipping UNTESTED BROKEN work.**\n\n**PHASE 4: GATE DECISION**\n\n1. Can I explain what EVERY changed line does? (If no \u2192 Phase 1)\n2. Did I SEE it work via tool calls? (If user-facing and no \u2192 Phase 3)\n3. Am I confident nothing is broken? (If no \u2192 broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO.\n\n**DO NOT proceed to the next task until all 4 phases are complete.**";
|
|
5
5
|
export declare const ORCHESTRATOR_DELEGATION_REQUIRED: string;
|
|
6
6
|
export declare const SINGLE_TASK_DIRECTIVE: string;
|