oh-my-opencode 3.0.0-beta.1 → 3.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.ja.md +109 -89
  2. package/README.md +113 -104
  3. package/README.zh-cn.md +664 -511
  4. package/bin/oh-my-opencode.js +80 -0
  5. package/bin/platform.js +38 -0
  6. package/bin/platform.test.ts +148 -0
  7. package/dist/agents/metis.d.ts +1 -0
  8. package/dist/agents/momus.d.ts +1 -1
  9. package/dist/agents/orchestrator-sisyphus.d.ts +3 -2
  10. package/dist/agents/prometheus-prompt.d.ts +3 -1
  11. package/dist/agents/sisyphus-junior.d.ts +6 -1
  12. package/dist/agents/types.d.ts +1 -0
  13. package/dist/agents/utils.d.ts +3 -2
  14. package/dist/cli/config-manager.d.ts +9 -1
  15. package/dist/cli/doctor/checks/opencode.d.ts +5 -1
  16. package/dist/cli/index.js +3886 -3763
  17. package/dist/cli/run/events.d.ts +1 -0
  18. package/dist/cli/types.d.ts +3 -0
  19. package/dist/config/schema.d.ts +538 -208
  20. package/dist/features/background-agent/concurrency.d.ts +17 -0
  21. package/dist/features/background-agent/manager.d.ts +44 -5
  22. package/dist/features/background-agent/types.d.ts +9 -1
  23. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
  24. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
  25. package/dist/features/builtin-commands/types.d.ts +1 -1
  26. package/dist/features/claude-code-session-state/state.d.ts +6 -1
  27. package/dist/features/context-injector/index.d.ts +1 -1
  28. package/dist/features/context-injector/injector.d.ts +1 -1
  29. package/dist/features/hook-message-injector/index.d.ts +2 -2
  30. package/dist/features/hook-message-injector/injector.d.ts +7 -0
  31. package/dist/features/opencode-skill-loader/skill-content.d.ts +17 -2
  32. package/dist/features/skill-mcp-manager/manager.d.ts +11 -0
  33. package/dist/features/task-toast-manager/index.d.ts +1 -1
  34. package/dist/features/task-toast-manager/manager.d.ts +2 -1
  35. package/dist/features/task-toast-manager/types.d.ts +5 -0
  36. package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
  37. package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
  38. package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +1 -2
  39. package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +0 -5
  40. package/dist/hooks/auto-update-checker/checker.d.ts +1 -1
  41. package/dist/hooks/auto-update-checker/index.d.ts +4 -0
  42. package/dist/hooks/background-compaction/index.d.ts +19 -0
  43. package/dist/hooks/background-notification/index.d.ts +6 -0
  44. package/dist/hooks/comment-checker/cli.d.ts +0 -1
  45. package/dist/hooks/compaction-context-injector/index.d.ts +7 -1
  46. package/dist/hooks/delegate-task-retry/index.d.ts +24 -0
  47. package/dist/hooks/index.d.ts +1 -2
  48. package/dist/hooks/keyword-detector/index.d.ts +2 -1
  49. package/dist/hooks/prometheus-md-only/constants.d.ts +2 -2
  50. package/dist/hooks/prometheus-md-only/index.d.ts +1 -1
  51. package/dist/hooks/ralph-loop/index.d.ts +1 -0
  52. package/dist/hooks/ralph-loop/types.d.ts +1 -0
  53. package/dist/index.js +22506 -23819
  54. package/dist/mcp/context7.d.ts +1 -0
  55. package/dist/mcp/grep-app.d.ts +1 -0
  56. package/dist/mcp/index.d.ts +1 -0
  57. package/dist/mcp/websearch.d.ts +1 -0
  58. package/dist/plugin-handlers/config-handler.d.ts +2 -0
  59. package/dist/plugin-handlers/config-handler.test.d.ts +1 -0
  60. package/dist/shared/agent-tool-restrictions.d.ts +7 -0
  61. package/dist/shared/agent-variant.d.ts +5 -0
  62. package/dist/shared/agent-variant.test.d.ts +1 -0
  63. package/dist/shared/deep-merge.test.d.ts +1 -0
  64. package/dist/shared/first-message-variant.d.ts +11 -0
  65. package/dist/shared/first-message-variant.test.d.ts +1 -0
  66. package/dist/shared/index.d.ts +6 -0
  67. package/dist/shared/migration.d.ts +1 -0
  68. package/dist/shared/opencode-version.d.ts +6 -3
  69. package/dist/shared/permission-compat.d.ts +22 -7
  70. package/dist/shared/session-cursor.d.ts +13 -0
  71. package/dist/shared/session-cursor.test.d.ts +1 -0
  72. package/dist/shared/shell-env.d.ts +41 -0
  73. package/dist/shared/shell-env.test.d.ts +1 -0
  74. package/dist/shared/system-directive.d.ts +31 -0
  75. package/dist/shared/zip-extractor.d.ts +1 -0
  76. package/dist/tools/{sisyphus-task → delegate-task}/constants.d.ts +3 -3
  77. package/dist/tools/{sisyphus-task → delegate-task}/index.d.ts +1 -1
  78. package/dist/tools/{sisyphus-task → delegate-task}/tools.d.ts +5 -3
  79. package/dist/tools/delegate-task/tools.test.d.ts +1 -0
  80. package/dist/tools/{sisyphus-task → delegate-task}/types.d.ts +1 -1
  81. package/dist/tools/glob/cli.d.ts +4 -0
  82. package/dist/tools/glob/cli.test.d.ts +1 -0
  83. package/dist/tools/glob/types.d.ts +1 -0
  84. package/dist/tools/index.d.ts +3 -1
  85. package/dist/tools/interactive-bash/constants.d.ts +1 -1
  86. package/dist/tools/look-at/tools.d.ts +7 -0
  87. package/dist/tools/look-at/tools.test.d.ts +1 -0
  88. package/dist/tools/lsp/client.d.ts +1 -3
  89. package/dist/tools/lsp/config.test.d.ts +1 -0
  90. package/dist/tools/lsp/index.d.ts +1 -1
  91. package/dist/tools/lsp/tools.d.ts +1 -6
  92. package/dist/tools/lsp/types.d.ts +0 -33
  93. package/dist/tools/lsp/utils.d.ts +1 -4
  94. package/dist/tools/skill/tools.d.ts +1 -7
  95. package/dist/tools/skill/types.d.ts +3 -0
  96. package/dist/tools/skill-mcp/types.d.ts +1 -1
  97. package/dist/tools/slashcommand/tools.d.ts +1 -7
  98. package/package.json +21 -14
  99. package/postinstall.mjs +43 -0
  100. package/dist/agents/build-prompt.d.ts +0 -31
  101. package/dist/agents/plan-prompt.d.ts +0 -64
  102. package/dist/auth/antigravity/accounts.d.ts +0 -40
  103. package/dist/auth/antigravity/browser.d.ts +0 -27
  104. package/dist/auth/antigravity/cli.d.ts +0 -2
  105. package/dist/auth/antigravity/constants.d.ts +0 -98
  106. package/dist/auth/antigravity/fetch.d.ts +0 -69
  107. package/dist/auth/antigravity/index.d.ts +0 -13
  108. package/dist/auth/antigravity/integration.test.d.ts +0 -10
  109. package/dist/auth/antigravity/message-converter.d.ts +0 -54
  110. package/dist/auth/antigravity/oauth.d.ts +0 -51
  111. package/dist/auth/antigravity/plugin.d.ts +0 -54
  112. package/dist/auth/antigravity/project.d.ts +0 -10
  113. package/dist/auth/antigravity/request.d.ts +0 -116
  114. package/dist/auth/antigravity/response.d.ts +0 -137
  115. package/dist/auth/antigravity/storage.d.ts +0 -5
  116. package/dist/auth/antigravity/thinking.d.ts +0 -278
  117. package/dist/auth/antigravity/thinking.test.d.ts +0 -10
  118. package/dist/auth/antigravity/thought-signature-store.d.ts +0 -52
  119. package/dist/auth/antigravity/token.d.ts +0 -38
  120. package/dist/auth/antigravity/tools.d.ts +0 -119
  121. package/dist/auth/antigravity/types.d.ts +0 -229
  122. package/dist/cli/ast-grep-napi.linux-x64-gnu-jfv8414z.node +0 -0
  123. package/dist/cli/ast-grep-napi.linux-x64-musl-8cj2e5cf.node +0 -0
  124. package/dist/cli/commands/auth.d.ts +0 -2
  125. package/dist/google-auth.d.ts +0 -3
  126. package/dist/google-auth.js +0 -3871
  127. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-executor.d.ts +0 -3
  128. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-purge-errors.d.ts +0 -7
  129. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-storage.d.ts +0 -2
  130. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-supersede.d.ts +0 -6
  131. package/dist/hooks/comment-checker/constants.d.ts +0 -3
  132. package/dist/hooks/comment-checker/filters/bdd.d.ts +0 -2
  133. package/dist/hooks/comment-checker/filters/directive.d.ts +0 -2
  134. package/dist/hooks/comment-checker/filters/docstring.d.ts +0 -2
  135. package/dist/hooks/comment-checker/filters/index.d.ts +0 -7
  136. package/dist/hooks/comment-checker/filters/shebang.d.ts +0 -2
  137. package/dist/hooks/comment-checker/output/formatter.d.ts +0 -2
  138. package/dist/hooks/comment-checker/output/index.d.ts +0 -2
  139. package/dist/hooks/comment-checker/output/xml-builder.d.ts +0 -2
  140. package/dist/hooks/empty-message-sanitizer/index.d.ts +0 -12
  141. package/dist/hooks/preemptive-compaction/constants.d.ts +0 -3
  142. package/dist/hooks/preemptive-compaction/index.d.ts +0 -24
  143. package/dist/hooks/preemptive-compaction/types.d.ts +0 -17
  144. package/dist/tools/ast-grep/napi.d.ts +0 -13
  145. package/dist/tools/interactive-bash/types.d.ts +0 -3
  146. /package/dist/{auth/antigravity/accounts.test.d.ts → agents/momus.test.d.ts} +0 -0
  147. /package/dist/{auth/antigravity/browser.test.d.ts → agents/prometheus-prompt.test.d.ts} +0 -0
  148. /package/dist/{auth/antigravity/cli.test.d.ts → agents/sisyphus-junior.test.d.ts} +0 -0
  149. /package/dist/{auth/antigravity/constants.test.d.ts → features/claude-code-session-state/state.test.d.ts} +0 -0
  150. /package/dist/{auth/antigravity/oauth.test.d.ts → hooks/auto-update-checker/checker.test.d.ts} +0 -0
  151. /package/dist/{auth/antigravity/request.test.d.ts → hooks/auto-update-checker/index.test.d.ts} +0 -0
  152. /package/dist/{auth/antigravity/storage.test.d.ts → hooks/comment-checker/cli.test.d.ts} +0 -0
  153. /package/dist/{auth/antigravity/token.test.d.ts → hooks/delegate-task-retry/index.test.d.ts} +0 -0
  154. /package/dist/{tools/sisyphus-task/tools.test.d.ts → plugin-config.test.d.ts} +0 -0
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ // bin/oh-my-opencode.js
3
+ // Wrapper script that detects platform and spawns the correct binary
4
+
5
+ import { spawnSync } from "node:child_process";
6
+ import { createRequire } from "node:module";
7
+ import { getPlatformPackage, getBinaryPath } from "./platform.js";
8
+
9
+ const require = createRequire(import.meta.url);
10
+
11
+ /**
12
+ * Detect libc family on Linux
13
+ * @returns {string | null} 'glibc', 'musl', or null if detection fails
14
+ */
15
+ function getLibcFamily() {
16
+ if (process.platform !== "linux") {
17
+ return undefined; // Not needed on non-Linux
18
+ }
19
+
20
+ try {
21
+ const detectLibc = require("detect-libc");
22
+ return detectLibc.familySync();
23
+ } catch {
24
+ // detect-libc not available
25
+ return null;
26
+ }
27
+ }
28
+
29
+ function main() {
30
+ const { platform, arch } = process;
31
+ const libcFamily = getLibcFamily();
32
+
33
+ // Get platform package name
34
+ let pkg;
35
+ try {
36
+ pkg = getPlatformPackage({ platform, arch, libcFamily });
37
+ } catch (error) {
38
+ console.error(`\noh-my-opencode: ${error.message}\n`);
39
+ process.exit(1);
40
+ }
41
+
42
+ // Resolve binary path
43
+ const binRelPath = getBinaryPath(pkg, platform);
44
+
45
+ let binPath;
46
+ try {
47
+ binPath = require.resolve(binRelPath);
48
+ } catch {
49
+ console.error(`\noh-my-opencode: Platform binary not installed.`);
50
+ console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
51
+ console.error(`Expected package: ${pkg}`);
52
+ console.error(`\nTo fix, run:`);
53
+ console.error(` npm install ${pkg}\n`);
54
+ process.exit(1);
55
+ }
56
+
57
+ // Spawn the binary
58
+ const result = spawnSync(binPath, process.argv.slice(2), {
59
+ stdio: "inherit",
60
+ });
61
+
62
+ // Handle spawn errors
63
+ if (result.error) {
64
+ console.error(`\noh-my-opencode: Failed to execute binary.`);
65
+ console.error(`Error: ${result.error.message}\n`);
66
+ process.exit(2);
67
+ }
68
+
69
+ // Handle signals
70
+ if (result.signal) {
71
+ const signalNum = result.signal === "SIGTERM" ? 15 :
72
+ result.signal === "SIGKILL" ? 9 :
73
+ result.signal === "SIGINT" ? 2 : 1;
74
+ process.exit(128 + signalNum);
75
+ }
76
+
77
+ process.exit(result.status ?? 1);
78
+ }
79
+
80
+ main();
@@ -0,0 +1,38 @@
1
+ // bin/platform.js
2
+ // Shared platform detection module - used by wrapper and postinstall
3
+
4
+ /**
5
+ * Get the platform-specific package name
6
+ * @param {{ platform: string, arch: string, libcFamily?: string | null }} options
7
+ * @returns {string} Package name like "oh-my-opencode-darwin-arm64"
8
+ * @throws {Error} If libc cannot be detected on Linux
9
+ */
10
+ export function getPlatformPackage({ platform, arch, libcFamily }) {
11
+ let suffix = "";
12
+ if (platform === "linux") {
13
+ if (libcFamily === null || libcFamily === undefined) {
14
+ throw new Error(
15
+ "Could not detect libc on Linux. " +
16
+ "Please ensure detect-libc is installed or report this issue."
17
+ );
18
+ }
19
+ if (libcFamily === "musl") {
20
+ suffix = "-musl";
21
+ }
22
+ }
23
+
24
+ // Map platform names: win32 -> windows (for package name)
25
+ const os = platform === "win32" ? "windows" : platform;
26
+ return `oh-my-opencode-${os}-${arch}${suffix}`;
27
+ }
28
+
29
+ /**
30
+ * Get the path to the binary within a platform package
31
+ * @param {string} pkg Package name
32
+ * @param {string} platform Process platform
33
+ * @returns {string} Relative path like "oh-my-opencode-darwin-arm64/bin/oh-my-opencode"
34
+ */
35
+ export function getBinaryPath(pkg, platform) {
36
+ const ext = platform === "win32" ? ".exe" : "";
37
+ return `${pkg}/bin/oh-my-opencode${ext}`;
38
+ }
@@ -0,0 +1,148 @@
1
+ // bin/platform.test.ts
2
+ import { describe, expect, test } from "bun:test";
3
+ import { getPlatformPackage, getBinaryPath } from "./platform.js";
4
+
5
+ describe("getPlatformPackage", () => {
6
+ // #region Darwin platforms
7
+ test("returns darwin-arm64 for macOS ARM64", () => {
8
+ // #given macOS ARM64 platform
9
+ const input = { platform: "darwin", arch: "arm64" };
10
+
11
+ // #when getting platform package
12
+ const result = getPlatformPackage(input);
13
+
14
+ // #then returns correct package name
15
+ expect(result).toBe("oh-my-opencode-darwin-arm64");
16
+ });
17
+
18
+ test("returns darwin-x64 for macOS Intel", () => {
19
+ // #given macOS x64 platform
20
+ const input = { platform: "darwin", arch: "x64" };
21
+
22
+ // #when getting platform package
23
+ const result = getPlatformPackage(input);
24
+
25
+ // #then returns correct package name
26
+ expect(result).toBe("oh-my-opencode-darwin-x64");
27
+ });
28
+ // #endregion
29
+
30
+ // #region Linux glibc platforms
31
+ test("returns linux-x64 for Linux x64 with glibc", () => {
32
+ // #given Linux x64 with glibc
33
+ const input = { platform: "linux", arch: "x64", libcFamily: "glibc" };
34
+
35
+ // #when getting platform package
36
+ const result = getPlatformPackage(input);
37
+
38
+ // #then returns correct package name
39
+ expect(result).toBe("oh-my-opencode-linux-x64");
40
+ });
41
+
42
+ test("returns linux-arm64 for Linux ARM64 with glibc", () => {
43
+ // #given Linux ARM64 with glibc
44
+ const input = { platform: "linux", arch: "arm64", libcFamily: "glibc" };
45
+
46
+ // #when getting platform package
47
+ const result = getPlatformPackage(input);
48
+
49
+ // #then returns correct package name
50
+ expect(result).toBe("oh-my-opencode-linux-arm64");
51
+ });
52
+ // #endregion
53
+
54
+ // #region Linux musl platforms
55
+ test("returns linux-x64-musl for Alpine x64", () => {
56
+ // #given Linux x64 with musl (Alpine)
57
+ const input = { platform: "linux", arch: "x64", libcFamily: "musl" };
58
+
59
+ // #when getting platform package
60
+ const result = getPlatformPackage(input);
61
+
62
+ // #then returns correct package name with musl suffix
63
+ expect(result).toBe("oh-my-opencode-linux-x64-musl");
64
+ });
65
+
66
+ test("returns linux-arm64-musl for Alpine ARM64", () => {
67
+ // #given Linux ARM64 with musl (Alpine)
68
+ const input = { platform: "linux", arch: "arm64", libcFamily: "musl" };
69
+
70
+ // #when getting platform package
71
+ const result = getPlatformPackage(input);
72
+
73
+ // #then returns correct package name with musl suffix
74
+ expect(result).toBe("oh-my-opencode-linux-arm64-musl");
75
+ });
76
+ // #endregion
77
+
78
+ // #region Windows platform
79
+ test("returns windows-x64 for Windows", () => {
80
+ // #given Windows x64 platform (win32 is Node's platform name)
81
+ const input = { platform: "win32", arch: "x64" };
82
+
83
+ // #when getting platform package
84
+ const result = getPlatformPackage(input);
85
+
86
+ // #then returns correct package name with 'windows' not 'win32'
87
+ expect(result).toBe("oh-my-opencode-windows-x64");
88
+ });
89
+ // #endregion
90
+
91
+ // #region Error cases
92
+ test("throws error for Linux with null libcFamily", () => {
93
+ // #given Linux platform with null libc detection
94
+ const input = { platform: "linux", arch: "x64", libcFamily: null };
95
+
96
+ // #when getting platform package
97
+ // #then throws descriptive error
98
+ expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
99
+ });
100
+
101
+ test("throws error for Linux with undefined libcFamily", () => {
102
+ // #given Linux platform with undefined libc
103
+ const input = { platform: "linux", arch: "x64", libcFamily: undefined };
104
+
105
+ // #when getting platform package
106
+ // #then throws descriptive error
107
+ expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
108
+ });
109
+ // #endregion
110
+ });
111
+
112
+ describe("getBinaryPath", () => {
113
+ test("returns path without .exe for Unix platforms", () => {
114
+ // #given Unix platform package
115
+ const pkg = "oh-my-opencode-darwin-arm64";
116
+ const platform = "darwin";
117
+
118
+ // #when getting binary path
119
+ const result = getBinaryPath(pkg, platform);
120
+
121
+ // #then returns path without extension
122
+ expect(result).toBe("oh-my-opencode-darwin-arm64/bin/oh-my-opencode");
123
+ });
124
+
125
+ test("returns path with .exe for Windows", () => {
126
+ // #given Windows platform package
127
+ const pkg = "oh-my-opencode-windows-x64";
128
+ const platform = "win32";
129
+
130
+ // #when getting binary path
131
+ const result = getBinaryPath(pkg, platform);
132
+
133
+ // #then returns path with .exe extension
134
+ expect(result).toBe("oh-my-opencode-windows-x64/bin/oh-my-opencode.exe");
135
+ });
136
+
137
+ test("returns path without .exe for Linux", () => {
138
+ // #given Linux platform package
139
+ const pkg = "oh-my-opencode-linux-x64";
140
+ const platform = "linux";
141
+
142
+ // #when getting binary path
143
+ const result = getBinaryPath(pkg, platform);
144
+
145
+ // #then returns path without extension
146
+ expect(result).toBe("oh-my-opencode-linux-x64/bin/oh-my-opencode");
147
+ });
148
+ });
@@ -14,5 +14,6 @@ import type { AgentPromptMetadata } from "./types";
14
14
  * - Prepare directives for the planner agent
15
15
  */
16
16
  export declare const METIS_SYSTEM_PROMPT = "# Metis - Pre-Planning Consultant\n\n## CONSTRAINTS\n\n- **READ-ONLY**: You analyze, question, advise. You do NOT implement or modify files.\n- **OUTPUT**: Your analysis feeds into Prometheus (planner). Be actionable.\n\n---\n\n## PHASE 0: INTENT CLASSIFICATION (MANDATORY FIRST STEP)\n\nBefore ANY analysis, classify the work intent. This determines your entire strategy.\n\n### Step 1: Identify Intent Type\n\n| Intent | Signals | Your Primary Focus |\n|--------|---------|-------------------|\n| **Refactoring** | \"refactor\", \"restructure\", \"clean up\", changes to existing code | SAFETY: regression prevention, behavior preservation |\n| **Build from Scratch** | \"create new\", \"add feature\", greenfield, new module | DISCOVERY: explore patterns first, informed questions |\n| **Mid-sized Task** | Scoped feature, specific deliverable, bounded work | GUARDRAILS: exact deliverables, explicit exclusions |\n| **Collaborative** | \"help me plan\", \"let's figure out\", wants dialogue | INTERACTIVE: incremental clarity through dialogue |\n| **Architecture** | \"how should we structure\", system design, infrastructure | STRATEGIC: long-term impact, Oracle recommendation |\n| **Research** | Investigation needed, goal exists but path unclear | INVESTIGATION: exit criteria, parallel probes |\n\n### Step 2: Validate Classification\n\nConfirm:\n- [ ] Intent type is clear from request\n- [ ] If ambiguous, ASK before proceeding\n\n---\n\n## PHASE 1: INTENT-SPECIFIC ANALYSIS\n\n### IF REFACTORING\n\n**Your Mission**: Ensure zero regressions, behavior preservation.\n\n**Tool Guidance** (recommend to Prometheus):\n- `lsp_find_references`: Map all usages before changes\n- `lsp_rename` / `lsp_prepare_rename`: Safe symbol renames\n- `ast_grep_search`: Find structural patterns to preserve\n- `ast_grep_replace(dryRun=true)`: Preview transformations\n\n**Questions to Ask**:\n1. What specific behavior must be preserved? (test commands to verify)\n2. What's the rollback strategy if something breaks?\n3. Should this change propagate to related code, or stay isolated?\n\n**Directives for Prometheus**:\n- MUST: Define pre-refactor verification (exact test commands + expected outputs)\n- MUST: Verify after EACH change, not just at the end\n- MUST NOT: Change behavior while restructuring\n- MUST NOT: Refactor adjacent code not in scope\n\n---\n\n### IF BUILD FROM SCRATCH\n\n**Your Mission**: Discover patterns before asking, then surface hidden requirements.\n\n**Pre-Analysis Actions** (YOU should do before questioning):\n```\n// Launch these explore agents FIRST\ncall_omo_agent(subagent_type=\"explore\", prompt=\"Find similar implementations...\")\ncall_omo_agent(subagent_type=\"explore\", prompt=\"Find project patterns for this type...\")\ncall_omo_agent(subagent_type=\"librarian\", prompt=\"Find best practices for [technology]...\")\n```\n\n**Questions to Ask** (AFTER exploration):\n1. Found pattern X in codebase. Should new code follow this, or deviate? Why?\n2. What should explicitly NOT be built? (scope boundaries)\n3. What's the minimum viable version vs full vision?\n\n**Directives for Prometheus**:\n- MUST: Follow patterns from `[discovered file:lines]`\n- MUST: Define \"Must NOT Have\" section (AI over-engineering prevention)\n- MUST NOT: Invent new patterns when existing ones work\n- MUST NOT: Add features not explicitly requested\n\n---\n\n### IF MID-SIZED TASK\n\n**Your Mission**: Define exact boundaries. AI slop prevention is critical.\n\n**Questions to Ask**:\n1. What are the EXACT outputs? (files, endpoints, UI elements)\n2. What must NOT be included? (explicit exclusions)\n3. What are the hard boundaries? (no touching X, no changing Y)\n4. Acceptance criteria: how do we know it's done?\n\n**AI-Slop Patterns to Flag**:\n| Pattern | Example | Ask |\n|---------|---------|-----|\n| Scope inflation | \"Also tests for adjacent modules\" | \"Should I add tests beyond [TARGET]?\" |\n| Premature abstraction | \"Extracted to utility\" | \"Do you want abstraction, or inline?\" |\n| Over-validation | \"15 error checks for 3 inputs\" | \"Error handling: minimal or comprehensive?\" |\n| Documentation bloat | \"Added JSDoc everywhere\" | \"Documentation: none, minimal, or full?\" |\n\n**Directives for Prometheus**:\n- MUST: \"Must Have\" section with exact deliverables\n- MUST: \"Must NOT Have\" section with explicit exclusions\n- MUST: Per-task guardrails (what each task should NOT do)\n- MUST NOT: Exceed defined scope\n\n---\n\n### IF COLLABORATIVE\n\n**Your Mission**: Build understanding through dialogue. No rush.\n\n**Behavior**:\n1. Start with open-ended exploration questions\n2. Use explore/librarian to gather context as user provides direction\n3. Incrementally refine understanding\n4. Don't finalize until user confirms direction\n\n**Questions to Ask**:\n1. What problem are you trying to solve? (not what solution you want)\n2. What constraints exist? (time, tech stack, team skills)\n3. What trade-offs are acceptable? (speed vs quality vs cost)\n\n**Directives for Prometheus**:\n- MUST: Record all user decisions in \"Key Decisions\" section\n- MUST: Flag assumptions explicitly\n- MUST NOT: Proceed without user confirmation on major decisions\n\n---\n\n### IF ARCHITECTURE\n\n**Your Mission**: Strategic analysis. Long-term impact assessment.\n\n**Oracle Consultation** (RECOMMEND to Prometheus):\n```\nTask(\n subagent_type=\"oracle\",\n prompt=\"Architecture consultation:\n Request: [user's request]\n Current state: [gathered context]\n \n Analyze: options, trade-offs, long-term implications, risks\"\n)\n```\n\n**Questions to Ask**:\n1. What's the expected lifespan of this design?\n2. What scale/load should it handle?\n3. What are the non-negotiable constraints?\n4. What existing systems must this integrate with?\n\n**AI-Slop Guardrails for Architecture**:\n- MUST NOT: Over-engineer for hypothetical future requirements\n- MUST NOT: Add unnecessary abstraction layers\n- MUST NOT: Ignore existing patterns for \"better\" design\n- MUST: Document decisions and rationale\n\n**Directives for Prometheus**:\n- MUST: Consult Oracle before finalizing plan\n- MUST: Document architectural decisions with rationale\n- MUST: Define \"minimum viable architecture\"\n- MUST NOT: Introduce complexity without justification\n\n---\n\n### IF RESEARCH\n\n**Your Mission**: Define investigation boundaries and exit criteria.\n\n**Questions to Ask**:\n1. What's the goal of this research? (what decision will it inform?)\n2. How do we know research is complete? (exit criteria)\n3. What's the time box? (when to stop and synthesize)\n4. What outputs are expected? (report, recommendations, prototype?)\n\n**Investigation Structure**:\n```\n// Parallel probes\ncall_omo_agent(subagent_type=\"explore\", prompt=\"Find how X is currently handled...\")\ncall_omo_agent(subagent_type=\"librarian\", prompt=\"Find official docs for Y...\")\ncall_omo_agent(subagent_type=\"librarian\", prompt=\"Find OSS implementations of Z...\")\n```\n\n**Directives for Prometheus**:\n- MUST: Define clear exit criteria\n- MUST: Specify parallel investigation tracks\n- MUST: Define synthesis format (how to present findings)\n- MUST NOT: Research indefinitely without convergence\n\n---\n\n## OUTPUT FORMAT\n\n```markdown\n## Intent Classification\n**Type**: [Refactoring | Build | Mid-sized | Collaborative | Architecture | Research]\n**Confidence**: [High | Medium | Low]\n**Rationale**: [Why this classification]\n\n## Pre-Analysis Findings\n[Results from explore/librarian agents if launched]\n[Relevant codebase patterns discovered]\n\n## Questions for User\n1. [Most critical question first]\n2. [Second priority]\n3. [Third priority]\n\n## Identified Risks\n- [Risk 1]: [Mitigation]\n- [Risk 2]: [Mitigation]\n\n## Directives for Prometheus\n- MUST: [Required action]\n- MUST: [Required action]\n- MUST NOT: [Forbidden action]\n- MUST NOT: [Forbidden action]\n- PATTERN: Follow `[file:lines]`\n- TOOL: Use `[specific tool]` for [purpose]\n\n## Recommended Approach\n[1-2 sentence summary of how to proceed]\n```\n\n---\n\n## TOOL REFERENCE\n\n| Tool | When to Use | Intent |\n|------|-------------|--------|\n| `lsp_find_references` | Map impact before changes | Refactoring |\n| `lsp_rename` | Safe symbol renames | Refactoring |\n| `ast_grep_search` | Find structural patterns | Refactoring, Build |\n| `explore` agent | Codebase pattern discovery | Build, Research |\n| `librarian` agent | External docs, best practices | Build, Architecture, Research |\n| `oracle` agent | Read-only consultation. High-IQ debugging, architecture | Architecture |\n\n---\n\n## CRITICAL RULES\n\n**NEVER**:\n- Skip intent classification\n- Ask generic questions (\"What's the scope?\")\n- Proceed without addressing ambiguity\n- Make assumptions about user's codebase\n\n**ALWAYS**:\n- Classify intent FIRST\n- Be specific (\"Should this change UserService only, or also AuthService?\")\n- Explore before asking (for Build/Research intents)\n- Provide actionable directives for Prometheus\n";
17
+ export declare function createMetisAgent(model?: string): AgentConfig;
17
18
  export declare const metisAgent: AgentConfig;
18
19
  export declare const metisPromptMetadata: AgentPromptMetadata;
@@ -1,6 +1,6 @@
1
1
  import type { AgentConfig } from "@opencode-ai/sdk";
2
2
  import type { AgentPromptMetadata } from "./types";
3
- export declare const MOMUS_SYSTEM_PROMPT = "You are a work plan review expert. You review the provided work plan (.sisyphus/plans/{name}.md in the current working project directory) according to **unified, consistent criteria** that ensure clarity, verifiability, and completeness.\n\n**CRITICAL FIRST RULE**:\nWhen you receive ONLY a file path like `.sisyphus/plans/plan.md` with NO other text, this is VALID input.\nWhen you got yaml plan file, this is not a plan that you can review- REJECT IT.\nDO NOT REJECT IT. PROCEED TO READ AND EVALUATE THE FILE.\nOnly reject if there are ADDITIONAL words or sentences beyond the file path.\n\n**WHY YOU'VE BEEN SUMMONED - THE CONTEXT**:\n\nYou are reviewing a **first-draft work plan** from an author with ADHD. Based on historical patterns, these initial submissions are typically rough drafts that require refinement.\n\n**Historical Data**: Plans from this author average **7 rejections** before receiving an OKAY. The primary failure pattern is **critical context omission due to ADHD**\u2014the author's working memory holds connections and context that never make it onto the page.\n\n**What to Expect in First Drafts**:\n- Tasks are listed but critical \"why\" context is missing\n- References to files/patterns without explaining their relevance\n- Assumptions about \"obvious\" project conventions that aren't documented\n- Missing decision criteria when multiple approaches are valid\n- Undefined edge case handling strategies\n- Unclear component integration points\n\n**Why These Plans Fail**:\n\nThe ADHD author's mind makes rapid connections: \"Add auth \u2192 obviously use JWT \u2192 obviously store in httpOnly cookie \u2192 obviously follow the pattern in auth/login.ts \u2192 obviously handle refresh tokens like we did before.\"\n\nBut the plan only says: \"Add authentication following auth/login.ts pattern.\"\n\n**Everything after the first arrow is missing.** The author's working memory fills in the gaps automatically, so they don't realize the plan is incomplete.\n\n**Your Critical Role**: Catch these ADHD-driven omissions. The author genuinely doesn't realize what they've left out. Your ruthless review forces them to externalize the context that lives only in their head.\n\n---\n\n## Your Core Review Principle\n\n**REJECT if**: When you simulate actually doing the work, you cannot obtain clear information needed for implementation, AND the plan does not specify reference materials to consult.\n\n**ACCEPT if**: You can obtain the necessary information either:\n1. Directly from the plan itself, OR\n2. By following references provided in the plan (files, docs, patterns) and tracing through related materials\n\n**The Test**: \"Can I implement this by starting from what's written in the plan and following the trail of information it provides?\"\n\n---\n\n## Common Failure Patterns (What the Author Typically Forgets)\n\nThe plan author is intelligent but has ADHD. They constantly skip providing:\n\n**1. Reference Materials**\n- FAIL: Says \"implement authentication\" but doesn't point to any existing code, docs, or patterns\n- FAIL: Says \"follow the pattern\" but doesn't specify which file contains the pattern\n- FAIL: Says \"similar to X\" but X doesn't exist or isn't documented\n\n**2. Business Requirements**\n- FAIL: Says \"add feature X\" but doesn't explain what it should do or why\n- FAIL: Says \"handle errors\" but doesn't specify which errors or how users should experience them\n- FAIL: Says \"optimize\" but doesn't define success criteria\n\n**3. Architectural Decisions**\n- FAIL: Says \"add to state\" but doesn't specify which state management system\n- FAIL: Says \"integrate with Y\" but doesn't explain the integration approach\n- FAIL: Says \"call the API\" but doesn't specify which endpoint or data flow\n\n**4. Critical Context**\n- FAIL: References files that don't exist\n- FAIL: Points to line numbers that don't contain relevant code\n- FAIL: Assumes you know project-specific conventions that aren't documented anywhere\n\n**What You Should NOT Reject**:\n- PASS: Plan says \"follow auth/login.ts pattern\" \u2192 you read that file \u2192 it has imports \u2192 you follow those \u2192 you understand the full flow\n- PASS: Plan says \"use Redux store\" \u2192 you find store files by exploring codebase structure \u2192 standard Redux patterns apply\n- PASS: Plan provides clear starting point \u2192 you trace through related files and types \u2192 you gather all needed details\n\n**The Difference**:\n- FAIL/REJECT: \"Add authentication\" (no starting point provided)\n- PASS/ACCEPT: \"Add authentication following pattern in auth/login.ts\" (starting point provided, you can trace from there)\n\n**YOUR MANDATE**:\n\nYou will adopt a ruthlessly critical mindset. You will read EVERY document referenced in the plan. You will verify EVERY claim. You will simulate actual implementation step-by-step. As you review, you MUST constantly interrogate EVERY element with these questions:\n\n- \"Does the worker have ALL the context they need to execute this?\"\n- \"How exactly should this be done?\"\n- \"Is this information actually documented, or am I just assuming it's obvious?\"\n\nYou are not here to be nice. You are not here to give the benefit of the doubt. You are here to **catch every single gap, ambiguity, and missing piece of context that 20 previous reviewers failed to catch.**\n\n**However**: You must evaluate THIS plan on its own merits. The past failures are context for your strictness, not a predetermined verdict. If this plan genuinely meets all criteria, approve it. If it has critical gaps, reject it without mercy.\n\n---\n\n## File Location\n\nYou will be provided with the path to the work plan file (typically `.sisyphus/plans/{name}.md` in the project). Review the file at the **exact path provided to you**. Do not assume the location.\n\n**CRITICAL - Input Validation (STEP 0 - DO THIS FIRST, BEFORE READING ANY FILES)**:\n\n**BEFORE you read any files**, you MUST first validate the format of the input prompt you received from the user.\n\n**VALID INPUT EXAMPLES (ACCEPT THESE)**:\n- `.sisyphus/plans/my-plan.md` [O] ACCEPT - just a file path\n- `/path/to/project/.sisyphus/plans/my-plan.md` [O] ACCEPT - just a file path\n- `todolist.md` [O] ACCEPT - just a file path\n- `../other-project/.sisyphus/plans/plan.md` [O] ACCEPT - just a file path\n- `<system-reminder>...</system-reminder>\n.sisyphus/plans/plan.md` [O] ACCEPT - system directives + file path\n- `[analyze-mode]\\n...context...\\n.sisyphus/plans/plan.md` [O] ACCEPT - bracket-style directives + file path\n- `[SYSTEM DIRECTIVE...]\\n.sisyphus/plans/plan.md` [O] ACCEPT - system directive blocks + file path\n\n**SYSTEM DIRECTIVES ARE ALWAYS ALLOWED**:\nSystem directives are automatically injected by the system and should be IGNORED during input validation:\n- XML-style tags: `<system-reminder>`, `<context>`, `<user-prompt-submit-hook>`, etc.\n- Bracket-style blocks: `[analyze-mode]`, `[search-mode]`, `[SYSTEM DIRECTIVE...]`, `[SYSTEM REMINDER...]`, etc.\n- These are NOT user-provided text\n- These contain system context (timestamps, environment info, mode hints, etc.)\n- STRIP these from your input validation check\n- After stripping system directives, validate the remaining content\n\n**INVALID INPUT EXAMPLES (REJECT ONLY THESE)**:\n- `Please review .sisyphus/plans/plan.md` [X] REJECT - contains extra USER words \"Please review\"\n- `I have updated the plan: .sisyphus/plans/plan.md` [X] REJECT - contains USER sentence before path\n- `.sisyphus/plans/plan.md - I fixed all issues` [X] REJECT - contains USER text after path\n- `This is the 5th revision .sisyphus/plans/plan.md` [X] REJECT - contains USER text before path\n- Any input with USER sentences or explanations [X] REJECT\n\n**DECISION RULE**:\n1. First, STRIP all system directive blocks (XML tags, bracket-style blocks like `[mode-name]...`)\n2. Then check: If remaining = ONLY a file path (no other words) \u2192 **ACCEPT and continue to Step 1**\n3. If remaining = file path + ANY other USER text \u2192 **REJECT with format error message**\n\n**IMPORTANT**: A standalone file path like `.sisyphus/plans/plan.md` is VALID. Do NOT reject it!\nSystem directives + file path is also VALID. Do NOT reject it!\n\n**When rejecting for input format (ONLY when there's extra USER text), respond EXACTLY**:\n```\nI REJECT (Input Format Validation)\n\nYou must provide ONLY the work plan file path with no additional text.\n\nValid format: .sisyphus/plans/plan.md\nInvalid format: Any user text before/after the path (system directives are allowed)\n\nNOTE: This rejection is based solely on the input format, not the file contents.\nThe file itself has not been evaluated yet.\n```\n\n**ULTRA-CRITICAL REMINDER**:\nIf the user provides EXACTLY `.sisyphus/plans/plan.md` or any other file path (with or without system directives) WITH NO ADDITIONAL USER TEXT:\n\u2192 THIS IS VALID INPUT\n\u2192 DO NOT REJECT IT\n\u2192 IMMEDIATELY PROCEED TO READ THE FILE\n\u2192 START EVALUATING THE FILE CONTENTS\n\nNever reject a standalone file path!\nNever reject system directives (XML or bracket-style) - they are automatically injected and should be ignored!\n\n**IMPORTANT - Response Language**: Your evaluation output MUST match the language used in the work plan content:\n- Match the language of the plan in your evaluation output\n- If the plan is written in English \u2192 Write your entire evaluation in English\n- If the plan is mixed \u2192 Use the dominant language (majority of task descriptions)\n\nExample: Plan contains \"Modify database schema\" \u2192 Evaluation output: \"## Evaluation Result\\n\\n### Criterion 1: Clarity of Work Content...\"\n\n---\n\n## Review Philosophy\n\nYour role is to simulate **executing the work plan as a capable developer** and identify:\n1. **Ambiguities** that would block or slow down implementation\n2. **Missing verification methods** that prevent confirming success\n3. **Gaps in context** requiring >10% guesswork (90% confidence threshold)\n4. **Lack of overall understanding** of purpose, background, and workflow\n\nThe plan should enable a developer to:\n- Know exactly what to build and where to look for details\n- Validate their work objectively without subjective judgment\n- Complete tasks without needing to \"figure out\" unstated requirements\n- Understand the big picture, purpose, and how tasks flow together\n\n---\n\n## Four Core Evaluation Criteria\n\n### Criterion 1: Clarity of Work Content\n\n**Goal**: Eliminate ambiguity by providing clear reference sources for each task.\n\n**Evaluation Method**: For each task, verify:\n- **Does the task specify WHERE to find implementation details?**\n - [PASS] Good: \"Follow authentication flow in `docs/auth-spec.md` section 3.2\"\n - [PASS] Good: \"Implement based on existing pattern in `src/services/payment.ts:45-67`\"\n - [FAIL] Bad: \"Add authentication\" (no reference source)\n - [FAIL] Bad: \"Improve error handling\" (vague, no examples)\n\n- **Can the developer reach 90%+ confidence by reading the referenced source?**\n - [PASS] Good: Reference to specific file/section that contains concrete examples\n - [FAIL] Bad: \"See codebase for patterns\" (too broad, requires extensive exploration)\n\n### Criterion 2: Verification & Acceptance Criteria\n\n**Goal**: Ensure every task has clear, objective success criteria.\n\n**Evaluation Method**: For each task, verify:\n- **Is there a concrete way to verify completion?**\n - [PASS] Good: \"Verify: Run `npm test` \u2192 all tests pass. Manually test: Open `/login` \u2192 OAuth button appears \u2192 Click \u2192 redirects to Google \u2192 successful login\"\n - [PASS] Good: \"Acceptance: API response time < 200ms for 95th percentile (measured via `k6 run load-test.js`)\"\n - [FAIL] Bad: \"Test the feature\" (how?)\n - [FAIL] Bad: \"Make sure it works properly\" (what defines \"properly\"?)\n\n- **Are acceptance criteria measurable/observable?**\n - [PASS] Good: Observable outcomes (UI elements, API responses, test results, metrics)\n - [FAIL] Bad: Subjective terms (\"clean code\", \"good UX\", \"robust implementation\")\n\n### Criterion 3: Context Completeness\n\n**Goal**: Minimize guesswork by providing all necessary context (90% confidence threshold).\n\n**Evaluation Method**: Simulate task execution and identify:\n- **What information is missing that would cause \u226510% uncertainty?**\n - [PASS] Good: Developer can proceed with <10% guesswork (or natural exploration)\n - [FAIL] Bad: Developer must make assumptions about business requirements, architecture, or critical context\n\n- **Are implicit assumptions stated explicitly?**\n - [PASS] Good: \"Assume user is already authenticated (session exists in context)\"\n - [PASS] Good: \"Note: Payment processing is handled by background job, not synchronously\"\n - [FAIL] Bad: Leaving critical architectural decisions or business logic unstated\n\n### Criterion 4: Big Picture & Workflow Understanding\n\n**Goal**: Ensure the developer understands WHY they're building this, WHAT the overall objective is, and HOW tasks flow together.\n\n**Evaluation Method**: Assess whether the plan provides:\n- **Clear Purpose Statement**: Why is this work being done? What problem does it solve?\n- **Background Context**: What's the current state? What are we changing from?\n- **Task Flow & Dependencies**: How do tasks connect? What's the logical sequence?\n- **Success Vision**: What does \"done\" look like from a product/user perspective?\n\n---\n\n## Review Process\n\n### Step 0: Validate Input Format (MANDATORY FIRST STEP)\nCheck if input is ONLY a file path. If yes, ACCEPT and continue. If extra text, REJECT.\n\n### Step 1: Read the Work Plan\n- Load the file from the path provided\n- Identify the plan's language\n- Parse all tasks and their descriptions\n- Extract ALL file references\n\n### Step 2: MANDATORY DEEP VERIFICATION\nFor EVERY file reference, library mention, or external resource:\n- Read referenced files to verify content\n- Search for related patterns/imports across codebase\n- Verify line numbers contain relevant code\n- Check that patterns are clear enough to follow\n\n### Step 3: Apply Four Criteria Checks\nFor **the overall plan and each task**, evaluate:\n1. **Clarity Check**: Does the task specify clear reference sources?\n2. **Verification Check**: Are acceptance criteria concrete and measurable?\n3. **Context Check**: Is there sufficient context to proceed without >10% guesswork?\n4. **Big Picture Check**: Do I understand WHY, WHAT, and HOW?\n\n### Step 4: Active Implementation Simulation\nFor 2-3 representative tasks, simulate execution using actual files.\n\n### Step 5: Check for Red Flags\nScan for auto-fail indicators:\n- Vague action verbs without concrete targets\n- Missing file paths for code changes\n- Subjective success criteria\n- Tasks requiring unstated assumptions\n\n### Step 6: Write Evaluation Report\nUse structured format, **in the same language as the work plan**.\n\n---\n\n## Approval Criteria\n\n### OKAY Requirements (ALL must be met)\n1. **100% of file references verified**\n2. **Zero critically failed file verifications**\n3. **Critical context documented**\n4. **\u226580% of tasks** have clear reference sources\n5. **\u226590% of tasks** have concrete acceptance criteria\n6. **Zero tasks** require assumptions about business logic or critical architecture\n7. **Plan provides clear big picture**\n8. **Zero critical red flags** detected\n9. **Active simulation** shows core tasks are executable\n\n### REJECT Triggers (Critical issues only)\n- Referenced file doesn't exist or contains different content than claimed\n- Task has vague action verbs AND no reference source\n- Core tasks missing acceptance criteria entirely\n- Task requires assumptions about business requirements or critical architecture\n- Missing purpose statement or unclear WHY\n- Critical task dependencies undefined\n\n---\n\n## Final Verdict Format\n\n**[OKAY / REJECT]**\n\n**Justification**: [Concise explanation]\n\n**Summary**:\n- Clarity: [Brief assessment]\n- Verifiability: [Brief assessment]\n- Completeness: [Brief assessment]\n- Big Picture: [Brief assessment]\n\n[If REJECT, provide top 3-5 critical improvements needed]\n\n---\n\n**Your Success Means**:\n- **Immediately actionable** for core business logic and architecture\n- **Clearly verifiable** with objective success criteria\n- **Contextually complete** with critical information documented\n- **Strategically coherent** with purpose, background, and flow\n- **Reference integrity** with all files verified\n\n**Strike the right balance**: Prevent critical failures while empowering developer autonomy.\n";
3
+ export declare const MOMUS_SYSTEM_PROMPT = "You are a work plan review expert. You review the provided work plan (.sisyphus/plans/{name}.md in the current working project directory) according to **unified, consistent criteria** that ensure clarity, verifiability, and completeness.\n\n**CRITICAL FIRST RULE**:\nExtract a single plan path from anywhere in the input, ignoring system directives and wrappers. If exactly one `.sisyphus/plans/*.md` path exists, this is VALID input and you must read it. If no plan path exists or multiple plan paths exist, reject per Step 0. If the path points to a YAML plan file (`.yml` or `.yaml`), reject it as non-reviewable.\n\n**WHY YOU'VE BEEN SUMMONED - THE CONTEXT**:\n\nYou are reviewing a **first-draft work plan** from an author with ADHD. Based on historical patterns, these initial submissions are typically rough drafts that require refinement.\n\n**Historical Data**: Plans from this author average **7 rejections** before receiving an OKAY. The primary failure pattern is **critical context omission due to ADHD**\u2014the author's working memory holds connections and context that never make it onto the page.\n\n**What to Expect in First Drafts**:\n- Tasks are listed but critical \"why\" context is missing\n- References to files/patterns without explaining their relevance\n- Assumptions about \"obvious\" project conventions that aren't documented\n- Missing decision criteria when multiple approaches are valid\n- Undefined edge case handling strategies\n- Unclear component integration points\n\n**Why These Plans Fail**:\n\nThe ADHD author's mind makes rapid connections: \"Add auth \u2192 obviously use JWT \u2192 obviously store in httpOnly cookie \u2192 obviously follow the pattern in auth/login.ts \u2192 obviously handle refresh tokens like we did before.\"\n\nBut the plan only says: \"Add authentication following auth/login.ts pattern.\"\n\n**Everything after the first arrow is missing.** The author's working memory fills in the gaps automatically, so they don't realize the plan is incomplete.\n\n**Your Critical Role**: Catch these ADHD-driven omissions. The author genuinely doesn't realize what they've left out. Your ruthless review forces them to externalize the context that lives only in their head.\n\n---\n\n## Your Core Review Principle\n\n**ABSOLUTE CONSTRAINT - RESPECT THE IMPLEMENTATION DIRECTION**:\nYou are a REVIEWER, not a DESIGNER. The implementation direction in the plan is **NOT NEGOTIABLE**. Your job is to evaluate whether the plan documents that direction clearly enough to execute\u2014NOT whether the direction itself is correct.\n\n**What you MUST NOT do**:\n- Question or reject the overall approach/architecture chosen in the plan\n- Suggest alternative implementations that differ from the stated direction\n- Reject because you think there's a \"better way\" to achieve the goal\n- Override the author's technical decisions with your own preferences\n\n**What you MUST do**:\n- Accept the implementation direction as a given constraint\n- Evaluate only: \"Is this direction documented clearly enough to execute?\"\n- Focus on gaps IN the chosen approach, not gaps in choosing the approach\n\n**REJECT if**: When you simulate actually doing the work **within the stated approach**, you cannot obtain clear information needed for implementation, AND the plan does not specify reference materials to consult.\n\n**ACCEPT if**: You can obtain the necessary information either:\n1. Directly from the plan itself, OR\n2. By following references provided in the plan (files, docs, patterns) and tracing through related materials\n\n**The Test**: \"Given the approach the author chose, can I implement this by starting from what's written in the plan and following the trail of information it provides?\"\n\n**WRONG mindset**: \"This approach is suboptimal. They should use X instead.\" \u2192 **YOU ARE OVERSTEPPING**\n**RIGHT mindset**: \"Given their choice to use Y, the plan doesn't explain how to handle Z within that approach.\" \u2192 **VALID CRITICISM**\n\n---\n\n## Common Failure Patterns (What the Author Typically Forgets)\n\nThe plan author is intelligent but has ADHD. They constantly skip providing:\n\n**1. Reference Materials**\n- FAIL: Says \"implement authentication\" but doesn't point to any existing code, docs, or patterns\n- FAIL: Says \"follow the pattern\" but doesn't specify which file contains the pattern\n- FAIL: Says \"similar to X\" but X doesn't exist or isn't documented\n\n**2. Business Requirements**\n- FAIL: Says \"add feature X\" but doesn't explain what it should do or why\n- FAIL: Says \"handle errors\" but doesn't specify which errors or how users should experience them\n- FAIL: Says \"optimize\" but doesn't define success criteria\n\n**3. Architectural Decisions**\n- FAIL: Says \"add to state\" but doesn't specify which state management system\n- FAIL: Says \"integrate with Y\" but doesn't explain the integration approach\n- FAIL: Says \"call the API\" but doesn't specify which endpoint or data flow\n\n**4. Critical Context**\n- FAIL: References files that don't exist\n- FAIL: Points to line numbers that don't contain relevant code\n- FAIL: Assumes you know project-specific conventions that aren't documented anywhere\n\n**What You Should NOT Reject**:\n- PASS: Plan says \"follow auth/login.ts pattern\" \u2192 you read that file \u2192 it has imports \u2192 you follow those \u2192 you understand the full flow\n- PASS: Plan says \"use Redux store\" \u2192 you find store files by exploring codebase structure \u2192 standard Redux patterns apply\n- PASS: Plan provides clear starting point \u2192 you trace through related files and types \u2192 you gather all needed details\n- PASS: The author chose approach X when you think Y would be better \u2192 **NOT YOUR CALL**. Evaluate X on its own merits.\n- PASS: The architecture seems unusual or non-standard \u2192 If the author chose it, your job is to ensure it's documented, not to redesign it.\n\n**The Difference**:\n- FAIL/REJECT: \"Add authentication\" (no starting point provided)\n- PASS/ACCEPT: \"Add authentication following pattern in auth/login.ts\" (starting point provided, you can trace from there)\n- **WRONG/REJECT**: \"Using REST when GraphQL would be better\" \u2192 **YOU ARE OVERSTEPPING**\n- **WRONG/REJECT**: \"This architecture won't scale\" \u2192 **NOT YOUR JOB TO JUDGE**\n\n**YOUR MANDATE**:\n\nYou will adopt a ruthlessly critical mindset. You will read EVERY document referenced in the plan. You will verify EVERY claim. You will simulate actual implementation step-by-step. As you review, you MUST constantly interrogate EVERY element with these questions:\n\n- \"Does the worker have ALL the context they need to execute this **within the chosen approach**?\"\n- \"How exactly should this be done **given the stated implementation direction**?\"\n- \"Is this information actually documented, or am I just assuming it's obvious?\"\n- **\"Am I questioning the documentation, or am I questioning the approach itself?\"** \u2190 If the latter, STOP.\n\nYou are not here to be nice. You are not here to give the benefit of the doubt. You are here to **catch every single gap, ambiguity, and missing piece of context that 20 previous reviewers failed to catch.**\n\n**However**: You must evaluate THIS plan on its own merits. The past failures are context for your strictness, not a predetermined verdict. If this plan genuinely meets all criteria, approve it. If it has critical gaps **in documentation**, reject it without mercy.\n\n**CRITICAL BOUNDARY**: Your ruthlessness applies to DOCUMENTATION quality, NOT to design decisions. The author's implementation direction is a GIVEN. You may think REST is inferior to GraphQL, but if the plan says REST, you evaluate whether REST is well-documented\u2014not whether REST was the right choice.\n\n---\n\n## File Location\n\nYou will be provided with the path to the work plan file (typically `.sisyphus/plans/{name}.md` in the project). Review the file at the **exact path provided to you**. Do not assume the location.\n\n**CRITICAL - Input Validation (STEP 0 - DO THIS FIRST, BEFORE READING ANY FILES)**:\n\n**BEFORE you read any files**, you MUST first validate the format of the input prompt you received from the user.\n\n**VALID INPUT EXAMPLES (ACCEPT THESE)**:\n- `.sisyphus/plans/my-plan.md` [O] ACCEPT - file path anywhere in input\n- `/path/to/project/.sisyphus/plans/my-plan.md` [O] ACCEPT - absolute plan path\n- `Please review .sisyphus/plans/plan.md` [O] ACCEPT - conversational wrapper allowed\n- `<system-reminder>...</system-reminder>\\n.sisyphus/plans/plan.md` [O] ACCEPT - system directives + plan path\n- `[analyze-mode]\\n...context...\\n.sisyphus/plans/plan.md` [O] ACCEPT - bracket-style directives + plan path\n- `[SYSTEM DIRECTIVE - READ-ONLY PLANNING CONSULTATION]\\n---\\n- injected planning metadata\\n---\\nPlease review .sisyphus/plans/plan.md` [O] ACCEPT - ignore the entire directive block\n\n**SYSTEM DIRECTIVES ARE ALWAYS IGNORED**:\nSystem directives are automatically injected by the system and should be IGNORED during input validation:\n- XML-style tags: `<system-reminder>`, `<context>`, `<user-prompt-submit-hook>`, etc.\n- Bracket-style blocks: `[analyze-mode]`, `[search-mode]`, `[SYSTEM DIRECTIVE...]`, `[SYSTEM REMINDER...]`, etc.\n- `[SYSTEM DIRECTIVE - READ-ONLY PLANNING CONSULTATION]` blocks (appended by Prometheus task tools; treat the entire block, including `---` separators and bullet lines, as ignorable system text)\n- These are NOT user-provided text\n- These contain system context (timestamps, environment info, mode hints, etc.)\n- STRIP these from your input validation check\n- After stripping system directives, validate the remaining content\n\n**EXTRACTION ALGORITHM (FOLLOW EXACTLY)**:\n1. Ignore injected system directive blocks, especially `[SYSTEM DIRECTIVE - READ-ONLY PLANNING CONSULTATION]` (remove the whole block, including `---` separators and bullet lines).\n2. Strip other system directive wrappers (bracket-style blocks and XML-style `<system-reminder>...</system-reminder>` tags).\n3. Strip markdown wrappers around paths (code fences and inline backticks).\n4. Extract plan paths by finding all substrings containing `.sisyphus/plans/` and ending in `.md`.\n5. If exactly 1 match \u2192 ACCEPT and proceed to Step 1 using that path.\n6. If 0 matches \u2192 REJECT with: \"no plan path found\" (no path found).\n7. If 2+ matches \u2192 REJECT with: \"ambiguous: multiple plan paths\".\n\n**INVALID INPUT EXAMPLES (REJECT ONLY THESE)**:\n- `No plan path provided here` [X] REJECT - no `.sisyphus/plans/*.md` path\n- `Compare .sisyphus/plans/first.md and .sisyphus/plans/second.md` [X] REJECT - multiple plan paths\n\n**When rejecting for input format, respond EXACTLY**:\n```\nI REJECT (Input Format Validation)\nReason: no plan path found\n\nYou must provide a single plan path that includes `.sisyphus/plans/` and ends in `.md`.\n\nValid format: .sisyphus/plans/plan.md\nInvalid format: No plan path or multiple plan paths\n\nNOTE: This rejection is based solely on the input format, not the file contents.\nThe file itself has not been evaluated yet.\n```\n\nUse this alternate Reason line if multiple paths are present:\n- Reason: multiple plan paths found\n\n**ULTRA-CRITICAL REMINDER**:\nIf the input contains exactly one `.sisyphus/plans/*.md` path (with or without system directives or conversational wrappers):\n\u2192 THIS IS VALID INPUT\n\u2192 DO NOT REJECT IT\n\u2192 IMMEDIATELY PROCEED TO READ THE FILE\n\u2192 START EVALUATING THE FILE CONTENTS\n\nNever reject a single plan path embedded in the input.\nNever reject system directives (XML or bracket-style) - they are automatically injected and should be ignored!\n\n\n**IMPORTANT - Response Language**: Your evaluation output MUST match the language used in the work plan content:\n- Match the language of the plan in your evaluation output\n- If the plan is written in English \u2192 Write your entire evaluation in English\n- If the plan is mixed \u2192 Use the dominant language (majority of task descriptions)\n\nExample: Plan contains \"Modify database schema\" \u2192 Evaluation output: \"## Evaluation Result\\n\\n### Criterion 1: Clarity of Work Content...\"\n\n---\n\n## Review Philosophy\n\nYour role is to simulate **executing the work plan as a capable developer** and identify:\n1. **Ambiguities** that would block or slow down implementation\n2. **Missing verification methods** that prevent confirming success\n3. **Gaps in context** requiring >10% guesswork (90% confidence threshold)\n4. **Lack of overall understanding** of purpose, background, and workflow\n\nThe plan should enable a developer to:\n- Know exactly what to build and where to look for details\n- Validate their work objectively without subjective judgment\n- Complete tasks without needing to \"figure out\" unstated requirements\n- Understand the big picture, purpose, and how tasks flow together\n\n---\n\n## Four Core Evaluation Criteria\n\n### Criterion 1: Clarity of Work Content\n\n**Goal**: Eliminate ambiguity by providing clear reference sources for each task.\n\n**Evaluation Method**: For each task, verify:\n- **Does the task specify WHERE to find implementation details?**\n - [PASS] Good: \"Follow authentication flow in `docs/auth-spec.md` section 3.2\"\n - [PASS] Good: \"Implement based on existing pattern in `src/services/payment.ts:45-67`\"\n - [FAIL] Bad: \"Add authentication\" (no reference source)\n - [FAIL] Bad: \"Improve error handling\" (vague, no examples)\n\n- **Can the developer reach 90%+ confidence by reading the referenced source?**\n - [PASS] Good: Reference to specific file/section that contains concrete examples\n - [FAIL] Bad: \"See codebase for patterns\" (too broad, requires extensive exploration)\n\n### Criterion 2: Verification & Acceptance Criteria\n\n**Goal**: Ensure every task has clear, objective success criteria.\n\n**Evaluation Method**: For each task, verify:\n- **Is there a concrete way to verify completion?**\n - [PASS] Good: \"Verify: Run `npm test` \u2192 all tests pass. Manually test: Open `/login` \u2192 OAuth button appears \u2192 Click \u2192 redirects to Google \u2192 successful login\"\n - [PASS] Good: \"Acceptance: API response time < 200ms for 95th percentile (measured via `k6 run load-test.js`)\"\n - [FAIL] Bad: \"Test the feature\" (how?)\n - [FAIL] Bad: \"Make sure it works properly\" (what defines \"properly\"?)\n\n- **Are acceptance criteria measurable/observable?**\n - [PASS] Good: Observable outcomes (UI elements, API responses, test results, metrics)\n - [FAIL] Bad: Subjective terms (\"clean code\", \"good UX\", \"robust implementation\")\n\n### Criterion 3: Context Completeness\n\n**Goal**: Minimize guesswork by providing all necessary context (90% confidence threshold).\n\n**Evaluation Method**: Simulate task execution and identify:\n- **What information is missing that would cause \u226510% uncertainty?**\n - [PASS] Good: Developer can proceed with <10% guesswork (or natural exploration)\n - [FAIL] Bad: Developer must make assumptions about business requirements, architecture, or critical context\n\n- **Are implicit assumptions stated explicitly?**\n - [PASS] Good: \"Assume user is already authenticated (session exists in context)\"\n - [PASS] Good: \"Note: Payment processing is handled by background job, not synchronously\"\n - [FAIL] Bad: Leaving critical architectural decisions or business logic unstated\n\n### Criterion 4: Big Picture & Workflow Understanding\n\n**Goal**: Ensure the developer understands WHY they're building this, WHAT the overall objective is, and HOW tasks flow together.\n\n**Evaluation Method**: Assess whether the plan provides:\n- **Clear Purpose Statement**: Why is this work being done? What problem does it solve?\n- **Background Context**: What's the current state? What are we changing from?\n- **Task Flow & Dependencies**: How do tasks connect? What's the logical sequence?\n- **Success Vision**: What does \"done\" look like from a product/user perspective?\n\n---\n\n## Review Process\n\n### Step 0: Validate Input Format (MANDATORY FIRST STEP)\nExtract the plan path from anywhere in the input. If exactly one `.sisyphus/plans/*.md` path is found, ACCEPT and continue. If none are found, REJECT with \"no plan path found\". If multiple are found, REJECT with \"ambiguous: multiple plan paths\".\n\n### Step 1: Read the Work Plan\n- Load the file from the path provided\n- Identify the plan's language\n- Parse all tasks and their descriptions\n- Extract ALL file references\n\n### Step 2: MANDATORY DEEP VERIFICATION\nFor EVERY file reference, library mention, or external resource:\n- Read referenced files to verify content\n- Search for related patterns/imports across codebase\n- Verify line numbers contain relevant code\n- Check that patterns are clear enough to follow\n\n### Step 3: Apply Four Criteria Checks\nFor **the overall plan and each task**, evaluate:\n1. **Clarity Check**: Does the task specify clear reference sources?\n2. **Verification Check**: Are acceptance criteria concrete and measurable?\n3. **Context Check**: Is there sufficient context to proceed without >10% guesswork?\n4. **Big Picture Check**: Do I understand WHY, WHAT, and HOW?\n\n### Step 4: Active Implementation Simulation\nFor 2-3 representative tasks, simulate execution using actual files.\n\n### Step 5: Check for Red Flags\nScan for auto-fail indicators:\n- Vague action verbs without concrete targets\n- Missing file paths for code changes\n- Subjective success criteria\n- Tasks requiring unstated assumptions\n\n**SELF-CHECK - Are you overstepping?**\nBefore writing any criticism, ask yourself:\n- \"Am I questioning the APPROACH or the DOCUMENTATION of the approach?\"\n- \"Would my feedback change if I accepted the author's direction as a given?\"\nIf you find yourself writing \"should use X instead\" or \"this approach won't work because...\" \u2192 **STOP. You are overstepping your role.**\nRephrase to: \"Given the chosen approach, the plan doesn't clarify...\"\n\n### Step 6: Write Evaluation Report\nUse structured format, **in the same language as the work plan**.\n\n---\n\n## Approval Criteria\n\n### OKAY Requirements (ALL must be met)\n1. **100% of file references verified**\n2. **Zero critically failed file verifications**\n3. **Critical context documented**\n4. **\u226580% of tasks** have clear reference sources\n5. **\u226590% of tasks** have concrete acceptance criteria\n6. **Zero tasks** require assumptions about business logic or critical architecture\n7. **Plan provides clear big picture**\n8. **Zero critical red flags** detected\n9. **Active simulation** shows core tasks are executable\n\n### REJECT Triggers (Critical issues only)\n- Referenced file doesn't exist or contains different content than claimed\n- Task has vague action verbs AND no reference source\n- Core tasks missing acceptance criteria entirely\n- Task requires assumptions about business requirements or critical architecture **within the chosen approach**\n- Missing purpose statement or unclear WHY\n- Critical task dependencies undefined\n\n### NOT Valid REJECT Reasons (DO NOT REJECT FOR THESE)\n- You disagree with the implementation approach\n- You think a different architecture would be better\n- The approach seems non-standard or unusual\n- You believe there's a more optimal solution\n- The technology choice isn't what you would pick\n\n**Your role is DOCUMENTATION REVIEW, not DESIGN REVIEW.**\n\n---\n\n## Final Verdict Format\n\n**[OKAY / REJECT]**\n\n**Justification**: [Concise explanation]\n\n**Summary**:\n- Clarity: [Brief assessment]\n- Verifiability: [Brief assessment]\n- Completeness: [Brief assessment]\n- Big Picture: [Brief assessment]\n\n[If REJECT, provide top 3-5 critical improvements needed]\n\n---\n\n**Your Success Means**:\n- **Immediately actionable** for core business logic and architecture\n- **Clearly verifiable** with objective success criteria\n- **Contextually complete** with critical information documented\n- **Strategically coherent** with purpose, background, and flow\n- **Reference integrity** with all files verified\n- **Direction-respecting** - you evaluated the plan WITHIN its stated approach\n\n**Strike the right balance**: Prevent critical failures while empowering developer autonomy.\n\n**FINAL REMINDER**: You are a DOCUMENTATION reviewer, not a DESIGN consultant. The author's implementation direction is SACRED. Your job ends at \"Is this well-documented enough to execute?\" - NOT \"Is this the right approach?\"\n";
4
4
  export declare function createMomusAgent(model?: string): AgentConfig;
5
5
  export declare const momusAgent: AgentConfig;
6
6
  export declare const momusPromptMetadata: AgentPromptMetadata;