oh-my-customcode 0.1.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/LICENSE +21 -0
- package/README.md +287 -0
- package/dist/cli/index.js +13299 -0
- package/dist/index.js +927 -0
- package/package.json +74 -0
- package/templates/.claude/contexts/dev.md +20 -0
- package/templates/.claude/contexts/ecomode.md +63 -0
- package/templates/.claude/contexts/index.yaml +41 -0
- package/templates/.claude/contexts/research.md +28 -0
- package/templates/.claude/contexts/review.md +23 -0
- package/templates/.claude/hooks/hooks.json +185 -0
- package/templates/.claude/hooks/hud/index.yaml +27 -0
- package/templates/.claude/hooks/hud/update-status.sh +32 -0
- package/templates/.claude/hooks/index.yaml +46 -0
- package/templates/.claude/hooks/memory-persistence/pre-compact.sh +37 -0
- package/templates/.claude/hooks/memory-persistence/session-end.sh +64 -0
- package/templates/.claude/hooks/memory-persistence/session-start.sh +41 -0
- package/templates/.claude/hooks/strategic-compact/suggest-compact.sh +50 -0
- package/templates/.claude/install-hooks.sh +100 -0
- package/templates/.claude/rules/MAY-optimization.md +93 -0
- package/templates/.claude/rules/MUST-agent-design.md +107 -0
- package/templates/.claude/rules/MUST-agent-identification.md +108 -0
- package/templates/.claude/rules/MUST-continuous-improvement.md +132 -0
- package/templates/.claude/rules/MUST-intent-transparency.md +199 -0
- package/templates/.claude/rules/MUST-language-policy.md +62 -0
- package/templates/.claude/rules/MUST-orchestrator-coordination.md +266 -0
- package/templates/.claude/rules/MUST-parallel-execution.md +341 -0
- package/templates/.claude/rules/MUST-permissions.md +84 -0
- package/templates/.claude/rules/MUST-safety.md +69 -0
- package/templates/.claude/rules/MUST-sync-verification.md +219 -0
- package/templates/.claude/rules/MUST-tool-identification.md +112 -0
- package/templates/.claude/rules/SHOULD-ecomode.md +145 -0
- package/templates/.claude/rules/SHOULD-error-handling.md +102 -0
- package/templates/.claude/rules/SHOULD-hud-statusline.md +89 -0
- package/templates/.claude/rules/SHOULD-interaction.md +103 -0
- package/templates/.claude/rules/SHOULD-memory-integration.md +114 -0
- package/templates/.claude/rules/SHOULD-pipeline-mode.md +165 -0
- package/templates/.claude/rules/index.yaml +125 -0
- package/templates/.claude/uninstall-hooks.sh +52 -0
- package/templates/CLAUDE.md.en +259 -0
- package/templates/CLAUDE.md.ko +259 -0
- package/templates/agents/index.yaml +237 -0
- package/templates/agents/infra-engineer/aws-expert/AGENT.md +47 -0
- package/templates/agents/infra-engineer/aws-expert/index.yaml +27 -0
- package/templates/agents/infra-engineer/docker-expert/AGENT.md +47 -0
- package/templates/agents/infra-engineer/docker-expert/index.yaml +27 -0
- package/templates/agents/manager/creator/AGENT.md +274 -0
- package/templates/agents/manager/creator/index.yaml +66 -0
- package/templates/agents/manager/gitnerd/AGENT.md +91 -0
- package/templates/agents/manager/gitnerd/index.yaml +55 -0
- package/templates/agents/manager/sauron/AGENT.md +153 -0
- package/templates/agents/manager/sauron/index.yaml +52 -0
- package/templates/agents/manager/supplier/AGENT.md +142 -0
- package/templates/agents/manager/supplier/index.yaml +31 -0
- package/templates/agents/manager/sync-checker/AGENT.md +34 -0
- package/templates/agents/manager/sync-checker/index.yaml +32 -0
- package/templates/agents/manager/updater/AGENT.md +125 -0
- package/templates/agents/manager/updater/index.yaml +31 -0
- package/templates/agents/orchestrator/dev-lead/AGENT.md +116 -0
- package/templates/agents/orchestrator/dev-lead/index.yaml +73 -0
- package/templates/agents/orchestrator/planner/AGENT.md +102 -0
- package/templates/agents/orchestrator/planner/index.yaml +38 -0
- package/templates/agents/orchestrator/qa-lead/AGENT.md +92 -0
- package/templates/agents/orchestrator/qa-lead/index.yaml +40 -0
- package/templates/agents/orchestrator/secretary/AGENT.md +132 -0
- package/templates/agents/orchestrator/secretary/index.yaml +55 -0
- package/templates/agents/qa-team/qa-engineer/AGENT.md +98 -0
- package/templates/agents/qa-team/qa-engineer/index.yaml +59 -0
- package/templates/agents/qa-team/qa-planner/AGENT.md +75 -0
- package/templates/agents/qa-team/qa-planner/index.yaml +47 -0
- package/templates/agents/qa-team/qa-writer/AGENT.md +98 -0
- package/templates/agents/qa-team/qa-writer/index.yaml +44 -0
- package/templates/agents/sw-architect/documenter/AGENT.md +120 -0
- package/templates/agents/sw-architect/documenter/index.yaml +39 -0
- package/templates/agents/sw-architect/speckit-agent/AGENT.md +127 -0
- package/templates/agents/sw-architect/speckit-agent/index.yaml +78 -0
- package/templates/agents/sw-engineer/backend/express-expert/AGENT.md +132 -0
- package/templates/agents/sw-engineer/backend/express-expert/index.yaml +36 -0
- package/templates/agents/sw-engineer/backend/fastapi-expert/AGENT.md +47 -0
- package/templates/agents/sw-engineer/backend/fastapi-expert/index.yaml +27 -0
- package/templates/agents/sw-engineer/backend/go-backend-expert/AGENT.md +47 -0
- package/templates/agents/sw-engineer/backend/go-backend-expert/index.yaml +27 -0
- package/templates/agents/sw-engineer/backend/nestjs-expert/AGENT.md +107 -0
- package/templates/agents/sw-engineer/backend/nestjs-expert/index.yaml +43 -0
- package/templates/agents/sw-engineer/backend/springboot-expert/AGENT.md +103 -0
- package/templates/agents/sw-engineer/backend/springboot-expert/index.yaml +69 -0
- package/templates/agents/sw-engineer/frontend/svelte-agent/AGENT.md +71 -0
- package/templates/agents/sw-engineer/frontend/svelte-agent/index.yaml +41 -0
- package/templates/agents/sw-engineer/frontend/vercel-agent/AGENT.md +67 -0
- package/templates/agents/sw-engineer/frontend/vercel-agent/index.yaml +43 -0
- package/templates/agents/sw-engineer/frontend/vuejs-agent/AGENT.md +71 -0
- package/templates/agents/sw-engineer/frontend/vuejs-agent/index.yaml +48 -0
- package/templates/agents/sw-engineer/language/golang-expert/AGENT.md +47 -0
- package/templates/agents/sw-engineer/language/golang-expert/index.yaml +27 -0
- package/templates/agents/sw-engineer/language/java21-expert/AGENT.md +122 -0
- package/templates/agents/sw-engineer/language/java21-expert/index.yaml +51 -0
- package/templates/agents/sw-engineer/language/kotlin-expert/AGENT.md +47 -0
- package/templates/agents/sw-engineer/language/kotlin-expert/index.yaml +27 -0
- package/templates/agents/sw-engineer/language/python-expert/AGENT.md +47 -0
- package/templates/agents/sw-engineer/language/python-expert/index.yaml +27 -0
- package/templates/agents/sw-engineer/language/rust-expert/AGENT.md +47 -0
- package/templates/agents/sw-engineer/language/rust-expert/index.yaml +27 -0
- package/templates/agents/sw-engineer/language/typescript-expert/AGENT.md +47 -0
- package/templates/agents/sw-engineer/language/typescript-expert/index.yaml +27 -0
- package/templates/agents/sw-engineer/tooling/bun-expert/AGENT.md +73 -0
- package/templates/agents/sw-engineer/tooling/bun-expert/index.yaml +46 -0
- package/templates/agents/sw-engineer/tooling/npm-expert/AGENT.md +160 -0
- package/templates/agents/sw-engineer/tooling/npm-expert/index.yaml +45 -0
- package/templates/agents/sw-engineer/tooling/optimizer/AGENT.md +170 -0
- package/templates/agents/sw-engineer/tooling/optimizer/index.yaml +45 -0
- package/templates/agents/system/memory-keeper/AGENT.md +126 -0
- package/templates/agents/system/memory-keeper/index.yaml +45 -0
- package/templates/agents/system/naggy/AGENT.md +72 -0
- package/templates/agents/system/naggy/index.yaml +35 -0
- package/templates/commands/COMMANDS.md +136 -0
- package/templates/commands/creator/agent.md +121 -0
- package/templates/commands/dev/refactor.md +126 -0
- package/templates/commands/dev/review.md +82 -0
- package/templates/commands/git/branch.yaml +8 -0
- package/templates/commands/git/commit.yaml +4 -0
- package/templates/commands/git/pr.yaml +4 -0
- package/templates/commands/git/status.yaml +4 -0
- package/templates/commands/git/sync.yaml +4 -0
- package/templates/commands/index.yaml +225 -0
- package/templates/commands/intent/explain.md +144 -0
- package/templates/commands/memory/recall.md +164 -0
- package/templates/commands/memory/save.md +128 -0
- package/templates/commands/naggy/add.yaml +8 -0
- package/templates/commands/naggy/done.yaml +8 -0
- package/templates/commands/naggy/list.yaml +4 -0
- package/templates/commands/naggy/priority.yaml +11 -0
- package/templates/commands/naggy/remind.yaml +4 -0
- package/templates/commands/npm/audit.yaml +62 -0
- package/templates/commands/npm/publish.yaml +52 -0
- package/templates/commands/npm/version.yaml +62 -0
- package/templates/commands/optimize/analyze.yaml +34 -0
- package/templates/commands/optimize/bundle.yaml +50 -0
- package/templates/commands/optimize/report.yaml +56 -0
- package/templates/commands/pipeline/list.md +81 -0
- package/templates/commands/pipeline/run.md +127 -0
- package/templates/commands/sauron/quick.yaml +4 -0
- package/templates/commands/sauron/report.yaml +4 -0
- package/templates/commands/sauron/watch.yaml +4 -0
- package/templates/commands/supplier/audit.md +133 -0
- package/templates/commands/supplier/fix.md +121 -0
- package/templates/commands/sync/agents.yaml +4 -0
- package/templates/commands/sync/check.yaml +4 -0
- package/templates/commands/sync/commands.yaml +4 -0
- package/templates/commands/sync/docs.yaml +4 -0
- package/templates/commands/sync/fix.yaml +4 -0
- package/templates/commands/system/help.md +137 -0
- package/templates/commands/system/lists.md +86 -0
- package/templates/commands/system/status.md +163 -0
- package/templates/commands/updater/docs.md +165 -0
- package/templates/commands/updater/external.md +214 -0
- package/templates/guides/aws/common-patterns.md +169 -0
- package/templates/guides/aws/index.yaml +26 -0
- package/templates/guides/aws/well-architected.md +143 -0
- package/templates/guides/claude-code/01-overview.md +42 -0
- package/templates/guides/claude-code/03-tools.md +107 -0
- package/templates/guides/claude-code/04-agent-skills.md +90 -0
- package/templates/guides/claude-code/05-agent-sdk.md +129 -0
- package/templates/guides/claude-code/06-mcp.md +165 -0
- package/templates/guides/claude-code/07-prompt-engineering.md +100 -0
- package/templates/guides/claude-code/08-testing.md +58 -0
- package/templates/guides/claude-code/09-guardrails.md +80 -0
- package/templates/guides/claude-code/10-monitoring.md +89 -0
- package/templates/guides/claude-code/index.yaml +51 -0
- package/templates/guides/docker/compose-best-practices.md +284 -0
- package/templates/guides/docker/dockerfile-best-practices.md +262 -0
- package/templates/guides/docker/index.yaml +26 -0
- package/templates/guides/fastapi/best-practices.md +232 -0
- package/templates/guides/fastapi/index.yaml +21 -0
- package/templates/guides/go-backend/index.yaml +26 -0
- package/templates/guides/go-backend/project-layout.md +243 -0
- package/templates/guides/go-backend/uber-style.md +212 -0
- package/templates/guides/golang/concurrency.md +282 -0
- package/templates/guides/golang/effective-go.md +309 -0
- package/templates/guides/golang/error-handling.md +250 -0
- package/templates/guides/golang/index.yaml +27 -0
- package/templates/guides/index.yaml +101 -0
- package/templates/guides/kotlin/coding-conventions.md +247 -0
- package/templates/guides/kotlin/idioms.md +234 -0
- package/templates/guides/kotlin/index.yaml +26 -0
- package/templates/guides/python/index.yaml +26 -0
- package/templates/guides/python/pep8-style-guide.md +202 -0
- package/templates/guides/python/zen-of-python.md +79 -0
- package/templates/guides/rust/error-handling.md +262 -0
- package/templates/guides/rust/index.yaml +26 -0
- package/templates/guides/rust/ownership.md +180 -0
- package/templates/guides/springboot/best-practices.md +361 -0
- package/templates/guides/springboot/index.yaml +22 -0
- package/templates/guides/typescript/advanced-types.md +225 -0
- package/templates/guides/typescript/index.yaml +26 -0
- package/templates/guides/typescript/type-system.md +219 -0
- package/templates/guides/web-design/accessibility.md +66 -0
- package/templates/guides/web-design/index.yaml +20 -0
- package/templates/guides/web-design/performance.md +102 -0
- package/templates/pipelines/examples/code-review.yaml +66 -0
- package/templates/pipelines/index.yaml +18 -0
- package/templates/pipelines/templates/pipeline-template.yaml +50 -0
- package/templates/skills/backend/fastapi-best-practices/SKILL.md +269 -0
- package/templates/skills/backend/fastapi-best-practices/index.yaml +25 -0
- package/templates/skills/backend/go-backend-best-practices/SKILL.md +337 -0
- package/templates/skills/backend/go-backend-best-practices/index.yaml +26 -0
- package/templates/skills/backend/springboot-best-practices/SKILL.md +356 -0
- package/templates/skills/backend/springboot-best-practices/index.yaml +27 -0
- package/templates/skills/development/go-best-practices/SKILL.md +202 -0
- package/templates/skills/development/go-best-practices/index.yaml +25 -0
- package/templates/skills/development/kotlin-best-practices/SKILL.md +255 -0
- package/templates/skills/development/kotlin-best-practices/index.yaml +27 -0
- package/templates/skills/development/python-best-practices/SKILL.md +221 -0
- package/templates/skills/development/python-best-practices/index.yaml +25 -0
- package/templates/skills/development/react-best-practices/SKILL.md +100 -0
- package/templates/skills/development/react-best-practices/index.yaml +39 -0
- package/templates/skills/development/rust-best-practices/SKILL.md +266 -0
- package/templates/skills/development/rust-best-practices/index.yaml +26 -0
- package/templates/skills/development/typescript-best-practices/SKILL.md +320 -0
- package/templates/skills/development/typescript-best-practices/index.yaml +28 -0
- package/templates/skills/development/vercel-deploy/SKILL.md +73 -0
- package/templates/skills/development/vercel-deploy/index.yaml +30 -0
- package/templates/skills/development/web-design-guidelines/SKILL.md +117 -0
- package/templates/skills/development/web-design-guidelines/index.yaml +34 -0
- package/templates/skills/index.yaml +129 -0
- package/templates/skills/infrastructure/aws-best-practices/SKILL.md +279 -0
- package/templates/skills/infrastructure/aws-best-practices/index.yaml +27 -0
- package/templates/skills/infrastructure/docker-best-practices/SKILL.md +274 -0
- package/templates/skills/infrastructure/docker-best-practices/index.yaml +26 -0
- package/templates/skills/orchestration/intent-detection/SKILL.md +214 -0
- package/templates/skills/orchestration/intent-detection/index.yaml +30 -0
- package/templates/skills/orchestration/intent-detection/patterns/agent-triggers.yaml +333 -0
- package/templates/skills/orchestration/pipeline-execution/SKILL.md +188 -0
- package/templates/skills/orchestration/pipeline-execution/index.yaml +27 -0
- package/templates/skills/system/memory-management/SKILL.md +194 -0
- package/templates/skills/system/memory-management/index.yaml +30 -0
- package/templates/skills/system/result-aggregation/SKILL.md +163 -0
- package/templates/skills/system/result-aggregation/index.yaml +36 -0
|
@@ -0,0 +1,341 @@
|
|
|
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
|
+
Detection criteria for parallel execution:
|
|
13
|
+
- Tasks don't share mutable state
|
|
14
|
+
- Tasks don't have sequential dependencies
|
|
15
|
+
- Tasks can complete independently
|
|
16
|
+
|
|
17
|
+
If ALL criteria met → MUST execute in parallel (max 4 instances)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### How to Detect Independent Tasks
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Independent (MUST parallelize):
|
|
24
|
+
✓ "Create agents A, B, C" → 3 separate creations
|
|
25
|
+
✓ "Read files X, Y, Z" → 3 separate reads
|
|
26
|
+
✓ "Review code in src/, test/, docs/" → 3 separate reviews
|
|
27
|
+
|
|
28
|
+
Dependent (sequential OK):
|
|
29
|
+
✗ "Create agent then configure it" → depends on creation
|
|
30
|
+
✗ "Build then test" → test depends on build
|
|
31
|
+
✗ "Read file then edit it" → edit depends on read content
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Failure to parallelize independent tasks = Rule violation = Must be corrected.
|
|
35
|
+
|
|
36
|
+
### Self-Check Before Every Multi-File Operation
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
40
|
+
║ BEFORE writing/creating multiple files, ASK YOURSELF: ║
|
|
41
|
+
║ ║
|
|
42
|
+
║ 1. Are these files independent of each other? ║
|
|
43
|
+
║ → YES: Use Task tool to spawn parallel agents ║
|
|
44
|
+
║ → NO: Sequential is OK ║
|
|
45
|
+
║ ║
|
|
46
|
+
║ 2. Am I using Write/Edit sequentially for 3+ files? ║
|
|
47
|
+
║ → STOP. This is likely a violation. ║
|
|
48
|
+
║ → Spawn parallel agents instead. ║
|
|
49
|
+
║ ║
|
|
50
|
+
║ 3. Are there domain-specific experts available? ║
|
|
51
|
+
║ → YES: Delegate to them (kotlin-expert, springboot-expert) ║
|
|
52
|
+
║ → NO: Create general-purpose parallel agents ║
|
|
53
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Common Violations to Avoid
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
❌ WRONG: Writing files one by one
|
|
60
|
+
Write(file1.kt) → Write(file2.kt) → Write(file3.kt) → Write(file4.kt)
|
|
61
|
+
|
|
62
|
+
✓ CORRECT: Spawn parallel agents
|
|
63
|
+
Task(agent1 → file1.kt) ┐
|
|
64
|
+
Task(agent2 → file2.kt) ├─ All in single message
|
|
65
|
+
Task(agent3 → file3.kt) │
|
|
66
|
+
Task(agent4 → file4.kt) ┘
|
|
67
|
+
|
|
68
|
+
❌ WRONG: Secretary doing all the work
|
|
69
|
+
Secretary writes domain/, usecase/, infrastructure/ sequentially
|
|
70
|
+
|
|
71
|
+
✓ CORRECT: Delegate to specialists
|
|
72
|
+
Task(kotlin-expert → domain layer)
|
|
73
|
+
Task(springboot-expert → infrastructure layer)
|
|
74
|
+
Task(kotlin-expert → usecase layer)
|
|
75
|
+
|
|
76
|
+
❌ WRONG: Single Task delegating to multiple agents
|
|
77
|
+
Task(dev-lead → "coordinate kotlin-expert and springboot-expert")
|
|
78
|
+
|
|
79
|
+
This creates a SEQUENTIAL bottleneck inside the Task!
|
|
80
|
+
|
|
81
|
+
✓ CORRECT: Multiple Tasks in parallel, one per agent
|
|
82
|
+
Task(kotlin-expert → usecase commands) ┐
|
|
83
|
+
Task(kotlin-expert → usecase queries) ├─ All spawned together
|
|
84
|
+
Task(springboot-expert → persistence) │
|
|
85
|
+
Task(springboot-expert → security) ┘
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Parallel Task Spawning Rule
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
92
|
+
║ PARALLEL MEANS PARALLEL AT THE TOOL CALL LEVEL ║
|
|
93
|
+
║ ║
|
|
94
|
+
║ When spawning Tasks for parallel work: ║
|
|
95
|
+
║ - Each independent unit of work = separate Task tool call ║
|
|
96
|
+
║ - All Task calls in the SAME message = truly parallel ║
|
|
97
|
+
║ - One Task that "coordinates" others = still sequential inside ║
|
|
98
|
+
║ ║
|
|
99
|
+
║ Rule: If work can be split, split it into separate Tasks. ║
|
|
100
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Large Task Decomposition (MANDATORY)
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
╔══════════════════════════════════════════════════════════════════╗
|
|
107
|
+
║ LARGE TASKS MUST BE SPLIT INTO PARALLEL SUB-TASKS ║
|
|
108
|
+
║ ║
|
|
109
|
+
║ Before spawning a single large Task, ASK: ║
|
|
110
|
+
║ ║
|
|
111
|
+
║ 1. Can this work be divided into independent parts? ║
|
|
112
|
+
║ → Query tests, Security tests, Exception tests ║
|
|
113
|
+
║ → Domain A, Domain B, Domain C ║
|
|
114
|
+
║ → Layer 1, Layer 2, Layer 3 ║
|
|
115
|
+
║ ║
|
|
116
|
+
║ 2. How many parallel slots available? (max 4) ║
|
|
117
|
+
║ → If 3 slots free, split into 3 parallel Tasks ║
|
|
118
|
+
║ → Maximize parallelism to minimize total time ║
|
|
119
|
+
║ ║
|
|
120
|
+
║ 3. Is estimated Task duration > 3 minutes? ║
|
|
121
|
+
║ → MUST split if work is decomposable ║
|
|
122
|
+
║ → 12 min single Task → 4 min with 3 parallel Tasks ║
|
|
123
|
+
╚══════════════════════════════════════════════════════════════════╝
|
|
124
|
+
|
|
125
|
+
Example - WRONG:
|
|
126
|
+
Task("Add tests for Query, Security, Exception, Domain")
|
|
127
|
+
→ Single agent works 12+ minutes sequentially
|
|
128
|
+
|
|
129
|
+
Example - CORRECT (3 parallel Tasks):
|
|
130
|
+
Task(agent1 → "Add Query usecase tests") ┐
|
|
131
|
+
Task(agent2 → "Add Security tests") ├─ ~4 min total
|
|
132
|
+
Task(agent3 → "Add Exception + Domain tests") ┘
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Purpose
|
|
136
|
+
|
|
137
|
+
Enable parallel execution of agents as separate instances to improve throughput for batch operations and independent tasks.
|
|
138
|
+
|
|
139
|
+
## Core Concept
|
|
140
|
+
|
|
141
|
+
Each agent (except orchestrators) can be instantiated multiple times to work on independent tasks in parallel.
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
Agent (Template)
|
|
145
|
+
│
|
|
146
|
+
├── Instance 1 → Task A
|
|
147
|
+
├── Instance 2 → Task B
|
|
148
|
+
├── Instance 3 → Task C
|
|
149
|
+
└── Instance 4 → Task D
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Rules
|
|
153
|
+
|
|
154
|
+
### 1. Maximum Parallel Instances
|
|
155
|
+
|
|
156
|
+
```yaml
|
|
157
|
+
limit: 4
|
|
158
|
+
reason: Balance between throughput and resource usage
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### 2. Exclusions
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
not_parallelizable:
|
|
165
|
+
- orchestrator/* (must remain singleton for coordination)
|
|
166
|
+
|
|
167
|
+
reason: |
|
|
168
|
+
Orchestrator agents manage other agents and must maintain
|
|
169
|
+
a single point of coordination to prevent conflicts.
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 3. Instance Independence
|
|
173
|
+
|
|
174
|
+
```yaml
|
|
175
|
+
requirements:
|
|
176
|
+
- Tasks must be independent (no shared state)
|
|
177
|
+
- No cross-instance communication required
|
|
178
|
+
- Each instance has isolated context
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Instance Model
|
|
182
|
+
|
|
183
|
+
### Instantiation
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
┌─────────────────────────────────────────────────────────┐
|
|
187
|
+
│ Agent Template │
|
|
188
|
+
│ (agents/{type}/{name}/) │
|
|
189
|
+
├─────────────────────────────────────────────────────────┤
|
|
190
|
+
│ AGENT.md - Role definition │
|
|
191
|
+
│ index.yaml - Configuration │
|
|
192
|
+
│ refs/ - Skill/guide references │
|
|
193
|
+
└────────────────────────┬────────────────────────────────┘
|
|
194
|
+
│
|
|
195
|
+
┌────────────────┼────────────────┐
|
|
196
|
+
│ │ │
|
|
197
|
+
▼ ▼ ▼
|
|
198
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
199
|
+
│ Instance #1 │ │ Instance #2 │ │ Instance #3 │
|
|
200
|
+
│ Task: A │ │ Task: B │ │ Task: C │
|
|
201
|
+
│ Context: ... │ │ Context: ... │ │ Context: ... │
|
|
202
|
+
└──────────────┘ └──────────────┘ └──────────────┘
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Instance Properties
|
|
206
|
+
|
|
207
|
+
```yaml
|
|
208
|
+
instance:
|
|
209
|
+
id: "{agent-name}-{uuid}"
|
|
210
|
+
template: "{agent-path}"
|
|
211
|
+
task: "{assigned-task}"
|
|
212
|
+
context: "{isolated-context}"
|
|
213
|
+
status: "pending|running|completed|failed"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Usage Patterns
|
|
217
|
+
|
|
218
|
+
### Batch Agent Creation
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
User: "Create golang, python, rust, typescript expert agents"
|
|
222
|
+
|
|
223
|
+
Orchestrator (secretary):
|
|
224
|
+
│
|
|
225
|
+
├── [golang-expert] creator instance #1
|
|
226
|
+
├── [python-expert] creator instance #2
|
|
227
|
+
├── [rust-expert] creator instance #3
|
|
228
|
+
└── [typescript-expert] creator instance #4
|
|
229
|
+
|
|
230
|
+
Execution: Parallel (4 instances)
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Batch Code Review
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
User: "/dev:review src/*.go src/*.py src/*.ts"
|
|
237
|
+
|
|
238
|
+
Orchestrator:
|
|
239
|
+
│
|
|
240
|
+
├── [src/*.go] golang-expert instance #1
|
|
241
|
+
├── [src/*.py] python-expert instance #2
|
|
242
|
+
└── [src/*.ts] typescript-expert instance #3
|
|
243
|
+
|
|
244
|
+
Execution: Parallel (3 instances)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Batch Audit
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
User: "Audit all agents"
|
|
251
|
+
|
|
252
|
+
Orchestrator (secretary):
|
|
253
|
+
│
|
|
254
|
+
├── [agent-1] supplier instance #1
|
|
255
|
+
├── [agent-2] supplier instance #2
|
|
256
|
+
├── [agent-3] supplier instance #3
|
|
257
|
+
└── [agent-4] supplier instance #4
|
|
258
|
+
|
|
259
|
+
Execution: Parallel (4 instances, batched if > 4)
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Coordination
|
|
263
|
+
|
|
264
|
+
### Task Distribution
|
|
265
|
+
|
|
266
|
+
```yaml
|
|
267
|
+
strategy: round_robin
|
|
268
|
+
max_instances: 4
|
|
269
|
+
queue: remaining tasks wait for available instance
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Result Aggregation
|
|
273
|
+
|
|
274
|
+
```
|
|
275
|
+
Instance Results:
|
|
276
|
+
#1: ✓ Success (agent-a created)
|
|
277
|
+
#2: ✓ Success (agent-b created)
|
|
278
|
+
#3: ✗ Failed (agent-c: skill not found)
|
|
279
|
+
#4: ✓ Success (agent-d created)
|
|
280
|
+
|
|
281
|
+
Aggregated Result:
|
|
282
|
+
Total: 4 tasks
|
|
283
|
+
Succeeded: 3
|
|
284
|
+
Failed: 1
|
|
285
|
+
Details: [...]
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Implementation Notes
|
|
289
|
+
|
|
290
|
+
### For Orchestrators
|
|
291
|
+
|
|
292
|
+
```yaml
|
|
293
|
+
responsibilities:
|
|
294
|
+
- Identify parallelizable tasks
|
|
295
|
+
- Spawn instances (max 4)
|
|
296
|
+
- Monitor instance status
|
|
297
|
+
- Aggregate results
|
|
298
|
+
- Handle failures
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### For Worker/Manager Agents
|
|
302
|
+
|
|
303
|
+
```yaml
|
|
304
|
+
requirements:
|
|
305
|
+
- Stateless task execution
|
|
306
|
+
- Isolated context per instance
|
|
307
|
+
- No shared mutable state
|
|
308
|
+
- Clear success/failure reporting
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## Display Format
|
|
312
|
+
|
|
313
|
+
When parallel execution occurs:
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
┌─ Agent: secretary (orchestrator)
|
|
317
|
+
└─ Task: Batch agent creation
|
|
318
|
+
|
|
319
|
+
[Parallel] Spawning 4 instances...
|
|
320
|
+
|
|
321
|
+
[Instance 1] creator → golang-expert
|
|
322
|
+
[Instance 2] creator → python-expert
|
|
323
|
+
[Instance 3] creator → rust-expert
|
|
324
|
+
[Instance 4] creator → typescript-expert
|
|
325
|
+
|
|
326
|
+
[Progress] ████████░░░░ 2/4
|
|
327
|
+
|
|
328
|
+
[Instance 1] ✓ golang-expert created
|
|
329
|
+
[Instance 2] ✓ python-expert created
|
|
330
|
+
[Instance 3] ✓ rust-expert created
|
|
331
|
+
[Instance 4] ✓ typescript-expert created
|
|
332
|
+
|
|
333
|
+
[Summary] 4/4 tasks completed successfully
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Benefits
|
|
337
|
+
|
|
338
|
+
1. **Throughput**: N tasks complete in ~1/N time
|
|
339
|
+
2. **Efficiency**: Better resource utilization
|
|
340
|
+
3. **User Experience**: Faster batch operations
|
|
341
|
+
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
|
+
```
|