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.
- package/README.md +3 -3
- package/agents/explore-high.md +195 -0
- package/agents/qa-tester-high.md +141 -0
- package/agents/templates/README.md +110 -0
- package/agents/templates/base-agent.md +54 -0
- package/agents/templates/tier-instructions.md +94 -0
- package/commands/ecomode.md +60 -0
- package/commands/help.md +1 -1
- package/commands/mcp-setup.md +7 -6
- package/commands/ralplan.md +8 -1
- package/commands/ultrapilot.md +158 -0
- package/commands/ultrawork.md +1 -0
- package/dist/__tests__/delegation-enforcer-integration.test.d.ts +6 -0
- package/dist/__tests__/delegation-enforcer-integration.test.d.ts.map +1 -0
- package/dist/__tests__/delegation-enforcer-integration.test.js +136 -0
- package/dist/__tests__/delegation-enforcer-integration.test.js.map +1 -0
- package/dist/__tests__/delegation-enforcer.test.d.ts +5 -0
- package/dist/__tests__/delegation-enforcer.test.d.ts.map +1 -0
- package/dist/__tests__/delegation-enforcer.test.js +208 -0
- package/dist/__tests__/delegation-enforcer.test.js.map +1 -0
- package/dist/__tests__/hooks.test.js +2 -2
- package/dist/__tests__/hooks.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +4 -6
- package/dist/__tests__/installer.test.js.map +1 -1
- package/dist/__tests__/ralph-prd.test.js +1 -1
- package/dist/__tests__/ralph-prd.test.js.map +1 -1
- package/dist/__tests__/ralph-progress.test.js +1 -1
- package/dist/__tests__/ralph-progress.test.js.map +1 -1
- package/dist/__tests__/skills.test.js +31 -24
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/agents/analyst.d.ts.map +1 -1
- package/dist/agents/analyst.js +1 -0
- package/dist/agents/analyst.js.map +1 -1
- package/dist/agents/architect.d.ts.map +1 -1
- package/dist/agents/architect.js +1 -0
- package/dist/agents/architect.js.map +1 -1
- package/dist/agents/critic.d.ts.map +1 -1
- package/dist/agents/critic.js +1 -0
- package/dist/agents/critic.js.map +1 -1
- package/dist/agents/definitions.d.ts +5 -1
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +53 -155
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/designer.d.ts.map +1 -1
- package/dist/agents/designer.js +1 -0
- package/dist/agents/designer.js.map +1 -1
- package/dist/agents/executor.d.ts.map +1 -1
- package/dist/agents/executor.js +1 -0
- package/dist/agents/executor.js.map +1 -1
- package/dist/agents/explore.d.ts.map +1 -1
- package/dist/agents/explore.js +1 -0
- package/dist/agents/explore.js.map +1 -1
- package/dist/agents/planner.d.ts.map +1 -1
- package/dist/agents/planner.js +1 -0
- package/dist/agents/planner.js.map +1 -1
- package/dist/agents/qa-tester.d.ts.map +1 -1
- package/dist/agents/qa-tester.js +1 -0
- package/dist/agents/qa-tester.js.map +1 -1
- package/dist/agents/researcher.d.ts.map +1 -1
- package/dist/agents/researcher.js +1 -0
- package/dist/agents/researcher.js.map +1 -1
- package/dist/agents/scientist.d.ts.map +1 -1
- package/dist/agents/scientist.js +1 -0
- package/dist/agents/scientist.js.map +1 -1
- package/dist/agents/types.d.ts +2 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/types.js.map +1 -1
- package/dist/agents/vision.d.ts.map +1 -1
- package/dist/agents/vision.js +1 -0
- package/dist/agents/vision.js.map +1 -1
- package/dist/agents/writer.d.ts.map +1 -1
- package/dist/agents/writer.js +1 -0
- package/dist/agents/writer.js.map +1 -1
- package/dist/cli/index.js +0 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +1 -6
- package/dist/config/loader.js.map +1 -1
- package/dist/features/delegation-enforcer.d.ts +71 -0
- package/dist/features/delegation-enforcer.d.ts.map +1 -0
- package/dist/features/delegation-enforcer.js +128 -0
- package/dist/features/delegation-enforcer.js.map +1 -0
- package/dist/features/index.d.ts +3 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +18 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/state-manager/index.d.ts +100 -0
- package/dist/features/state-manager/index.d.ts.map +1 -0
- package/dist/features/state-manager/index.js +407 -0
- package/dist/features/state-manager/index.js.map +1 -0
- package/dist/features/state-manager/types.d.ts +147 -0
- package/dist/features/state-manager/types.d.ts.map +1 -0
- package/dist/features/state-manager/types.js +30 -0
- package/dist/features/state-manager/types.js.map +1 -0
- package/dist/features/task-decomposer/index.d.ts +33 -0
- package/dist/features/task-decomposer/index.d.ts.map +1 -0
- package/dist/features/task-decomposer/index.js +698 -0
- package/dist/features/task-decomposer/index.js.map +1 -0
- package/dist/features/task-decomposer/types.d.ts +133 -0
- package/dist/features/task-decomposer/types.d.ts.map +1 -0
- package/dist/features/task-decomposer/types.js +8 -0
- package/dist/features/task-decomposer/types.js.map +1 -0
- package/dist/features/verification/example.d.ts +49 -0
- package/dist/features/verification/example.d.ts.map +1 -0
- package/dist/features/verification/example.js +235 -0
- package/dist/features/verification/example.js.map +1 -0
- package/dist/features/verification/index.d.ts +97 -0
- package/dist/features/verification/index.d.ts.map +1 -0
- package/dist/features/verification/index.js +439 -0
- package/dist/features/verification/index.js.map +1 -0
- package/dist/features/verification/types.d.ts +142 -0
- package/dist/features/verification/types.d.ts.map +1 -0
- package/dist/features/verification/types.js +7 -0
- package/dist/features/verification/types.js.map +1 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts.map +1 -1
- package/dist/hooks/agent-usage-reminder/constants.js +0 -1
- package/dist/hooks/agent-usage-reminder/constants.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/cancel.test.js +4 -4
- package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/summary.test.js +1 -1
- package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -1
- package/dist/hooks/autopilot/__tests__/transition.test.js +1 -2
- package/dist/hooks/autopilot/__tests__/transition.test.js.map +1 -1
- package/dist/hooks/autopilot/cancel.js +2 -2
- package/dist/hooks/autopilot/cancel.js.map +1 -1
- package/dist/hooks/autopilot/enforcement.d.ts +16 -2
- package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
- package/dist/hooks/autopilot/enforcement.js +78 -4
- package/dist/hooks/autopilot/enforcement.js.map +1 -1
- package/dist/hooks/autopilot/index.d.ts +3 -6
- package/dist/hooks/autopilot/index.d.ts.map +1 -1
- package/dist/hooks/autopilot/index.js +6 -12
- package/dist/hooks/autopilot/index.js.map +1 -1
- package/dist/hooks/autopilot/state.d.ts +36 -2
- package/dist/hooks/autopilot/state.d.ts.map +1 -1
- package/dist/hooks/autopilot/state.js +216 -2
- package/dist/hooks/autopilot/state.js.map +1 -1
- package/dist/hooks/autopilot/validation.d.ts +23 -2
- package/dist/hooks/autopilot/validation.d.ts.map +1 -1
- package/dist/hooks/autopilot/validation.js +158 -1
- package/dist/hooks/autopilot/validation.js.map +1 -1
- package/dist/hooks/bridge.js +3 -3
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/index.d.ts +5 -9
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +31 -21
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/learner/promotion.js +1 -1
- package/dist/hooks/learner/promotion.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +2 -3
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/ralph/index.d.ts +11 -0
- package/dist/hooks/ralph/index.d.ts.map +1 -0
- package/dist/hooks/ralph/index.js +53 -0
- package/dist/hooks/ralph/index.js.map +1 -0
- package/dist/hooks/ralph/loop.d.ts +116 -0
- package/dist/hooks/ralph/loop.d.ts.map +1 -0
- package/dist/hooks/ralph/loop.js +322 -0
- package/dist/hooks/ralph/loop.js.map +1 -0
- package/dist/hooks/ralph/prd.d.ts +130 -0
- package/dist/hooks/ralph/prd.d.ts.map +1 -0
- package/dist/hooks/ralph/prd.js +310 -0
- package/dist/hooks/ralph/prd.js.map +1 -0
- package/dist/hooks/ralph/progress.d.ts +102 -0
- package/dist/hooks/ralph/progress.d.ts.map +1 -0
- package/dist/hooks/ralph/progress.js +408 -0
- package/dist/hooks/ralph/progress.js.map +1 -0
- package/dist/hooks/ralph/verifier.d.ts +72 -0
- package/dist/hooks/ralph/verifier.d.ts.map +1 -0
- package/dist/hooks/ralph/verifier.js +223 -0
- package/dist/hooks/ralph/verifier.js.map +1 -0
- package/dist/hooks/recovery/constants.d.ts +114 -0
- package/dist/hooks/recovery/constants.d.ts.map +1 -0
- package/dist/hooks/recovery/constants.js +227 -0
- package/dist/hooks/recovery/constants.js.map +1 -0
- package/dist/hooks/recovery/context-window.d.ts +24 -0
- package/dist/hooks/recovery/context-window.d.ts.map +1 -0
- package/dist/hooks/recovery/context-window.js +321 -0
- package/dist/hooks/recovery/context-window.js.map +1 -0
- package/dist/hooks/recovery/edit-error.d.ts +24 -0
- package/dist/hooks/recovery/edit-error.d.ts.map +1 -0
- package/dist/hooks/recovery/edit-error.js +56 -0
- package/dist/hooks/recovery/edit-error.js.map +1 -0
- package/dist/hooks/recovery/index.d.ts +102 -0
- package/dist/hooks/recovery/index.d.ts.map +1 -0
- package/dist/hooks/recovery/index.js +166 -0
- package/dist/hooks/recovery/index.js.map +1 -0
- package/dist/hooks/recovery/session-recovery.d.ts +24 -0
- package/dist/hooks/recovery/session-recovery.d.ts.map +1 -0
- package/dist/hooks/recovery/session-recovery.js +281 -0
- package/dist/hooks/recovery/session-recovery.js.map +1 -0
- package/dist/hooks/recovery/storage.d.ts +75 -0
- package/dist/hooks/recovery/storage.d.ts.map +1 -0
- package/dist/hooks/recovery/storage.js +382 -0
- package/dist/hooks/recovery/storage.js.map +1 -0
- package/dist/hooks/recovery/types.d.ts +196 -0
- package/dist/hooks/recovery/types.d.ts.map +1 -0
- package/dist/hooks/recovery/types.js +32 -0
- package/dist/hooks/recovery/types.js.map +1 -0
- package/dist/hooks/ultrapilot/index.d.ts +90 -0
- package/dist/hooks/ultrapilot/index.d.ts.map +1 -0
- package/dist/hooks/ultrapilot/index.js +310 -0
- package/dist/hooks/ultrapilot/index.js.map +1 -0
- package/dist/hooks/ultrapilot/state.d.ts +72 -0
- package/dist/hooks/ultrapilot/state.d.ts.map +1 -0
- package/dist/hooks/ultrapilot/state.js +258 -0
- package/dist/hooks/ultrapilot/state.js.map +1 -0
- package/dist/hooks/ultrapilot/types.d.ts +113 -0
- package/dist/hooks/ultrapilot/types.d.ts.map +1 -0
- package/dist/hooks/ultrapilot/types.js +36 -0
- package/dist/hooks/ultrapilot/types.js.map +1 -0
- package/dist/hooks/ultraqa/index.d.ts +94 -0
- package/dist/hooks/ultraqa/index.d.ts.map +1 -0
- package/dist/hooks/ultraqa/index.js +216 -0
- package/dist/hooks/ultraqa/index.js.map +1 -0
- package/dist/hooks/ultrawork/index.d.ts +62 -0
- package/dist/hooks/ultrawork/index.d.ts.map +1 -0
- package/dist/hooks/ultrawork/index.js +208 -0
- package/dist/hooks/ultrawork/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/installer/index.d.ts +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +1 -1
- package/dist/installer/index.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/servers.d.ts +2 -18
- package/dist/mcp/servers.d.ts.map +1 -1
- package/dist/mcp/servers.js +4 -36
- package/dist/mcp/servers.js.map +1 -1
- package/dist/shared/types.d.ts +1 -3
- package/dist/shared/types.d.ts.map +1 -1
- package/docs/CLAUDE.md +170 -44
- package/docs/DELEGATION-ENFORCER.md +282 -0
- package/docs/FULL-README.md +1 -1
- package/docs/LOCAL_PLUGIN_INSTALL.md +1 -1
- package/docs/MIGRATION.md +298 -104
- package/package.json +2 -2
- package/scripts/test-mutual-exclusion.ts +1 -1
- package/skills/analyze/SKILL.md +0 -1
- package/skills/autopilot/SKILL.md +0 -1
- package/skills/cancel/SKILL.md +580 -0
- package/skills/cancel-autopilot/SKILL.md +0 -1
- package/skills/cancel-ecomode/SKILL.md +41 -0
- package/skills/cancel-ralph/SKILL.md +0 -1
- package/skills/cancel-ultraqa/SKILL.md +0 -1
- package/skills/cancel-ultrawork/SKILL.md +0 -1
- package/skills/deepinit/SKILL.md +0 -1
- package/skills/deepsearch/SKILL.md +0 -1
- package/skills/doctor/SKILL.md +0 -1
- package/skills/ecomode/SKILL.md +128 -0
- package/skills/frontend-ui-ux/SKILL.md +0 -1
- package/skills/git-master/SKILL.md +0 -1
- package/skills/help/SKILL.md +1 -2
- package/skills/hud/SKILL.md +0 -1
- package/skills/learner/SKILL.md +0 -1
- package/skills/mcp-setup/SKILL.md +8 -7
- package/skills/note/SKILL.md +0 -1
- package/skills/omc-default/SKILL.md +0 -1
- package/skills/omc-default-global/SKILL.md +0 -1
- package/skills/omc-setup/SKILL.md +176 -10
- package/skills/orchestrate/SKILL.md +0 -1
- package/skills/pipeline/SKILL.md +417 -0
- package/skills/plan/SKILL.md +138 -21
- package/skills/planner/SKILL.md +0 -1
- package/skills/ralph/SKILL.md +65 -1
- package/skills/ralph-init/SKILL.md +0 -1
- package/skills/ralplan/SKILL.md +0 -1
- package/skills/release/SKILL.md +0 -1
- package/skills/research/SKILL.md +0 -1
- package/skills/review/SKILL.md +0 -1
- package/skills/swarm/SKILL.md +349 -0
- package/skills/tdd/SKILL.md +0 -1
- package/skills/ultrapilot/SKILL.md +563 -0
- package/skills/ultraqa/SKILL.md +0 -1
- package/skills/ultrawork/SKILL.md +0 -1
- 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
|
package/docs/FULL-README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
# oh-my-claudecode
|
|
12
12
|
|
|
13
|
-
[](https://github.com/Yeachan-Heo/oh-my-claudecode)
|
|
14
14
|
[](https://www.npmjs.com/package/oh-my-claudecode)
|
|
15
15
|
[](https://opensource.org/licenses/MIT)
|
|
16
16
|
[](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
|
|
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"],
|