@wolfx/oh-my-openagent 3.17.14 → 4.0.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 (158) hide show
  1. package/README.ja.md +153 -113
  2. package/README.ko.md +196 -149
  3. package/README.md +53 -50
  4. package/README.ru.md +92 -70
  5. package/README.zh-cn.md +112 -71
  6. package/dist/agents/agent-skill-resolution.d.ts +1 -0
  7. package/dist/agents/builtin-agents/available-skills.d.ts +1 -1
  8. package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
  9. package/dist/agents/builtin-agents.d.ts +1 -1
  10. package/dist/agents/dynamic-agent-core-sections.d.ts +1 -0
  11. package/dist/agents/dynamic-agent-prompt-builder.d.ts +1 -1
  12. package/dist/agents/hephaestus/gpt-5-5.d.ts +0 -4
  13. package/dist/agents/types.d.ts +1 -0
  14. package/dist/config/index.d.ts +1 -1
  15. package/dist/config/schema/agent-names.d.ts +1 -0
  16. package/dist/config/schema/agent-overrides.d.ts +45 -0
  17. package/dist/config/schema/categories.d.ts +7 -1
  18. package/dist/config/schema/commands.d.ts +1 -0
  19. package/dist/config/schema/fallback-models.d.ts +5 -0
  20. package/dist/config/schema/hooks.d.ts +1 -0
  21. package/dist/config/schema/keyword-detector.d.ts +21 -0
  22. package/dist/config/schema/oh-my-opencode-config.d.ts +70 -0
  23. package/dist/config/schema/team-mode.d.ts +16 -0
  24. package/dist/config/schema.d.ts +2 -0
  25. package/dist/create-hooks.d.ts +3 -0
  26. package/dist/features/background-agent/manager.d.ts +3 -0
  27. package/dist/features/background-agent/types.d.ts +4 -0
  28. package/dist/features/boulder-state/storage.d.ts +1 -0
  29. package/dist/features/builtin-commands/commands.d.ts +1 -0
  30. package/dist/features/builtin-commands/templates/hyperplan.d.ts +1 -0
  31. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
  32. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -0
  33. package/dist/features/builtin-commands/types.d.ts +1 -1
  34. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
  35. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
  36. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
  37. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
  38. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
  39. package/dist/features/builtin-skills/skills/index.d.ts +1 -0
  40. package/dist/features/builtin-skills/skills/team-mode.d.ts +2 -0
  41. package/dist/features/builtin-skills/skills.d.ts +1 -0
  42. package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -0
  43. package/dist/features/hook-message-injector/injector.d.ts +2 -2
  44. package/dist/features/opencode-skill-loader/loader.d.ts +2 -2
  45. package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -0
  46. package/dist/features/team-mode/deps.d.ts +6 -0
  47. package/dist/features/team-mode/member-guidance.d.ts +2 -0
  48. package/dist/features/team-mode/member-parser.d.ts +16 -0
  49. package/dist/features/team-mode/member-session-resolution.d.ts +6 -0
  50. package/dist/features/team-mode/member-session-routing.d.ts +19 -0
  51. package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +4 -0
  52. package/dist/features/team-mode/team-layout-tmux/layout.d.ts +26 -6
  53. package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +9 -0
  54. package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +7 -0
  55. package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +8 -0
  56. package/dist/features/team-mode/team-mailbox/ack.d.ts +2 -0
  57. package/dist/features/team-mode/team-mailbox/inbox.d.ts +3 -0
  58. package/dist/features/team-mode/team-mailbox/index.d.ts +7 -0
  59. package/dist/features/team-mode/team-mailbox/poll.d.ts +10 -0
  60. package/dist/features/team-mode/team-mailbox/reservation.d.ts +11 -0
  61. package/dist/features/team-mode/team-mailbox/send.d.ts +27 -0
  62. package/dist/features/team-mode/team-registry/index.d.ts +3 -0
  63. package/dist/features/team-mode/team-registry/loader.d.ts +12 -0
  64. package/dist/features/team-mode/team-registry/paths.d.ts +13 -0
  65. package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +6 -0
  66. package/dist/features/team-mode/team-registry/validator.d.ts +10 -0
  67. package/dist/features/team-mode/team-runtime/activate-team-layout.d.ts +4 -0
  68. package/dist/features/team-mode/team-runtime/cleanup-team-run-resources.d.ts +17 -0
  69. package/dist/features/team-mode/team-runtime/create.d.ts +25 -0
  70. package/dist/features/team-mode/team-runtime/delete-team.d.ts +16 -0
  71. package/dist/features/team-mode/team-runtime/index.d.ts +2 -0
  72. package/dist/features/team-mode/team-runtime/resolve-member-dependencies.d.ts +3 -0
  73. package/dist/features/team-mode/team-runtime/resolve-member.d.ts +17 -0
  74. package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +11 -0
  75. package/dist/features/team-mode/team-runtime/shutdown-test-fixtures.d.ts +46 -0
  76. package/dist/features/team-mode/team-runtime/shutdown.d.ts +5 -0
  77. package/dist/features/team-mode/team-runtime/status.d.ts +36 -0
  78. package/dist/features/team-mode/team-session-registry.d.ts +11 -0
  79. package/dist/features/team-mode/team-state-store/index.d.ts +1 -0
  80. package/dist/features/team-mode/team-state-store/locks.d.ts +12 -0
  81. package/dist/features/team-mode/team-state-store/resume.d.ts +10 -0
  82. package/dist/features/team-mode/team-state-store/store.d.ts +21 -0
  83. package/dist/features/team-mode/team-tasklist/claim.d.ts +10 -0
  84. package/dist/features/team-mode/team-tasklist/dependencies.d.ts +2 -0
  85. package/dist/features/team-mode/team-tasklist/get.d.ts +3 -0
  86. package/dist/features/team-mode/team-tasklist/index.d.ts +6 -0
  87. package/dist/features/team-mode/team-tasklist/list.d.ts +8 -0
  88. package/dist/features/team-mode/team-tasklist/store.d.ts +3 -0
  89. package/dist/features/team-mode/team-tasklist/test-support.d.ts +9 -0
  90. package/dist/features/team-mode/team-tasklist/update.d.ts +9 -0
  91. package/dist/features/team-mode/tools/index.d.ts +1 -0
  92. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +188 -0
  93. package/dist/features/team-mode/tools/lifecycle.d.ts +37 -0
  94. package/dist/features/team-mode/tools/messaging.d.ts +31 -0
  95. package/dist/features/team-mode/tools/query.d.ts +16 -0
  96. package/dist/features/team-mode/tools/tasks.d.ts +18 -0
  97. package/dist/features/team-mode/types.d.ts +137 -5
  98. package/dist/features/tmux-subagent/action-executor-core.d.ts +1 -0
  99. package/dist/features/tmux-subagent/action-executor.d.ts +1 -0
  100. package/dist/features/tmux-subagent/attachable-session-status.d.ts +4 -0
  101. package/dist/features/tmux-subagent/manager.d.ts +32 -3
  102. package/dist/features/tmux-subagent/pane-state-querier.d.ts +10 -0
  103. package/dist/features/tmux-subagent/polling.d.ts +1 -0
  104. package/dist/hooks/atlas/atlas-hook.d.ts +1 -1
  105. package/dist/hooks/atlas/boulder-continuation-injector.d.ts +2 -3
  106. package/dist/hooks/atlas/recent-model-resolver.d.ts +9 -1
  107. package/dist/hooks/atlas/tool-execute-after.d.ts +2 -1
  108. package/dist/hooks/atlas/tool-execute-before.d.ts +1 -0
  109. package/dist/hooks/atlas/types.d.ts +8 -2
  110. package/dist/hooks/index.d.ts +3 -0
  111. package/dist/hooks/keyword-detector/constants.d.ts +6 -0
  112. package/dist/hooks/keyword-detector/detector.d.ts +5 -3
  113. package/dist/hooks/keyword-detector/hook.d.ts +2 -1
  114. package/dist/hooks/keyword-detector/hyperplan/default.d.ts +13 -0
  115. package/dist/hooks/keyword-detector/hyperplan/index.d.ts +1 -0
  116. package/dist/hooks/keyword-detector/team/default.d.ts +13 -0
  117. package/dist/hooks/keyword-detector/team/index.d.ts +1 -0
  118. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +2 -2
  119. package/dist/hooks/team-mailbox-injector/hook.d.ts +31 -0
  120. package/dist/hooks/team-mailbox-injector/index.d.ts +2 -0
  121. package/dist/hooks/team-mode-status-injector/hook.d.ts +28 -0
  122. package/dist/hooks/team-mode-status-injector/index.d.ts +1 -0
  123. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +38 -0
  124. package/dist/hooks/team-session-events/team-lead-orphan-handler.d.ts +12 -0
  125. package/dist/hooks/team-session-events/team-member-error-handler.d.ts +10 -0
  126. package/dist/hooks/team-session-events/team-member-status-handler.d.ts +10 -0
  127. package/dist/hooks/team-tool-gating/hook.d.ts +3 -0
  128. package/dist/hooks/team-tool-gating/index.d.ts +1 -0
  129. package/dist/hooks/write-existing-file-guard/hook.d.ts +6 -1
  130. package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -0
  131. package/dist/index.js +89536 -80765
  132. package/dist/oh-my-opencode.schema.json +191 -47
  133. package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
  134. package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
  135. package/dist/plugin/hooks/create-transform-hooks.d.ts +3 -1
  136. package/dist/plugin/recent-synthetic-idles.d.ts +1 -0
  137. package/dist/plugin/tool-registry.d.ts +16 -0
  138. package/dist/shared/bun-spawn-shim.d.ts +40 -0
  139. package/dist/shared/project-discovery-dirs.d.ts +1 -0
  140. package/dist/shared/shell-env.d.ts +1 -0
  141. package/dist/shared/tmux/constants.d.ts +1 -1
  142. package/dist/shared/tmux/index.d.ts +1 -0
  143. package/dist/shared/tmux/runner.d.ts +13 -0
  144. package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -1
  145. package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +13 -1
  146. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +13 -1
  147. package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -1
  148. package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +9 -2
  149. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +13 -1
  150. package/dist/shared/tmux/tmux-utils.d.ts +1 -1
  151. package/dist/tools/delegate-task/openai-categories.d.ts +1 -0
  152. package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
  153. package/dist/tools/delegate-task/subagent-resolver.d.ts +5 -1
  154. package/dist/tools/delegate-task/types.d.ts +1 -0
  155. package/dist/tools/index.d.ts +1 -0
  156. package/dist/tools/look-at/missing-file-error.d.ts +2 -0
  157. package/dist/tools/skill/types.d.ts +2 -0
  158. package/package.json +3 -1
@@ -14,6 +14,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
14
14
  "git-master": "git-master";
15
15
  "review-work": "review-work";
16
16
  "ai-slop-remover": "ai-slop-remover";
17
+ "team-mode": "team-mode";
17
18
  }>>>;
18
19
  disabled_hooks: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
20
  disabled_commands: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -25,6 +26,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
25
26
  "start-work": "start-work";
26
27
  "stop-continuation": "stop-continuation";
27
28
  "remove-ai-slops": "remove-ai-slops";
29
+ hyperplan: "hyperplan";
28
30
  }>>>;
29
31
  disabled_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
32
  mcp_env_allowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -43,6 +45,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
43
45
  medium: "medium";
44
46
  high: "high";
45
47
  xhigh: "xhigh";
48
+ max: "max";
46
49
  }>>;
47
50
  temperature: z.ZodOptional<z.ZodNumber>;
48
51
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -64,6 +67,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
64
67
  medium: "medium";
65
68
  high: "high";
66
69
  xhigh: "xhigh";
70
+ max: "max";
67
71
  }>>;
68
72
  temperature: z.ZodOptional<z.ZodNumber>;
69
73
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -143,6 +147,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
143
147
  medium: "medium";
144
148
  high: "high";
145
149
  xhigh: "xhigh";
150
+ max: "max";
146
151
  }>>;
147
152
  textVerbosity: z.ZodOptional<z.ZodEnum<{
148
153
  low: "low";
@@ -171,6 +176,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
171
176
  medium: "medium";
172
177
  high: "high";
173
178
  xhigh: "xhigh";
179
+ max: "max";
174
180
  }>>;
175
181
  temperature: z.ZodOptional<z.ZodNumber>;
176
182
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -192,6 +198,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
192
198
  medium: "medium";
193
199
  high: "high";
194
200
  xhigh: "xhigh";
201
+ max: "max";
195
202
  }>>;
196
203
  temperature: z.ZodOptional<z.ZodNumber>;
197
204
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -271,6 +278,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
271
278
  medium: "medium";
272
279
  high: "high";
273
280
  xhigh: "xhigh";
281
+ max: "max";
274
282
  }>>;
275
283
  textVerbosity: z.ZodOptional<z.ZodEnum<{
276
284
  low: "low";
@@ -299,6 +307,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
299
307
  medium: "medium";
300
308
  high: "high";
301
309
  xhigh: "xhigh";
310
+ max: "max";
302
311
  }>>;
303
312
  temperature: z.ZodOptional<z.ZodNumber>;
304
313
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -320,6 +329,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
320
329
  medium: "medium";
321
330
  high: "high";
322
331
  xhigh: "xhigh";
332
+ max: "max";
323
333
  }>>;
324
334
  temperature: z.ZodOptional<z.ZodNumber>;
325
335
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -399,6 +409,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
399
409
  medium: "medium";
400
410
  high: "high";
401
411
  xhigh: "xhigh";
412
+ max: "max";
402
413
  }>>;
403
414
  textVerbosity: z.ZodOptional<z.ZodEnum<{
404
415
  low: "low";
@@ -427,6 +438,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
427
438
  medium: "medium";
428
439
  high: "high";
429
440
  xhigh: "xhigh";
441
+ max: "max";
430
442
  }>>;
431
443
  temperature: z.ZodOptional<z.ZodNumber>;
432
444
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -448,6 +460,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
448
460
  medium: "medium";
449
461
  high: "high";
450
462
  xhigh: "xhigh";
463
+ max: "max";
451
464
  }>>;
452
465
  temperature: z.ZodOptional<z.ZodNumber>;
453
466
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -527,6 +540,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
527
540
  medium: "medium";
528
541
  high: "high";
529
542
  xhigh: "xhigh";
543
+ max: "max";
530
544
  }>>;
531
545
  textVerbosity: z.ZodOptional<z.ZodEnum<{
532
546
  low: "low";
@@ -556,6 +570,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
556
570
  medium: "medium";
557
571
  high: "high";
558
572
  xhigh: "xhigh";
573
+ max: "max";
559
574
  }>>;
560
575
  temperature: z.ZodOptional<z.ZodNumber>;
561
576
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -577,6 +592,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
577
592
  medium: "medium";
578
593
  high: "high";
579
594
  xhigh: "xhigh";
595
+ max: "max";
580
596
  }>>;
581
597
  temperature: z.ZodOptional<z.ZodNumber>;
582
598
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -656,6 +672,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
656
672
  medium: "medium";
657
673
  high: "high";
658
674
  xhigh: "xhigh";
675
+ max: "max";
659
676
  }>>;
660
677
  textVerbosity: z.ZodOptional<z.ZodEnum<{
661
678
  low: "low";
@@ -684,6 +701,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
684
701
  medium: "medium";
685
702
  high: "high";
686
703
  xhigh: "xhigh";
704
+ max: "max";
687
705
  }>>;
688
706
  temperature: z.ZodOptional<z.ZodNumber>;
689
707
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -705,6 +723,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
705
723
  medium: "medium";
706
724
  high: "high";
707
725
  xhigh: "xhigh";
726
+ max: "max";
708
727
  }>>;
709
728
  temperature: z.ZodOptional<z.ZodNumber>;
710
729
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -784,6 +803,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
784
803
  medium: "medium";
785
804
  high: "high";
786
805
  xhigh: "xhigh";
806
+ max: "max";
787
807
  }>>;
788
808
  textVerbosity: z.ZodOptional<z.ZodEnum<{
789
809
  low: "low";
@@ -812,6 +832,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
812
832
  medium: "medium";
813
833
  high: "high";
814
834
  xhigh: "xhigh";
835
+ max: "max";
815
836
  }>>;
816
837
  temperature: z.ZodOptional<z.ZodNumber>;
817
838
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -833,6 +854,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
833
854
  medium: "medium";
834
855
  high: "high";
835
856
  xhigh: "xhigh";
857
+ max: "max";
836
858
  }>>;
837
859
  temperature: z.ZodOptional<z.ZodNumber>;
838
860
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -912,6 +934,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
912
934
  medium: "medium";
913
935
  high: "high";
914
936
  xhigh: "xhigh";
937
+ max: "max";
915
938
  }>>;
916
939
  textVerbosity: z.ZodOptional<z.ZodEnum<{
917
940
  low: "low";
@@ -940,6 +963,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
940
963
  medium: "medium";
941
964
  high: "high";
942
965
  xhigh: "xhigh";
966
+ max: "max";
943
967
  }>>;
944
968
  temperature: z.ZodOptional<z.ZodNumber>;
945
969
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -961,6 +985,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
961
985
  medium: "medium";
962
986
  high: "high";
963
987
  xhigh: "xhigh";
988
+ max: "max";
964
989
  }>>;
965
990
  temperature: z.ZodOptional<z.ZodNumber>;
966
991
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1040,6 +1065,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1040
1065
  medium: "medium";
1041
1066
  high: "high";
1042
1067
  xhigh: "xhigh";
1068
+ max: "max";
1043
1069
  }>>;
1044
1070
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1045
1071
  low: "low";
@@ -1068,6 +1094,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1068
1094
  medium: "medium";
1069
1095
  high: "high";
1070
1096
  xhigh: "xhigh";
1097
+ max: "max";
1071
1098
  }>>;
1072
1099
  temperature: z.ZodOptional<z.ZodNumber>;
1073
1100
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1089,6 +1116,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1089
1116
  medium: "medium";
1090
1117
  high: "high";
1091
1118
  xhigh: "xhigh";
1119
+ max: "max";
1092
1120
  }>>;
1093
1121
  temperature: z.ZodOptional<z.ZodNumber>;
1094
1122
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1168,6 +1196,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1168
1196
  medium: "medium";
1169
1197
  high: "high";
1170
1198
  xhigh: "xhigh";
1199
+ max: "max";
1171
1200
  }>>;
1172
1201
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1173
1202
  low: "low";
@@ -1196,6 +1225,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1196
1225
  medium: "medium";
1197
1226
  high: "high";
1198
1227
  xhigh: "xhigh";
1228
+ max: "max";
1199
1229
  }>>;
1200
1230
  temperature: z.ZodOptional<z.ZodNumber>;
1201
1231
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1217,6 +1247,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1217
1247
  medium: "medium";
1218
1248
  high: "high";
1219
1249
  xhigh: "xhigh";
1250
+ max: "max";
1220
1251
  }>>;
1221
1252
  temperature: z.ZodOptional<z.ZodNumber>;
1222
1253
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1296,6 +1327,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1296
1327
  medium: "medium";
1297
1328
  high: "high";
1298
1329
  xhigh: "xhigh";
1330
+ max: "max";
1299
1331
  }>>;
1300
1332
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1301
1333
  low: "low";
@@ -1324,6 +1356,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1324
1356
  medium: "medium";
1325
1357
  high: "high";
1326
1358
  xhigh: "xhigh";
1359
+ max: "max";
1327
1360
  }>>;
1328
1361
  temperature: z.ZodOptional<z.ZodNumber>;
1329
1362
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1345,6 +1378,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1345
1378
  medium: "medium";
1346
1379
  high: "high";
1347
1380
  xhigh: "xhigh";
1381
+ max: "max";
1348
1382
  }>>;
1349
1383
  temperature: z.ZodOptional<z.ZodNumber>;
1350
1384
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1424,6 +1458,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1424
1458
  medium: "medium";
1425
1459
  high: "high";
1426
1460
  xhigh: "xhigh";
1461
+ max: "max";
1427
1462
  }>>;
1428
1463
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1429
1464
  low: "low";
@@ -1452,6 +1487,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1452
1487
  medium: "medium";
1453
1488
  high: "high";
1454
1489
  xhigh: "xhigh";
1490
+ max: "max";
1455
1491
  }>>;
1456
1492
  temperature: z.ZodOptional<z.ZodNumber>;
1457
1493
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1473,6 +1509,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1473
1509
  medium: "medium";
1474
1510
  high: "high";
1475
1511
  xhigh: "xhigh";
1512
+ max: "max";
1476
1513
  }>>;
1477
1514
  temperature: z.ZodOptional<z.ZodNumber>;
1478
1515
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1552,6 +1589,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1552
1589
  medium: "medium";
1553
1590
  high: "high";
1554
1591
  xhigh: "xhigh";
1592
+ max: "max";
1555
1593
  }>>;
1556
1594
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1557
1595
  low: "low";
@@ -1580,6 +1618,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1580
1618
  medium: "medium";
1581
1619
  high: "high";
1582
1620
  xhigh: "xhigh";
1621
+ max: "max";
1583
1622
  }>>;
1584
1623
  temperature: z.ZodOptional<z.ZodNumber>;
1585
1624
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1601,6 +1640,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1601
1640
  medium: "medium";
1602
1641
  high: "high";
1603
1642
  xhigh: "xhigh";
1643
+ max: "max";
1604
1644
  }>>;
1605
1645
  temperature: z.ZodOptional<z.ZodNumber>;
1606
1646
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1680,6 +1720,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1680
1720
  medium: "medium";
1681
1721
  high: "high";
1682
1722
  xhigh: "xhigh";
1723
+ max: "max";
1683
1724
  }>>;
1684
1725
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1685
1726
  low: "low";
@@ -1708,6 +1749,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1708
1749
  medium: "medium";
1709
1750
  high: "high";
1710
1751
  xhigh: "xhigh";
1752
+ max: "max";
1711
1753
  }>>;
1712
1754
  temperature: z.ZodOptional<z.ZodNumber>;
1713
1755
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1729,6 +1771,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1729
1771
  medium: "medium";
1730
1772
  high: "high";
1731
1773
  xhigh: "xhigh";
1774
+ max: "max";
1732
1775
  }>>;
1733
1776
  temperature: z.ZodOptional<z.ZodNumber>;
1734
1777
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1808,6 +1851,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1808
1851
  medium: "medium";
1809
1852
  high: "high";
1810
1853
  xhigh: "xhigh";
1854
+ max: "max";
1811
1855
  }>>;
1812
1856
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1813
1857
  low: "low";
@@ -1838,6 +1882,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1838
1882
  medium: "medium";
1839
1883
  high: "high";
1840
1884
  xhigh: "xhigh";
1885
+ max: "max";
1841
1886
  }>>;
1842
1887
  temperature: z.ZodOptional<z.ZodNumber>;
1843
1888
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1859,6 +1904,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1859
1904
  medium: "medium";
1860
1905
  high: "high";
1861
1906
  xhigh: "xhigh";
1907
+ max: "max";
1862
1908
  }>>;
1863
1909
  temperature: z.ZodOptional<z.ZodNumber>;
1864
1910
  top_p: z.ZodOptional<z.ZodNumber>;
@@ -1889,6 +1935,7 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
1889
1935
  medium: "medium";
1890
1936
  high: "high";
1891
1937
  xhigh: "xhigh";
1938
+ max: "max";
1892
1939
  }>>;
1893
1940
  textVerbosity: z.ZodOptional<z.ZodEnum<{
1894
1941
  low: "low";
@@ -2056,6 +2103,29 @@ export declare const OhMyOpenCodeConfigSchema: z.ZodObject<{
2056
2103
  includePrefix: z.ZodDefault<z.ZodBoolean>;
2057
2104
  }, z.core.$strip>>;
2058
2105
  }, z.core.$strip>>;
2106
+ team_mode: z.ZodOptional<z.ZodObject<{
2107
+ enabled: z.ZodDefault<z.ZodBoolean>;
2108
+ tmux_visualization: z.ZodDefault<z.ZodBoolean>;
2109
+ max_parallel_members: z.ZodDefault<z.ZodNumber>;
2110
+ max_members: z.ZodDefault<z.ZodNumber>;
2111
+ max_messages_per_run: z.ZodDefault<z.ZodNumber>;
2112
+ max_wall_clock_minutes: z.ZodDefault<z.ZodNumber>;
2113
+ max_member_turns: z.ZodDefault<z.ZodNumber>;
2114
+ base_dir: z.ZodOptional<z.ZodString>;
2115
+ message_payload_max_bytes: z.ZodDefault<z.ZodNumber>;
2116
+ recipient_unread_max_bytes: z.ZodDefault<z.ZodNumber>;
2117
+ mailbox_poll_interval_ms: z.ZodDefault<z.ZodNumber>;
2118
+ }, z.core.$strip>>;
2119
+ keyword_detector: z.ZodOptional<z.ZodObject<{
2120
+ disabled_keywords: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2121
+ search: "search";
2122
+ ultrawork: "ultrawork";
2123
+ hyperplan: "hyperplan";
2124
+ analyze: "analyze";
2125
+ team: "team";
2126
+ "hyperplan-ultrawork": "hyperplan-ultrawork";
2127
+ }>>>;
2128
+ }, z.core.$strip>>;
2059
2129
  babysitting: z.ZodOptional<z.ZodObject<{
2060
2130
  timeout_ms: z.ZodDefault<z.ZodNumber>;
2061
2131
  }, z.core.$strip>>;
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ /** Team Mode config - see .sisyphus/plans/team-mode.md (D-01/D-25). */
3
+ export declare const TeamModeConfigSchema: z.ZodObject<{
4
+ enabled: z.ZodDefault<z.ZodBoolean>;
5
+ tmux_visualization: z.ZodDefault<z.ZodBoolean>;
6
+ max_parallel_members: z.ZodDefault<z.ZodNumber>;
7
+ max_members: z.ZodDefault<z.ZodNumber>;
8
+ max_messages_per_run: z.ZodDefault<z.ZodNumber>;
9
+ max_wall_clock_minutes: z.ZodDefault<z.ZodNumber>;
10
+ max_member_turns: z.ZodDefault<z.ZodNumber>;
11
+ base_dir: z.ZodOptional<z.ZodString>;
12
+ message_payload_max_bytes: z.ZodDefault<z.ZodNumber>;
13
+ recipient_unread_max_bytes: z.ZodDefault<z.ZodNumber>;
14
+ mailbox_poll_interval_ms: z.ZodDefault<z.ZodNumber>;
15
+ }, z.core.$strip>;
16
+ export type TeamModeConfig = z.infer<typeof TeamModeConfigSchema>;
@@ -13,11 +13,13 @@ export * from "./schema/fallback-models";
13
13
  export * from "./schema/git-env-prefix";
14
14
  export * from "./schema/git-master";
15
15
  export * from "./schema/hooks";
16
+ export * from "./schema/keyword-detector";
16
17
  export * from "./schema/model-capabilities";
17
18
  export * from "./schema/notification";
18
19
  export * from "./schema/oh-my-opencode-config";
19
20
  export * from "./schema/ralph-loop";
20
21
  export * from "./schema/runtime-fallback";
22
+ export * from "./schema/team-mode";
21
23
  export * from "./schema/skills";
22
24
  export * from "./schema/sisyphus";
23
25
  export * from "./schema/sisyphus-agent";
@@ -42,6 +42,8 @@ export declare function createHooks(args: {
42
42
  claudeCodeHooks: ReturnType<typeof import("./hooks").createClaudeCodeHooksHook> | null;
43
43
  keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
44
44
  contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
45
+ teamModeStatusInjector: ReturnType<typeof import("./hooks").createTeamModeStatusInjector> | null;
46
+ teamMailboxInjector: ReturnType<typeof import("./hooks").createTeamMailboxInjector> | null;
45
47
  thinkingBlockValidator: ReturnType<typeof import("./hooks").createThinkingBlockValidatorHook> | null;
46
48
  toolPairValidator: ReturnType<typeof import("./hooks").createToolPairValidatorHook> | null;
47
49
  commentChecker: ReturnType<typeof import("./hooks").createCommentCheckerHooks> | null;
@@ -58,6 +60,7 @@ export declare function createHooks(args: {
58
60
  readImageResizer: ReturnType<typeof import("./hooks").createReadImageResizerHook> | null;
59
61
  todoDescriptionOverride: ReturnType<typeof import("./hooks").createTodoDescriptionOverrideHook> | null;
60
62
  webfetchRedirectGuard: ReturnType<typeof import("./hooks").createWebFetchRedirectGuardHook> | null;
63
+ teamToolGating: ReturnType<typeof import("./hooks").createTeamToolGating> | null;
61
64
  contextWindowMonitor: ReturnType<typeof import("./hooks").createContextWindowMonitorHook> | null;
62
65
  preemptiveCompaction: ReturnType<typeof import("./hooks").createPreemptiveCompactionHook> | null;
63
66
  sessionRecovery: ReturnType<typeof import("./hooks").createSessionRecoveryHook> | null;
@@ -2,6 +2,7 @@ import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { ModelFallbackControllerAccessor } from "../../hooks/model-fallback";
3
3
  import type { BackgroundTask, LaunchInput, ResumeInput } from "./types";
4
4
  import { TaskHistory } from "./task-history";
5
+ import { log } from "../../shared";
5
6
  import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema";
6
7
  import { type SubagentSpawnContext } from "./subagent-spawn-limits";
7
8
  interface EventProperties {
@@ -29,6 +30,7 @@ export interface BackgroundManagerConfig {
29
30
  onShutdown?: () => void | Promise<void>;
30
31
  enableParentSessionNotifications?: boolean;
31
32
  modelFallbackControllerAccessor?: ModelFallbackControllerAccessor;
33
+ log?: typeof log;
32
34
  }
33
35
  export declare class BackgroundManager {
34
36
  private tasks;
@@ -58,6 +60,7 @@ export declare class BackgroundManager {
58
60
  private preStartDescendantReservations;
59
61
  private enableParentSessionNotifications;
60
62
  private modelFallbackControllerAccessor?;
63
+ private logger;
61
64
  private loggedSessionStatusUnavailable;
62
65
  readonly taskHistory: TaskHistory;
63
66
  private cachedCircuitBreakerSettings?;
@@ -35,6 +35,7 @@ export interface BackgroundTask {
35
35
  rootSessionId?: string;
36
36
  parentSessionId: string;
37
37
  parentMessageId: string;
38
+ teamRunId?: string;
38
39
  description: string;
39
40
  prompt: string;
40
41
  agent: string;
@@ -91,6 +92,8 @@ export interface LaunchInput {
91
92
  agent: string;
92
93
  parentSessionId: string;
93
94
  parentMessageId: string;
95
+ teamRunId?: string;
96
+ suppressTmuxSpawn?: boolean;
94
97
  parentModel?: {
95
98
  providerID: string;
96
99
  modelID: string;
@@ -105,6 +108,7 @@ export interface LaunchInput {
105
108
  skillContent?: string;
106
109
  category?: string;
107
110
  sessionPermission?: SessionPermissionRule[];
111
+ onSessionCreated?: (sessionId: string) => void | Promise<void>;
108
112
  }
109
113
  export interface ResumeInput {
110
114
  sessionId: string;
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import type { BoulderState, PlanProgress, TaskSessionState } from "./types";
7
7
  export declare function getBoulderFilePath(directory: string): string;
8
+ export declare function resolveBoulderPlanPath(directory: string, state: Pick<BoulderState, "active_plan" | "worktree_path">): string;
8
9
  export declare function readBoulderState(directory: string): BoulderState | null;
9
10
  export declare function writeBoulderState(directory: string, state: BoulderState): boolean;
10
11
  export declare function appendSessionId(directory: string, sessionId: string, origin?: "direct" | "appended"): BoulderState | null;
@@ -1,6 +1,7 @@
1
1
  import type { BuiltinCommandName, BuiltinCommands } from "./types";
2
2
  interface LoadBuiltinCommandsOptions {
3
3
  useRegisteredAgents?: boolean;
4
+ teamModeEnabled?: boolean;
4
5
  }
5
6
  export declare function loadBuiltinCommands(disabledCommands?: BuiltinCommandName[], options?: LoadBuiltinCommandsOptions): BuiltinCommands;
6
7
  export {};
@@ -0,0 +1 @@
1
+ export declare const HYPERPLAN_TEMPLATE = "You are running the `/hyperplan` command \u2014 adversarial multi-agent planning via team-mode.\n\nLOAD THE HYPERPLAN SKILL IMMEDIATELY:\n\n```\nskill(name=\"hyperplan\")\n```\n\nAfter loading the skill, follow its 7-phase workflow EXACTLY using this user request.\n\nRoster contract: call `team_create` with category members `unspecified-low`, `unspecified-high`, `ultrabrain`, and `artistry`. Include `deep` only if the category is enabled; if `deep` is disabled or unavailable, retry without only that member and state the degraded roster.\n\n<user-request>\n$ARGUMENTS\n</user-request>\n\nIf team-mode is unavailable (`team_*` tools missing), instruct the user to set `team_mode.enabled: true` in `~/.config/opencode/oh-my-opencode.jsonc` and restart opencode.";
@@ -1 +1,2 @@
1
1
  export declare const REFACTOR_TEMPLATE = "# Intelligent Refactor Command\n\n## Usage\n```\n/refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\nArguments:\n refactoring-target: What to refactor. Can be:\n - File path: src/auth/handler.ts\n - Symbol name: \"AuthService class\"\n - Pattern: \"all functions using deprecated API\"\n - Description: \"extract validation logic into separate module\"\n\nOptions:\n --scope: Refactoring scope (default: module)\n - file: Single file only\n - module: Module/directory scope\n - project: Entire codebase\n\n --strategy: Risk tolerance (default: safe)\n - safe: Conservative, maximum test coverage required\n - aggressive: Allow broader changes with adequate coverage\n```\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file/symbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules/files?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file/module/project)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n```\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n```\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using `call_omo_agent`:\n\n```\n// Agent 1: Find the refactoring target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET]. \n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: Find related code\ncall_omo_agent(\n subagent_type=\"explore\", \n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: Find similar patterns\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: Find tests\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: Architecture context\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n```typescript\n// Find definition(s)\nLspGotoDefinition(filePath, line, character) // Where is it defined?\n\n// Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n// Get file structure\nLspDocumentSymbols(filePath) // Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\") // Search by name\n\n// Get current diagnostics\nlsp_diagnostics(filePath) // Errors, warnings before we start\n```\n\n### AST-Grep for Pattern Analysis:\n\n```typescript\n// Find structural patterns\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // or relevant pattern\n lang=\"typescript\", // or relevant language\n paths=[\"src/\"]\n)\n\n// Preview refactoring (DRY RUN)\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // ALWAYS preview first\n)\n```\n\n### Grep for Text Patterns:\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3: Collect Background Results\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n```\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- `path/to/file.ts:L10-L50` - Primary definition\n- `path/to/file2.ts:L25` - Key usage\n\n### Dependency Graph\n```\n[TARGET] \n\u251C\u2500\u2500 imports from: \n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 imported by:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 used by:\n \u251C\u2500\u2500 handler.ts (direct call)\n \u2514\u2500\u2500 service.ts (dependency injection)\n```\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n```\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n```bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n```\n\n## 3.2: Analyze Test Coverage\n\n```\n// Find all tests related to target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=false, // Need this synchronously\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (<50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n```\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n```\n\n## 3.4: Document Verification Plan\n\n```\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: `bun test` / `npm test` / `pytest` / etc.\n- Integration: [command if exists]\n- Type check: `tsc --noEmit` / `pyright` / etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics \u2192 zero new errors\n2. Run test command \u2192 all pass\n3. Type check \u2192 clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n```\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n```\nTodoWrite([\n // Each step from the plan becomes a todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... continue for all steps\n])\n```\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as `in_progress`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n```typescript\nlsp_prepare_rename(filePath, line, character) // Validate rename is possible\nlsp_rename(filePath, line, character, newName) // Execute rename\n```\n\n**For Pattern Transformations:**\n```typescript\n// Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**For Structural Changes:**\n```typescript\n// Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n```\n\n### Post-Step Verification (MANDATORY)\n\n```typescript\n// 1. Check diagnostics\nlsp_diagnostics(filePath) // Must be clean or same as baseline\n\n// 2. Run tests\nbash(\"bun test\") // Or appropriate test command\n\n// 3. Type check\nbash(\"tsc --noEmit\") // Or appropriate type check\n```\n\n### Step Completion\n1. If verification passes \u2192 Mark step todo as `completed`\n2. If verification fails \u2192 **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n - Fix the issue and retry\n - Skip this step (if optional)\n - Consult oracle agent for help\n - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n```bash\n# Run complete test suite\nbun test # or npm test, pytest, go test, etc.\n```\n\n## 6.2: Type Check\n\n```bash\n# Full type check\ntsc --noEmit # or equivalent\n```\n\n## 6.3: Lint Check\n\n```bash\n# Run linter\neslint . # or equivalent\n```\n\n## 6.4: Build Verification (if applicable)\n\n```bash\n# Ensure build still works\nbun run build # or npm run build, etc.\n```\n\n## 6.5: Final Diagnostics\n\n```typescript\n// Check all changed files\nfor (file of changedFiles) {\n lsp_diagnostics(file) // Must all be clean\n}\n```\n\n## 6.6: Generate Summary\n\n```markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- `path/to/file.ts` - [what changed]\n- `path/to/file2.ts` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X/Y passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n```\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use `as any`, `@ts-ignore`, `@ts-expect-error`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: `LspGotoDefinition` to grasp context\n- **Impact analysis**: `LspFindReferences` to map all usages before modification\n- **Safe refactoring**: `lsp_prepare_rename` \u2192 `lsp_rename` for symbol renames\n- **Continuous verification**: `lsp_diagnostics` after every change\n\n## AST-Grep\nUse `ast_grep_search` and `ast_grep_replace` for structural transformations.\n**Critical**: Always `dryRun=true` first, review, then execute.\n\n## Agents\n- `explore`: Parallel codebase pattern discovery\n- `plan`: Detailed refactoring plan generation\n- `oracle`: Read-only consultation for complex architectural decisions and debugging\n- `librarian`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods/APIs during refactoring:\n1. Fire `librarian` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use `librarian` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
2
+ export declare const REFACTOR_TEAM_MODE_ADDENDUM = "\n---\n\n# Team Mode Protocol (active when team_* tools are present)\n\nTeam mode is enabled for this session. The rules below **override Phase 4-6** above. Follow this protocol instead of the in-session step-by-step execution.\n\n## Phase 4 override: Plan agent staffing requirement\n\nWhen invoking the Plan agent in Phase 4.1, append this additional requirement to the prompt:\n\n```\n7. (REQUIRED when team mode is active) Output a Team Staffing Recommendation section with these fields \u2014 missing fields fail Phase 5.0:\n - total_atomic_steps: integer\n - file_independent_steps: integer (parallelizable, no cross-file blocker)\n - cross_file_dependent_steps: integer (has blockers)\n - per_step_assignment: [{step_id, assigned_to: 'quick' | 'unspecified-low', blockedBy: [step_ids], rationale}]\n - dispatch_path_recommendation: 'team' | 'legacy' with reason\n - rationale for the composition\n```\n\n**Classification rules** the plan agent must apply to each step:\n- `quick`: mechanical edits \u2014 LSP rename, extract variable, inline, simple move, signature change without call-site logic.\n- `unspecified-low`: logic-preserving refactors that need reasoning \u2014 extract function, restructure conditional, pattern transformation, cross-file API change.\n- Recommend `team` path when `file_independent_steps >= 3`; recommend `legacy` otherwise.\n\n## Phase 5 override: Dispatch path selection\n\nRead the Team Staffing Recommendation from Phase 4. If any required field is missing, fail here and re-request the plan with the exact missing field names. Do not proceed with a partial plan.\n\nThen choose the path:\n\n- **Team path (5.1-T)**: when the plan recommends `team` AND `file_independent_steps >= 3`. Members execute in parallel, Lead orchestrates, a `deep` verifier lives outside the team.\n- **Legacy path (5.1-L)**: otherwise. Use the original 5.1 / 5.2 / 5.3 flow from above.\n\nRecord the chosen path in the TodoWrite list.\n\n## Phase 5.1-T: `refactor-squad` team execution\n\n**Precondition checks** (fail hard if any step fails):\n\n1. Load the `team-mode` skill via the `skill` tool for lifecycle, message protocol, and limits.\n2. Call `team_list` and verify no active `refactor-squad` run exists; if one does, shutdown + delete the orphan before proceeding.\n3. If `~/.omo/teams/refactor-squad/config.json` is missing, write it using the spec below.\n\n**Team spec** (`~/.omo/teams/refactor-squad/config.json`):\n\n```json\n{\n \"name\": \"refactor-squad\",\n \"lead\": { \"kind\": \"subagent_type\", \"subagent_type\": \"sisyphus\" },\n \"members\": [\n {\n \"kind\": \"category\",\n \"category\": \"quick\",\n \"prompt\": \"You handle mechanical refactoring steps (LSP rename, extract variable, inline, simple move, signature change). Use LSP tools for correctness. Apply the task description's per-step instructions verbatim \u2014 no scope expansion. After edits, run lsp_diagnostics on touched files. Report via team_send_message(teamRunId=<id>, to=\"lead\", summary=<files touched>, body=<lsp status + diff summary>) + team_task_update(status=completed). Never run tests \u2014 the external verifier handles that. Never git add, never --continue.\"\n },\n { \"kind\": \"category\", \"category\": \"quick\", \"prompt\": \"Same contract as peer quick worker.\" },\n {\n \"kind\": \"category\",\n \"category\": \"unspecified-low\",\n \"prompt\": \"You handle logic-preserving refactors that need reasoning (extract function, restructure conditional, pattern transformation, cross-file API change). Read the task description's plan step carefully. Use ast_grep_replace with dryRun=true first, review the preview, then execute. If the step is ambiguous or would require out-of-scope changes, STOP and send team_send_message(teamRunId=<id>, to=\"lead\", summary=\"UNCLEAR\", body=<reason>) + team_task_update(status=pending). Same reporting contract as peer quick workers. Never run tests.\"\n },\n { \"kind\": \"category\", \"category\": \"unspecified-low\", \"prompt\": \"Same contract as peer unspecified-low worker.\" }\n ]\n}\n```\n\nRationale for this composition:\n- **4 workers = team mode's parallel cap.** 5+ just queues.\n- **No verifier team member.** Verification needs `deep` reasoning (or `unspecified-high` fallback). In-team category routing downcasts to sisyphus-junior, which is weaker than required \u2014 the verifier runs OUTSIDE the team as a `task(category=\"deep\")`.\n- **quick \u00D7 2** for mechanical edits, **unspecified-low \u00D7 2** for reasoning edits \u2014 mirrors the plan's split.\n\n**Team lifecycle** (one team, reused until Phase 6 cleanup):\n\n1. `team_create(teamName=\"refactor-squad\")`. Record `teamRunId`.\n2. Broadcast the refactor Intent Card ONCE (keep task descriptions slim):\n ```\n team_send_message(\n teamRunId=<id>, to=\"*\", kind=\"announcement\",\n summary=\"refactor-intent\",\n body=<codemap summary + constraints + established patterns from Phase 2>\n )\n ```\n3. Broadcast the verification spec ONCE:\n ```\n team_send_message(\n teamRunId=<id>, to=\"*\", kind=\"announcement\",\n summary=\"verify-spec\",\n body=<exact test/typecheck/lint commands + expected pass counts + regression indicators from Phase 3.4>\n )\n ```\n4. For each plan step, `team_task_create(teamRunId=<id>, subject=\"refactor step <N>: <short>\", description=<per-step instructions from plan, including target files and line ranges, rollback strategy>, blockedBy=<from plan's per_step_assignment>)`.\n\n**Lead monitoring loop**:\n\nWhile any team task is `pending | claimed | in_progress`:\n\n- Wait for `<system-reminder>` or member messages. Avoid tight polling; a single `team_status` check is acceptable if no notification arrives within roughly 10 seconds of expected completion.\n- On a worker completion report, immediately dispatch an **external verifier** \u2014 verification runs OUTSIDE the team because team-member category routing downcasts to sisyphus-junior:\n ```\n task(\n category=\"deep\",\n load_skills=[],\n run_in_background=true,\n description=\"verify step <N>\",\n prompt=<files touched + verify-spec commands + instruction to return \"PASS\" or \"FAIL:<failing test + specific error + suggested revert hunks>\">\n )\n ```\n If `deep` is unavailable, fall back to `category=\"unspecified-high\"`. Do not create a commit checkpoint until the verifier returns PASS.\n- On a verifier PASS: make the commit checkpoint for that step (see original 5.3). Proceed.\n- On a verifier FAIL: Lead decides:\n - **Retry with fix hint**: `team_task_update(status=pending)` on the original step + `team_send_message(teamRunId=<id>, to=<original member>, summary=\"retry\", body=<specific failure from verifier>)`. Runtime reassigns.\n - **Escalate**: after three FAIL cycles on the same step, STOP and consult the user with full evidence.\n- On a member UNCLEAR message: re-harvest context via a targeted `task()` outside the team, broadcast an updated Intent Card fragment, then reassign.\n\nProceed to Phase 6 only when every team task is `completed` AND every paired verifier task returned PASS.\n\n## Phase 6 override: Team cleanup before summary\n\nIf Phase 5 used the team path, dismantle `refactor-squad` BEFORE producing the 6.6 summary. Every exit path \u2014 success, escalation, abort \u2014 must cleanup; orphan teams poison the next session's precondition check.\n\n1. `team_shutdown_request` for each member, then `team_approve_shutdown` if members do not self-approve within a reasonable window.\n2. `team_delete(teamRunId=<id>)`.\n3. `team_list` to confirm no residual `refactor-squad` run.\n\nThe `~/.omo/teams/refactor-squad/config.json` declaration stays on disk; next session reuses it.\n\nAppend to the 6.6 summary a \"Dispatch path\" line and, when team path was used, team metrics (teamRunId, tasks created, verifier runs, team lifetime).\n\n## MUST NOT (team mode)\n\n- Lead never edits files directly \u2014 orchestrate only.\n- Do not inline the Intent Card or verify-spec into task descriptions \u2014 rely on the broadcasts.\n- Do not recreate the team mid-session.\n- Do not run tests from Lead \u2014 the external verifier owns that lane.\n- Do not put `oracle` / `librarian` / `deep` into the team spec \u2014 oracle/librarian are team-ineligible, and `deep` under category routing downcasts to sisyphus-junior. Use them via `task()` outside the team when needed.\n";
@@ -1 +1,2 @@
1
1
  export declare const REMOVE_AI_SLOPS_TEMPLATE = "# Remove AI Slops Command\n\n## What this command does\nAnalyzes all files changed in the current branch (compared to parent commit), removes AI-generated code smells in parallel, then critically reviews the changes to ensure safety and behavior preservation. Fixes any issues found during review.\n\n## Step 0: Task Planning\n\nUse TodoWrite to create the task list:\n1. Get changed files from branch\n2. Run ai-slop-remover on each file in parallel\n3. Critically review all changes\n4. Fix any issues found\n\n## Role Definition\nYou are a senior code quality engineer specialized in identifying and removing AI-generated code patterns while preserving original functionality. You have deep expertise in code review, refactoring safety, and behavioral preservation.\n\n## Process\n\n### Phase 1: Identify Changed Files\nDetect the repository base branch dynamically, then get all changed files in the current branch:\n```bash\nBASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo \"main\")\ngit diff $(git merge-base \"$BASE_BRANCH\" HEAD)..HEAD --name-only\n```\n\nIf `git symbolic-ref refs/remotes/origin/HEAD` is unavailable, detect the base branch at runtime using the repo's configured remote default branch. Only fall back to `main` as a last resort.\n\n### Phase 2: Parallel AI Slop Removal\nFor each changed file, spawn an agent in parallel using the Task tool with the ai-slop-remover skill:\n\n```\ntask(category=\"quick\", load_skills=[\"ai-slop-remover\"], run_in_background=true, description=\"Remove AI slops from {filename}\", prompt=\"Remove AI slops from: {file_path}\")\n```\n\n**CRITICAL**: Launch ALL agents in a SINGLE message with multiple Task tool calls for maximum parallelism.\n\nBefore running ai-slop-remover on each file, save a file-specific rollback artifact that captures only the delta introduced by the slop-removal pass. Use a safe pattern such as generating a per-file patch and reverse-applying it if review fails.\n\nDo NOT use `git checkout -- {file_path}` or any rollback that discards pre-existing branch changes in the file.\n\n### Phase 3: Critical Review\nAfter all ai-slop-remover agents complete, perform a critical review with the following checklist:\n\n**Safety Verification**:\n- [ ] No functional logic was accidentally removed\n- [ ] All error handling is preserved\n- [ ] Type hints remain correct and complete\n- [ ] Import statements are still valid\n- [ ] No breaking changes to public APIs\n\n**Behavior Preservation**:\n- [ ] Return values unchanged\n- [ ] Side effects unchanged\n- [ ] Exception behavior unchanged\n- [ ] Edge case handling preserved\n\n**Code Quality**:\n- [ ] Removed changes are genuinely AI slop (not intentional patterns)\n- [ ] Remaining code follows project conventions\n- [ ] No orphaned code or dead references\n\n### Phase 4: Fix Issues\nIf any issues are found during critical review:\n1. Identify the specific problem\n2. Explain why it's a problem\n3. Revert only the ai-slop-remover delta using the saved per-file patch or an equivalent reverse-apply workflow\n4. If remaining ai-slops are found after reverting, remove them by editing the file yourself - with parallel tool calls, per-file\n5. Verify the fix doesn't introduce new issues\n\n## Output Format\n\n### Summary Report\n```\n## AI Slop Removal Summary\n\n### Files Processed\n- file1.py: X changes\n- file2.py: Y changes\n\n### Critical Review Results\n- Safety: PASS/FAIL\n- Behavior: PASS/FAIL\n- Quality: PASS/FAIL\n\n### Issues Found & Fixed\n1. [Issue description] -> [Fix applied]\n\n### Final Status\n[CLEAN / ISSUES FIXED / REQUIRES ATTENTION]\n```\n\n## Quality Assurance\n- NEVER remove code that serves a functional purpose\n- ALWAYS verify changes compile/parse correctly\n- ALWAYS preserve test coverage\n- If uncertain about a change, err on the side of keeping the original code";
2
+ export declare const REMOVE_AI_SLOPS_TEAM_MODE_ADDENDUM = "\n---\n\n# Team Mode Protocol (active when team_* tools are present)\n\nTeam mode is enabled for this session. The rules below **override Phase 2-4** of the legacy flow above. Follow this protocol instead of the per-file fire-and-forget `task()` dispatch.\n\n## Phase 2 (team): `slop-squad` setup\n\n**Precondition checks** (fail hard if any step fails):\n\n1. Load the `team-mode` skill via the `skill` tool for lifecycle, message protocol, broadcast rules, 32KB message cap, and 4 parallel worker cap.\n2. Call `team_list` and verify no active run named `slop-squad` exists. If one does, it is an orphan from a crashed prior session \u2014 `team_shutdown_request` + `team_approve_shutdown` + `team_delete` it before proceeding. Do not rename the team or run concurrent sessions under the same name.\n3. If `~/.omo/teams/slop-squad/config.json` is missing, write it using the spec below.\n\n**Team spec** (`~/.omo/teams/slop-squad/config.json`):\n\n```json\n{\n \"name\": \"slop-squad\",\n \"lead\": { \"kind\": \"subagent_type\", \"subagent_type\": \"sisyphus\" },\n \"members\": [\n {\n \"kind\": \"category\",\n \"category\": \"quick\",\n \"prompt\": \"You run ai-slop-remover on ONE file per task. Load ai-slop-remover via the skill tool. Read the task description for the file path. Apply the skill's detection criteria verbatim. After edits: run lsp_diagnostics on the file. Report via team_send_message(teamRunId=<id>, to=\"lead\", summary=<change count>, body=<full ai-slop-remover report>) + team_task_update(status=completed). On ambiguity: send team_send_message(teamRunId=<id>, to=\"lead\", summary=\"UNCLEAR\", body=<reason>) + team_task_update(status=pending). Never git add, never run tests, never touch other files.\"\n },\n { \"kind\": \"category\", \"category\": \"quick\", \"prompt\": \"Same contract as peer quick worker.\" },\n { \"kind\": \"category\", \"category\": \"quick\", \"prompt\": \"Same contract as peer quick worker.\" },\n {\n \"kind\": \"category\",\n \"category\": \"unspecified-low\",\n \"prompt\": \"You are the FIX worker. You claim rework tasks that the lead creates after the external reviewer flags issues. Read the reviewer's per-hunk rollback instructions in the task description, apply the reverse patch, then run ai-slop-remover ONLY on the non-rolled-back remainder. Same reporting contract as quick peers. Handle UNCLEAR escalations the same way.\"\n }\n ]\n}\n```\n\nRationale for this composition:\n- **4 workers = team mode's parallel cap.** A fifth member just queues.\n- **Reviewer is NOT a team member** \u2014 review demands stronger reasoning than category routing provides (team category members are downcast to sisyphus-junior). The reviewer runs OUTSIDE the team as a `deep` task; see Phase 3.\n- **quick \u00D7 3** absorbs the mass of per-file slop removal. **unspecified-low \u00D7 1** is the rework lane for fixes triggered by reviewer findings.\n\n**Team lifecycle** (create once, reuse until Phase 5 cleanup):\n\n1. `team_create(teamName=\"slop-squad\")`. Record `teamRunId` \u2014 every subsequent team call needs it.\n2. Broadcast the detection criteria ONCE so each task description stays minimal:\n ```\n team_send_message(\n teamRunId=<id>, to=\"*\", kind=\"announcement\",\n summary=\"slop-criteria\",\n body=<the 9 slop categories + KEEP rules; reference the ai-slop-remover skill content>\n )\n ```\n3. Before spawning tasks, save a per-file rollback artifact that captures only the delta the slop-removal pass will introduce. Do NOT use `git checkout -- <file>` \u2014 that would discard pre-existing branch changes.\n4. For each changed file, `team_task_create(teamRunId=<id>, subject=\"slop: <file>\", description=<file path + rollback artifact path + reporting format>, blockedBy=[])`.\n\n## Phase 3 (team): Incremental reviewer dispatch\n\nWhile any team task is `pending | claimed | in_progress`:\n\n- Wait for `<system-reminder>` or member messages. Do NOT tight-poll `team_status`; the runtime notifies on state changes. A single `team_status` check is acceptable if no notification arrives within roughly 10 seconds of expected completion.\n- On each worker completion report:\n - Log the report to the pending final summary (no blocking).\n - Immediately dispatch an **external reviewer** \u2014 review runs OUTSIDE the team because team-member category routing downcasts to sisyphus-junior:\n ```\n task(\n category=\"deep\",\n load_skills=[],\n run_in_background=true,\n description=\"slop review: <file>\",\n prompt=<file path + full worker report + Safety/Behavior/Quality checklist + instruction to output \"PASS\" or \"FAIL:<per-hunk rollback instructions>\">\n )\n ```\n If `deep` is unavailable in this session, fall back to `category=\"unspecified-high\"`.\n- On a reviewer task returning FAIL:\n - Create a rework team task: `team_task_create(subject=\"rework: <file>\", description=<reverse-patch hunks from reviewer + \"then run ai-slop-remover on remaining non-rolled-back issues only\">)`. The `unspecified-low` fix member claims it.\n - Create a new reviewer task paired to the rework completion (same incremental pattern).\n- Loop until every file has a PASS from the reviewer AND no team task is outstanding.\n\n## Phase 4 (team): Fix issues\n\nFixes happen incrementally during Phase 3's loop via rework tasks \u2014 this phase is already handled when the loop exits. Any remaining manual fix that neither worker nor fix member could resolve is handled by Lead here, editing files directly.\n\n## Phase 5 (team): Team cleanup\n\nBefore producing the summary report, dismantle the team on EVERY exit path \u2014 success, escalation, abort \u2014 otherwise the next session's Phase 2 precondition check catches the orphan.\n\n1. `team_shutdown_request` for each member, then `team_approve_shutdown` if members do not self-approve within a reasonable window.\n2. `team_delete(teamRunId=<id>)`.\n3. `team_list` to confirm no residual `slop-squad` run.\n\nThe `~/.omo/teams/slop-squad/config.json` declaration file stays on disk; it is reused next session.\n\n## MUST NOT (team mode)\n\n- Lead never edits files directly \u2014 orchestrate only. If editing is needed, it goes into a team task.\n- Do not inline the full slop-criteria into every task description; rely on the Phase 2 broadcast.\n- Do not call `team_create` again mid-session. One team per resolution.\n- Do not put `oracle` / `librarian` into the team spec \u2014 they are team-ineligible; call them via `task()` outside the team when needed.\n";
@@ -1,5 +1,5 @@
1
1
  import type { CommandDefinition } from "../claude-code-command-loader";
2
- export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "remove-ai-slops";
2
+ export type BuiltinCommandName = "init-deep" | "ralph-loop" | "cancel-ralph" | "ulw-loop" | "refactor" | "start-work" | "stop-continuation" | "handoff" | "remove-ai-slops" | "hyperplan";
3
3
  export interface BuiltinCommandConfig {
4
4
  disabled_commands?: BuiltinCommandName[];
5
5
  }