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
@@ -0,0 +1,282 @@
1
+ # Delegation Enforcer
2
+
3
+ **Automatic model parameter injection for Task/Agent calls**
4
+
5
+ ## Problem
6
+
7
+ Claude Code does NOT automatically apply model parameters from agent definitions. When you invoke the `Task` tool (or `Agent` tool), you must manually specify the `model` parameter every time, even though each agent has a default model defined in its configuration.
8
+
9
+ This leads to:
10
+ - Verbose delegation code
11
+ - Forgotten model parameters defaulting to parent model
12
+ - Inconsistent model usage across codebase
13
+
14
+ ## Solution
15
+
16
+ The **Delegation Enforcer** is middleware that automatically injects the model parameter based on agent definitions when not explicitly specified.
17
+
18
+ ## How It Works
19
+
20
+ ### 1. Pre-Tool-Use Hook
21
+
22
+ The enforcer runs as a pre-tool-use hook that intercepts `Task` and `Agent` tool calls:
23
+
24
+ ```typescript
25
+ // Before enforcement
26
+ Task(
27
+ subagent_type="oh-my-claudecode:executor",
28
+ prompt="Implement feature X"
29
+ )
30
+
31
+ // After enforcement (automatic)
32
+ Task(
33
+ subagent_type="oh-my-claudecode:executor",
34
+ model="sonnet", // ← Automatically injected
35
+ prompt="Implement feature X"
36
+ )
37
+ ```
38
+
39
+ ### 2. Agent Definition Lookup
40
+
41
+ Each agent has a default model in its definition:
42
+
43
+ ```typescript
44
+ export const executorAgent: AgentConfig = {
45
+ name: 'executor',
46
+ description: '...',
47
+ prompt: '...',
48
+ tools: [...],
49
+ model: 'sonnet' // ← Default model
50
+ };
51
+ ```
52
+
53
+ The enforcer reads this definition and injects the model when not specified.
54
+
55
+ ### 3. Explicit Models Preserved
56
+
57
+ If you explicitly specify a model, it's always preserved:
58
+
59
+ ```typescript
60
+ // Explicit model is never overridden
61
+ Task(
62
+ subagent_type="oh-my-claudecode:executor",
63
+ model="haiku", // ← Explicitly using haiku instead of default sonnet
64
+ prompt="Quick lookup"
65
+ )
66
+ ```
67
+
68
+ ## API
69
+
70
+ ### Core Functions
71
+
72
+ #### `enforceModel(agentInput: AgentInput): EnforcementResult`
73
+
74
+ Enforces model parameter for a single agent delegation call.
75
+
76
+ ```typescript
77
+ import { enforceModel } from 'oh-my-claude-sisyphus';
78
+
79
+ const input = {
80
+ description: 'Implement feature',
81
+ prompt: 'Add validation',
82
+ subagent_type: 'executor'
83
+ };
84
+
85
+ const result = enforceModel(input);
86
+ console.log(result.modifiedInput.model); // 'sonnet'
87
+ console.log(result.injected); // true
88
+ ```
89
+
90
+ #### `getModelForAgent(agentType: string): ModelType`
91
+
92
+ Get the default model for an agent type.
93
+
94
+ ```typescript
95
+ import { getModelForAgent } from 'oh-my-claude-sisyphus';
96
+
97
+ getModelForAgent('executor'); // 'sonnet'
98
+ getModelForAgent('executor-low'); // 'haiku'
99
+ getModelForAgent('executor-high'); // 'opus'
100
+ ```
101
+
102
+ #### `isAgentCall(toolName: string, toolInput: unknown): boolean`
103
+
104
+ Check if a tool invocation is an agent delegation call.
105
+
106
+ ```typescript
107
+ import { isAgentCall } from 'oh-my-claude-sisyphus';
108
+
109
+ isAgentCall('Task', { subagent_type: 'executor', ... }); // true
110
+ isAgentCall('Bash', { command: 'ls' }); // false
111
+ ```
112
+
113
+ ### Hook Integration
114
+
115
+ The enforcer automatically integrates with the pre-tool-use hook:
116
+
117
+ ```typescript
118
+ import { processHook } from 'oh-my-claude-sisyphus';
119
+
120
+ const hookInput = {
121
+ toolName: 'Task',
122
+ toolInput: {
123
+ description: 'Test',
124
+ prompt: 'Test',
125
+ subagent_type: 'executor'
126
+ }
127
+ };
128
+
129
+ const result = await processHook('pre-tool-use', hookInput);
130
+ console.log(result.modifiedInput.model); // 'sonnet'
131
+ ```
132
+
133
+ ## Agent Model Mapping
134
+
135
+ | Agent Type | Default Model | Use Case |
136
+ |------------|---------------|----------|
137
+ | `architect` | opus | Complex analysis, debugging |
138
+ | `architect-medium` | sonnet | Standard analysis |
139
+ | `architect-low` | haiku | Quick questions |
140
+ | `executor` | sonnet | Standard implementation |
141
+ | `executor-high` | opus | Complex refactoring |
142
+ | `executor-low` | haiku | Simple changes |
143
+ | `explore` | haiku | Fast code search |
144
+ | `explore-medium` | sonnet | Thorough search |
145
+ | `designer` | sonnet | UI implementation |
146
+ | `designer-high` | opus | Complex UI architecture |
147
+ | `designer-low` | haiku | Simple styling |
148
+ | `researcher` | sonnet | Documentation lookup |
149
+ | `researcher-low` | haiku | Quick docs |
150
+ | `writer` | haiku | Documentation writing |
151
+ | `vision` | sonnet | Image analysis |
152
+ | `planner` | opus | Strategic planning |
153
+ | `critic` | opus | Plan review |
154
+ | `analyst` | opus | Pre-planning analysis |
155
+ | `qa-tester` | sonnet | CLI testing |
156
+ | `qa-tester-high` | opus | Comprehensive QA |
157
+ | `scientist` | sonnet | Data analysis |
158
+ | `scientist-low` | haiku | Quick inspection |
159
+ | `scientist-high` | opus | Complex research |
160
+
161
+ ## Debug Mode
162
+
163
+ Enable debug logging to see when models are auto-injected:
164
+
165
+ ```bash
166
+ export OMC_DEBUG=true
167
+ ```
168
+
169
+ When enabled, you'll see warnings like:
170
+
171
+ ```
172
+ [OMC] Auto-injecting model: sonnet for executor
173
+ ```
174
+
175
+ **Important:** Warnings are ONLY shown when `OMC_DEBUG=true`. Without this flag, enforcement happens silently.
176
+
177
+ ## Usage Examples
178
+
179
+ ### Before (Manual)
180
+
181
+ ```typescript
182
+ // Every delegation needs explicit model
183
+ Task(
184
+ subagent_type="oh-my-claudecode:executor",
185
+ model="sonnet",
186
+ prompt="Implement X"
187
+ )
188
+
189
+ Task(
190
+ subagent_type="oh-my-claudecode:executor-low",
191
+ model="haiku",
192
+ prompt="Quick lookup"
193
+ )
194
+ ```
195
+
196
+ ### After (Automatic)
197
+
198
+ ```typescript
199
+ // Model automatically injected from definition
200
+ Task(
201
+ subagent_type="oh-my-claudecode:executor",
202
+ prompt="Implement X"
203
+ )
204
+
205
+ Task(
206
+ subagent_type="oh-my-claudecode:executor-low",
207
+ prompt="Quick lookup"
208
+ )
209
+ ```
210
+
211
+ ### Override When Needed
212
+
213
+ ```typescript
214
+ // Use haiku for a simple executor task
215
+ Task(
216
+ subagent_type="oh-my-claudecode:executor",
217
+ model="haiku", // Override default sonnet
218
+ prompt="Find definition of X"
219
+ )
220
+ ```
221
+
222
+ ## Implementation Details
223
+
224
+ ### Hook Integration
225
+
226
+ The enforcer runs in the `pre-tool-use` hook:
227
+
228
+ 1. Hook receives tool invocation
229
+ 2. Checks if tool is `Task` or `Agent`
230
+ 3. Checks if `model` parameter is missing
231
+ 4. Looks up agent definition
232
+ 5. Injects default model
233
+ 6. Returns modified input
234
+
235
+ ### Error Handling
236
+
237
+ - Unknown agent types throw errors
238
+ - Agents without default models throw errors
239
+ - Invalid input structures are passed through unchanged
240
+ - Non-agent tools are ignored
241
+
242
+ ### Performance
243
+
244
+ - O(1) lookup: Direct hash map lookup for agent definitions
245
+ - No async operations: Synchronous enforcement
246
+ - Minimal overhead: Only applies to Task/Agent calls
247
+
248
+ ## Testing
249
+
250
+ Run tests:
251
+
252
+ ```bash
253
+ npm test -- delegation-enforcer
254
+ ```
255
+
256
+ Run demo:
257
+
258
+ ```bash
259
+ npx tsx examples/delegation-enforcer-demo.ts
260
+ ```
261
+
262
+ ## Benefits
263
+
264
+ 1. **Cleaner Code**: No need to manually specify model every time
265
+ 2. **Consistency**: Always uses correct model tier for each agent
266
+ 3. **Safety**: Explicit models always preserved
267
+ 4. **Transparency**: Debug mode shows when models are injected
268
+ 5. **Zero Config**: Works automatically with existing agent definitions
269
+
270
+ ## Migration
271
+
272
+ No migration needed! The enforcer is backward compatible:
273
+
274
+ - Existing code with explicit models continues working
275
+ - New code can omit model parameter
276
+ - No breaking changes
277
+
278
+ ## Related
279
+
280
+ - [Model Routing](./MODEL-ROUTING.md) - Intelligent task complexity analysis
281
+ - [Agent Definitions](./AGENTS.md) - Complete agent reference
282
+ - [Delegation Categories](./DELEGATION-CATEGORIES.md) - Semantic task grouping
@@ -10,7 +10,7 @@
10
10
 
11
11
  # oh-my-claudecode
12
12
 
13
- [![Version](https://img.shields.io/badge/version-3.3.10-ff6b6b)](https://github.com/Yeachan-Heo/oh-my-claudecode)
13
+ [![Version](https://img.shields.io/badge/version-3.4.0-ff6b6b)](https://github.com/Yeachan-Heo/oh-my-claudecode)
14
14
  [![npm version](https://img.shields.io/npm/v/oh-my-claudecode?color=cb3837)](https://www.npmjs.com/package/oh-my-claudecode)
15
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
16
16
  [![Node.js](https://img.shields.io/badge/Node.js-20+-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
@@ -43,7 +43,7 @@ The plugin requires a `plugin.json` manifest:
43
43
  ```json
44
44
  {
45
45
  "name": "oh-my-claudecode",
46
- "version": "3.0.11",
46
+ "version": "3.4.0",
47
47
  "description": "Multi-agent orchestration system for Claude Code",
48
48
  "hooks": {
49
49
  "PreToolUse": ["scripts/pre-tool-enforcer.mjs"],