ima-claude 2.20.0 → 2.26.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 (80) hide show
  1. package/README.md +74 -9
  2. package/dist/cli.js +2 -1
  3. package/package.json +1 -1
  4. package/plugins/ima-claude/.claude-plugin/plugin.json +2 -2
  5. package/plugins/ima-claude/agents/explorer.md +29 -15
  6. package/plugins/ima-claude/agents/implementer.md +58 -13
  7. package/plugins/ima-claude/agents/memory.md +19 -19
  8. package/plugins/ima-claude/agents/reviewer.md +84 -34
  9. package/plugins/ima-claude/agents/tester.md +59 -16
  10. package/plugins/ima-claude/agents/wp-developer.md +66 -21
  11. package/plugins/ima-claude/hooks/bootstrap.sh +42 -44
  12. package/plugins/ima-claude/hooks/prompt_coach_digest.md +14 -17
  13. package/plugins/ima-claude/hooks/prompt_coach_system.md +10 -12
  14. package/plugins/ima-claude/personalities/README.md +17 -6
  15. package/plugins/ima-claude/personalities/enable-efficient.md +61 -0
  16. package/plugins/ima-claude/personalities/enable-terse.md +71 -0
  17. package/plugins/ima-claude/skills/agentic-workflows/SKILL.md +35 -71
  18. package/plugins/ima-claude/skills/architect/SKILL.md +54 -168
  19. package/plugins/ima-claude/skills/compound-bridge/SKILL.md +41 -94
  20. package/plugins/ima-claude/skills/design-to-code/SKILL.md +43 -78
  21. package/plugins/ima-claude/skills/discourse/SKILL.md +79 -194
  22. package/plugins/ima-claude/skills/discourse-admin/SKILL.md +41 -103
  23. package/plugins/ima-claude/skills/docs-organize/SKILL.md +63 -203
  24. package/plugins/ima-claude/skills/ember-discourse/SKILL.md +90 -200
  25. package/plugins/ima-claude/skills/espocrm/SKILL.md +14 -23
  26. package/plugins/ima-claude/skills/espocrm-api/SKILL.md +79 -192
  27. package/plugins/ima-claude/skills/functional-programmer/SKILL.md +33 -237
  28. package/plugins/ima-claude/skills/gh-cli/SKILL.md +26 -65
  29. package/plugins/ima-claude/skills/ima-bootstrap/SKILL.md +71 -104
  30. package/plugins/ima-claude/skills/ima-bootstrap/references/ima-brand.md +32 -22
  31. package/plugins/ima-claude/skills/ima-brand/SKILL.md +18 -23
  32. package/plugins/ima-claude/skills/ima-copywriting/SKILL.md +68 -179
  33. package/plugins/ima-claude/skills/ima-doc2pdf/SKILL.md +32 -102
  34. package/plugins/ima-claude/skills/ima-editorial-scorecard/SKILL.md +38 -63
  35. package/plugins/ima-claude/skills/ima-editorial-workflow/SKILL.md +69 -114
  36. package/plugins/ima-claude/skills/ima-email-creator/SKILL.md +16 -22
  37. package/plugins/ima-claude/skills/ima-forms-expert/SKILL.md +21 -37
  38. package/plugins/ima-claude/skills/ima-git/SKILL.md +81 -0
  39. package/plugins/ima-claude/skills/jira-checkpoint/SKILL.md +39 -120
  40. package/plugins/ima-claude/skills/jquery/SKILL.md +107 -233
  41. package/plugins/ima-claude/skills/js-fp/SKILL.md +75 -296
  42. package/plugins/ima-claude/skills/js-fp-api/SKILL.md +52 -162
  43. package/plugins/ima-claude/skills/js-fp-react/SKILL.md +47 -270
  44. package/plugins/ima-claude/skills/js-fp-vue/SKILL.md +55 -209
  45. package/plugins/ima-claude/skills/js-fp-wordpress/SKILL.md +59 -204
  46. package/plugins/ima-claude/skills/livecanvas/SKILL.md +19 -32
  47. package/plugins/ima-claude/skills/mcp-atlassian/SKILL.md +92 -162
  48. package/plugins/ima-claude/skills/mcp-context7/SKILL.md +32 -64
  49. package/plugins/ima-claude/skills/mcp-gitea/SKILL.md +98 -188
  50. package/plugins/ima-claude/skills/mcp-github/SKILL.md +60 -124
  51. package/plugins/ima-claude/skills/mcp-memory/SKILL.md +1 -177
  52. package/plugins/ima-claude/skills/mcp-qdrant/SKILL.md +58 -115
  53. package/plugins/ima-claude/skills/mcp-sequential/SKILL.md +32 -87
  54. package/plugins/ima-claude/skills/mcp-serena/SKILL.md +54 -80
  55. package/plugins/ima-claude/skills/mcp-tavily/SKILL.md +40 -63
  56. package/plugins/ima-claude/skills/mcp-vestige/SKILL.md +75 -116
  57. package/plugins/ima-claude/skills/php-authnet/SKILL.md +32 -65
  58. package/plugins/ima-claude/skills/php-fp/SKILL.md +50 -129
  59. package/plugins/ima-claude/skills/php-fp-wordpress/SKILL.md +25 -73
  60. package/plugins/ima-claude/skills/phpunit-wp/SKILL.md +103 -463
  61. package/plugins/ima-claude/skills/playwright/SKILL.md +69 -220
  62. package/plugins/ima-claude/skills/prompt-starter/SKILL.md +33 -83
  63. package/plugins/ima-claude/skills/prompt-starter/references/code-review.md +38 -0
  64. package/plugins/ima-claude/skills/py-fp/SKILL.md +78 -384
  65. package/plugins/ima-claude/skills/quasar-fp/SKILL.md +54 -255
  66. package/plugins/ima-claude/skills/quickstart/SKILL.md +7 -11
  67. package/plugins/ima-claude/skills/rails/SKILL.md +63 -184
  68. package/plugins/ima-claude/skills/resume-session/SKILL.md +14 -35
  69. package/plugins/ima-claude/skills/rg/SKILL.md +61 -146
  70. package/plugins/ima-claude/skills/ruby-fp/SKILL.md +66 -163
  71. package/plugins/ima-claude/skills/save-session/SKILL.md +10 -39
  72. package/plugins/ima-claude/skills/scorecard/SKILL.md +42 -40
  73. package/plugins/ima-claude/skills/skill-analyzer/SKILL.md +42 -71
  74. package/plugins/ima-claude/skills/skill-creator/SKILL.md +79 -250
  75. package/plugins/ima-claude/skills/task-master/SKILL.md +11 -31
  76. package/plugins/ima-claude/skills/task-planner/SKILL.md +44 -153
  77. package/plugins/ima-claude/skills/task-runner/SKILL.md +61 -143
  78. package/plugins/ima-claude/skills/unit-testing/SKILL.md +59 -134
  79. package/plugins/ima-claude/skills/wp-ddev/SKILL.md +38 -120
  80. package/plugins/ima-claude/skills/wp-local/SKILL.md +26 -108
@@ -5,224 +5,115 @@ description: "Decomposition and planning sub-skill. Breaks work into Epic > Stor
5
5
 
6
6
  # Task Planner - Structured Work Breakdown
7
7
 
8
- **"Slow is smooth, smooth is fast."**
8
+ Plan before implementing. Every hour of planning prevents rework.
9
9
 
10
- Complex work fails when we dive in without structure. This skill provides a systematic approach to breaking down work and choosing the right storage.
10
+ ## Work Hierarchy
11
11
 
12
- ## Core Philosophy
13
-
14
- ### The Planning Imperative
15
-
16
- **Think before acting. Plan before implementing.**
17
-
18
- Every hour of planning saves 10 hours of rework. The urge to "just start coding" is the enemy of clean architecture and maintainable systems.
19
-
20
- ```
21
- Unplanned work → Rework → Technical debt → More rework
22
- Planned work → Clean implementation → Iteration → Progress
23
12
  ```
24
-
25
- ### The Hierarchy of Work
26
-
27
- ```
28
- Epic (Big Goal)
29
- ├── Story (Deliverable Outcome)
30
- │ ├── Task (Actionable Step)
31
- │ ├── Task
32
- │ └── Task
33
- ├── Story
34
- │ ├── Task
13
+ Epic (large goal, multi-session)
14
+ ├── Story (deliverable outcome with value)
15
+ │ ├── Task (single actionable step, <2 hours)
35
16
  │ └── Task
36
17
  └── Story
37
18
  └── Task
38
19
  ```
39
20
 
40
- **Definitions:**
41
- - **Epic**: A large goal spanning multiple sessions (e.g., "Implement user authentication system")
42
- - **Story**: A coherent deliverable that provides value (e.g., "Users can log in with email/password")
43
- - **Task**: A single actionable step, completable in one session (e.g., "Create login form component")
21
+ If a task exceeds 2 hours or requires context switches, break it down further.
44
22
 
45
- **Rule:** If a task takes more than 2 hours or requires context switches, break it down further.
46
-
47
- ## Storage Strategy Decision Tree
23
+ ## Storage Decision Tree
48
24
 
49
25
  ```
50
- Is Serena MCP available?
51
- ├── Yes → Does this need to persist across sessions?
26
+ Serena MCP available?
27
+ ├── Yes → Needs cross-session persistence?
52
28
  │ ├── Yes → Serena Memory (write_memory/read_memory)
53
29
  │ └── No → Claude Task List (TaskCreate/TaskUpdate)
54
-
55
- └── No Does this need to persist across sessions?
56
- ├── Yes → Markdown file (docs/PLANNING.md or similar)
30
+ └── No → Needs cross-session persistence?
31
+ ├── Yes Markdown file (docs/PLANNING.md)
57
32
  └── No → Claude Task List (survives compacts)
58
33
  ```
59
34
 
60
- ### When to Use Each
61
-
62
- | Storage | Use Case | Survives | Example |
63
- |---------|----------|----------|---------|
64
- | **Serena Memory** | Big-picture milestones, decisions, project state | Sessions | "Phase 1 complete, moving to Phase 2" |
65
- | **Claude Task List** | In-session tracking, current work items | Compacts | "[ ] Implement validation [ ] Add tests" |
66
- | **Markdown File** | No Serena, need persistence, team visibility | Forever | `docs/PLANNING.md` with full breakdown |
35
+ | Storage | Survives | Use Case |
36
+ |---------|----------|----------|
37
+ | **Serena Memory** | Sessions | Milestones, decisions, project state |
38
+ | **Claude Task List** | Compacts | In-session tracking, current work items |
39
+ | **Markdown File** | Forever | No Serena, need persistence or team visibility |
67
40
 
68
- ### Serena Memory Pattern
69
-
70
- For cross-session persistence of project state:
41
+ ## Storage Patterns
71
42
 
43
+ **Serena Memory:**
72
44
  ```
73
- # Save project state
74
45
  mcp__serena__write_memory
75
46
  memory_file_name: "planning-{project-name}"
76
47
  content: |
77
48
  # Project: {name}
78
49
  ## Current Phase: 2 - Core Implementation
79
-
80
50
  ## Completed
81
- - [x] Phase 1: Project setup and architecture
82
-
51
+ - [x] Phase 1: Setup and architecture
83
52
  ## In Progress
84
53
  - [ ] Story: User authentication
85
54
  - [x] Task: Database schema
86
55
  - [ ] Task: Login endpoint
87
- - [ ] Task: Session management
88
-
89
56
  ## Upcoming
90
57
  - Phase 3: Testing and polish
91
58
 
92
- # Resume later
93
59
  mcp__serena__read_memory
94
60
  memory_file_name: "planning-{project-name}"
95
61
  ```
96
62
 
97
- ### Claude Task List Pattern
98
-
99
- For in-session work tracking (survives context compaction):
100
-
63
+ **Claude Task List:**
101
64
  ```
102
- # Create tasks for current work
103
65
  TaskCreate
104
66
  description: "Implement login form validation"
105
67
  status: "in_progress"
106
68
  priority: "high"
107
69
 
108
- TaskCreate
109
- description: "Add unit tests for auth service"
110
- status: "pending"
111
- priority: "medium"
112
-
113
- # Update as you work
114
70
  TaskUpdate
115
71
  id: {task-id}
116
72
  status: "completed"
117
73
 
118
- # Check status
119
74
  TaskList
120
75
  ```
121
76
 
122
- ### Markdown Fallback Pattern
123
-
124
- **Note:** When using Markdown, use the `docs-organize` Skill for proper file/folder structure
125
-
126
- When Serena isn't available but you need persistence:
127
-
77
+ **Markdown fallback** (use `docs-organize` skill for file placement):
128
78
  ```markdown
129
- <!-- docs/PLANNING.md -->
130
- # Project Planning
131
-
132
79
  ## Epic: User Authentication System
133
80
 
134
- ### Story: Email/Password Login
135
- **Status:** In Progress
136
-
81
+ ### Story: Email/Password Login — In Progress
137
82
  - [x] Task: Create users table migration
138
- - [x] Task: Implement password hashing utility
139
83
  - [ ] Task: Create login endpoint
140
- - [ ] Task: Add session management
141
84
  - [ ] Task: Write integration tests
142
-
143
- ### Story: Password Reset Flow
144
- **Status:** Not Started
145
-
146
- - [ ] Task: Create password reset tokens table
147
- - [ ] Task: Implement reset email sender
148
- - [ ] Task: Create reset confirmation endpoint
149
- ```
150
-
151
- ## The Breakdown Process
152
-
153
- ### Step 1: Define the Epic
154
-
155
- Start with the end state:
156
- ```
157
- "Users can authenticate via email/password, reset forgotten passwords,
158
- and stay logged in across browser sessions."
159
- ```
160
-
161
- ### Step 2: Identify Stories
162
-
163
- What deliverable outcomes compose the epic?
164
- ```
165
- 1. Users can log in with email/password
166
- 2. Users can register new accounts
167
- 3. Users can reset forgotten passwords
168
- 4. Sessions persist across browser restarts
169
85
  ```
170
86
 
171
- ### Step 3: Decompose into Tasks
172
-
173
- For each story, what specific steps are needed?
174
- ```
175
- Story: Users can log in with email/password
176
- ├── Create users table with email, password_hash columns
177
- ├── Implement password hashing utility (use bcrypt)
178
- ├── Create POST /api/auth/login endpoint
179
- ├── Add login form component
180
- ├── Connect form to API
181
- └── Add error handling for invalid credentials
182
- ```
87
+ ## Breakdown Process
183
88
 
184
- ### Step 4: Estimate and Sequence
89
+ 1. **Define Epic** one sentence end state
90
+ 2. **Identify Stories** — deliverable outcomes composing the epic
91
+ 3. **Decompose Tasks** — specific steps per story, each <2 hours
92
+ 4. **Sequence** — mark dependencies, estimate effort
93
+ 5. **Store** — use decision tree above, then execute
185
94
 
186
- Mark dependencies and rough effort:
95
+ **Example sequencing:**
187
96
  ```
188
97
  1. [15m] Create users table ─┐
189
- 2. [30m] Password hashing ─┼─→ 3. [45m] Login endpoint ─→ 5. [30m] Connect form
190
- 4. [30m] Login form component ─────────────────────────────┘
98
+ 2. [30m] Password hashing ─┼─→ 3. [45m] Login endpoint 5. [30m] Connect form
99
+ 4. [30m] Login form ─────────┘
191
100
  6. [30m] Error handling (after 5)
192
101
  ```
193
102
 
194
- ### Step 5: Choose Storage and Execute
195
-
196
- Based on the decision tree above, store appropriately and begin work.
197
-
198
- ## Quick Reference
199
-
200
- ### Breakdown Checklist
201
-
202
- Before starting any significant work:
203
-
204
- - [ ] Can I describe the goal in one sentence?
205
- - [ ] Have I identified all major deliverables (stories)?
206
- - [ ] Is each task completable in under 2 hours?
207
- - [ ] Do I know the dependencies between tasks?
208
- - [ ] Have I chosen appropriate storage (Serena/TaskList/Markdown)?
209
- - [ ] If delegating, does each subagent have minimal, clear context?
210
-
211
- ### Red Flags
103
+ ## Red Flags Stop and Restructure
212
104
 
213
- **Stop and restructure if:**
214
- - A "task" has more than 3 subtasksIt's actually a story
215
- - You're nesting agents 3+ levels deep Flatten the structure
216
- - Subagent needs "full context"Task is too broad
217
- - Task estimate exceeds 2 hours Break down further
218
- - Dependencies form cycles → Rethink the approach
105
+ - "Task" has 3+ subtasks → it's a Story
106
+ - Agents nesting 3+ levelsflatten
107
+ - Subagent needs "full context"task too broad
108
+ - Task estimate >2 hoursbreak down further
109
+ - Dependencies form cyclesrethink approach
219
110
 
220
- ### Anti-Patterns (Planning)
111
+ ## Anti-Patterns
221
112
 
222
- | Anti-Pattern | Problem | Solution |
223
- |--------------|---------|----------|
224
- | "I'll figure it out as I go" | Rework, tangents, debt | Plan first, even 5 minutes |
225
- | "This task is simple enough" | Scope creep | Still write it down |
226
- | "I'll remember the plan" | Context loss after compact | Use TaskList or Serena |
113
+ | Anti-Pattern | Solution |
114
+ |--------------|----------|
115
+ | "I'll figure it out as I go" | Plan first, even 5 minutes |
116
+ | "This task is simple enough" | Still write it down |
117
+ | "I'll remember the plan" | Use TaskList or Serena |
227
118
 
228
- **REQUIRED SUB-SKILL:** After decomposition is complete, use `task-runner` to delegate tasks to agents.
119
+ **REQUIRED:** After decomposition, use `task-runner` to delegate to agents.
@@ -5,188 +5,106 @@ description: "Agent delegation and execution sub-skill. Selects models (opus/son
5
5
 
6
6
  # Task Runner - Agent Delegation & Execution
7
7
 
8
- **You are the Orchestrator. You coordinate. Agents implement.**
8
+ You are the Orchestrator. Agents implement. Max nesting: 2 levels deep.
9
9
 
10
- This skill handles the execution phase: delegating decomposed tasks to subagents with the right model, minimal context, and relevant skills.
11
-
12
- ## Agent Delegation Patterns
13
-
14
- ### The Two-Level Rule
15
-
16
- **Maximum nesting: 2 levels deep.**
17
-
18
- ```
19
- Main Claude
20
- ├── Subagent A (specific task)
21
- └── Subagent B (specific task)
22
- ```
23
-
24
- Deeper hierarchies create:
25
- - Debugging nightmares
26
- - Context loss
27
- - Coordination overhead
28
- - Exponential complexity
29
-
30
- **If you think you need 3+ levels, restructure the work instead.**
31
-
32
- ### Named Agents (Preferred)
33
-
34
- **Delegate to named agents when one fits. Fall back to generic agents for edge cases.**
35
-
36
- The plugin provides purpose-built agents with enforced constraints (model, tools, permissions, skills). Use them instead of manually configuring generic agents.
10
+ ## Named Agents (Prefer over generic)
37
11
 
38
12
  ```
39
13
  Agent(agent_type="ima-claude:explorer", ...) # Read-only codebase exploration (haiku)
40
14
  Agent(agent_type="ima-claude:implementer", ...) # Standard implementation (sonnet + FP skills)
41
15
  Agent(agent_type="ima-claude:reviewer", ...) # Code quality review (sonnet, read-only)
16
+ Agent(agent_type="ima-claude:tester", ...) # Test writing/running (sonnet + test skills)
42
17
  Agent(agent_type="ima-claude:wp-developer", ...) # WordPress specialist (sonnet + WP skills)
18
+ Agent(agent_type="ima-claude:memory", ...) # Memory ops (Vestige/Qdrant/Serena)
43
19
  ```
44
20
 
45
- **Agent selection tree:**
46
-
21
+ **Selection tree:**
47
22
  ```
48
23
  What does the subtask need?
49
- ├── Find files, understand structure, explore code?
50
- → ima-claude:explorer (haiku, read-only, cheap/fast)
51
- ├── Implement a feature, fix a bug, write code?
52
- → ima-claude:implementer (sonnet, FP-aware)
53
- ├── WordPress-specific work (plugin, theme, WP-CLI, forms)?
54
- → ima-claude:wp-developer (sonnet, full WP skill bundle)
55
- ├── Review code quality, check for bugs/security?
56
- → ima-claude:reviewer (sonnet, read-only)
57
- ├── Write tests, run test suites, TDD, debug test failures?
58
- │ → ima-claude:tester (sonnet, test orchestration + FP)
59
- ├── Memory operations (search, store, consolidate)?
60
- │ → ima-claude:memory (sonnet, Vestige/Qdrant/Serena)
61
- ├── Needs a custom tool/skill combination?
62
- │ → general-purpose with explicit model parameter
63
- └── Uncertain?
64
- → ima-claude:implementer (safe default)
24
+ ├── Find files, explore code? → ima-claude:explorer (haiku, read-only, cheap)
25
+ ├── Implement, fix, refactor? → ima-claude:implementer (sonnet, FP-aware)
26
+ ├── WordPress (plugin/theme/WP-CLI)? → ima-claude:wp-developer (sonnet, full WP bundle)
27
+ ├── Review code quality/security? → ima-claude:reviewer (sonnet, read-only)
28
+ ├── Write/run tests, TDD? → ima-claude:tester (sonnet)
29
+ ├── Memory search/store/consolidate? → ima-claude:memory (sonnet)
30
+ ├── Custom tool/skill combo? → generic agent with explicit model
31
+ └── Uncertain? → ima-claude:implementer (safe default)
65
32
  ```
66
33
 
67
34
  | Agent | Model | Mode | Use For |
68
35
  |-------|-------|------|---------|
69
- | **explorer** | haiku | read-only | File discovery, architecture understanding, code search |
70
- | **implementer** | sonnet | full access | Feature dev, bug fixes, refactoring, tests |
71
- | **reviewer** | sonnet | read-only | Code review, security audit, FP compliance |
72
- | **tester** | sonnet | full access | Test creation, test running, TDD, debugging failures |
73
- | **wp-developer** | sonnet | full access | WordPress plugins, themes, WP-CLI, forms, Bootstrap |
74
- | **memory** | sonnet | full access | Memory search, storage, consolidation (Vestige/Qdrant/Serena) |
75
-
76
- ### Model Selection (Generic Agents)
36
+ | **explorer** | haiku | read-only | File discovery, architecture, code search |
37
+ | **implementer** | sonnet | full | Feature dev, bug fixes, refactoring |
38
+ | **reviewer** | sonnet | read-only | Code review, security, FP compliance |
39
+ | **tester** | sonnet | full | Test creation, TDD, debugging failures |
40
+ | **wp-developer** | sonnet | full | WordPress plugins, themes, WP-CLI |
41
+ | **memory** | sonnet | full | Vestige/Qdrant/Serena memory ops |
77
42
 
78
- For tasks that don't fit a named agent, fall back to generic agents with explicit model selection.
43
+ ## Model Selection (Generic Agents)
79
44
 
80
- **Opus orchestrates. Sonnet executes. Haiku handles the trivial.**
45
+ Opus orchestrates. Sonnet executes. Haiku handles trivial.
81
46
 
82
- | Model | Cost | Use For |
83
- |-------|------|---------|
84
- | **haiku** | Lowest | File searches, quick lookups, simple reads |
85
- | **sonnet** | Medium | Most delegated work: implementation, research, testing, formatting |
86
- | **opus** | Highest | Orchestration (main agent), complex reasoning, architecture decisions |
47
+ | Model | Use For |
48
+ |-------|---------|
49
+ | **haiku** | File searches, quick lookups, simple reads |
50
+ | **sonnet** | Most delegated work: implementation, research, testing |
51
+ | **opus** | Orchestration, complex reasoning, ambiguous trade-offs |
87
52
 
88
- **Rule of thumb:** If you can describe the task in 2-3 sentences with clear success criteria,
89
- Sonnet can handle it. If the agent needs to make judgment calls about ambiguous trade-offs,
90
- consider Opus.
53
+ ## Minimal Context Principle
91
54
 
92
- ### Minimal Context Principle
93
-
94
- **Give subagents only what they need: task in, result out.**
55
+ Give subagents only what they need.
95
56
 
96
57
  ```
97
- Bad: "Here's the full project context, all decisions we've made,
98
- the entire codebase history, and now please also add a button."
99
-
100
- Good: "Add a submit button to /src/components/LoginForm.vue that
101
- calls the onSubmit prop. Return the updated file."
58
+ Bad: Full project history + all decisions + "also add a button"
59
+ Good: "Add submit button to /src/components/LoginForm.vue calling onSubmit prop. Return updated file."
102
60
  ```
103
61
 
104
- **The 80% Rule:** 80% of subagent tasks should be completely isolated. They get:
105
- - The specific task
106
- - The specific file(s) to modify
107
- - The expected output format
62
+ 80% of subagent tasks are fully isolated: specific task + specific file(s) + expected output. No project history, no architectural decisions, no other tasks.
108
63
 
109
- They don't get:
110
- - Project history
111
- - Architectural decisions
112
- - Other tasks
113
- - Your reasoning process
64
+ ## Decomposition Patterns
114
65
 
115
- ### Vertical vs Horizontal Decomposition
116
-
117
- **Vertical (Sequential):** When steps depend on each other.
66
+ **Vertical (sequential):** Steps depend on each other → execute in order.
118
67
  ```
119
- Step 1: Create database schema
120
-
121
- Step 2: Implement data access layer
122
-
123
- Step 3: Build API endpoints
124
-
125
- Step 4: Create UI components
68
+ Schema Data layer → API endpoints → UI components
126
69
  ```
127
- *Execute in order. Each step needs the previous step's output.*
128
70
 
129
- **Horizontal (Parallel):** When steps are independent.
71
+ **Horizontal (parallel):** Independent steps execute concurrently.
130
72
  ```
131
- ┌─────────────────────────────────────────┐
132
- │ Main Claude (coordinator) │
133
- ├──────────┬──────────┬──────────┬────────┤
134
- │ Agent A │ Agent B │ Agent C │ Agent D│
135
- │ Login UI │ Auth API │ DB Setup │ Tests │
136
- └──────────┴──────────┴──────────┴────────┘
73
+ Main Claude → [Login UI | Auth API | DB Setup | Tests]
137
74
  ```
138
- *Execute in parallel when tasks don't share state or dependencies.*
139
-
140
- ### Delegation Decision Framework
141
-
142
- Before delegating to a subagent, ask:
143
-
144
- **1. Is the task clearly bounded?**
145
- - Can you describe the input and expected output in 2-3 sentences?
146
- - Are the success criteria unambiguous?
147
- - No? → Break it down further before delegating.
148
75
 
149
- **2. Does it require shared state?**
150
- - Does the agent need to modify files another agent is touching?
151
- - Does it need context from other ongoing work?
152
- - Yes? → Don't parallelize. Do sequentially or yourself.
76
+ ## Delegation Checklist
153
77
 
154
- **3. Is the context minimal?**
155
- - Can the agent succeed with just the task description?
156
- - Do they need more than 1-2 files for context?
157
- - No? Simplify the task or provide only essential context.
78
+ Before delegating, verify:
79
+ 1. **Bounded?** Task describable in 2-3 sentences with clear success criteria
80
+ 2. **No shared state?** Agent won't conflict with other agents' files
81
+ 3. **Minimal context?** Agent succeeds with task + 1-2 files max
82
+ 4. **Failure safe?** Can retry or fix without cascading
83
+ 5. **Escalation-aware?** Expect three return shapes — success, failure, **ESCALATION**. Don't treat escalation as failure.
158
84
 
159
- **4. What's the failure mode?**
160
- - If the subagent fails, can you retry or fix easily?
161
- - Does failure cascade to other work?
162
- - High risk? → Do it yourself or add verification.
85
+ ## Handling ESCALATION returns (advisor pattern)
163
86
 
164
- **5. What model does this need?**
165
- - Is the task well-scoped with clear criteria? → `model: "sonnet"`
166
- - Is it a quick file search or lookup? → `model: "haiku"`
167
- - Does it require complex reasoning or ambiguous trade-offs? → `model: "opus"`
168
- - Default to Sonnet. Opus orchestrates, Sonnet executes.
87
+ Executor agents return `ESCALATION: <trigger>` when they hit out-of-scope forks (scope drift, architectural fork, security-sensitive changes, repeated failure, ambiguous requirements). This is the designed-in advisor channel — parent (Opus) is the advisor.
169
88
 
170
- ### Anti-Patterns (Delegation)
89
+ When an agent returns ESCALATION:
171
90
 
172
- | Anti-Pattern | Problem | Solution |
173
- |--------------|---------|----------|
174
- | "The agent needs everything" | Context overload, errors | Minimal context principle |
175
- | "Just one more level of agents" | Debugging nightmare | Max 2 levels, restructure |
176
- | "Every agent needs Opus" | Wastes expensive tokens | Sonnet for most tasks, Opus for orchestration |
91
+ 1. Read the structured report `Did`, `Blocked on`, `Options`, `Recommendation`, `Files touched`
92
+ 2. Decide — continue as planned, narrow the task, expand the scope, abandon, or ask the human (AskUserQuestion)
93
+ 3. Re-dispatch with explicit guidance do NOT just retry the same prompt. Add the decision to the new task.
177
94
 
178
- ## Integration Points
95
+ Cost shape: Sonnet ran cheap, stopped early, returned a focused question. Opus answers the question. Sonnet resumes with clarity. This is cheaper than letting Sonnet guess wrong and rework.
179
96
 
180
- This skill works with:
181
- - **Named agents** - `ima-claude:explorer`, `ima-claude:implementer`, `ima-claude:reviewer`, `ima-claude:tester`, `ima-claude:wp-developer` preferred delegation targets
182
- - **task-planner** - For decomposition before delegation
183
- - **mcp-serena** - For persistent memory across sessions
184
- - **mcp-vestige** - For cross-project decisions, patterns, and intentions
185
- - **architect** - For evaluating architectural choices during planning
186
- - **save-session / resume-session** - For session state management
97
+ **Do NOT:**
98
+ - Tell agents to "just figure it out"that defeats the escalation channel
99
+ - Treat ESCALATION as retryable failure — it's a request for arbitration, not a crash
100
+ - Re-dispatch without adding the resolution agent will escalate the same thing again
187
101
 
188
- **REQUIRED SUB-SKILL:** If work hasn't been decomposed yet, use `task-planner` first.
102
+ ## Anti-Patterns
189
103
 
190
- ## The Final Word
104
+ | Anti-Pattern | Solution |
105
+ |--------------|----------|
106
+ | "Agent needs everything" | Minimal context — task + files only |
107
+ | "3+ levels of agents" | Max 2 levels — restructure the work |
108
+ | "Every agent needs Opus" | Sonnet for most; Opus orchestrates only |
191
109
 
192
- *"The goal isn't to create perfect plans. It's to think through the work before doing it. A 10-minute planning session that gets revised three times is infinitely better than diving in blind. Master small chunks, then combine. The whole becomes greater than the sum of its parts."*
110
+ **REQUIRED:** If work isn't decomposed yet, use `task-planner` first.