opencode-metis 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/README.md +140 -0
- package/dist/cli.cjs +63 -0
- package/dist/mcp-server.cjs +51 -0
- package/dist/plugin.cjs +4 -0
- package/dist/worker.cjs +224 -0
- package/opencode/agent/the-analyst/feature-prioritization.md +66 -0
- package/opencode/agent/the-analyst/market-research.md +77 -0
- package/opencode/agent/the-analyst/project-coordination.md +81 -0
- package/opencode/agent/the-analyst/requirements-analysis.md +77 -0
- package/opencode/agent/the-architect/compatibility-review.md +138 -0
- package/opencode/agent/the-architect/complexity-review.md +137 -0
- package/opencode/agent/the-architect/quality-review.md +67 -0
- package/opencode/agent/the-architect/security-review.md +127 -0
- package/opencode/agent/the-architect/system-architecture.md +119 -0
- package/opencode/agent/the-architect/system-documentation.md +83 -0
- package/opencode/agent/the-architect/technology-research.md +85 -0
- package/opencode/agent/the-chief.md +79 -0
- package/opencode/agent/the-designer/accessibility-implementation.md +101 -0
- package/opencode/agent/the-designer/design-foundation.md +74 -0
- package/opencode/agent/the-designer/interaction-architecture.md +75 -0
- package/opencode/agent/the-designer/user-research.md +70 -0
- package/opencode/agent/the-meta-agent.md +155 -0
- package/opencode/agent/the-platform-engineer/ci-cd-pipelines.md +109 -0
- package/opencode/agent/the-platform-engineer/containerization.md +106 -0
- package/opencode/agent/the-platform-engineer/data-architecture.md +81 -0
- package/opencode/agent/the-platform-engineer/dependency-review.md +144 -0
- package/opencode/agent/the-platform-engineer/deployment-automation.md +81 -0
- package/opencode/agent/the-platform-engineer/infrastructure-as-code.md +107 -0
- package/opencode/agent/the-platform-engineer/performance-tuning.md +82 -0
- package/opencode/agent/the-platform-engineer/pipeline-engineering.md +81 -0
- package/opencode/agent/the-platform-engineer/production-monitoring.md +105 -0
- package/opencode/agent/the-qa-engineer/exploratory-testing.md +66 -0
- package/opencode/agent/the-qa-engineer/performance-testing.md +81 -0
- package/opencode/agent/the-qa-engineer/quality-assurance.md +77 -0
- package/opencode/agent/the-qa-engineer/test-execution.md +66 -0
- package/opencode/agent/the-software-engineer/api-development.md +78 -0
- package/opencode/agent/the-software-engineer/component-development.md +79 -0
- package/opencode/agent/the-software-engineer/concurrency-review.md +141 -0
- package/opencode/agent/the-software-engineer/domain-modeling.md +66 -0
- package/opencode/agent/the-software-engineer/performance-optimization.md +113 -0
- package/opencode/command/analyze.md +149 -0
- package/opencode/command/constitution.md +178 -0
- package/opencode/command/debug.md +194 -0
- package/opencode/command/document.md +178 -0
- package/opencode/command/implement.md +225 -0
- package/opencode/command/refactor.md +207 -0
- package/opencode/command/review.md +229 -0
- package/opencode/command/simplify.md +267 -0
- package/opencode/command/specify.md +191 -0
- package/opencode/command/validate.md +224 -0
- package/opencode/skill/accessibility-design/SKILL.md +566 -0
- package/opencode/skill/accessibility-design/checklists/wcag-checklist.md +435 -0
- package/opencode/skill/agent-coordination/SKILL.md +224 -0
- package/opencode/skill/api-contract-design/SKILL.md +550 -0
- package/opencode/skill/api-contract-design/templates/graphql-schema-template.md +818 -0
- package/opencode/skill/api-contract-design/templates/rest-api-template.md +417 -0
- package/opencode/skill/architecture-design/SKILL.md +160 -0
- package/opencode/skill/architecture-design/examples/architecture-examples.md +170 -0
- package/opencode/skill/architecture-design/template.md +749 -0
- package/opencode/skill/architecture-design/validation.md +99 -0
- package/opencode/skill/architecture-selection/SKILL.md +522 -0
- package/opencode/skill/architecture-selection/examples/adrs/001-example-adr.md +71 -0
- package/opencode/skill/architecture-selection/examples/architecture-patterns.md +239 -0
- package/opencode/skill/bug-diagnosis/SKILL.md +235 -0
- package/opencode/skill/code-quality-review/SKILL.md +337 -0
- package/opencode/skill/code-quality-review/examples/anti-patterns.md +629 -0
- package/opencode/skill/code-quality-review/reference.md +322 -0
- package/opencode/skill/code-review/SKILL.md +363 -0
- package/opencode/skill/code-review/reference.md +450 -0
- package/opencode/skill/codebase-analysis/SKILL.md +139 -0
- package/opencode/skill/codebase-navigation/SKILL.md +227 -0
- package/opencode/skill/codebase-navigation/examples/exploration-patterns.md +263 -0
- package/opencode/skill/coding-conventions/SKILL.md +178 -0
- package/opencode/skill/coding-conventions/checklists/accessibility-checklist.md +176 -0
- package/opencode/skill/coding-conventions/checklists/performance-checklist.md +154 -0
- package/opencode/skill/coding-conventions/checklists/security-checklist.md +127 -0
- package/opencode/skill/constitution-validation/SKILL.md +315 -0
- package/opencode/skill/constitution-validation/examples/CONSTITUTION.md +202 -0
- package/opencode/skill/constitution-validation/reference/rule-patterns.md +328 -0
- package/opencode/skill/constitution-validation/template.md +115 -0
- package/opencode/skill/context-preservation/SKILL.md +445 -0
- package/opencode/skill/data-modeling/SKILL.md +385 -0
- package/opencode/skill/data-modeling/templates/schema-design-template.md +268 -0
- package/opencode/skill/deployment-pipeline-design/SKILL.md +579 -0
- package/opencode/skill/deployment-pipeline-design/templates/pipeline-template.md +633 -0
- package/opencode/skill/documentation-extraction/SKILL.md +259 -0
- package/opencode/skill/documentation-sync/SKILL.md +431 -0
- package/opencode/skill/domain-driven-design/SKILL.md +509 -0
- package/opencode/skill/domain-driven-design/examples/ddd-patterns.md +688 -0
- package/opencode/skill/domain-driven-design/reference.md +465 -0
- package/opencode/skill/drift-detection/SKILL.md +383 -0
- package/opencode/skill/drift-detection/reference.md +340 -0
- package/opencode/skill/error-recovery/SKILL.md +162 -0
- package/opencode/skill/error-recovery/examples/error-patterns.md +484 -0
- package/opencode/skill/feature-prioritization/SKILL.md +419 -0
- package/opencode/skill/feature-prioritization/examples/rice-template.md +139 -0
- package/opencode/skill/feature-prioritization/reference.md +256 -0
- package/opencode/skill/git-workflow/SKILL.md +453 -0
- package/opencode/skill/implementation-planning/SKILL.md +215 -0
- package/opencode/skill/implementation-planning/examples/phase-examples.md +217 -0
- package/opencode/skill/implementation-planning/template.md +220 -0
- package/opencode/skill/implementation-planning/validation.md +88 -0
- package/opencode/skill/implementation-verification/SKILL.md +272 -0
- package/opencode/skill/knowledge-capture/SKILL.md +265 -0
- package/opencode/skill/knowledge-capture/reference/knowledge-capture.md +402 -0
- package/opencode/skill/knowledge-capture/reference.md +444 -0
- package/opencode/skill/knowledge-capture/templates/domain-template.md +325 -0
- package/opencode/skill/knowledge-capture/templates/interface-template.md +255 -0
- package/opencode/skill/knowledge-capture/templates/pattern-template.md +144 -0
- package/opencode/skill/observability-design/SKILL.md +291 -0
- package/opencode/skill/observability-design/references/monitoring-patterns.md +461 -0
- package/opencode/skill/pattern-detection/SKILL.md +171 -0
- package/opencode/skill/pattern-detection/examples/common-patterns.md +359 -0
- package/opencode/skill/performance-analysis/SKILL.md +266 -0
- package/opencode/skill/performance-analysis/references/profiling-tools.md +499 -0
- package/opencode/skill/requirements-analysis/SKILL.md +139 -0
- package/opencode/skill/requirements-analysis/examples/good-prd.md +66 -0
- package/opencode/skill/requirements-analysis/template.md +177 -0
- package/opencode/skill/requirements-analysis/validation.md +69 -0
- package/opencode/skill/requirements-elicitation/SKILL.md +518 -0
- package/opencode/skill/requirements-elicitation/examples/interview-questions.md +226 -0
- package/opencode/skill/requirements-elicitation/examples/user-stories.md +414 -0
- package/opencode/skill/safe-refactoring/SKILL.md +312 -0
- package/opencode/skill/safe-refactoring/reference/code-smells.md +347 -0
- package/opencode/skill/security-assessment/SKILL.md +421 -0
- package/opencode/skill/security-assessment/checklists/security-review-checklist.md +285 -0
- package/opencode/skill/specification-management/SKILL.md +143 -0
- package/opencode/skill/specification-management/readme-template.md +32 -0
- package/opencode/skill/specification-management/reference.md +115 -0
- package/opencode/skill/specification-management/spec.py +229 -0
- package/opencode/skill/specification-validation/SKILL.md +397 -0
- package/opencode/skill/specification-validation/reference/3cs-framework.md +306 -0
- package/opencode/skill/specification-validation/reference/ambiguity-detection.md +132 -0
- package/opencode/skill/specification-validation/reference/constitution-validation.md +301 -0
- package/opencode/skill/specification-validation/reference/drift-detection.md +383 -0
- package/opencode/skill/task-delegation/SKILL.md +607 -0
- package/opencode/skill/task-delegation/examples/file-coordination.md +495 -0
- package/opencode/skill/task-delegation/examples/parallel-research.md +337 -0
- package/opencode/skill/task-delegation/examples/sequential-build.md +504 -0
- package/opencode/skill/task-delegation/reference.md +825 -0
- package/opencode/skill/tech-stack-detection/SKILL.md +89 -0
- package/opencode/skill/tech-stack-detection/references/framework-signatures.md +598 -0
- package/opencode/skill/technical-writing/SKILL.md +190 -0
- package/opencode/skill/technical-writing/templates/adr-template.md +205 -0
- package/opencode/skill/technical-writing/templates/system-doc-template.md +380 -0
- package/opencode/skill/test-design/SKILL.md +464 -0
- package/opencode/skill/test-design/examples/test-pyramid.md +724 -0
- package/opencode/skill/testing/SKILL.md +213 -0
- package/opencode/skill/testing/examples/test-pyramid.md +724 -0
- package/opencode/skill/user-insight-synthesis/SKILL.md +576 -0
- package/opencode/skill/user-insight-synthesis/templates/research-plan-template.md +217 -0
- package/opencode/skill/user-research/SKILL.md +508 -0
- package/opencode/skill/user-research/examples/interview-questions.md +265 -0
- package/opencode/skill/user-research/examples/personas.md +267 -0
- package/opencode/skill/vibe-security/SKILL.md +654 -0
- package/package.json +45 -0
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
# Example: File Coordination for Parallel Agents
|
|
2
|
+
|
|
3
|
+
This example shows how to prevent file path collisions when multiple agents create documentation in parallel.
|
|
4
|
+
|
|
5
|
+
## Scenario
|
|
6
|
+
|
|
7
|
+
**User Request:** "Document our codebase patterns for authentication, caching, and error handling"
|
|
8
|
+
|
|
9
|
+
## Initial Decomposition (Incorrect)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
❌ WRONG APPROACH
|
|
13
|
+
|
|
14
|
+
Activities:
|
|
15
|
+
1. Document authentication patterns
|
|
16
|
+
2. Document caching patterns
|
|
17
|
+
3. Document error handling patterns
|
|
18
|
+
|
|
19
|
+
All parallel, all OUTPUT: "docs/patterns/[pattern-name].md"
|
|
20
|
+
|
|
21
|
+
Problem: What if agents choose same filename?
|
|
22
|
+
- Agent 1 might create: docs/patterns/auth.md
|
|
23
|
+
- Agent 2 might create: docs/patterns/cache.md
|
|
24
|
+
- Agent 3 might create: docs/patterns/error.md
|
|
25
|
+
|
|
26
|
+
OR worse:
|
|
27
|
+
- Agent 1: docs/patterns/authentication.md
|
|
28
|
+
- Agent 2: docs/patterns/authentication-patterns.md
|
|
29
|
+
- Both trying to document auth? Collision!
|
|
30
|
+
|
|
31
|
+
Result: Ambiguous, potential collisions, inconsistent naming
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Correct Decomposition (File Coordination)
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
✅ CORRECT APPROACH
|
|
38
|
+
|
|
39
|
+
Activities:
|
|
40
|
+
1. Document authentication patterns
|
|
41
|
+
- OUTPUT: docs/patterns/authentication-flow.md (EXPLICIT PATH)
|
|
42
|
+
|
|
43
|
+
2. Document caching patterns
|
|
44
|
+
- OUTPUT: docs/patterns/caching-strategy.md (EXPLICIT PATH)
|
|
45
|
+
|
|
46
|
+
3. Document error handling patterns
|
|
47
|
+
- OUTPUT: docs/patterns/error-handling.md (EXPLICIT PATH)
|
|
48
|
+
|
|
49
|
+
File Coordination Check:
|
|
50
|
+
✅ All paths explicit and unique
|
|
51
|
+
✅ No ambiguity in naming
|
|
52
|
+
✅ No collision risk
|
|
53
|
+
|
|
54
|
+
Status: SAFE FOR PARALLEL EXECUTION
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Agent Prompts with File Coordination
|
|
58
|
+
|
|
59
|
+
### Agent 1: Authentication Pattern
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
DISCOVERY_FIRST: Before starting, check existing documentation:
|
|
63
|
+
- List docs/patterns/ directory
|
|
64
|
+
- Search for existing auth-related files
|
|
65
|
+
- Note naming conventions used
|
|
66
|
+
- Check if authentication-flow.md already exists
|
|
67
|
+
|
|
68
|
+
FOCUS: Document authentication patterns discovered in codebase
|
|
69
|
+
- JWT token generation and validation
|
|
70
|
+
- Password hashing (bcrypt usage)
|
|
71
|
+
- Session management approach
|
|
72
|
+
- Protected route patterns
|
|
73
|
+
- Error responses for auth failures
|
|
74
|
+
|
|
75
|
+
EXCLUDE:
|
|
76
|
+
- Don't document caching (Agent 2 handles this)
|
|
77
|
+
- Don't document error handling generally (Agent 3 handles this)
|
|
78
|
+
- Don't create multiple files (single document)
|
|
79
|
+
- Don't modify existing authentication files if they exist
|
|
80
|
+
|
|
81
|
+
CONTEXT: Documenting patterns found in src/middleware/auth.*, src/routes/auth.*
|
|
82
|
+
- Focus on how authentication works, not implementation details
|
|
83
|
+
- Use pattern template: docs/templates/pattern-template.md
|
|
84
|
+
- Follow existing documentation style
|
|
85
|
+
|
|
86
|
+
OUTPUT: EXACTLY this path: docs/patterns/authentication-flow.md
|
|
87
|
+
- If file exists: STOP and report (don't overwrite)
|
|
88
|
+
- If file doesn't exist: Create new
|
|
89
|
+
- Use pattern template structure
|
|
90
|
+
- Include code examples from codebase
|
|
91
|
+
|
|
92
|
+
SUCCESS: Authentication patterns documented
|
|
93
|
+
- File created at exact path specified
|
|
94
|
+
- Follows pattern template
|
|
95
|
+
- Includes JWT, bcrypt, and session patterns
|
|
96
|
+
- Code examples are accurate
|
|
97
|
+
- No collision with other agents
|
|
98
|
+
|
|
99
|
+
TERMINATION:
|
|
100
|
+
- Documentation complete at specified path
|
|
101
|
+
- File already exists (report to user)
|
|
102
|
+
- No authentication patterns found in codebase
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Agent 2: Caching Pattern
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
DISCOVERY_FIRST: Before starting, check existing documentation:
|
|
109
|
+
- List docs/patterns/ directory
|
|
110
|
+
- Search for existing cache-related files
|
|
111
|
+
- Note naming conventions
|
|
112
|
+
- Check if caching-strategy.md already exists
|
|
113
|
+
|
|
114
|
+
FOCUS: Document caching patterns discovered in codebase
|
|
115
|
+
- Redis usage patterns
|
|
116
|
+
- Cache key naming conventions
|
|
117
|
+
- TTL (time-to-live) strategies
|
|
118
|
+
- Cache invalidation approaches
|
|
119
|
+
- What gets cached and why
|
|
120
|
+
|
|
121
|
+
EXCLUDE:
|
|
122
|
+
- Don't document authentication (Agent 1 handles this)
|
|
123
|
+
- Don't document error handling (Agent 3 handles this)
|
|
124
|
+
- Don't create multiple files (single document)
|
|
125
|
+
- Don't overlap with Agent 1's work
|
|
126
|
+
|
|
127
|
+
CONTEXT: Documenting patterns found in src/cache/*, src/services/*
|
|
128
|
+
- Focus on caching strategy, not Redis API details
|
|
129
|
+
- Use pattern template
|
|
130
|
+
- Follow existing documentation style
|
|
131
|
+
|
|
132
|
+
OUTPUT: EXACTLY this path: docs/patterns/caching-strategy.md
|
|
133
|
+
- If file exists: STOP and report (don't overwrite)
|
|
134
|
+
- If file doesn't exist: Create new
|
|
135
|
+
- Use pattern template structure
|
|
136
|
+
- Include code examples from codebase
|
|
137
|
+
|
|
138
|
+
SUCCESS: Caching patterns documented
|
|
139
|
+
- File created at exact path specified
|
|
140
|
+
- Follows pattern template
|
|
141
|
+
- Includes Redis patterns and cache strategies
|
|
142
|
+
- No collision with other agents
|
|
143
|
+
|
|
144
|
+
TERMINATION:
|
|
145
|
+
- Documentation complete at specified path
|
|
146
|
+
- File already exists (report)
|
|
147
|
+
- No caching patterns found
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Agent 3: Error Handling Pattern
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
DISCOVERY_FIRST: Before starting, check existing documentation:
|
|
154
|
+
- List docs/patterns/ directory
|
|
155
|
+
- Search for existing error-related files
|
|
156
|
+
- Note naming conventions
|
|
157
|
+
- Check if error-handling.md already exists
|
|
158
|
+
|
|
159
|
+
FOCUS: Document error handling patterns discovered in codebase
|
|
160
|
+
- Error class hierarchy
|
|
161
|
+
- HTTP status code mapping
|
|
162
|
+
- Error response format
|
|
163
|
+
- Logging strategy for errors
|
|
164
|
+
- Recovery patterns
|
|
165
|
+
|
|
166
|
+
EXCLUDE:
|
|
167
|
+
- Don't document authentication (Agent 1's domain)
|
|
168
|
+
- Don't document caching (Agent 2's domain)
|
|
169
|
+
- Don't create multiple files
|
|
170
|
+
- Don't overlap with other agents
|
|
171
|
+
|
|
172
|
+
CONTEXT: Documenting patterns found in src/errors/*, src/middleware/error.*
|
|
173
|
+
- Focus on error handling strategy and patterns
|
|
174
|
+
- Use pattern template
|
|
175
|
+
- Follow existing documentation style
|
|
176
|
+
|
|
177
|
+
OUTPUT: EXACTLY this path: docs/patterns/error-handling.md
|
|
178
|
+
- If file exists: STOP and report (don't overwrite)
|
|
179
|
+
- If file doesn't exist: Create new
|
|
180
|
+
- Use pattern template structure
|
|
181
|
+
- Include code examples
|
|
182
|
+
|
|
183
|
+
SUCCESS: Error handling patterns documented
|
|
184
|
+
- File created at exact path specified
|
|
185
|
+
- Follows pattern template
|
|
186
|
+
- Includes error classes and response patterns
|
|
187
|
+
- No collision with other agents
|
|
188
|
+
|
|
189
|
+
TERMINATION:
|
|
190
|
+
- Documentation complete at specified path
|
|
191
|
+
- File already exists (report)
|
|
192
|
+
- No error handling patterns found
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## File Coordination Checklist
|
|
196
|
+
|
|
197
|
+
Before launching these agents:
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
📋 File Coordination Pre-Flight Check
|
|
201
|
+
|
|
202
|
+
Agent 1 OUTPUT: docs/patterns/authentication-flow.md
|
|
203
|
+
Agent 2 OUTPUT: docs/patterns/caching-strategy.md
|
|
204
|
+
Agent 3 OUTPUT: docs/patterns/error-handling.md
|
|
205
|
+
|
|
206
|
+
✅ All paths are explicit (no ambiguity)
|
|
207
|
+
✅ All paths are unique (no two agents write same file)
|
|
208
|
+
✅ All paths follow convention (docs/patterns/[name].md)
|
|
209
|
+
✅ All agents instructed to check if file exists first
|
|
210
|
+
✅ All agents instructed to STOP if collision detected
|
|
211
|
+
|
|
212
|
+
File Collision Risk: NONE
|
|
213
|
+
Safe to launch in parallel: YES
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Execution Flow
|
|
217
|
+
|
|
218
|
+
### Launch All Three Agents in Parallel
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
🚀 Launching 3 parallel documentation agents
|
|
222
|
+
|
|
223
|
+
Agent 1: Authentication Pattern → RUNNING
|
|
224
|
+
TARGET: docs/patterns/authentication-flow.md
|
|
225
|
+
|
|
226
|
+
Agent 2: Caching Pattern → RUNNING
|
|
227
|
+
TARGET: docs/patterns/caching-strategy.md
|
|
228
|
+
|
|
229
|
+
Agent 3: Error Handling Pattern → RUNNING
|
|
230
|
+
TARGET: docs/patterns/error-handling.md
|
|
231
|
+
|
|
232
|
+
File coordination: ✅ All unique paths
|
|
233
|
+
Collision risk: ✅ None
|
|
234
|
+
Parallel safety: ✅ Confirmed
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Monitoring for Collisions
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
⏳ Agents running...
|
|
241
|
+
|
|
242
|
+
[Agent 1] Checking: docs/patterns/authentication-flow.md → NOT EXISTS
|
|
243
|
+
[Agent 1] Safe to create → PROCEEDING
|
|
244
|
+
|
|
245
|
+
[Agent 2] Checking: docs/patterns/caching-strategy.md → NOT EXISTS
|
|
246
|
+
[Agent 2] Safe to create → PROCEEDING
|
|
247
|
+
|
|
248
|
+
[Agent 3] Checking: docs/patterns/error-handling.md → NOT EXISTS
|
|
249
|
+
[Agent 3] Safe to create → PROCEEDING
|
|
250
|
+
|
|
251
|
+
No collisions detected. All agents proceeding independently.
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Completion
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
Agent 1: COMPLETE ✅ (22 minutes)
|
|
258
|
+
Created: docs/patterns/authentication-flow.md (3.2 KB)
|
|
259
|
+
|
|
260
|
+
Agent 2: COMPLETE ✅ (18 minutes)
|
|
261
|
+
Created: docs/patterns/caching-strategy.md (2.8 KB)
|
|
262
|
+
|
|
263
|
+
Agent 3: COMPLETE ✅ (25 minutes)
|
|
264
|
+
Created: docs/patterns/error-handling.md (4.1 KB)
|
|
265
|
+
|
|
266
|
+
All agents complete. No collisions occurred.
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Results
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
📁 docs/patterns/
|
|
273
|
+
├── authentication-flow.md ✅ Created by Agent 1
|
|
274
|
+
├── caching-strategy.md ✅ Created by Agent 2
|
|
275
|
+
└── error-handling.md ✅ Created by Agent 3
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Total time:** 25 minutes (parallel)
|
|
279
|
+
**Sequential would take:** 65 minutes
|
|
280
|
+
**Time saved:** 40 minutes (61% faster)
|
|
281
|
+
|
|
282
|
+
## Alternative Coordination Strategies
|
|
283
|
+
|
|
284
|
+
### Strategy 1: Directory Separation
|
|
285
|
+
|
|
286
|
+
If agents might create multiple files:
|
|
287
|
+
|
|
288
|
+
```
|
|
289
|
+
Agent 1 OUTPUT: docs/patterns/authentication/
|
|
290
|
+
- flow.md
|
|
291
|
+
- jwt-tokens.md
|
|
292
|
+
- session-management.md
|
|
293
|
+
|
|
294
|
+
Agent 2 OUTPUT: docs/patterns/caching/
|
|
295
|
+
- redis-usage.md
|
|
296
|
+
- invalidation.md
|
|
297
|
+
- key-naming.md
|
|
298
|
+
|
|
299
|
+
Agent 3 OUTPUT: docs/patterns/error-handling/
|
|
300
|
+
- error-classes.md
|
|
301
|
+
- response-format.md
|
|
302
|
+
- recovery-patterns.md
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
**Result:** Each agent owns a directory, no file collisions possible.
|
|
306
|
+
|
|
307
|
+
### Strategy 2: Timestamp-Based Naming
|
|
308
|
+
|
|
309
|
+
For logs or reports that accumulate:
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
Agent 1 OUTPUT: logs/auth-analysis-2025-01-24-10-30-00.md
|
|
313
|
+
Agent 2 OUTPUT: logs/cache-analysis-2025-01-24-10-30-00.md
|
|
314
|
+
Agent 3 OUTPUT: logs/error-analysis-2025-01-24-10-30-00.md
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
**Result:** Timestamps ensure uniqueness even if same topic.
|
|
318
|
+
|
|
319
|
+
### Strategy 3: Agent ID Namespacing
|
|
320
|
+
|
|
321
|
+
When dynamic number of agents:
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
For each module in [moduleA, moduleB, moduleC, moduleD]:
|
|
325
|
+
Launch agent with OUTPUT: analysis/module-${MODULE_NAME}.md
|
|
326
|
+
|
|
327
|
+
Results:
|
|
328
|
+
- analysis/module-moduleA.md
|
|
329
|
+
- analysis/module-moduleB.md
|
|
330
|
+
- analysis/module-moduleC.md
|
|
331
|
+
- analysis/module-moduleD.md
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
**Result:** Template-based naming prevents collisions.
|
|
335
|
+
|
|
336
|
+
## What Could Go Wrong (Anti-Patterns)
|
|
337
|
+
|
|
338
|
+
### ❌ Anti-Pattern 1: Ambiguous Paths
|
|
339
|
+
|
|
340
|
+
```
|
|
341
|
+
BAD:
|
|
342
|
+
Agent 1 OUTPUT: "Create pattern documentation"
|
|
343
|
+
Agent 2 OUTPUT: "Document caching patterns"
|
|
344
|
+
|
|
345
|
+
Problem: Where exactly? What filename?
|
|
346
|
+
Result: Agents might choose same name or wrong location
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### ❌ Anti-Pattern 2: Overlapping Domains
|
|
350
|
+
|
|
351
|
+
```
|
|
352
|
+
BAD:
|
|
353
|
+
Agent 1 FOCUS: "Document authentication and security"
|
|
354
|
+
Agent 2 FOCUS: "Document security patterns"
|
|
355
|
+
|
|
356
|
+
Problem: Both might document auth security!
|
|
357
|
+
Result: Duplicate or conflicting documentation
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
**Fix:** Clear FOCUS boundaries, explicit EXCLUDE
|
|
361
|
+
|
|
362
|
+
### ❌ Anti-Pattern 3: No Existence Check
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
BAD:
|
|
366
|
+
OUTPUT: docs/patterns/auth.md
|
|
367
|
+
(No instruction to check if exists)
|
|
368
|
+
|
|
369
|
+
Problem: If file exists, agent might overwrite
|
|
370
|
+
Result: Lost documentation
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Fix:** Always include existence check in FOCUS or OUTPUT
|
|
374
|
+
|
|
375
|
+
### ❌ Anti-Pattern 4: Generic Filenames
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
BAD:
|
|
379
|
+
Agent 1 OUTPUT: docs/patterns/pattern.md
|
|
380
|
+
Agent 2 OUTPUT: docs/patterns/patterns.md
|
|
381
|
+
Agent 3 OUTPUT: docs/patterns/pattern-doc.md
|
|
382
|
+
|
|
383
|
+
Problem: All similar, confusing, might collide
|
|
384
|
+
Result: Unclear which agent created what
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**Fix:** Descriptive, specific filenames
|
|
388
|
+
|
|
389
|
+
## File Coordination Best Practices
|
|
390
|
+
|
|
391
|
+
### 1. Explicit Paths
|
|
392
|
+
|
|
393
|
+
✅ **Always specify exact OUTPUT path:**
|
|
394
|
+
```
|
|
395
|
+
OUTPUT: docs/patterns/authentication-flow.md
|
|
396
|
+
NOT: "Document authentication patterns"
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### 2. Unique Names
|
|
400
|
+
|
|
401
|
+
✅ **Ensure all agents have unique filenames:**
|
|
402
|
+
```
|
|
403
|
+
Before launching:
|
|
404
|
+
- Agent 1: authentication-flow.md
|
|
405
|
+
- Agent 2: caching-strategy.md
|
|
406
|
+
- Agent 3: error-handling.md
|
|
407
|
+
✅ All unique → SAFE
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### 3. Existence Checks
|
|
411
|
+
|
|
412
|
+
✅ **Instruct agents to check before creating:**
|
|
413
|
+
```
|
|
414
|
+
OUTPUT: docs/patterns/authentication-flow.md
|
|
415
|
+
- If file exists: STOP and report (don't overwrite)
|
|
416
|
+
- If file doesn't exist: Create new
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### 4. Clear Boundaries
|
|
420
|
+
|
|
421
|
+
✅ **Use EXCLUDE to prevent overlap:**
|
|
422
|
+
```
|
|
423
|
+
Agent 1:
|
|
424
|
+
FOCUS: Document authentication
|
|
425
|
+
EXCLUDE: Don't document caching (Agent 2) or errors (Agent 3)
|
|
426
|
+
|
|
427
|
+
Agent 2:
|
|
428
|
+
FOCUS: Document caching
|
|
429
|
+
EXCLUDE: Don't document auth (Agent 1) or errors (Agent 3)
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### 5. Validation
|
|
433
|
+
|
|
434
|
+
✅ **Check coordination before launching:**
|
|
435
|
+
```
|
|
436
|
+
Checklist:
|
|
437
|
+
- [ ] All paths explicit
|
|
438
|
+
- [ ] All paths unique
|
|
439
|
+
- [ ] All agents have existence checks
|
|
440
|
+
- [ ] Clear FOCUS boundaries
|
|
441
|
+
- [ ] No overlap in domains
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## Integration with Documentation Skill
|
|
445
|
+
|
|
446
|
+
When these agents complete, documentation skill may activate:
|
|
447
|
+
|
|
448
|
+
```
|
|
449
|
+
Agent 1 completes → Creates authentication-flow.md
|
|
450
|
+
↓
|
|
451
|
+
Documentation skill notices "pattern" created
|
|
452
|
+
↓
|
|
453
|
+
Checks: Is this in correct location? (docs/patterns/ ✅)
|
|
454
|
+
Checks: Does it follow template? (✅)
|
|
455
|
+
Checks: Should it be cross-referenced? (Yes)
|
|
456
|
+
↓
|
|
457
|
+
Documentation skill adds cross-references:
|
|
458
|
+
- Links to related authentication interfaces
|
|
459
|
+
- Links to domain rules about user permissions
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
**Coordination:** Agent-delegation ensures unique paths, documentation skill ensures quality and linking.
|
|
463
|
+
|
|
464
|
+
## Lessons Learned
|
|
465
|
+
|
|
466
|
+
### What Worked
|
|
467
|
+
|
|
468
|
+
✅ **Explicit paths:** Zero ambiguity, zero collisions
|
|
469
|
+
✅ **Existence checks:** Prevented accidental overwrites
|
|
470
|
+
✅ **Clear boundaries:** No domain overlap
|
|
471
|
+
✅ **Parallel execution:** 61% time savings
|
|
472
|
+
|
|
473
|
+
### What to Watch For
|
|
474
|
+
|
|
475
|
+
⚠️ **Naming conventions:** Ensure consistency (kebab-case vs snake_case)
|
|
476
|
+
⚠️ **Template usage:** All agents should use same template
|
|
477
|
+
⚠️ **Directory structure:** Verify docs/patterns/ exists before launching
|
|
478
|
+
|
|
479
|
+
## Reusable Coordination Template
|
|
480
|
+
|
|
481
|
+
For any parallel file creation:
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
1. List all files to be created
|
|
485
|
+
2. Verify all paths are unique
|
|
486
|
+
3. Add existence checks to OUTPUT
|
|
487
|
+
4. Use EXCLUDE to prevent overlap
|
|
488
|
+
5. Launch in parallel with confidence
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
**This prevents:**
|
|
492
|
+
- File path collisions
|
|
493
|
+
- Accidental overwrites
|
|
494
|
+
- Domain overlap
|
|
495
|
+
- Naming inconsistencies
|