oh-my-customcode 0.7.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.
- package/README.md +38 -12
- package/dist/cli/index.js +518 -274
- package/dist/index.js +304 -101
- package/package.json +1 -1
- package/templates/.claude/agents/db-postgres-expert.md +106 -0
- package/templates/.claude/agents/db-redis-expert.md +101 -0
- package/templates/.claude/agents/de-airflow-expert.md +71 -0
- package/templates/.claude/agents/de-dbt-expert.md +72 -0
- package/templates/.claude/agents/de-kafka-expert.md +81 -0
- package/templates/.claude/agents/de-pipeline-expert.md +92 -0
- package/templates/.claude/agents/de-snowflake-expert.md +89 -0
- package/templates/.claude/agents/de-spark-expert.md +80 -0
- package/templates/.claude/rules/SHOULD-agent-teams.md +47 -1
- package/templates/.claude/skills/airflow-best-practices/SKILL.md +56 -0
- package/templates/.claude/skills/dbt-best-practices/SKILL.md +54 -0
- package/templates/.claude/skills/de-lead-routing/SKILL.md +230 -0
- package/templates/.claude/skills/dev-lead-routing/SKILL.md +15 -0
- package/templates/.claude/skills/kafka-best-practices/SKILL.md +52 -0
- package/templates/.claude/skills/pipeline-architecture-patterns/SKILL.md +83 -0
- package/templates/.claude/skills/postgres-best-practices/SKILL.md +66 -0
- package/templates/.claude/skills/redis-best-practices/SKILL.md +83 -0
- package/templates/.claude/skills/secretary-routing/SKILL.md +12 -0
- package/templates/.claude/skills/snowflake-best-practices/SKILL.md +65 -0
- package/templates/.claude/skills/spark-best-practices/SKILL.md +52 -0
- package/templates/.codex/agents/arch-documenter.md +97 -0
- package/templates/.codex/agents/arch-speckit-agent.md +134 -0
- package/templates/.codex/agents/be-express-expert.md +80 -0
- package/templates/.codex/agents/be-fastapi-expert.md +43 -0
- package/templates/.codex/agents/be-go-backend-expert.md +43 -0
- package/templates/.codex/agents/be-nestjs-expert.md +60 -0
- package/templates/.codex/agents/be-springboot-expert.md +85 -0
- package/templates/.codex/agents/db-postgres-expert.md +106 -0
- package/templates/.codex/agents/db-redis-expert.md +101 -0
- package/templates/.codex/agents/db-supabase-expert.md +71 -0
- package/templates/.codex/agents/de-airflow-expert.md +71 -0
- package/templates/.codex/agents/de-dbt-expert.md +72 -0
- package/templates/.codex/agents/de-kafka-expert.md +81 -0
- package/templates/.codex/agents/de-pipeline-expert.md +92 -0
- package/templates/.codex/agents/de-snowflake-expert.md +89 -0
- package/templates/.codex/agents/de-spark-expert.md +80 -0
- package/templates/.codex/agents/fe-svelte-agent.md +65 -0
- package/templates/.codex/agents/fe-vercel-agent.md +69 -0
- package/templates/.codex/agents/fe-vuejs-agent.md +65 -0
- package/templates/.codex/agents/infra-aws-expert.md +47 -0
- package/templates/.codex/agents/infra-docker-expert.md +47 -0
- package/templates/.codex/agents/lang-golang-expert.md +43 -0
- package/templates/.codex/agents/lang-java21-expert.md +65 -0
- package/templates/.codex/agents/lang-kotlin-expert.md +43 -0
- package/templates/.codex/agents/lang-python-expert.md +43 -0
- package/templates/.codex/agents/lang-rust-expert.md +43 -0
- package/templates/.codex/agents/lang-typescript-expert.md +43 -0
- package/templates/.codex/agents/mgr-claude-code-bible.md +246 -0
- package/templates/.codex/agents/mgr-creator.md +120 -0
- package/templates/.codex/agents/mgr-gitnerd.md +113 -0
- package/templates/.codex/agents/mgr-sauron.md +154 -0
- package/templates/.codex/agents/mgr-supplier.md +120 -0
- package/templates/.codex/agents/mgr-sync-checker.md +99 -0
- package/templates/.codex/agents/mgr-updater.md +103 -0
- package/templates/.codex/agents/qa-engineer.md +96 -0
- package/templates/.codex/agents/qa-planner.md +74 -0
- package/templates/.codex/agents/qa-writer.md +97 -0
- package/templates/.codex/agents/sys-memory-keeper.md +117 -0
- package/templates/.codex/agents/sys-naggy.md +90 -0
- package/templates/.codex/agents/tool-bun-expert.md +71 -0
- package/templates/.codex/agents/tool-npm-expert.md +88 -0
- package/templates/.codex/agents/tool-optimizer.md +87 -0
- package/templates/.codex/codex-native-hash.txt +1 -0
- package/templates/.codex/contexts/dev.md +20 -0
- package/templates/.codex/contexts/ecomode.md +63 -0
- package/templates/.codex/contexts/index.yaml +41 -0
- package/templates/.codex/contexts/research.md +28 -0
- package/templates/.codex/contexts/review.md +23 -0
- package/templates/.codex/hooks/hooks.json +151 -0
- package/templates/.codex/install-hooks.sh +100 -0
- package/templates/.codex/rules/MAY-optimization.md +93 -0
- package/templates/.codex/rules/MUST-agent-design.md +162 -0
- package/templates/.codex/rules/MUST-agent-identification.md +108 -0
- package/templates/.codex/rules/MUST-continuous-improvement.md +132 -0
- package/templates/.codex/rules/MUST-intent-transparency.md +199 -0
- package/templates/.codex/rules/MUST-language-policy.md +62 -0
- package/templates/.codex/rules/MUST-orchestrator-coordination.md +471 -0
- package/templates/.codex/rules/MUST-parallel-execution.md +469 -0
- package/templates/.codex/rules/MUST-permissions.md +84 -0
- package/templates/.codex/rules/MUST-safety.md +69 -0
- package/templates/.codex/rules/MUST-sync-verification.md +281 -0
- package/templates/.codex/rules/MUST-tool-identification.md +195 -0
- package/templates/.codex/rules/SHOULD-agent-teams.md +183 -0
- package/templates/.codex/rules/SHOULD-ecomode.md +145 -0
- package/templates/.codex/rules/SHOULD-error-handling.md +102 -0
- package/templates/.codex/rules/SHOULD-hud-statusline.md +112 -0
- package/templates/.codex/rules/SHOULD-interaction.md +103 -0
- package/templates/.codex/rules/SHOULD-memory-integration.md +132 -0
- package/templates/.codex/rules/index.yaml +141 -0
- package/templates/.codex/skills/airflow-best-practices/SKILL.md +56 -0
- package/templates/.codex/skills/audit-agents/SKILL.md +116 -0
- package/templates/.codex/skills/aws-best-practices/SKILL.md +280 -0
- package/templates/.codex/skills/claude-code-bible/SKILL.md +180 -0
- package/templates/.codex/skills/claude-code-bible/scripts/fetch-docs.js +244 -0
- package/templates/.codex/skills/create-agent/SKILL.md +91 -0
- package/templates/.codex/skills/dbt-best-practices/SKILL.md +54 -0
- package/templates/.codex/skills/de-lead-routing/SKILL.md +230 -0
- package/templates/.codex/skills/dev-lead-routing/SKILL.md +253 -0
- package/templates/.codex/skills/dev-refactor/SKILL.md +123 -0
- package/templates/.codex/skills/dev-review/SKILL.md +81 -0
- package/templates/.codex/skills/docker-best-practices/SKILL.md +275 -0
- package/templates/.codex/skills/fastapi-best-practices/SKILL.md +270 -0
- package/templates/.codex/skills/fix-refs/SKILL.md +107 -0
- package/templates/.codex/skills/go-backend-best-practices/SKILL.md +338 -0
- package/templates/.codex/skills/go-best-practices/CLAUDE.md +9 -0
- package/templates/.codex/skills/go-best-practices/SKILL.md +203 -0
- package/templates/.codex/skills/help/SKILL.md +125 -0
- package/templates/.codex/skills/intent-detection/SKILL.md +215 -0
- package/templates/.codex/skills/intent-detection/patterns/agent-triggers.yaml +349 -0
- package/templates/.codex/skills/kafka-best-practices/SKILL.md +52 -0
- package/templates/.codex/skills/kotlin-best-practices/SKILL.md +256 -0
- package/templates/.codex/skills/lists/SKILL.md +78 -0
- package/templates/.codex/skills/memory-management/SKILL.md +195 -0
- package/templates/.codex/skills/memory-recall/SKILL.md +152 -0
- package/templates/.codex/skills/memory-save/SKILL.md +126 -0
- package/templates/.codex/skills/monitoring-setup/SKILL.md +115 -0
- package/templates/.codex/skills/npm-audit/SKILL.md +72 -0
- package/templates/.codex/skills/npm-publish/SKILL.md +63 -0
- package/templates/.codex/skills/npm-version/SKILL.md +75 -0
- package/templates/.codex/skills/optimize-analyze/SKILL.md +55 -0
- package/templates/.codex/skills/optimize-bundle/SKILL.md +67 -0
- package/templates/.codex/skills/optimize-report/SKILL.md +74 -0
- package/templates/.codex/skills/pipeline-architecture-patterns/SKILL.md +83 -0
- package/templates/.codex/skills/postgres-best-practices/SKILL.md +66 -0
- package/templates/.codex/skills/python-best-practices/SKILL.md +222 -0
- package/templates/.codex/skills/qa-lead-routing/SKILL.md +277 -0
- package/templates/.codex/skills/react-best-practices/SKILL.md +101 -0
- package/templates/.codex/skills/redis-best-practices/SKILL.md +83 -0
- package/templates/.codex/skills/result-aggregation/SKILL.md +164 -0
- package/templates/.codex/skills/rust-best-practices/SKILL.md +267 -0
- package/templates/.codex/skills/sauron-watch/SKILL.md +144 -0
- package/templates/.codex/skills/secretary-routing/SKILL.md +190 -0
- package/templates/.codex/skills/snowflake-best-practices/SKILL.md +65 -0
- package/templates/.codex/skills/spark-best-practices/SKILL.md +52 -0
- package/templates/.codex/skills/springboot-best-practices/SKILL.md +357 -0
- package/templates/.codex/skills/status/SKILL.md +153 -0
- package/templates/.codex/skills/supabase-postgres-best-practices/SKILL.md +99 -0
- package/templates/.codex/skills/typescript-best-practices/SKILL.md +321 -0
- package/templates/.codex/skills/update-docs/SKILL.md +140 -0
- package/templates/.codex/skills/update-external/SKILL.md +149 -0
- package/templates/.codex/skills/vercel-deploy/SKILL.md +73 -0
- package/templates/.codex/skills/web-design-guidelines/SKILL.md +118 -0
- package/templates/.codex/skills/writing-clearly-and-concisely/SKILL.md +64 -0
- package/templates/.codex/uninstall-hooks.sh +52 -0
- package/templates/AGENTS.md.en +39 -0
- package/templates/AGENTS.md.ko +39 -0
- package/templates/CLAUDE.md.en +7 -5
- package/templates/CLAUDE.md.ko +7 -5
- package/templates/guides/airflow/README.md +32 -0
- package/templates/guides/dbt/README.md +32 -0
- package/templates/guides/iceberg/README.md +49 -0
- package/templates/guides/kafka/README.md +32 -0
- package/templates/guides/postgres/README.md +58 -0
- package/templates/guides/redis/README.md +50 -0
- package/templates/guides/snowflake/README.md +32 -0
- package/templates/guides/spark/README.md +32 -0
- package/templates/manifest.codex.json +43 -0
- package/templates/manifest.json +5 -5
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
# [MUST] Parallel Execution Rules
|
|
2
|
+
|
|
3
|
+
> **Priority**: MUST - ENFORCED for 2+ independent tasks
|
|
4
|
+
> **ID**: R009
|
|
5
|
+
> **Violation**: Sequential execution of parallelizable tasks = Rule violation
|
|
6
|
+
|
|
7
|
+
## CRITICAL
|
|
8
|
+
|
|
9
|
+
**When 2 or more tasks are INDEPENDENT, they MUST be executed in parallel.**
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
13
|
+
║ ⚠️ ABSOLUTE RULE: 2+ INDEPENDENT FILES = PARALLEL ║
|
|
14
|
+
║ ║
|
|
15
|
+
║ If you are about to Write/Edit 2 or more independent files: ║
|
|
16
|
+
║ → STOP ║
|
|
17
|
+
║ → Use Task tool to spawn parallel agents ║
|
|
18
|
+
║ → Each agent handles a subset of files ║
|
|
19
|
+
║ ║
|
|
20
|
+
║ NO EXCEPTIONS for: ║
|
|
21
|
+
║ - Project scaffolding (package.json, tsconfig, src/*.ts) ║
|
|
22
|
+
║ - Multiple module creation ║
|
|
23
|
+
║ - Batch file updates ║
|
|
24
|
+
║ - Any multi-file operation ║
|
|
25
|
+
║ ║
|
|
26
|
+
║ VIOLATION = Using Write/Edit 2+ times in sequence ║
|
|
27
|
+
║ when files are independent ║
|
|
28
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Detection criteria for parallel execution:
|
|
33
|
+
- Tasks don't share mutable state
|
|
34
|
+
- Tasks don't have sequential dependencies
|
|
35
|
+
- Tasks can complete independently
|
|
36
|
+
|
|
37
|
+
If ALL criteria met → MUST execute in parallel (max 4 instances)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### How to Detect Independent Tasks
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Independent (MUST parallelize):
|
|
44
|
+
✓ "Create agents A, B, C" → 3 separate creations
|
|
45
|
+
✓ "Read files X, Y, Z" → 3 separate reads
|
|
46
|
+
✓ "Review code in src/, test/, docs/" → 3 separate reviews
|
|
47
|
+
|
|
48
|
+
Dependent (sequential OK):
|
|
49
|
+
✗ "Create agent then configure it" → depends on creation
|
|
50
|
+
✗ "Build then test" → test depends on build
|
|
51
|
+
✗ "Read file then edit it" → edit depends on read content
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Failure to parallelize independent tasks = Rule violation = Must be corrected.
|
|
55
|
+
|
|
56
|
+
### Self-Check Before Every Multi-File Operation
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
60
|
+
║ BEFORE writing/creating multiple files, ASK YOURSELF: ║
|
|
61
|
+
║ ║
|
|
62
|
+
║ 1. Are these files independent of each other? ║
|
|
63
|
+
║ → YES: Use Task tool to spawn parallel agents ║
|
|
64
|
+
║ → NO: Sequential is OK ║
|
|
65
|
+
║ ║
|
|
66
|
+
║ 2. Am I using Write/Edit sequentially for 3+ files? ║
|
|
67
|
+
║ → STOP. This is likely a violation. ║
|
|
68
|
+
║ → Spawn parallel agents instead. ║
|
|
69
|
+
║ ║
|
|
70
|
+
║ 3. Are there domain-specific experts available? ║
|
|
71
|
+
║ → YES: Delegate to them (lang-kotlin-expert, be-springboot-expert) ║
|
|
72
|
+
║ → NO: Create general-purpose parallel agents ║
|
|
73
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Common Violations to Avoid
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
❌ WRONG: Writing files one by one
|
|
80
|
+
Write(file1.kt) → Write(file2.kt) → Write(file3.kt) → Write(file4.kt)
|
|
81
|
+
|
|
82
|
+
✓ CORRECT: Spawn parallel agents
|
|
83
|
+
Task(agent1 → file1.kt) ┐
|
|
84
|
+
Task(agent2 → file2.kt) ├─ All in single message
|
|
85
|
+
Task(agent3 → file3.kt) │
|
|
86
|
+
Task(agent4 → file4.kt) ┘
|
|
87
|
+
|
|
88
|
+
❌ WRONG: Project scaffolding sequentially
|
|
89
|
+
Write(package.json) → Write(tsconfig.json) → Write(src/index.ts) → ...
|
|
90
|
+
|
|
91
|
+
✓ CORRECT: Parallel scaffolding
|
|
92
|
+
Task(agent1 → "Create package.json, tsconfig.json") ┐
|
|
93
|
+
Task(agent2 → "Create src/cli.ts, src/index.ts") ├─ Parallel
|
|
94
|
+
Task(agent3 → "Create src/analyzer/*.ts") │
|
|
95
|
+
Task(agent4 → "Create src/converter/*.ts") ┘
|
|
96
|
+
|
|
97
|
+
❌ WRONG: Secretary doing all the work
|
|
98
|
+
Secretary writes domain/, usecase/, infrastructure/ sequentially
|
|
99
|
+
|
|
100
|
+
✓ CORRECT: Delegate to specialists
|
|
101
|
+
Task(lang-kotlin-expert → domain layer)
|
|
102
|
+
Task(be-springboot-expert → infrastructure layer)
|
|
103
|
+
Task(lang-kotlin-expert → usecase layer)
|
|
104
|
+
|
|
105
|
+
❌ WRONG: Single Task delegating to multiple agents
|
|
106
|
+
Task(dev-lead → "coordinate lang-kotlin-expert and be-springboot-expert")
|
|
107
|
+
|
|
108
|
+
This creates a SEQUENTIAL bottleneck inside the Task!
|
|
109
|
+
|
|
110
|
+
✓ CORRECT: Multiple Tasks in parallel, one per agent
|
|
111
|
+
Task(lang-kotlin-expert → usecase commands) ┐
|
|
112
|
+
Task(lang-kotlin-expert → usecase queries) ├─ All spawned together
|
|
113
|
+
Task(be-springboot-expert → persistence) │
|
|
114
|
+
Task(be-springboot-expert → security) ┘
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Parallel Task Spawning Rule
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
121
|
+
║ PARALLEL MEANS PARALLEL AT THE TOOL CALL LEVEL ║
|
|
122
|
+
║ ║
|
|
123
|
+
║ When spawning Tasks for parallel work: ║
|
|
124
|
+
║ - Each independent unit of work = separate Task tool call ║
|
|
125
|
+
║ - All Task calls in the SAME message = truly parallel ║
|
|
126
|
+
║ - One Task that "coordinates" others = still sequential inside ║
|
|
127
|
+
║ ║
|
|
128
|
+
║ Rule: If work can be split, split it into separate Tasks. ║
|
|
129
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Large Task Decomposition (MANDATORY)
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
136
|
+
║ LARGE TASKS MUST BE SPLIT INTO PARALLEL SUB-TASKS ║
|
|
137
|
+
║ ║
|
|
138
|
+
║ Before spawning a single large Task, ASK: ║
|
|
139
|
+
║ ║
|
|
140
|
+
║ 1. Can this work be divided into independent parts? ║
|
|
141
|
+
║ → Query tests, Security tests, Exception tests ║
|
|
142
|
+
║ → Domain A, Domain B, Domain C ║
|
|
143
|
+
║ → Layer 1, Layer 2, Layer 3 ║
|
|
144
|
+
║ ║
|
|
145
|
+
║ 2. How many parallel slots available? (max 4) ║
|
|
146
|
+
║ → If 3 slots free, split into 3 parallel Tasks ║
|
|
147
|
+
║ → Maximize parallelism to minimize total time ║
|
|
148
|
+
║ ║
|
|
149
|
+
║ 3. Is estimated Task duration > 3 minutes? ║
|
|
150
|
+
║ → MUST split if work is decomposable ║
|
|
151
|
+
║ → 12 min single Task → 4 min with 3 parallel Tasks ║
|
|
152
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
153
|
+
|
|
154
|
+
Example - WRONG:
|
|
155
|
+
Task("Add tests for Query, Security, Exception, Domain")
|
|
156
|
+
→ Single agent works 12+ minutes sequentially
|
|
157
|
+
|
|
158
|
+
Example - CORRECT (3 parallel Tasks):
|
|
159
|
+
Task(agent1 → "Add Query usecase tests") ┐
|
|
160
|
+
Task(agent2 → "Add Security tests") ├─ ~4 min total
|
|
161
|
+
Task(agent3 → "Add Exception + Domain tests") ┘
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Purpose
|
|
165
|
+
|
|
166
|
+
Enable parallel execution of agents as separate instances to improve throughput for batch operations and independent tasks.
|
|
167
|
+
|
|
168
|
+
## Core Concept
|
|
169
|
+
|
|
170
|
+
Each agent (except orchestrators) can be instantiated multiple times to work on independent tasks in parallel.
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Agent (Template)
|
|
174
|
+
│
|
|
175
|
+
├── Instance 1 → Task A
|
|
176
|
+
├── Instance 2 → Task B
|
|
177
|
+
├── Instance 3 → Task C
|
|
178
|
+
└── Instance 4 → Task D
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Rules
|
|
182
|
+
|
|
183
|
+
### 1. Maximum Parallel Instances
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
limit: 4
|
|
187
|
+
reason: Balance between throughput and resource usage
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 2. Exclusions
|
|
191
|
+
|
|
192
|
+
```yaml
|
|
193
|
+
not_parallelizable:
|
|
194
|
+
- orchestrator/* (must remain singleton for coordination)
|
|
195
|
+
|
|
196
|
+
reason: |
|
|
197
|
+
Orchestrator agents manage other agents and must maintain
|
|
198
|
+
a single point of coordination to prevent conflicts.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 3. Instance Independence
|
|
202
|
+
|
|
203
|
+
```yaml
|
|
204
|
+
requirements:
|
|
205
|
+
- Tasks must be independent (no shared state)
|
|
206
|
+
- No cross-instance communication required
|
|
207
|
+
- Each instance has isolated context
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### 4. Subagent Visibility (MANDATORY)
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
214
|
+
║ TASK TOOL MUST USE SPECIFIC subagent_type (NOT general-purpose) ║
|
|
215
|
+
║ ║
|
|
216
|
+
║ When a specialized agent exists for the task: ║
|
|
217
|
+
║ → MUST use that agent's subagent_type ║
|
|
218
|
+
║ → DO NOT use "general-purpose" as a catch-all ║
|
|
219
|
+
║ ║
|
|
220
|
+
║ The HUD hook displays: [Spawn] {subagent_type}:{model} | {desc}║
|
|
221
|
+
║ Using "general-purpose" makes all spawns look identical. ║
|
|
222
|
+
║ ║
|
|
223
|
+
║ WRONG: ║
|
|
224
|
+
║ Task(subagent_type: "general-purpose", desc: "Update agents") ║
|
|
225
|
+
║ Task(subagent_type: "general-purpose", desc: "Update agents") ║
|
|
226
|
+
║ → HUD shows: [Spawn] general-purpose:sonnet | Update agents ║
|
|
227
|
+
║ → HUD shows: [Spawn] general-purpose:sonnet | Update agents ║
|
|
228
|
+
║ → User cannot distinguish which is which ║
|
|
229
|
+
║ ║
|
|
230
|
+
║ CORRECT: ║
|
|
231
|
+
║ Task(subagent_type: "mgr-creator", desc: "Create Go agent") ║
|
|
232
|
+
║ Task(subagent_type: "lang-golang-expert", desc: "Review code")║
|
|
233
|
+
║ → HUD shows: [Spawn] mgr-creator:sonnet | Create Go agent ║
|
|
234
|
+
║ → HUD shows: [Spawn] lang-golang-expert:sonnet | Review code ║
|
|
235
|
+
║ ║
|
|
236
|
+
║ When NO specialized agent exists (truly generic work): ║
|
|
237
|
+
║ → Use "general-purpose" but with UNIQUE descriptions ║
|
|
238
|
+
║ → Description MUST identify the specific batch/scope ║
|
|
239
|
+
║ ║
|
|
240
|
+
║ Task(subagent_type: "general-purpose", ║
|
|
241
|
+
║ desc: "batch1: lang-* agents") ║
|
|
242
|
+
║ Task(subagent_type: "general-purpose", ║
|
|
243
|
+
║ desc: "batch2: be-* fe-* agents") ║
|
|
244
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### 5. Model Specification (RECOMMENDED)
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
251
|
+
║ USE MODEL PARAMETER FOR COST/PERFORMANCE OPTIMIZATION ║
|
|
252
|
+
║ ║
|
|
253
|
+
║ Task tool supports `model` parameter: ║
|
|
254
|
+
║ ║
|
|
255
|
+
║ Task( ║
|
|
256
|
+
║ subagent_type: "general-purpose", ║
|
|
257
|
+
║ prompt: "...", ║
|
|
258
|
+
║ model: "haiku" ← Specify model ║
|
|
259
|
+
║ ) ║
|
|
260
|
+
║ ║
|
|
261
|
+
║ Model Selection: ║
|
|
262
|
+
║ - opus : Complex reasoning (expensive, powerful) ║
|
|
263
|
+
║ - sonnet : General tasks (default, balanced) ║
|
|
264
|
+
║ - haiku : Simple tasks (fast, cheap) ║
|
|
265
|
+
║ ║
|
|
266
|
+
║ Parallel Task Optimization: ║
|
|
267
|
+
║ - Use haiku for file search/validation tasks ║
|
|
268
|
+
║ - Use sonnet for code generation tasks ║
|
|
269
|
+
║ - Use opus only when deep reasoning is required ║
|
|
270
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Example with model specification:
|
|
274
|
+
```
|
|
275
|
+
# Parallel tasks with appropriate models
|
|
276
|
+
Task(prompt: "Search for auth files", model: "haiku") ┐
|
|
277
|
+
Task(prompt: "Implement feature A", model: "sonnet") ├─ Optimized
|
|
278
|
+
Task(prompt: "Implement feature B", model: "sonnet") │
|
|
279
|
+
Task(prompt: "Analyze architecture", model: "opus") ┘
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Instance Model
|
|
283
|
+
|
|
284
|
+
### Instantiation
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
┌─────────────────────────────────────────────────────────┐
|
|
288
|
+
│ Agent Template │
|
|
289
|
+
│ (agents/{type}/{name}/) │
|
|
290
|
+
├─────────────────────────────────────────────────────────┤
|
|
291
|
+
│ AGENT.md - Role definition │
|
|
292
|
+
│ index.yaml - Configuration │
|
|
293
|
+
│ refs/ - Skill/guide references │
|
|
294
|
+
└────────────────────────┬────────────────────────────────┘
|
|
295
|
+
│
|
|
296
|
+
┌────────────────┼────────────────┐
|
|
297
|
+
│ │ │
|
|
298
|
+
▼ ▼ ▼
|
|
299
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
300
|
+
│ Instance #1 │ │ Instance #2 │ │ Instance #3 │
|
|
301
|
+
│ Task: A │ │ Task: B │ │ Task: C │
|
|
302
|
+
│ Context: ... │ │ Context: ... │ │ Context: ... │
|
|
303
|
+
└──────────────┘ └──────────────┘ └──────────────┘
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Instance Properties
|
|
307
|
+
|
|
308
|
+
```yaml
|
|
309
|
+
instance:
|
|
310
|
+
id: "{agent-name}-{uuid}"
|
|
311
|
+
template: "{agent-path}"
|
|
312
|
+
task: "{assigned-task}"
|
|
313
|
+
context: "{isolated-context}"
|
|
314
|
+
status: "pending|running|completed|failed"
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Usage Patterns
|
|
318
|
+
|
|
319
|
+
### Batch Agent Creation
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
User: "Create golang, python, rust, typescript expert agents"
|
|
323
|
+
|
|
324
|
+
Orchestrator (secretary):
|
|
325
|
+
│
|
|
326
|
+
├── [lang-golang-expert] mgr-creator instance #1
|
|
327
|
+
├── [lang-python-expert] mgr-creator instance #2
|
|
328
|
+
├── [lang-rust-expert] mgr-creator instance #3
|
|
329
|
+
└── [lang-typescript-expert] mgr-creator instance #4
|
|
330
|
+
|
|
331
|
+
Execution: Parallel (4 instances)
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Batch Code Review
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
User: "/dev:review src/*.go src/*.py src/*.ts"
|
|
338
|
+
|
|
339
|
+
Orchestrator:
|
|
340
|
+
│
|
|
341
|
+
├── [src/*.go] lang-golang-expert instance #1
|
|
342
|
+
├── [src/*.py] lang-python-expert instance #2
|
|
343
|
+
└── [src/*.ts] lang-typescript-expert instance #3
|
|
344
|
+
|
|
345
|
+
Execution: Parallel (3 instances)
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Batch Audit
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
User: "Audit all agents"
|
|
352
|
+
|
|
353
|
+
Orchestrator (secretary):
|
|
354
|
+
│
|
|
355
|
+
├── [agent-1] mgr-supplier instance #1
|
|
356
|
+
├── [agent-2] mgr-supplier instance #2
|
|
357
|
+
├── [agent-3] mgr-supplier instance #3
|
|
358
|
+
└── [agent-4] mgr-supplier instance #4
|
|
359
|
+
|
|
360
|
+
Execution: Parallel (4 instances, batched if > 4)
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
## Coordination
|
|
364
|
+
|
|
365
|
+
### Task Distribution
|
|
366
|
+
|
|
367
|
+
```yaml
|
|
368
|
+
strategy: round_robin
|
|
369
|
+
max_instances: 4
|
|
370
|
+
queue: remaining tasks wait for available instance
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Result Aggregation
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
Instance Results:
|
|
377
|
+
#1: ✓ Success (agent-a created)
|
|
378
|
+
#2: ✓ Success (agent-b created)
|
|
379
|
+
#3: ✗ Failed (agent-c: skill not found)
|
|
380
|
+
#4: ✓ Success (agent-d created)
|
|
381
|
+
|
|
382
|
+
Aggregated Result:
|
|
383
|
+
Total: 4 tasks
|
|
384
|
+
Succeeded: 3
|
|
385
|
+
Failed: 1
|
|
386
|
+
Details: [...]
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
## Implementation Notes
|
|
390
|
+
|
|
391
|
+
### For Orchestrators
|
|
392
|
+
|
|
393
|
+
```yaml
|
|
394
|
+
responsibilities:
|
|
395
|
+
- Identify parallelizable tasks
|
|
396
|
+
- Spawn instances (max 4)
|
|
397
|
+
- Monitor instance status
|
|
398
|
+
- Aggregate results
|
|
399
|
+
- Handle failures
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### For Worker/Manager Agents
|
|
403
|
+
|
|
404
|
+
```yaml
|
|
405
|
+
requirements:
|
|
406
|
+
- Stateless task execution
|
|
407
|
+
- Isolated context per instance
|
|
408
|
+
- No shared mutable state
|
|
409
|
+
- Clear success/failure reporting
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
## Display Format
|
|
413
|
+
|
|
414
|
+
When parallel execution occurs, MUST display `Task({subagent_type}):{model}` format:
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
┌─ Agent: secretary (orchestrator)
|
|
418
|
+
└─ Task: Batch agent creation
|
|
419
|
+
|
|
420
|
+
[Parallel] Spawning 4 instances...
|
|
421
|
+
|
|
422
|
+
[Instance 1] Task(mgr-creator):sonnet → lang-golang-expert
|
|
423
|
+
[Instance 2] Task(mgr-creator):sonnet → lang-python-expert
|
|
424
|
+
[Instance 3] Task(mgr-creator):sonnet → lang-rust-expert
|
|
425
|
+
[Instance 4] Task(mgr-creator):sonnet → lang-typescript-expert
|
|
426
|
+
|
|
427
|
+
[Progress] ████████░░░░ 2/4
|
|
428
|
+
|
|
429
|
+
[Instance 1] Task(mgr-creator):sonnet ✓ lang-golang-expert created
|
|
430
|
+
[Instance 2] Task(mgr-creator):sonnet ✓ lang-python-expert created
|
|
431
|
+
[Instance 3] Task(mgr-creator):sonnet ✓ lang-rust-expert created
|
|
432
|
+
[Instance 4] Task(mgr-creator):sonnet ✓ lang-typescript-expert created
|
|
433
|
+
|
|
434
|
+
[Summary] 4/4 tasks completed successfully
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### Display Format Rules
|
|
438
|
+
|
|
439
|
+
```
|
|
440
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
441
|
+
║ PARALLEL AGENT DISPLAY FORMAT (MANDATORY) ║
|
|
442
|
+
║ ║
|
|
443
|
+
║ When announcing parallel agents, MUST show: ║
|
|
444
|
+
║ ║
|
|
445
|
+
║ Task({subagent_type}):{model} ║
|
|
446
|
+
║ ║
|
|
447
|
+
║ Examples: ║
|
|
448
|
+
║ [Instance 1] Task(general-purpose):sonnet → R006 업데이트 ║
|
|
449
|
+
║ [Instance 2] Task(lang-golang-expert):sonnet → Go 코드 리뷰 ║
|
|
450
|
+
║ [Instance 3] Task(Explore):haiku → 코드베이스 탐색 ║
|
|
451
|
+
║ [Instance 4] Task(mgr-gitnerd):sonnet → git commit ║
|
|
452
|
+
║ ║
|
|
453
|
+
║ The subagent_type MUST match the Task tool's subagent_type ║
|
|
454
|
+
║ parameter. Custom names are NOT allowed. ║
|
|
455
|
+
║ ║
|
|
456
|
+
║ This allows users to: ║
|
|
457
|
+
║ - See which model is used for each task ║
|
|
458
|
+
║ - See the exact subagent_type used ║
|
|
459
|
+
║ - Understand cost implications ║
|
|
460
|
+
║ - Debug model selection issues ║
|
|
461
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
## Benefits
|
|
465
|
+
|
|
466
|
+
1. **Throughput**: N tasks complete in ~1/N time
|
|
467
|
+
2. **Efficiency**: Better resource utilization
|
|
468
|
+
3. **User Experience**: Faster batch operations
|
|
469
|
+
4. **Scalability**: Handles large workloads
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# [MUST] Permission Rules
|
|
2
|
+
|
|
3
|
+
> **Priority**: MUST - Never violate
|
|
4
|
+
> **Principle**: Least privilege, explicit approval
|
|
5
|
+
|
|
6
|
+
## Tool Permission Tiers
|
|
7
|
+
|
|
8
|
+
### Tier 1: Always Allowed
|
|
9
|
+
```yaml
|
|
10
|
+
always_allowed:
|
|
11
|
+
- Read # Read files
|
|
12
|
+
- Glob # Search files
|
|
13
|
+
- Grep # Search content
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Tier 2: Default Allowed (Use with care)
|
|
17
|
+
```yaml
|
|
18
|
+
default_allowed:
|
|
19
|
+
- Write # Create files
|
|
20
|
+
- Edit # Modify files
|
|
21
|
+
```
|
|
22
|
+
→ State changes explicitly
|
|
23
|
+
→ Notify before modifying important files
|
|
24
|
+
|
|
25
|
+
### Tier 3: Requires Approval
|
|
26
|
+
```yaml
|
|
27
|
+
requires_approval:
|
|
28
|
+
- Bash # Execute commands
|
|
29
|
+
- WebFetch # Web access
|
|
30
|
+
- WebSearch # Web search
|
|
31
|
+
```
|
|
32
|
+
→ Request user approval on first use
|
|
33
|
+
→ State command/URL to be accessed
|
|
34
|
+
|
|
35
|
+
### Tier 4: Explicit Request Only
|
|
36
|
+
```yaml
|
|
37
|
+
explicit_request_only:
|
|
38
|
+
- Task # Create subagents
|
|
39
|
+
```
|
|
40
|
+
→ Only when user explicitly requests
|
|
41
|
+
|
|
42
|
+
## File Access
|
|
43
|
+
|
|
44
|
+
### Read Access
|
|
45
|
+
```
|
|
46
|
+
✓ All source code in project
|
|
47
|
+
✓ Config files (read-only)
|
|
48
|
+
✓ Documentation files
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Write Access
|
|
52
|
+
```
|
|
53
|
+
✓ Source code in project
|
|
54
|
+
✓ New files in project
|
|
55
|
+
✗ Sensitive configs (.env, .git/config)
|
|
56
|
+
✗ Paths outside project
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Delete Access
|
|
60
|
+
```
|
|
61
|
+
✓ Temp files created by agent
|
|
62
|
+
✗ Existing files (without explicit request)
|
|
63
|
+
✗ Entire directories
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Permission Request Format
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
[Permission Request]
|
|
70
|
+
Action: {intended action}
|
|
71
|
+
Required: {tool/access needed}
|
|
72
|
+
Reason: {why needed}
|
|
73
|
+
Risk: Low / Medium / High
|
|
74
|
+
|
|
75
|
+
Approve?
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## On Insufficient Permission
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
1. Do not attempt action
|
|
82
|
+
2. Notify user of insufficient permission
|
|
83
|
+
3. Request permission or suggest alternative
|
|
84
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# [MUST] Safety Rules
|
|
2
|
+
|
|
3
|
+
> **Priority**: MUST - Never violate
|
|
4
|
+
> **On violation**: Stop immediately, report to user
|
|
5
|
+
|
|
6
|
+
## Prohibited Actions
|
|
7
|
+
|
|
8
|
+
### 1. Data Protection
|
|
9
|
+
```
|
|
10
|
+
[PROHIBITED]
|
|
11
|
+
- Expose API keys, secrets, passwords
|
|
12
|
+
- Collect personal info without consent
|
|
13
|
+
- Log authentication tokens
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 2. File System
|
|
17
|
+
```
|
|
18
|
+
[PROHIBITED]
|
|
19
|
+
- Modify system files (/etc, /usr, /bin)
|
|
20
|
+
- Delete files outside project
|
|
21
|
+
- Modify hidden configs (.env, .git/config) without approval
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 3. Command Execution
|
|
25
|
+
```
|
|
26
|
+
[PROHIBITED]
|
|
27
|
+
- rm -rf / or broad delete commands
|
|
28
|
+
- System shutdown/restart
|
|
29
|
+
- Privilege escalation (sudo, su)
|
|
30
|
+
- Network configuration changes
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 4. External Communication
|
|
34
|
+
```
|
|
35
|
+
[PROHIBITED]
|
|
36
|
+
- Access external URLs without approval
|
|
37
|
+
- Send user data externally
|
|
38
|
+
- Download and execute unknown scripts
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Required Actions
|
|
42
|
+
|
|
43
|
+
### Before Destructive Operations
|
|
44
|
+
```
|
|
45
|
+
[REQUIRED]
|
|
46
|
+
□ Verify target
|
|
47
|
+
□ Assess impact scope
|
|
48
|
+
□ Check recoverability
|
|
49
|
+
□ Get user approval
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### On Risk Detection
|
|
53
|
+
```
|
|
54
|
+
→ Stop immediately
|
|
55
|
+
→ Report risk
|
|
56
|
+
→ Wait for user instruction
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Violation Response
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
1. Stop all operations
|
|
63
|
+
2. Preserve current state
|
|
64
|
+
3. Report to user:
|
|
65
|
+
- What was detected
|
|
66
|
+
- Why it's risky
|
|
67
|
+
- What action was taken
|
|
68
|
+
4. Wait for instructions
|
|
69
|
+
```
|