claudecode-omc 5.6.8 → 5.11.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 (216) hide show
  1. package/.local/settings/settings.json +8 -0
  2. package/.local/skills/prompt-optimizer/SKILL.md +262 -19
  3. package/.omc-curation/ecc-selection.json +80 -0
  4. package/.omc-curation/governance.json +116 -0
  5. package/.omc-curation/sources.lock.json +30 -0
  6. package/README.md +78 -4
  7. package/bundled/manifest.json +6 -5
  8. package/bundled/upstream/anthropic-skills/.omc-source/bundle.json +18 -0
  9. package/bundled/upstream/anthropic-skills/.omc-source/provenance.json +399 -0
  10. package/bundled/upstream/anthropic-skills/skills/claude-api/SKILL.md +18 -17
  11. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/examples.md +9 -9
  12. package/bundled/upstream/anthropic-skills/skills/claude-api/curl/managed-agents.md +4 -4
  13. package/bundled/upstream/anthropic-skills/skills/claude-api/go/managed-agents/README.md +2 -2
  14. package/bundled/upstream/anthropic-skills/skills/claude-api/java/claude-api.md +2 -2
  15. package/bundled/upstream/anthropic-skills/skills/claude-api/java/managed-agents/README.md +2 -2
  16. package/bundled/upstream/anthropic-skills/skills/claude-api/php/claude-api.md +10 -10
  17. package/bundled/upstream/anthropic-skills/skills/claude-api/php/managed-agents/README.md +2 -2
  18. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/README.md +16 -16
  19. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/batches.md +3 -3
  20. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/files-api.md +3 -3
  21. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/streaming.md +7 -7
  22. package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/tool-use.md +19 -19
  23. package/bundled/upstream/anthropic-skills/skills/claude-api/python/managed-agents/README.md +3 -3
  24. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/claude-api.md +4 -4
  25. package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/managed-agents/README.md +2 -2
  26. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/error-codes.md +5 -5
  27. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/live-sources.md +3 -1
  28. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-api-reference.md +10 -4
  29. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-core.md +19 -1
  30. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-environments.md +6 -2
  31. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-multiagent.md +1 -1
  32. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-onboarding.md +3 -3
  33. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-overview.md +3 -2
  34. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +173 -0
  35. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-tools.md +10 -4
  36. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/model-migration.md +113 -13
  37. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/models.md +14 -11
  38. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/prompt-caching.md +2 -2
  39. package/bundled/upstream/anthropic-skills/skills/claude-api/shared/tool-use-concepts.md +4 -4
  40. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/README.md +15 -15
  41. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/batches.md +2 -2
  42. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/files-api.md +1 -1
  43. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/streaming.md +5 -5
  44. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/tool-use.md +15 -15
  45. package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/managed-agents/README.md +3 -3
  46. package/bundled/upstream/ecc/.omc-source/bundle.json +2 -1
  47. package/bundled/upstream/ecc/.omc-source/last-plan-apply.json +108 -24
  48. package/bundled/upstream/ecc/.omc-source/manifests/.claude-plugin/marketplace.json +3 -3
  49. package/bundled/upstream/ecc/.omc-source/provenance.json +563 -0
  50. package/bundled/upstream/ecc/agents/marketing-agent.md +159 -0
  51. package/bundled/upstream/ecc/agents/react-build-resolver.md +215 -0
  52. package/bundled/upstream/ecc/agents/react-reviewer.md +167 -0
  53. package/bundled/upstream/ecc/agents/typescript-reviewer.md +3 -0
  54. package/bundled/upstream/ecc/commands/harness-audit.md +17 -10
  55. package/bundled/upstream/ecc/commands/marketing-campaign.md +129 -0
  56. package/bundled/upstream/ecc/commands/react-build.md +187 -0
  57. package/bundled/upstream/ecc/commands/react-review.md +170 -0
  58. package/bundled/upstream/ecc/commands/react-test.md +265 -0
  59. package/bundled/upstream/ecc/skills/benchmark-optimization-loop/SKILL.md +69 -0
  60. package/bundled/upstream/ecc/skills/blender-motion-state-inspection/SKILL.md +164 -0
  61. package/bundled/upstream/ecc/skills/canary-watch/SKILL.md +9 -1
  62. package/bundled/upstream/ecc/skills/continuous-learning-v2/hooks/observe.sh +31 -9
  63. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +38 -4
  64. package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +319 -12
  65. package/bundled/upstream/ecc/skills/data-throughput-accelerator/SKILL.md +72 -0
  66. package/bundled/upstream/ecc/skills/dynamic-workflow-mode/SKILL.md +123 -0
  67. package/bundled/upstream/ecc/skills/frontend-a11y/SKILL.md +446 -0
  68. package/bundled/upstream/ecc/skills/ito-basket-compare/SKILL.md +63 -0
  69. package/bundled/upstream/ecc/skills/ito-data-atlas-agent/SKILL.md +63 -0
  70. package/bundled/upstream/ecc/skills/ito-market-intelligence/SKILL.md +60 -0
  71. package/bundled/upstream/ecc/skills/ito-trade-planner/SKILL.md +67 -0
  72. package/bundled/upstream/ecc/skills/latency-critical-systems/SKILL.md +73 -0
  73. package/bundled/upstream/ecc/skills/marketing-campaign/SKILL.md +113 -0
  74. package/bundled/upstream/ecc/skills/nextjs-turbopack/SKILL.md +13 -0
  75. package/bundled/upstream/ecc/skills/parallel-execution-optimizer/SKILL.md +72 -0
  76. package/bundled/upstream/ecc/skills/prediction-market-oracle-research/SKILL.md +63 -0
  77. package/bundled/upstream/ecc/skills/prediction-market-risk-review/SKILL.md +60 -0
  78. package/bundled/upstream/ecc/skills/react-patterns/SKILL.md +341 -0
  79. package/bundled/upstream/ecc/skills/react-performance/SKILL.md +574 -0
  80. package/bundled/upstream/ecc/skills/react-testing/SKILL.md +423 -0
  81. package/bundled/upstream/ecc/skills/recsys-pipeline-architect/SKILL.md +114 -0
  82. package/bundled/upstream/ecc/skills/recursive-decision-ledger/SKILL.md +79 -0
  83. package/bundled/upstream/ecc/skills/social-publisher/SKILL.md +115 -0
  84. package/bundled/upstream/ecc/skills/team-agent-orchestration/SKILL.md +110 -0
  85. package/bundled/upstream/ecc/skills/uncloud/SKILL.md +343 -0
  86. package/bundled/upstream/ecc/skills/windows-desktop-e2e/SKILL.md +99 -0
  87. package/bundled/upstream/impeccable/.omc-source/bundle.json +20 -0
  88. package/bundled/upstream/impeccable/.omc-source/provenance.json +105 -0
  89. package/bundled/upstream/impeccable/agents/impeccable-manual-edit-applier.md +97 -0
  90. package/bundled/upstream/impeccable/skills/impeccable/SKILL.md +168 -0
  91. package/bundled/upstream/impeccable/skills/impeccable/reference/adapt.md +311 -0
  92. package/bundled/upstream/impeccable/skills/impeccable/reference/animate.md +201 -0
  93. package/bundled/upstream/impeccable/skills/impeccable/reference/audit.md +133 -0
  94. package/bundled/upstream/impeccable/skills/impeccable/reference/bolder.md +113 -0
  95. package/bundled/upstream/impeccable/skills/impeccable/reference/brand.md +108 -0
  96. package/bundled/upstream/impeccable/skills/impeccable/reference/clarify.md +288 -0
  97. package/bundled/upstream/impeccable/skills/impeccable/reference/codex.md +105 -0
  98. package/bundled/upstream/impeccable/skills/impeccable/reference/colorize.md +257 -0
  99. package/bundled/upstream/impeccable/skills/impeccable/reference/craft.md +123 -0
  100. package/bundled/upstream/impeccable/skills/impeccable/reference/critique.md +767 -0
  101. package/bundled/upstream/impeccable/skills/impeccable/reference/delight.md +302 -0
  102. package/bundled/upstream/impeccable/skills/impeccable/reference/distill.md +111 -0
  103. package/bundled/upstream/impeccable/skills/impeccable/reference/document.md +429 -0
  104. package/bundled/upstream/impeccable/skills/impeccable/reference/extract.md +69 -0
  105. package/bundled/upstream/impeccable/skills/impeccable/reference/harden.md +347 -0
  106. package/bundled/upstream/impeccable/skills/impeccable/reference/hooks.md +88 -0
  107. package/bundled/upstream/impeccable/skills/impeccable/reference/init.md +172 -0
  108. package/bundled/upstream/impeccable/skills/impeccable/reference/interaction-design.md +189 -0
  109. package/bundled/upstream/impeccable/skills/impeccable/reference/layout.md +161 -0
  110. package/bundled/upstream/impeccable/skills/impeccable/reference/live.md +718 -0
  111. package/bundled/upstream/impeccable/skills/impeccable/reference/onboard.md +234 -0
  112. package/bundled/upstream/impeccable/skills/impeccable/reference/optimize.md +258 -0
  113. package/bundled/upstream/impeccable/skills/impeccable/reference/overdrive.md +130 -0
  114. package/bundled/upstream/impeccable/skills/impeccable/reference/polish.md +241 -0
  115. package/bundled/upstream/impeccable/skills/impeccable/reference/product.md +60 -0
  116. package/bundled/upstream/impeccable/skills/impeccable/reference/quieter.md +99 -0
  117. package/bundled/upstream/impeccable/skills/impeccable/reference/shape.md +165 -0
  118. package/bundled/upstream/impeccable/skills/impeccable/reference/typeset.md +279 -0
  119. package/bundled/upstream/impeccable/skills/impeccable/scripts/command-metadata.json +94 -0
  120. package/bundled/upstream/impeccable/skills/impeccable/scripts/context-signals.mjs +225 -0
  121. package/bundled/upstream/impeccable/skills/impeccable/scripts/context.mjs +280 -0
  122. package/bundled/upstream/impeccable/skills/impeccable/scripts/critique-storage.mjs +242 -0
  123. package/bundled/upstream/impeccable/skills/impeccable/scripts/detect-csp.mjs +198 -0
  124. package/bundled/upstream/impeccable/skills/impeccable/scripts/detect.mjs +21 -0
  125. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/browser/injected/index.mjs +1735 -0
  126. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/cli/main.mjs +244 -0
  127. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +4907 -0
  128. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/detect-antipatterns.mjs +43 -0
  129. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +252 -0
  130. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +552 -0
  131. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +1013 -0
  132. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +208 -0
  133. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +189 -0
  134. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/findings.mjs +12 -0
  135. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/node/file-system.mjs +198 -0
  136. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/profile/profiler.mjs +166 -0
  137. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/registry/antipatterns.mjs +419 -0
  138. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/rules/checks.mjs +2671 -0
  139. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/shared/color.mjs +124 -0
  140. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/shared/constants.mjs +101 -0
  141. package/bundled/upstream/impeccable/skills/impeccable/scripts/detector/shared/page.mjs +7 -0
  142. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook-admin.mjs +574 -0
  143. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook-before-edit.mjs +473 -0
  144. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook-lib.mjs +1286 -0
  145. package/bundled/upstream/impeccable/skills/impeccable/scripts/hook.mjs +61 -0
  146. package/bundled/upstream/impeccable/skills/impeccable/scripts/lib/design-parser.mjs +835 -0
  147. package/bundled/upstream/impeccable/skills/impeccable/scripts/lib/impeccable-paths.mjs +126 -0
  148. package/bundled/upstream/impeccable/skills/impeccable/scripts/lib/is-generated.mjs +69 -0
  149. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/browser-script-parts.mjs +49 -0
  150. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/completion.mjs +19 -0
  151. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/event-validation.mjs +137 -0
  152. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/insert-ui.mjs +458 -0
  153. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/manual-apply.mjs +939 -0
  154. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/manual-edit-routes.mjs +357 -0
  155. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/manual-edits-buffer.mjs +152 -0
  156. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/session-store.mjs +289 -0
  157. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/svelte-component.mjs +826 -0
  158. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/sveltekit-adapter.mjs +274 -0
  159. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/ui-core.mjs +180 -0
  160. package/bundled/upstream/impeccable/skills/impeccable/scripts/live/vocabulary.mjs +36 -0
  161. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-accept.mjs +812 -0
  162. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-browser-dom.js +146 -0
  163. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-browser-session.js +123 -0
  164. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-browser.js +11086 -0
  165. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-commit-manual-edits.mjs +1241 -0
  166. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-complete.mjs +75 -0
  167. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-copy-edit-agent.mjs +683 -0
  168. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-discard-manual-edits.mjs +51 -0
  169. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-inject.mjs +583 -0
  170. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-insert.mjs +272 -0
  171. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-manual-edit-evidence.mjs +363 -0
  172. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-poll.mjs +379 -0
  173. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-resume.mjs +94 -0
  174. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-server.mjs +1134 -0
  175. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-status.mjs +61 -0
  176. package/bundled/upstream/impeccable/skills/impeccable/scripts/live-wrap.mjs +894 -0
  177. package/bundled/upstream/impeccable/skills/impeccable/scripts/live.mjs +246 -0
  178. package/bundled/upstream/impeccable/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  179. package/bundled/upstream/impeccable/skills/impeccable/scripts/palette.mjs +633 -0
  180. package/bundled/upstream/impeccable/skills/impeccable/scripts/pin.mjs +214 -0
  181. package/bundled/upstream/oh-my-claudecode/.omc-source/bundle.json +2 -1
  182. package/bundled/upstream/oh-my-claudecode/.omc-source/provenance.json +116 -0
  183. package/bundled/upstream/oh-my-claudecode/skills/autopilot/SKILL.md +7 -0
  184. package/bundled/upstream/oh-my-claudecode/skills/cancel/SKILL.md +1 -0
  185. package/bundled/upstream/oh-my-claudecode/skills/deep-interview/SKILL.md +39 -5
  186. package/bundled/upstream/oh-my-claudecode/skills/hud/SKILL.md +1 -0
  187. package/bundled/upstream/oh-my-claudecode/skills/local-build-reminder/SKILL.md +78 -0
  188. package/bundled/upstream/oh-my-claudecode/skills/omc-doctor/SKILL.md +1 -1
  189. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/SKILL.md +26 -10
  190. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/01-install-claude-md.md +3 -3
  191. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/02-configure.md +6 -4
  192. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/03-integrations.md +1 -1
  193. package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/04-welcome.md +2 -2
  194. package/bundled/upstream/oh-my-claudecode/skills/omc-teams/SKILL.md +6 -6
  195. package/bundled/upstream/oh-my-claudecode/skills/plan/SKILL.md +44 -32
  196. package/bundled/upstream/oh-my-claudecode/skills/ralph/SKILL.md +45 -21
  197. package/bundled/upstream/oh-my-claudecode/skills/ralplan/SKILL.md +1 -1
  198. package/bundled/upstream/oh-my-claudecode/skills/self-improve/SKILL.md +7 -0
  199. package/bundled/upstream/oh-my-claudecode/skills/self-improve/scripts/resolve-paths.mjs +39 -15
  200. package/bundled/upstream/oh-my-claudecode/skills/team/SKILL.md +132 -90
  201. package/bundled/upstream/oh-my-claudecode/skills/ultragoal/SKILL.md +93 -0
  202. package/bundled/upstream/oh-my-claudecode/skills/ultraqa/SKILL.md +28 -13
  203. package/bundled/upstream/oh-my-claudecode/skills/ultrawork/SKILL.md +7 -0
  204. package/bundled/upstream/superpowers/.omc-source/bundle.json +2 -1
  205. package/bundled/upstream/superpowers/.omc-source/provenance.json +63 -0
  206. package/package.json +2 -1
  207. package/src/catalog/source-catalog.js +10 -4
  208. package/src/cli/index.js +4 -0
  209. package/src/cli/plan.js +14 -2
  210. package/src/cli/setup.js +52 -13
  211. package/src/cli/skill.js +1 -1
  212. package/src/cli/source.js +271 -14
  213. package/src/config/sources.js +82 -1
  214. package/src/merge/content-patch.js +88 -0
  215. package/templates/merge-config.json +1 -8
  216. package/bundled/upstream/ecc/skills/strategic-compact/suggest-compact.sh +0 -54
@@ -2,9 +2,12 @@
2
2
 
3
3
  import { existsSync, mkdirSync } from 'node:fs';
4
4
  import { join, resolve } from 'node:path';
5
+ import { pathToFileURL } from 'node:url';
6
+ import { resolveOmcStateRoot } from '../../../scripts/lib/state-root.mjs';
5
7
 
6
8
  const DEFAULT_TOPIC_SLUG = 'default';
7
9
  const TOPICS_DIR = 'topics';
10
+ const SESSIONS_DIR = 'sessions';
8
11
 
9
12
  function slugify(value) {
10
13
  const normalized = String(value ?? '')
@@ -24,6 +27,7 @@ function parseArgs(argv) {
24
27
  projectRoot: process.cwd(),
25
28
  topic: '',
26
29
  slug: '',
30
+ sessionId: '',
27
31
  format: 'json',
28
32
  ensureDirs: false,
29
33
  };
@@ -47,6 +51,11 @@ function parseArgs(argv) {
47
51
  index += 1;
48
52
  } else if (arg.startsWith('--slug=')) {
49
53
  result.slug = arg.slice('--slug='.length);
54
+ } else if (arg === '--session-id' && next) {
55
+ result.sessionId = next;
56
+ index += 1;
57
+ } else if (arg.startsWith('--session-id=')) {
58
+ result.sessionId = arg.slice('--session-id='.length);
50
59
  } else if (arg === '--format' && next) {
51
60
  result.format = next;
52
61
  index += 1;
@@ -73,13 +82,13 @@ function hasLegacyLayout(baseRoot) {
73
82
  || existsSync(join(baseRoot, 'state', 'agent-settings.json'));
74
83
  }
75
84
 
76
- function buildPaths(root, projectRoot, topicSlug, scopeMode) {
85
+ function buildPaths(root, projectRoot, topicSlug, scopeMode, baseRoot) {
77
86
  const configDir = join(root, 'config');
78
87
  const stateDir = join(root, 'state');
79
88
  const trackingDir = join(root, 'tracking');
80
89
  const paths = {
81
90
  project_root: projectRoot,
82
- base_root: join(projectRoot, '.omc', 'self-improve'),
91
+ base_root: baseRoot,
83
92
  topic_slug: topicSlug,
84
93
  scope_mode: scopeMode,
85
94
  root,
@@ -120,21 +129,36 @@ function ensureDirs(paths) {
120
129
  }
121
130
  }
122
131
 
123
- export function resolveSelfImprovePaths({ projectRoot = process.cwd(), topic = '', slug = '' } = {}) {
132
+ export async function resolveSelfImprovePaths({ projectRoot = process.cwd(), topic = '', slug = '', sessionId = '' } = {}) {
124
133
  const resolvedProjectRoot = resolve(projectRoot);
125
- const baseRoot = join(resolvedProjectRoot, '.omc', 'self-improve');
134
+ const omcRoot = await resolveOmcStateRoot(resolvedProjectRoot);
135
+ const baseRoot = join(omcRoot, 'self-improve');
126
136
  const explicitSlug = slugify(slug || topic);
127
137
  const legacyLayout = hasLegacyLayout(baseRoot);
128
138
  const shouldUseLegacyRoot = !slug && !topic && legacyLayout;
129
139
  const topicSlug = shouldUseLegacyRoot ? DEFAULT_TOPIC_SLUG : explicitSlug;
140
+
141
+ // When a sessionId is provided, scope beneath topics/<slug>/sessions/<sid>/
142
+ // so concurrent runs sharing the same topic slug don't collide.
143
+ // Falls back to OMC_SESSION_ID env var when explicit arg is absent.
144
+ // Legacy layout (no topic/slug supplied, flat .omc/self-improve/ exists) is
145
+ // preserved as-is — session scoping only applies to the topic-scoped layout.
146
+ const rawSessionId = sessionId && sessionId.trim()
147
+ ? sessionId.trim()
148
+ : (process.env.OMC_SESSION_ID && process.env.OMC_SESSION_ID.trim() ? process.env.OMC_SESSION_ID.trim() : '');
149
+ const effectiveSessionId = shouldUseLegacyRoot ? '' : rawSessionId;
130
150
  const root = shouldUseLegacyRoot
131
151
  ? baseRoot
132
- : join(baseRoot, TOPICS_DIR, topicSlug);
152
+ : effectiveSessionId
153
+ ? join(baseRoot, TOPICS_DIR, topicSlug, SESSIONS_DIR, effectiveSessionId)
154
+ : join(baseRoot, TOPICS_DIR, topicSlug);
133
155
  const scopeMode = shouldUseLegacyRoot
134
156
  ? 'legacy-flat-root'
135
- : (slug || topic ? 'topic-scoped' : 'default-scoped');
157
+ : effectiveSessionId
158
+ ? 'session-scoped'
159
+ : (slug || topic ? 'topic-scoped' : 'default-scoped');
136
160
 
137
- return buildPaths(root, resolvedProjectRoot, topicSlug, scopeMode);
161
+ return { ...buildPaths(root, resolvedProjectRoot, topicSlug, scopeMode, baseRoot), session_id: effectiveSessionId || null };
138
162
  }
139
163
 
140
164
  function renderShell(paths) {
@@ -146,27 +170,29 @@ function renderShell(paths) {
146
170
  function printHelp() {
147
171
  process.stdout.write(
148
172
  [
149
- 'Usage: node resolve-paths.mjs [--project-root PATH] [--topic TEXT | --slug SLUG] [--ensure-dirs] [--format json|shell]',
173
+ 'Usage: node resolve-paths.mjs [--project-root PATH] [--topic TEXT | --slug SLUG] [--session-id SID] [--ensure-dirs] [--format json|shell]',
150
174
  '',
151
175
  'Resolves self-improve artifact paths.',
152
176
  '- New runs default to .omc/self-improve/topics/<topic-slug>/',
177
+ '- Pass --session-id to isolate parallel runs: .omc/self-improve/topics/<slug>/sessions/<sid>/',
153
178
  '- Legacy flat .omc/self-improve/ is preserved only when no topic/slug is supplied and a flat layout already exists',
154
179
  '',
155
180
  ].join('\n'),
156
181
  );
157
182
  }
158
183
 
159
- function main() {
184
+ async function main() {
160
185
  const args = parseArgs(process.argv.slice(2));
161
186
  if (args.help) {
162
187
  printHelp();
163
188
  return;
164
189
  }
165
190
 
166
- const paths = resolveSelfImprovePaths({
191
+ const paths = await resolveSelfImprovePaths({
167
192
  projectRoot: args.projectRoot,
168
193
  topic: args.topic,
169
194
  slug: args.slug,
195
+ sessionId: args.sessionId,
170
196
  });
171
197
 
172
198
  if (args.ensureDirs) {
@@ -181,12 +207,10 @@ function main() {
181
207
  process.stdout.write(`${JSON.stringify(paths, null, 2)}\n`);
182
208
  }
183
209
 
184
- if (import.meta.url === `file://${process.argv[1]}`) {
185
- try {
186
- main();
187
- } catch (error) {
210
+ if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) {
211
+ main().catch((error) => {
188
212
  const message = error instanceof Error ? error.message : String(error);
189
213
  process.stderr.write(`${message}\n`);
190
214
  process.exit(1);
191
- }
215
+ });
192
216
  }
@@ -78,6 +78,7 @@ User: "/team 3:executor fix all TypeScript errors"
78
78
  ```
79
79
 
80
80
  **Storage layout (managed by Claude Code):**
81
+
81
82
  ```
82
83
  ~/.claude/
83
84
  teams/fix-ts-errors/
@@ -90,6 +91,10 @@ User: "/team 3:executor fix all TypeScript errors"
90
91
  ...
91
92
  ```
92
93
 
94
+ ## Goal Workflow Relationship
95
+
96
+ Team is the OMC authority for parallel, staged execution. Use the deterministic conflict policies `refuse`, `adopt_existing`, and `artifact_only` rather than non-deterministic warning handling. If a task mentions Claude Code `/goal`, Ralph, UltraQA, or artifact-only Ultragoal, keep Team as the primary loop authority unless the leader explicitly hands off. Use `/goal` only as a documented native Claude Code handoff target or as visible evidence from the lead session; do not claim the `/goal` evaluator independently runs commands, reads files, or replaces `team-verify` / `team-fix`. Artifact-only Ultragoal references should be treated as durable goal ledger/checkpoint/evidence artifacts, not as worker execution by themselves.
97
+
93
98
  ## Staged Pipeline (Canonical Team Runtime)
94
99
 
95
100
  Team execution follows a staged pipeline:
@@ -100,13 +105,13 @@ Team execution follows a staged pipeline:
100
105
 
101
106
  Each pipeline stage uses **specialized agents** -- not just executors. The lead selects agents based on the stage and task characteristics.
102
107
 
103
- | Stage | Required Agents | Optional Agents | Selection Criteria |
104
- |-------|----------------|-----------------|-------------------|
105
- | **team-plan** | `explore` (haiku), `planner` (opus) | `analyst` (opus), `architect` (opus) | Use `analyst` for unclear requirements. Use `architect` for systems with complex boundaries. |
106
- | **team-prd** | `analyst` (opus) | `critic` (opus) | Use `critic` to challenge scope. |
107
- | **team-exec** | `executor` (sonnet) | `executor` (opus), `debugger` (sonnet), `designer` (sonnet), `writer` (haiku), `test-engineer` (sonnet) | Match agent to subtask type. Use `executor` (model=opus) for complex autonomous work, `designer` for UI, `debugger` for compilation issues, `writer` for docs, `test-engineer` for test creation. |
108
- | **team-verify** | `verifier` (sonnet) | `test-engineer` (sonnet), `security-reviewer` (sonnet), `code-reviewer` (opus) | Always run `verifier`. Add `security-reviewer` for auth/crypto changes. Add `code-reviewer` for >20 files or architectural changes. `code-reviewer` also covers style/formatting checks. |
109
- | **team-fix** | `executor` (sonnet) | `debugger` (sonnet), `executor` (opus) | Use `debugger` for type/build errors and regression isolation. Use `executor` (model=opus) for complex multi-file fixes. |
108
+ | Stage | Required Agents | Optional Agents | Selection Criteria |
109
+ | --------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
110
+ | **team-plan** | `explore` (haiku), `planner` (opus) | `analyst` (opus), `architect` (opus) | Use `analyst` for unclear requirements. Use `architect` for systems with complex boundaries. |
111
+ | **team-prd** | `analyst` (opus) | `critic` (opus) | Use `critic` to challenge scope. |
112
+ | **team-exec** | `executor` (sonnet) | `executor` (opus), `debugger` (sonnet), `designer` (sonnet), `writer` (haiku), `test-engineer` (sonnet) | Match agent to subtask type. Use `executor` (model=opus) for complex autonomous work, `designer` for UI, `debugger` for compilation issues, `writer` for docs, `test-engineer` for test creation. |
113
+ | **team-verify** | `verifier` (sonnet) | `test-engineer` (sonnet), `security-reviewer` (sonnet), `code-reviewer` (opus) | Always run `verifier`. Add `security-reviewer` for auth/crypto changes. Add `code-reviewer` for >20 files or architectural changes. `code-reviewer` also covers style/formatting checks. |
114
+ | **team-fix** | `executor` (sonnet) | `debugger` (sonnet), `executor` (opus) | Use `debugger` for type/build errors and regression isolation. Use `executor` (model=opus) for complex multi-file fixes. |
110
115
 
111
116
  **Routing rules:**
112
117
 
@@ -142,6 +147,7 @@ Each pipeline stage uses **specialized agents** -- not just executors. The lead
142
147
  ### Verify/Fix Loop and Stop Conditions
143
148
 
144
149
  Continue `team-exec -> team-verify -> team-fix` until:
150
+
145
151
  1. verification passes and no required fix tasks remain, or
146
152
  2. work reaches an explicit terminal blocked/failed outcome with evidence.
147
153
 
@@ -159,6 +165,7 @@ The lead writes handoffs to `.omc/handoffs/<stage-name>.md`.
159
165
 
160
166
  ```markdown
161
167
  ## Handoff: <current-stage> → <next-stage>
168
+
162
169
  - **Decided**: [key decisions made in this stage]
163
170
  - **Rejected**: [alternatives considered and why they were rejected]
164
171
  - **Risks**: [identified risks for the next stage]
@@ -177,6 +184,7 @@ The lead writes handoffs to `.omc/handoffs/<stage-name>.md`.
177
184
 
178
185
  ```markdown
179
186
  ## Handoff: team-plan → team-exec
187
+
180
188
  - **Decided**: Microservice architecture with 3 services (auth, api, worker). PostgreSQL for persistence. JWT for auth tokens.
181
189
  - **Rejected**: Monolith (scaling concerns), MongoDB (team expertise is SQL), session cookies (API-first design).
182
190
  - **Risks**: Worker service needs Redis for job queue — not yet provisioned. Auth service has no rate limiting in initial design.
@@ -190,6 +198,17 @@ The lead writes handoffs to `.omc/handoffs/<stage-name>.md`.
190
198
  - **Cancel:** `/oh-my-claudecode:cancel` requests teammate shutdown, waits for responses (best effort), marks phase `cancelled` with `active=false`, captures cancellation metadata, then deletes team resources and clears/preserves Team state per policy. Handoff files in `.omc/handoffs/` are preserved for potential resume.
191
199
  - Terminal states are `complete`, `failed`, and `cancelled`.
192
200
 
201
+ ## Windows psmux tmux-compatible gate
202
+
203
+ On native Windows, do **not** tell users that `/team` requires WSL or that tmux is unavailable until the actual tmux-compatible binary has been checked. Native [psmux](https://github.com/psmux/psmux) installs a `tmux`-compatible command (often `tmux` / `tmux.cmd`) and is a supported Team multiplexer.
204
+
205
+ Before blocking or falling back on Windows:
206
+
207
+ 1. Check `tmux -V` (or the platform equivalent such as `where tmux` followed by `tmux -V`).
208
+ 2. Treat a successful psmux-backed `tmux -V` as tmux available.
209
+ 3. If psmux/tmux is available, continue the normal Team flow; do not emit WSL-required guidance.
210
+ 4. Only when no tmux-compatible binary is available, tell the user to install psmux for native Windows support or use WSL2 as an alternative.
211
+
193
212
  ## Workflow
194
213
 
195
214
  ### Phase 1: Parse Input
@@ -219,6 +238,7 @@ Call `TeamCreate` with a slug derived from the task:
219
238
  ```
220
239
 
221
240
  **Response:**
241
+
222
242
  ```json
223
243
  {
224
244
  "team_name": "fix-ts-errors",
@@ -248,18 +268,18 @@ state_write(mode="team", active=true, current_phase="team-plan", state={
248
268
 
249
269
  **State schema fields:**
250
270
 
251
- | Field | Type | Description |
252
- |-------|------|-------------|
253
- | `active` | boolean | Whether team mode is active |
254
- | `current_phase` | string | Current pipeline stage: `team-plan`, `team-prd`, `team-exec`, `team-verify`, `team-fix` |
255
- | `team_name` | string | Slug name for the team |
256
- | `agent_count` | number | Number of worker agents |
257
- | `agent_types` | string | Comma-separated agent types used in team-exec |
258
- | `task` | string | Original task description |
259
- | `fix_loop_count` | number | Current fix iteration count |
260
- | `max_fix_loops` | number | Maximum fix iterations before failing (default: 3) |
261
- | `linked_ralph` | boolean | Whether team is linked to a ralph persistence loop |
262
- | `stage_history` | string | Comma-separated list of stage transitions with timestamps |
271
+ | Field | Type | Description |
272
+ | ---------------- | ------- | --------------------------------------------------------------------------------------- |
273
+ | `active` | boolean | Whether team mode is active |
274
+ | `current_phase` | string | Current pipeline stage: `team-plan`, `team-prd`, `team-exec`, `team-verify`, `team-fix` |
275
+ | `team_name` | string | Slug name for the team |
276
+ | `agent_count` | number | Number of worker agents |
277
+ | `agent_types` | string | Comma-separated agent types used in team-exec |
278
+ | `task` | string | Original task description |
279
+ | `fix_loop_count` | number | Current fix iteration count |
280
+ | `max_fix_loops` | number | Maximum fix iterations before failing (default: 3) |
281
+ | `linked_ralph` | boolean | Whether team is linked to a ralph persistence loop |
282
+ | `stage_history` | string | Comma-separated list of stage transitions with timestamps |
263
283
 
264
284
  **Update state on every stage transition:**
265
285
 
@@ -291,6 +311,7 @@ Call `TaskCreate` for each subtask. Set dependencies with `TaskUpdate` using `ad
291
311
  ```
292
312
 
293
313
  **Response stores a task file (e.g. `1.json`):**
314
+
294
315
  ```json
295
316
  {
296
317
  "id": "1",
@@ -338,6 +359,7 @@ Spawn N teammates using `Task` with `team_name` and `name` parameters. Each team
338
359
  ```
339
360
 
340
361
  **Response:**
362
+
341
363
  ```json
342
364
  {
343
365
  "agent_id": "worker-1@fix-ts-errors",
@@ -347,6 +369,7 @@ Spawn N teammates using `Task` with `team_name` and `name` parameters. Each team
347
369
  ```
348
370
 
349
371
  **Side effects:**
372
+
350
373
  - Teammate added to `config.json` members array
351
374
  - An **internal task** is auto-created (with `metadata._internal: true`) tracking the agent lifecycle
352
375
  - Internal tasks appear in `TaskList` output -- filter them when counting real tasks
@@ -401,6 +424,7 @@ state_write(mode="team", current_phase="team-fix", state={
401
424
  ```
402
425
 
403
426
  This enables:
427
+
404
428
  - **Resume**: If the lead crashes, `state_read(mode="team")` reveals the last stage and team name for recovery
405
429
  - **Cancel**: The cancel skill reads `current_phase` to know what cleanup is needed
406
430
  - **Ralph integration**: Ralph can read team state to know if the pipeline completed or failed
@@ -533,6 +557,7 @@ This addendum must preserve the core rule: **worker = executor only, never leade
533
557
  **CRITICAL: Steps must execute in exact order. Never call TeamDelete before shutdown is confirmed.**
534
558
 
535
559
  **Step 1: Verify completion**
560
+
536
561
  ```
537
562
  Call TaskList — verify all real tasks (non-internal) are completed or failed.
538
563
  ```
@@ -540,6 +565,7 @@ Call TaskList — verify all real tasks (non-internal) are completed or failed.
540
565
  **Step 2: Request shutdown from each teammate**
541
566
 
542
567
  **Lead sends:**
568
+
543
569
  ```json
544
570
  {
545
571
  "type": "shutdown_request",
@@ -549,11 +575,13 @@ Call TaskList — verify all real tasks (non-internal) are completed or failed.
549
575
  ```
550
576
 
551
577
  **Step 3: Wait for responses (BLOCKING)**
578
+
552
579
  - Wait up to 30s per teammate for `shutdown_response`
553
580
  - Track which teammates confirmed vs timed out
554
581
  - If a teammate doesn't respond within 30s: log warning, mark as unresponsive
555
582
 
556
583
  **Teammate receives and responds:**
584
+
557
585
  ```json
558
586
  {
559
587
  "type": "shutdown_response",
@@ -563,11 +591,13 @@ Call TaskList — verify all real tasks (non-internal) are completed or failed.
563
591
  ```
564
592
 
565
593
  After approval:
594
+
566
595
  - Teammate process terminates
567
596
  - Teammate auto-removed from `config.json` members array
568
597
  - Internal task for that teammate completes
569
598
 
570
599
  **Step 4: TeamDelete — only after ALL teammates confirmed or timed out**
600
+
571
601
  ```json
572
602
  { "team_name": "fix-ts-errors" }
573
603
  ```
@@ -575,6 +605,7 @@ After approval:
575
605
  **Step 5: Orphan scan**
576
606
 
577
607
  Check for agent processes that survived TeamDelete:
608
+
578
609
  ```bash
579
610
  node "${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-orphans.mjs" --team-name fix-ts-errors
580
611
  ```
@@ -582,6 +613,7 @@ node "${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-orphans.mjs" --team-name fix-ts-erro
582
613
  This scans for processes matching the team name whose config no longer exists, and terminates them (SIGTERM → 5s wait → SIGKILL). Supports `--dry-run` for inspection.
583
614
 
584
615
  **Shutdown sequence is BLOCKING:** Do not proceed to TeamDelete until all teammates have either:
616
+
585
617
  - Confirmed shutdown (`shutdown_response` with `approve: true`), OR
586
618
  - Timed out (30s with no response)
587
619
 
@@ -595,11 +627,11 @@ The team skill supports **hybrid execution** combining Claude agent teammates wi
595
627
 
596
628
  Tasks are tagged with an execution mode during decomposition:
597
629
 
598
- | Execution Mode | Provider | Capabilities |
599
- |---------------|----------|-------------|
600
- | `claude_worker` | Claude agent | Full Claude Code tool access (Read/Write/Edit/Bash/Task). Best for tasks needing Claude's reasoning + iterative tool use. |
601
- | `codex_worker` | Codex CLI (tmux pane) | Full filesystem access in working_directory. Runs autonomously via tmux pane. Best for code review, security analysis, refactoring, architecture. Requires `npm install -g @openai/codex`. |
602
- | `gemini_worker` | Gemini CLI (tmux pane) | Full filesystem access in working_directory. Runs autonomously via tmux pane. Best for UI/design work, documentation, large-context tasks. Requires `npm install -g @google/gemini-cli`. |
630
+ | Execution Mode | Provider | Capabilities |
631
+ | --------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
632
+ | `claude_worker` | Claude agent | Full Claude Code tool access (Read/Write/Edit/Bash/Task). Best for tasks needing Claude's reasoning + iterative tool use. |
633
+ | `codex_worker` | Codex CLI (tmux pane) | Full filesystem access in working_directory. Runs autonomously via tmux pane. Best for code review, security analysis, refactoring, architecture. Requires `npm install -g @openai/codex`. |
634
+ | `gemini_worker` | Gemini CLI (tmux pane) | Full filesystem access in working_directory. Runs autonomously via tmux pane. Best for UI/design work, documentation, large-context tasks. Requires `npm install -g @google/gemini-cli`. |
603
635
 
604
636
  ### How CLI Workers Operate
605
637
 
@@ -612,6 +644,7 @@ Tmux CLI workers run in dedicated tmux panes with filesystem access. They are **
612
644
  5. Lead reads the output, marks the task complete, and feeds results to dependent tasks
613
645
 
614
646
  **Key difference from Claude teammates:**
647
+
615
648
  - CLI workers operate via tmux, not Claude Code's tool system
616
649
  - They cannot use TaskList/TaskUpdate/SendMessage (no team awareness)
617
650
  - They run as one-shot autonomous jobs, not persistent teammates
@@ -619,16 +652,16 @@ Tmux CLI workers run in dedicated tmux panes with filesystem access. They are **
619
652
 
620
653
  ### When to Route Where
621
654
 
622
- | Task Type | Best Route | Why |
623
- |-----------|-----------|-----|
624
- | Iterative multi-step work | Claude teammate | Needs tool-mediated iteration + team communication |
625
- | Code review / security audit | CLI worker or specialist agent | Autonomous execution, good at structured analysis |
626
- | Architecture analysis / planning | architect Claude agent | Strong analytical reasoning with codebase access |
627
- | Refactoring (well-scoped) | CLI worker or executor agent | Autonomous execution, good at structured transforms |
628
- | UI/frontend implementation | designer Claude agent | Design expertise, framework idioms |
629
- | Large-scale documentation | writer Claude agent | Writing expertise + large context for consistency |
630
- | Build/test iteration loops | Claude teammate | Needs Bash tool + iterative fix cycles |
631
- | Tasks needing team coordination | Claude teammate | Needs SendMessage for status updates |
655
+ | Task Type | Best Route | Why |
656
+ | -------------------------------- | ------------------------------ | --------------------------------------------------- |
657
+ | Iterative multi-step work | Claude teammate | Needs tool-mediated iteration + team communication |
658
+ | Code review / security audit | CLI worker or specialist agent | Autonomous execution, good at structured analysis |
659
+ | Architecture analysis / planning | architect Claude agent | Strong analytical reasoning with codebase access |
660
+ | Refactoring (well-scoped) | CLI worker or executor agent | Autonomous execution, good at structured transforms |
661
+ | UI/frontend implementation | designer Claude agent | Design expertise, framework idioms |
662
+ | Large-scale documentation | writer Claude agent | Writing expertise + large context for consistency |
663
+ | Build/test iteration loops | Claude teammate | Needs Bash tool + iterative fix cycles |
664
+ | Tasks needing team coordination | Claude teammate | Needs SendMessage for status updates |
632
665
 
633
666
  ### Example: Hybrid Team with CLI Workers
634
667
 
@@ -680,18 +713,18 @@ The `getTeamStatus(teamName, workingDirectory, heartbeatMaxAgeMs?)` function pro
680
713
  Example usage in the monitor loop:
681
714
 
682
715
  ```typescript
683
- const status = getTeamStatus('fix-ts-errors', workingDirectory);
716
+ const status = getTeamStatus("fix-ts-errors", workingDirectory);
684
717
 
685
718
  for (const worker of status.workers) {
686
719
  if (!worker.isAlive) {
687
720
  // Worker is dead -- reassign its in-progress tasks
688
721
  }
689
722
  for (const msg of worker.recentMessages) {
690
- if (msg.type === 'task_complete') {
723
+ if (msg.type === "task_complete") {
691
724
  // Mark task complete, unblock dependents
692
- } else if (msg.type === 'task_failed') {
725
+ } else if (msg.type === "task_failed") {
693
726
  // Handle failure, possibly retry or reassign
694
- } else if (msg.type === 'error') {
727
+ } else if (msg.type === "error") {
695
728
  // Log error, check if worker needs intervention
696
729
  }
697
730
  }
@@ -704,14 +737,14 @@ if (status.taskSummary.pending === 0 && status.taskSummary.inProgress === 0) {
704
737
 
705
738
  ### Event-Based Actions from Outbox Messages
706
739
 
707
- | Message Type | Action |
708
- |-------------|--------|
709
- | `task_complete` | Mark task completed, check if blocked tasks are now unblocked, notify dependent workers |
710
- | `task_failed` | Increment failure sidecar, decide retry vs reassign vs skip |
711
- | `idle` | Worker has no assigned tasks -- assign pending work or begin shutdown |
712
- | `error` | Log the error, check `consecutiveErrors` in heartbeat for quarantine threshold |
713
- | `shutdown_ack` | Worker acknowledged shutdown -- safe to remove from team |
714
- | `heartbeat` | Update liveness tracking (redundant with heartbeat files but useful for latency monitoring) |
740
+ | Message Type | Action |
741
+ | --------------- | ------------------------------------------------------------------------------------------- |
742
+ | `task_complete` | Mark task completed, check if blocked tasks are now unblocked, notify dependent workers |
743
+ | `task_failed` | Increment failure sidecar, decide retry vs reassign vs skip |
744
+ | `idle` | Worker has no assigned tasks -- assign pending work or begin shutdown |
745
+ | `error` | Log the error, check `consecutiveErrors` in heartbeat for quarantine threshold |
746
+ | `shutdown_ack` | Worker acknowledged shutdown -- safe to remove from team |
747
+ | `heartbeat` | Update liveness tracking (redundant with heartbeat files but useful for latency monitoring) |
715
748
 
716
749
  This approach complements the existing `SendMessage`-based communication by providing a pull-based mechanism for MCP workers that cannot use Claude Code's team messaging tools.
717
750
 
@@ -755,6 +788,7 @@ When the user invokes `/team ralph`, says "team ralph", or combines both keyword
755
788
  ### Activation
756
789
 
757
790
  Team+Ralph activates when:
791
+
758
792
  1. User invokes `/team ralph "task"` or `/oh-my-claudecode:team ralph "task"`
759
793
  2. Keyword detector finds both `team` and `ralph` in the prompt
760
794
  3. Hook detects `MAGIC KEYWORD: RALPH` alongside team context
@@ -791,6 +825,7 @@ state_write(mode="ralph", active=true, iteration=1, max_iterations=10, current_p
791
825
  ### Cancellation
792
826
 
793
827
  Cancel either mode cancels both:
828
+
794
829
  - **Cancel Ralph (linked):** Cancel Team first (graceful shutdown), then clear Ralph state
795
830
  - **Cancel Team (linked):** Clear Team, mark Ralph iteration cancelled, stop loop
796
831
 
@@ -810,21 +845,21 @@ This prevents duplicate teams and allows graceful recovery from lead failures.
810
845
 
811
846
  ## Comparison: Team vs Legacy Swarm
812
847
 
813
- | Aspect | Team (Native) | Swarm (Legacy SQLite) |
814
- |--------|--------------|----------------------|
815
- | **Storage** | JSON files in `~/.claude/teams/` and `~/.claude/tasks/` | SQLite in `.omc/state/swarm.db` |
816
- | **Dependencies** | `better-sqlite3` not needed | Requires `better-sqlite3` npm package |
817
- | **Task claiming** | `TaskUpdate(owner + in_progress)` -- lead pre-assigns | SQLite IMMEDIATE transaction -- atomic |
818
- | **Race conditions** | Possible if two agents claim same task (mitigate by pre-assigning) | None (SQLite transactions) |
819
- | **Communication** | `SendMessage` (DM, broadcast, shutdown) | None (fire-and-forget agents) |
820
- | **Task dependencies** | Built-in `blocks` / `blockedBy` arrays | Not supported |
821
- | **Heartbeat** | Automatic idle notifications from Claude Code | Manual heartbeat table + polling |
822
- | **Shutdown** | Graceful request/response protocol | Signal-based termination |
823
- | **Agent lifecycle** | Auto-tracked via internal tasks + config members | Manual tracking via heartbeat table |
824
- | **Progress visibility** | `TaskList` shows live status with owner | SQL queries on tasks table |
825
- | **Conflict prevention** | Owner field (lead-assigned) | Lease-based claiming with timeout |
826
- | **Crash recovery** | Lead detects via missing messages, reassigns | Auto-release after 5-min lease timeout |
827
- | **State cleanup** | `TeamDelete` removes everything | Manual `rm` of SQLite database |
848
+ | Aspect | Team (Native) | Swarm (Legacy SQLite) |
849
+ | ----------------------- | ------------------------------------------------------------------ | -------------------------------------- |
850
+ | **Storage** | JSON files in `~/.claude/teams/` and `~/.claude/tasks/` | SQLite in `.omc/state/swarm.db` |
851
+ | **Dependencies** | `better-sqlite3` not needed | Requires `better-sqlite3` npm package |
852
+ | **Task claiming** | `TaskUpdate(owner + in_progress)` -- lead pre-assigns | SQLite IMMEDIATE transaction -- atomic |
853
+ | **Race conditions** | Possible if two agents claim same task (mitigate by pre-assigning) | None (SQLite transactions) |
854
+ | **Communication** | `SendMessage` (DM, broadcast, shutdown) | None (fire-and-forget agents) |
855
+ | **Task dependencies** | Built-in `blocks` / `blockedBy` arrays | Not supported |
856
+ | **Heartbeat** | Automatic idle notifications from Claude Code | Manual heartbeat table + polling |
857
+ | **Shutdown** | Graceful request/response protocol | Signal-based termination |
858
+ | **Agent lifecycle** | Auto-tracked via internal tasks + config members | Manual tracking via heartbeat table |
859
+ | **Progress visibility** | `TaskList` shows live status with owner | SQL queries on tasks table |
860
+ | **Conflict prevention** | Owner field (lead-assigned) | Lease-based claiming with timeout |
861
+ | **Crash recovery** | Lead detects via missing messages, reassigns | Auto-release after 5-min lease timeout |
862
+ | **State cleanup** | `TeamDelete` removes everything | Manual `rm` of SQLite database |
828
863
 
829
864
  **When to use Team over Swarm:** Always prefer `/team` for new work. It uses Claude Code's built-in infrastructure, requires no external dependencies, supports inter-agent communication, and has task dependency management.
830
865
 
@@ -881,9 +916,9 @@ Optional settings live in `.claude/omc.jsonc` (project) or `~/.config/claude-omc
881
916
  "maxAgents": 20,
882
917
  "defaultAgentType": "claude",
883
918
  "monitorIntervalMs": 30000,
884
- "shutdownTimeoutMs": 15000
885
- }
886
- }
919
+ "shutdownTimeoutMs": 15000,
920
+ },
921
+ },
887
922
  }
888
923
  ```
889
924
 
@@ -907,27 +942,27 @@ Declare which provider (`claude`, `codex`, `gemini`) and which model tier should
907
942
  {
908
943
  "team": {
909
944
  "roleRouting": {
910
- "orchestrator": { "model": "inherit" },
911
- "planner": { "provider": "claude", "model": "HIGH" },
912
- "analyst": { "provider": "claude", "model": "HIGH" },
913
- "executor": { "provider": "claude", "model": "MEDIUM" },
914
- "critic": { "provider": "codex" },
945
+ "orchestrator": { "model": "inherit" },
946
+ "planner": { "provider": "claude", "model": "HIGH" },
947
+ "analyst": { "provider": "claude", "model": "HIGH" },
948
+ "executor": { "provider": "claude", "model": "MEDIUM" },
949
+ "critic": { "provider": "codex" },
915
950
  "code-reviewer": { "provider": "gemini" },
916
- "test-engineer": { "provider": "gemini", "model": "MEDIUM" }
917
- }
918
- }
951
+ "test-engineer": { "provider": "gemini", "model": "MEDIUM" },
952
+ },
953
+ },
919
954
  }
920
955
  ```
921
956
 
922
- | Role | Provider | Model |
923
- |---|---|---|
924
- | `orchestrator` | claude (pinned) | inherits invoking session |
925
- | `planner` | claude | `HIGH` (opus) |
926
- | `analyst` | claude | `HIGH` (opus) |
927
- | `executor` | claude | `MEDIUM` (sonnet) |
928
- | `critic` | codex | codex default |
929
- | `code-reviewer` | gemini | gemini default |
930
- | `test-engineer` | gemini | `MEDIUM` (sonnet) |
957
+ | Role | Provider | Model |
958
+ | --------------- | --------------- | ------------------------- |
959
+ | `orchestrator` | claude (pinned) | inherits invoking session |
960
+ | `planner` | claude | `HIGH` (opus) |
961
+ | `analyst` | claude | `HIGH` (opus) |
962
+ | `executor` | claude | `MEDIUM` (sonnet) |
963
+ | `critic` | codex | codex default |
964
+ | `code-reviewer` | gemini | gemini default |
965
+ | `test-engineer` | gemini | `MEDIUM` (sonnet) |
931
966
 
932
967
  ### Canonical roles
933
968
 
@@ -998,15 +1033,15 @@ MCP workers can operate in isolated git worktrees to prevent file conflicts betw
998
1033
 
999
1034
  ### API Reference
1000
1035
 
1001
- | Function | Description |
1002
- |----------|-------------|
1003
- | `createWorkerWorktree(teamName, workerName, repoRoot, baseBranch?)` | Create isolated worktree |
1004
- | `removeWorkerWorktree(teamName, workerName, repoRoot)` | Remove worktree and branch |
1005
- | `listTeamWorktrees(teamName, repoRoot)` | List all team worktrees |
1006
- | `cleanupTeamWorktrees(teamName, repoRoot)` | Remove all team worktrees |
1007
- | `checkMergeConflicts(workerBranch, baseBranch, repoRoot)` | Non-destructive conflict check |
1008
- | `mergeWorkerBranch(workerBranch, baseBranch, repoRoot)` | Merge worker branch (--no-ff) |
1009
- | `mergeAllWorkerBranches(teamName, repoRoot, baseBranch?)` | Merge all completed workers |
1036
+ | Function | Description |
1037
+ | ------------------------------------------------------------------- | ------------------------------ |
1038
+ | `createWorkerWorktree(teamName, workerName, repoRoot, baseBranch?)` | Create isolated worktree |
1039
+ | `removeWorkerWorktree(teamName, workerName, repoRoot)` | Remove worktree and branch |
1040
+ | `listTeamWorktrees(teamName, repoRoot)` | List all team worktrees |
1041
+ | `cleanupTeamWorktrees(teamName, repoRoot)` | Remove all team worktrees |
1042
+ | `checkMergeConflicts(workerBranch, baseBranch, repoRoot)` | Non-destructive conflict check |
1043
+ | `mergeWorkerBranch(workerBranch, baseBranch, repoRoot)` | Merge worker branch (--no-ff) |
1044
+ | `mergeAllWorkerBranches(teamName, repoRoot, baseBranch?)` | Merge all completed workers |
1010
1045
 
1011
1046
  ### Important Notes
1012
1047
 
@@ -1038,3 +1073,10 @@ MCP workers can operate in isolated git worktrees to prevent file conflicts betw
1038
1073
  10. **Broadcast is expensive** -- Each broadcast sends a separate message to every teammate. Use `message` (DM) by default. Only broadcast for truly team-wide critical alerts.
1039
1074
 
1040
1075
  11. **CLI workers are one-shot, not persistent** -- Tmux CLI workers have full filesystem access and CAN make code changes. However, they run as autonomous one-shot jobs -- they cannot use TaskList/TaskUpdate/SendMessage. The lead must manage their lifecycle: write prompt_file, spawn CLI worker, read output_file, mark task complete. They don't participate in team communication like Claude teammates do.
1076
+
1077
+ ## Parallel session caveats
1078
+
1079
+ - **Multi-repo workspace anchor:** drop a `.omc-workspace` marker at the parent directory so multiple sessions across sub-repos share one `.omc/`. Resolution order: `OMC_STATE_DIR > .omc-workspace > git > cwd`. See `docs/REFERENCE.md`.
1080
+ - **Session id source:** OMC_SESSION_ID env var wins in CLI contexts; hook payload data.session_id wins in hook contexts.
1081
+ - **Plan id (when applicable):** Team state is session-scoped. Team handoffs at `.omc/handoffs/` are shared by design (see Wave G in the workspace plan).
1082
+ - **Parallel verdict:** supported (session-scoped + shared handoffs by design)