oh-my-customcodex 0.5.7 → 0.5.9

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 (38) hide show
  1. package/README.md +4 -4
  2. package/dist/cli/index.js +1 -1
  3. package/dist/index.js +1 -1
  4. package/package.json +1 -1
  5. package/templates/.claude/agents/arch-speckit-agent.md +1 -1
  6. package/templates/.claude/agents/sys-memory-keeper.md +9 -9
  7. package/templates/.claude/hooks/scripts/agent-teams-advisor.sh +4 -1
  8. package/templates/.claude/ontology/agents.yaml +16 -4
  9. package/templates/.claude/ontology/skills.yaml +9 -9
  10. package/templates/.claude/rules/MUST-agent-teams.md +85 -246
  11. package/templates/.claude/rules/SHOULD-memory-integration.md +4 -5
  12. package/templates/.claude/skills/de-lead-routing/SKILL.md +6 -13
  13. package/templates/.claude/skills/dev-lead-routing/SKILL.md +6 -13
  14. package/templates/.claude/skills/intent-detection/SKILL.md +7 -9
  15. package/templates/.claude/skills/memory-management/SKILL.md +7 -12
  16. package/templates/.claude/skills/memory-recall/SKILL.md +2 -2
  17. package/templates/.claude/skills/memory-save/SKILL.md +2 -2
  18. package/templates/.claude/skills/peer-messaging/SKILL.md +2 -2
  19. package/templates/.claude/skills/research/SKILL.md +8 -23
  20. package/templates/.claude/skills/roundtable-debate/SKILL.md +3 -4
  21. package/templates/.claude/skills/structured-dev-cycle/SKILL.md +7 -10
  22. package/templates/AGENTS.md.en +1 -2
  23. package/templates/AGENTS.md.ko +1 -2
  24. package/templates/CLAUDE.md +2 -2
  25. package/templates/CLAUDE.md.en +1 -2
  26. package/templates/CLAUDE.md.ko +1 -2
  27. package/templates/README.md +2 -2
  28. package/templates/guides/agentmemory-migration/measure-step-zero.md +13 -113
  29. package/templates/guides/agentmemory-migration/phase-1-coexist.md +18 -252
  30. package/templates/guides/index.yaml +1 -1
  31. package/templates/guides/multi-agent-debate-patterns/README.md +1 -1
  32. package/templates/guides/multi-provider-exec/README.md +9 -79
  33. package/templates/manifest.json +3 -3
  34. package/templates/.claude/skills/agora/SKILL.md +0 -209
  35. package/templates/.claude/skills/codex-exec/SKILL.md +0 -218
  36. package/templates/.claude/skills/codex-exec/scripts/codex-wrapper.cjs +0 -433
  37. package/templates/.claude/skills/gemini-exec/SKILL.md +0 -215
  38. package/templates/.claude/skills/gemini-exec/scripts/gemini-wrapper.cjs +0 -485
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  **[한국어 문서 (Korean)](./README_ko.md)**
15
15
 
16
- 50 agents. 123 skills. 22 rules. One command.
16
+ 50 agents. 120 skills. 22 rules. One command.
17
17
 
18
18
  ```bash
19
19
  npm install -g oh-my-customcodex && cd your-project && omcustomcodex init
@@ -135,7 +135,7 @@ Each agent declares its tools, model, memory scope, and limitations in YAML fron
135
135
 
136
136
  ---
137
137
 
138
- ### Skills (123)
138
+ ### Skills (120)
139
139
 
140
140
  | Category | Count | Includes |
141
141
  |----------|-------|----------|
@@ -148,7 +148,7 @@ Each agent declares its tools, model, memory scope, and limitations in YAML fron
148
148
  | Package | 3 | npm-publish, npm-version, npm-audit |
149
149
  | Optimization | 3 | optimize-analyze, optimize-bundle, optimize-report |
150
150
  | Security | 3 | adversarial-review, cve-triage, jinja2-prompts |
151
- | Other | 13 | codex-exec, claude-native, gitlab, visual-ralph, visual-verdict, vercel-deploy, skills-sh-search, result-aggregation, writing-clearly-and-concisely, and more |
151
+ | Other | 10 | claude-native, gitlab, visual-ralph, visual-verdict, vercel-deploy, skills-sh-search, result-aggregation, writing-clearly-and-concisely, and more |
152
152
 
153
153
  Skills use a 3-tier scope system: `core` (universal), `harness` (agent/skill maintenance), `package` (project-specific).
154
154
 
@@ -288,7 +288,7 @@ your-project/
288
288
  │ ├── contexts/ # 4 shared context files
289
289
  │ └── ontology/ # Knowledge graph for RAG
290
290
  ├── .agents/
291
- │ └── skills/ # 123 installed skill modules
291
+ │ └── skills/ # 120 installed skill modules
292
292
  └── guides/ # 51 reference documents
293
293
  ```
294
294
 
package/dist/cli/index.js CHANGED
@@ -3091,7 +3091,7 @@ var init_package = __esm(() => {
3091
3091
  workspaces: [
3092
3092
  "packages/*"
3093
3093
  ],
3094
- version: "0.5.7",
3094
+ version: "0.5.9",
3095
3095
  requiresCC: ">=2.1.121",
3096
3096
  claudeCode: {
3097
3097
  minimumVersion: "2.1.121",
package/dist/index.js CHANGED
@@ -2316,7 +2316,7 @@ var package_default = {
2316
2316
  workspaces: [
2317
2317
  "packages/*"
2318
2318
  ],
2319
- version: "0.5.7",
2319
+ version: "0.5.9",
2320
2320
  requiresCC: ">=2.1.121",
2321
2321
  claudeCode: {
2322
2322
  minimumVersion: "2.1.121",
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "workspaces": [
4
4
  "packages/*"
5
5
  ],
6
- "version": "0.5.7",
6
+ "version": "0.5.9",
7
7
  "requiresCC": ">=2.1.121",
8
8
  "claudeCode": {
9
9
  "minimumVersion": "2.1.121",
@@ -60,7 +60,7 @@ When writing acceptance criteria, use the EARS (Easy Approach to Requirements Sy
60
60
  | Ubiquitous | The `<system>` shall `<action>` | The validator shall reject invalid frontmatter |
61
61
  | Event-driven | When `<event>`, the `<system>` shall `<action>` | When a new agent is created, the routing skill shall update its pattern table |
62
62
  | State-driven | While `<state>`, the `<system>` shall `<action>` | While ecomode is active, agents shall use concise output format |
63
- | Optional | Where `<condition>`, the `<system>` shall `<action>` | Where the user has MCP configured, the orchestrator shall attempt claude-mem save |
63
+ | Optional | Where `<condition>`, the `<system>` shall `<action>` | Where the user has an approved memory MCP configured, the orchestrator shall attempt searchable memory save |
64
64
  | Complex | When `<event>` while `<state>` where `<condition>`, the `<system>` shall `<action>`, resulting in `<result>` | When session ends while Agent Teams is active where tasks remain incomplete, the orchestrator shall log incomplete tasks, resulting in a task summary |
65
65
 
66
66
  **Usage**: Apply EARS format in spec output's `invariants` and `acceptance_criteria` sections. This ensures testable, unambiguous requirements.
@@ -27,26 +27,26 @@ permissionMode: bypassPermissions
27
27
 
28
28
  When a task targets `.claude/**`, `templates/.claude/**`, or other Claude-compatibility mirrors, treat the old `/tmp` wrapper as legacy fallback only. Codex-native `.codex/**` edits stay direct, and Claude Code `bypassPermissions` can write `.claude/skills/`, `.claude/agents/`, and `.claude/commands/` directly on v2.1.121+, with broader protected-path coverage on v2.1.126+.
29
29
 
30
- You are a session memory management specialist ensuring context survives across session compactions using claude-mem.
30
+ You are a session memory management specialist ensuring context survives across session compactions using native auto-memory first and optional omx-memory/AgentMemory-compatible searchable backends.
31
31
 
32
32
  ## Capabilities
33
33
 
34
34
  - Save session context before compaction
35
35
  - Restore context on session start
36
- - Query memories by project and semantic search
37
- - Tag memories with project, session, and task info
36
+ - Query native and configured searchable memory by project and semantic search
37
+ - Tag memory summaries with project, session, and task info
38
38
 
39
39
  ## Save Operation
40
40
 
41
- Collect tasks, decisions, open items, code changes. Format with metadata (project, session, tags, timestamp). Store via chroma_add_documents.
41
+ Collect tasks, decisions, open items, and code changes. Format with metadata (project, session, tags, timestamp). Return the summary to the orchestrator for optional `memory_add` or `observation_add` persistence.
42
42
 
43
43
  ## Recall Operation
44
44
 
45
- Build semantic query with project prefix + keywords + optional date. Search via chroma_query_documents. Filter by relevance, return summary.
45
+ Build semantic query with project prefix + keywords + optional date. Prefer native MEMORY.md and configured `memory_search`/`memory_read` tools. Filter by relevance and return a summary.
46
46
 
47
47
  ## Query Guidelines
48
48
 
49
- Always include project name. Use task-based, temporal, or topic-based queries. Avoid complex where filters (they fail in Chroma).
49
+ Always include project name. Use task-based, temporal, or topic-based queries. Avoid backend-specific filter syntax unless the configured memory MCP documents it.
50
50
 
51
51
  ## Native MEMORY.md Compaction
52
52
 
@@ -60,7 +60,7 @@ Treat native auto-memory as an index, not a transcript. Keep the first 200 loade
60
60
 
61
61
  ## Config
62
62
 
63
- Provider: claude-mem | Collection: claude_memories | Archive: ~/.claude-mem/archives/
63
+ Provider order: native MEMORY.md first; optional omx-memory or AgentMemory-compatible MCP only when a searchable backend is configured. Deprecated Chroma memory providers are intentionally not used.
64
64
 
65
65
  ## Session-End Auto-Save
66
66
 
@@ -75,9 +75,9 @@ When triggered by session-end signal from orchestrator:
75
75
  - Existing behaviors observed again → promote confidence level
76
76
  - Contradicted behaviors → flag for review or demote
77
77
  3. **Update native auto-memory** (MEMORY.md) with session learnings + behaviors
78
- 4. **Return formatted summary** to orchestrator for MCP persistence (claude-mem, episodic-memory)
78
+ 4. **Return formatted summary** to orchestrator for optional MCP persistence (omx-memory/AgentMemory-compatible backends; episodic indexing is automatic when configured)
79
79
 
80
- > **Note**: MCP tools (claude-mem, episodic-memory) are orchestrator-scoped and cannot be called from subagents. The orchestrator handles MCP saves directly after receiving the formatted summary.
80
+ > **Note**: MCP tools are orchestrator-scoped and cannot be called from subagents. The orchestrator handles searchable memory saves directly after receiving the formatted summary.
81
81
 
82
82
  ### Confidence Decay Check
83
83
 
@@ -57,7 +57,8 @@ echo "$COUNT" > "$COUNTER_FILE"
57
57
  if [ "$BATCH_ISSUES" -ge 3 ] && [ "$COUNT" -eq 1 ]; then
58
58
  echo "" >&2
59
59
  echo "--- [R018 Advisor] Batch context detected (${BATCH_ISSUES} issues) ---" >&2
60
- echo " RECOMMENDATION: Use Agent Teams (TeamCreate) for this batch." >&2
60
+ echo " RECOMMENDATION: Use Agent Teams (TeamCreate) for this batch unless work is a mechanical disjoint-file refactor with explicit write scopes." >&2
61
+ echo " VERIFY DONE WITH: git diff/status, rg/grep, scripts/tests; team task status is advisory only." >&2
61
62
  echo " Current: Agent(${agent_type}) -- ${prompt_preview}" >&2
62
63
  echo "-----------------------------------------------------------" >&2
63
64
  elif [ "$COUNT" -ge 2 ]; then
@@ -67,6 +68,8 @@ elif [ "$COUNT" -ge 2 ]; then
67
68
  echo " * 3+ agents needed for this work" >&2
68
69
  echo " * Review -> fix -> re-review cycle exists" >&2
69
70
  echo " * Agents need shared state or coordination" >&2
71
+ echo " NOTE: For mechanical disjoint-file refactors, bounded standalone agents may avoid Team runtime overhead." >&2
72
+ echo " VERIFY DONE WITH: git diff/status, rg/grep, scripts/tests; task status alone is not proof." >&2
70
73
  echo " Current: Agent(${agent_type}) -- ${prompt_preview}" >&2
71
74
  echo "-----------------------------------------------------------" >&2
72
75
  fi
@@ -39,7 +39,7 @@ classes:
39
39
  agents: [scholastic]
40
40
  description: "Reasoning, critique, and coordination specialists"
41
41
  SystemAgent:
42
- agents: [sys-memory-keeper, sys-naggy]
42
+ agents: [sys-memory-keeper, sys-naggy, tracker-checkpoint]
43
43
  description: "System utility agents"
44
44
 
45
45
  # Agent instances
@@ -526,14 +526,14 @@ agents:
526
526
 
527
527
  sys-memory-keeper:
528
528
  class: SystemAgent
529
- description: "Use when you need to manage session memory persistence using claude-mem, save context before compaction, restore context on session start, or query past memories"
529
+ description: "Use when you need to manage session memory persistence using native memory plus omx-memory, save context before compaction, restore context on session start, or query past memories"
530
530
  model: sonnet
531
531
  memory: project
532
532
  effort: medium
533
533
  skills: [memory-management, memory-save, memory-recall]
534
534
  tools: [Read, Write, Edit, Grep, Glob, Bash]
535
- summary: "Session memory manager for context persistence with claude-mem"
536
- keywords: [memory, persistence, claude-mem, context, session, recall, chroma, semantic-search]
535
+ summary: "Session memory manager for native memory and approved searchable persistence"
536
+ keywords: [memory, persistence, omx-memory, context, session, recall, semantic-search]
537
537
  file_patterns: []
538
538
 
539
539
  sys-naggy:
@@ -548,6 +548,18 @@ agents:
548
548
  keywords: [todo, tasks, reminders, tracking, deadlines, project-momentum]
549
549
  file_patterns: ["TODO.md", "*.todo"]
550
550
 
551
+ tracker-checkpoint:
552
+ class: SystemAgent
553
+ description: "Use when pipeline or DAG execution needs checkpoint persistence, state transition validation, or resume-after-failure support"
554
+ model: sonnet
555
+ memory: project
556
+ effort: medium
557
+ skills: [dag-orchestration, pipeline-guards]
558
+ tools: [Read, Write, Edit, Grep, Glob, Bash]
559
+ summary: "Pipeline checkpoint tracker for resumable DAG and pipeline state"
560
+ keywords: [pipeline, checkpoint, resume, dag, state, tracker]
561
+ file_patterns: ["/tmp/.codex-pipeline-*.json", "/tmp/.codex-dag-*.json"]
562
+
551
563
  scholastic:
552
564
  class: CoordinationAgent
553
565
  description: "Ontology-first reasoning reviewer for category mistakes, hidden assumptions, modality separation, scholastic critique, and minimal-repair proposals."
@@ -292,29 +292,29 @@ skills:
292
292
 
293
293
  memory-management:
294
294
  class: MemorySkill
295
- description: "Memory persistence operations using claude-mem"
295
+ description: "Memory persistence operations using native memory plus omx-memory"
296
296
  user_invocable: false
297
297
  model_invocable: true
298
- summary: "Provide memory persistence operations using claude-mem for session context"
299
- keywords: [memory, claude-mem, persistence, session, context]
298
+ summary: "Provide memory persistence operations using native memory and approved searchable backends for session context"
299
+ keywords: [memory, omx-memory, persistence, session, context]
300
300
  rule_references: [R011]
301
301
 
302
302
  memory-recall:
303
303
  class: MemorySkill
304
- description: "Search and recall memories from claude-mem"
304
+ description: "Search and recall memories from native memory plus omx-memory"
305
305
  user_invocable: true
306
306
  model_invocable: true
307
- summary: "Search and recall relevant memories from claude-mem using semantic search"
308
- keywords: [memory, recall, search, semantic, claude-mem]
307
+ summary: "Search and recall relevant memories from approved searchable backends"
308
+ keywords: [memory, recall, search, semantic, omx-memory]
309
309
  rule_references: [R011]
310
310
 
311
311
  memory-save:
312
312
  class: MemorySkill
313
- description: "Save current session context to claude-mem"
313
+ description: "Save current session context to native memory plus omx-memory"
314
314
  user_invocable: true
315
315
  model_invocable: false
316
- summary: "Save current session context to claude-mem for persistence across compaction"
317
- keywords: [memory, save, session, context, claude-mem]
316
+ summary: "Save current session context to native memory and approved searchable backends"
317
+ keywords: [memory, save, session, context, omx-memory]
318
318
  rule_references: [R011]
319
319
 
320
320
  monitoring-setup:
@@ -6,296 +6,135 @@
6
6
 
7
7
  ## Detection
8
8
 
9
- Available when `OMCODEX_AGENT_TEAMS=1` or TeamCreate/SendMessage tools present.
9
+ Available when `OMCODEX_AGENT_TEAMS=1` or `TeamCreate` / `SendMessage` exists.
10
10
 
11
11
  ## Decision Matrix
12
12
 
13
13
  | Scenario | Preferred | Reason |
14
14
  |----------|-----------|--------|
15
15
  | Simple independent subtasks | Agent Tool | Lower cost, no coordination overhead |
16
- | Sequential-dependency init/scaffolding | Agent Tool | Blocked agents waste tokens polling; single agent faster |
16
+ | Mechanical disjoint-file refactors/deletions | Agent Tool | Explicit write scopes can avoid Team runtime overhead/stalls |
17
+ | Sequential-dependency init/scaffolding | Agent Tool | Avoid blocked agents polling |
17
18
  | Multi-step with shared state | **Agent Teams** | Shared task list, peer messaging |
18
- | Research requiring discussion | **Agent Teams** | Iterative discovery, synthesis |
19
- | Cost-sensitive batch ops | Agent Tool | Minimal token overhead |
19
+ | Research requiring discussion | **Agent Teams** | Iterative discovery and synthesis |
20
20
  | Complex debugging across modules | **Agent Teams** | Cross-module state sharing |
21
21
  | Code review + fix cycle | **Agent Teams** | Review → fix → re-review loop |
22
- | Single file operations | Agent Tool | Overkill for simple tasks |
23
22
  | Dynamic agent creation + usage | **Agent Teams** | Create → test → iterate cycle |
24
- | Multi-issue release batch | **Agent Teams** | Shared task tracking, coordinated release |
25
-
26
- **When Agent Teams is enabled and criteria are met, usage is required.**
27
-
28
- ### Scope: Intra-Session vs Cross-Session
29
-
30
- | Scope | Tool | Protocol | Use Case |
31
- |-------|------|----------|----------|
32
- | Intra-session | `SendMessage` (Agent Teams) | Peer-to-peer within team | Multi-agent collaboration in one session |
33
- | Cross-session | `send_message` (claude-peers-mcp) | Broker-mediated | Multi-terminal/project coordination |
34
-
35
- These are distinct mechanisms. Agent Teams `SendMessage` requires `TeamCreate` and operates within a single Claude Code session. claude-peers-mcp `send_message` operates across separate Claude Code processes via a localhost broker.
36
-
37
- ## Self-Check (Before Agent Tool)
38
-
39
- Before using Agent tool for 2+ agent tasks, complete this check:
40
- Quick rule: User explicitly preferred plain subagents this session? → use Agent Tool (R000 user instructions > R018). Otherwise: 3+ agents OR review cycle → use Agent Teams. Sequential deps / scaffolding → Agent Tool. 2+ issues in same batch → prefer Agent Teams.
41
-
42
- <!-- DETAIL: Self-Check (Before Agent Tool)
43
- ╔══════════════════════════════════════════════════════════════════╗
44
- ║ BEFORE USING Agent TOOL FOR 2+ AGENTS: ║
45
- ║ ║
46
- ║ 0. Has user explicitly preferred plain subagents this session?
47
- ║ YES Use Agent tool (R000 user instructions > R018) ║
48
- ║ NO Continue to #1 ║
49
- ║ ║
50
- ║ 1. Is Agent Teams available? ║
51
- ║ YES → check criteria #2-#5 ║
52
- ║ NO → Proceed with Agent tool ║
53
- ║ ║
54
- ║ 2. Will 3+ agents be involved? ║
55
- ║ YES → use Agent Teams ║
56
- ║ NO → Check #3 ║
57
- ║ ║
58
- ║ 3. Is there a review → fix → re-review cycle? ║
59
- ║ YES → use Agent Teams ║
60
- ║ NO → Check #4 ║
61
- ║ ║
62
- ║ 4. Are 2+ issues being fixed in the same release batch? ║
63
- ║ YES → prefer Agent Teams (coordination benefit) ║
64
- ║ NO → Check #5 ║
65
- ║ ║
66
- ║ 5. Are tasks sequentially dependent (init/scaffold)? ║
67
- ║ YES → prefer Agent Tool (single agent, no coordination) ║
68
- ║ NO → Continue with Agent Teams ║
69
- ║ ║
70
- ║ Simple rule: 3+ agents OR review cycle → use Agent Teams ║
71
- ║ Sequential deps / scaffolding → Agent Tool (single agent) ║
72
- ║ 2+ issues in same batch → prefer Agent Teams ║
73
- ║ Everything else → Agent tool ║
74
- ╚══════════════════════════════════════════════════════════════════╝
23
+ | Multi-issue release batch | **Agent Teams** | Shared task tracking and coordinated release |
24
+
25
+ When enabled and criteria match, Agent Teams is required.
26
+
27
+ ## Scope: Intra-Session vs Cross-Session
28
+
29
+ | Scope | Tool | Use Case |
30
+ |-------|------|----------|
31
+ | Intra-session | `SendMessage` (Agent Teams) | Multi-agent collaboration in one session |
32
+ | Cross-session | `send_message` (claude-peers-mcp) | Multi-terminal/project coordination |
33
+
34
+ Do not confuse these mechanisms.
35
+
36
+ ## Self-Check Before Agent Tool
37
+
38
+ Quick rule: explicit user preference for plain subagents wins. Otherwise use Teams for 3+ agents, review cycles, shared state, complex debugging, dynamic creation, or multi-issue batches; use Agent Tool for 1-2 simple tasks, sequential scaffolding, or mechanical disjoint-file batches with explicit scopes.
39
+
40
+ <!-- DETAIL: Self-Check Before Agent Tool
41
+ 0. Did the user explicitly prefer plain subagents this session? YES → Agent Tool.
42
+ 1. Is Agent Teams unavailable? YES → Agent Tool with R009/R010.
43
+ 2. Will 3+ agents be involved? YES → Agent Teams.
44
+ 3. Is there a review → fix → re-review cycle? YES → Agent Teams.
45
+ 4. Are 2+ issues fixed in the same release batch? YES → prefer Agent Teams.
46
+ 5. Are tasks sequentially dependent init/scaffold work? YES Agent Tool.
47
+ 6. Is this a mechanical disjoint-file refactor/deletion batch with explicit write scopes where Team runtime overhead or stall risk exceeds coordination value? YES Agent Tool allowed.
48
+ 7. Otherwise, use Agent Teams when collaboration or shared state has material value.
75
49
  -->
76
50
 
77
- ### Spawn Completeness Check
78
-
79
- All members must be spawned in a single message. Partial spawning needs correction per R018 and R009.
80
-
81
- <!-- DETAIL: Self-Check (Spawn Completeness)
82
- ╔══════════════════════════════════════════════════════════════════╗
83
- ║ BEFORE SPAWNING TEAM MEMBERS: ║
84
- ║ ║
85
- ║ 1. How many members does this team need? N = ___ ║
86
- ║ 2. Am I spawning ALL N members in THIS message? ║
87
- ║ YES → Good. Continue. ║
88
- ║ NO → Spawn all N members in this message before proceeding. ║
89
- ║ ║
90
- ║ Partial spawn (e.g., 1/3) = needs correction ║
91
- ║ Sequential spawn (one per message) = needs correction ║
92
- ║ All at once in single message = correct ║
93
- ╚══════════════════════════════════════════════════════════════════╝
51
+ ## Spawn Completeness
52
+
53
+ Spawn all members for a parallel team slice in one message; partial/sequential spawning needs correction.
54
+
55
+ <!-- DETAIL: Spawn Completeness
56
+ Before spawning, count required members (N) and spawn all N in one message. Partial spawn (1/N) and one-member-per-message sequencing break the team contract because early workers begin without the intended peer set and shared coordination context.
94
57
  -->
95
58
 
96
- <!-- DETAIL: External Skill Conflict Resolution
97
- When an external skill instructs using Agent tool but R018 criteria are met:
59
+ ## External Skill Conflict Resolution
98
60
 
99
- | Skill says | R018 requires | Resolution |
100
- |------------|--------------|------------|
101
- | "Use Agent tool for N tasks" | 3+ agents → Teams | Use Agent Teams, follow skill logic |
102
- | "Sequential agent spawning" | Independent tasks → parallel | Parallelize per R009 |
103
- | "Skip coordination" | Shared state → Teams | Use Teams for coordination |
61
+ External skills define workflow; R018 defines execution method. Keep skill logic but use Teams when R018 criteria match.
104
62
 
105
- Rule: External skills define the WORKFLOW. R018 defines the EXECUTION METHOD.
106
- The skill's steps are followed, but agent spawning uses Teams when criteria are met.
63
+ <!-- DETAIL: External Skill Conflict Resolution
64
+ Examples:
65
+ - Skill says “Use Agent tool for N tasks”; R018 says 3+ agents → use Agent Teams.
66
+ - Skill suggests sequential spawning; R009 says independent tasks → spawn in parallel.
67
+ - Skill says “skip coordination”; shared state/review cycles → use Team coordination.
68
+ -->
69
+
70
+ ## Retrospective Hardening
71
+
72
+ - Mechanical disjoint-file refactors/deletions may use standalone parallel agents when prompts have explicit write scopes and Team runtime overhead or stall risk outweighs coordination value.
73
+ - Agent Teams task status is advisory only; verify completion with deterministic evidence such as `git diff`, `git status`, search, scripts, tests, or build output.
74
+ - Split giant delegated prompts by domain, file group, and write scope so assignees can finish without touching another agent's files.
75
+ - Do not misuse `AskUserQuestion` or other user-facing prompts for internal coordination; use peer channels, runtime state, or repository evidence.
76
+ - In zsh snippets, avoid the reserved `status` variable; use names like `exit_status` or `cmd_status`.
77
+
78
+ <!-- DETAIL: Retrospective Hardening
79
+ #1430/#1431 hardening intent:
80
+ - Mechanical disjoint-file batches are not inherently collaborative. Standalone agents may be safer when each owns a non-overlapping file set and Team runtime coordination would add token cost, idle polling, or stall risk.
81
+ - Team task status, TaskList state, member status, and peer claims are coordination signals, not proof. The orchestrator must confirm outcomes through repository state and repeatable commands before declaring completion.
82
+ - Giant prompts create cross-scope edits and confused ownership. Split by domain/file group/write scope, include explicit boundaries, and require agents to report rather than self-assign extra work.
83
+ - AskUserQuestion is for human decisions, not internal agent coordination. Internal coordination belongs in Agent Teams peer messages, cross-session peer messaging, runtime state, or direct repo evidence.
84
+ - zsh reserves `status`; shell snippets that assign to it can fail. Use `exit_status`, `cmd_status`, or another non-reserved name.
107
85
  -->
108
86
 
109
87
  ## Common Violations
110
88
 
111
- ```
112
- ❌ WRONG: 3+ tasks using Agent tool instead of Agent Teams
113
- Agent(Explore):haiku Analysis 1
114
- Agent(Explore):haiku Analysis 2
115
- Agent(Explore):haiku Analysis 3
116
-
117
- ✓ CORRECT: TeamCreatespawn researchers coordinate via shared task list
118
- TeamCreate("research-team") + Agent(researcher-1/2/3) + SendMessage(coordinate)
119
- ```
120
-
121
- <!-- DETAIL: Common Violations (full examples)
122
- ❌ WRONG: Agent Teams enabled, 3+ research tasks using Agent tool
123
- Agent(Explore):haiku → Analysis 1
124
- Agent(Explore):haiku → Analysis 2
125
- Agent(Explore):haiku → Analysis 3
126
-
127
- ✓ CORRECT: TeamCreate → spawn researchers → coordinate via shared task list
128
- TeamCreate("research-team")
129
- Agent(researcher-1) → Analysis 1 ┐
130
- Agent(researcher-2) → Analysis 2 ├─ Spawned as team members
131
- Agent(researcher-3) → Analysis 3 ┘
132
- SendMessage(coordinate)
133
-
134
- ❌ WRONG: Code review + fix as independent Agents
135
- Agent(reviewer) → "Review code"
136
- (receive result)
137
- Agent(implementer) → "Fix issues"
138
- (receive result)
139
- Agent(reviewer) → "Re-review"
140
-
141
- ✓ CORRECT: Agent Teams for review-fix cycle
142
- TeamCreate("review-fix")
143
- Agent(reviewer) + Agent(implementer) → team members
144
- reviewer → SendMessage(implementer, "issues found")
145
- implementer → fixes → SendMessage(reviewer, "fixed")
146
- reviewer → re-reviews → done
147
-
148
- ❌ WRONG: Spawning team members one at a time
149
- TeamCreate("research-team")
150
- Message 1: Agent(researcher-1) → Analysis 1 (only 1/3 spawned)
151
- Message 2: Agent(researcher-2) → Analysis 2 (late spawn)
152
- Message 3: Agent(researcher-3) → Analysis 3 (late spawn)
153
-
154
- ✓ CORRECT: All members in a single message
155
- TeamCreate("research-team")
156
- Single message:
157
- Agent(researcher-1) → Analysis 1 ┐
158
- Agent(researcher-2) → Analysis 2 ├─ ALL spawned together
159
- Agent(researcher-3) → Analysis 3 ┘
160
-
161
- ❌ WRONG: Completed member modifies other member's files
162
- svelte-projects completes task → browses TaskList → edits agent-teams-advisor.sh (hook-fixer's scope)
163
-
164
- ✓ CORRECT: Completed member reports and waits
165
- svelte-projects completes task → SendMessage("Task complete") → waits silently
89
+ Wrong: 3+ collaborative standalone agents, uncoordinated review/fix loops, or one-at-a-time team spawns. Correct: create team, spawn together, coordinate via `SendMessage`, verify deterministically.
90
+
91
+ <!-- DETAIL: Common Violations
92
+ Wrong: three researchers launched as unrelated Agent calls while Agent Teams is available.
93
+ Correct: TeamCreate("research-team") + researcher-1/2/3 spawned together + SendMessage coordination.
94
+
95
+ Wrong: reviewerimplementerreviewer as disconnected calls.
96
+ Correct: reviewer and implementer are team members; reviewer sends findings, implementer fixes, reviewer re-checks.
97
+
98
+ Wrong: completed member browses TaskList and edits another member's files.
99
+ Correct: completed member reports completion and waits silently unless reassigned by the lead.
166
100
  -->
167
101
 
168
102
  ## Cost Guidelines
169
103
 
170
- | Criteria | Agent Tool | Agent Teams |
171
- |----------|-----------|-------------|
172
- | Agent count | 1-2 | 3+ |
173
- | Inter-task dependency | None | Present |
174
- | Iteration cycles | None | Present (review→fix→re-review) |
175
- | Estimated duration | < 3 min | > 3 min |
176
- | Shared state needed | No | Yes |
104
+ Agent Tool: 1-2 simple independent agents. Agent Teams: 3+ agents, shared state, review cycles, complex work, multi-issue batches, or dynamic creation.
177
105
 
178
106
  ## Team Patterns
179
107
 
180
- Standard: Research (researcher-1 + researcher-2 + synthesizer), Development (implementer + reviewer + tester), Debug (investigator-1 + investigator-2 + fixer).
181
- Hybrid: Review+Fix, Create+Validate, Multi-Expert, Dynamic Creation, Codex Hybrid.
108
+ Common patterns: Research, Development, Debug, Dynamic Creation, and Codex Hybrid.
182
109
 
183
110
  <!-- DETAIL: Team Patterns
184
- ### Standard Patterns
185
- - Research: researcher-1 + researcher-2 + synthesizer
186
- - Development: implementer + reviewer + tester
187
- - Debug: investigator-1 + investigator-2 + fixer
188
-
189
- ### Hybrid Patterns
190
- - Review+Fix: reviewer + implementer (reviewer finds issues → implementer fixes → reviewer re-checks)
191
- - Create+Validate: mgr-creator + qa-engineer (create agent → validate → iterate)
192
- - Multi-Expert: expert-1 + expert-2 + coordinator (cross-domain tasks requiring multiple specialties)
193
-
194
- ### Dynamic Patterns
195
- - Dynamic Creation: mgr-creator + domain-expert (create new agent → immediately use for pending task)
196
- - Codex Hybrid: codex-exec-agent + claude-reviewer (Codex generates → Claude reviews/refines)
197
-
198
- ### Codex-Exec Integration
199
- When both Agent Teams and codex-exec are available:
200
- 1. Claude agent analyzes requirements
201
- 2. codex-exec generates implementation (Codex strength: code generation)
202
- 3. Claude agent reviews and refines (Claude strength: reasoning, quality)
203
- 4. Iterate via team messaging until quality meets standards
204
-
205
- | Step | Agent | Model |
206
- |------|-------|-------|
207
- | Analysis | Claude team member | sonnet/opus |
208
- | Generation | codex-exec | (Codex default) |
209
- | Review | Claude team member | sonnet |
210
- | Refinement | Appropriate expert | sonnet |
211
-
212
- ### Dynamic Agent Creation in Teams
213
- When Agent Teams creates a new agent via mgr-creator:
214
- 1. Team lead identifies missing expertise
215
- 2. Spawns mgr-creator as team member
216
- 3. mgr-creator creates agent with auto-discovered skills
217
- 4. New agent joins team immediately
218
- 5. Team continues with expanded capabilities
111
+ Research: parallel researchers gather evidence; synthesizer merges and checks conflicts.
112
+ Development: implementer changes code, reviewer challenges, tester verifies.
113
+ Debug: investigators isolate causes across modules; fixer implements after evidence converges.
114
+ Dynamic Creation: mgr-creator creates missing expertise, validator checks immediate usability.
115
+ Codex Hybrid: codex-exec generates implementation, Claude team member reviews/refines, then verification closes the loop.
219
116
  -->
220
117
 
221
118
  ## Blocked Agent Behavior
222
119
 
223
- When a team member is blocked: prefer Deferred spawn (no wasted tokens) > Silent wait (short waits) > Reassign (blocked >2 min).
224
- Post-completion: report via SendMessage, wait silently. Do NOT browse TaskList or modify files outside scope.
120
+ Prefer deferred spawn over idle polling. Blocked/completed members wait silently, check infrequently, and never edit outside scope.
225
121
 
226
122
  <!-- DETAIL: Blocked Agent Behavior
227
- | Strategy | When | Benefit |
228
- |----------|------|---------|
229
- | Deferred spawn | Dependency chain is clear | No wasted tokens; spawn after blocker completes |
230
- | Silent wait | Agent already spawned, short wait expected | Minimal overhead |
231
- | Reassign | Agent blocked >2 min with no progress | Reuse agent for unblocked work |
232
-
233
- ### Prompt Guidelines for Team Members
234
- When spawning agents that may be blocked:
235
- 1. Include explicit instruction: "If your task is blocked, wait silently. Do NOT send periodic status messages."
236
- 2. Set check interval: "Check TaskList once per minute, not continuously."
237
- 3. Prefer deferred spawn when the dependency resolution time is unpredictable.
238
- 4. Post-completion instruction: "After completing your task, report via SendMessage and wait. Do NOT explore or modify files outside your scope."
239
- 5. Explicit scope boundary: "Your scope is limited to: {file list or directory}. Do NOT modify files outside this scope."
240
-
241
- ### Anti-Pattern: Idle Polling
242
- ❌ WRONG: Blocked agent sends repeated status messages
243
- docker-dev: "Task #1 still pending..." (×5 messages, wasting tokens)
244
-
245
- ✓ CORRECT: Deferred spawn after dependency resolves
246
- (Task #1 completes) → then spawn docker-dev for Task #3
247
-
248
- ✓ ALSO CORRECT: Silent wait with infrequent checks
249
- docker-dev spawned with: "Wait silently if blocked. Check TaskList once per minute."
250
-
251
- ### Post-Completion Scope Constraint
252
- | Behavior | Correct | Wrong |
253
- |----------|---------|-------|
254
- | Task completed | Report completion via SendMessage, wait silently | Browse TaskList for other work |
255
- | No more tasks | Exit or wait for team shutdown | Explore/modify files outside original scope |
256
- | See unfinished work | Report to team lead, do NOT self-assign | Edit files that belong to other members |
257
-
258
- ### Self-Check (After Task Completion)
259
- ╔══════════════════════════════════════════════════════════════════╗
260
- ║ AFTER COMPLETING YOUR ASSIGNED TASK: ║
261
- ║ ║
262
- ║ 1. Did I complete ONLY my assigned task? ║
263
- ║ YES → Report completion ║
264
- ║ NO → Revert scope-violation changes ║
265
- ║ ║
266
- ║ 2. Are there files modified outside my task scope? ║
267
- ║ YES → This is a violation — revert ║
268
- ║ NO → Good ║
269
- ║ ║
270
- ║ 3. Am I about to explore/modify files for "other tasks"? ║
271
- ║ YES → STOP. Report to team lead instead ║
272
- ║ NO → Good. Wait silently or exit ║
273
- ╚══════════════════════════════════════════════════════════════════╝
123
+ Strategies: defer spawn when dependency chain is clear; silent wait for short blocks; reassign after sustained blocking. Prompts should say: “If blocked, wait silently. Check TaskList at most once per minute. After completing, report via SendMessage and do not browse or edit outside your scope.”
274
124
  -->
275
125
 
276
126
  ## Lifecycle
277
127
 
278
- `TeamCreate → TaskCreate → Agent(spawn members) → SendMessage → TaskUpdate → ... → TeamDelete`. See full lifecycle via Read tool.
128
+ `TeamCreate → TaskCreate → Agent(spawn members) → SendMessage → TaskUpdate → ... → TeamDelete`.
279
129
 
280
130
  <!-- DETAIL: Lifecycle diagram
281
- ```
282
- TeamCreate → TaskCreate → Agent(spawn members) → SendMessage(coordinate)
283
- → TaskUpdate(progress) → ... → shutdown members → TeamDelete
284
- ```
131
+ TeamCreate → TaskCreate → Agent(spawn members) → SendMessage(coordinate) → TaskUpdate(progress) → verify → shutdown members → TeamDelete.
285
132
  -->
286
133
 
287
134
  ## Fallback
288
135
 
289
- When Agent Teams unavailable: use Agent tool with R009/R010 rules.
290
- When Agent Teams available: actively prefer it for qualifying tasks.
291
-
292
- ## Cost Awareness
293
-
294
- Agent Teams actively preferred for qualifying collaborative tasks. Use Agent tool only when:
295
- - 1-2 agents with no inter-dependency
296
- - No review → fix cycles
297
- - Simple independent subtasks
136
+ If Teams unavailable, use Agent tool with R009/R010. If available, prefer Teams for qualifying collaboration.
298
137
 
299
- Do NOT avoid Agent Teams solely for cost reasons when criteria are met.
138
+ ## Active Preference Rule
300
139
 
301
- **Active preference rule**: When Agent Teams is available, default to using it for any multi-step or multi-issue work. Only fall back to Agent tool for truly simple, single-issue tasks with no verification needs.
140
+ Default to Teams for multi-step/multi-issue collaboration. Fall back only for simple single-issue work, explicit user preference, sequential scaffolding, or low-coordination mechanical disjoint-file batches.