oh-my-claude-sisyphus 3.3.10 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/README.md +3 -3
  2. package/agents/explore-high.md +195 -0
  3. package/agents/qa-tester-high.md +141 -0
  4. package/agents/templates/README.md +110 -0
  5. package/agents/templates/base-agent.md +54 -0
  6. package/agents/templates/tier-instructions.md +94 -0
  7. package/commands/ecomode.md +60 -0
  8. package/commands/help.md +1 -1
  9. package/commands/mcp-setup.md +7 -6
  10. package/commands/ralplan.md +8 -1
  11. package/commands/ultrapilot.md +158 -0
  12. package/commands/ultrawork.md +1 -0
  13. package/dist/__tests__/delegation-enforcer-integration.test.d.ts +6 -0
  14. package/dist/__tests__/delegation-enforcer-integration.test.d.ts.map +1 -0
  15. package/dist/__tests__/delegation-enforcer-integration.test.js +136 -0
  16. package/dist/__tests__/delegation-enforcer-integration.test.js.map +1 -0
  17. package/dist/__tests__/delegation-enforcer.test.d.ts +5 -0
  18. package/dist/__tests__/delegation-enforcer.test.d.ts.map +1 -0
  19. package/dist/__tests__/delegation-enforcer.test.js +208 -0
  20. package/dist/__tests__/delegation-enforcer.test.js.map +1 -0
  21. package/dist/__tests__/hooks.test.js +2 -2
  22. package/dist/__tests__/hooks.test.js.map +1 -1
  23. package/dist/__tests__/installer.test.js +4 -6
  24. package/dist/__tests__/installer.test.js.map +1 -1
  25. package/dist/__tests__/ralph-prd.test.js +1 -1
  26. package/dist/__tests__/ralph-prd.test.js.map +1 -1
  27. package/dist/__tests__/ralph-progress.test.js +1 -1
  28. package/dist/__tests__/ralph-progress.test.js.map +1 -1
  29. package/dist/__tests__/skills.test.js +31 -24
  30. package/dist/__tests__/skills.test.js.map +1 -1
  31. package/dist/agents/analyst.d.ts.map +1 -1
  32. package/dist/agents/analyst.js +1 -0
  33. package/dist/agents/analyst.js.map +1 -1
  34. package/dist/agents/architect.d.ts.map +1 -1
  35. package/dist/agents/architect.js +1 -0
  36. package/dist/agents/architect.js.map +1 -1
  37. package/dist/agents/critic.d.ts.map +1 -1
  38. package/dist/agents/critic.js +1 -0
  39. package/dist/agents/critic.js.map +1 -1
  40. package/dist/agents/definitions.d.ts +5 -1
  41. package/dist/agents/definitions.d.ts.map +1 -1
  42. package/dist/agents/definitions.js +53 -155
  43. package/dist/agents/definitions.js.map +1 -1
  44. package/dist/agents/designer.d.ts.map +1 -1
  45. package/dist/agents/designer.js +1 -0
  46. package/dist/agents/designer.js.map +1 -1
  47. package/dist/agents/executor.d.ts.map +1 -1
  48. package/dist/agents/executor.js +1 -0
  49. package/dist/agents/executor.js.map +1 -1
  50. package/dist/agents/explore.d.ts.map +1 -1
  51. package/dist/agents/explore.js +1 -0
  52. package/dist/agents/explore.js.map +1 -1
  53. package/dist/agents/planner.d.ts.map +1 -1
  54. package/dist/agents/planner.js +1 -0
  55. package/dist/agents/planner.js.map +1 -1
  56. package/dist/agents/qa-tester.d.ts.map +1 -1
  57. package/dist/agents/qa-tester.js +1 -0
  58. package/dist/agents/qa-tester.js.map +1 -1
  59. package/dist/agents/researcher.d.ts.map +1 -1
  60. package/dist/agents/researcher.js +1 -0
  61. package/dist/agents/researcher.js.map +1 -1
  62. package/dist/agents/scientist.d.ts.map +1 -1
  63. package/dist/agents/scientist.js +1 -0
  64. package/dist/agents/scientist.js.map +1 -1
  65. package/dist/agents/types.d.ts +2 -0
  66. package/dist/agents/types.d.ts.map +1 -1
  67. package/dist/agents/types.js.map +1 -1
  68. package/dist/agents/vision.d.ts.map +1 -1
  69. package/dist/agents/vision.js +1 -0
  70. package/dist/agents/vision.js.map +1 -1
  71. package/dist/agents/writer.d.ts.map +1 -1
  72. package/dist/agents/writer.js +1 -0
  73. package/dist/agents/writer.js.map +1 -1
  74. package/dist/cli/index.js +0 -3
  75. package/dist/cli/index.js.map +1 -1
  76. package/dist/config/loader.d.ts.map +1 -1
  77. package/dist/config/loader.js +1 -6
  78. package/dist/config/loader.js.map +1 -1
  79. package/dist/features/delegation-enforcer.d.ts +71 -0
  80. package/dist/features/delegation-enforcer.d.ts.map +1 -0
  81. package/dist/features/delegation-enforcer.js +128 -0
  82. package/dist/features/delegation-enforcer.js.map +1 -0
  83. package/dist/features/index.d.ts +3 -0
  84. package/dist/features/index.d.ts.map +1 -1
  85. package/dist/features/index.js +18 -0
  86. package/dist/features/index.js.map +1 -1
  87. package/dist/features/state-manager/index.d.ts +100 -0
  88. package/dist/features/state-manager/index.d.ts.map +1 -0
  89. package/dist/features/state-manager/index.js +407 -0
  90. package/dist/features/state-manager/index.js.map +1 -0
  91. package/dist/features/state-manager/types.d.ts +147 -0
  92. package/dist/features/state-manager/types.d.ts.map +1 -0
  93. package/dist/features/state-manager/types.js +30 -0
  94. package/dist/features/state-manager/types.js.map +1 -0
  95. package/dist/features/task-decomposer/index.d.ts +33 -0
  96. package/dist/features/task-decomposer/index.d.ts.map +1 -0
  97. package/dist/features/task-decomposer/index.js +698 -0
  98. package/dist/features/task-decomposer/index.js.map +1 -0
  99. package/dist/features/task-decomposer/types.d.ts +133 -0
  100. package/dist/features/task-decomposer/types.d.ts.map +1 -0
  101. package/dist/features/task-decomposer/types.js +8 -0
  102. package/dist/features/task-decomposer/types.js.map +1 -0
  103. package/dist/features/verification/example.d.ts +49 -0
  104. package/dist/features/verification/example.d.ts.map +1 -0
  105. package/dist/features/verification/example.js +235 -0
  106. package/dist/features/verification/example.js.map +1 -0
  107. package/dist/features/verification/index.d.ts +97 -0
  108. package/dist/features/verification/index.d.ts.map +1 -0
  109. package/dist/features/verification/index.js +439 -0
  110. package/dist/features/verification/index.js.map +1 -0
  111. package/dist/features/verification/types.d.ts +142 -0
  112. package/dist/features/verification/types.d.ts.map +1 -0
  113. package/dist/features/verification/types.js +7 -0
  114. package/dist/features/verification/types.js.map +1 -0
  115. package/dist/hooks/agent-usage-reminder/constants.d.ts.map +1 -1
  116. package/dist/hooks/agent-usage-reminder/constants.js +0 -1
  117. package/dist/hooks/agent-usage-reminder/constants.js.map +1 -1
  118. package/dist/hooks/autopilot/__tests__/cancel.test.js +4 -4
  119. package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -1
  120. package/dist/hooks/autopilot/__tests__/summary.test.js +1 -1
  121. package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -1
  122. package/dist/hooks/autopilot/__tests__/transition.test.js +1 -2
  123. package/dist/hooks/autopilot/__tests__/transition.test.js.map +1 -1
  124. package/dist/hooks/autopilot/cancel.js +2 -2
  125. package/dist/hooks/autopilot/cancel.js.map +1 -1
  126. package/dist/hooks/autopilot/enforcement.d.ts +16 -2
  127. package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
  128. package/dist/hooks/autopilot/enforcement.js +78 -4
  129. package/dist/hooks/autopilot/enforcement.js.map +1 -1
  130. package/dist/hooks/autopilot/index.d.ts +3 -6
  131. package/dist/hooks/autopilot/index.d.ts.map +1 -1
  132. package/dist/hooks/autopilot/index.js +6 -12
  133. package/dist/hooks/autopilot/index.js.map +1 -1
  134. package/dist/hooks/autopilot/state.d.ts +36 -2
  135. package/dist/hooks/autopilot/state.d.ts.map +1 -1
  136. package/dist/hooks/autopilot/state.js +216 -2
  137. package/dist/hooks/autopilot/state.js.map +1 -1
  138. package/dist/hooks/autopilot/validation.d.ts +23 -2
  139. package/dist/hooks/autopilot/validation.d.ts.map +1 -1
  140. package/dist/hooks/autopilot/validation.js +158 -1
  141. package/dist/hooks/autopilot/validation.js.map +1 -1
  142. package/dist/hooks/bridge.js +3 -3
  143. package/dist/hooks/bridge.js.map +1 -1
  144. package/dist/hooks/index.d.ts +5 -9
  145. package/dist/hooks/index.d.ts.map +1 -1
  146. package/dist/hooks/index.js +31 -21
  147. package/dist/hooks/index.js.map +1 -1
  148. package/dist/hooks/learner/promotion.js +1 -1
  149. package/dist/hooks/learner/promotion.js.map +1 -1
  150. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  151. package/dist/hooks/persistent-mode/index.js +2 -3
  152. package/dist/hooks/persistent-mode/index.js.map +1 -1
  153. package/dist/hooks/ralph/index.d.ts +11 -0
  154. package/dist/hooks/ralph/index.d.ts.map +1 -0
  155. package/dist/hooks/ralph/index.js +53 -0
  156. package/dist/hooks/ralph/index.js.map +1 -0
  157. package/dist/hooks/ralph/loop.d.ts +116 -0
  158. package/dist/hooks/ralph/loop.d.ts.map +1 -0
  159. package/dist/hooks/ralph/loop.js +322 -0
  160. package/dist/hooks/ralph/loop.js.map +1 -0
  161. package/dist/hooks/ralph/prd.d.ts +130 -0
  162. package/dist/hooks/ralph/prd.d.ts.map +1 -0
  163. package/dist/hooks/ralph/prd.js +310 -0
  164. package/dist/hooks/ralph/prd.js.map +1 -0
  165. package/dist/hooks/ralph/progress.d.ts +102 -0
  166. package/dist/hooks/ralph/progress.d.ts.map +1 -0
  167. package/dist/hooks/ralph/progress.js +408 -0
  168. package/dist/hooks/ralph/progress.js.map +1 -0
  169. package/dist/hooks/ralph/verifier.d.ts +72 -0
  170. package/dist/hooks/ralph/verifier.d.ts.map +1 -0
  171. package/dist/hooks/ralph/verifier.js +223 -0
  172. package/dist/hooks/ralph/verifier.js.map +1 -0
  173. package/dist/hooks/recovery/constants.d.ts +114 -0
  174. package/dist/hooks/recovery/constants.d.ts.map +1 -0
  175. package/dist/hooks/recovery/constants.js +227 -0
  176. package/dist/hooks/recovery/constants.js.map +1 -0
  177. package/dist/hooks/recovery/context-window.d.ts +24 -0
  178. package/dist/hooks/recovery/context-window.d.ts.map +1 -0
  179. package/dist/hooks/recovery/context-window.js +321 -0
  180. package/dist/hooks/recovery/context-window.js.map +1 -0
  181. package/dist/hooks/recovery/edit-error.d.ts +24 -0
  182. package/dist/hooks/recovery/edit-error.d.ts.map +1 -0
  183. package/dist/hooks/recovery/edit-error.js +56 -0
  184. package/dist/hooks/recovery/edit-error.js.map +1 -0
  185. package/dist/hooks/recovery/index.d.ts +102 -0
  186. package/dist/hooks/recovery/index.d.ts.map +1 -0
  187. package/dist/hooks/recovery/index.js +166 -0
  188. package/dist/hooks/recovery/index.js.map +1 -0
  189. package/dist/hooks/recovery/session-recovery.d.ts +24 -0
  190. package/dist/hooks/recovery/session-recovery.d.ts.map +1 -0
  191. package/dist/hooks/recovery/session-recovery.js +281 -0
  192. package/dist/hooks/recovery/session-recovery.js.map +1 -0
  193. package/dist/hooks/recovery/storage.d.ts +75 -0
  194. package/dist/hooks/recovery/storage.d.ts.map +1 -0
  195. package/dist/hooks/recovery/storage.js +382 -0
  196. package/dist/hooks/recovery/storage.js.map +1 -0
  197. package/dist/hooks/recovery/types.d.ts +196 -0
  198. package/dist/hooks/recovery/types.d.ts.map +1 -0
  199. package/dist/hooks/recovery/types.js +32 -0
  200. package/dist/hooks/recovery/types.js.map +1 -0
  201. package/dist/hooks/ultrapilot/index.d.ts +90 -0
  202. package/dist/hooks/ultrapilot/index.d.ts.map +1 -0
  203. package/dist/hooks/ultrapilot/index.js +310 -0
  204. package/dist/hooks/ultrapilot/index.js.map +1 -0
  205. package/dist/hooks/ultrapilot/state.d.ts +72 -0
  206. package/dist/hooks/ultrapilot/state.d.ts.map +1 -0
  207. package/dist/hooks/ultrapilot/state.js +258 -0
  208. package/dist/hooks/ultrapilot/state.js.map +1 -0
  209. package/dist/hooks/ultrapilot/types.d.ts +113 -0
  210. package/dist/hooks/ultrapilot/types.d.ts.map +1 -0
  211. package/dist/hooks/ultrapilot/types.js +36 -0
  212. package/dist/hooks/ultrapilot/types.js.map +1 -0
  213. package/dist/hooks/ultraqa/index.d.ts +94 -0
  214. package/dist/hooks/ultraqa/index.d.ts.map +1 -0
  215. package/dist/hooks/ultraqa/index.js +216 -0
  216. package/dist/hooks/ultraqa/index.js.map +1 -0
  217. package/dist/hooks/ultrawork/index.d.ts +62 -0
  218. package/dist/hooks/ultrawork/index.d.ts.map +1 -0
  219. package/dist/hooks/ultrawork/index.js +208 -0
  220. package/dist/hooks/ultrawork/index.js.map +1 -0
  221. package/dist/index.d.ts.map +1 -1
  222. package/dist/index.js +1 -2
  223. package/dist/index.js.map +1 -1
  224. package/dist/installer/index.d.ts +1 -1
  225. package/dist/installer/index.d.ts.map +1 -1
  226. package/dist/installer/index.js +1 -1
  227. package/dist/installer/index.js.map +1 -1
  228. package/dist/mcp/index.d.ts +1 -1
  229. package/dist/mcp/index.d.ts.map +1 -1
  230. package/dist/mcp/index.js +1 -1
  231. package/dist/mcp/index.js.map +1 -1
  232. package/dist/mcp/servers.d.ts +2 -18
  233. package/dist/mcp/servers.d.ts.map +1 -1
  234. package/dist/mcp/servers.js +4 -36
  235. package/dist/mcp/servers.js.map +1 -1
  236. package/dist/shared/types.d.ts +1 -3
  237. package/dist/shared/types.d.ts.map +1 -1
  238. package/docs/CLAUDE.md +170 -44
  239. package/docs/DELEGATION-ENFORCER.md +282 -0
  240. package/docs/FULL-README.md +1 -1
  241. package/docs/LOCAL_PLUGIN_INSTALL.md +1 -1
  242. package/docs/MIGRATION.md +298 -104
  243. package/package.json +2 -2
  244. package/scripts/test-mutual-exclusion.ts +1 -1
  245. package/skills/analyze/SKILL.md +0 -1
  246. package/skills/autopilot/SKILL.md +0 -1
  247. package/skills/cancel/SKILL.md +580 -0
  248. package/skills/cancel-autopilot/SKILL.md +0 -1
  249. package/skills/cancel-ecomode/SKILL.md +41 -0
  250. package/skills/cancel-ralph/SKILL.md +0 -1
  251. package/skills/cancel-ultraqa/SKILL.md +0 -1
  252. package/skills/cancel-ultrawork/SKILL.md +0 -1
  253. package/skills/deepinit/SKILL.md +0 -1
  254. package/skills/deepsearch/SKILL.md +0 -1
  255. package/skills/doctor/SKILL.md +0 -1
  256. package/skills/ecomode/SKILL.md +128 -0
  257. package/skills/frontend-ui-ux/SKILL.md +0 -1
  258. package/skills/git-master/SKILL.md +0 -1
  259. package/skills/help/SKILL.md +1 -2
  260. package/skills/hud/SKILL.md +0 -1
  261. package/skills/learner/SKILL.md +0 -1
  262. package/skills/mcp-setup/SKILL.md +8 -7
  263. package/skills/note/SKILL.md +0 -1
  264. package/skills/omc-default/SKILL.md +0 -1
  265. package/skills/omc-default-global/SKILL.md +0 -1
  266. package/skills/omc-setup/SKILL.md +176 -10
  267. package/skills/orchestrate/SKILL.md +0 -1
  268. package/skills/pipeline/SKILL.md +417 -0
  269. package/skills/plan/SKILL.md +138 -21
  270. package/skills/planner/SKILL.md +0 -1
  271. package/skills/ralph/SKILL.md +65 -1
  272. package/skills/ralph-init/SKILL.md +0 -1
  273. package/skills/ralplan/SKILL.md +0 -1
  274. package/skills/release/SKILL.md +0 -1
  275. package/skills/research/SKILL.md +0 -1
  276. package/skills/review/SKILL.md +0 -1
  277. package/skills/swarm/SKILL.md +349 -0
  278. package/skills/tdd/SKILL.md +0 -1
  279. package/skills/ultrapilot/SKILL.md +563 -0
  280. package/skills/ultraqa/SKILL.md +0 -1
  281. package/skills/ultrawork/SKILL.md +0 -1
  282. package/docs/MIGRATION-v3.md +0 -186
@@ -64,7 +64,7 @@ Read the current `~/.claude/settings.json` and add/update the `mcpServers` secti
64
64
  "mcpServers": {
65
65
  "context7": {
66
66
  "command": "npx",
67
- "args": ["-y", "@context7/mcp"]
67
+ "args": ["-y", "@upstash/context7-mcp"]
68
68
  }
69
69
  }
70
70
  }
@@ -76,7 +76,7 @@ Read the current `~/.claude/settings.json` and add/update the `mcpServers` secti
76
76
  "mcpServers": {
77
77
  "exa": {
78
78
  "command": "npx",
79
- "args": ["-y", "@anthropic/exa-mcp-server"],
79
+ "args": ["-y", "exa-mcp-server"],
80
80
  "env": {
81
81
  "EXA_API_KEY": "<user-provided-key>"
82
82
  }
@@ -91,7 +91,7 @@ Read the current `~/.claude/settings.json` and add/update the `mcpServers` secti
91
91
  "mcpServers": {
92
92
  "filesystem": {
93
93
  "command": "npx",
94
- "args": ["-y", "@anthropic/mcp-server-filesystem", "<allowed-directories>"]
94
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "<allowed-directories>"]
95
95
  }
96
96
  }
97
97
  }
@@ -102,15 +102,16 @@ Read the current `~/.claude/settings.json` and add/update the `mcpServers` secti
102
102
  {
103
103
  "mcpServers": {
104
104
  "github": {
105
- "command": "npx",
106
- "args": ["-y", "@anthropic/github-mcp-server"],
105
+ "command": "docker",
106
+ "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
107
107
  "env": {
108
- "GITHUB_TOKEN": "<user-provided-token>"
108
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "<user-provided-token>"
109
109
  }
110
110
  }
111
111
  }
112
112
  }
113
113
  ```
114
+ > Note: GitHub MCP requires Docker. Alternatively, configure as a remote URL: https://api.githubcopilot.com/mcp/
114
115
 
115
116
  ## Step 4: Merge Configuration
116
117
 
@@ -1,8 +1,15 @@
1
1
  ---
2
2
  description: Iterative planning with Planner, Architect, and Critic until consensus
3
+ aliases: [rp, planloop]
3
4
  ---
4
5
 
5
- # Ralplan Skill
6
+ # Ralplan Command
7
+
8
+ [RALPLAN ACTIVATED - ITERATIVE PLANNING CONSENSUS MODE]
9
+
10
+ ## User's Task
11
+
12
+ {{ARGUMENTS}}
6
13
 
7
14
  ## Overview
8
15
 
@@ -0,0 +1,158 @@
1
+ ---
2
+ description: Parallel autopilot with file ownership partitioning (up to 5x faster)
3
+ aliases: [up, ultraauto, parallelauto]
4
+ ---
5
+
6
+ # Ultrapilot Command
7
+
8
+ [ULTRAPILOT ACTIVATED - PARALLEL AUTONOMOUS EXECUTION MODE]
9
+
10
+ You are now in ULTRAPILOT mode. This is a parallel autopilot that spawns multiple workers with file ownership partitioning for maximum speed.
11
+
12
+ ## User's Task
13
+
14
+ {{ARGUMENTS}}
15
+
16
+ ## Your Mission
17
+
18
+ Transform this task into working code through parallel execution:
19
+
20
+ 1. **Analysis** - Determine if task is parallelizable
21
+ 2. **Decomposition** - Break into parallel-safe subtasks with file partitioning
22
+ 3. **Parallel Execution** - Spawn up to 5 workers with exclusive file ownership
23
+ 4. **Integration** - Handle shared files sequentially
24
+ 5. **Validation** - Full system integrity check
25
+
26
+ ## Phase 0: Task Analysis
27
+
28
+ Determine if task is suitable for parallel execution:
29
+
30
+ **Parallelizable if:**
31
+ - Can be split into 2+ independent subtasks
32
+ - File boundaries are clear
33
+ - Dependencies between subtasks are minimal
34
+
35
+ **If NOT parallelizable:** Fall back to regular `/oh-my-claudecode:autopilot`
36
+
37
+ ## Phase 1: Decomposition
38
+
39
+ Break task into parallel-safe subtasks:
40
+
41
+ 1. Identify independent components (e.g., frontend, backend, database, tests)
42
+ 2. Map each subtask to a non-overlapping file set
43
+ 3. Identify shared files (package.json, tsconfig.json) for sequential handling
44
+ 4. Create task list with clear ownership
45
+
46
+ **Output:** Subtask definitions with file ownership assignments
47
+
48
+ ## Phase 2: File Partitioning
49
+
50
+ Create exclusive ownership map:
51
+
52
+ ```
53
+ Worker 1: src/api/** (exclusive)
54
+ Worker 2: src/ui/** (exclusive)
55
+ Worker 3: src/db/** (exclusive)
56
+ Worker 4: docs/** (exclusive)
57
+ Worker 5: tests/** (exclusive)
58
+ SHARED: package.json, tsconfig.json (sequential)
59
+ ```
60
+
61
+ **Rule:** No two workers can touch the same files
62
+
63
+ ## Phase 3: Parallel Execution
64
+
65
+ Spawn workers using Task tool with `run_in_background: true`:
66
+
67
+ ```
68
+ Task(
69
+ subagent_type="oh-my-claudecode:executor",
70
+ model="sonnet",
71
+ run_in_background=true,
72
+ prompt="ULTRAPILOT WORKER [1/5]
73
+
74
+ OWNED FILES: src/api/**
75
+ TASK: [specific subtask]
76
+
77
+ You have EXCLUSIVE ownership of these files.
78
+ DO NOT touch files outside your ownership.
79
+ Signal WORKER_COMPLETE when done."
80
+ )
81
+ ```
82
+
83
+ **Critical Rules:**
84
+ - Maximum 5 parallel workers (Claude Code limit)
85
+ - Each worker owns exclusive file set
86
+ - Monitor via TaskOutput
87
+ - Handle failures by reassigning or fixing
88
+
89
+ ## Phase 4: Integration
90
+
91
+ After all workers complete:
92
+
93
+ 1. Handle shared files (package.json, configs) sequentially
94
+ 2. Resolve any integration issues
95
+ 3. Ensure all pieces work together
96
+
97
+ ## Phase 5: Validation
98
+
99
+ Spawn Architect for full system verification:
100
+
101
+ ```
102
+ Task(
103
+ subagent_type="oh-my-claudecode:architect",
104
+ model="opus",
105
+ prompt="ULTRAPILOT VALIDATION
106
+
107
+ Verify the complete implementation:
108
+ 1. All subtasks completed successfully
109
+ 2. No integration conflicts
110
+ 3. System works as a whole
111
+ 4. Tests pass (if applicable)"
112
+ )
113
+ ```
114
+
115
+ ## Delegation Rules (MANDATORY)
116
+
117
+ **YOU ARE A COORDINATOR, NOT AN IMPLEMENTER.**
118
+
119
+ | Action | YOU Do | DELEGATE |
120
+ |--------|--------|----------|
121
+ | Decompose task | ✓ | |
122
+ | Partition files | ✓ | |
123
+ | Spawn workers | ✓ | |
124
+ | Track progress | ✓ | |
125
+ | **ANY code change** | ✗ NEVER | executor workers |
126
+
127
+ **Path Exception**: Only write to `.omc/`, `.claude/`, `CLAUDE.md`, `AGENTS.md`
128
+
129
+ ## State Management
130
+
131
+ Track state in `.omc/ultrapilot-state.json`:
132
+
133
+ ```json
134
+ {
135
+ "active": true,
136
+ "mode": "ultrapilot",
137
+ "workers": [
138
+ {"id": "w1", "status": "running", "files": ["src/api/**"], "task_id": "..."},
139
+ {"id": "w2", "status": "complete", "files": ["src/ui/**"], "task_id": "..."}
140
+ ],
141
+ "shared_files": ["package.json", "tsconfig.json"],
142
+ "phase": "parallel_execution"
143
+ }
144
+ ```
145
+
146
+ ## Completion
147
+
148
+ When all phases complete and Architect validates:
149
+
150
+ ```
151
+ <promise>ULTRAPILOT_COMPLETE</promise>
152
+ ```
153
+
154
+ Display summary with:
155
+ - Time savings vs sequential
156
+ - Workers spawned
157
+ - Files modified per worker
158
+ - Final validation status
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Activate maximum performance mode with parallel agent orchestration for high-throughput task completion
3
+ aliases: [ulw, uw, turbo]
3
4
  ---
4
5
 
5
6
  # Ultrawork Skill
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Integration tests for delegation enforcer
3
+ * Tests the entire flow from hook input to modified output
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=delegation-enforcer-integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-enforcer-integration.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/delegation-enforcer-integration.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Integration tests for delegation enforcer
3
+ * Tests the entire flow from hook input to modified output
4
+ */
5
+ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
6
+ import { processHook } from '../hooks/bridge.js';
7
+ describe('delegation-enforcer integration', () => {
8
+ let originalDebugEnv;
9
+ beforeEach(() => {
10
+ originalDebugEnv = process.env.OMC_DEBUG;
11
+ });
12
+ afterEach(() => {
13
+ if (originalDebugEnv === undefined) {
14
+ delete process.env.OMC_DEBUG;
15
+ }
16
+ else {
17
+ process.env.OMC_DEBUG = originalDebugEnv;
18
+ }
19
+ });
20
+ describe('pre-tool-use hook with Task calls', () => {
21
+ it('injects model parameter for Task call without model', async () => {
22
+ const input = {
23
+ toolName: 'Task',
24
+ toolInput: {
25
+ description: 'Test task',
26
+ prompt: 'Do something',
27
+ subagent_type: 'oh-my-claudecode:executor'
28
+ }
29
+ };
30
+ const result = await processHook('pre-tool-use', input);
31
+ expect(result.continue).toBe(true);
32
+ expect(result.modifiedInput).toBeDefined();
33
+ const modifiedInput = result.modifiedInput;
34
+ expect(modifiedInput.model).toBe('sonnet');
35
+ expect(modifiedInput.description).toBe('Test task');
36
+ expect(modifiedInput.prompt).toBe('Do something');
37
+ });
38
+ it('preserves explicit model parameter', async () => {
39
+ const input = {
40
+ toolName: 'Task',
41
+ toolInput: {
42
+ description: 'Test task',
43
+ prompt: 'Do something',
44
+ subagent_type: 'oh-my-claudecode:executor',
45
+ model: 'haiku'
46
+ }
47
+ };
48
+ const result = await processHook('pre-tool-use', input);
49
+ expect(result.continue).toBe(true);
50
+ expect(result.modifiedInput).toBeDefined();
51
+ const modifiedInput = result.modifiedInput;
52
+ expect(modifiedInput.model).toBe('haiku');
53
+ });
54
+ it('handles Agent tool name', async () => {
55
+ const input = {
56
+ toolName: 'Agent',
57
+ toolInput: {
58
+ description: 'Test task',
59
+ prompt: 'Do something',
60
+ subagent_type: 'executor-low'
61
+ }
62
+ };
63
+ const result = await processHook('pre-tool-use', input);
64
+ expect(result.continue).toBe(true);
65
+ const modifiedInput = result.modifiedInput;
66
+ expect(modifiedInput.model).toBe('haiku');
67
+ });
68
+ it('does not modify non-agent tools', async () => {
69
+ const input = {
70
+ toolName: 'Bash',
71
+ toolInput: {
72
+ command: 'ls -la'
73
+ }
74
+ };
75
+ const result = await processHook('pre-tool-use', input);
76
+ expect(result.continue).toBe(true);
77
+ const modifiedInput = result.modifiedInput;
78
+ expect(modifiedInput.command).toBe('ls -la');
79
+ expect(modifiedInput).not.toHaveProperty('model');
80
+ });
81
+ it('works with all agent tiers', async () => {
82
+ const testCases = [
83
+ { agent: 'architect', expectedModel: 'opus' },
84
+ { agent: 'architect-low', expectedModel: 'haiku' },
85
+ { agent: 'executor-high', expectedModel: 'opus' },
86
+ { agent: 'executor-low', expectedModel: 'haiku' },
87
+ { agent: 'designer-high', expectedModel: 'opus' }
88
+ ];
89
+ for (const testCase of testCases) {
90
+ const input = {
91
+ toolName: 'Task',
92
+ toolInput: {
93
+ description: 'Test',
94
+ prompt: 'Test',
95
+ subagent_type: testCase.agent
96
+ }
97
+ };
98
+ const result = await processHook('pre-tool-use', input);
99
+ const modifiedInput = result.modifiedInput;
100
+ expect(modifiedInput.model).toBe(testCase.expectedModel);
101
+ }
102
+ });
103
+ it('does not log warning when OMC_DEBUG not set', async () => {
104
+ delete process.env.OMC_DEBUG;
105
+ const consoleWarnSpy = vi.spyOn(console, 'warn');
106
+ const input = {
107
+ toolName: 'Task',
108
+ toolInput: {
109
+ description: 'Test',
110
+ prompt: 'Test',
111
+ subagent_type: 'executor'
112
+ }
113
+ };
114
+ await processHook('pre-tool-use', input);
115
+ expect(consoleWarnSpy).not.toHaveBeenCalled();
116
+ consoleWarnSpy.mockRestore();
117
+ });
118
+ it('logs warning when OMC_DEBUG=true', async () => {
119
+ process.env.OMC_DEBUG = 'true';
120
+ const consoleWarnSpy = vi.spyOn(console, 'warn');
121
+ const input = {
122
+ toolName: 'Task',
123
+ toolInput: {
124
+ description: 'Test',
125
+ prompt: 'Test',
126
+ subagent_type: 'executor'
127
+ }
128
+ };
129
+ await processHook('pre-tool-use', input);
130
+ expect(consoleWarnSpy).toHaveBeenCalledWith(expect.stringContaining('[OMC] Auto-injecting model'));
131
+ expect(consoleWarnSpy).toHaveBeenCalledWith(expect.stringContaining('sonnet'));
132
+ consoleWarnSpy.mockRestore();
133
+ });
134
+ });
135
+ });
136
+ //# sourceMappingURL=delegation-enforcer-integration.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-enforcer-integration.test.js","sourceRoot":"","sources":["../../src/__tests__/delegation-enforcer-integration.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AAEjE,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,IAAI,gBAAoC,CAAC;IAEzC,UAAU,CAAC,GAAG,EAAE;QACd,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,gBAAgB,CAAC;QAC3C,CAAC;IACH,C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B;aACF,CAAC;YAEF,MAAM,WAAW,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YAEzC,MAAM,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;YAE9C,cAAc,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;YAChD,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC;YAE/B,MAAM,cAAc,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAEjD,MAAM,KAAK,GAAc;gBACvB,QAAQ,EAAE,MAAM;gBAChB,SAAS,EAAE;oBACT,WAAW,EAAE,MAAM;oBACnB,MAAM,EAAE,MAAM;oBACd,aAAa,EAAE,UAAU;iBAC1B;aACF,CAAC;YAEF,MAAM,WAAW,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YAEzC,MAAM,CAAC,cAAc,CAAC,CAAC,oBAAoB,CACzC,MAAM,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,CACtD,CAAC;YACF,MAAM,CAAC,cAAc,CAAC,CAAC,oBAAoB,CACzC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAClC,CAAC;YAEF,cAAc,CAAC,WAAW,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Tests for delegation enforcer middleware
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=delegation-enforcer.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-enforcer.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/delegation-enforcer.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Tests for delegation enforcer middleware
3
+ */
4
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
5
+ import { enforceModel, isAgentCall, processPreToolUse, getModelForAgent } from '../features/delegation-enforcer.js';
6
+ describe('delegation-enforcer', () => {
7
+ let originalDebugEnv;
8
+ beforeEach(() => {
9
+ originalDebugEnv = process.env.OMC_DEBUG;
10
+ });
11
+ afterEach(() => {
12
+ if (originalDebugEnv === undefined) {
13
+ delete process.env.OMC_DEBUG;
14
+ }
15
+ else {
16
+ process.env.OMC_DEBUG = originalDebugEnv;
17
+ }
18
+ });
19
+ describe('enforceModel', () => {
20
+ it('preserves explicitly specified model', () => {
21
+ const input = {
22
+ description: 'Test task',
23
+ prompt: 'Do something',
24
+ subagent_type: 'oh-my-claudecode:executor',
25
+ model: 'haiku'
26
+ };
27
+ const result = enforceModel(input);
28
+ expect(result.injected).toBe(false);
29
+ expect(result.modifiedInput.model).toBe('haiku');
30
+ expect(result.modifiedInput).toEqual(input);
31
+ });
32
+ it('injects model from agent definition when not specified', () => {
33
+ const input = {
34
+ description: 'Test task',
35
+ prompt: 'Do something',
36
+ subagent_type: 'oh-my-claudecode:executor'
37
+ };
38
+ const result = enforceModel(input);
39
+ expect(result.injected).toBe(true);
40
+ expect(result.modifiedInput.model).toBe('sonnet'); // executor defaults to sonnet
41
+ expect(result.originalInput.model).toBeUndefined();
42
+ });
43
+ it('handles agent type without prefix', () => {
44
+ const input = {
45
+ description: 'Test task',
46
+ prompt: 'Do something',
47
+ subagent_type: 'executor-low'
48
+ };
49
+ const result = enforceModel(input);
50
+ expect(result.injected).toBe(true);
51
+ expect(result.modifiedInput.model).toBe('haiku'); // executor-low defaults to haiku
52
+ });
53
+ it('throws error for unknown agent type', () => {
54
+ const input = {
55
+ description: 'Test task',
56
+ prompt: 'Do something',
57
+ subagent_type: 'unknown-agent'
58
+ };
59
+ expect(() => enforceModel(input)).toThrow('Unknown agent type');
60
+ });
61
+ it('logs warning only when OMC_DEBUG=true', () => {
62
+ const input = {
63
+ description: 'Test task',
64
+ prompt: 'Do something',
65
+ subagent_type: 'executor'
66
+ };
67
+ // Without debug flag
68
+ delete process.env.OMC_DEBUG;
69
+ const resultWithoutDebug = enforceModel(input);
70
+ expect(resultWithoutDebug.warning).toBeUndefined();
71
+ // With debug flag
72
+ process.env.OMC_DEBUG = 'true';
73
+ const resultWithDebug = enforceModel(input);
74
+ expect(resultWithDebug.warning).toBeDefined();
75
+ expect(resultWithDebug.warning).toContain('Auto-injecting model');
76
+ expect(resultWithDebug.warning).toContain('sonnet');
77
+ expect(resultWithDebug.warning).toContain('executor');
78
+ });
79
+ it('does not log warning when OMC_DEBUG is false', () => {
80
+ const input = {
81
+ description: 'Test task',
82
+ prompt: 'Do something',
83
+ subagent_type: 'executor'
84
+ };
85
+ process.env.OMC_DEBUG = 'false';
86
+ const result = enforceModel(input);
87
+ expect(result.warning).toBeUndefined();
88
+ });
89
+ it('works with all tiered agents', () => {
90
+ const testCases = [
91
+ { agent: 'architect', expectedModel: 'opus' },
92
+ { agent: 'architect-medium', expectedModel: 'sonnet' },
93
+ { agent: 'architect-low', expectedModel: 'haiku' },
94
+ { agent: 'executor', expectedModel: 'sonnet' },
95
+ { agent: 'executor-high', expectedModel: 'opus' },
96
+ { agent: 'executor-low', expectedModel: 'haiku' },
97
+ { agent: 'explore', expectedModel: 'haiku' },
98
+ { agent: 'explore-medium', expectedModel: 'sonnet' },
99
+ { agent: 'designer', expectedModel: 'sonnet' },
100
+ { agent: 'designer-high', expectedModel: 'opus' },
101
+ { agent: 'designer-low', expectedModel: 'haiku' }
102
+ ];
103
+ for (const testCase of testCases) {
104
+ const input = {
105
+ description: 'Test',
106
+ prompt: 'Test',
107
+ subagent_type: testCase.agent
108
+ };
109
+ const result = enforceModel(input);
110
+ expect(result.modifiedInput.model).toBe(testCase.expectedModel);
111
+ expect(result.injected).toBe(true);
112
+ }
113
+ });
114
+ });
115
+ describe('isAgentCall', () => {
116
+ it('returns true for Agent tool with valid input', () => {
117
+ const toolInput = {
118
+ description: 'Test',
119
+ prompt: 'Test',
120
+ subagent_type: 'executor'
121
+ };
122
+ expect(isAgentCall('Agent', toolInput)).toBe(true);
123
+ });
124
+ it('returns true for Task tool with valid input', () => {
125
+ const toolInput = {
126
+ description: 'Test',
127
+ prompt: 'Test',
128
+ subagent_type: 'executor'
129
+ };
130
+ expect(isAgentCall('Task', toolInput)).toBe(true);
131
+ });
132
+ it('returns false for non-agent tools', () => {
133
+ const toolInput = {
134
+ description: 'Test',
135
+ prompt: 'Test',
136
+ subagent_type: 'executor'
137
+ };
138
+ expect(isAgentCall('Bash', toolInput)).toBe(false);
139
+ expect(isAgentCall('Read', toolInput)).toBe(false);
140
+ });
141
+ it('returns false for invalid input structure', () => {
142
+ expect(isAgentCall('Agent', null)).toBe(false);
143
+ expect(isAgentCall('Agent', undefined)).toBe(false);
144
+ expect(isAgentCall('Agent', 'string')).toBe(false);
145
+ expect(isAgentCall('Agent', { description: 'test' })).toBe(false); // missing prompt
146
+ expect(isAgentCall('Agent', { prompt: 'test' })).toBe(false); // missing description
147
+ });
148
+ });
149
+ describe('processPreToolUse', () => {
150
+ it('returns original input for non-agent tools', () => {
151
+ const toolInput = { command: 'ls -la' };
152
+ const result = processPreToolUse('Bash', toolInput);
153
+ expect(result.modifiedInput).toEqual(toolInput);
154
+ expect(result.warning).toBeUndefined();
155
+ });
156
+ it('enforces model for agent calls', () => {
157
+ const toolInput = {
158
+ description: 'Test',
159
+ prompt: 'Test',
160
+ subagent_type: 'executor'
161
+ };
162
+ const result = processPreToolUse('Agent', toolInput);
163
+ expect(result.modifiedInput).toHaveProperty('model', 'sonnet');
164
+ });
165
+ it('does not modify input when model already specified', () => {
166
+ const toolInput = {
167
+ description: 'Test',
168
+ prompt: 'Test',
169
+ subagent_type: 'executor',
170
+ model: 'haiku'
171
+ };
172
+ const result = processPreToolUse('Agent', toolInput);
173
+ expect(result.modifiedInput).toEqual(toolInput);
174
+ expect(result.warning).toBeUndefined();
175
+ });
176
+ it('logs warning only when OMC_DEBUG=true and model injected', () => {
177
+ const toolInput = {
178
+ description: 'Test',
179
+ prompt: 'Test',
180
+ subagent_type: 'executor'
181
+ };
182
+ // Without debug
183
+ delete process.env.OMC_DEBUG;
184
+ const resultWithoutDebug = processPreToolUse('Agent', toolInput);
185
+ expect(resultWithoutDebug.warning).toBeUndefined();
186
+ // With debug
187
+ process.env.OMC_DEBUG = 'true';
188
+ const resultWithDebug = processPreToolUse('Agent', toolInput);
189
+ expect(resultWithDebug.warning).toBeDefined();
190
+ });
191
+ });
192
+ describe('getModelForAgent', () => {
193
+ it('returns correct model for agent with prefix', () => {
194
+ expect(getModelForAgent('oh-my-claudecode:executor')).toBe('sonnet');
195
+ expect(getModelForAgent('oh-my-claudecode:executor-low')).toBe('haiku');
196
+ expect(getModelForAgent('oh-my-claudecode:architect')).toBe('opus');
197
+ });
198
+ it('returns correct model for agent without prefix', () => {
199
+ expect(getModelForAgent('executor')).toBe('sonnet');
200
+ expect(getModelForAgent('executor-low')).toBe('haiku');
201
+ expect(getModelForAgent('architect')).toBe('opus');
202
+ });
203
+ it('throws error for unknown agent', () => {
204
+ expect(() => getModelForAgent('unknown')).toThrow('Unknown agent type');
205
+ });
206
+ });
207
+ });
208
+ //# sourceMappingURL=delegation-enforcer.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-enforcer.test.js","sourceRoot":"","sources":["../../src/__tests__/delegation-enforcer.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EACL,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,oCAAoC,CAAC;AAE5C,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,gBAAoC,CAAC;IAEzC,UAAU,CAAC,GAAG,EAAE;QACd,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;IAC3C,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C,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -5,8 +5,8 @@ import { tmpdir } from 'os';
5
5
  import { extractPromptText, removeCodeBlocks, detectKeywordsWithType, hasKeyword, getPrimaryKeyword } from '../hooks/keyword-detector/index.js';
6
6
  import { formatTodoStatus, getNextPendingTodo } from '../hooks/todo-continuation/index.js';
7
7
  import { resetTodoContinuationAttempts } from '../hooks/persistent-mode/index.js';
8
- import { startUltraQA, clearUltraQAState, isRalphLoopActive } from '../hooks/ultraqa-loop/index.js';
9
- import { createRalphLoopHook, clearRalphState, isUltraQAActive } from '../hooks/ralph-loop/index.js';
8
+ import { startUltraQA, clearUltraQAState, isRalphLoopActive } from '../hooks/ultraqa/index.js';
9
+ import { createRalphLoopHook, clearRalphState, isUltraQAActive } from '../hooks/ralph/index.js';
10
10
  describe('Keyword Detector', () => {
11
11
  describe('extractPromptText', () => {
12
12
  it('should extract text from text parts', () => {