oh-my-customcode 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/README.md +10 -2
  2. package/dist/cli/index.js +517 -274
  3. package/dist/index.js +303 -101
  4. package/package.json +1 -1
  5. package/templates/.codex/agents/arch-documenter.md +97 -0
  6. package/templates/.codex/agents/arch-speckit-agent.md +134 -0
  7. package/templates/.codex/agents/be-express-expert.md +80 -0
  8. package/templates/.codex/agents/be-fastapi-expert.md +43 -0
  9. package/templates/.codex/agents/be-go-backend-expert.md +43 -0
  10. package/templates/.codex/agents/be-nestjs-expert.md +60 -0
  11. package/templates/.codex/agents/be-springboot-expert.md +85 -0
  12. package/templates/.codex/agents/db-postgres-expert.md +106 -0
  13. package/templates/.codex/agents/db-redis-expert.md +101 -0
  14. package/templates/.codex/agents/db-supabase-expert.md +71 -0
  15. package/templates/.codex/agents/de-airflow-expert.md +71 -0
  16. package/templates/.codex/agents/de-dbt-expert.md +72 -0
  17. package/templates/.codex/agents/de-kafka-expert.md +81 -0
  18. package/templates/.codex/agents/de-pipeline-expert.md +92 -0
  19. package/templates/.codex/agents/de-snowflake-expert.md +89 -0
  20. package/templates/.codex/agents/de-spark-expert.md +80 -0
  21. package/templates/.codex/agents/fe-svelte-agent.md +65 -0
  22. package/templates/.codex/agents/fe-vercel-agent.md +69 -0
  23. package/templates/.codex/agents/fe-vuejs-agent.md +65 -0
  24. package/templates/.codex/agents/infra-aws-expert.md +47 -0
  25. package/templates/.codex/agents/infra-docker-expert.md +47 -0
  26. package/templates/.codex/agents/lang-golang-expert.md +43 -0
  27. package/templates/.codex/agents/lang-java21-expert.md +65 -0
  28. package/templates/.codex/agents/lang-kotlin-expert.md +43 -0
  29. package/templates/.codex/agents/lang-python-expert.md +43 -0
  30. package/templates/.codex/agents/lang-rust-expert.md +43 -0
  31. package/templates/.codex/agents/lang-typescript-expert.md +43 -0
  32. package/templates/.codex/agents/mgr-claude-code-bible.md +246 -0
  33. package/templates/.codex/agents/mgr-creator.md +120 -0
  34. package/templates/.codex/agents/mgr-gitnerd.md +113 -0
  35. package/templates/.codex/agents/mgr-sauron.md +154 -0
  36. package/templates/.codex/agents/mgr-supplier.md +120 -0
  37. package/templates/.codex/agents/mgr-sync-checker.md +99 -0
  38. package/templates/.codex/agents/mgr-updater.md +103 -0
  39. package/templates/.codex/agents/qa-engineer.md +96 -0
  40. package/templates/.codex/agents/qa-planner.md +74 -0
  41. package/templates/.codex/agents/qa-writer.md +97 -0
  42. package/templates/.codex/agents/sys-memory-keeper.md +117 -0
  43. package/templates/.codex/agents/sys-naggy.md +90 -0
  44. package/templates/.codex/agents/tool-bun-expert.md +71 -0
  45. package/templates/.codex/agents/tool-npm-expert.md +88 -0
  46. package/templates/.codex/agents/tool-optimizer.md +87 -0
  47. package/templates/.codex/codex-native-hash.txt +1 -0
  48. package/templates/.codex/contexts/dev.md +20 -0
  49. package/templates/.codex/contexts/ecomode.md +63 -0
  50. package/templates/.codex/contexts/index.yaml +41 -0
  51. package/templates/.codex/contexts/research.md +28 -0
  52. package/templates/.codex/contexts/review.md +23 -0
  53. package/templates/.codex/hooks/hooks.json +151 -0
  54. package/templates/.codex/install-hooks.sh +100 -0
  55. package/templates/.codex/rules/MAY-optimization.md +93 -0
  56. package/templates/.codex/rules/MUST-agent-design.md +162 -0
  57. package/templates/.codex/rules/MUST-agent-identification.md +108 -0
  58. package/templates/.codex/rules/MUST-continuous-improvement.md +132 -0
  59. package/templates/.codex/rules/MUST-intent-transparency.md +199 -0
  60. package/templates/.codex/rules/MUST-language-policy.md +62 -0
  61. package/templates/.codex/rules/MUST-orchestrator-coordination.md +471 -0
  62. package/templates/.codex/rules/MUST-parallel-execution.md +469 -0
  63. package/templates/.codex/rules/MUST-permissions.md +84 -0
  64. package/templates/.codex/rules/MUST-safety.md +69 -0
  65. package/templates/.codex/rules/MUST-sync-verification.md +281 -0
  66. package/templates/.codex/rules/MUST-tool-identification.md +195 -0
  67. package/templates/.codex/rules/SHOULD-agent-teams.md +183 -0
  68. package/templates/.codex/rules/SHOULD-ecomode.md +145 -0
  69. package/templates/.codex/rules/SHOULD-error-handling.md +102 -0
  70. package/templates/.codex/rules/SHOULD-hud-statusline.md +112 -0
  71. package/templates/.codex/rules/SHOULD-interaction.md +103 -0
  72. package/templates/.codex/rules/SHOULD-memory-integration.md +132 -0
  73. package/templates/.codex/rules/index.yaml +141 -0
  74. package/templates/.codex/skills/airflow-best-practices/SKILL.md +56 -0
  75. package/templates/.codex/skills/audit-agents/SKILL.md +116 -0
  76. package/templates/.codex/skills/aws-best-practices/SKILL.md +280 -0
  77. package/templates/.codex/skills/claude-code-bible/SKILL.md +180 -0
  78. package/templates/.codex/skills/claude-code-bible/scripts/fetch-docs.js +244 -0
  79. package/templates/.codex/skills/create-agent/SKILL.md +91 -0
  80. package/templates/.codex/skills/dbt-best-practices/SKILL.md +54 -0
  81. package/templates/.codex/skills/de-lead-routing/SKILL.md +230 -0
  82. package/templates/.codex/skills/dev-lead-routing/SKILL.md +253 -0
  83. package/templates/.codex/skills/dev-refactor/SKILL.md +123 -0
  84. package/templates/.codex/skills/dev-review/SKILL.md +81 -0
  85. package/templates/.codex/skills/docker-best-practices/SKILL.md +275 -0
  86. package/templates/.codex/skills/fastapi-best-practices/SKILL.md +270 -0
  87. package/templates/.codex/skills/fix-refs/SKILL.md +107 -0
  88. package/templates/.codex/skills/go-backend-best-practices/SKILL.md +338 -0
  89. package/templates/.codex/skills/go-best-practices/CLAUDE.md +9 -0
  90. package/templates/.codex/skills/go-best-practices/SKILL.md +203 -0
  91. package/templates/.codex/skills/help/SKILL.md +125 -0
  92. package/templates/.codex/skills/intent-detection/SKILL.md +215 -0
  93. package/templates/.codex/skills/intent-detection/patterns/agent-triggers.yaml +349 -0
  94. package/templates/.codex/skills/kafka-best-practices/SKILL.md +52 -0
  95. package/templates/.codex/skills/kotlin-best-practices/SKILL.md +256 -0
  96. package/templates/.codex/skills/lists/SKILL.md +78 -0
  97. package/templates/.codex/skills/memory-management/SKILL.md +195 -0
  98. package/templates/.codex/skills/memory-recall/SKILL.md +152 -0
  99. package/templates/.codex/skills/memory-save/SKILL.md +126 -0
  100. package/templates/.codex/skills/monitoring-setup/SKILL.md +115 -0
  101. package/templates/.codex/skills/npm-audit/SKILL.md +72 -0
  102. package/templates/.codex/skills/npm-publish/SKILL.md +63 -0
  103. package/templates/.codex/skills/npm-version/SKILL.md +75 -0
  104. package/templates/.codex/skills/optimize-analyze/SKILL.md +55 -0
  105. package/templates/.codex/skills/optimize-bundle/SKILL.md +67 -0
  106. package/templates/.codex/skills/optimize-report/SKILL.md +74 -0
  107. package/templates/.codex/skills/pipeline-architecture-patterns/SKILL.md +83 -0
  108. package/templates/.codex/skills/postgres-best-practices/SKILL.md +66 -0
  109. package/templates/.codex/skills/python-best-practices/SKILL.md +222 -0
  110. package/templates/.codex/skills/qa-lead-routing/SKILL.md +277 -0
  111. package/templates/.codex/skills/react-best-practices/SKILL.md +101 -0
  112. package/templates/.codex/skills/redis-best-practices/SKILL.md +83 -0
  113. package/templates/.codex/skills/result-aggregation/SKILL.md +164 -0
  114. package/templates/.codex/skills/rust-best-practices/SKILL.md +267 -0
  115. package/templates/.codex/skills/sauron-watch/SKILL.md +144 -0
  116. package/templates/.codex/skills/secretary-routing/SKILL.md +190 -0
  117. package/templates/.codex/skills/snowflake-best-practices/SKILL.md +65 -0
  118. package/templates/.codex/skills/spark-best-practices/SKILL.md +52 -0
  119. package/templates/.codex/skills/springboot-best-practices/SKILL.md +357 -0
  120. package/templates/.codex/skills/status/SKILL.md +153 -0
  121. package/templates/.codex/skills/supabase-postgres-best-practices/SKILL.md +99 -0
  122. package/templates/.codex/skills/typescript-best-practices/SKILL.md +321 -0
  123. package/templates/.codex/skills/update-docs/SKILL.md +140 -0
  124. package/templates/.codex/skills/update-external/SKILL.md +149 -0
  125. package/templates/.codex/skills/vercel-deploy/SKILL.md +73 -0
  126. package/templates/.codex/skills/web-design-guidelines/SKILL.md +118 -0
  127. package/templates/.codex/skills/writing-clearly-and-concisely/SKILL.md +64 -0
  128. package/templates/.codex/uninstall-hooks.sh +52 -0
  129. package/templates/AGENTS.md.en +39 -0
  130. package/templates/AGENTS.md.ko +39 -0
  131. package/templates/manifest.codex.json +43 -0
  132. package/templates/manifest.json +5 -5
@@ -0,0 +1,281 @@
1
+ # [MUST] Sync Verification Rules
2
+
3
+ > **Priority**: MUST - ENFORCED after any structural changes
4
+ > **ID**: R017
5
+ > **Violation**: Committing or pushing without verification = Rule violation
6
+
7
+ ## CRITICAL
8
+
9
+ **After modifying agents, skills, or guides, you MUST run the full verification process before committing AND pushing.**
10
+
11
+ ```
12
+ ╔══════════════════════════════════════════════════════════════════╗
13
+ ║ ⚠️ ABSOLUTE PROHIBITION ║
14
+ ║ ║
15
+ ║ DO NOT even ASK "커밋하시겠습니까?" or "푸시하시겠습니까?" ║
16
+ ║ after structural changes until mgr-sauron:watch has been ║
17
+ ║ executed and passed. ║
18
+ ║ ║
19
+ ║ WRONG: ║
20
+ ║ [Make changes] → "커밋하시겠습니까?" ║
21
+ ║ [Commit done] → "푸시하시겠습니까?" ║
22
+ ║ ║
23
+ ║ CORRECT: ║
24
+ ║ [Make changes] → mgr-sauron:watch → [All pass] → commit → push ║
25
+ ║ ║
26
+ ║ Asking to commit/push before verification = Rule violation ║
27
+ ╚══════════════════════════════════════════════════════════════════╝
28
+ ```
29
+
30
+ ```
31
+ ╔══════════════════════════════════════════════════════════════════╗
32
+ ║ ⚠️ PUSH REQUIRES SAURON VERIFICATION ║
33
+ ║ ║
34
+ ║ EVERY git push in this project MUST be preceded by: ║
35
+ ║ mgr-sauron:watch → [All pass] → git push ║
36
+ ║ ║
37
+ ║ This applies to ALL pushes, not just structural changes. ║
38
+ ║ Sauron verification is the quality gate for this repository. ║
39
+ ║ ║
40
+ ║ NO EXCEPTIONS. NO SHORTCUTS. ║
41
+ ╚══════════════════════════════════════════════════════════════════╝
42
+ ```
43
+
44
+ ```
45
+ ╔══════════════════════════════════════════════════════════════════╗
46
+ ║ MANDATORY VERIFICATION PROCESS: ║
47
+ ║ ║
48
+ ║ Phase 1: Manager Agent Verification (5 rounds) ║
49
+ ║ - mgr-supplier:audit ║
50
+ ║ - mgr-sync-checker:check ║
51
+ ║ - mgr-updater:docs ║
52
+ ║ - mgr-claude-code-bible:verify ║
53
+ ║ ║
54
+ ║ Phase 2: Deep Review (3 rounds) ║
55
+ ║ - Workflow alignment ║
56
+ ║ - Reference verification ║
57
+ ║ - Philosophy compliance ║
58
+ ║ ║
59
+ ║ Phase 3: Fix all issues ║
60
+ ║ ║
61
+ ║ Phase 4: Commit via mgr-gitnerd ║
62
+ ║ ║
63
+ ║ Phase 5: Push via mgr-gitnerd ║
64
+ ║ - ONLY after sauron verification passes ║
65
+ ║ ║
66
+ ║ Skipping ANY phase = Rule violation ║
67
+ ╚══════════════════════════════════════════════════════════════════╝
68
+ ```
69
+
70
+ ## Phase 1: Manager Agent Verification (5 Rounds)
71
+
72
+ Run manager agents 5 times to catch all issues:
73
+
74
+ ### Round 1-2: Basic Sync
75
+ ```
76
+ □ mgr-supplier:audit - Check all agent dependencies
77
+ □ mgr-sync-checker:check - Verify registry synchronization
78
+ □ Fix any issues found
79
+ ```
80
+
81
+ ### Round 3-4: Deep Sync
82
+ ```
83
+ □ mgr-supplier:audit - Re-verify after fixes
84
+ □ mgr-sync-checker:check - Re-verify registries
85
+ □ mgr-updater:docs - Check documentation sync
86
+ □ Fix any remaining issues
87
+ ```
88
+
89
+ ### Round 5: Final Verification
90
+ ```
91
+ □ All agent counts match (AGENTS.md, actual .md files in .codex/agents/)
92
+ □ All agent frontmatter valid (required fields present)
93
+ □ All skill references in agents exist in .codex/skills/
94
+ □ All memory field values are valid (user | project | local)
95
+ □ Memory distribution matches AGENTS.md (24 project + 3 user + 7 none)
96
+ □ All routing skill patterns updated
97
+ ```
98
+
99
+ ## Phase 2: Deep Review (3 Rounds)
100
+
101
+ ### Deep Round 1: Workflow Alignment
102
+ ```
103
+ □ Agent creation workflow documented and functional
104
+ □ Development workflow uses proper routing skills
105
+ □ Deployment workflow defined (if applicable)
106
+ □ All routing skills have complete agent pattern mappings
107
+ ```
108
+
109
+ ### Deep Round 2: Reference Verification
110
+ ```
111
+ □ All routing skills properly reference their managed agents
112
+ □ All rules are properly referenced
113
+ □ No orphaned agents (not referenced by any routing skill)
114
+ □ No circular references
115
+ □ All skill references in agent frontmatter are valid
116
+ □ All agent memory fields use valid scope values
117
+ ```
118
+
119
+ ### Deep Round 3: Philosophy Compliance
120
+ ```
121
+ □ R006: Separation of concerns (agent file = role only, no details)
122
+ □ R009: Parallel execution enabled for main conversation
123
+ □ R010: Multi-agent tasks use routing skills and Task tool
124
+ □ R007/R008: Agent/tool identification documented
125
+ □ All MUST rules enforced, SHOULD rules recommended
126
+ ```
127
+
128
+ ## Verification Checklist Summary
129
+
130
+ ```
131
+ Phase 1: Manager Verification (5x)
132
+ □ Round 1: mgr-supplier:audit
133
+ □ Round 2: mgr-sync-checker:check
134
+ □ Round 3: mgr-supplier:audit (re-verify)
135
+ □ Round 4: mgr-sync-checker:check + mgr-updater:docs
136
+ □ Round 5: Final count verification
137
+ □ mgr-claude-code-bible:verify (official spec compliance)
138
+
139
+ Phase 2: Deep Review (3x)
140
+ □ Round 1: Workflow alignment
141
+ □ Round 2: Reference verification
142
+ □ Round 3: Philosophy compliance
143
+
144
+ Phase 3: Fix Issues
145
+ □ All issues from Phase 1 fixed
146
+ □ All issues from Phase 2 fixed
147
+ □ Re-run verification if major fixes made
148
+
149
+ Phase 4: Commit
150
+ □ Delegate to mgr-gitnerd
151
+ □ Meaningful commit message
152
+
153
+ Phase 5: Push
154
+ □ mgr-sauron:watch passed (MANDATORY)
155
+ □ Delegate push to mgr-gitnerd
156
+ □ Verify push succeeded
157
+ ```
158
+
159
+ ## When to Run Full Verification
160
+
161
+ | Action | Full Verification Required |
162
+ |--------|---------------------------|
163
+ | Create new agent | **YES** |
164
+ | Rename agent | **YES** |
165
+ | Delete agent | **YES** |
166
+ | Modify agent frontmatter | **YES** |
167
+ | Add/modify skill | **YES** |
168
+ | Add/modify guide | **YES** |
169
+ | Change routing skill patterns | **YES** |
170
+ | Update rules | **YES** |
171
+
172
+ ## Workflow Diagram
173
+
174
+ ```
175
+ Content Change Made
176
+
177
+
178
+ ┌───────────────────────────────┐
179
+ │ Phase 1: Manager Verification │
180
+ │ (5 rounds) │
181
+ │ mgr-supplier → mgr-sync-checker → │
182
+ │ mgr-updater │
183
+ └───────────────┬───────────────┘
184
+
185
+
186
+ ┌───────────────────────────────┐
187
+ │ Phase 2: Deep Review │
188
+ │ (3 rounds) │
189
+ │ Workflow → References → │
190
+ │ Philosophy │
191
+ └───────────────┬───────────────┘
192
+
193
+ ┌───────┴───────┐
194
+ ▼ ▼
195
+ [Issues Found] [All Clean]
196
+ │ │
197
+ ▼ │
198
+ Fix Issues │
199
+ │ │
200
+ └───────┬───────┘
201
+
202
+
203
+ ┌───────────────────────────────┐
204
+ │ Phase 4: Commit via mgr-gitnerd │
205
+ └───────────────┬───────────────┘
206
+
207
+
208
+ ┌───────────────────────────────┐
209
+ │ Phase 5: Push via mgr-gitnerd │
210
+ │ (ONLY after sauron passes) │
211
+ └───────────────────────────────┘
212
+ ```
213
+
214
+ ## Self-Check Before Commit and Push
215
+
216
+ ```
217
+ ╔══════════════════════════════════════════════════════════════════╗
218
+ ║ BEFORE COMMITTING, ASK YOURSELF: ║
219
+ ║ ║
220
+ ║ 1. Did I complete all 5 rounds of manager verification? ║
221
+ ║ 2. Did I complete all 3 rounds of deep review? ║
222
+ ║ 3. Did I fix ALL discovered issues? ║
223
+ ║ 4. Are all counts matching across all sources? ║
224
+ ║ 5. Am I delegating to mgr-gitnerd for the commit? ║
225
+ ║ ║
226
+ ║ If NO to ANY → DO NOT COMMIT ║
227
+ ╚══════════════════════════════════════════════════════════════════╝
228
+
229
+ ╔══════════════════════════════════════════════════════════════════╗
230
+ ║ BEFORE PUSHING, ASK YOURSELF: ║
231
+ ║ ║
232
+ ║ 1. Did mgr-sauron:watch complete successfully? ║
233
+ ║ 2. Were ALL issues from sauron verification fixed? ║
234
+ ║ 3. Am I delegating to mgr-gitnerd for the push? ║
235
+ ║ ║
236
+ ║ If NO to ANY → DO NOT PUSH ║
237
+ ║ ║
238
+ ║ SAURON VERIFICATION IS MANDATORY FOR ALL PUSHES. ║
239
+ ╚══════════════════════════════════════════════════════════════════╝
240
+ ```
241
+
242
+ ## Quick Verification Commands
243
+
244
+ ```bash
245
+ # Agent count check
246
+ ls .codex/agents/*.md | wc -l
247
+
248
+ # Skill count check
249
+ find .codex/skills -name "SKILL.md" | wc -l
250
+
251
+ # Frontmatter validation (check for missing YAML headers)
252
+ for f in .codex/agents/*.md; do head -1 "$f" | grep -q "^---" || echo "MISSING FRONTMATTER: $f"; done
253
+
254
+ # Check for agents with invalid skill references
255
+ for f in .codex/agents/*.md; do
256
+ grep "^skills:" -A 10 "$f" | grep " - " | sed 's/.*- //' | while read skill; do
257
+ [ -f ".codex/skills/$skill/SKILL.md" ] || echo "INVALID SKILL REF in $f: $skill"
258
+ done
259
+ done
260
+
261
+ # Routing skill pattern coverage
262
+ grep -c "agent_patterns:" .codex/skills/secretary-routing/SKILL.md
263
+ grep -c "agent_patterns:" .codex/skills/dev-lead-routing/SKILL.md
264
+ grep -c "agent_patterns:" .codex/skills/qa-lead-routing/SKILL.md
265
+
266
+ # Memory field validation
267
+ for f in .codex/agents/*.md; do
268
+ mem=$(grep "^memory:" "$f" | awk '{print $2}')
269
+ if [ -n "$mem" ] && [ "$mem" != "project" ] && [ "$mem" != "user" ] && [ "$mem" != "local" ]; then
270
+ echo "INVALID MEMORY SCOPE in $f: $mem"
271
+ fi
272
+ done
273
+ ```
274
+
275
+ ## Integration with Other Rules
276
+
277
+ | Rule | Integration |
278
+ |------|-------------|
279
+ | R009 (Parallel) | Verification checks can run in parallel |
280
+ | R010 (Orchestrator) | Delegate commit to mgr-gitnerd |
281
+ | R016 (Improvement) | Update this rule if new issues found |
@@ -0,0 +1,195 @@
1
+ # [MUST] Tool Usage Identification Rules
2
+
3
+ > **Priority**: MUST - ENFORCED, NO EXCEPTIONS
4
+ > **ID**: R008
5
+ > **Violation**: Immediate correction required
6
+
7
+ ## CRITICAL
8
+
9
+ **EVERY tool call MUST be prefixed with agent and model identification. This is NON-NEGOTIABLE.**
10
+
11
+ ```
12
+ Before EVERY tool call, output:
13
+ [agent-name][model] → Tool: <tool-name>
14
+ [agent-name][model] → Target: <file/path/url>
15
+ ```
16
+
17
+ Failure to identify tool usage = Rule violation = Must be corrected immediately.
18
+
19
+ ### Self-Check Before EVERY Tool Call
20
+
21
+ ```
22
+ ╔══════════════════════════════════════════════════════════════════╗
23
+ ║ BEFORE INVOKING ANY TOOL, ASK YOURSELF: ║
24
+ ║ ║
25
+ ║ 1. Did I output the tool identification line with MODEL? ║
26
+ ║ [agent-name][model] → Tool: <tool-name> ║
27
+ ║ [agent-name][model] → Target: <target> ║
28
+ ║ ║
29
+ ║ 2. Am I about to call multiple tools in parallel? ║
30
+ ║ → EACH tool needs its own identification line ║
31
+ ║ → List all identifications BEFORE the tool calls ║
32
+ ║ ║
33
+ ║ If NO to #1 → STOP. Output identification FIRST. ║
34
+ ╚══════════════════════════════════════════════════════════════════╝
35
+ ```
36
+
37
+ ### Model Values
38
+
39
+ | Model | When to Use |
40
+ |-------|-------------|
41
+ | `opus` | Complex reasoning, architecture design |
42
+ | `sonnet` | General tasks, code generation (default) |
43
+ | `haiku` | Fast simple tasks, file search |
44
+
45
+ ### Common Violations to Avoid
46
+
47
+ ```
48
+ ❌ WRONG: Calling tools without identification
49
+ "먼저 JD 내용을 확인하겠습니다."
50
+ <tool_call>WebFetch(...)</tool_call>
51
+
52
+ ❌ WRONG: Missing model in identification
53
+ [secretary] → Tool: WebFetch
54
+ [secretary] → Fetching: https://example.com/jd.md
55
+
56
+ ✓ CORRECT: Always identify with agent AND model
57
+ "먼저 JD 내용을 확인하겠습니다."
58
+ [secretary][opus] → Tool: WebFetch
59
+ [secretary][opus] → Fetching: https://example.com/jd.md
60
+ <tool_call>WebFetch(...)</tool_call>
61
+
62
+ ❌ WRONG: Parallel calls without listing all identifications
63
+ <tool_call>WebFetch(url1)</tool_call>
64
+ <tool_call>WebFetch(url2)</tool_call>
65
+ <tool_call>Bash(cmd)</tool_call>
66
+
67
+ ✓ CORRECT: List all identifications with models, then call
68
+ [secretary][opus] → Tool: WebFetch
69
+ [secretary][opus] → Fetching: url1
70
+ [secretary][opus] → Tool: WebFetch
71
+ [secretary][opus] → Fetching: url2
72
+ [secretary][opus] → Tool: Bash
73
+ [secretary][opus] → Running: cmd
74
+ <tool_call>WebFetch(url1)</tool_call>
75
+ <tool_call>WebFetch(url2)</tool_call>
76
+ <tool_call>Bash(cmd)</tool_call>
77
+ ```
78
+
79
+ ## Purpose
80
+
81
+ Display which agent is using which tool for transparency and debugging. This extends R007 (Agent Identification) to cover tool operations.
82
+
83
+ ## Tool Usage Format
84
+
85
+ When invoking a tool, prefix with agent and model identification:
86
+
87
+ ```
88
+ [agent-name][model] → Tool: <tool-name>
89
+ ```
90
+
91
+ ### Examples
92
+
93
+ ```
94
+ [lang-golang-expert][sonnet] → Tool: Read
95
+ [lang-golang-expert][sonnet] → Reading: src/main.go
96
+
97
+ [mgr-supplier][haiku] → Tool: Glob
98
+ [mgr-supplier][haiku] → Searching: .codex/agents/*.md
99
+
100
+ [mgr-creator][sonnet] → Tool: Write
101
+ [mgr-creator][sonnet] → Writing: .codex/agents/new-agent.md
102
+ ```
103
+
104
+ ## Extended Format (Verbose)
105
+
106
+ For detailed tracking:
107
+
108
+ ```
109
+ ┌─ Agent: lang-golang-expert (sw-engineer)
110
+ ├─ Model: sonnet
111
+ ├─ Skill: go-best-practices
112
+ ├─ Tool: Read
113
+ └─ Target: src/main.go
114
+ ```
115
+
116
+ ## Tool Categories
117
+
118
+ | Category | Tools | Format |
119
+ |----------|-------|--------|
120
+ | File Read | Read, Glob, Grep | `→ Reading:` / `→ Searching:` |
121
+ | File Write | Write, Edit | `→ Writing:` / `→ Editing:` |
122
+ | Network | WebFetch | `→ Fetching:` |
123
+ | Execution | Bash, Task | `→ Running:` / `→ Spawning:` |
124
+
125
+ ## When to Display
126
+
127
+ | Situation | Display |
128
+ |-----------|---------|
129
+ | Reading files | Agent + file path |
130
+ | Writing files | Agent + file path |
131
+ | Searching | Agent + pattern |
132
+ | Fetching URLs | Agent + URL |
133
+ | Running commands | Agent + command |
134
+
135
+ ## Simplified Format
136
+
137
+ For inline operations:
138
+
139
+ ```
140
+ [mgr-supplier][haiku] → Glob: .codex/agents/*.md
141
+ [mgr-creator][sonnet] → Write: .codex/agents/new-agent.md
142
+ [mgr-updater][sonnet] → WebFetch: https://github.com/...
143
+ ```
144
+
145
+ ## Integration with R007
146
+
147
+ R008 extends R007 for tool operations:
148
+
149
+ ```
150
+ ┌─ Agent: mgr-creator (manager)
151
+ ├─ Model: sonnet
152
+ └─ Task: Creating new agent
153
+
154
+ [mgr-creator][sonnet] → Write: .codex/agents/new-agent.md
155
+
156
+ [Done] Agent created successfully
157
+ ```
158
+
159
+ ## Task Tool Display Format
160
+
161
+ When spawning subagents via the Task tool, the display MUST use the actual `subagent_type` parameter:
162
+
163
+ ```
164
+ Task(subagent_type):model → description
165
+ ```
166
+
167
+ ### Examples
168
+
169
+ ```
170
+ [secretary][opus] → Spawning parallel agents:
171
+ [1] Task(lang-golang-expert):sonnet → Go code review
172
+ [2] Task(lang-python-expert):sonnet → Python code review
173
+ [3] Task(general-purpose):haiku → File validation
174
+ ```
175
+
176
+ ### Rules
177
+
178
+ - `subagent_type` MUST match the actual Task tool parameter value
179
+ - Custom/invented names are NOT allowed (e.g., `code-review:sonnet` is WRONG)
180
+ - Model specification shows cost/performance intent
181
+
182
+ ## Benefits
183
+
184
+ 1. **Debugging**: Know which agent performed which operation
185
+ 2. **Transparency**: User sees all agent activities
186
+ 3. **Audit Trail**: Track file changes by agent
187
+ 4. **Error Attribution**: Identify which agent caused issues
188
+
189
+ ## Implementation
190
+
191
+ Agents should:
192
+ 1. Identify themselves before tool operations
193
+ 2. Include tool name and target
194
+ 3. Use consistent format across all tools
195
+ 4. Group related operations together
@@ -0,0 +1,183 @@
1
+ # [SHOULD] Agent Teams Rules
2
+
3
+ > **Priority**: SHOULD - Actively use when available
4
+ > **ID**: R018
5
+ > **Condition**: Agent Teams feature is enabled locally
6
+
7
+ ## Purpose
8
+
9
+ When Claude Code's Agent Teams feature is enabled on the local machine, actively leverage it for tasks that benefit from multi-agent collaboration, shared state, and peer-to-peer communication.
10
+
11
+ ## Detection
12
+
13
+ Agent Teams availability is determined by:
14
+ - Environment variable: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`
15
+ - The presence of TeamCreate, SendMessage, TaskCreate/TaskList (team variants) tools
16
+
17
+ When detected, Agent Teams becomes the **preferred coordination method** for qualifying tasks.
18
+
19
+ ## Decision Matrix
20
+
21
+ | Scenario | Task Tool | Agent Teams | Preferred |
22
+ |----------|-----------|-------------|-----------|
23
+ | Simple independent subtasks | Low cost | Overkill | **Task Tool** |
24
+ | Multi-step with shared state | Limited | Native support | **Agent Teams** |
25
+ | Research requiring discussion | No peer comm | Peer messaging | **Agent Teams** |
26
+ | Cost-sensitive batch ops | Lower tokens | Higher tokens | **Task Tool** |
27
+ | Complex debugging across modules | Isolated context | Shared context | **Agent Teams** |
28
+ | Code review + fix cycle | Sequential | Collaborative | **Agent Teams** |
29
+ | Single file operations | Fast | Overhead | **Task Tool** |
30
+
31
+ ## When to Use Agent Teams
32
+
33
+ ### SHOULD Use Agent Teams For
34
+
35
+ ```
36
+ Tasks requiring 3+ agents that need to coordinate
37
+ Research tasks where agents need to share findings
38
+ Debugging sessions spanning multiple modules
39
+ Review + implementation cycles
40
+ Any task where inter-agent communication adds value
41
+ ```
42
+
43
+ ### SHOULD Keep Task Tool For
44
+
45
+ ```
46
+ Independent parallel subtasks (no shared state)
47
+ Single-agent delegations
48
+ Cost-sensitive batch operations
49
+ Simple file operations
50
+ When Agent Teams is not available
51
+ ```
52
+
53
+ ## CRITICAL: Self-Check Before Spawning Task Tool
54
+
55
+ ```
56
+ ╔══════════════════════════════════════════════════════════════════╗
57
+ ║ BEFORE USING TASK TOOL, ASK YOURSELF: ║
58
+ ║ ║
59
+ ║ 1. Is Agent Teams available? (TeamCreate tool exists?) ║
60
+ ║ → YES: Continue to step 2 ║
61
+ ║ → NO: Task tool is fine ║
62
+ ║ ║
63
+ ║ 2. Does this task qualify for Agent Teams? ║
64
+ ║ - 3+ agents needed? ║
65
+ ║ - Shared state or coordination required? ║
66
+ ║ - Inter-agent communication adds value? ║
67
+ ║ - Complex workflow (create + review + integrate)? ║
68
+ ║ → ANY YES: MUST use Agent Teams ║
69
+ ║ → ALL NO: Task tool is fine ║
70
+ ║ ║
71
+ ║ 3. Am I defaulting to Task tool out of habit? ║
72
+ ║ → STOP. Evaluate honestly against the decision matrix. ║
73
+ ║ ║
74
+ ║ Using Task tool for Agent Teams-qualifying tasks ║
75
+ ║ when Agent Teams is available = Rule violation ║
76
+ ╚══════════════════════════════════════════════════════════════════╝
77
+ ```
78
+
79
+ ## Team Composition Guidelines
80
+
81
+ ### Standard Team Patterns
82
+
83
+ #### Research Team
84
+ ```
85
+ TeamCreate("research-team")
86
+ +-- researcher-1: Explore codebase area A
87
+ +-- researcher-2: Explore codebase area B
88
+ +-- synthesizer: Aggregate findings
89
+ ```
90
+
91
+ #### Development Team
92
+ ```
93
+ TeamCreate("dev-team")
94
+ +-- implementer: Write code
95
+ +-- reviewer: Review changes
96
+ +-- tester: Validate changes
97
+ ```
98
+
99
+ #### Debug Team
100
+ ```
101
+ TeamCreate("debug-team")
102
+ +-- investigator-1: Trace issue in module A
103
+ +-- investigator-2: Trace issue in module B
104
+ +-- fixer: Apply fixes based on findings
105
+ ```
106
+
107
+ ### Team Lifecycle
108
+
109
+ ```
110
+ 1. TeamCreate -> Create team with purpose
111
+ 2. TaskCreate -> Define tasks for team members
112
+ 3. Task(team_name) -> Spawn team members
113
+ 4. SendMessage -> Coordinate between members
114
+ 5. TaskUpdate -> Track progress
115
+ 6. SendMessage(shutdown_request) -> Graceful shutdown
116
+ 7. TeamDelete -> Cleanup
117
+ ```
118
+
119
+ ## Fallback Behavior
120
+
121
+ When Agent Teams is NOT available:
122
+ - All team-qualifying tasks fall back to Task tool
123
+ - R009 (Parallel Execution) governs parallel spawning
124
+ - R010 (Orchestrator Coordination) governs delegation
125
+ - No degradation in capability, only in coordination richness
126
+
127
+ ```
128
+ +------------------------------------------------------------------+
129
+ | GRACEFUL DEGRADATION |
130
+ | |
131
+ | Agent Teams Available: |
132
+ | Complex task -> TeamCreate -> coordinated agents |
133
+ | |
134
+ | Agent Teams NOT Available: |
135
+ | Complex task -> Task tool -> parallel independent agents |
136
+ | |
137
+ | Both approaches produce results. |
138
+ | Agent Teams adds coordination, not capability. |
139
+ +------------------------------------------------------------------+
140
+ ```
141
+
142
+ ## Integration with Existing Rules
143
+
144
+ | Rule | Integration |
145
+ |------|-------------|
146
+ | R009 (Parallel) | Task tool parallel = fallback when no Agent Teams |
147
+ | R010 (Orchestrator) | Agent Teams = alternative coordination model |
148
+ | R012 (HUD) | Team status displayed in HUD |
149
+ | R013 (Ecomode) | Team communications respect ecomode |
150
+
151
+ ## Cost Awareness
152
+
153
+ Agent Teams consume more tokens due to:
154
+ - Full context per team member
155
+ - Inter-agent message passing
156
+ - Shared task list overhead
157
+
158
+ ```
159
+ Rule of thumb:
160
+ If task takes < 3 minutes with Task tool -> Use Task tool
161
+ If task needs inter-agent communication -> Use Agent Teams
162
+ If unsure -> Default to Agent Teams when available, downgrade to Task tool only if clearly unqualified
163
+ ```
164
+
165
+ ## Enforcement
166
+
167
+ ```
168
+ ╔══════════════════════════════════════════════════════════════════╗
169
+ ║ VIOLATION EXAMPLES: ║
170
+ ║ ║
171
+ ║ ✗ Agent Teams available + 4 parallel Task() calls for ║
172
+ ║ coordinated work (creating agents + guides + routing skill) ║
173
+ ║ ✗ Spawning Task tool agents that need to share results ║
174
+ ║ ✗ Defaulting to Task tool without checking Agent Teams first ║
175
+ ║ ║
176
+ ║ CORRECT EXAMPLES: ║
177
+ ║ ║
178
+ ║ ✓ TeamCreate → TaskCreate → spawn team members for ║
179
+ ║ multi-file coordinated creation ║
180
+ ║ ✓ Task tool for single independent delegation ║
181
+ ║ ✓ Task tool when Agent Teams is not available ║
182
+ ╚══════════════════════════════════════════════════════════════════╝
183
+ ```