claudecode-omc 4.4.10 → 4.5.7

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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Test: Pre-Tool-Use Hook Agent Prefix Stripping
3
+ *
4
+ * Ensures that the pre-tool-use hook correctly strips the oh-my-claudecode:
5
+ * prefix from subagent_type before the tool call reaches Claude Code.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=pre-tool-agent-prefix.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pre-tool-agent-prefix.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/pre-tool-agent-prefix.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Test: Pre-Tool-Use Hook Agent Prefix Stripping
3
+ *
4
+ * Ensures that the pre-tool-use hook correctly strips the oh-my-claudecode:
5
+ * prefix from subagent_type before the tool call reaches Claude Code.
6
+ */
7
+ import { describe, it, expect } from 'vitest';
8
+ import { execSync } from 'child_process';
9
+ import { join } from 'path';
10
+ import { existsSync } from 'fs';
11
+ describe('Pre-Tool-Use Hook: Agent Prefix Stripping', () => {
12
+ const hookPath = join(process.env.HOME || '', '.claude', 'hooks', 'pre-tool-use.mjs');
13
+ it('should have pre-tool-use hook installed', () => {
14
+ expect(existsSync(hookPath)).toBe(true);
15
+ });
16
+ it('should strip oh-my-claudecode: prefix from Agent tool calls', () => {
17
+ const input = JSON.stringify({
18
+ tool_name: 'Agent',
19
+ tool_input: {
20
+ subagent_type: 'oh-my-claudecode:architect',
21
+ description: 'Test agent call',
22
+ prompt: 'Analyze something'
23
+ }
24
+ });
25
+ const output = execSync(`echo '${input}' | node "${hookPath}"`, {
26
+ encoding: 'utf-8'
27
+ });
28
+ const result = JSON.parse(output.trim());
29
+ expect(result.continue).toBe(true);
30
+ expect(result.modifiedInput).toBeDefined();
31
+ expect(result.modifiedInput.subagent_type).toBe('architect');
32
+ expect(result.modifiedInput.description).toBe('Test agent call');
33
+ expect(result.modifiedInput.prompt).toBe('Analyze something');
34
+ });
35
+ it('should strip oh-my-claudecode: prefix from Task tool calls', () => {
36
+ const input = JSON.stringify({
37
+ tool_name: 'Task',
38
+ tool_input: {
39
+ subagent_type: 'oh-my-claudecode:executor',
40
+ description: 'Test task call',
41
+ prompt: 'Execute something'
42
+ }
43
+ });
44
+ const output = execSync(`echo '${input}' | node "${hookPath}"`, {
45
+ encoding: 'utf-8'
46
+ });
47
+ const result = JSON.parse(output.trim());
48
+ expect(result.continue).toBe(true);
49
+ expect(result.modifiedInput).toBeDefined();
50
+ expect(result.modifiedInput.subagent_type).toBe('executor');
51
+ });
52
+ it('should not modify agent calls without oh-my-claudecode: prefix', () => {
53
+ const input = JSON.stringify({
54
+ tool_name: 'Agent',
55
+ tool_input: {
56
+ subagent_type: 'architect',
57
+ description: 'Test agent call',
58
+ prompt: 'Analyze something'
59
+ }
60
+ });
61
+ const output = execSync(`echo '${input}' | node "${hookPath}"`, {
62
+ encoding: 'utf-8'
63
+ });
64
+ const result = JSON.parse(output.trim());
65
+ expect(result.continue).toBe(true);
66
+ expect(result.modifiedInput).toBeUndefined();
67
+ });
68
+ it('should handle all OMC agent types', () => {
69
+ const agentTypes = [
70
+ 'architect',
71
+ 'executor',
72
+ 'planner',
73
+ 'analyst',
74
+ 'critic',
75
+ 'verifier',
76
+ 'debugger',
77
+ 'explore',
78
+ 'designer',
79
+ 'writer',
80
+ 'qa-tester',
81
+ 'scientist',
82
+ 'deep-executor',
83
+ 'test-engineer',
84
+ 'build-fixer',
85
+ 'security-reviewer',
86
+ 'code-reviewer',
87
+ 'quality-reviewer',
88
+ 'git-master',
89
+ 'code-simplifier',
90
+ 'document-specialist'
91
+ ];
92
+ for (const agentType of agentTypes) {
93
+ const input = JSON.stringify({
94
+ tool_name: 'Agent',
95
+ tool_input: {
96
+ subagent_type: `oh-my-claudecode:${agentType}`,
97
+ description: `Test ${agentType}`,
98
+ prompt: 'Test prompt'
99
+ }
100
+ });
101
+ const output = execSync(`echo '${input}' | node "${hookPath}"`, {
102
+ encoding: 'utf-8'
103
+ });
104
+ const result = JSON.parse(output.trim());
105
+ expect(result.continue).toBe(true);
106
+ expect(result.modifiedInput).toBeDefined();
107
+ expect(result.modifiedInput.subagent_type).toBe(agentType);
108
+ }
109
+ });
110
+ it('should not affect other tool calls', () => {
111
+ const tools = ['Edit', 'Write', 'Read', 'Bash', 'Grep', 'Glob'];
112
+ for (const tool of tools) {
113
+ const input = JSON.stringify({
114
+ tool_name: tool,
115
+ tool_input: {
116
+ some_param: 'value'
117
+ }
118
+ });
119
+ const output = execSync(`echo '${input}' | node "${hookPath}"`, {
120
+ encoding: 'utf-8'
121
+ });
122
+ const result = JSON.parse(output.trim());
123
+ expect(result.continue).toBe(true);
124
+ // Should not have modifiedInput for non-Agent tools (unless it's a delegation warning)
125
+ if (tool !== 'Edit' && tool !== 'Write' && tool !== 'Bash') {
126
+ expect(result.modifiedInput).toBeUndefined();
127
+ }
128
+ }
129
+ });
130
+ });
131
+ //# sourceMappingURL=pre-tool-agent-prefix.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pre-tool-agent-prefix.test.js","sourceRoot":"","sources":["../../src/__tests__/pre-tool-agent-prefix.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEhC,QAAQ,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,CAA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AC,SAAS,CAAC;gBAC3B,SAAS,EAAE,IAAI;gBACf,UAAU,EAAE;oBACV,UAAU,EAAE,OAAO;iBACpB;aACF,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,KAAK,aAAa,QAAQ,GAAG,EAAE;gBAC9D,QAAQ,EAAE,OAAO;aAClB,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnC,uFAAuF;YACvF,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBAC3D,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,aAAa,EAAE,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,105 @@
1
+ # Agent Prefix Routing Fix (v4.5.7)
2
+
3
+ ## Problem
4
+
5
+ Users were experiencing intermittent "Agent type 'oh-my-claudecode:architect' not found" errors when using OMC agent types with the `oh-my-claudecode:` prefix. The error message showed:
6
+
7
+ ```
8
+ ⏺ oh-my-claudecode:architect(...)
9
+ ⎿ Initializing…
10
+ ⎿ Error: Agent type 'oh-my-claudecode:architect' not found. Available agents: general-purpose,
11
+ statusline-setup, Explore, Plan, claude-code-guide, code-simplifier:code-simplifier,
12
+ superpowers:code-reviewer, api-reviewer, code-reviewer, scientist, qa-tester, writer, explore,
13
+ build-fixer, security-reviewer, test-engineer, architect, debugger, designer, analyst,
14
+ style-reviewer, code-simplifier, information-architect, executor, git-master, verifier,
15
+ ux-researcher, researcher, deep-executor, critic, product-manager, performance-reviewer,
16
+ vision, planner, quality-strategist, quality-reviewer, dependency-expert, document-specialist,
17
+ product-analyst
18
+ ```
19
+
20
+ ## Root Cause
21
+
22
+ The issue occurred because:
23
+
24
+ 1. OMC's CLAUDE.md instructs Claude to use agent types with the `oh-my-claudecode:` prefix (e.g., `oh-my-claudecode:architect`)
25
+ 2. Claude Code's Agent tool only recognizes agent types without the prefix (e.g., `architect`)
26
+ 3. The delegation enforcer in `src/features/delegation-enforcer.ts` strips the prefix, but it runs **after** Claude Code validates the tool call
27
+ 4. The pre-tool-use hook didn't handle Agent/Task tool calls at all, so the prefix was never stripped before validation
28
+
29
+ ## Solution
30
+
31
+ Updated the pre-tool-use hook (`templates/hooks/pre-tool-use.mjs` and `~/.claude/hooks/pre-tool-use.mjs`) to:
32
+
33
+ 1. Detect Agent/Task tool calls
34
+ 2. Strip the `oh-my-claudecode:` prefix from `subagent_type` parameter
35
+ 3. Return the modified tool input with `modifiedInput` field
36
+
37
+ This ensures the prefix is removed **before** the tool call reaches Claude Code's validation layer.
38
+
39
+ ## Changes
40
+
41
+ ### Files Modified
42
+
43
+ 1. **templates/hooks/pre-tool-use.mjs** - Added Agent/Task tool handling
44
+ 2. **~/.claude/hooks/pre-tool-use.mjs** - Applied the same fix to installed hook
45
+ 3. **src/__tests__/pre-tool-agent-prefix.test.ts** - Added comprehensive test coverage
46
+ 4. **CHANGELOG.md** - Documented the fix
47
+ 5. **package.json** - Bumped version to 4.5.7
48
+
49
+ ### Code Changes
50
+
51
+ ```javascript
52
+ // Handle Agent/Task tool - strip oh-my-claudecode: prefix from subagent_type
53
+ if (toolName === 'Agent' || toolName === 'Task' || toolName === 'agent' || toolName === 'task') {
54
+ const toolInput = data.tool_input || data.toolInput || {};
55
+ const subagentType = toolInput.subagent_type || toolInput.subagentType || '';
56
+
57
+ // Strip oh-my-claudecode: prefix if present
58
+ if (subagentType.startsWith('oh-my-claudecode:')) {
59
+ const strippedType = subagentType.replace(/^oh-my-claudecode:/, '');
60
+ const modifiedInput = {
61
+ ...toolInput,
62
+ subagent_type: strippedType
63
+ };
64
+
65
+ console.log(JSON.stringify({
66
+ continue: true,
67
+ modifiedInput: modifiedInput
68
+ }));
69
+ return;
70
+ }
71
+
72
+ // No prefix to strip, continue as-is
73
+ console.log(JSON.stringify({ continue: true }));
74
+ return;
75
+ }
76
+ ```
77
+
78
+ ## Testing
79
+
80
+ Created comprehensive test suite that verifies:
81
+
82
+ 1. ✅ Prefix stripping works for Agent tool calls
83
+ 2. ✅ Prefix stripping works for Task tool calls
84
+ 3. ✅ Agent calls without prefix are not modified
85
+ 4. ✅ All 21 OMC agent types are handled correctly
86
+ 5. ✅ Other tool calls (Edit, Write, Read, Bash, Grep, Glob) are not affected
87
+
88
+ All tests pass successfully.
89
+
90
+ ## Impact
91
+
92
+ - **Before**: Intermittent failures when using `oh-my-claudecode:` prefixed agent types
93
+ - **After**: All agent calls work reliably, regardless of prefix usage
94
+ - **Backward Compatibility**: Agent calls without prefix continue to work as before
95
+ - **Performance**: Minimal overhead - simple string check and replace operation
96
+
97
+ ## Deployment
98
+
99
+ To apply this fix:
100
+
101
+ 1. Run `npm install` to get version 4.5.7
102
+ 2. Run `omc setup` to update the installed hooks
103
+ 3. Or manually copy `templates/hooks/pre-tool-use.mjs` to `~/.claude/hooks/pre-tool-use.mjs`
104
+
105
+ The fix is automatically applied when users update to version 4.5.7 or later.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudecode-omc",
3
- "version": "4.4.10",
3
+ "version": "4.5.7",
4
4
  "description": "Multi-agent orchestration system for Claude Code - Inspired by oh-my-opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/skills/AGENTS.md CHANGED
@@ -1,9 +1,9 @@
1
1
  <!-- Parent: ../AGENTS.md -->
2
- <!-- Generated: 2026-01-28 | Updated: 2026-02-27 -->
2
+ <!-- Generated: 2026-01-28 | Updated: 2026-03-03 -->
3
3
 
4
4
  # skills
5
5
 
6
- 40 skill directories for workflow automation and specialized behaviors (42 runtime skill names including compatibility aliases).
6
+ 41 skill directories for workflow automation and specialized behaviors (43 runtime skill names including compatibility aliases).
7
7
 
8
8
  ## Purpose
9
9
 
@@ -35,6 +35,7 @@ Skills are reusable workflow templates that can be invoked via `/oh-my-claudecod
35
35
  | `review/SKILL.md` | review | Review plan with Critic |
36
36
  | `analyze/SKILL.md` | analyze | Deep analysis and investigation |
37
37
  | `ralph-init/SKILL.md` | ralph-init | Initialize PRD for structured ralph |
38
+ | `quick-init-project/SKILL.md` | quick-init-project | Intelligent project bootstrap with mode selection (fullstack/frontend/backend/demo) and data-driven tech stack recommendations |
38
39
 
39
40
  ### Code Quality Skills
40
41
 
@@ -0,0 +1,333 @@
1
+ ---
2
+ name: quick-init-project
3
+ description: Use when the user wants to "quick init project", "bootstrap a new project", "recommend fullstack vs frontend vs backend", "initialize monorepo", "generate project scaffold", "project setup recommendation", or asks "快速初始化项目", "初始化 monorepo", "生成项目脚手架方案"
4
+ version: 1.0.0
5
+ argument-hint: <product requirement or idea>
6
+ ---
7
+
8
+ <Purpose>
9
+ Quickly bootstrap a new project with intelligent mode selection (fullstack/frontend/backend/demo), data-dense tech stack recommendations based on 2026 ecosystem data, and executable initialization commands. Delivers a complete startup plan in 5-10 minutes with minimal input.
10
+ </Purpose>
11
+
12
+ <Use_When>
13
+ - User wants to start a new project from scratch
14
+ - User needs help deciding between fullstack, frontend-only, or backend-only architecture
15
+ - User asks for monorepo setup or project scaffolding
16
+ - User wants tech stack recommendations based on current ecosystem data
17
+ - User says "quick init", "bootstrap project", "initialize monorepo", "快速初始化项目", "根据需求推荐全栈还是前端/后端"
18
+ - User wants a project scaffold with best practices and modern tooling
19
+ </Use_When>
20
+
21
+ <Do_Not_Use_When>
22
+ - User wants to modify an existing project structure
23
+ - User has already decided on tech stack and just needs implementation help
24
+ - User wants to explore multiple architectural options without commitment (use `plan` skill instead)
25
+ - User wants to add features to an existing project (use `executor` agent)
26
+ - User is asking about general architecture concepts without a specific project
27
+ </Do_Not_Use_When>
28
+
29
+ <Why_This_Exists>
30
+ Starting a new project involves critical early decisions: architecture mode, tech stack, repository structure, and tooling. Making wrong choices early can compound into significant technical debt. This skill uses data-driven decision making (Stack Overflow surveys, npm download stats, State of JS/CSS 2024) to recommend proven, well-supported stacks and provides executable commands to get started immediately.
31
+ </Why_This_Exists>
32
+
33
+ ## Research Baseline (as of 2026-02-26)
34
+
35
+ Decision making is based on the following public signals:
36
+ - Stack Overflow Developer Survey 2024: Node.js 40.8%, React 39.5%, Next.js 17.9%, NestJS 5.8%
37
+ - State of JS 2024: 67% respondents write more TypeScript than JavaScript
38
+ - State of CSS 2024: Tailwind CSS usage significantly leads CSS framework category
39
+ - npm weekly downloads (2026-02-18 to 2026-02-24):
40
+ - `typescript`: 131,004,723
41
+ - `react`: 96,415,450
42
+ - `tailwindcss`: 60,494,373
43
+ - `next`: 36,026,759
44
+ - `@nestjs/core`: 7,290,173
45
+
46
+ ## Input Contract
47
+
48
+ Extract at least the following inputs; use defaults when missing and note assumptions:
49
+ - Product goal: target users and core scenarios
50
+ - Delivery speed: `urgent (<1 week)` / `normal (2-4 weeks)` / `long (>4 weeks)`
51
+ - Team shape: frontend-heavy / backend-heavy / fullstack
52
+ - Runtime: web / api / both
53
+ - Data complexity: low / medium / high
54
+
55
+ Default assumptions: `normal + small team + web-first + medium complexity`
56
+
57
+ ## Mode Selection
58
+
59
+ ### Step 1: Hard Gates
60
+
61
+ Check in order; if hit, select mode immediately:
62
+ 1. Only concept demo, idea validation, no production requirement -> `demo`
63
+ 2. Backend exists with stable API contract, only need UI -> `frontend-only`
64
+ 3. Frontend consumer exists, only need API/service -> `backend-only`
65
+ 4. Frontend and backend both needed with frequent interface changes -> proceed to scoring (usually `full-stack`)
66
+
67
+ ### Step 2: Weighted Scoring (0-100)
68
+
69
+ Dimension scoring range `1-5`:
70
+ - Requirement complexity (weight 25)
71
+ - Delivery speed pressure (weight 20)
72
+ - Team skill fitness (weight 20)
73
+ - Deployment constraint strength (weight 15)
74
+ - Data/state complexity (weight 20)
75
+
76
+ Mode target profiles:
77
+ - `full-stack`: [4, 3, 4, 3, 4]
78
+ - `frontend-only`: [2, 4, 4, 3, 2]
79
+ - `backend-only`: [3, 3, 4, 4, 4]
80
+ - `demo`: [1, 5, 3, 1, 1]
81
+
82
+ Calculation:
83
+ - `fit = 5 - abs(actual - target)`
84
+ - `modeScore = Σ(fit/5 * weight)`
85
+
86
+ Decision rules:
87
+ 1. Top score < 60 -> fallback to `demo` + output information gaps
88
+ 2. Top1 - Top2 >= 8 -> select Top1 directly
89
+ 3. Gap < 8 -> compare `delivery speed`, `team skill fitness`, `change surface` in order
90
+
91
+ ## Tech Stack Policy (Data-Dense First)
92
+
93
+ ### Preferred Default Stack
94
+
95
+ - Language: `TypeScript`
96
+ - Frontend: `React + Next.js (App Router) + Tailwind CSS`
97
+ - Backend: `NestJS (REST-first) + OpenAPI`
98
+ - Package manager: `pnpm`
99
+ - Repository: `Monorepo` (pnpm workspaces)
100
+ - Task orchestration: `Turborepo` (default), upgrade to `Nx` when governance is required
101
+ - Quality baseline: `ESLint + Prettier + Vitest + Playwright`
102
+
103
+ ### Escalation to Nx
104
+
105
+ Upgrade from Turborepo to Nx when:
106
+ - Project count >= 6 packages/apps
107
+ - Need enforced module boundaries (lint-level boundaries)
108
+ - Need mature affected execution and stronger governance
109
+
110
+ ### Downgrade Rules
111
+
112
+ - Ultra-short PoC with only runnable pages -> can downgrade to single-repo single-app (non-monorepo)
113
+ - Backend single service with no shared packages -> can skip monorepo for now
114
+
115
+ ## Architecture Templates
116
+
117
+ ### 1) full-stack
118
+
119
+ ```text
120
+ repo/
121
+ apps/
122
+ web/ # Next.js
123
+ api/ # NestJS
124
+ packages/
125
+ ui/ # React shared components
126
+ config/ # eslint/tsconfig/prettier shared config
127
+ types/ # shared DTO/types
128
+ sdk/ # typed API client
129
+ turbo.json
130
+ pnpm-workspace.yaml
131
+ tsconfig.base.json
132
+ ```
133
+
134
+ Layering rules:
135
+ - `apps/*` can depend on `packages/*`
136
+ - `packages/ui` cannot depend on `apps/*`
137
+ - `packages/types` must stay framework-agnostic
138
+
139
+ ### 2) frontend-only
140
+
141
+ ```text
142
+ repo/
143
+ apps/web/
144
+ packages/
145
+ ui/
146
+ config/
147
+ types/
148
+ ```
149
+
150
+ Default: use `MSW` or mock server to decouple backend availability.
151
+
152
+ ### 3) backend-only
153
+
154
+ ```text
155
+ repo/
156
+ apps/api/
157
+ packages/
158
+ config/
159
+ types/
160
+ contracts/ # OpenAPI schema + generated clients
161
+ ```
162
+
163
+ Default: deliver `OpenAPI` first with health/readiness endpoints.
164
+
165
+ ### 4) demo
166
+
167
+ ```text
168
+ repo/
169
+ apps/demo/
170
+ packages/config/
171
+ ```
172
+
173
+ Scope limit: single main flow + minimal dependencies + quick demo capability.
174
+
175
+ ## Execution Workflow
176
+
177
+ <Agent_Orchestration>
178
+ Phase A (Requirement Parsing):
179
+ - Use Agent(subagent_type="oh-my-claudecode:analyst", model="sonnet")
180
+ - Extract: product goal, delivery speed, team shape, runtime, data complexity
181
+ - Output summary: problem statement, assumptions, unknowns (max 1 screen)
182
+ - Save to: `.omc/quick-init/requirements.md`
183
+
184
+ Phase B (Mode Decision):
185
+ - Use Agent(subagent_type="oh-my-claudecode:architect", model="opus")
186
+ - Apply hard gates first, then weighted scoring if needed
187
+ - Output: selected mode, scores, hard gate hit (if any), reasoning (max 3 bullets), risk note (1 line)
188
+ - Save to: `.omc/quick-init/decision.md`
189
+
190
+ Phase C (Bootstrap Plan):
191
+ - Use Agent(subagent_type="oh-my-claudecode:planner", model="sonnet")
192
+ - Generate: directory structure, init commands, milestones (Day 1/3/7), minimal verification commands
193
+ - Save to: `.omc/quick-init/bootstrap-plan.md`
194
+
195
+ Phase D (Command Generation):
196
+ - Direct execution: generate executable commands based on selected mode
197
+ - Save to: `.omc/quick-init/init-commands.sh`
198
+ </Agent_Orchestration>
199
+
200
+ ### Default Command Templates
201
+
202
+ Full-stack or multi-package:
203
+ ```bash
204
+ pnpm dlx create-turbo@latest
205
+ pnpm install
206
+ pnpm -r lint
207
+ pnpm -r test
208
+ pnpm -r build
209
+ ```
210
+
211
+ Frontend-only (non-monorepo):
212
+ ```bash
213
+ pnpm create next-app@latest web --ts --tailwind --eslint --app
214
+ cd web && pnpm test
215
+ ```
216
+
217
+ Backend-only (non-monorepo):
218
+ ```bash
219
+ pnpm add -g @nestjs/cli
220
+ nest new api
221
+ cd api && pnpm test
222
+ ```
223
+
224
+ ## Output Format
225
+
226
+ Every execution must return:
227
+
228
+ ```text
229
+ ## Init Recommendation
230
+ - Selected Mode: <full-stack|frontend-only|backend-only|demo>
231
+ - Confidence: <HIGH|MEDIUM|LOW>
232
+
233
+ ## Decision Evidence
234
+ - Hard Gate: <rule-id or none>
235
+ - Scores: full-stack=<n>, frontend-only=<n>, backend-only=<n>, demo=<n>
236
+ - Why: <3 bullets max>
237
+
238
+ ## Recommended Stack
239
+ - Runtime: ...
240
+ - Frameworks: ...
241
+ - Repo Strategy: ...
242
+
243
+ ## Bootstrap Commands
244
+ [exact commands here]
245
+
246
+ ## Folder Blueprint
247
+ [tree here]
248
+
249
+ ## 7-Day Plan
250
+ 1. Day 1 ...
251
+ 2. Day 3 ...
252
+ 3. Day 7 ...
253
+
254
+ ## Risks & Mitigations
255
+ - Risk: ...
256
+ - Mitigation: ...
257
+ ```
258
+
259
+ ## Quality Gates
260
+
261
+ Before claiming "ready to initialize", must satisfy:
262
+ 1. Mode selection has traceable basis (hard gate or complete scoring)
263
+ 2. Tech stack includes TypeScript, with explanation if not using default stack
264
+ 3. Commands are directly executable, no placeholders
265
+ 4. Directory structure matches selected mode
266
+ 5. At least one risk with mitigation provided
267
+
268
+ <Tool_Usage>
269
+ - Use `Agent` tool with appropriate subagent types for each phase
270
+ - Use `Write` tool to save outputs to `.omc/quick-init/` directory
271
+ - Use `Bash` tool to execute verification commands (lint/test/build) if user requests immediate setup
272
+ - Use `state_write(mode="quick-init")` to track progress across phases
273
+ - Use `notepad_write_working` to log key decisions for session context
274
+ </Tool_Usage>
275
+
276
+ <Examples>
277
+ <Good>
278
+ User: "快速初始化一个电商项目,需要前后端"
279
+ Why good: Clear domain (e-commerce), explicit requirement (fullstack). Skill will analyze and recommend appropriate stack with monorepo structure.
280
+ </Good>
281
+
282
+ <Good>
283
+ User: "bootstrap a SaaS dashboard with user auth and billing"
284
+ Why good: Specific features mentioned, clear product type. Skill can make informed mode and stack decisions based on complexity.
285
+ </Good>
286
+
287
+ <Good>
288
+ User: "quick init a REST API for inventory management"
289
+ Why good: Clear backend-only scenario. Skill will detect this via hard gate and recommend NestJS + OpenAPI setup.
290
+ </Good>
291
+
292
+ <Bad>
293
+ User: "add a new feature to my existing Next.js app"
294
+ Why bad: This is about modifying existing code, not initializing a new project. Use executor agent instead.
295
+ </Bad>
296
+
297
+ <Bad>
298
+ User: "what's the best way to structure a monorepo?"
299
+ Why bad: This is a general architecture question without a specific project. Respond conversationally or use plan skill.
300
+ </Bad>
301
+ </Examples>
302
+
303
+ <Execution_Policy>
304
+ - Each phase must complete before the next begins
305
+ - Analyst extracts requirements first, architect makes mode decision, planner generates bootstrap plan
306
+ - If requirements are too vague and analyst cannot extract sufficient information, pause and ask user for clarification
307
+ - If mode decision confidence is LOW, present options to user before proceeding
308
+ - All outputs must be saved to `.omc/quick-init/` for traceability
309
+ - Commands must be tested for syntax validity before presenting to user
310
+ </Execution_Policy>
311
+
312
+ <Escalation_And_Stop_Conditions>
313
+ - Stop and ask for clarification when requirements are too vague (confidence < 50%)
314
+ - Stop and present options when mode decision is ambiguous (top two scores within 5 points)
315
+ - Stop when user says "stop", "cancel", or "wait"
316
+ - If tech stack constraints conflict with best practices, explain tradeoffs and ask for confirmation
317
+ </Escalation_And_Stop_Conditions>
318
+
319
+ ## Sources
320
+
321
+ - Stack Overflow Developer Survey 2024 (Technology): https://survey.stackoverflow.co/2024/technology
322
+ - State of JS 2024 (Usage): https://2024.stateofjs.com/en-US/usage/
323
+ - State of CSS 2024 (Tools): https://2024.stateofcss.com/en-US/tools/
324
+ - npm downloads API:
325
+ - https://api.npmjs.org/downloads/point/last-week/typescript
326
+ - https://api.npmjs.org/downloads/point/last-week/react
327
+ - https://api.npmjs.org/downloads/point/last-week/tailwindcss
328
+ - https://api.npmjs.org/downloads/point/last-week/next
329
+ - https://api.npmjs.org/downloads/point/last-week/@nestjs/core
330
+ - Turborepo docs: https://turborepo.com/docs
331
+ - pnpm workspaces: https://pnpm.io/workspaces
332
+ - Nx monorepo docs: https://nx.dev/docs/features/maintain-typescript-monorepos
333
+ - TypeScript project references: https://www.typescriptlang.org/docs/handbook/project-references
@@ -95,6 +95,32 @@ async function main() {
95
95
  // Extract tool name (handle both cases)
96
96
  const toolName = data.tool_name || data.toolName || '';
97
97
 
98
+ // Handle Agent/Task tool - strip oh-my-claudecode: prefix from subagent_type
99
+ if (toolName === 'Agent' || toolName === 'Task' || toolName === 'agent' || toolName === 'task') {
100
+ const toolInput = data.tool_input || data.toolInput || {};
101
+ const subagentType = toolInput.subagent_type || toolInput.subagentType || '';
102
+
103
+ // Strip oh-my-claudecode: prefix if present
104
+ if (subagentType.startsWith('oh-my-claudecode:')) {
105
+ const strippedType = subagentType.replace(/^oh-my-claudecode:/, '');
106
+ const modifiedInput = {
107
+ ...toolInput,
108
+ subagent_type: strippedType
109
+ };
110
+
111
+ console.log(JSON.stringify({
112
+ continue: true,
113
+ modifiedInput: modifiedInput,
114
+ suppressOutput: true
115
+ }));
116
+ return;
117
+ }
118
+
119
+ // No prefix to strip, continue as-is
120
+ console.log(JSON.stringify({ continue: true, suppressOutput: true }));
121
+ return;
122
+ }
123
+
98
124
  // Handle Bash tool separately - check for file modification patterns
99
125
  if (toolName === 'Bash' || toolName === 'bash') {
100
126
  const toolInput = data.tool_input || data.toolInput || {};