oh-my-claude-sisyphus 3.3.10 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/README.md +3 -3
  2. package/agents/explore-high.md +195 -0
  3. package/agents/qa-tester-high.md +141 -0
  4. package/agents/templates/README.md +110 -0
  5. package/agents/templates/base-agent.md +54 -0
  6. package/agents/templates/tier-instructions.md +94 -0
  7. package/commands/ecomode.md +60 -0
  8. package/commands/help.md +1 -1
  9. package/commands/mcp-setup.md +7 -6
  10. package/commands/ralplan.md +8 -1
  11. package/commands/ultrapilot.md +158 -0
  12. package/commands/ultrawork.md +1 -0
  13. package/dist/__tests__/delegation-enforcer-integration.test.d.ts +6 -0
  14. package/dist/__tests__/delegation-enforcer-integration.test.d.ts.map +1 -0
  15. package/dist/__tests__/delegation-enforcer-integration.test.js +136 -0
  16. package/dist/__tests__/delegation-enforcer-integration.test.js.map +1 -0
  17. package/dist/__tests__/delegation-enforcer.test.d.ts +5 -0
  18. package/dist/__tests__/delegation-enforcer.test.d.ts.map +1 -0
  19. package/dist/__tests__/delegation-enforcer.test.js +208 -0
  20. package/dist/__tests__/delegation-enforcer.test.js.map +1 -0
  21. package/dist/__tests__/hooks.test.js +2 -2
  22. package/dist/__tests__/hooks.test.js.map +1 -1
  23. package/dist/__tests__/installer.test.js +4 -6
  24. package/dist/__tests__/installer.test.js.map +1 -1
  25. package/dist/__tests__/ralph-prd.test.js +1 -1
  26. package/dist/__tests__/ralph-prd.test.js.map +1 -1
  27. package/dist/__tests__/ralph-progress.test.js +1 -1
  28. package/dist/__tests__/ralph-progress.test.js.map +1 -1
  29. package/dist/__tests__/skills.test.js +31 -24
  30. package/dist/__tests__/skills.test.js.map +1 -1
  31. package/dist/agents/analyst.d.ts.map +1 -1
  32. package/dist/agents/analyst.js +1 -0
  33. package/dist/agents/analyst.js.map +1 -1
  34. package/dist/agents/architect.d.ts.map +1 -1
  35. package/dist/agents/architect.js +1 -0
  36. package/dist/agents/architect.js.map +1 -1
  37. package/dist/agents/critic.d.ts.map +1 -1
  38. package/dist/agents/critic.js +1 -0
  39. package/dist/agents/critic.js.map +1 -1
  40. package/dist/agents/definitions.d.ts +5 -1
  41. package/dist/agents/definitions.d.ts.map +1 -1
  42. package/dist/agents/definitions.js +53 -155
  43. package/dist/agents/definitions.js.map +1 -1
  44. package/dist/agents/designer.d.ts.map +1 -1
  45. package/dist/agents/designer.js +1 -0
  46. package/dist/agents/designer.js.map +1 -1
  47. package/dist/agents/executor.d.ts.map +1 -1
  48. package/dist/agents/executor.js +1 -0
  49. package/dist/agents/executor.js.map +1 -1
  50. package/dist/agents/explore.d.ts.map +1 -1
  51. package/dist/agents/explore.js +1 -0
  52. package/dist/agents/explore.js.map +1 -1
  53. package/dist/agents/planner.d.ts.map +1 -1
  54. package/dist/agents/planner.js +1 -0
  55. package/dist/agents/planner.js.map +1 -1
  56. package/dist/agents/qa-tester.d.ts.map +1 -1
  57. package/dist/agents/qa-tester.js +1 -0
  58. package/dist/agents/qa-tester.js.map +1 -1
  59. package/dist/agents/researcher.d.ts.map +1 -1
  60. package/dist/agents/researcher.js +1 -0
  61. package/dist/agents/researcher.js.map +1 -1
  62. package/dist/agents/scientist.d.ts.map +1 -1
  63. package/dist/agents/scientist.js +1 -0
  64. package/dist/agents/scientist.js.map +1 -1
  65. package/dist/agents/types.d.ts +2 -0
  66. package/dist/agents/types.d.ts.map +1 -1
  67. package/dist/agents/types.js.map +1 -1
  68. package/dist/agents/vision.d.ts.map +1 -1
  69. package/dist/agents/vision.js +1 -0
  70. package/dist/agents/vision.js.map +1 -1
  71. package/dist/agents/writer.d.ts.map +1 -1
  72. package/dist/agents/writer.js +1 -0
  73. package/dist/agents/writer.js.map +1 -1
  74. package/dist/cli/index.js +0 -3
  75. package/dist/cli/index.js.map +1 -1
  76. package/dist/config/loader.d.ts.map +1 -1
  77. package/dist/config/loader.js +1 -6
  78. package/dist/config/loader.js.map +1 -1
  79. package/dist/features/delegation-enforcer.d.ts +71 -0
  80. package/dist/features/delegation-enforcer.d.ts.map +1 -0
  81. package/dist/features/delegation-enforcer.js +128 -0
  82. package/dist/features/delegation-enforcer.js.map +1 -0
  83. package/dist/features/index.d.ts +3 -0
  84. package/dist/features/index.d.ts.map +1 -1
  85. package/dist/features/index.js +18 -0
  86. package/dist/features/index.js.map +1 -1
  87. package/dist/features/state-manager/index.d.ts +100 -0
  88. package/dist/features/state-manager/index.d.ts.map +1 -0
  89. package/dist/features/state-manager/index.js +407 -0
  90. package/dist/features/state-manager/index.js.map +1 -0
  91. package/dist/features/state-manager/types.d.ts +147 -0
  92. package/dist/features/state-manager/types.d.ts.map +1 -0
  93. package/dist/features/state-manager/types.js +30 -0
  94. package/dist/features/state-manager/types.js.map +1 -0
  95. package/dist/features/task-decomposer/index.d.ts +33 -0
  96. package/dist/features/task-decomposer/index.d.ts.map +1 -0
  97. package/dist/features/task-decomposer/index.js +698 -0
  98. package/dist/features/task-decomposer/index.js.map +1 -0
  99. package/dist/features/task-decomposer/types.d.ts +133 -0
  100. package/dist/features/task-decomposer/types.d.ts.map +1 -0
  101. package/dist/features/task-decomposer/types.js +8 -0
  102. package/dist/features/task-decomposer/types.js.map +1 -0
  103. package/dist/features/verification/example.d.ts +49 -0
  104. package/dist/features/verification/example.d.ts.map +1 -0
  105. package/dist/features/verification/example.js +235 -0
  106. package/dist/features/verification/example.js.map +1 -0
  107. package/dist/features/verification/index.d.ts +97 -0
  108. package/dist/features/verification/index.d.ts.map +1 -0
  109. package/dist/features/verification/index.js +439 -0
  110. package/dist/features/verification/index.js.map +1 -0
  111. package/dist/features/verification/types.d.ts +142 -0
  112. package/dist/features/verification/types.d.ts.map +1 -0
  113. package/dist/features/verification/types.js +7 -0
  114. package/dist/features/verification/types.js.map +1 -0
  115. package/dist/hooks/agent-usage-reminder/constants.d.ts.map +1 -1
  116. package/dist/hooks/agent-usage-reminder/constants.js +0 -1
  117. package/dist/hooks/agent-usage-reminder/constants.js.map +1 -1
  118. package/dist/hooks/autopilot/__tests__/cancel.test.js +4 -4
  119. package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -1
  120. package/dist/hooks/autopilot/__tests__/summary.test.js +1 -1
  121. package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -1
  122. package/dist/hooks/autopilot/__tests__/transition.test.js +1 -2
  123. package/dist/hooks/autopilot/__tests__/transition.test.js.map +1 -1
  124. package/dist/hooks/autopilot/cancel.js +2 -2
  125. package/dist/hooks/autopilot/cancel.js.map +1 -1
  126. package/dist/hooks/autopilot/enforcement.d.ts +16 -2
  127. package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
  128. package/dist/hooks/autopilot/enforcement.js +78 -4
  129. package/dist/hooks/autopilot/enforcement.js.map +1 -1
  130. package/dist/hooks/autopilot/index.d.ts +3 -6
  131. package/dist/hooks/autopilot/index.d.ts.map +1 -1
  132. package/dist/hooks/autopilot/index.js +6 -12
  133. package/dist/hooks/autopilot/index.js.map +1 -1
  134. package/dist/hooks/autopilot/state.d.ts +36 -2
  135. package/dist/hooks/autopilot/state.d.ts.map +1 -1
  136. package/dist/hooks/autopilot/state.js +216 -2
  137. package/dist/hooks/autopilot/state.js.map +1 -1
  138. package/dist/hooks/autopilot/validation.d.ts +23 -2
  139. package/dist/hooks/autopilot/validation.d.ts.map +1 -1
  140. package/dist/hooks/autopilot/validation.js +158 -1
  141. package/dist/hooks/autopilot/validation.js.map +1 -1
  142. package/dist/hooks/bridge.js +3 -3
  143. package/dist/hooks/bridge.js.map +1 -1
  144. package/dist/hooks/index.d.ts +5 -9
  145. package/dist/hooks/index.d.ts.map +1 -1
  146. package/dist/hooks/index.js +31 -21
  147. package/dist/hooks/index.js.map +1 -1
  148. package/dist/hooks/learner/promotion.js +1 -1
  149. package/dist/hooks/learner/promotion.js.map +1 -1
  150. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  151. package/dist/hooks/persistent-mode/index.js +2 -3
  152. package/dist/hooks/persistent-mode/index.js.map +1 -1
  153. package/dist/hooks/ralph/index.d.ts +11 -0
  154. package/dist/hooks/ralph/index.d.ts.map +1 -0
  155. package/dist/hooks/ralph/index.js +53 -0
  156. package/dist/hooks/ralph/index.js.map +1 -0
  157. package/dist/hooks/ralph/loop.d.ts +116 -0
  158. package/dist/hooks/ralph/loop.d.ts.map +1 -0
  159. package/dist/hooks/ralph/loop.js +322 -0
  160. package/dist/hooks/ralph/loop.js.map +1 -0
  161. package/dist/hooks/ralph/prd.d.ts +130 -0
  162. package/dist/hooks/ralph/prd.d.ts.map +1 -0
  163. package/dist/hooks/ralph/prd.js +310 -0
  164. package/dist/hooks/ralph/prd.js.map +1 -0
  165. package/dist/hooks/ralph/progress.d.ts +102 -0
  166. package/dist/hooks/ralph/progress.d.ts.map +1 -0
  167. package/dist/hooks/ralph/progress.js +408 -0
  168. package/dist/hooks/ralph/progress.js.map +1 -0
  169. package/dist/hooks/ralph/verifier.d.ts +72 -0
  170. package/dist/hooks/ralph/verifier.d.ts.map +1 -0
  171. package/dist/hooks/ralph/verifier.js +223 -0
  172. package/dist/hooks/ralph/verifier.js.map +1 -0
  173. package/dist/hooks/recovery/constants.d.ts +114 -0
  174. package/dist/hooks/recovery/constants.d.ts.map +1 -0
  175. package/dist/hooks/recovery/constants.js +227 -0
  176. package/dist/hooks/recovery/constants.js.map +1 -0
  177. package/dist/hooks/recovery/context-window.d.ts +24 -0
  178. package/dist/hooks/recovery/context-window.d.ts.map +1 -0
  179. package/dist/hooks/recovery/context-window.js +321 -0
  180. package/dist/hooks/recovery/context-window.js.map +1 -0
  181. package/dist/hooks/recovery/edit-error.d.ts +24 -0
  182. package/dist/hooks/recovery/edit-error.d.ts.map +1 -0
  183. package/dist/hooks/recovery/edit-error.js +56 -0
  184. package/dist/hooks/recovery/edit-error.js.map +1 -0
  185. package/dist/hooks/recovery/index.d.ts +102 -0
  186. package/dist/hooks/recovery/index.d.ts.map +1 -0
  187. package/dist/hooks/recovery/index.js +166 -0
  188. package/dist/hooks/recovery/index.js.map +1 -0
  189. package/dist/hooks/recovery/session-recovery.d.ts +24 -0
  190. package/dist/hooks/recovery/session-recovery.d.ts.map +1 -0
  191. package/dist/hooks/recovery/session-recovery.js +281 -0
  192. package/dist/hooks/recovery/session-recovery.js.map +1 -0
  193. package/dist/hooks/recovery/storage.d.ts +75 -0
  194. package/dist/hooks/recovery/storage.d.ts.map +1 -0
  195. package/dist/hooks/recovery/storage.js +382 -0
  196. package/dist/hooks/recovery/storage.js.map +1 -0
  197. package/dist/hooks/recovery/types.d.ts +196 -0
  198. package/dist/hooks/recovery/types.d.ts.map +1 -0
  199. package/dist/hooks/recovery/types.js +32 -0
  200. package/dist/hooks/recovery/types.js.map +1 -0
  201. package/dist/hooks/ultrapilot/index.d.ts +90 -0
  202. package/dist/hooks/ultrapilot/index.d.ts.map +1 -0
  203. package/dist/hooks/ultrapilot/index.js +310 -0
  204. package/dist/hooks/ultrapilot/index.js.map +1 -0
  205. package/dist/hooks/ultrapilot/state.d.ts +72 -0
  206. package/dist/hooks/ultrapilot/state.d.ts.map +1 -0
  207. package/dist/hooks/ultrapilot/state.js +258 -0
  208. package/dist/hooks/ultrapilot/state.js.map +1 -0
  209. package/dist/hooks/ultrapilot/types.d.ts +113 -0
  210. package/dist/hooks/ultrapilot/types.d.ts.map +1 -0
  211. package/dist/hooks/ultrapilot/types.js +36 -0
  212. package/dist/hooks/ultrapilot/types.js.map +1 -0
  213. package/dist/hooks/ultraqa/index.d.ts +94 -0
  214. package/dist/hooks/ultraqa/index.d.ts.map +1 -0
  215. package/dist/hooks/ultraqa/index.js +216 -0
  216. package/dist/hooks/ultraqa/index.js.map +1 -0
  217. package/dist/hooks/ultrawork/index.d.ts +62 -0
  218. package/dist/hooks/ultrawork/index.d.ts.map +1 -0
  219. package/dist/hooks/ultrawork/index.js +208 -0
  220. package/dist/hooks/ultrawork/index.js.map +1 -0
  221. package/dist/index.d.ts.map +1 -1
  222. package/dist/index.js +1 -2
  223. package/dist/index.js.map +1 -1
  224. package/dist/installer/index.d.ts +1 -1
  225. package/dist/installer/index.d.ts.map +1 -1
  226. package/dist/installer/index.js +1 -1
  227. package/dist/installer/index.js.map +1 -1
  228. package/dist/mcp/index.d.ts +1 -1
  229. package/dist/mcp/index.d.ts.map +1 -1
  230. package/dist/mcp/index.js +1 -1
  231. package/dist/mcp/index.js.map +1 -1
  232. package/dist/mcp/servers.d.ts +2 -18
  233. package/dist/mcp/servers.d.ts.map +1 -1
  234. package/dist/mcp/servers.js +4 -36
  235. package/dist/mcp/servers.js.map +1 -1
  236. package/dist/shared/types.d.ts +1 -3
  237. package/dist/shared/types.d.ts.map +1 -1
  238. package/docs/CLAUDE.md +170 -44
  239. package/docs/DELEGATION-ENFORCER.md +282 -0
  240. package/docs/FULL-README.md +1 -1
  241. package/docs/LOCAL_PLUGIN_INSTALL.md +1 -1
  242. package/docs/MIGRATION.md +298 -104
  243. package/package.json +2 -2
  244. package/scripts/test-mutual-exclusion.ts +1 -1
  245. package/skills/analyze/SKILL.md +0 -1
  246. package/skills/autopilot/SKILL.md +0 -1
  247. package/skills/cancel/SKILL.md +580 -0
  248. package/skills/cancel-autopilot/SKILL.md +0 -1
  249. package/skills/cancel-ecomode/SKILL.md +41 -0
  250. package/skills/cancel-ralph/SKILL.md +0 -1
  251. package/skills/cancel-ultraqa/SKILL.md +0 -1
  252. package/skills/cancel-ultrawork/SKILL.md +0 -1
  253. package/skills/deepinit/SKILL.md +0 -1
  254. package/skills/deepsearch/SKILL.md +0 -1
  255. package/skills/doctor/SKILL.md +0 -1
  256. package/skills/ecomode/SKILL.md +128 -0
  257. package/skills/frontend-ui-ux/SKILL.md +0 -1
  258. package/skills/git-master/SKILL.md +0 -1
  259. package/skills/help/SKILL.md +1 -2
  260. package/skills/hud/SKILL.md +0 -1
  261. package/skills/learner/SKILL.md +0 -1
  262. package/skills/mcp-setup/SKILL.md +8 -7
  263. package/skills/note/SKILL.md +0 -1
  264. package/skills/omc-default/SKILL.md +0 -1
  265. package/skills/omc-default-global/SKILL.md +0 -1
  266. package/skills/omc-setup/SKILL.md +176 -10
  267. package/skills/orchestrate/SKILL.md +0 -1
  268. package/skills/pipeline/SKILL.md +417 -0
  269. package/skills/plan/SKILL.md +138 -21
  270. package/skills/planner/SKILL.md +0 -1
  271. package/skills/ralph/SKILL.md +65 -1
  272. package/skills/ralph-init/SKILL.md +0 -1
  273. package/skills/ralplan/SKILL.md +0 -1
  274. package/skills/release/SKILL.md +0 -1
  275. package/skills/research/SKILL.md +0 -1
  276. package/skills/review/SKILL.md +0 -1
  277. package/skills/swarm/SKILL.md +349 -0
  278. package/skills/tdd/SKILL.md +0 -1
  279. package/skills/ultrapilot/SKILL.md +563 -0
  280. package/skills/ultraqa/SKILL.md +0 -1
  281. package/skills/ultrawork/SKILL.md +0 -1
  282. package/docs/MIGRATION-v3.md +0 -186
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: research
3
3
  description: Orchestrate parallel scientist agents for comprehensive research with AUTO mode
4
- user-invocable: true
5
4
  argument-hint: <research goal>
6
5
  ---
7
6
 
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: review
3
3
  description: Review a plan with Critic
4
- user-invocable: true
5
4
  ---
6
5
 
7
6
  # Review Skill
@@ -0,0 +1,349 @@
1
+ ---
2
+ name: swarm
3
+ description: N coordinated agents on shared task list with atomic claiming
4
+ ---
5
+
6
+ # Swarm Skill
7
+
8
+ Spawn N coordinated agents working on a shared task list with atomic claiming. Like a dev team tackling multiple files in parallel.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /swarm N:agent-type "task description"
14
+ ```
15
+
16
+ ### Parameters
17
+
18
+ - **N** - Number of agents (1-5, enforced by Claude Code limit)
19
+ - **agent-type** - Agent to spawn (e.g., executor, build-fixer, architect)
20
+ - **task** - High-level task to decompose and distribute
21
+
22
+ ### Examples
23
+
24
+ ```bash
25
+ /swarm 5:executor "fix all TypeScript errors"
26
+ /swarm 3:build-fixer "fix build errors in src/"
27
+ /swarm 4:designer "implement responsive layouts for all components"
28
+ /swarm 2:architect "analyze and document all API endpoints"
29
+ ```
30
+
31
+ ## Architecture
32
+
33
+ ```
34
+ User: "/swarm 5:executor fix all TypeScript errors"
35
+ |
36
+ v
37
+ [SWARM ORCHESTRATOR]
38
+ |
39
+ +--+--+--+--+--+
40
+ | | | | |
41
+ v v v v v
42
+ E1 E2 E3 E4 E5
43
+ | | | | |
44
+ +--+--+--+--+
45
+ |
46
+ v
47
+ [SHARED TASK LIST]
48
+ - Fix a.ts (claimed E1)
49
+ - Fix b.ts (done E2)
50
+ - Fix c.ts (claimed E3)
51
+ - Fix d.ts (pending)
52
+ ...
53
+ ```
54
+
55
+ ## Workflow
56
+
57
+ ### 1. Parse Input
58
+ - Extract N (agent count)
59
+ - Extract agent-type
60
+ - Extract task description
61
+ - Validate N <= 5
62
+
63
+ ### 2. Create Task List
64
+ - Analyze codebase based on task
65
+ - Break into file-specific subtasks
66
+ - Initialize shared task list with all subtasks
67
+ - Each task gets: id, file, description, status, owner, timestamp
68
+
69
+ ### 3. Spawn Agents
70
+ - Launch N agents via Task tool
71
+ - Set `run_in_background: true` for all
72
+ - Each agent gets:
73
+ - Reference to shared task list
74
+ - Claiming protocol instructions
75
+ - Completion criteria
76
+
77
+ ### 4. Task Claiming Protocol
78
+ Each agent follows this loop:
79
+
80
+ ```
81
+ LOOP:
82
+ 1. Read swarm-tasks.json
83
+ 2. Find first pending task
84
+ 3. Atomically claim task (check status, set to claimed, add owner)
85
+ 4. Execute task
86
+ 5. Mark task as done
87
+ 6. GOTO LOOP (until no pending tasks)
88
+ ```
89
+
90
+ **Atomic Claiming:**
91
+ - Read current task status
92
+ - If still "pending", claim it
93
+ - If someone else claimed, try next task
94
+ - Timeout: 5 minutes per task
95
+ - If timeout exceeded, task auto-releases to pending
96
+
97
+ ### 5. Progress Tracking
98
+ - Orchestrator monitors via TaskOutput
99
+ - Shows live progress: claimed/done/pending counts
100
+ - Reports which agent is working on which file
101
+ - Detects idle agents (all tasks claimed by others)
102
+
103
+ ### 6. Completion
104
+ Exit when ANY of:
105
+ - All tasks marked "done"
106
+ - All agents idle (no pending tasks)
107
+ - User cancels via `/cancel-swarm`
108
+
109
+ ## State Files
110
+
111
+ ### `.omc/swarm-state.json`
112
+ Session-level state:
113
+
114
+ ```json
115
+ {
116
+ "session_id": "swarm-20260123-143022",
117
+ "agent_count": 5,
118
+ "agent_type": "executor",
119
+ "task_description": "fix all TypeScript errors",
120
+ "status": "active",
121
+ "started_at": "2026-01-23T14:30:22Z",
122
+ "agents": [
123
+ {"id": "agent-1", "background_task_id": "task_abc123", "status": "working"},
124
+ {"id": "agent-2", "background_task_id": "task_def456", "status": "working"},
125
+ ...
126
+ ]
127
+ }
128
+ ```
129
+
130
+ ### `.omc/state/swarm-tasks.json`
131
+ Shared task list with atomic claiming:
132
+
133
+ ```json
134
+ {
135
+ "tasks": [
136
+ {
137
+ "id": "task-001",
138
+ "file": "src/utils/validation.ts",
139
+ "description": "Fix type errors in validation helpers",
140
+ "status": "claimed",
141
+ "owner": "agent-1",
142
+ "claimed_at": "2026-01-23T14:30:25Z",
143
+ "timeout_at": "2026-01-23T14:35:25Z"
144
+ },
145
+ {
146
+ "id": "task-002",
147
+ "file": "src/components/Header.tsx",
148
+ "description": "Fix missing prop types",
149
+ "status": "done",
150
+ "owner": "agent-2",
151
+ "claimed_at": "2026-01-23T14:30:26Z",
152
+ "completed_at": "2026-01-23T14:32:15Z"
153
+ },
154
+ {
155
+ "id": "task-003",
156
+ "file": "src/api/client.ts",
157
+ "description": "Add return type annotations",
158
+ "status": "pending",
159
+ "owner": null,
160
+ "claimed_at": null,
161
+ "timeout_at": null
162
+ }
163
+ ],
164
+ "stats": {
165
+ "total": 15,
166
+ "pending": 8,
167
+ "claimed": 5,
168
+ "done": 2
169
+ }
170
+ }
171
+ ```
172
+
173
+ ### `.omc/state/swarm-claims.json`
174
+ Ownership tracking and timeout enforcement:
175
+
176
+ ```json
177
+ {
178
+ "claims": [
179
+ {
180
+ "task_id": "task-001",
181
+ "agent_id": "agent-1",
182
+ "claimed_at": "2026-01-23T14:30:25Z",
183
+ "timeout_at": "2026-01-23T14:35:25Z",
184
+ "heartbeat_at": "2026-01-23T14:33:10Z"
185
+ }
186
+ ],
187
+ "timeouts": {
188
+ "claim_timeout_seconds": 300,
189
+ "heartbeat_interval_seconds": 60
190
+ }
191
+ }
192
+ ```
193
+
194
+ ## Task Claiming Protocol (Detailed)
195
+
196
+ ### Atomic Claim Operation
197
+
198
+ ```javascript
199
+ // Pseudo-code for agent claiming
200
+ function claimTask() {
201
+ const tasks = readJSON('.omc/state/swarm-tasks.json');
202
+
203
+ for (const task of tasks.tasks) {
204
+ if (task.status === 'pending') {
205
+ // Attempt atomic claim
206
+ const now = new Date().toISOString();
207
+ const timeout = addMinutes(now, 5).toISOString();
208
+
209
+ task.status = 'claimed';
210
+ task.owner = agentId;
211
+ task.claimed_at = now;
212
+ task.timeout_at = timeout;
213
+
214
+ writeJSON('.omc/state/swarm-tasks.json', tasks);
215
+ return task;
216
+ }
217
+ }
218
+
219
+ return null; // No pending tasks
220
+ }
221
+ ```
222
+
223
+ ### Timeout Auto-Release
224
+
225
+ Orchestrator periodically checks for timed-out claims:
226
+
227
+ ```javascript
228
+ function releaseTimedOutTasks() {
229
+ const tasks = readJSON('.omc/state/swarm-tasks.json');
230
+ const now = new Date();
231
+
232
+ for (const task of tasks.tasks) {
233
+ if (task.status === 'claimed' && new Date(task.timeout_at) < now) {
234
+ task.status = 'pending';
235
+ task.owner = null;
236
+ task.claimed_at = null;
237
+ task.timeout_at = null;
238
+ // Log timeout event
239
+ }
240
+ }
241
+
242
+ writeJSON('.omc/state/swarm-tasks.json', tasks);
243
+ }
244
+ ```
245
+
246
+ ## Agent Instructions Template
247
+
248
+ Each spawned agent receives these instructions:
249
+
250
+ ```markdown
251
+ You are agent {id} in a swarm of {N} {agent-type} agents.
252
+
253
+ **Your Task:** {task_description}
254
+
255
+ **Shared Task List:** .omc/state/swarm-tasks.json
256
+
257
+ **Your Loop:**
258
+ 1. Read swarm-tasks.json
259
+ 2. Find first task with status="pending"
260
+ 3. Claim it atomically (set status="claimed", owner="{id}", timestamp)
261
+ 4. Execute the task
262
+ 5. Mark status="done", set completed_at
263
+ 6. Repeat until no pending tasks
264
+
265
+ **Claiming Protocol:**
266
+ - Read file, check status="pending"
267
+ - Update status="claimed", add your ID
268
+ - Set timeout_at = now + 5 minutes
269
+ - Write file back
270
+ - If file changed between read/write, retry
271
+
272
+ **Completion:**
273
+ When no pending tasks remain, exit cleanly.
274
+
275
+ **Reporting:**
276
+ Update your progress in swarm-state.json under agents[{id}].status
277
+ ```
278
+
279
+ ## Constraints
280
+
281
+ - **Max Agents:** 5 (enforced by Claude Code background task limit)
282
+ - **Claim Timeout:** 5 minutes per task
283
+ - **Heartbeat:** Agents should update heartbeat every 60 seconds
284
+ - **Auto-Release:** Timed-out claims automatically released by orchestrator
285
+
286
+ ## Error Handling
287
+
288
+ - **Agent Crash:** Task auto-releases after timeout
289
+ - **State Corruption:** Orchestrator validates and repairs on each cycle
290
+ - **No Pending Tasks:** Agent exits cleanly
291
+ - **All Agents Idle:** Orchestrator detects and concludes session
292
+
293
+ ## Cancel Swarm
294
+
295
+ User can cancel via `/cancel-swarm`:
296
+ - Stops orchestrator monitoring
297
+ - Signals all background agents to exit
298
+ - Preserves partial progress in swarm-tasks.json
299
+ - Marks session as "cancelled" in swarm-state.json
300
+
301
+ ## Use Cases
302
+
303
+ ### 1. Fix All Type Errors
304
+ ```
305
+ /swarm 5:executor "fix all TypeScript type errors"
306
+ ```
307
+ Spawns 5 executors, each claiming and fixing individual files.
308
+
309
+ ### 2. Implement UI Components
310
+ ```
311
+ /swarm 3:designer "implement Material-UI styling for all components in src/components/"
312
+ ```
313
+ Spawns 3 designers, each styling different component files.
314
+
315
+ ### 3. Security Audit
316
+ ```
317
+ /swarm 4:security-reviewer "review all API endpoints for vulnerabilities"
318
+ ```
319
+ Spawns 4 security reviewers, each auditing different endpoints.
320
+
321
+ ### 4. Documentation Sprint
322
+ ```
323
+ /swarm 2:writer "add JSDoc comments to all exported functions"
324
+ ```
325
+ Spawns 2 writers, each documenting different modules.
326
+
327
+ ## Benefits
328
+
329
+ - **Parallel Execution:** N agents work simultaneously
330
+ - **Auto-Balancing:** Fast agents claim more tasks
331
+ - **Fault Tolerance:** Timeouts and auto-release prevent deadlocks
332
+ - **Progress Visibility:** Live stats on claimed/done/pending
333
+ - **Scalable:** Works for 10s to 100s of subtasks
334
+
335
+ ## Implementation Notes
336
+
337
+ The orchestrator (main skill handler) is responsible for:
338
+ 1. Initial task decomposition (via explore/architect)
339
+ 2. Creating state files
340
+ 3. Spawning N background agents
341
+ 4. Monitoring progress via TaskOutput
342
+ 5. Enforcing timeouts and auto-release
343
+ 6. Detecting completion conditions
344
+ 7. Reporting final summary
345
+
346
+ Each agent is a standard Task invocation with:
347
+ - `run_in_background: true`
348
+ - Agent-specific prompt with claiming instructions
349
+ - Reference to shared state files
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: tdd
3
3
  description: Test-Driven Development enforcement skill - write tests first, always
4
- user-invocable: true
5
4
  ---
6
5
 
7
6
  # TDD Mode