Skills.MD
# Executing Work in Parallel
## Core Pattern
Parallel execution prevents context saturation and accelerates work through concurrent processing. Key principle: **implement shared dependencies first, then launch independent agents simultaneously**.
### When to parallelize
- **2+ independent tasks** — Different files or modules without interactions
- **Research investigations** — Multiple agents exploring different aspects
- **Layer-based work** — Database → API → Frontend stages
- **Multi-file refactoring** — Changes without interdependencies
### When NOT to parallelize
- **Single file modification** — Use direct tools
- **Sequential operations** — Tasks building on each other
- **Shared resource conflicts** — Multiple agents modifying same file
- **Complex interdependencies** — Most tasks depend on others
## Execution Framework
### Phase 1: Task Analysis
1. **Map all tasks** — Comprehensive list of everything needed
2. **Identify dependencies** — Document what depends on what
3. **Group independent work** — Find tasks running simultaneously
4. **Validate groupings** — Confirm groups are truly independent
### Phase 2: Implementation
**Step 1: Shared Dependencies**
Implement first alone (shared types, interfaces, schemas, core utilities). Never parallelize these—they block other work.
**Step 2: Parallel Execution**
Use single `function_calls` block with multiple Task invocations:
```xml
<function_calls>
<invoke name="Task">
<parameter name="description">First parallel task</parameter>
<parameter name="subagent_type">appropriate-agent</parameter>
<parameter name="prompt">Detailed context and instructions...</parameter>
</invoke>
<invoke name="Task">
<parameter name="description">Second parallel task</parameter>
<parameter name="subagent_type">appropriate-agent</parameter>
<parameter name="prompt">Detailed context and instructions...</parameter>
</invoke>
</function_calls>
```
**Step 3: Wait and Reassess**
Let agents complete, then:
- Review results
- Identify newly unblocked work
- Plan next batch
**Step 4: Repeat**
Continue batching until complete.
## Common Patterns
### Layer-Based
```
Stage 1: Database schema + Type definitions + Core utilities
Stage 2: Service layer + API endpoints + Frontend components
Stage 3: Tests + Documentation + Configuration
```
### Feature-Based
```
Stage 1: Independent feature implementations
Stage 2: Integration points between features
Stage 3: Cross-cutting concerns
```
### Research-First
```
Stage 1: Multiple research agents investigating aspects
Stage 2: Consolidation and planning from findings
Stage 3: Parallel implementation of requirements
```
## Agent Delegation Checklist
✅ **Provide complete context**
- Exact file paths to read for patterns
- Target files to modify
- Existing conventions to follow
- Expected output format
✅ **Use appropriate agents**
- `programmer` — API, services, data layers, components, pages, styling
- `Explore` — Semantic searches, flow tracing
- `senior-engineer` — Testing and verification
- `orchestrator` — Complex multi-agent work
✅ **Respect dependencies**
- Type dependencies (interfaces others use)
- Core utilities and shared functions
- Database schemas and migrations
- API contracts and payloads
- Never parallelize dependent tasks
## Thresholds
| Metric | Threshold |
|--------|-----------|
| Minimum tasks to parallelize | 2 independent tasks |
| Optimal group size | 3-5 independent tasks |
| Maximum concurrent agents | 7-8 (diminishing returns) |
## Critical Reminders
1. **Implement shared dependencies alone first** — Types, interfaces, schemas, base utilities
2. **Single function_calls block per batch** — All parallel invocations in one call
3. **Exact file paths** — Agents need explicit guidance
4. **Think between batches** — Reassess what's unblocked after each stage
5. **Monitor context limits** — Split complex tasks rather than overload agents
6. **Quality over speed** — Correctness and correctness always supersede parallelization
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「parallel-execution」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次