oh-my-claude-sisyphus 3.8.16 → 3.9.1

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 (178) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.mcp.json +1 -1
  4. package/agents/analyst.md +41 -0
  5. package/agents/architect.md +47 -2
  6. package/agents/critic.md +42 -0
  7. package/agents/deep-executor.md +193 -0
  8. package/agents/planner.md +82 -0
  9. package/bridge/mcp-server.cjs +181 -181
  10. package/commands/build-fix.md +3 -3
  11. package/commands/ralph.md +3 -3
  12. package/commands/ultraqa.md +4 -4
  13. package/commands/ultrawork.md +3 -3
  14. package/dist/__tests__/agent-registry.test.js +1 -1
  15. package/dist/__tests__/installer.test.js +8 -8
  16. package/dist/__tests__/installer.test.js.map +1 -1
  17. package/dist/__tests__/omc-tools-server.test.js +2 -2
  18. package/dist/__tests__/omc-tools-server.test.js.map +1 -1
  19. package/dist/__tests__/skills.test.js +5 -4
  20. package/dist/__tests__/skills.test.js.map +1 -1
  21. package/dist/agents/deep-executor.d.ts +15 -0
  22. package/dist/agents/deep-executor.d.ts.map +1 -0
  23. package/dist/agents/deep-executor.js +47 -0
  24. package/dist/agents/deep-executor.js.map +1 -0
  25. package/dist/agents/definitions.d.ts +16 -1
  26. package/dist/agents/definitions.d.ts.map +1 -1
  27. package/dist/agents/definitions.js +26 -1
  28. package/dist/agents/definitions.js.map +1 -1
  29. package/dist/agents/index.d.ts +1 -0
  30. package/dist/agents/index.d.ts.map +1 -1
  31. package/dist/agents/index.js +1 -0
  32. package/dist/agents/index.js.map +1 -1
  33. package/dist/cli/commands/doctor-conflicts.d.ts +55 -0
  34. package/dist/cli/commands/doctor-conflicts.d.ts.map +1 -0
  35. package/dist/cli/commands/doctor-conflicts.js +261 -0
  36. package/dist/cli/commands/doctor-conflicts.js.map +1 -0
  37. package/dist/cli/index.js +16 -1
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/features/auto-update.d.ts +12 -0
  40. package/dist/features/auto-update.d.ts.map +1 -1
  41. package/dist/features/auto-update.js +4 -1
  42. package/dist/features/auto-update.js.map +1 -1
  43. package/dist/features/background-tasks.js +4 -4
  44. package/dist/features/context-injector/types.d.ts +1 -1
  45. package/dist/features/context-injector/types.d.ts.map +1 -1
  46. package/dist/features/task-decomposer/index.js +3 -3
  47. package/dist/features/task-decomposer/index.js.map +1 -1
  48. package/dist/features/verification/index.d.ts +3 -3
  49. package/dist/features/verification/index.js +3 -3
  50. package/dist/features/verification/index.js.map +1 -1
  51. package/dist/hooks/__tests__/bridge.test.d.ts +2 -0
  52. package/dist/hooks/__tests__/bridge.test.d.ts.map +1 -0
  53. package/dist/hooks/__tests__/bridge.test.js +199 -0
  54. package/dist/hooks/__tests__/bridge.test.js.map +1 -0
  55. package/dist/hooks/autopilot/state.js +3 -3
  56. package/dist/hooks/beads-context/__tests__/index.test.d.ts +2 -0
  57. package/dist/hooks/beads-context/__tests__/index.test.d.ts.map +1 -0
  58. package/dist/hooks/beads-context/__tests__/index.test.js +150 -0
  59. package/dist/hooks/beads-context/__tests__/index.test.js.map +1 -0
  60. package/dist/hooks/beads-context/constants.d.ts +3 -0
  61. package/dist/hooks/beads-context/constants.d.ts.map +1 -0
  62. package/dist/hooks/beads-context/constants.js +35 -0
  63. package/dist/hooks/beads-context/constants.js.map +1 -0
  64. package/dist/hooks/beads-context/index.d.ts +21 -0
  65. package/dist/hooks/beads-context/index.d.ts.map +1 -0
  66. package/dist/hooks/beads-context/index.js +62 -0
  67. package/dist/hooks/beads-context/index.js.map +1 -0
  68. package/dist/hooks/beads-context/types.d.ts +7 -0
  69. package/dist/hooks/beads-context/types.d.ts.map +1 -0
  70. package/dist/hooks/beads-context/types.js +2 -0
  71. package/dist/hooks/beads-context/types.js.map +1 -0
  72. package/dist/hooks/bridge.d.ts +4 -0
  73. package/dist/hooks/bridge.d.ts.map +1 -1
  74. package/dist/hooks/bridge.js +76 -23
  75. package/dist/hooks/bridge.js.map +1 -1
  76. package/dist/hooks/clear-suggestions/constants.d.ts +54 -0
  77. package/dist/hooks/clear-suggestions/constants.d.ts.map +1 -0
  78. package/dist/hooks/clear-suggestions/constants.js +102 -0
  79. package/dist/hooks/clear-suggestions/constants.js.map +1 -0
  80. package/dist/hooks/clear-suggestions/index.d.ts +61 -0
  81. package/dist/hooks/clear-suggestions/index.d.ts.map +1 -0
  82. package/dist/hooks/clear-suggestions/index.js +282 -0
  83. package/dist/hooks/clear-suggestions/index.js.map +1 -0
  84. package/dist/hooks/clear-suggestions/triggers.d.ts +65 -0
  85. package/dist/hooks/clear-suggestions/triggers.d.ts.map +1 -0
  86. package/dist/hooks/clear-suggestions/triggers.js +222 -0
  87. package/dist/hooks/clear-suggestions/triggers.js.map +1 -0
  88. package/dist/hooks/clear-suggestions/types.d.ts +92 -0
  89. package/dist/hooks/clear-suggestions/types.d.ts.map +1 -0
  90. package/dist/hooks/clear-suggestions/types.js +9 -0
  91. package/dist/hooks/clear-suggestions/types.js.map +1 -0
  92. package/dist/hooks/index.d.ts +1 -0
  93. package/dist/hooks/index.d.ts.map +1 -1
  94. package/dist/hooks/index.js +3 -0
  95. package/dist/hooks/index.js.map +1 -1
  96. package/dist/hooks/permission-handler/index.d.ts.map +1 -1
  97. package/dist/hooks/permission-handler/index.js +3 -1
  98. package/dist/hooks/permission-handler/index.js.map +1 -1
  99. package/dist/hooks/setup/index.d.ts.map +1 -1
  100. package/dist/hooks/setup/index.js +12 -5
  101. package/dist/hooks/setup/index.js.map +1 -1
  102. package/dist/hooks/subagent-tracker/index.d.ts.map +1 -1
  103. package/dist/hooks/subagent-tracker/index.js +25 -9
  104. package/dist/hooks/subagent-tracker/index.js.map +1 -1
  105. package/dist/hooks/ultraqa/index.js +4 -4
  106. package/dist/hooks/ultraqa/index.js.map +1 -1
  107. package/dist/index.js +1 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/installer/__tests__/claude-md-merge.test.d.ts +6 -0
  110. package/dist/installer/__tests__/claude-md-merge.test.d.ts.map +1 -0
  111. package/dist/installer/__tests__/claude-md-merge.test.js +220 -0
  112. package/dist/installer/__tests__/claude-md-merge.test.js.map +1 -0
  113. package/dist/installer/__tests__/safe-installer.test.d.ts +6 -0
  114. package/dist/installer/__tests__/safe-installer.test.d.ts.map +1 -0
  115. package/dist/installer/__tests__/safe-installer.test.js +172 -0
  116. package/dist/installer/__tests__/safe-installer.test.js.map +1 -0
  117. package/dist/installer/hooks.d.ts.map +1 -1
  118. package/dist/installer/hooks.js +3 -1
  119. package/dist/installer/hooks.js.map +1 -1
  120. package/dist/installer/index.d.ts +27 -1
  121. package/dist/installer/index.d.ts.map +1 -1
  122. package/dist/installer/index.js +209 -85
  123. package/dist/installer/index.js.map +1 -1
  124. package/dist/mcp/omc-tools-server.d.ts +1 -1
  125. package/dist/mcp/omc-tools-server.d.ts.map +1 -1
  126. package/dist/mcp/omc-tools-server.js +3 -3
  127. package/dist/mcp/omc-tools-server.js.map +1 -1
  128. package/dist/mcp/standalone-server.js +1 -1
  129. package/dist/mcp/standalone-server.js.map +1 -1
  130. package/dist/verification/tier-selector.d.ts +40 -0
  131. package/dist/verification/tier-selector.d.ts.map +1 -0
  132. package/dist/verification/tier-selector.js +95 -0
  133. package/dist/verification/tier-selector.js.map +1 -0
  134. package/dist/verification/tier-selector.test.d.ts +2 -0
  135. package/dist/verification/tier-selector.test.d.ts.map +1 -0
  136. package/dist/verification/tier-selector.test.js +282 -0
  137. package/dist/verification/tier-selector.test.js.map +1 -0
  138. package/docs/AGENTS.md +1 -1
  139. package/docs/CLAUDE.md +90 -378
  140. package/docs/partials/agent-tiers.md +165 -0
  141. package/docs/partials/features.md +131 -0
  142. package/docs/partials/mode-hierarchy.md +120 -0
  143. package/docs/partials/mode-selection-guide.md +82 -0
  144. package/docs/partials/verification-tiers.md +107 -0
  145. package/docs/shared/agent-tiers.md +165 -0
  146. package/docs/shared/features.md +131 -0
  147. package/docs/shared/mode-hierarchy.md +120 -0
  148. package/docs/shared/mode-selection-guide.md +82 -0
  149. package/docs/shared/verification-tiers.md +107 -0
  150. package/package.json +4 -3
  151. package/scripts/compose-docs.mjs +44 -0
  152. package/scripts/keyword-detector.mjs +13 -3
  153. package/skills/build-fix/SKILL.md +8 -8
  154. package/skills/deep-executor/SKILL.md +50 -0
  155. package/skills/deepinit/SKILL.md +2 -2
  156. package/skills/ecomode/SKILL.md +58 -103
  157. package/skills/omc-setup/SKILL.md +197 -20
  158. package/skills/plan/SKILL.md +62 -0
  159. package/skills/project-session-manager/SKILL.md +87 -4
  160. package/skills/project-session-manager/lib/config.sh +54 -5
  161. package/skills/project-session-manager/lib/parse.sh +65 -11
  162. package/skills/project-session-manager/lib/providers/github.sh +52 -0
  163. package/skills/project-session-manager/lib/providers/interface.sh +76 -0
  164. package/skills/project-session-manager/lib/providers/jira.sh +79 -0
  165. package/skills/project-session-manager/lib/session.sh +49 -12
  166. package/skills/project-session-manager/lib/worktree.sh +37 -4
  167. package/skills/project-session-manager/psm.sh +116 -51
  168. package/skills/ralph/SKILL.md +44 -30
  169. package/skills/tdd/SKILL.md +2 -2
  170. package/skills/ultrapilot/SKILL.md +3 -3
  171. package/skills/ultraqa/SKILL.md +4 -4
  172. package/skills/ultrawork/SKILL.md +59 -69
  173. package/templates/hooks/keyword-detector.mjs +21 -13
  174. package/templates/hooks/lib/stdin.mjs +62 -0
  175. package/templates/hooks/persistent-mode.mjs +7 -8
  176. package/templates/hooks/post-tool-use.mjs +8 -10
  177. package/templates/hooks/pre-tool-use.mjs +9 -6
  178. package/templates/hooks/session-start.mjs +7 -8
@@ -73,10 +73,20 @@ function extractPrompt(input) {
73
73
  }
74
74
  }
75
75
 
76
- // Remove code blocks to prevent false positives
77
- function removeCodeBlocks(text) {
76
+ // Sanitize text to prevent false positives from code blocks, XML tags, URLs, and file paths
77
+ function sanitizeForKeywordDetection(text) {
78
78
  return text
79
+ // 1. Strip XML-style tag blocks: <tag-name ...>...</tag-name> (multi-line, greedy on tag name)
80
+ .replace(/<(\w[\w-]*)[\s>][\s\S]*?<\/\1>/g, '')
81
+ // 2. Strip self-closing XML tags: <tag-name />, <tag-name attr="val" />
82
+ .replace(/<\w[\w-]*(?:\s[^>]*)?\s*\/>/g, '')
83
+ // 3. Strip URLs: http://... or https://... up to whitespace
84
+ .replace(/https?:\/\/[^\s)>\]]+/g, '')
85
+ // 4. Strip file paths: /foo/bar/baz or foo/bar/baz (using lookbehind to avoid consuming leading char)
86
+ .replace(/(?<=^|[\s"'`(])(?:\/)?(?:[\w.-]+\/)+[\w.-]+/gm, '')
87
+ // 5. Strip markdown code blocks (existing)
79
88
  .replace(/```[\s\S]*?```/g, '')
89
+ // 6. Strip inline code (existing)
80
90
  .replace(/`[^`]+`/g, '');
81
91
  }
82
92
 
@@ -225,7 +235,7 @@ async function main() {
225
235
  return;
226
236
  }
227
237
 
228
- const cleanPrompt = removeCodeBlocks(prompt).toLowerCase();
238
+ const cleanPrompt = sanitizeForKeywordDetection(prompt).toLowerCase();
229
239
 
230
240
  // Collect all matching keywords
231
241
  const matches = [];
@@ -5,14 +5,14 @@ description: Fix build and TypeScript errors with minimal changes
5
5
 
6
6
  # Build Fix Skill
7
7
 
8
- Fix build and TypeScript errors quickly with minimal code changes. Get the build green without refactoring.
8
+ Fix build and compilation errors quickly with minimal code changes. Get the build green without refactoring.
9
9
 
10
10
  ## When to Use
11
11
 
12
12
  This skill activates when:
13
13
  - User says "fix the build", "build is broken"
14
14
  - TypeScript compilation fails
15
- - `npm run build` or `tsc` reports errors
15
+ - the build command or type checker reports errors
16
16
  - User requests "minimal fixes" for errors
17
17
 
18
18
  ## What It Does
@@ -20,8 +20,8 @@ This skill activates when:
20
20
  Delegates to the `build-fixer` agent (Sonnet model) to:
21
21
 
22
22
  1. **Collect Errors**
23
- - Run `npx tsc --noEmit` to get all TypeScript errors
24
- - Or run `npm run build` to get build failures
23
+ - Run the project's type check command (e.g., `tsc --noEmit`, `mypy`, `cargo check`, `go vet`)
24
+ - Or run the project's build command to get build failures
25
25
  - Categorize errors by type and severity
26
26
 
27
27
  2. **Fix Strategically**
@@ -38,7 +38,7 @@ Delegates to the `build-fixer` agent (Sonnet model) to:
38
38
  - ONLY what's needed to make build pass
39
39
 
40
40
  4. **Verify**
41
- - Run `npx tsc --noEmit` after each fix
41
+ - Run the project's type check command after each fix
42
42
  - Ensure no new errors introduced
43
43
  - Stop when build passes
44
44
 
@@ -69,8 +69,8 @@ Output: Build error resolution report with:
69
69
  ## Stop Conditions
70
70
 
71
71
  The build-fixer agent stops when:
72
- - `npx tsc --noEmit` exits with code 0
73
- - `npm run build` completes successfully
72
+ - Type check command exits with code 0
73
+ - Build command completes successfully
74
74
  - No new errors introduced
75
75
 
76
76
  ## Output Format
@@ -90,7 +90,7 @@ Fixes Applied:
90
90
  ...
91
91
 
92
92
  Final Build Status: ✓ PASSING
93
- Verification: npx tsc --noEmit (exit code 0)
93
+ Verification: [type check command] (exit code 0)
94
94
  ```
95
95
 
96
96
  ## Best Practices
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: deep-executor
3
+ description: Deep executor mode for complex goal-oriented tasks
4
+ ---
5
+
6
+ # Deep Executor Skill
7
+
8
+ Activate autonomous deep work mode for complex tasks.
9
+
10
+ ## Overview
11
+
12
+ Deep Executor is the autonomous deep worker agent. When activated, it:
13
+
14
+ 1. **Explores First**: Uses its own tools (Glob, Grep, Read, ast_grep_search) to thoroughly understand the problem
15
+ 2. **Plans Strategically**: Creates execution plan based on exploration
16
+ 3. **Executes Directly**: Does all work itself using Edit, Write, Bash, ast_grep_replace
17
+ 4. **Verifies Everything**: Runs builds, tests, and diagnostics before claiming completion
18
+ 5. **Completes 100%**: Guarantees full completion with evidence
19
+
20
+ ## Usage
21
+
22
+ ```
23
+ /oh-my-claudecode:deep-executor <your complex task>
24
+ ```
25
+
26
+ Or use magic keywords:
27
+ - "deep-executor: ..."
28
+ - "deep work: ..."
29
+ - "forge: ..."
30
+
31
+ ## When to Use
32
+
33
+ | Situation | Use Deep Executor? |
34
+ |-----------|-----------------|
35
+ | Complex multi-file refactoring | YES |
36
+ | Unclear implementation path | YES |
37
+ | Need guaranteed completion | YES |
38
+ | Simple single-file fix | NO (use executor) |
39
+ | Quick code search | NO (use explore) |
40
+ | Cost-sensitive work | NO (use ecomode) |
41
+
42
+ ## Activation
43
+
44
+ This skill spawns the `deep-executor` agent via:
45
+
46
+ ```
47
+ Task(subagent_type="oh-my-claudecode:deep-executor", model="opus", prompt="{{PROMPT}}")
48
+ ```
49
+
50
+ The agent handles all exploration and execution internally. No sub-agents are spawned.
@@ -229,12 +229,12 @@ A web application for managing user tasks with real-time collaboration features.
229
229
  ## For AI Agents
230
230
 
231
231
  ### Working In This Directory
232
- - Always run `npm install` after modifying package.json
232
+ - Always install dependencies after modifying the project manifest
233
233
  - Use TypeScript strict mode
234
234
  - Follow ESLint rules
235
235
 
236
236
  ### Testing Requirements
237
- - Run `npm test` before committing
237
+ - Run tests before committing
238
238
  - Ensure >80% coverage
239
239
 
240
240
  ### Common Patterns
@@ -1,141 +1,96 @@
1
1
  ---
2
2
  name: ecomode
3
- description: Token-efficient parallel execution mode using Haiku and Sonnet agents
3
+ description: Token-efficient model routing modifier
4
4
  ---
5
5
 
6
6
  # Ecomode Skill
7
7
 
8
- Activates token-efficient parallel execution for pro-plan users who prioritize cost efficiency.
8
+ Token-efficient model routing. This is a **MODIFIER**, not a standalone execution mode.
9
9
 
10
- ## When Activated
10
+ ## What Ecomode Does
11
11
 
12
- This skill enhances Claude's capabilities by:
12
+ Overrides default model selection to prefer cheaper tiers:
13
13
 
14
- 1. **Parallel Execution**: Running multiple agents simultaneously for independent tasks
15
- 2. **Token-Conscious Routing**: Preferring Haiku and Sonnet agents, avoiding Opus
16
- 3. **Background Operations**: Using `run_in_background: true` for long operations
17
- 4. **Persistence Enforcement**: Never stopping until all tasks are verified complete
18
- 5. **Cost Optimization**: Minimizing token usage while maintaining quality
14
+ | Default Tier | Ecomode Override |
15
+ |--------------|------------------|
16
+ | HIGH (opus) | MEDIUM (sonnet), HIGH only if essential |
17
+ | MEDIUM (sonnet) | LOW (haiku) first, MEDIUM if fails |
18
+ | LOW (haiku) | LOW (haiku) - no change |
19
19
 
20
- ## Ecomode Routing Rules (CRITICAL)
20
+ ## What Ecomode Does NOT Do
21
21
 
22
- **ALWAYS prefer lower tiers. Only escalate when task genuinely requires it.**
23
-
24
- | Decision | Rule |
25
- |----------|------|
26
- | DEFAULT | Use LOW tier (Haiku) for all tasks |
27
- | UPGRADE | Use MEDIUM (Sonnet) only when task complexity warrants |
28
- | AVOID | HIGH tier (Opus) - only use for planning/critique if explicitly essential |
22
+ - **Persistence**: Use `ralph` for "don't stop until done"
23
+ - **Parallel Execution**: Use `ultrawork` for parallel agents
24
+ - **Delegation Enforcement**: Always active via core orchestration
29
25
 
30
- ## Smart Model Routing (PREFER LOW TIER)
26
+ ## Combining Ecomode with Other Modes
31
27
 
32
- **Choose tier based on task complexity: LOW (haiku) preferred → MEDIUM (sonnet) fallback → HIGH (opus) AVOID**
28
+ Ecomode is a modifier that combines with execution modes:
33
29
 
34
- ### Agent Routing Table
30
+ | Combination | Effect |
31
+ |-------------|--------|
32
+ | `eco ralph` | Ralph loop with cheaper agents |
33
+ | `eco ultrawork` | Parallel execution with cheaper agents |
34
+ | `eco autopilot` | Full autonomous with cost optimization |
35
35
 
36
- | Domain | PREFERRED (Haiku) | FALLBACK (Sonnet) | AVOID (Opus) |
37
- |--------|-------------------|-------------------|--------------|
38
- | **Analysis** | `architect-low` | `architect-medium` | ~~`architect`~~ |
39
- | **Execution** | `executor-low` | `executor` | ~~`executor-high`~~ |
40
- | **Search** | `explore` | `explore-medium` | ~~`explore-high`~~ |
41
- | **Research** | `researcher-low` | `researcher` | - |
42
- | **Frontend** | `designer-low` | `designer` | ~~`designer-high`~~ |
43
- | **Docs** | `writer` | - | - |
44
- | **Visual** | - | `vision` | - |
45
- | **Planning** | - | - | `planner` (if essential) |
46
- | **Critique** | - | - | `critic` (if essential) |
47
- | **Testing** | - | `qa-tester` | ~~`qa-tester-high`~~ |
48
- | **Security** | `security-reviewer-low` | - | ~~`security-reviewer`~~ |
49
- | **Build** | `build-fixer-low` | `build-fixer` | - |
50
- | **TDD** | `tdd-guide-low` | `tdd-guide` | - |
51
- | **Code Review** | `code-reviewer-low` | - | ~~`code-reviewer`~~ |
52
- | **Data Science** | `scientist-low` | `scientist` | ~~`scientist-high`~~ |
36
+ ## Ecomode Routing Rules
53
37
 
54
- ### Tier Selection Guide (Token-Conscious)
55
-
56
- | Task Complexity | Tier | Examples |
57
- |-----------------|------|----------|
58
- | Simple lookups | LOW | "What does this function return?", "Find where X is defined" |
59
- | Standard work | LOW first, MEDIUM if fails | "Add error handling", "Implement this feature" |
60
- | Complex analysis | MEDIUM | "Debug this issue", "Refactor this module" |
61
- | Planning only | HIGH (if essential) | "Design architecture for new system" |
38
+ **ALWAYS prefer lower tiers. Only escalate when task genuinely requires it.**
62
39
 
63
- ### Routing Examples
40
+ | Decision | Rule |
41
+ |----------|------|
42
+ | DEFAULT | Use LOW tier (Haiku) for all tasks |
43
+ | UPGRADE | Use MEDIUM (Sonnet) only when task complexity warrants |
44
+ | AVOID | HIGH tier (Opus) - only for planning/critique if essential |
64
45
 
65
- **CRITICAL: Always pass `model` parameter explicitly - Claude Code does NOT auto-apply models from agent definitions!**
46
+ ## Agent Selection in Ecomode
66
47
 
48
+ **FIRST ACTION:** Before delegating any work, read the agent reference file:
67
49
  ```
68
- // Simple question → LOW tier (DEFAULT)
69
- Task(subagent_type="oh-my-claudecode:architect-low", model="haiku", prompt="What does this function return?")
70
-
71
- // Standard implementation → TRY LOW first
72
- Task(subagent_type="oh-my-claudecode:executor-low", model="haiku", prompt="Add validation to login form")
73
-
74
- // If LOW fails, escalate to MEDIUM
75
- Task(subagent_type="oh-my-claudecode:executor", model="sonnet", prompt="Add error handling to login")
76
-
77
- // File lookup → ALWAYS LOW
78
- Task(subagent_type="oh-my-claudecode:explore", model="haiku", prompt="Find where UserService is defined")
79
-
80
- // Only use MEDIUM for complex patterns
81
- Task(subagent_type="oh-my-claudecode:explore-medium", model="sonnet", prompt="Find all authentication patterns in the codebase")
50
+ Read file: docs/shared/agent-tiers.md
82
51
  ```
52
+ This provides the complete agent tier matrix, MCP tool assignments, and selection guidance.
83
53
 
84
- ## DELEGATION ENFORCEMENT (CRITICAL)
85
-
86
- **YOU ARE AN ORCHESTRATOR, NOT AN IMPLEMENTER.**
87
-
88
- | Action | YOU Do | DELEGATE |
89
- |--------|--------|----------|
90
- | Read files for context | ✓ | |
91
- | Track progress (TODO) | ✓ | |
92
- | Spawn parallel agents | ✓ | |
93
- | **ANY code change** | ✗ NEVER | executor-low/executor |
94
- | **UI work** | ✗ NEVER | designer-low/designer |
95
- | **Docs** | ✗ NEVER | writer |
54
+ **Ecomode preference order:**
96
55
 
97
- **Path Exception**: Only write to `.omc/`, `.claude/`, `CLAUDE.md`, `AGENTS.md`
56
+ ```
57
+ // PREFERRED - Use for most tasks
58
+ Task(subagent_type="oh-my-claudecode:executor-low", model="haiku", prompt="...")
59
+ Task(subagent_type="oh-my-claudecode:explore", model="haiku", prompt="...")
60
+ Task(subagent_type="oh-my-claudecode:architect-low", model="haiku", prompt="...")
98
61
 
99
- ## Background Execution Rules
62
+ // FALLBACK - Only if LOW fails
63
+ Task(subagent_type="oh-my-claudecode:executor", model="sonnet", prompt="...")
64
+ Task(subagent_type="oh-my-claudecode:architect-medium", model="sonnet", prompt="...")
100
65
 
101
- **Run in Background** (set `run_in_background: true`):
102
- - Package installation: npm install, pip install, cargo build
103
- - Build processes: npm run build, make, tsc
104
- - Test suites: npm test, pytest, cargo test
105
- - Docker operations: docker build, docker pull
66
+ // AVOID - Only for planning/critique if essential
67
+ Task(subagent_type="oh-my-claudecode:planner", model="opus", prompt="...")
68
+ ```
106
69
 
107
- **Run Blocking** (foreground):
108
- - Quick status checks: git status, ls, pwd
109
- - File reads (NOT edits - delegate edits to executor-low)
110
- - Simple commands
70
+ ## Delegation Enforcement
111
71
 
112
- ## Verification Checklist
72
+ Ecomode maintains all delegation rules from core protocol with cost-optimized routing:
113
73
 
114
- Before stopping, verify:
115
- - [ ] TODO LIST: Zero pending/in_progress tasks
116
- - [ ] FUNCTIONALITY: All requested features work
117
- - [ ] TESTS: All tests pass (if applicable)
118
- - [ ] ERRORS: Zero unaddressed errors
74
+ | Action | Delegate To | Model |
75
+ |--------|-------------|-------|
76
+ | Code changes | executor-low / executor | haiku / sonnet |
77
+ | Analysis | architect-low | haiku |
78
+ | Search | explore | haiku |
79
+ | Documentation | writer | haiku |
119
80
 
120
- **If ANY checkbox is unchecked, CONTINUE WORKING.**
81
+ ### Background Execution
82
+ Long-running commands (install, build, test) run in background. Maximum 5 concurrent.
121
83
 
122
84
  ## Token Savings Tips
123
85
 
124
86
  1. **Batch similar tasks** to one agent instead of spawning many
125
87
  2. **Use explore (haiku)** for file discovery, not architect
126
88
  3. **Prefer executor-low** for simple changes - only upgrade if it fails
127
- 4. **Avoid opus agents** unless the task genuinely requires deep reasoning
128
- 5. **Use writer (haiku)** for all documentation tasks
129
-
130
- ## STATE CLEANUP ON COMPLETION
89
+ 4. **Use writer (haiku)** for all documentation tasks
90
+ 5. **Avoid opus agents** unless the task genuinely requires deep reasoning
131
91
 
132
- **IMPORTANT: Delete state files on completion - do NOT just set `active: false`**
92
+ ## State Management
133
93
 
134
- When ecomode completes (all verification passes):
135
-
136
- ```bash
137
- # Delete ecomode state files
138
- rm -f .omc/state/ecomode-state.json
139
- ```
94
+ Ecomode state is tracked in `.omc/state/ecomode-state.json`.
140
95
 
141
- This ensures clean state for future sessions. Stale state files with `active: false` should not be left behind.
96
+ When work is complete, run `/oh-my-claudecode:cancel` for clean state cleanup.
@@ -146,23 +146,81 @@ mkdir -p .claude && echo ".claude directory ready"
146
146
  ### Download Fresh CLAUDE.md
147
147
 
148
148
  ```bash
149
+ # Define target path
150
+ TARGET_PATH=".claude/CLAUDE.md"
151
+
149
152
  # Extract old version before download
150
- OLD_VERSION=$(grep -m1 "^# oh-my-claudecode" .claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "none")
153
+ OLD_VERSION=$(grep -m1 "^# oh-my-claudecode" "$TARGET_PATH" 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "none")
151
154
 
152
- # Backup existing CLAUDE.md before overwriting (if it exists)
153
- if [ -f ".claude/CLAUDE.md" ]; then
154
- BACKUP_DATE=$(date +%Y-%m-%d)
155
- BACKUP_PATH=".claude/CLAUDE.md.backup.${BACKUP_DATE}"
156
- cp .claude/CLAUDE.md "$BACKUP_PATH"
155
+ # Backup existing
156
+ if [ -f "$TARGET_PATH" ]; then
157
+ BACKUP_DATE=$(date +%Y-%m-%d_%H%M%S)
158
+ BACKUP_PATH="${TARGET_PATH}.backup.${BACKUP_DATE}"
159
+ cp "$TARGET_PATH" "$BACKUP_PATH"
157
160
  echo "Backed up existing CLAUDE.md to $BACKUP_PATH"
158
161
  fi
159
162
 
160
- # Download fresh CLAUDE.md from GitHub
161
- curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o .claude/CLAUDE.md && \
162
- echo "Downloaded CLAUDE.md to .claude/CLAUDE.md"
163
+ # Download fresh OMC content to temp file
164
+ TEMP_OMC=$(mktemp /tmp/omc-claude-XXXXXX.md)
165
+ trap 'rm -f "$TEMP_OMC"' EXIT
166
+ curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o "$TEMP_OMC"
167
+
168
+ if [ ! -s "$TEMP_OMC" ]; then
169
+ echo "ERROR: Failed to download CLAUDE.md. Aborting."
170
+ rm -f "$TEMP_OMC"
171
+ return 1
172
+ fi
173
+
174
+ # Strip existing markers from downloaded content (idempotency)
175
+ if grep -q '<!-- OMC:START -->' "$TEMP_OMC"; then
176
+ # Extract content between markers
177
+ sed -n '/<!-- OMC:START -->/,/<!-- OMC:END -->/{//!p}' "$TEMP_OMC" > "${TEMP_OMC}.clean"
178
+ mv "${TEMP_OMC}.clean" "$TEMP_OMC"
179
+ fi
180
+
181
+ if [ ! -f "$TARGET_PATH" ]; then
182
+ # Fresh install: wrap in markers
183
+ {
184
+ echo '<!-- OMC:START -->'
185
+ cat "$TEMP_OMC"
186
+ echo '<!-- OMC:END -->'
187
+ } > "$TARGET_PATH"
188
+ rm -f "$TEMP_OMC"
189
+ echo "Installed CLAUDE.md (fresh)"
190
+ else
191
+ # Merge: preserve user content outside OMC markers
192
+ if grep -q '<!-- OMC:START -->' "$TARGET_PATH"; then
193
+ # Has markers: replace OMC section, keep user content
194
+ BEFORE_OMC=$(sed -n '1,/<!-- OMC:START -->/{ /<!-- OMC:START -->/!p }' "$TARGET_PATH")
195
+ AFTER_OMC=$(sed -n '/<!-- OMC:END -->/,${ /<!-- OMC:END -->/!p }' "$TARGET_PATH")
196
+ {
197
+ [ -n "$BEFORE_OMC" ] && printf '%s\n' "$BEFORE_OMC"
198
+ echo '<!-- OMC:START -->'
199
+ cat "$TEMP_OMC"
200
+ echo '<!-- OMC:END -->'
201
+ [ -n "$AFTER_OMC" ] && printf '%s\n' "$AFTER_OMC"
202
+ } > "${TARGET_PATH}.tmp"
203
+ mv "${TARGET_PATH}.tmp" "$TARGET_PATH"
204
+ echo "Updated OMC section (user customizations preserved)"
205
+ else
206
+ # No markers: wrap new content in markers, append old content as user section
207
+ OLD_CONTENT=$(cat "$TARGET_PATH")
208
+ {
209
+ echo '<!-- OMC:START -->'
210
+ cat "$TEMP_OMC"
211
+ echo '<!-- OMC:END -->'
212
+ echo ""
213
+ echo "<!-- User customizations (migrated from previous CLAUDE.md) -->"
214
+ printf '%s\n' "$OLD_CONTENT"
215
+ } > "${TARGET_PATH}.tmp"
216
+ mv "${TARGET_PATH}.tmp" "$TARGET_PATH"
217
+ echo "Migrated existing CLAUDE.md (added OMC markers, preserved old content)"
218
+ fi
219
+ rm -f "$TEMP_OMC"
220
+ fi
163
221
 
164
222
  # Extract new version and report
165
- NEW_VERSION=$(grep -m1 "^# oh-my-claudecode" .claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
223
+ NEW_VERSION=$(grep -m1 "^# oh-my-claudecode" "$TARGET_PATH" 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
166
224
  if [ "$OLD_VERSION" = "none" ]; then
167
225
  echo "Installed CLAUDE.md: $NEW_VERSION"
168
226
  elif [ "$OLD_VERSION" = "$NEW_VERSION" ]; then
@@ -227,23 +285,81 @@ Do not continue to HUD setup or other steps.
227
285
  ### Download Fresh CLAUDE.md
228
286
 
229
287
  ```bash
288
+ # Define target path
289
+ TARGET_PATH="$HOME/.claude/CLAUDE.md"
290
+
230
291
  # Extract old version before download
231
- OLD_VERSION=$(grep -m1 "^# oh-my-claudecode" ~/.claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "none")
292
+ OLD_VERSION=$(grep -m1 "^# oh-my-claudecode" "$TARGET_PATH" 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "none")
232
293
 
233
- # Backup existing CLAUDE.md before overwriting (if it exists)
234
- if [ -f "$HOME/.claude/CLAUDE.md" ]; then
235
- BACKUP_DATE=$(date +%Y-%m-%d)
236
- BACKUP_PATH="$HOME/.claude/CLAUDE.md.backup.${BACKUP_DATE}"
237
- cp "$HOME/.claude/CLAUDE.md" "$BACKUP_PATH"
294
+ # Backup existing
295
+ if [ -f "$TARGET_PATH" ]; then
296
+ BACKUP_DATE=$(date +%Y-%m-%d_%H%M%S)
297
+ BACKUP_PATH="${TARGET_PATH}.backup.${BACKUP_DATE}"
298
+ cp "$TARGET_PATH" "$BACKUP_PATH"
238
299
  echo "Backed up existing CLAUDE.md to $BACKUP_PATH"
239
300
  fi
240
301
 
241
- # Download fresh CLAUDE.md to global config
242
- curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o ~/.claude/CLAUDE.md && \
243
- echo "Downloaded CLAUDE.md to ~/.claude/CLAUDE.md"
302
+ # Download fresh OMC content to temp file
303
+ TEMP_OMC=$(mktemp /tmp/omc-claude-XXXXXX.md)
304
+ trap 'rm -f "$TEMP_OMC"' EXIT
305
+ curl -fsSL "https://raw.githubusercontent.com/Yeachan-Heo/oh-my-claudecode/main/docs/CLAUDE.md" -o "$TEMP_OMC"
306
+
307
+ if [ ! -s "$TEMP_OMC" ]; then
308
+ echo "ERROR: Failed to download CLAUDE.md. Aborting."
309
+ rm -f "$TEMP_OMC"
310
+ return 1
311
+ fi
312
+
313
+ # Strip existing markers from downloaded content (idempotency)
314
+ if grep -q '<!-- OMC:START -->' "$TEMP_OMC"; then
315
+ # Extract content between markers
316
+ sed -n '/<!-- OMC:START -->/,/<!-- OMC:END -->/{//!p}' "$TEMP_OMC" > "${TEMP_OMC}.clean"
317
+ mv "${TEMP_OMC}.clean" "$TEMP_OMC"
318
+ fi
319
+
320
+ if [ ! -f "$TARGET_PATH" ]; then
321
+ # Fresh install: wrap in markers
322
+ {
323
+ echo '<!-- OMC:START -->'
324
+ cat "$TEMP_OMC"
325
+ echo '<!-- OMC:END -->'
326
+ } > "$TARGET_PATH"
327
+ rm -f "$TEMP_OMC"
328
+ echo "Installed CLAUDE.md (fresh)"
329
+ else
330
+ # Merge: preserve user content outside OMC markers
331
+ if grep -q '<!-- OMC:START -->' "$TARGET_PATH"; then
332
+ # Has markers: replace OMC section, keep user content
333
+ BEFORE_OMC=$(sed -n '1,/<!-- OMC:START -->/{ /<!-- OMC:START -->/!p }' "$TARGET_PATH")
334
+ AFTER_OMC=$(sed -n '/<!-- OMC:END -->/,${ /<!-- OMC:END -->/!p }' "$TARGET_PATH")
335
+ {
336
+ [ -n "$BEFORE_OMC" ] && printf '%s\n' "$BEFORE_OMC"
337
+ echo '<!-- OMC:START -->'
338
+ cat "$TEMP_OMC"
339
+ echo '<!-- OMC:END -->'
340
+ [ -n "$AFTER_OMC" ] && printf '%s\n' "$AFTER_OMC"
341
+ } > "${TARGET_PATH}.tmp"
342
+ mv "${TARGET_PATH}.tmp" "$TARGET_PATH"
343
+ echo "Updated OMC section (user customizations preserved)"
344
+ else
345
+ # No markers: wrap new content in markers, append old content as user section
346
+ OLD_CONTENT=$(cat "$TARGET_PATH")
347
+ {
348
+ echo '<!-- OMC:START -->'
349
+ cat "$TEMP_OMC"
350
+ echo '<!-- OMC:END -->'
351
+ echo ""
352
+ echo "<!-- User customizations (migrated from previous CLAUDE.md) -->"
353
+ printf '%s\n' "$OLD_CONTENT"
354
+ } > "${TARGET_PATH}.tmp"
355
+ mv "${TARGET_PATH}.tmp" "$TARGET_PATH"
356
+ echo "Migrated existing CLAUDE.md (added OMC markers, preserved old content)"
357
+ fi
358
+ rm -f "$TEMP_OMC"
359
+ fi
244
360
 
245
361
  # Extract new version and report
246
- NEW_VERSION=$(grep -m1 "^# oh-my-claudecode" ~/.claude/CLAUDE.md 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
362
+ NEW_VERSION=$(grep -m1 "^# oh-my-claudecode" "$TARGET_PATH" 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
247
363
  if [ "$OLD_VERSION" = "none" ]; then
248
364
  echo "Installed CLAUDE.md: $NEW_VERSION"
249
365
  elif [ "$OLD_VERSION" = "$NEW_VERSION" ]; then
@@ -456,6 +572,67 @@ All functionality is available through the plugin system:
456
572
 
457
573
  Skip this step - the plugin provides all features.
458
574
 
575
+ ## Step 3.8.5: Select Task Management Tool
576
+
577
+ First, detect available task tools:
578
+
579
+ ```bash
580
+ # Detect beads (bd)
581
+ BD_VERSION=""
582
+ if command -v bd &>/dev/null; then
583
+ BD_VERSION=$(bd --version 2>/dev/null | head -1 || echo "installed")
584
+ fi
585
+
586
+ # Detect beads-rust (br)
587
+ BR_VERSION=""
588
+ if command -v br &>/dev/null; then
589
+ BR_VERSION=$(br --version 2>/dev/null | head -1 || echo "installed")
590
+ fi
591
+
592
+ # Report findings
593
+ if [ -n "$BD_VERSION" ]; then
594
+ echo "Found beads (bd): $BD_VERSION"
595
+ fi
596
+ if [ -n "$BR_VERSION" ]; then
597
+ echo "Found beads-rust (br): $BR_VERSION"
598
+ fi
599
+ if [ -z "$BD_VERSION" ] && [ -z "$BR_VERSION" ]; then
600
+ echo "No external task tools found. Using built-in Tasks."
601
+ fi
602
+ ```
603
+
604
+ If **neither** beads nor beads-rust is detected, skip this step (default to built-in).
605
+
606
+ If beads or beads-rust is detected, use AskUserQuestion:
607
+
608
+ **Question:** "Which task management tool should I use for tracking work?"
609
+
610
+ **Options:**
611
+ 1. **Built-in Tasks (default)** - Use Claude Code's native TaskCreate/TodoWrite. Tasks are session-only.
612
+ 2. **Beads (bd)** - Git-backed persistent tasks. Survives across sessions. [Only if detected]
613
+ 3. **Beads-Rust (br)** - Lightweight Rust port of beads. [Only if detected]
614
+
615
+ (Only show options 2/3 if the corresponding tool is detected)
616
+
617
+ Store the preference:
618
+
619
+ ```bash
620
+ CONFIG_FILE="$HOME/.claude/.omc-config.json"
621
+ mkdir -p "$(dirname "$CONFIG_FILE")"
622
+
623
+ if [ -f "$CONFIG_FILE" ]; then
624
+ EXISTING=$(cat "$CONFIG_FILE")
625
+ else
626
+ EXISTING='{}'
627
+ fi
628
+
629
+ # USER_CHOICE is "builtin", "beads", or "beads-rust" based on user selection
630
+ echo "$EXISTING" | jq --arg tool "USER_CHOICE" '. + {taskTool: $tool, taskToolConfig: {injectInstructions: true, useMcp: false}}' > "$CONFIG_FILE"
631
+ echo "Task tool set to: USER_CHOICE"
632
+ ```
633
+
634
+ **Note:** The beads context instructions will be injected automatically on the next session start. No restart is needed for config to take effect.
635
+
459
636
  ## Step 4: Verify Plugin Installation
460
637
 
461
638
  ```bash