oh-my-customcode 0.18.3 → 0.19.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.
package/dist/cli/index.js CHANGED
@@ -14083,9 +14083,6 @@ async function installComponent(targetDir, component, options) {
14083
14083
  return false;
14084
14084
  }
14085
14085
  const templatePath = getComponentPath(component);
14086
- if (!templatePath) {
14087
- return false;
14088
- }
14089
14086
  const destPath = join4(targetDir, templatePath);
14090
14087
  const destExists = await fileExists(destPath);
14091
14088
  if (destExists && !options.force && !options.backup) {
@@ -15194,7 +15191,9 @@ function createUpdateResult() {
15194
15191
  backedUpPaths: [],
15195
15192
  previousVersion: "",
15196
15193
  newVersion: "",
15197
- warnings: []
15194
+ warnings: [],
15195
+ syncedRootFiles: [],
15196
+ removedDeprecatedFiles: []
15198
15197
  };
15199
15198
  }
15200
15199
  async function handleBackupIfRequested(targetDir, backup, result) {
@@ -15359,6 +15358,14 @@ async function update(options) {
15359
15358
  const customizations = resolveCustomizations(manifestCustomizations, configPreserveFiles, options.targetDir);
15360
15359
  const components = options.components || getAllUpdateComponents();
15361
15360
  await updateAllComponents(options.targetDir, components, updateCheck, customizations, options, result, config);
15361
+ if (!options.components || options.components.length === 0) {
15362
+ const synced = await syncRootLevelFiles(options.targetDir, options);
15363
+ result.syncedRootFiles = synced;
15364
+ }
15365
+ if (!options.components || options.components.length === 0) {
15366
+ const removed = await removeDeprecatedFiles(options.targetDir, options);
15367
+ result.removedDeprecatedFiles = removed;
15368
+ }
15362
15369
  if (!options.components || options.components.length === 0) {
15363
15370
  await updateEntryDoc(options.targetDir, config, options);
15364
15371
  }
@@ -15453,6 +15460,70 @@ async function updateComponent(targetDir, component, customizations, options, co
15453
15460
  });
15454
15461
  return preservedFiles;
15455
15462
  }
15463
+ var ROOT_LEVEL_FILES = ["statusline.sh", "install-hooks.sh", "uninstall-hooks.sh"];
15464
+ async function syncRootLevelFiles(targetDir, options) {
15465
+ if (options.dryRun) {
15466
+ return ROOT_LEVEL_FILES;
15467
+ }
15468
+ const fs3 = await import("node:fs/promises");
15469
+ const layout = getProviderLayout();
15470
+ const synced = [];
15471
+ for (const fileName of ROOT_LEVEL_FILES) {
15472
+ const srcPath = resolveTemplatePath(join8(layout.rootDir, fileName));
15473
+ if (!await fileExists(srcPath)) {
15474
+ continue;
15475
+ }
15476
+ const destPath = join8(targetDir, layout.rootDir, fileName);
15477
+ await ensureDirectory(join8(destPath, ".."));
15478
+ await fs3.copyFile(srcPath, destPath);
15479
+ if (fileName.endsWith(".sh")) {
15480
+ await fs3.chmod(destPath, 493);
15481
+ }
15482
+ synced.push(fileName);
15483
+ }
15484
+ if (synced.length > 0) {
15485
+ debug("update.root_files_synced", { files: synced.join(", ") });
15486
+ }
15487
+ return synced;
15488
+ }
15489
+ async function removeDeprecatedFiles(targetDir, options) {
15490
+ const manifestPath = resolveTemplatePath("deprecated-files.json");
15491
+ if (!await fileExists(manifestPath)) {
15492
+ return [];
15493
+ }
15494
+ const manifest = await readJsonFile(manifestPath);
15495
+ if (!manifest.files || manifest.files.length === 0) {
15496
+ return [];
15497
+ }
15498
+ if (options.dryRun) {
15499
+ return manifest.files.map((f) => f.path);
15500
+ }
15501
+ const fs3 = await import("node:fs/promises");
15502
+ const removed = [];
15503
+ for (const entry of manifest.files) {
15504
+ const validation = validatePreserveFilePath(entry.path, targetDir);
15505
+ if (!validation.valid) {
15506
+ warn("update.deprecated_file_invalid_path", {
15507
+ path: entry.path,
15508
+ reason: validation.reason ?? "Invalid path"
15509
+ });
15510
+ continue;
15511
+ }
15512
+ const fullPath = join8(targetDir, entry.path);
15513
+ if (await fileExists(fullPath)) {
15514
+ await fs3.unlink(fullPath);
15515
+ removed.push(entry.path);
15516
+ info("update.deprecated_file_removed", {
15517
+ path: entry.path,
15518
+ reason: entry.reason
15519
+ });
15520
+ }
15521
+ }
15522
+ if (removed.length > 0) {
15523
+ debug("update.deprecated_files_cleaned", { count: String(removed.length) });
15524
+ }
15525
+ return removed;
15526
+ }
15456
15527
  function getComponentPath2(component) {
15457
15528
  const layout = getProviderLayout();
15458
15529
  if (component === "guides") {
package/dist/index.js CHANGED
@@ -980,9 +980,6 @@ async function installComponent(targetDir, component, options) {
980
980
  return false;
981
981
  }
982
982
  const templatePath = getComponentPath(component);
983
- if (!templatePath) {
984
- return false;
985
- }
986
983
  const destPath = join3(targetDir, templatePath);
987
984
  const destExists = await fileExists(destPath);
988
985
  if (destExists && !options.force && !options.backup) {
@@ -1210,7 +1207,9 @@ function createUpdateResult() {
1210
1207
  backedUpPaths: [],
1211
1208
  previousVersion: "",
1212
1209
  newVersion: "",
1213
- warnings: []
1210
+ warnings: [],
1211
+ syncedRootFiles: [],
1212
+ removedDeprecatedFiles: []
1214
1213
  };
1215
1214
  }
1216
1215
  async function handleBackupIfRequested(targetDir, backup, result) {
@@ -1375,6 +1374,14 @@ async function update(options) {
1375
1374
  const customizations = resolveCustomizations(manifestCustomizations, configPreserveFiles, options.targetDir);
1376
1375
  const components = options.components || getAllUpdateComponents();
1377
1376
  await updateAllComponents(options.targetDir, components, updateCheck, customizations, options, result, config);
1377
+ if (!options.components || options.components.length === 0) {
1378
+ const synced = await syncRootLevelFiles(options.targetDir, options);
1379
+ result.syncedRootFiles = synced;
1380
+ }
1381
+ if (!options.components || options.components.length === 0) {
1382
+ const removed = await removeDeprecatedFiles(options.targetDir, options);
1383
+ result.removedDeprecatedFiles = removed;
1384
+ }
1378
1385
  if (!options.components || options.components.length === 0) {
1379
1386
  await updateEntryDoc(options.targetDir, config, options);
1380
1387
  }
@@ -1490,6 +1497,70 @@ async function updateComponent(targetDir, component, customizations, options, co
1490
1497
  });
1491
1498
  return preservedFiles;
1492
1499
  }
1500
+ var ROOT_LEVEL_FILES = ["statusline.sh", "install-hooks.sh", "uninstall-hooks.sh"];
1501
+ async function syncRootLevelFiles(targetDir, options) {
1502
+ if (options.dryRun) {
1503
+ return ROOT_LEVEL_FILES;
1504
+ }
1505
+ const fs = await import("node:fs/promises");
1506
+ const layout = getProviderLayout();
1507
+ const synced = [];
1508
+ for (const fileName of ROOT_LEVEL_FILES) {
1509
+ const srcPath = resolveTemplatePath(join4(layout.rootDir, fileName));
1510
+ if (!await fileExists(srcPath)) {
1511
+ continue;
1512
+ }
1513
+ const destPath = join4(targetDir, layout.rootDir, fileName);
1514
+ await ensureDirectory(join4(destPath, ".."));
1515
+ await fs.copyFile(srcPath, destPath);
1516
+ if (fileName.endsWith(".sh")) {
1517
+ await fs.chmod(destPath, 493);
1518
+ }
1519
+ synced.push(fileName);
1520
+ }
1521
+ if (synced.length > 0) {
1522
+ debug("update.root_files_synced", { files: synced.join(", ") });
1523
+ }
1524
+ return synced;
1525
+ }
1526
+ async function removeDeprecatedFiles(targetDir, options) {
1527
+ const manifestPath = resolveTemplatePath("deprecated-files.json");
1528
+ if (!await fileExists(manifestPath)) {
1529
+ return [];
1530
+ }
1531
+ const manifest = await readJsonFile(manifestPath);
1532
+ if (!manifest.files || manifest.files.length === 0) {
1533
+ return [];
1534
+ }
1535
+ if (options.dryRun) {
1536
+ return manifest.files.map((f) => f.path);
1537
+ }
1538
+ const fs = await import("node:fs/promises");
1539
+ const removed = [];
1540
+ for (const entry of manifest.files) {
1541
+ const validation = validatePreserveFilePath(entry.path, targetDir);
1542
+ if (!validation.valid) {
1543
+ warn("update.deprecated_file_invalid_path", {
1544
+ path: entry.path,
1545
+ reason: validation.reason ?? "Invalid path"
1546
+ });
1547
+ continue;
1548
+ }
1549
+ const fullPath = join4(targetDir, entry.path);
1550
+ if (await fileExists(fullPath)) {
1551
+ await fs.unlink(fullPath);
1552
+ removed.push(entry.path);
1553
+ info("update.deprecated_file_removed", {
1554
+ path: entry.path,
1555
+ reason: entry.reason
1556
+ });
1557
+ }
1558
+ }
1559
+ if (removed.length > 0) {
1560
+ debug("update.deprecated_files_cleaned", { count: String(removed.length) });
1561
+ }
1562
+ return removed;
1563
+ }
1493
1564
  function getComponentPath2(component) {
1494
1565
  const layout = getProviderLayout();
1495
1566
  if (component === "guides") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-customcode",
3
- "version": "0.18.3",
3
+ "version": "0.19.0",
4
4
  "description": "Batteries-included agent harness for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,7 +54,7 @@
54
54
  "js-yaml": "^4.1.0",
55
55
  "nodemailer": "^8.0.1",
56
56
  "typescript": "^5.7.3",
57
- "vitepress": "^1.6.3"
57
+ "vitepress": "^1.6.4"
58
58
  },
59
59
  "keywords": [
60
60
  "claude",
@@ -72,9 +72,25 @@
72
72
  {
73
73
  "type": "command",
74
74
  "command": "bash .claude/hooks/scripts/git-delegation-guard.sh"
75
+ },
76
+ {
77
+ "type": "command",
78
+ "command": "bash .claude/hooks/scripts/agent-teams-advisor.sh"
79
+ }
80
+ ],
81
+ "description": "HUD statusline + R010 git delegation guard + R018 Agent Teams advisor on Task spawn"
82
+ }
83
+ ],
84
+ "SessionStart": [
85
+ {
86
+ "matcher": "*",
87
+ "hooks": [
88
+ {
89
+ "type": "command",
90
+ "command": "bash .claude/hooks/scripts/session-env-check.sh"
75
91
  }
76
92
  ],
77
- "description": "HUD statusline + R010 git delegation guard on Task spawn"
93
+ "description": "Check codex CLI and Agent Teams availability at session start"
78
94
  }
79
95
  ],
80
96
  "PostToolUse": [
@@ -155,10 +171,10 @@
155
171
  "hooks": [
156
172
  {
157
173
  "type": "command",
158
- "command": "#!/bin/bash\ninput=$(cat)\n\nif git rev-parse --git-dir > /dev/null 2>&1; then\n modified_files=$(git diff --name-only HEAD 2>/dev/null | grep -E '\\.(ts|tsx|js|jsx)$' || true)\n \n if [ -n \"$modified_files\" ]; then\n has_console=false\n while IFS= read -r file; do\n if [ -f \"$file\" ]; then\n if grep -q \"console\\.log\" \"$file\" 2>/dev/null; then\n echo \"[Hook] WARNING: console.log found in $file\" >&2\n has_console=true\n fi\n fi\n done <<< \"$modified_files\"\n \n if [ \"$has_console\" = true ]; then\n echo \"[Hook] Remove console.log statements before committing\" >&2\n fi\n fi\nfi\n\necho \"$input\""
174
+ "command": "bash .claude/hooks/scripts/stop-console-audit.sh"
159
175
  }
160
176
  ],
161
- "description": "Final audit for console.log in modified files before session ends"
177
+ "description": "Final console.log audit and session diagnostics before session ends"
162
178
  }
163
179
  ]
164
180
  }
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # Agent Teams Advisor Hook
5
+ # Trigger: PreToolUse, tool == "Task"
6
+ # Purpose: Track Task tool usage count per session and warn when Agent Teams may be more appropriate
7
+ # Protocol: stdin JSON -> process -> stdout pass-through, exit 0 always (advisory only)
8
+
9
+ input=$(cat)
10
+
11
+ # Extract task info from input
12
+ agent_type=$(echo "$input" | jq -r '.tool_input.subagent_type // "unknown"')
13
+ prompt_preview=$(echo "$input" | jq -r '.tool_input.description // ""' | head -c 60)
14
+
15
+ # Session-scoped counter using parent PID as session identifier
16
+ COUNTER_FILE="/tmp/.claude-task-count-${PPID}"
17
+
18
+ # Read and increment counter
19
+ if [ -f "$COUNTER_FILE" ]; then
20
+ COUNT=$(cat "$COUNTER_FILE")
21
+ COUNT=$((COUNT + 1))
22
+ else
23
+ COUNT=1
24
+ fi
25
+ echo "$COUNT" > "$COUNTER_FILE"
26
+
27
+ # Warn from 2nd Task call onward -- Agent Teams may be more appropriate
28
+ if [ "$COUNT" -ge 2 ]; then
29
+ echo "" >&2
30
+ echo "--- [R018 Advisor] Task tool call #${COUNT} in this session ---" >&2
31
+ echo " WARNING: Multiple Task calls detected. Consider Agent Teams if:" >&2
32
+ echo " * 3+ agents needed for this work" >&2
33
+ echo " * Review -> fix -> re-review cycle exists" >&2
34
+ echo " * Agents need shared state or coordination" >&2
35
+ echo " Current: Task(${agent_type}) -- ${prompt_preview}" >&2
36
+ echo "-----------------------------------------------------------" >&2
37
+ fi
38
+
39
+ # Always pass through -- advisory only, never blocks
40
+ echo "$input"
41
+ exit 0
@@ -0,0 +1,36 @@
1
+ #!/bin/bash
2
+ # R010 git-delegation-guard hook
3
+ # Warns when git operations are delegated to a non-mgr-gitnerd agent via Task tool.
4
+ # WARN only - does NOT block (exit 0, passes input through).
5
+
6
+ input=$(cat)
7
+
8
+ agent_type=$(echo "$input" | jq -r '.tool_input.subagent_type // ""')
9
+ prompt=$(echo "$input" | jq -r '.tool_input.prompt // ""')
10
+
11
+ # Only warn when the delegated agent is NOT mgr-gitnerd
12
+ if [ "$agent_type" != "mgr-gitnerd" ]; then
13
+ git_keywords=(
14
+ "git commit"
15
+ "git push"
16
+ "git revert"
17
+ "git merge"
18
+ "git rebase"
19
+ "git checkout"
20
+ "git branch"
21
+ "git reset"
22
+ "git cherry-pick"
23
+ "git tag"
24
+ )
25
+
26
+ for keyword in "${git_keywords[@]}"; do
27
+ if echo "$prompt" | grep -qi "$keyword"; then
28
+ echo "[Hook] WARNING: R010 violation detected - git operation ('$keyword') delegated to '$agent_type' instead of 'mgr-gitnerd'" >&2
29
+ echo "[Hook] Per R010, all git operations (commit/push/branch/merge/etc.) MUST be delegated to mgr-gitnerd" >&2
30
+ break
31
+ fi
32
+ done
33
+ fi
34
+
35
+ # Always pass through - this hook is advisory only
36
+ echo "$input"
@@ -0,0 +1,44 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # Session Environment Check Hook
5
+ # Trigger: SessionStart
6
+ # Purpose: Check availability of codex CLI and Agent Teams, report via stderr
7
+ # Protocol: stdin JSON -> stdout pass-through, exit 0 always
8
+
9
+ input=$(cat)
10
+
11
+ echo "" >&2
12
+ echo "--- [Session Environment Check] ---" >&2
13
+
14
+ # Check codex CLI availability
15
+ CODEX_STATUS="unavailable"
16
+ if command -v codex >/dev/null 2>&1; then
17
+ if [ -n "${OPENAI_API_KEY:-}" ]; then
18
+ CODEX_STATUS="available (authenticated)"
19
+ else
20
+ CODEX_STATUS="installed but OPENAI_API_KEY not set"
21
+ fi
22
+ fi
23
+
24
+ # Check Agent Teams availability
25
+ AGENT_TEAMS_STATUS="disabled"
26
+ if [ "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-0}" = "1" ]; then
27
+ AGENT_TEAMS_STATUS="enabled"
28
+ fi
29
+
30
+ # Write status to file for other hooks to reference
31
+ STATUS_FILE="/tmp/.claude-env-status-${PPID}"
32
+ cat > "$STATUS_FILE" << ENVEOF
33
+ codex=${CODEX_STATUS}
34
+ agent_teams=${AGENT_TEAMS_STATUS}
35
+ ENVEOF
36
+
37
+ # Report to stderr (visible in conversation)
38
+ echo " codex CLI: ${CODEX_STATUS}" >&2
39
+ echo " Agent Teams: ${AGENT_TEAMS_STATUS}" >&2
40
+ echo "------------------------------------" >&2
41
+
42
+ # Pass through
43
+ echo "$input"
44
+ exit 0
@@ -0,0 +1,46 @@
1
+ #!/bin/bash
2
+ # Stop hook: Final audit for console.log and session diagnostics
3
+ # Always exits 0 (never blocks session termination)
4
+ # Ref: https://github.com/baekenough/oh-my-customcode/issues/206
5
+
6
+ set -euo pipefail
7
+
8
+ input=$(cat)
9
+
10
+ # --- Session diagnostics ---
11
+ # Output session status for debugging stop evaluator false positives
12
+ echo "[Stop] Session termination audit starting..." >&2
13
+
14
+ # Check for background task output files (helps diagnose evaluator false positives)
15
+ bg_task_files=$(find /tmp -maxdepth 1 -name "claude-*.output" 2>/dev/null | wc -l | tr -d ' ')
16
+ if [ "$bg_task_files" -gt 0 ]; then
17
+ echo "[Stop] Background task output files found: ${bg_task_files} (informational only — these are normal)" >&2
18
+ fi
19
+
20
+ # --- Console.log audit ---
21
+ if git rev-parse --git-dir > /dev/null 2>&1; then
22
+ modified_files=$(git diff --name-only HEAD 2>/dev/null | grep -E '\.(ts|tsx|js|jsx)$' || true)
23
+
24
+ if [ -n "$modified_files" ]; then
25
+ has_console=false
26
+ while IFS= read -r file; do
27
+ if [ -f "$file" ]; then
28
+ if grep -q "console\.log" "$file" 2>/dev/null; then
29
+ echo "[Stop] WARNING: console.log found in $file" >&2
30
+ has_console=true
31
+ fi
32
+ fi
33
+ done <<< "$modified_files"
34
+
35
+ if [ "$has_console" = true ]; then
36
+ echo "[Stop] Remove console.log statements before committing" >&2
37
+ fi
38
+ fi
39
+ fi
40
+
41
+ echo "[Stop] Audit complete. Session safe to terminate." >&2
42
+
43
+ # CRITICAL: Always pass through input and exit 0
44
+ # This hook MUST NEVER block session termination
45
+ echo "$input"
46
+ exit 0
@@ -35,16 +35,16 @@ BEFORE using Task tool for 2+ agent tasks, this check is **ENFORCED**:
35
35
  ║ YES → MUST check criteria #2-#5 ║
36
36
  ║ NO → Proceed with Task tool ║
37
37
  ║ ║
38
- ║ 2. Do 2+ agents need to coordinate? → Agent Teams
39
- 3. Is there a review/fix/iterate cycle? → Agent Teams
40
- 4. Do agents need shared state? Agent Teams
41
- ║ 5. Is research requiring synthesis? → Agent Teams ║
38
+ ║ 2. Will 3+ agents be involved?
39
+ YES MUST use Agent Teams
40
+ NOCheck #3
42
41
  ║ ║
43
- If YES to #1 AND any of #2-#5:
44
- → MUST use Agent Teams
45
- ║ → Using Task tool instead is a VIOLATION
42
+ 3. Is there a review fix → re-review cycle?
43
+ YES → MUST use Agent Teams
44
+ NOProceed with Task tool
46
45
  ║ ║
47
- Exception: Cost-sensitive batch ops with no inter-agent need
46
+ Simple rule: 3+ agents OR review cycle Agent Teams
47
+ ║ Everything else → Task tool ║
48
48
  ╚══════════════════════════════════════════════════════════════════╝
49
49
  ```
50
50
 
@@ -156,12 +156,14 @@ TeamCreate → TaskCreate → Task(spawn members) → SendMessage(coordinate)
156
156
 
157
157
  ## Fallback
158
158
 
159
- When Agent Teams unavailable: use Task tool with R009/R010 rules. Both approaches produce results; Agent Teams adds coordination richness.
159
+ When Agent Teams unavailable: use Task tool with R009/R010 rules.
160
+ When Agent Teams available: actively prefer it for qualifying tasks. This is not optional.
160
161
 
161
162
  ## Cost Awareness
162
163
 
163
- Agent Teams uses more tokens (full context per member + message passing). Use Task tool when:
164
- - Task takes < 3 minutes
165
- - No inter-agent communication needed
166
- - Simple independent subtasks only
167
- - Cost is the primary concern
164
+ Agent Teams actively preferred for qualifying collaborative tasks. Use Task tool only when:
165
+ - 1-2 agents with no inter-dependency
166
+ - No review fix cycles
167
+ - Simple independent subtasks
168
+
169
+ Do NOT avoid Agent Teams solely for cost reasons when criteria are met.
@@ -15,12 +15,30 @@ Independent (MUST parallelize):
15
15
 
16
16
  Examples: creating multiple agents, reviewing multiple files, batch operations on different resources.
17
17
 
18
+ ## Agent Teams Gate (R018 Integration)
19
+
20
+ Before spawning parallel Task instances, evaluate Agent Teams eligibility:
21
+
22
+ ```
23
+ 2+ independent tasks detected
24
+
25
+ Is Agent Teams available? (env or tools check)
26
+ ├─ NO → Proceed with Task tool (standard R009)
27
+ └─ YES → Check eligibility:
28
+ ├─ 3+ agents needed? → Agent Teams (MUST)
29
+ ├─ Review → fix cycle? → Agent Teams (MUST)
30
+ └─ Neither → Task tool (standard R009)
31
+ ```
32
+
33
+ This gate is MANDATORY when Agent Teams is enabled. Skipping it is a violation of both R009 and R018.
34
+
18
35
  ## Self-Check
19
36
 
20
37
  Before writing/editing multiple files:
21
38
  1. Are files independent? → YES: spawn parallel Task agents
22
39
  2. Using Write/Edit sequentially for 2+ files? → STOP, parallelize
23
40
  3. Specialized agent available? → Use it (not general-purpose)
41
+ 4. Agent Teams available + 3+ agents or review cycle? → YES: use Agent Teams instead of Task
24
42
 
25
43
  ### Common Violations to Avoid
26
44
 
@@ -134,7 +134,7 @@ codex-exec requires the Codex CLI binary to be installed and authenticated. The
134
134
 
135
135
  If either check fails, this skill cannot be used. Fall back to Claude agents for the task.
136
136
 
137
- > **Note**: `disable-model-invocation: true` is set intentionally. This skill must be explicitly invoked via `/codex-exec` or delegated by the orchestrator. It is NOT auto-invoked by the model.
137
+ > **Note**: This skill is invoked via `/codex-exec` command, delegated by the orchestrator, or suggested by routing skills when codex is available. The intent-detection system can trigger it for research (xhigh) and code generation (hybrid) workflows.
138
138
 
139
139
  ## Agent Teams Integration
140
140
 
@@ -154,7 +154,7 @@ Orchestrator delegates generation task
154
154
 
155
155
  ## Research Workflow
156
156
 
157
- When the orchestrator detects a research/information gathering request:
157
+ When the orchestrator or intent-detection detects a research/information gathering request (routing_rule in agent-triggers.yaml):
158
158
 
159
159
  1. **Check Codex availability**: Verify `codex` binary and `OPENAI_API_KEY`
160
160
  2. **If available**: Execute with xhigh reasoning effort for thorough research
@@ -175,3 +175,30 @@ When the orchestrator detects a research/information gathering request:
175
175
  | medium | General tasks | Balanced | Standard |
176
176
  | high | Complex analysis | Slower | Deep |
177
177
  | xhigh | Research & investigation | Slowest | Maximum |
178
+
179
+ ## Code Generation Workflow
180
+
181
+ When routing skills detect a code generation task and codex is available:
182
+
183
+ 1. **Check availability**: Verify codex CLI via `/tmp/.claude-env-status-*`
184
+ 2. **If available + new file creation**: Suggest hybrid workflow
185
+ 3. **Hybrid pattern**:
186
+ - codex-exec generates initial code (fast, broad generation)
187
+ - Claude expert reviews for quality, patterns, best practices
188
+ - Iterate if needed
189
+
190
+ ### Suitable Tasks
191
+ - New file scaffolding
192
+ - Boilerplate generation
193
+ - Test stub creation
194
+ - Documentation generation
195
+
196
+ ### Unsuitable Tasks
197
+ - Modifying existing code (Claude expert better at understanding context)
198
+ - Architecture decisions (requires reasoning, not generation)
199
+ - Bug fixes (requires deep code understanding)
200
+
201
+ ### Code Generation Command Pattern
202
+ ```
203
+ /codex-exec "Generate {description} following {framework} best practices" --effort high --full-auto
204
+ ```
@@ -45,6 +45,33 @@ Routes data engineering tasks to appropriate DE expert agents. This skill contai
45
45
  | Kafka configs, `*.properties` (Kafka), `streams/*.java` | de-kafka-expert |
46
46
  | Snowflake SQL, warehouse DDL | de-snowflake-expert |
47
47
 
48
+ ## Routing Decision (Priority Order)
49
+
50
+ Before routing via Task tool, evaluate in this order:
51
+
52
+ ### Step 1: Agent Teams Eligibility (R018)
53
+ Check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or TeamCreate/SendMessage tools present).
54
+
55
+ | Scenario | Preferred |
56
+ |----------|-----------|
57
+ | Single-tool DE task | Task Tool |
58
+ | Multi-tool pipeline design (3+ tools) | Agent Teams |
59
+ | Cross-tool data quality analysis | Agent Teams |
60
+ | Quick DAG/model validation | Task Tool |
61
+
62
+ ### Step 2: Codex-Exec Hybrid (Code Generation)
63
+ For **new pipeline code**, **DAG scaffolding**, or **SQL model generation**:
64
+
65
+ 1. Check `/tmp/.claude-env-status-*` for codex availability
66
+ 2. If codex available → suggest hybrid workflow for code generation
67
+ 3. If codex unavailable → use DE expert directly
68
+
69
+ **Suitable**: New DAG files, dbt model scaffolding, SQL template generation
70
+ **Unsuitable**: Existing pipeline modification, architecture decisions, data quality analysis
71
+
72
+ ### Step 3: Expert Selection
73
+ Route to appropriate DE expert based on tool/framework detection.
74
+
48
75
  ## Command Routing
49
76
 
50
77
  ```
@@ -242,19 +269,6 @@ Delegate to mgr-creator with context:
242
269
  - Unfamiliar data formats or connectors
243
270
  - Data tool detected in project but no specialist agent
244
271
 
245
- ## Agent Teams Awareness
246
-
247
- Before routing via Task tool, check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or TeamCreate/SendMessage tools present).
248
-
249
- **Self-check:** Does this task need 3+ agents, shared state, or inter-agent communication? If yes, prefer Agent Teams over Task tool. See R018 for the full decision matrix.
250
-
251
- | Scenario | Preferred |
252
- |----------|-----------|
253
- | Single-tool DE task | Task Tool |
254
- | Multi-tool pipeline design (3+ tools) | Agent Teams |
255
- | Cross-tool data quality analysis | Agent Teams |
256
- | Quick DAG/model validation | Task Tool |
257
-
258
272
  ## Usage
259
273
 
260
274
  This skill is NOT user-invocable. It should be automatically triggered when the main conversation detects data engineering intent.
@@ -73,6 +73,36 @@ user-invocable: false
73
73
  | Code review/implementation | sonnet |
74
74
  | Quick validation/search | haiku |
75
75
 
76
+ ## Routing Decision (Priority Order)
77
+
78
+ Before selecting an expert agent, evaluate in this order:
79
+
80
+ ### Step 1: Agent Teams Eligibility (R018)
81
+ Check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or TeamCreate/SendMessage tools present).
82
+
83
+ | Scenario | Preferred |
84
+ |----------|-----------|
85
+ | Single-language review | Task Tool |
86
+ | Multi-language code review (3+) | Agent Teams |
87
+ | Code review + fix cycle | Agent Teams |
88
+ | Cross-layer debugging (FE + BE + DB) | Agent Teams |
89
+ | Simple file search/validation | Task Tool |
90
+
91
+ ### Step 2: Codex-Exec Hybrid (Implementation Tasks)
92
+ For **new file creation**, **boilerplate**, or **test code generation**:
93
+
94
+ 1. Check `/tmp/.claude-env-status-*` for codex availability
95
+ 2. If codex available → suggest hybrid workflow:
96
+ - codex-exec generates initial code (strength: fast generation)
97
+ - Claude expert reviews and refines (strength: reasoning, quality)
98
+ 3. If codex unavailable → use Claude expert directly
99
+
100
+ **Suitable**: New file creation, boilerplate, scaffolding, test code
101
+ **Unsuitable**: Existing code modification, architecture decisions, bug fixes
102
+
103
+ ### Step 3: Expert Agent Selection
104
+ Route to appropriate language/framework expert based on file extension and keyword mapping.
105
+
76
106
  ## Routing Rules
77
107
 
78
108
  Multi-language: detect all languages, route to parallel experts (max 4). Single-language: route to matching expert. Cross-layer (frontend + backend): multiple experts in parallel.
@@ -100,18 +130,4 @@ Delegate to mgr-creator with context:
100
130
  - New framework keyword (e.g., "Flutter 앱 리뷰해줘", "Rails API 만들어줘")
101
131
  - Language detected but no specialist exists
102
132
 
103
- ## Agent Teams Awareness
104
-
105
- Before routing via Task tool, check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or TeamCreate/SendMessage tools present).
106
-
107
- **Self-check:** Does this task need 3+ agents, shared state, or inter-agent communication? If yes, prefer Agent Teams over Task tool. See R018 for the full decision matrix.
108
-
109
- | Scenario | Preferred |
110
- |----------|-----------|
111
- | Single-language review | Task Tool |
112
- | Multi-language code review (3+) | Agent Teams |
113
- | Code review + fix cycle | Agent Teams |
114
- | Cross-layer debugging (FE + BE + DB) | Agent Teams |
115
- | Simple file search/validation | Task Tool |
116
-
117
133
  Not user-invocable. Auto-triggered on development intent.
@@ -322,7 +322,36 @@ agents:
322
322
  - gather
323
323
  base_confidence: 50
324
324
  action_weight: 30
325
- routing_note: "Uses codex-exec skill with xhigh effort when available, falls back to WebFetch/WebSearch"
325
+ routing_rule: "MUST use codex-exec --effort xhigh when codex available, fallback to WebFetch/WebSearch"
326
+
327
+ # ---------------------------------------------------------------------------
328
+ # Code Generation (hybrid workflow, skill-based)
329
+ # ---------------------------------------------------------------------------
330
+ code-generation-workflow:
331
+ keywords:
332
+ korean:
333
+ - 구현
334
+ - 만들어
335
+ - 생성해
336
+ - 작성해
337
+ - 스캐폴딩
338
+ - 보일러플레이트
339
+ english:
340
+ - implement
341
+ - create
342
+ - generate
343
+ - scaffold
344
+ - boilerplate
345
+ - "write code"
346
+ file_patterns: []
347
+ supported_actions:
348
+ - implement
349
+ - create
350
+ - generate
351
+ - scaffold
352
+ base_confidence: 30
353
+ action_weight: 25
354
+ routing_rule: "Suggest codex-exec hybrid when codex available and task is new file creation"
326
355
 
327
356
  # Managers (continued)
328
357
  mgr-gitnerd:
@@ -374,4 +403,3 @@ agents:
374
403
  file_patterns: []
375
404
  supported_actions: [manage, create, coordinate]
376
405
  base_confidence: 40
377
-
@@ -18,6 +18,19 @@ Coordinates QA team activities by routing tasks to qa-planner, qa-writer, and qa
18
18
  | qa-writer | Documentation | Test cases, test reports, templates |
19
19
  | qa-engineer | Execution | Test results, defect reports, coverage reports |
20
20
 
21
+ ## Routing Decision (Priority Order)
22
+
23
+ Before routing via Task tool, evaluate Agent Teams eligibility first:
24
+
25
+ **Self-check:** Does this task need 3+ agents, shared state, or inter-agent communication? If yes, prefer Agent Teams over Task tool. See R018 for the full decision matrix.
26
+
27
+ | Scenario | Preferred |
28
+ |----------|-----------|
29
+ | Single QA phase (plan/write/execute) | Task Tool |
30
+ | Full QA cycle (plan + write + execute + report) | Agent Teams |
31
+ | Quality analysis (parallel strategy + results) | Agent Teams |
32
+ | Quick test validation | Task Tool |
33
+
21
34
  ## Command Routing
22
35
 
23
36
  ```
@@ -287,19 +300,6 @@ Delegate to mgr-creator with context:
287
300
  - Specialized QA methodologies (e.g., "뮤테이션 테스트 전략 만들어줘")
288
301
  - Performance/security testing tools not covered by existing agents
289
302
 
290
- ## Agent Teams Awareness
291
-
292
- Before routing via Task tool, check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or TeamCreate/SendMessage tools present).
293
-
294
- **Self-check:** Does this task need 3+ agents, shared state, or inter-agent communication? If yes, prefer Agent Teams over Task tool. See R018 for the full decision matrix.
295
-
296
- | Scenario | Preferred |
297
- |----------|-----------|
298
- | Single QA phase (plan/write/execute) | Task Tool |
299
- | Full QA cycle (plan + write + execute + report) | Agent Teams |
300
- | Quality analysis (parallel strategy + results) | Agent Teams |
301
- | Quick test validation | Task Tool |
302
-
303
303
  ## Usage
304
304
 
305
305
  This skill is NOT user-invocable. It should be automatically triggered when the main conversation detects QA intent.
@@ -23,6 +23,19 @@ Routes agent management tasks to the appropriate manager agent. This skill conta
23
23
  | sys-memory-keeper | Memory operations | "save memory", "recall", "memory search" |
24
24
  | sys-naggy | TODO management | "todo", "track tasks", "task list" |
25
25
 
26
+ ## Routing Decision (Priority Order)
27
+
28
+ Before routing via Task tool, evaluate Agent Teams eligibility first:
29
+
30
+ **Self-check:** Does this task need 3+ agents, shared state, or inter-agent communication? If yes, prefer Agent Teams over Task tool. See R018 for the full decision matrix.
31
+
32
+ | Scenario | Preferred |
33
+ |----------|-----------|
34
+ | Single manager task | Task Tool |
35
+ | Batch agent creation (3+) | Agent Teams |
36
+ | Multi-round verification (sauron) | Task Tool |
37
+ | Agent audit + fix cycle | Agent Teams |
38
+
26
39
  ## Command Routing
27
40
 
28
41
  ```
@@ -76,19 +89,6 @@ When command requires multiple independent operations:
76
89
  | sys-memory-keeper | sonnet | Memory operations, search |
77
90
  | sys-naggy | haiku | Simple TODO tracking |
78
91
 
79
- ## Agent Teams Awareness
80
-
81
- Before routing via Task tool, check if Agent Teams is available (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` or TeamCreate/SendMessage tools present).
82
-
83
- **Self-check:** Does this task need 3+ agents, shared state, or inter-agent communication? If yes, prefer Agent Teams over Task tool. See R018 for the full decision matrix.
84
-
85
- | Scenario | Preferred |
86
- |----------|-----------|
87
- | Single manager task | Task Tool |
88
- | Batch agent creation (3+) | Agent Teams |
89
- | Multi-round verification (sauron) | Task Tool |
90
- | Agent audit + fix cycle | Agent Teams |
91
-
92
92
  ## No Match Fallback
93
93
 
94
94
  When no manager agent matches the request but the task is clearly management-related:
@@ -77,6 +77,15 @@ A PreToolUse hook in `.claude/hooks/hooks.json` checks this marker and blocks Wr
77
77
  └── Output: Implementation complete
78
78
  ```
79
79
 
80
+ **Codex-Exec Hybrid Option**: When entering Stage 3:
81
+ 1. Check `/tmp/.claude-env-status-*` for codex CLI availability
82
+ 2. If available AND task involves new file creation:
83
+ - Suggest: `[Codex Hybrid Available] New file generation can use codex-exec for faster scaffolding. Orchestrator may delegate initial code generation to codex-exec, then have Claude expert review.`
84
+ 3. If unavailable → proceed with standard implementation via Claude experts
85
+
86
+ Suitable for codex hybrid: new files, boilerplate, test stubs, scaffolding
87
+ Not suitable: modifying existing code, architecture-dependent changes
88
+
80
89
  **Exit criteria**: All planned files created/modified, tests written.
81
90
 
82
91
  ### Stage 4: Verify Implementation
@@ -127,12 +136,14 @@ Stage 2 (Verify Plan) and Stage 4 (Verify Implementation) can invoke the `multi-
127
136
  The stage marker file (`/tmp/.claude-dev-stage`) is read by a PreToolUse hook that enforces tool restrictions. This provides a safety net beyond instruction-based compliance.
128
137
 
129
138
  ### With Agent Teams
130
- For complex tasks, each stage can be handled by specialized team members:
139
+ For complex tasks, Agent Teams is **preferred** when available (R018):
131
140
  - Plan: architect agent
132
- - Verify: reviewer agent(s)
133
- - Implement: domain expert agent
141
+ - Verify: reviewer agent(s) — multi-model-verification via Agent Teams
142
+ - Implement: domain expert agent (+ codex-exec hybrid if available)
134
143
  - Compound: QA agent
135
144
 
145
+ When Agent Teams is enabled AND task involves 3+ agents or review→fix cycles, using Agent Teams is MANDATORY per R018.
146
+
136
147
  ## When to Use
137
148
 
138
149
  | Task Complexity | Recommended Cycle |
@@ -0,0 +1,10 @@
1
+ {
2
+ "description": "Files deprecated or renamed in this version. These will be removed during omcustom update.",
3
+ "files": [
4
+ {
5
+ "path": ".claude/rules/SHOULD-agent-teams.md",
6
+ "reason": "Renamed to MUST-agent-teams.md",
7
+ "since": "0.17.0"
8
+ }
9
+ ]
10
+ }