ima-claude 2.9.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 (182) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +463 -0
  3. package/dist/cli.js +1064 -0
  4. package/package.json +49 -0
  5. package/platforms/claude/adapter.ts +115 -0
  6. package/platforms/junie/adapter.ts +254 -0
  7. package/platforms/junie/agents-template.md +113 -0
  8. package/platforms/junie/hook-translations.md +84 -0
  9. package/platforms/shared/detector.ts +27 -0
  10. package/platforms/shared/installer.ts +202 -0
  11. package/platforms/shared/types.ts +78 -0
  12. package/plugins/ima-claude/.claude-plugin/plugin.json +25 -0
  13. package/plugins/ima-claude/agents/explorer.md +30 -0
  14. package/plugins/ima-claude/agents/implementer.md +30 -0
  15. package/plugins/ima-claude/agents/memory.md +42 -0
  16. package/plugins/ima-claude/agents/reviewer.md +53 -0
  17. package/plugins/ima-claude/agents/tester.md +33 -0
  18. package/plugins/ima-claude/agents/wp-developer.md +46 -0
  19. package/plugins/ima-claude/hooks/README.md +145 -0
  20. package/plugins/ima-claude/hooks/atlassian_prereqs.py +112 -0
  21. package/plugins/ima-claude/hooks/block_sed_edits.py +59 -0
  22. package/plugins/ima-claude/hooks/bootstrap.sh +90 -0
  23. package/plugins/ima-claude/hooks/bootstrap_utility_check.py +94 -0
  24. package/plugins/ima-claude/hooks/composer_autoload_check.py +70 -0
  25. package/plugins/ima-claude/hooks/docs_organization.py +104 -0
  26. package/plugins/ima-claude/hooks/enforce_rg_over_grep.py +56 -0
  27. package/plugins/ima-claude/hooks/fp_utility_check.py +90 -0
  28. package/plugins/ima-claude/hooks/hook_logger.py +69 -0
  29. package/plugins/ima-claude/hooks/hooks.json +239 -0
  30. package/plugins/ima-claude/hooks/jira_issue_fetch.py +79 -0
  31. package/plugins/ima-claude/hooks/jquery_in_wordpress.py +92 -0
  32. package/plugins/ima-claude/hooks/memory_bootstrap.py +79 -0
  33. package/plugins/ima-claude/hooks/memory_store_reminder.py +75 -0
  34. package/plugins/ima-claude/hooks/prompt_coach.py +125 -0
  35. package/plugins/ima-claude/hooks/prompt_coach_digest.md +48 -0
  36. package/plugins/ima-claude/hooks/prompt_coach_system.md +30 -0
  37. package/plugins/ima-claude/hooks/sequential_thinking_check.py +81 -0
  38. package/plugins/ima-claude/hooks/serena_over_grep.py +96 -0
  39. package/plugins/ima-claude/hooks/serena_over_read.py +66 -0
  40. package/plugins/ima-claude/hooks/serena_project_check.py +133 -0
  41. package/plugins/ima-claude/hooks/sql_injection_check.py +73 -0
  42. package/plugins/ima-claude/hooks/task_master_after_plan.py +31 -0
  43. package/plugins/ima-claude/hooks/task_master_before_impl.py +93 -0
  44. package/plugins/ima-claude/hooks/tavily_extract_advanced.py +48 -0
  45. package/plugins/ima-claude/hooks/vestige_before_external.py +86 -0
  46. package/plugins/ima-claude/hooks/webfetch_to_tavily.py +42 -0
  47. package/plugins/ima-claude/hooks/websearch_to_tavily.py +41 -0
  48. package/plugins/ima-claude/hooks/wp_security_check.py +150 -0
  49. package/plugins/ima-claude/personalities/README.md +45 -0
  50. package/plugins/ima-claude/personalities/enable-40k.md +69 -0
  51. package/plugins/ima-claude/personalities/enable-templars.md +69 -0
  52. package/plugins/ima-claude/skills/.research-summary.md +340 -0
  53. package/plugins/ima-claude/skills/architect/SKILL.md +304 -0
  54. package/plugins/ima-claude/skills/compound-bridge/SKILL.md +200 -0
  55. package/plugins/ima-claude/skills/discourse/SKILL.md +440 -0
  56. package/plugins/ima-claude/skills/discourse-admin/SKILL.md +192 -0
  57. package/plugins/ima-claude/skills/discourse-admin/references/api-endpoints.md +441 -0
  58. package/plugins/ima-claude/skills/discourse-admin/references/gotchas.md +107 -0
  59. package/plugins/ima-claude/skills/discourse-admin/references/staging-defaults.md +98 -0
  60. package/plugins/ima-claude/skills/discourse-admin/scripts/discourse-admin.py +319 -0
  61. package/plugins/ima-claude/skills/docs-organize/SKILL.md +254 -0
  62. package/plugins/ima-claude/skills/docs-organize/templates/active-README.md +50 -0
  63. package/plugins/ima-claude/skills/docs-organize/templates/archive-README.md +57 -0
  64. package/plugins/ima-claude/skills/docs-organize/templates/docs-README.md +43 -0
  65. package/plugins/ima-claude/skills/docs-organize/templates/phase-archive-README.md +83 -0
  66. package/plugins/ima-claude/skills/docs-organize/templates/section-README.md +48 -0
  67. package/plugins/ima-claude/skills/docs-organize/templates/transient-README.md +79 -0
  68. package/plugins/ima-claude/skills/docs-organize/templates/transient-gitignore +9 -0
  69. package/plugins/ima-claude/skills/ember-discourse/SKILL.md +496 -0
  70. package/plugins/ima-claude/skills/functional-programmer/SKILL.md +258 -0
  71. package/plugins/ima-claude/skills/ima-bootstrap/SKILL.md +278 -0
  72. package/plugins/ima-claude/skills/ima-bootstrap/references/bootstrap-patterns.md +356 -0
  73. package/plugins/ima-claude/skills/ima-bootstrap/references/ima-brand.md +273 -0
  74. package/plugins/ima-claude/skills/ima-bootstrap/references/theme-integration.md +212 -0
  75. package/plugins/ima-claude/skills/ima-brand/SKILL.md +108 -0
  76. package/plugins/ima-claude/skills/ima-brand/references/brand-identity.md +140 -0
  77. package/plugins/ima-claude/skills/ima-brand/references/digital-standards.md +180 -0
  78. package/plugins/ima-claude/skills/ima-brand/references/visual-system.md +173 -0
  79. package/plugins/ima-claude/skills/ima-forms-expert/SKILL.md +175 -0
  80. package/plugins/ima-claude/skills/ima-forms-expert/references/container-components.md +154 -0
  81. package/plugins/ima-claude/skills/ima-forms-expert/references/examples.md +328 -0
  82. package/plugins/ima-claude/skills/ima-forms-expert/references/field-components.md +298 -0
  83. package/plugins/ima-claude/skills/ima-forms-expert/references/form-factory.md +193 -0
  84. package/plugins/ima-claude/skills/ima-forms-expert/references/quick-reference.md +153 -0
  85. package/plugins/ima-claude/skills/ima-forms-expert/references/validation-engine.md +336 -0
  86. package/plugins/ima-claude/skills/jira-checkpoint/SKILL.md +178 -0
  87. package/plugins/ima-claude/skills/jquery/SKILL.md +413 -0
  88. package/plugins/ima-claude/skills/js-fp/SKILL.md +463 -0
  89. package/plugins/ima-claude/skills/js-fp/core-principles.md +487 -0
  90. package/plugins/ima-claude/skills/js-fp/examples/pure-functions.js +260 -0
  91. package/plugins/ima-claude/skills/js-fp/examples/tests/pure-functions.test.js +262 -0
  92. package/plugins/ima-claude/skills/js-fp/references/anti-patterns.md +120 -0
  93. package/plugins/ima-claude/skills/js-fp/references/performance-patterns.md +116 -0
  94. package/plugins/ima-claude/skills/js-fp/references/testing-patterns.md +134 -0
  95. package/plugins/ima-claude/skills/js-fp-api/SKILL.md +280 -0
  96. package/plugins/ima-claude/skills/js-fp-api/examples/crud-endpoint.js +258 -0
  97. package/plugins/ima-claude/skills/js-fp-api/references/middleware-patterns.md +134 -0
  98. package/plugins/ima-claude/skills/js-fp-api/references/security-sql.md +110 -0
  99. package/plugins/ima-claude/skills/js-fp-api/references/validation-patterns.md +165 -0
  100. package/plugins/ima-claude/skills/js-fp-react/SKILL.md +447 -0
  101. package/plugins/ima-claude/skills/js-fp-react/examples/ProductCard.tsx +65 -0
  102. package/plugins/ima-claude/skills/js-fp-react/references/hooks-advanced.md +136 -0
  103. package/plugins/ima-claude/skills/js-fp-react/references/performance-patterns.md +175 -0
  104. package/plugins/ima-claude/skills/js-fp-vue/SKILL.md +322 -0
  105. package/plugins/ima-claude/skills/js-fp-vue/references/complete-examples.md +397 -0
  106. package/plugins/ima-claude/skills/js-fp-vue/references/composables-advanced.md +282 -0
  107. package/plugins/ima-claude/skills/js-fp-vue/references/reactivity-patterns.md +348 -0
  108. package/plugins/ima-claude/skills/js-fp-vue/references/testing.md +314 -0
  109. package/plugins/ima-claude/skills/js-fp-wordpress/SKILL.md +301 -0
  110. package/plugins/ima-claude/skills/js-fp-wordpress/references/ajax-patterns.md +192 -0
  111. package/plugins/ima-claude/skills/js-fp-wordpress/references/event-patterns.md +136 -0
  112. package/plugins/ima-claude/skills/js-fp-wordpress/references/wp-integration.md +248 -0
  113. package/plugins/ima-claude/skills/livecanvas/SKILL.md +209 -0
  114. package/plugins/ima-claude/skills/livecanvas/references/livecanvas-features.md +311 -0
  115. package/plugins/ima-claude/skills/livecanvas/references/loops-and-logic.md +730 -0
  116. package/plugins/ima-claude/skills/livecanvas/references/picostrap.md +227 -0
  117. package/plugins/ima-claude/skills/mcp-atlassian/SKILL.md +339 -0
  118. package/plugins/ima-claude/skills/mcp-context7/SKILL.md +109 -0
  119. package/plugins/ima-claude/skills/mcp-memory/SKILL.md +182 -0
  120. package/plugins/ima-claude/skills/mcp-qdrant/SKILL.md +233 -0
  121. package/plugins/ima-claude/skills/mcp-sequential/SKILL.md +149 -0
  122. package/plugins/ima-claude/skills/mcp-serena/SKILL.md +174 -0
  123. package/plugins/ima-claude/skills/mcp-tavily/SKILL.md +118 -0
  124. package/plugins/ima-claude/skills/mcp-vestige/SKILL.md +259 -0
  125. package/plugins/ima-claude/skills/php-authnet/SKILL.md +275 -0
  126. package/plugins/ima-claude/skills/php-authnet/references/api-reference.md +624 -0
  127. package/plugins/ima-claude/skills/php-authnet/references/sandbox-testing.md +424 -0
  128. package/plugins/ima-claude/skills/php-fp/SKILL.md +333 -0
  129. package/plugins/ima-claude/skills/php-fp/examples/pure-functions.php +403 -0
  130. package/plugins/ima-claude/skills/php-fp/examples/tests/PureFunctionsTest.php +515 -0
  131. package/plugins/ima-claude/skills/php-fp/references/core-principles.md +277 -0
  132. package/plugins/ima-claude/skills/php-fp/references/testing-patterns.md +374 -0
  133. package/plugins/ima-claude/skills/php-fp-wordpress/SKILL.md +216 -0
  134. package/plugins/ima-claude/skills/php-fp-wordpress/references/fp-patterns.md +275 -0
  135. package/plugins/ima-claude/skills/php-fp-wordpress/references/plugin-architecture.md +295 -0
  136. package/plugins/ima-claude/skills/php-fp-wordpress/references/security-examples.md +203 -0
  137. package/plugins/ima-claude/skills/php-fp-wordpress/references/testing-strategy.md +259 -0
  138. package/plugins/ima-claude/skills/phpunit-wp/SKILL.md +716 -0
  139. package/plugins/ima-claude/skills/playwright/SKILL.md +434 -0
  140. package/plugins/ima-claude/skills/playwright/references/accessibility-testing.md +153 -0
  141. package/plugins/ima-claude/skills/playwright/references/ci-cd.md +268 -0
  142. package/plugins/ima-claude/skills/playwright/references/network-mocking.md +270 -0
  143. package/plugins/ima-claude/skills/playwright/references/visual-regression.md +215 -0
  144. package/plugins/ima-claude/skills/py-fp/SKILL.md +663 -0
  145. package/plugins/ima-claude/skills/py-fp/examples/pure-functions.py +185 -0
  146. package/plugins/ima-claude/skills/py-fp/examples/tests/test_pure_functions.py +244 -0
  147. package/plugins/ima-claude/skills/py-fp/references/core-principles.md +381 -0
  148. package/plugins/ima-claude/skills/py-fp/references/testing-patterns.md +283 -0
  149. package/plugins/ima-claude/skills/quasar-fp/SKILL.md +327 -0
  150. package/plugins/ima-claude/skills/quasar-fp/metadata.json +85 -0
  151. package/plugins/ima-claude/skills/quasar-fp/references/component-patterns.md +257 -0
  152. package/plugins/ima-claude/skills/quasar-fp/references/theme-integration.md +233 -0
  153. package/plugins/ima-claude/skills/quasar-fp/references/utility-classes.md +237 -0
  154. package/plugins/ima-claude/skills/quickstart/SKILL.md +129 -0
  155. package/plugins/ima-claude/skills/rails/SKILL.md +359 -0
  156. package/plugins/ima-claude/skills/resume-session/SKILL.md +68 -0
  157. package/plugins/ima-claude/skills/rg/SKILL.md +205 -0
  158. package/plugins/ima-claude/skills/ruby-fp/SKILL.md +336 -0
  159. package/plugins/ima-claude/skills/save-session/SKILL.md +81 -0
  160. package/plugins/ima-claude/skills/scorecard/SKILL.md +96 -0
  161. package/plugins/ima-claude/skills/skill-analyzer/SKILL.md +127 -0
  162. package/plugins/ima-claude/skills/skill-analyzer/references/advanced-checklist.md +44 -0
  163. package/plugins/ima-claude/skills/skill-analyzer/references/core-checklist.md +60 -0
  164. package/plugins/ima-claude/skills/skill-analyzer/scripts/analyze_skill.py +418 -0
  165. package/plugins/ima-claude/skills/skill-creator/LICENSE.txt +202 -0
  166. package/plugins/ima-claude/skills/skill-creator/SKILL.md +343 -0
  167. package/plugins/ima-claude/skills/skill-creator/references/output-patterns.md +82 -0
  168. package/plugins/ima-claude/skills/skill-creator/references/workflows.md +28 -0
  169. package/plugins/ima-claude/skills/skill-creator/scripts/init_skill.py +303 -0
  170. package/plugins/ima-claude/skills/skill-creator/scripts/package_skill.py +110 -0
  171. package/plugins/ima-claude/skills/skill-creator/scripts/quick_validate.py +103 -0
  172. package/plugins/ima-claude/skills/task-master/SKILL.md +51 -0
  173. package/plugins/ima-claude/skills/task-planner/SKILL.md +228 -0
  174. package/plugins/ima-claude/skills/task-runner/SKILL.md +192 -0
  175. package/plugins/ima-claude/skills/unit-testing/SKILL.md +198 -0
  176. package/plugins/ima-claude/skills/unit-testing/references/mock-patterns.md +181 -0
  177. package/plugins/ima-claude/skills/unit-testing/references/tdd-workflow.md +177 -0
  178. package/plugins/ima-claude/skills/unit-testing/references/test-strategy.md +126 -0
  179. package/plugins/ima-claude/skills/wp-local/SKILL.md +246 -0
  180. package/plugins/ima-claude/skills/wp-local/references/configuration.md +198 -0
  181. package/plugins/ima-claude/skills/wp-local/references/wp-cli-reference.md +406 -0
  182. package/plugins/ima-claude/skills/wp-local/scripts/wp-local.sh +61 -0
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: "task-planner"
3
+ description: "Decomposition and planning sub-skill. Breaks work into Epic > Story > Task hierarchy, selects storage strategy (Serena/TaskList/Markdown), and creates structured task lists. Use when work needs to be planned and broken down before execution."
4
+ ---
5
+
6
+ # Task Planner - Structured Work Breakdown
7
+
8
+ **"Slow is smooth, smooth is fast."**
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.
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
+ ```
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
35
+ │ └── Task
36
+ └── Story
37
+ └── Task
38
+ ```
39
+
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")
44
+
45
+ **Rule:** If a task takes more than 2 hours or requires context switches, break it down further.
46
+
47
+ ## Storage Strategy Decision Tree
48
+
49
+ ```
50
+ Is Serena MCP available?
51
+ ├── Yes → Does this need to persist across sessions?
52
+ │ ├── Yes → Serena Memory (write_memory/read_memory)
53
+ │ └── 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)
57
+ └── No → Claude Task List (survives compacts)
58
+ ```
59
+
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 |
67
+
68
+ ### Serena Memory Pattern
69
+
70
+ For cross-session persistence of project state:
71
+
72
+ ```
73
+ # Save project state
74
+ mcp__serena__write_memory
75
+ memory_file_name: "planning-{project-name}"
76
+ content: |
77
+ # Project: {name}
78
+ ## Current Phase: 2 - Core Implementation
79
+
80
+ ## Completed
81
+ - [x] Phase 1: Project setup and architecture
82
+
83
+ ## In Progress
84
+ - [ ] Story: User authentication
85
+ - [x] Task: Database schema
86
+ - [ ] Task: Login endpoint
87
+ - [ ] Task: Session management
88
+
89
+ ## Upcoming
90
+ - Phase 3: Testing and polish
91
+
92
+ # Resume later
93
+ mcp__serena__read_memory
94
+ memory_file_name: "planning-{project-name}"
95
+ ```
96
+
97
+ ### Claude Task List Pattern
98
+
99
+ For in-session work tracking (survives context compaction):
100
+
101
+ ```
102
+ # Create tasks for current work
103
+ TaskCreate
104
+ description: "Implement login form validation"
105
+ status: "in_progress"
106
+ priority: "high"
107
+
108
+ TaskCreate
109
+ description: "Add unit tests for auth service"
110
+ status: "pending"
111
+ priority: "medium"
112
+
113
+ # Update as you work
114
+ TaskUpdate
115
+ id: {task-id}
116
+ status: "completed"
117
+
118
+ # Check status
119
+ TaskList
120
+ ```
121
+
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
+
128
+ ```markdown
129
+ <!-- docs/PLANNING.md -->
130
+ # Project Planning
131
+
132
+ ## Epic: User Authentication System
133
+
134
+ ### Story: Email/Password Login
135
+ **Status:** In Progress
136
+
137
+ - [x] Task: Create users table migration
138
+ - [x] Task: Implement password hashing utility
139
+ - [ ] Task: Create login endpoint
140
+ - [ ] Task: Add session management
141
+ - [ ] 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
+ ```
170
+
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
+ ```
183
+
184
+ ### Step 4: Estimate and Sequence
185
+
186
+ Mark dependencies and rough effort:
187
+ ```
188
+ 1. [15m] Create users table ─┐
189
+ 2. [30m] Password hashing ─┼─→ 3. [45m] Login endpoint ─→ 5. [30m] Connect form
190
+ 4. [30m] Login form component ─────────────────────────────┘
191
+ 6. [30m] Error handling (after 5)
192
+ ```
193
+
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
212
+
213
+ **Stop and restructure if:**
214
+ - A "task" has more than 3 subtasks → It'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
219
+
220
+ ### Anti-Patterns (Planning)
221
+
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 |
227
+
228
+ **REQUIRED SUB-SKILL:** After decomposition is complete, use `task-runner` to delegate tasks to agents.
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: "task-runner"
3
+ description: "Agent delegation and execution sub-skill. Selects models (opus/sonnet/haiku), assigns skills, and delegates tasks to subagents via the Task tool. Use after work has been decomposed by task-planner."
4
+ ---
5
+
6
+ # Task Runner - Agent Delegation & Execution
7
+
8
+ **You are the Orchestrator. You coordinate. Agents implement.**
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.
37
+
38
+ ```
39
+ Agent(agent_type="ima-claude:explorer", ...) # Read-only codebase exploration (haiku)
40
+ Agent(agent_type="ima-claude:implementer", ...) # Standard implementation (sonnet + FP skills)
41
+ Agent(agent_type="ima-claude:reviewer", ...) # Code quality review (sonnet, read-only)
42
+ Agent(agent_type="ima-claude:wp-developer", ...) # WordPress specialist (sonnet + WP skills)
43
+ ```
44
+
45
+ **Agent selection tree:**
46
+
47
+ ```
48
+ 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)
65
+ ```
66
+
67
+ | Agent | Model | Mode | Use For |
68
+ |-------|-------|------|---------|
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)
77
+
78
+ For tasks that don't fit a named agent, fall back to generic agents with explicit model selection.
79
+
80
+ **Opus orchestrates. Sonnet executes. Haiku handles the trivial.**
81
+
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 |
87
+
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.
91
+
92
+ ### Minimal Context Principle
93
+
94
+ **Give subagents only what they need: task in, result out.**
95
+
96
+ ```
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."
102
+ ```
103
+
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
108
+
109
+ They don't get:
110
+ - Project history
111
+ - Architectural decisions
112
+ - Other tasks
113
+ - Your reasoning process
114
+
115
+ ### Vertical vs Horizontal Decomposition
116
+
117
+ **Vertical (Sequential):** When steps depend on each other.
118
+ ```
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
126
+ ```
127
+ *Execute in order. Each step needs the previous step's output.*
128
+
129
+ **Horizontal (Parallel):** When steps are independent.
130
+ ```
131
+ ┌─────────────────────────────────────────┐
132
+ │ Main Claude (coordinator) │
133
+ ├──────────┬──────────┬──────────┬────────┤
134
+ │ Agent A │ Agent B │ Agent C │ Agent D│
135
+ │ Login UI │ Auth API │ DB Setup │ Tests │
136
+ └──────────┴──────────┴──────────┴────────┘
137
+ ```
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
+
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.
153
+
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.
158
+
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.
163
+
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.
169
+
170
+ ### Anti-Patterns (Delegation)
171
+
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 |
177
+
178
+ ## Integration Points
179
+
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
187
+
188
+ **REQUIRED SUB-SKILL:** If work hasn't been decomposed yet, use `task-planner` first.
189
+
190
+ ## The Final Word
191
+
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."*
@@ -0,0 +1,198 @@
1
+ ---
2
+ name: "unit-testing"
3
+ description: "Test workflow orchestration — decision tree routing to domain skills (phpunit-wp, playwright, js-fp, php-fp). TDD, test strategy, mock decisions, quality checklists. Triggers on: unit test, write tests, TDD, test coverage, mock, test strategy."
4
+ ---
5
+
6
+ # Unit Testing - Orchestration Skill
7
+
8
+ **"Test pure core, not impure shell. FP makes testing easy."**
9
+
10
+ This skill orchestrates test workflows by routing to the right domain skills. It does NOT duplicate domain-specific testing patterns — it coordinates them.
11
+
12
+ ## Core Philosophy
13
+
14
+ Pure functions are trivially testable. If something is hard to test, the problem is the code design, not the test setup.
15
+
16
+ 1. **Extract pure logic** — separate decisions from effects
17
+ 2. **Test behavior, not implementation** — what it does, not how
18
+ 3. **Bottom-heavy pyramid** — many unit tests, few integration, fewer E2E
19
+ 4. **Minimal mocking** — mock boundaries (DB, network, filesystem), not your own code
20
+
21
+ ## Decision Tree: Which Skills to Use
22
+
23
+ ```
24
+ What are you testing?
25
+ ├── WordPress PHP plugin/theme?
26
+ │ → phpunit-wp (primary) + php-fp + php-fp-wordpress
27
+ │ → References: php-fp/references/testing-patterns.md
28
+ │ php-fp-wordpress/references/testing-strategy.md
29
+
30
+ ├── General PHP (non-WordPress)?
31
+ │ → php-fp (primary)
32
+ │ → References: php-fp/references/testing-patterns.md
33
+
34
+ ├── JavaScript/TypeScript?
35
+ │ ├── React components?
36
+ │ │ → js-fp-react + js-fp
37
+ │ ├── Vue components?
38
+ │ │ → js-fp-vue + js-fp
39
+ │ │ → References: js-fp-vue/references/testing.md
40
+ │ └── General JS/TS?
41
+ │ → js-fp (primary)
42
+ │ → References: js-fp/references/testing-patterns.md
43
+
44
+ ├── End-to-end / browser tests?
45
+ │ → playwright (primary)
46
+
47
+ └── Unknown / mixed?
48
+ → Start with functional-programmer principles
49
+ → Route to domain skill once context is clear
50
+ ```
51
+
52
+ **Always apply:** `functional-programmer` principles (pure functions, composition, immutability).
53
+
54
+ ## Workflow: Adding Tests to Existing Code
55
+
56
+ ### Step 1: Analyze
57
+
58
+ - Read the code under test
59
+ - Identify pure functions vs impure boundaries
60
+ - Map dependencies: what does this code touch? (DB, filesystem, network, global state)
61
+
62
+ ### Step 2: Classify
63
+
64
+ | Code Type | Test Type | Speed | Mocking |
65
+ |-----------|-----------|-------|---------|
66
+ | Pure function (no side effects) | Unit test | Fast (<10ms) | None |
67
+ | Function with injected deps | Unit test | Fast | Stub the deps |
68
+ | WordPress hook/filter callback | Unit or integration | Medium | Mock WP functions |
69
+ | API endpoint handler | Integration test | Medium | Mock external services |
70
+ | Full user workflow | E2E test | Slow | None (real browser) |
71
+
72
+ ### Step 3: Structure
73
+
74
+ Follow project conventions for test file location:
75
+ - PHP: `tests/Unit/`, `tests/Integration/` (mirror `src/` structure)
76
+ - JS/TS: colocated `*.test.ts` or `__tests__/` directory
77
+ - E2E: `tests/e2e/` or `e2e/`
78
+
79
+ ### Step 4: Write
80
+
81
+ Apply the domain skill's patterns. General principles:
82
+
83
+ ```
84
+ Arrange → Act → Assert (one behavior per test)
85
+ ```
86
+
87
+ - **Test name = behavior description**: `it('returns empty array when no items match filter')`
88
+ - **One assertion per concept** (multiple `expect` calls are fine if they verify one behavior)
89
+ - **No logic in tests**: no conditionals, no loops, no try/catch
90
+ - **Test data is minimal**: only include fields relevant to the behavior under test
91
+
92
+ ### Step 5: Verify
93
+
94
+ - Run the test suite: `composer test`, `npm test`, `npx vitest`, etc.
95
+ - All tests pass (green)
96
+ - No skipped or pending tests without a documented reason
97
+ - Coverage meets project floor (if configured)
98
+
99
+ ## Workflow: TDD (Test-Driven Development)
100
+
101
+ ### Red-Green-Refactor
102
+
103
+ ```
104
+ 1. RED — Write a failing test for the next behavior
105
+ 2. GREEN — Write the minimum code to make it pass
106
+ 3. REFACTOR — Clean up while keeping tests green
107
+ ```
108
+
109
+ ### TDD with Pure Functions (Ideal Case)
110
+
111
+ Pure functions + TDD = fast feedback loops. No setup, no teardown, no mocking.
112
+
113
+ ```
114
+ Test: add(2, 3) === 5
115
+ Code: const add = (a, b) => a + b
116
+ Done.
117
+ ```
118
+
119
+ ### TDD for Impure Boundaries
120
+
121
+ When TDD hits an impure boundary (DB, network, filesystem):
122
+
123
+ 1. **Define the interface** — what does the boundary need to provide?
124
+ 2. **Stub the boundary** — test against the interface, not the implementation
125
+ 3. **Wire up later** — connect the real implementation after the pure logic is tested
126
+
127
+ ### When TDD Slows You Down
128
+
129
+ TDD is a tool, not a religion. Skip it when:
130
+ - Exploring/prototyping (you'll throw the code away)
131
+ - The implementation is trivial and obvious
132
+ - You're writing glue code with no logic
133
+
134
+ See `references/tdd-workflow.md` for detailed mechanics.
135
+
136
+ ## Mock Decision Tree
137
+
138
+ ```
139
+ Is the dependency hard to test?
140
+ ├── No (pure function, simple data) → Don't mock. Test directly.
141
+ ├── Yes, but I own the code
142
+ │ ├── Can I extract pure logic? → Extract it. Test the pure part.
143
+ │ └── Can I inject the dependency? → Inject it. Pass a stub.
144
+ └── Yes, external service (DB, API, filesystem, time)
145
+ → Mock it. Use the simplest mock type that works.
146
+ ```
147
+
148
+ ### Mock Types (Simplest First)
149
+
150
+ | Type | What it does | When to use |
151
+ |------|-------------|-------------|
152
+ | **Stub** | Returns canned data | Most cases. Default choice. |
153
+ | **Spy** | Records calls for verification | When you need to verify a call was made |
154
+ | **Fake** | Working simplified implementation | Complex interfaces (in-memory DB) |
155
+ | **Full mock** | Strict expectations on calls | Almost never. Couples tests to implementation. |
156
+
157
+ See `references/mock-patterns.md` for language-specific examples and anti-patterns.
158
+
159
+ ## Test Quality Checklist
160
+
161
+ Before considering tests "done":
162
+
163
+ - [ ] Tests verify behavior, not implementation
164
+ - [ ] Each test has a descriptive name explaining the scenario
165
+ - [ ] No test depends on another test's state (isolation)
166
+ - [ ] No flaky signals: no timers, no real network, no filesystem in unit tests
167
+ - [ ] Pure functions tested without mocking
168
+ - [ ] Mocks used only at impure boundaries
169
+ - [ ] Edge cases covered: empty input, null/undefined, boundary values
170
+ - [ ] Error paths tested (not just happy path)
171
+ - [ ] Test runs fast (unit suite < 10s for most projects)
172
+
173
+ ## Anti-Patterns
174
+
175
+ | Anti-Pattern | Problem | Fix |
176
+ |-------------|---------|-----|
177
+ | Testing implementation details | Breaks on refactor | Test behavior/output instead |
178
+ | Mocking everything | Tests prove nothing | Extract pure logic, mock only boundaries |
179
+ | Giant test setup | Hard to understand | Simplify code under test or use factories |
180
+ | Copy-paste test bodies | Maintenance nightmare | Use parameterized/table-driven tests |
181
+ | Testing framework behavior | Wastes time | Trust the framework |
182
+ | 100% coverage target | Diminishing returns | Set a floor, not a ceiling |
183
+ | `sleep()` in tests | Flaky, slow | Use deterministic waits or fix the design |
184
+
185
+ ## Integration: Domain Skill Reference
186
+
187
+ | Context | Primary Skill | Reference Files |
188
+ |---------|--------------|-----------------|
189
+ | WordPress PHP | `phpunit-wp` | `php-fp/references/testing-patterns.md`, `php-fp-wordpress/references/testing-strategy.md` |
190
+ | General PHP | `php-fp` | `php-fp/references/testing-patterns.md` |
191
+ | JavaScript/TypeScript | `js-fp` | `js-fp/references/testing-patterns.md` |
192
+ | Vue.js | `js-fp-vue` | `js-fp-vue/references/testing.md` |
193
+ | React | `js-fp-react` | `js-fp/references/testing-patterns.md` |
194
+ | E2E / Browser | `playwright` | (self-contained skill) |
195
+
196
+ ## The Final Word
197
+
198
+ *"If it's hard to test, it's hard to use. Testability is a design signal, not a chore. Extract the pure, inject the impure, and the tests write themselves."*