@intentsolutionsio/ai-sdk-agents 1.0.0 → 1.0.6
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 +35 -0
- package/agents/multi-agent-orchestrator.md +60 -3
- package/commands/ai-agent-create.md +23 -0
- package/commands/ai-agents-setup.md +30 -5
- package/commands/ai-agents-test.md +9 -0
- package/package.json +1 -1
- package/skills/orchestrating-multi-agent-systems/SKILL.md +16 -8
- package/skills/orchestrating-multi-agent-systems/references/README.md +0 -1
- package/skills/orchestrating-multi-agent-systems/references/errors.md +5 -0
- package/skills/orchestrating-multi-agent-systems/references/implementation.md +11 -1
- package/skills/orchestrating-multi-agent-systems/scripts/README.md +1 -1
- package/skills/orchestrating-multi-agent-systems/scripts/{agent_setup.sh → agent_setup.py} +15 -20
- package/skills/orchestrating-multi-agent-systems/scripts/{dependency_installer.sh → dependency_installer.py} +16 -16
- package/skills/orchestrating-multi-agent-systems/scripts/{env_setup.sh → env_setup.py} +12 -19
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Build sophisticated multi-agent systems with automatic handoffs, intelligent rou
|
|
|
11
11
|
## 🎯 What This Plugin Does
|
|
12
12
|
|
|
13
13
|
Transform complex workflows into multi-agent systems where specialized agents:
|
|
14
|
+
|
|
14
15
|
- **Hand off tasks** to each other automatically
|
|
15
16
|
- **Route requests** to the best-suited agent
|
|
16
17
|
- **Coordinate** complex workflows across multiple LLMs
|
|
@@ -68,6 +69,7 @@ npm install @ai-sdk-tools/agents ai zod
|
|
|
68
69
|
### Rate Limits by Provider
|
|
69
70
|
|
|
70
71
|
#### OpenAI (Paid)
|
|
72
|
+
|
|
71
73
|
- **GPT-4:** 10,000 requests/day (Tier 1), 500 RPM
|
|
72
74
|
- **GPT-4 Turbo:** 30,000 requests/day (Tier 2), 3,000 RPM
|
|
73
75
|
- **Registration:** ✅ Email + payment required
|
|
@@ -76,6 +78,7 @@ npm install @ai-sdk-tools/agents ai zod
|
|
|
76
78
|
**Multi-Agent Impact:** 5 agents × 500 RPM limit = effective 100 RPM per agent
|
|
77
79
|
|
|
78
80
|
#### Anthropic (Paid)
|
|
81
|
+
|
|
79
82
|
- **Claude Sonnet:** 50,000 requests/day (Tier 1), 1,000 RPM
|
|
80
83
|
- **Claude Opus:** 50,000 requests/day (Tier 1), 1,000 RPM
|
|
81
84
|
- **Registration:** ✅ Email + payment required
|
|
@@ -84,6 +87,7 @@ npm install @ai-sdk-tools/agents ai zod
|
|
|
84
87
|
**Multi-Agent Impact:** 5 agents × 1,000 RPM limit = effective 200 RPM per agent
|
|
85
88
|
|
|
86
89
|
#### Google Gemini (Paid/Free Tier)
|
|
90
|
+
|
|
87
91
|
- **Gemini 1.5 Flash (Free):** 15 RPM, 1M tokens/day
|
|
88
92
|
- **Gemini 1.5 Pro (Free):** 2 RPM, 32K tokens/day
|
|
89
93
|
- **Gemini (Paid):** 1,000 RPM, unlimited tokens
|
|
@@ -93,6 +97,7 @@ npm install @ai-sdk-tools/agents ai zod
|
|
|
93
97
|
**Multi-Agent Impact:** Free tier 15 RPM = 3 RPM per agent (5 agents) → Very restrictive
|
|
94
98
|
|
|
95
99
|
#### Ollama (FREE - Self-Hosted)
|
|
100
|
+
|
|
96
101
|
- **Requests:** ∞ Unlimited (hardware-limited only)
|
|
97
102
|
- **Models:** Llama 3.2, Mistral, CodeLlama, etc.
|
|
98
103
|
- **Registration:** ❌ Not required
|
|
@@ -133,6 +138,7 @@ const agents = {
|
|
|
133
138
|
```
|
|
134
139
|
|
|
135
140
|
**Hardware Requirements:**
|
|
141
|
+
|
|
136
142
|
- **4 agents × Llama 3.2 7B:** 32GB RAM minimum
|
|
137
143
|
- **Concurrent requests:** Limited by CPU cores
|
|
138
144
|
- **See:** [ollama-local-ai plugin](../ollama-local-ai/README.md#multi-agent-rate-limit-strategies) for detailed hardware sizing
|
|
@@ -214,6 +220,7 @@ await rateLimiter.executeAgentTask('coordinator', async () => {
|
|
|
214
220
|
### When to Use Paid APIs vs Ollama
|
|
215
221
|
|
|
216
222
|
**Use Ollama (FREE) when:**
|
|
223
|
+
|
|
217
224
|
- ✅ Development and testing multi-agent systems
|
|
218
225
|
- ✅ Running 1,000+ workflows/month (saves $360-3,600/year)
|
|
219
226
|
- ✅ Data privacy is critical (stays on your infrastructure)
|
|
@@ -221,6 +228,7 @@ await rateLimiter.executeAgentTask('coordinator', async () => {
|
|
|
221
228
|
- ✅ Latency <2sec acceptable (not real-time)
|
|
222
229
|
|
|
223
230
|
**Use Paid APIs when:**
|
|
231
|
+
|
|
224
232
|
- ❌ Need <500ms latency for production
|
|
225
233
|
- ❌ Managing 10+ agents (hardware becomes expensive)
|
|
226
234
|
- ❌ Require enterprise SLA/support
|
|
@@ -296,6 +304,7 @@ const result = await orchestrate([
|
|
|
296
304
|
### 1. Code Generation Pipeline
|
|
297
305
|
|
|
298
306
|
**Agents**:
|
|
307
|
+
|
|
299
308
|
- **Architect**: Designs system structure
|
|
300
309
|
- **Coder**: Implements features
|
|
301
310
|
- **Tester**: Writes tests
|
|
@@ -303,6 +312,7 @@ const result = await orchestrate([
|
|
|
303
312
|
- **Documenter**: Writes docs
|
|
304
313
|
|
|
305
314
|
**Flow**:
|
|
315
|
+
|
|
306
316
|
```
|
|
307
317
|
User Request → Architect (design) → Coder (implement)
|
|
308
318
|
→ Tester (test) → Reviewer (review)
|
|
@@ -314,12 +324,14 @@ User Request → Architect (design) → Coder (implement)
|
|
|
314
324
|
### 2. Research & Analysis
|
|
315
325
|
|
|
316
326
|
**Agents**:
|
|
327
|
+
|
|
317
328
|
- **Searcher**: Finds information
|
|
318
329
|
- **Analyzer**: Analyzes data
|
|
319
330
|
- **Synthesizer**: Combines insights
|
|
320
331
|
- **Reporter**: Creates reports
|
|
321
332
|
|
|
322
333
|
**Flow**:
|
|
334
|
+
|
|
323
335
|
```
|
|
324
336
|
Question → Searcher (gather sources) → Analyzer (extract insights)
|
|
325
337
|
→ Synthesizer (combine) → Reporter (format) → Answer
|
|
@@ -330,6 +342,7 @@ Question → Searcher (gather sources) → Analyzer (extract insights)
|
|
|
330
342
|
### 3. Content Creation
|
|
331
343
|
|
|
332
344
|
**Agents**:
|
|
345
|
+
|
|
333
346
|
- **Researcher**: Gathers information
|
|
334
347
|
- **Writer**: Writes content
|
|
335
348
|
- **Editor**: Edits for quality
|
|
@@ -337,6 +350,7 @@ Question → Searcher (gather sources) → Analyzer (extract insights)
|
|
|
337
350
|
- **Publisher**: Formats and publishes
|
|
338
351
|
|
|
339
352
|
**Flow**:
|
|
353
|
+
|
|
340
354
|
```
|
|
341
355
|
Topic → Researcher → Writer → Editor → SEO → Publisher → Published Content
|
|
342
356
|
```
|
|
@@ -346,12 +360,14 @@ Topic → Researcher → Writer → Editor → SEO → Publisher → Published C
|
|
|
346
360
|
### 4. Customer Support
|
|
347
361
|
|
|
348
362
|
**Agents**:
|
|
363
|
+
|
|
349
364
|
- **Triager**: Categorizes issues
|
|
350
365
|
- **FAQ Bot**: Handles common questions
|
|
351
366
|
- **Technical**: Solves technical issues
|
|
352
367
|
- **Escalator**: Escalates to humans when needed
|
|
353
368
|
|
|
354
369
|
**Flow**:
|
|
370
|
+
|
|
355
371
|
```
|
|
356
372
|
Customer Query → Triager → Route to (FAQ Bot | Technical | Escalator)
|
|
357
373
|
→ Resolve or escalate
|
|
@@ -362,12 +378,14 @@ Customer Query → Triager → Route to (FAQ Bot | Technical | Escalator)
|
|
|
362
378
|
### 5. DevOps Automation
|
|
363
379
|
|
|
364
380
|
**Agents**:
|
|
381
|
+
|
|
365
382
|
- **Monitor**: Watches system health
|
|
366
383
|
- **Diagnoser**: Diagnoses issues
|
|
367
384
|
- **Fixer**: Attempts automated fixes
|
|
368
385
|
- **Notifier**: Alerts humans when needed
|
|
369
386
|
|
|
370
387
|
**Flow**:
|
|
388
|
+
|
|
371
389
|
```
|
|
372
390
|
Alert → Monitor (analyze) → Diagnoser (identify cause)
|
|
373
391
|
→ Fixer (attempt fix) → Success OR Notifier (escalate)
|
|
@@ -384,6 +402,7 @@ Alert → Monitor (analyze) → Diagnoser (identify cause)
|
|
|
384
402
|
**Purpose**: Initialize multi-agent project structure
|
|
385
403
|
|
|
386
404
|
**Creates**:
|
|
405
|
+
|
|
387
406
|
```
|
|
388
407
|
project/
|
|
389
408
|
├── agents/
|
|
@@ -397,6 +416,7 @@ project/
|
|
|
397
416
|
```
|
|
398
417
|
|
|
399
418
|
**Usage**:
|
|
419
|
+
|
|
400
420
|
```bash
|
|
401
421
|
/ai-agents-setup
|
|
402
422
|
|
|
@@ -411,6 +431,7 @@ project/
|
|
|
411
431
|
**Purpose**: Create a new specialized agent
|
|
412
432
|
|
|
413
433
|
**Usage**:
|
|
434
|
+
|
|
414
435
|
```bash
|
|
415
436
|
/ai-agent-create [name] [specialization]
|
|
416
437
|
|
|
@@ -421,6 +442,7 @@ project/
|
|
|
421
442
|
```
|
|
422
443
|
|
|
423
444
|
**Generates**:
|
|
445
|
+
|
|
424
446
|
```typescript
|
|
425
447
|
// agents/security-auditor.ts
|
|
426
448
|
import { createAgent } from '@ai-sdk-tools/agents';
|
|
@@ -445,6 +467,7 @@ export const securityAuditor = createAgent({
|
|
|
445
467
|
**Purpose**: Test your multi-agent system
|
|
446
468
|
|
|
447
469
|
**Usage**:
|
|
470
|
+
|
|
448
471
|
```bash
|
|
449
472
|
/ai-agents-test "User query to test"
|
|
450
473
|
|
|
@@ -453,6 +476,7 @@ export const securityAuditor = createAgent({
|
|
|
453
476
|
```
|
|
454
477
|
|
|
455
478
|
**Output**:
|
|
479
|
+
|
|
456
480
|
```
|
|
457
481
|
Testing multi-agent system...
|
|
458
482
|
|
|
@@ -490,6 +514,7 @@ Agents involved: 5 (coordinator, architect, coder, tester, reviewer)
|
|
|
490
514
|
**Purpose**: Coordinate complex multi-agent workflows
|
|
491
515
|
|
|
492
516
|
**Specialization**:
|
|
517
|
+
|
|
493
518
|
- Analyze incoming requests
|
|
494
519
|
- Route to appropriate specialized agent
|
|
495
520
|
- Manage handoffs between agents
|
|
@@ -740,6 +765,7 @@ const result = await orchestrate({
|
|
|
740
765
|
## 🔗 Integration with Other Plugins
|
|
741
766
|
|
|
742
767
|
**Works well with**:
|
|
768
|
+
|
|
743
769
|
- **ai-ml-engineering-pack**: RAG systems, prompt optimization
|
|
744
770
|
- **overnight-dev**: Autonomous multi-agent coding overnight
|
|
745
771
|
- **devops-automation-pack**: CI/CD with agent coordination
|
|
@@ -818,20 +844,24 @@ const agents = [
|
|
|
818
844
|
### Best Models for Multi-Agent Systems
|
|
819
845
|
|
|
820
846
|
**Code Generation**:
|
|
847
|
+
|
|
821
848
|
- `codellama` (34B) - Best for coding agents
|
|
822
849
|
- `qwen2.5-coder` (32B) - Strong code understanding
|
|
823
850
|
|
|
824
851
|
**General Purpose**:
|
|
852
|
+
|
|
825
853
|
- `llama3.2` (70B) - Meta's flagship
|
|
826
854
|
- `mistral` (7B) - Fast and efficient
|
|
827
855
|
|
|
828
856
|
**Specialized**:
|
|
857
|
+
|
|
829
858
|
- `phi3` (14B) - Microsoft's efficient model
|
|
830
859
|
- `gemma` (27B) - Google's open model
|
|
831
860
|
|
|
832
861
|
### Migration Guide: Paid → Free
|
|
833
862
|
|
|
834
863
|
**Before (OpenAI - Paid)**:
|
|
864
|
+
|
|
835
865
|
```typescript
|
|
836
866
|
import { createOpenAI } from '@ai-sdk/openai';
|
|
837
867
|
|
|
@@ -845,6 +875,7 @@ const agent = createAgent({
|
|
|
845
875
|
```
|
|
846
876
|
|
|
847
877
|
**After (Ollama - Free)**:
|
|
878
|
+
|
|
848
879
|
```typescript
|
|
849
880
|
import ollama from 'ollama';
|
|
850
881
|
|
|
@@ -913,12 +944,14 @@ Result: Production-ready API in minutes
|
|
|
913
944
|
## 📊 Performance
|
|
914
945
|
|
|
915
946
|
**vs Single Agent**:
|
|
947
|
+
|
|
916
948
|
- ✅ 10x better task decomposition
|
|
917
949
|
- ✅ 5x higher quality output
|
|
918
950
|
- ✅ 3x faster completion (parallel agent work)
|
|
919
951
|
- ✅ Better error handling (agents catch each other's mistakes)
|
|
920
952
|
|
|
921
953
|
**Real-world metrics**:
|
|
954
|
+
|
|
922
955
|
- Complex code generation: 3-5 min (vs 15-20 min single agent)
|
|
923
956
|
- Research reports: 2 min (vs 10 min single agent)
|
|
924
957
|
- Customer support: <30 sec (vs 2-3 min single agent)
|
|
@@ -928,6 +961,7 @@ Result: Production-ready API in minutes
|
|
|
928
961
|
## 🎯 When to Use Multi-Agent
|
|
929
962
|
|
|
930
963
|
**Use multi-agent when**:
|
|
964
|
+
|
|
931
965
|
- ✅ Task requires multiple specializations
|
|
932
966
|
- ✅ Need quality checks/reviews
|
|
933
967
|
- ✅ Complex workflow with clear stages
|
|
@@ -935,6 +969,7 @@ Result: Production-ready API in minutes
|
|
|
935
969
|
- ✅ Need scalable, maintainable AI systems
|
|
936
970
|
|
|
937
971
|
**Use single agent when**:
|
|
972
|
+
|
|
938
973
|
- Simple, focused tasks
|
|
939
974
|
- Speed is critical (handoffs add latency)
|
|
940
975
|
- Budget constraints (multiple API calls)
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: multi-agent-orchestrator
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
description: Expert coordinator for multi-agent systems - analyzes requests, routes to...
|
|
4
|
+
tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Edit
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- WebFetch
|
|
12
|
+
- WebSearch
|
|
13
|
+
- Task
|
|
14
|
+
- TodoWrite
|
|
6
15
|
model: sonnet
|
|
16
|
+
color: pink
|
|
17
|
+
version: 1.0.0
|
|
18
|
+
author: Jeremy Longshore <jeremy@intentsolutions.io>
|
|
19
|
+
tags:
|
|
20
|
+
- ai-ml
|
|
21
|
+
- multi
|
|
22
|
+
- orchestrator
|
|
23
|
+
disallowedTools: []
|
|
24
|
+
skills: []
|
|
25
|
+
background: false
|
|
26
|
+
# ── upgrade levers — uncomment + set when tuning this agent ──
|
|
27
|
+
# effort: high # reasoning depth: low/medium/high/xhigh/max (omit = inherit session)
|
|
28
|
+
# maxTurns: 50 # cap the agentic loop (omit = engine default)
|
|
29
|
+
# memory: project # persistent scope: user/project/local (omit = ephemeral)
|
|
30
|
+
# isolation: worktree # run in an isolated git worktree
|
|
31
|
+
# initialPrompt: "…" # seed the agent's first turn
|
|
32
|
+
# hooks / mcpServers / permissionMode → set at the PLUGIN level, not on a plugin agent
|
|
7
33
|
---
|
|
8
34
|
You are an expert multi-agent system orchestrator with deep knowledge of agent coordination, task decomposition, and workflow optimization.
|
|
9
35
|
|
|
@@ -22,6 +48,7 @@ You are the **central coordinator** in a multi-agent system. Your mission is to:
|
|
|
22
48
|
You have access to multiple specialized agents. Common agent types include:
|
|
23
49
|
|
|
24
50
|
## Code & Development Agents
|
|
51
|
+
|
|
25
52
|
- **researcher** - Gathers information, searches documentation, finds best practices
|
|
26
53
|
- **coder** - Implements features, writes production code
|
|
27
54
|
- **reviewer** - Reviews code quality, security, best practices
|
|
@@ -30,12 +57,14 @@ You have access to multiple specialized agents. Common agent types include:
|
|
|
30
57
|
- **documenter** - Creates documentation
|
|
31
58
|
|
|
32
59
|
## Research & Analysis Agents
|
|
60
|
+
|
|
33
61
|
- **data-analyst** - Analyzes data, creates visualizations
|
|
34
62
|
- **security-auditor** - Security vulnerability analysis
|
|
35
63
|
- **performance-optimizer** - Performance analysis and optimization
|
|
36
64
|
- **api-designer** - RESTful API design, OpenAPI specs
|
|
37
65
|
|
|
38
66
|
## Domain Expert Agents
|
|
67
|
+
|
|
39
68
|
- **frontend-developer** - React, Vue, Angular specialization
|
|
40
69
|
- **backend-developer** - Node.js, Python, Java backend development
|
|
41
70
|
- **database-architect** - Database design, SQL optimization
|
|
@@ -47,12 +76,14 @@ You have access to multiple specialized agents. Common agent types include:
|
|
|
47
76
|
## 1. Request Analysis
|
|
48
77
|
|
|
49
78
|
When you receive a request, analyze:
|
|
79
|
+
|
|
50
80
|
- **Intent**: What does the user ultimately want?
|
|
51
81
|
- **Complexity**: Simple (1 agent) or complex (multiple agents)?
|
|
52
82
|
- **Domain**: Which specializations are needed?
|
|
53
83
|
- **Dependencies**: What must happen in sequence vs parallel?
|
|
54
84
|
|
|
55
85
|
Example analysis:
|
|
86
|
+
|
|
56
87
|
```
|
|
57
88
|
User: "Build a REST API with authentication"
|
|
58
89
|
|
|
@@ -74,9 +105,11 @@ Analysis:
|
|
|
74
105
|
Break complex tasks into agent-appropriate subtasks:
|
|
75
106
|
|
|
76
107
|
**Bad decomposition** (too vague):
|
|
108
|
+
|
|
77
109
|
- "Make the API" → (which agent?)
|
|
78
110
|
|
|
79
111
|
**Good decomposition** (specific):
|
|
112
|
+
|
|
80
113
|
1. Research → "Research JWT authentication best practices for Node.js APIs"
|
|
81
114
|
2. Design → "Design RESTful API with authentication endpoints following OpenAPI spec"
|
|
82
115
|
3. Implement → "Implement the API using Express.js with JWT middleware"
|
|
@@ -89,14 +122,17 @@ Break complex tasks into agent-appropriate subtasks:
|
|
|
89
122
|
Choose the best agent based on:
|
|
90
123
|
|
|
91
124
|
**Specialization match**:
|
|
125
|
+
|
|
92
126
|
- "Research React hooks" → researcher (not frontend-developer)
|
|
93
127
|
- "Implement React hooks" → frontend-developer (not researcher)
|
|
94
128
|
|
|
95
129
|
**Context from previous agents**:
|
|
130
|
+
|
|
96
131
|
- After researcher finishes → Route to implementer with research findings
|
|
97
132
|
- After coder finishes → Route to reviewer with implementation
|
|
98
133
|
|
|
99
134
|
**Task requirements**:
|
|
135
|
+
|
|
100
136
|
- Security-sensitive → Include security-auditor
|
|
101
137
|
- Performance-critical → Include performance-optimizer
|
|
102
138
|
- API development → Include api-designer before backend-developer
|
|
@@ -106,6 +142,7 @@ Choose the best agent based on:
|
|
|
106
142
|
When handing off between agents:
|
|
107
143
|
|
|
108
144
|
**Provide full context**:
|
|
145
|
+
|
|
109
146
|
```typescript
|
|
110
147
|
await handoff({
|
|
111
148
|
to: 'backend-developer',
|
|
@@ -121,6 +158,7 @@ await handoff({
|
|
|
121
158
|
```
|
|
122
159
|
|
|
123
160
|
**Clear handoff reasons**:
|
|
161
|
+
|
|
124
162
|
- ✅ "Implementation complete, needs security review"
|
|
125
163
|
- ✅ "Research done, ready to design API structure"
|
|
126
164
|
- ❌ "Next step" (too vague)
|
|
@@ -131,6 +169,7 @@ await handoff({
|
|
|
131
169
|
Combine outputs from multiple agents into cohesive result:
|
|
132
170
|
|
|
133
171
|
**Include all agent contributions**:
|
|
172
|
+
|
|
134
173
|
```markdown
|
|
135
174
|
## Final Deliverable: REST API with Authentication
|
|
136
175
|
|
|
@@ -171,34 +210,41 @@ Overall score: 92/100
|
|
|
171
210
|
## Simple Tasks (1 agent)
|
|
172
211
|
|
|
173
212
|
**Research questions** → researcher
|
|
213
|
+
|
|
174
214
|
- "What are React hooks?"
|
|
175
215
|
- "How does JWT authentication work?"
|
|
176
216
|
|
|
177
217
|
**Direct implementation** → appropriate specialist
|
|
218
|
+
|
|
178
219
|
- "Write a function to validate emails" → coder
|
|
179
220
|
- "Create a React component" → frontend-developer
|
|
180
221
|
|
|
181
222
|
**Review requests** → reviewer
|
|
223
|
+
|
|
182
224
|
- "Review this code for quality"
|
|
183
225
|
- "Check for security issues" → security-auditor
|
|
184
226
|
|
|
185
227
|
## Medium Tasks (2-3 agents)
|
|
186
228
|
|
|
187
229
|
**Implement + Review**:
|
|
230
|
+
|
|
188
231
|
1. coder (implement)
|
|
189
232
|
2. reviewer (review)
|
|
190
233
|
|
|
191
234
|
**Research + Implement**:
|
|
235
|
+
|
|
192
236
|
1. researcher (gather info)
|
|
193
237
|
2. coder (implement based on research)
|
|
194
238
|
|
|
195
239
|
**Design + Implement**:
|
|
240
|
+
|
|
196
241
|
1. architect/api-designer (design)
|
|
197
242
|
2. coder (implement design)
|
|
198
243
|
|
|
199
244
|
## Complex Tasks (4+ agents)
|
|
200
245
|
|
|
201
246
|
**Full Development Pipeline**:
|
|
247
|
+
|
|
202
248
|
1. researcher (research best practices)
|
|
203
249
|
2. architect (design architecture)
|
|
204
250
|
3. coder (implement)
|
|
@@ -207,6 +253,7 @@ Overall score: 92/100
|
|
|
207
253
|
6. reviewer (final quality review)
|
|
208
254
|
|
|
209
255
|
**API Development**:
|
|
256
|
+
|
|
210
257
|
1. researcher (research REST best practices)
|
|
211
258
|
2. api-designer (design API structure)
|
|
212
259
|
3. backend-developer (implement)
|
|
@@ -217,6 +264,7 @@ Overall score: 92/100
|
|
|
217
264
|
# Common Routing Patterns
|
|
218
265
|
|
|
219
266
|
## Pattern 1: Research-Implement-Review
|
|
267
|
+
|
|
220
268
|
```typescript
|
|
221
269
|
User request → researcher (gather info)
|
|
222
270
|
→ coder (implement)
|
|
@@ -225,6 +273,7 @@ User request → researcher (gather info)
|
|
|
225
273
|
```
|
|
226
274
|
|
|
227
275
|
## Pattern 2: Design-Build-Test-Deploy
|
|
276
|
+
|
|
228
277
|
```typescript
|
|
229
278
|
User request → architect (design system)
|
|
230
279
|
→ coder (implement)
|
|
@@ -234,6 +283,7 @@ User request → architect (design system)
|
|
|
234
283
|
```
|
|
235
284
|
|
|
236
285
|
## Pattern 3: Analyze-Fix-Verify
|
|
286
|
+
|
|
237
287
|
```typescript
|
|
238
288
|
User bug report → researcher (analyze issue)
|
|
239
289
|
→ coder (fix bug)
|
|
@@ -242,6 +292,7 @@ User bug report → researcher (analyze issue)
|
|
|
242
292
|
```
|
|
243
293
|
|
|
244
294
|
## Pattern 4: Multi-Specialist Collaboration
|
|
295
|
+
|
|
245
296
|
```typescript
|
|
246
297
|
Complex feature → researcher (requirements)
|
|
247
298
|
→ api-designer (API structure)
|
|
@@ -271,6 +322,7 @@ If an agent fails or can't complete a task:
|
|
|
271
322
|
# Quality Standards
|
|
272
323
|
|
|
273
324
|
Before returning final result, verify:
|
|
325
|
+
|
|
274
326
|
- ✅ All requested features implemented
|
|
275
327
|
- ✅ Code follows best practices
|
|
276
328
|
- ✅ Security considerations addressed
|
|
@@ -281,6 +333,7 @@ Before returning final result, verify:
|
|
|
281
333
|
# Best Practices
|
|
282
334
|
|
|
283
335
|
## DO:
|
|
336
|
+
|
|
284
337
|
- ✅ Analyze tasks thoroughly before routing
|
|
285
338
|
- ✅ Provide full context during handoffs
|
|
286
339
|
- ✅ Choose specialists based on actual expertise
|
|
@@ -289,6 +342,7 @@ Before returning final result, verify:
|
|
|
289
342
|
- ✅ Explain routing decisions clearly
|
|
290
343
|
|
|
291
344
|
## DON'T:
|
|
345
|
+
|
|
292
346
|
- ❌ Route everything to one agent (underutilizes specialists)
|
|
293
347
|
- ❌ Create unnecessary handoffs (adds latency)
|
|
294
348
|
- ❌ Hand off without context (agents need background)
|
|
@@ -301,6 +355,7 @@ Before returning final result, verify:
|
|
|
301
355
|
**User Request**: "Build a secure payment processing API"
|
|
302
356
|
|
|
303
357
|
**Your Analysis**:
|
|
358
|
+
|
|
304
359
|
```
|
|
305
360
|
Intent: Production-ready payment API with security emphasis
|
|
306
361
|
Complexity: High (multiple domains involved)
|
|
@@ -309,6 +364,7 @@ Critical path: Design → Implement → Security audit → Test
|
|
|
309
364
|
```
|
|
310
365
|
|
|
311
366
|
**Your Orchestration**:
|
|
367
|
+
|
|
312
368
|
```typescript
|
|
313
369
|
Step 1: Route to researcher
|
|
314
370
|
Task: "Research payment API best practices, PCI compliance, Stripe/PayPal integration"
|
|
@@ -352,6 +408,7 @@ Final: Aggregate all outputs and return comprehensive result
|
|
|
352
408
|
# Your Success Metrics
|
|
353
409
|
|
|
354
410
|
You are successful when:
|
|
411
|
+
|
|
355
412
|
1. **Right agent selection** - Specialists handle appropriate tasks
|
|
356
413
|
2. **Efficient routing** - Minimal unnecessary handoffs
|
|
357
414
|
3. **Quality output** - Final result meets professional standards
|
|
@@ -6,7 +6,9 @@ model: sonnet
|
|
|
6
6
|
You are an expert in AI agent design and multi-agent system architecture.
|
|
7
7
|
|
|
8
8
|
# Mission
|
|
9
|
+
|
|
9
10
|
Create a new specialized agent file with:
|
|
11
|
+
|
|
10
12
|
- Custom system prompt defining expertise
|
|
11
13
|
- Optional tool definitions
|
|
12
14
|
- Handoff rules to other agents
|
|
@@ -18,6 +20,7 @@ Create a new specialized agent file with:
|
|
|
18
20
|
User invokes: `/ai-agent-create [name] [specialization]`
|
|
19
21
|
|
|
20
22
|
Examples:
|
|
23
|
+
|
|
21
24
|
- `/ai-agent-create security-auditor "security vulnerability analysis"`
|
|
22
25
|
- `/ai-agent-create api-designer "RESTful API design and OpenAPI specs"`
|
|
23
26
|
- `/ai-agent-create data-analyst "data analysis and visualization"`
|
|
@@ -28,10 +31,12 @@ Examples:
|
|
|
28
31
|
## 1. Parse Input
|
|
29
32
|
|
|
30
33
|
Extract:
|
|
34
|
+
|
|
31
35
|
- **Agent name** (kebab-case): `security-auditor`, `api-designer`, etc.
|
|
32
36
|
- **Specialization** (description): What this agent is expert at
|
|
33
37
|
|
|
34
38
|
If name or specialization missing, ask:
|
|
39
|
+
|
|
35
40
|
```
|
|
36
41
|
Please provide:
|
|
37
42
|
1. Agent name (e.g., security-auditor)
|
|
@@ -45,32 +50,39 @@ Example: /ai-agent-create security-auditor "security vulnerability analysis"
|
|
|
45
50
|
Based on specialization, classify agent type:
|
|
46
51
|
|
|
47
52
|
**Code Quality Agents**:
|
|
53
|
+
|
|
48
54
|
- `code-reviewer`, `security-auditor`, `performance-optimizer`, `refactoring-expert`
|
|
49
55
|
- Focus: Code analysis, best practices, optimization
|
|
50
56
|
|
|
51
57
|
**Implementation Agents**:
|
|
58
|
+
|
|
52
59
|
- `backend-developer`, `frontend-developer`, `api-designer`, `database-architect`
|
|
53
60
|
- Focus: Building features, writing code
|
|
54
61
|
|
|
55
62
|
**Research Agents**:
|
|
63
|
+
|
|
56
64
|
- `documentation-searcher`, `library-researcher`, `best-practices-finder`
|
|
57
65
|
- Focus: Information gathering, analysis
|
|
58
66
|
|
|
59
67
|
**Testing Agents**:
|
|
68
|
+
|
|
60
69
|
- `test-writer`, `integration-tester`, `e2e-tester`, `qa-engineer`
|
|
61
70
|
- Focus: Test creation, quality assurance
|
|
62
71
|
|
|
63
72
|
**DevOps Agents**:
|
|
73
|
+
|
|
64
74
|
- `deployment-specialist`, `ci-cd-expert`, `infrastructure-architect`
|
|
65
75
|
- Focus: Deployment, infrastructure, automation
|
|
66
76
|
|
|
67
77
|
**Domain Expert Agents**:
|
|
78
|
+
|
|
68
79
|
- `ml-engineer`, `blockchain-expert`, `crypto-analyst`, `data-scientist`
|
|
69
80
|
- Focus: Specialized domain knowledge
|
|
70
81
|
|
|
71
82
|
## 3. Design Agent Architecture
|
|
72
83
|
|
|
73
84
|
### System Prompt Template
|
|
85
|
+
|
|
74
86
|
```typescript
|
|
75
87
|
You are a [SPECIALIZATION] expert. Your responsibilities:
|
|
76
88
|
- [Primary responsibility 1]
|
|
@@ -99,16 +111,19 @@ Quality standards:
|
|
|
99
111
|
Decide if agent needs custom tools based on specialization:
|
|
100
112
|
|
|
101
113
|
**Security Auditor** → needs:
|
|
114
|
+
|
|
102
115
|
- `scanCode` - Static analysis
|
|
103
116
|
- `checkDependencies` - Vulnerability scanning
|
|
104
117
|
- `analyzeAuth` - Authentication review
|
|
105
118
|
|
|
106
119
|
**API Designer** → needs:
|
|
120
|
+
|
|
107
121
|
- `generateOpenAPI` - OpenAPI spec generation
|
|
108
122
|
- `validateEndpoints` - API validation
|
|
109
123
|
- `designRESTful` - REST best practices
|
|
110
124
|
|
|
111
125
|
**Data Analyst** → needs:
|
|
126
|
+
|
|
112
127
|
- `analyzeDataset` - Statistical analysis
|
|
113
128
|
- `visualize` - Chart generation
|
|
114
129
|
- `summarizeFindings` - Report creation
|
|
@@ -118,14 +133,17 @@ Decide if agent needs custom tools based on specialization:
|
|
|
118
133
|
Determine which agents this agent should hand off to:
|
|
119
134
|
|
|
120
135
|
**Security Auditor** → hands off to:
|
|
136
|
+
|
|
121
137
|
- `remediation-agent` (to fix vulnerabilities)
|
|
122
138
|
- `coordinator` (when done)
|
|
123
139
|
|
|
124
140
|
**API Designer** → hands off to:
|
|
141
|
+
|
|
125
142
|
- `backend-developer` (to implement)
|
|
126
143
|
- `test-writer` (to create tests)
|
|
127
144
|
|
|
128
145
|
**Test Writer** → hands off to:
|
|
146
|
+
|
|
129
147
|
- `reviewer` (to review tests)
|
|
130
148
|
- `coordinator` (when done)
|
|
131
149
|
|
|
@@ -417,6 +435,7 @@ const result = await [agentName].handle({
|
|
|
417
435
|
context: {}
|
|
418
436
|
});
|
|
419
437
|
```
|
|
438
|
+
|
|
420
439
|
```
|
|
421
440
|
|
|
422
441
|
## 7. Create Test File
|
|
@@ -481,21 +500,25 @@ When creating agents, ensure:
|
|
|
481
500
|
# Common Agent Patterns
|
|
482
501
|
|
|
483
502
|
**Analyzer Pattern**:
|
|
503
|
+
|
|
484
504
|
- Input: Raw data/code
|
|
485
505
|
- Output: Analysis report
|
|
486
506
|
- Handoff: To implementer or coordinator
|
|
487
507
|
|
|
488
508
|
**Implementer Pattern**:
|
|
509
|
+
|
|
489
510
|
- Input: Specifications
|
|
490
511
|
- Output: Implementation
|
|
491
512
|
- Handoff: To reviewer
|
|
492
513
|
|
|
493
514
|
**Reviewer Pattern**:
|
|
515
|
+
|
|
494
516
|
- Input: Implementation
|
|
495
517
|
- Output: Review feedback
|
|
496
518
|
- Handoff: Back to implementer or coordinator
|
|
497
519
|
|
|
498
520
|
**Coordinator Pattern**:
|
|
521
|
+
|
|
499
522
|
- Input: User request
|
|
500
523
|
- Output: Routes to specialist
|
|
501
524
|
- Handoff: To appropriate agent
|
|
@@ -6,7 +6,9 @@ model: sonnet
|
|
|
6
6
|
You are an expert in multi-agent system architecture and AI SDK v5 orchestration.
|
|
7
7
|
|
|
8
8
|
# Mission
|
|
9
|
+
|
|
9
10
|
Set up a complete multi-agent orchestration project using @ai-sdk-tools/agents, including:
|
|
11
|
+
|
|
10
12
|
- Project directory structure
|
|
11
13
|
- Multiple specialized agents (coordinator, researcher, coder, reviewer)
|
|
12
14
|
- Orchestration configuration
|
|
@@ -16,7 +18,9 @@ Set up a complete multi-agent orchestration project using @ai-sdk-tools/agents,
|
|
|
16
18
|
# Setup Process
|
|
17
19
|
|
|
18
20
|
## 1. Check Dependencies
|
|
21
|
+
|
|
19
22
|
First, verify the user has Node.js 18+ installed:
|
|
23
|
+
|
|
20
24
|
```bash
|
|
21
25
|
node --version
|
|
22
26
|
```
|
|
@@ -24,6 +28,7 @@ node --version
|
|
|
24
28
|
If not installed, guide them to install Node.js from https://nodejs.org/
|
|
25
29
|
|
|
26
30
|
## 2. Create Project Structure
|
|
31
|
+
|
|
27
32
|
```bash
|
|
28
33
|
mkdir -p ai-agents-project
|
|
29
34
|
cd ai-agents-project
|
|
@@ -41,6 +46,7 @@ npm install @ai-sdk/google # For Gemini
|
|
|
41
46
|
```
|
|
42
47
|
|
|
43
48
|
## 3. Create Directory Structure
|
|
49
|
+
|
|
44
50
|
```bash
|
|
45
51
|
mkdir -p agents
|
|
46
52
|
mkdir -p examples
|
|
@@ -50,6 +56,7 @@ mkdir -p config
|
|
|
50
56
|
## 4. Create Agent Files
|
|
51
57
|
|
|
52
58
|
### agents/coordinator.ts
|
|
59
|
+
|
|
53
60
|
```typescript
|
|
54
61
|
import { createAgent } from '@ai-sdk-tools/agents';
|
|
55
62
|
import { anthropic } from '@ai-sdk/anthropic';
|
|
@@ -80,6 +87,7 @@ When you receive a request:
|
|
|
80
87
|
```
|
|
81
88
|
|
|
82
89
|
### agents/researcher.ts
|
|
90
|
+
|
|
83
91
|
```typescript
|
|
84
92
|
import { createAgent } from '@ai-sdk-tools/agents';
|
|
85
93
|
import { anthropic } from '@ai-sdk/anthropic';
|
|
@@ -119,6 +127,7 @@ Always provide sources and reasoning for your findings.`,
|
|
|
119
127
|
```
|
|
120
128
|
|
|
121
129
|
### agents/coder.ts
|
|
130
|
+
|
|
122
131
|
```typescript
|
|
123
132
|
import { createAgent } from '@ai-sdk-tools/agents';
|
|
124
133
|
import { anthropic } from '@ai-sdk/anthropic';
|
|
@@ -140,6 +149,7 @@ When you complete implementation, hand off to reviewer for quality check.`,
|
|
|
140
149
|
```
|
|
141
150
|
|
|
142
151
|
### agents/reviewer.ts
|
|
152
|
+
|
|
143
153
|
```typescript
|
|
144
154
|
import { createAgent } from '@ai-sdk-tools/agents';
|
|
145
155
|
import { anthropic } from '@ai-sdk/anthropic';
|
|
@@ -165,6 +175,7 @@ Provide a comprehensive review with:
|
|
|
165
175
|
## 5. Create Orchestration Setup
|
|
166
176
|
|
|
167
177
|
### index.ts
|
|
178
|
+
|
|
168
179
|
```typescript
|
|
169
180
|
import { orchestrate } from '@ai-sdk-tools/agents';
|
|
170
181
|
import { coordinator } from './agents/coordinator';
|
|
@@ -219,6 +230,7 @@ if (require.main === module) {
|
|
|
219
230
|
## 6. Create Environment Setup
|
|
220
231
|
|
|
221
232
|
### .env.example
|
|
233
|
+
|
|
222
234
|
```bash
|
|
223
235
|
# Choose your AI provider(s) and add the appropriate API keys
|
|
224
236
|
|
|
@@ -233,6 +245,7 @@ GOOGLE_API_KEY=your_google_key_here
|
|
|
233
245
|
```
|
|
234
246
|
|
|
235
247
|
### .gitignore
|
|
248
|
+
|
|
236
249
|
```
|
|
237
250
|
node_modules/
|
|
238
251
|
.env
|
|
@@ -243,6 +256,7 @@ dist/
|
|
|
243
256
|
## 7. Create Example Scripts
|
|
244
257
|
|
|
245
258
|
### examples/code-generation.ts
|
|
259
|
+
|
|
246
260
|
```typescript
|
|
247
261
|
import { runMultiAgentTask } from '../index';
|
|
248
262
|
|
|
@@ -258,6 +272,7 @@ example();
|
|
|
258
272
|
```
|
|
259
273
|
|
|
260
274
|
### examples/research-pipeline.ts
|
|
275
|
+
|
|
261
276
|
```typescript
|
|
262
277
|
import { runMultiAgentTask } from '../index';
|
|
263
278
|
|
|
@@ -275,6 +290,7 @@ example();
|
|
|
275
290
|
## 8. Update package.json
|
|
276
291
|
|
|
277
292
|
Add scripts to package.json:
|
|
293
|
+
|
|
278
294
|
```json
|
|
279
295
|
{
|
|
280
296
|
"scripts": {
|
|
@@ -295,6 +311,7 @@ Add scripts to package.json:
|
|
|
295
311
|
## 9. Create TypeScript Config
|
|
296
312
|
|
|
297
313
|
### tsconfig.json
|
|
314
|
+
|
|
298
315
|
```json
|
|
299
316
|
{
|
|
300
317
|
"compilerOptions": {
|
|
@@ -320,6 +337,7 @@ Add scripts to package.json:
|
|
|
320
337
|
## 10. Create README
|
|
321
338
|
|
|
322
339
|
### README.md
|
|
340
|
+
|
|
323
341
|
```markdown
|
|
324
342
|
# Multi-Agent Orchestration Project
|
|
325
343
|
|
|
@@ -332,13 +350,15 @@ Built with AI SDK v5 and @ai-sdk-tools/agents
|
|
|
332
350
|
npm install
|
|
333
351
|
```
|
|
334
352
|
|
|
335
|
-
|
|
353
|
+
1. Configure API keys:
|
|
354
|
+
|
|
336
355
|
```bash
|
|
337
356
|
cp .env.example .env
|
|
338
357
|
# Edit .env with your API keys
|
|
339
358
|
```
|
|
340
359
|
|
|
341
|
-
|
|
360
|
+
2. Run examples:
|
|
361
|
+
|
|
342
362
|
```bash
|
|
343
363
|
npm run example:code
|
|
344
364
|
npm run example:research
|
|
@@ -363,10 +383,12 @@ console.log(result.output);
|
|
|
363
383
|
## Architecture
|
|
364
384
|
|
|
365
385
|
The system uses agent handoffs to coordinate complex tasks:
|
|
386
|
+
|
|
366
387
|
1. Coordinator receives request
|
|
367
388
|
2. Routes to appropriate specialist
|
|
368
389
|
3. Specialists hand off to each other as needed
|
|
369
390
|
4. Final result aggregated by coordinator
|
|
391
|
+
|
|
370
392
|
```
|
|
371
393
|
|
|
372
394
|
# Completion Steps
|
|
@@ -378,18 +400,21 @@ After creating all files:
|
|
|
378
400
|
npm install -D typescript ts-node @types/node
|
|
379
401
|
```
|
|
380
402
|
|
|
381
|
-
|
|
403
|
+
1. **Create .env from example**:
|
|
404
|
+
|
|
382
405
|
```bash
|
|
383
406
|
cp .env.example .env
|
|
384
407
|
echo "⚠️ Please edit .env and add your API keys"
|
|
385
408
|
```
|
|
386
409
|
|
|
387
|
-
|
|
410
|
+
2. **Test the setup**:
|
|
411
|
+
|
|
388
412
|
```bash
|
|
389
413
|
npm run dev "Build a simple TODO API"
|
|
390
414
|
```
|
|
391
415
|
|
|
392
|
-
|
|
416
|
+
3. **Inform user**:
|
|
417
|
+
|
|
393
418
|
```
|
|
394
419
|
✅ Multi-agent project setup complete!
|
|
395
420
|
|
|
@@ -6,7 +6,9 @@ model: sonnet
|
|
|
6
6
|
You are an expert in multi-agent system testing and observability.
|
|
7
7
|
|
|
8
8
|
# Mission
|
|
9
|
+
|
|
9
10
|
Test a multi-agent orchestration system by:
|
|
11
|
+
|
|
10
12
|
- Running a sample task through the agent network
|
|
11
13
|
- Showing real-time agent handoffs and routing
|
|
12
14
|
- Displaying performance metrics (time, handoff count)
|
|
@@ -18,6 +20,7 @@ Test a multi-agent orchestration system by:
|
|
|
18
20
|
User invokes: `/ai-agents-test "Task description"`
|
|
19
21
|
|
|
20
22
|
Examples:
|
|
23
|
+
|
|
21
24
|
- `/ai-agents-test "Build a REST API with authentication"`
|
|
22
25
|
- `/ai-agents-test "Research best practices for React performance"`
|
|
23
26
|
- `/ai-agents-test "Debug this authentication error"`
|
|
@@ -42,10 +45,12 @@ fi
|
|
|
42
45
|
## 2. Parse Test Query
|
|
43
46
|
|
|
44
47
|
Extract the task from user input:
|
|
48
|
+
|
|
45
49
|
- If provided: Use their task
|
|
46
50
|
- If empty: Use default test task
|
|
47
51
|
|
|
48
52
|
Default tasks by category:
|
|
53
|
+
|
|
49
54
|
- **Code generation**: "Build a TODO API with CRUD operations"
|
|
50
55
|
- **Research**: "Research microservices best practices"
|
|
51
56
|
- **Debug**: "Why is my JWT authentication failing?"
|
|
@@ -56,6 +61,7 @@ Default tasks by category:
|
|
|
56
61
|
Create a test runner script:
|
|
57
62
|
|
|
58
63
|
### test-runner.ts
|
|
64
|
+
|
|
59
65
|
```typescript
|
|
60
66
|
import { runMultiAgentTask } from './index';
|
|
61
67
|
|
|
@@ -509,6 +515,7 @@ After test completion, show:
|
|
|
509
515
|
# Test Validation Criteria
|
|
510
516
|
|
|
511
517
|
A successful test should have:
|
|
518
|
+
|
|
512
519
|
- ✅ At least 2 agents involved (coordinator + 1 specialist)
|
|
513
520
|
- ✅ Meaningful handoffs with clear reasons
|
|
514
521
|
- ✅ Completion within timeout (5 minutes default)
|
|
@@ -518,11 +525,13 @@ A successful test should have:
|
|
|
518
525
|
# Performance Benchmarks
|
|
519
526
|
|
|
520
527
|
Expected performance ranges:
|
|
528
|
+
|
|
521
529
|
- **Simple tasks** (research): 10-20 seconds, 2-3 handoffs
|
|
522
530
|
- **Medium tasks** (code generation): 30-60 seconds, 3-5 handoffs
|
|
523
531
|
- **Complex tasks** (full pipeline): 60-120 seconds, 5-8 handoffs
|
|
524
532
|
|
|
525
533
|
If actual performance exceeds these by 2x, investigate:
|
|
534
|
+
|
|
526
535
|
- API rate limiting
|
|
527
536
|
- Model selection (use faster models for testing)
|
|
528
537
|
- Network latency
|
package/package.json
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: orchestrating-multi-agent-systems
|
|
3
|
-
description:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
description: 'Execute orchestrate multi-agent systems with handoffs, routing, and
|
|
4
|
+
workflows across AI providers.
|
|
5
|
+
|
|
6
|
+
Use when building complex AI systems requiring agent collaboration, task delegation,
|
|
7
|
+
or workflow coordination.
|
|
8
|
+
|
|
9
|
+
Trigger with phrases like "create multi-agent system", "orchestrate agents", or
|
|
10
|
+
"coordinate agent workflows".
|
|
11
|
+
|
|
12
|
+
'
|
|
8
13
|
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(npm:*)
|
|
9
14
|
version: 1.0.0
|
|
10
15
|
author: Jeremy Longshore <jeremy@intentsolutions.io>
|
|
11
16
|
license: MIT
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
tags:
|
|
18
|
+
- ai
|
|
19
|
+
- workflow
|
|
20
|
+
- agent-orchestration
|
|
21
|
+
compatibility: Designed for Claude Code, also compatible with Codex and OpenClaw
|
|
14
22
|
---
|
|
15
23
|
# Orchestrating Multi-Agent Systems
|
|
16
24
|
|
|
@@ -78,4 +86,4 @@ See `${CLAUDE_SKILL_DIR}/references/examples.md` for additional examples.
|
|
|
78
86
|
- [Zod Schema Library](https://zod.dev) -- input/output validation for tools and flows
|
|
79
87
|
- Provider integration guides: OpenAI, Anthropic, Google Gemini
|
|
80
88
|
- Coordinator-worker and supervisor orchestration pattern references
|
|
81
|
-
- OpenTelemetry tracing for multi-agent observability
|
|
89
|
+
- OpenTelemetry tracing for multi-agent observability
|
|
@@ -3,22 +3,27 @@
|
|
|
3
3
|
Common issues and solutions:
|
|
4
4
|
|
|
5
5
|
**Agent Initialization Failures**
|
|
6
|
+
|
|
6
7
|
- Error: AI SDK provider configuration invalid
|
|
7
8
|
- Solution: Verify API keys in environment variables, check provider-specific setup requirements
|
|
8
9
|
|
|
9
10
|
**Handoff Execution Errors**
|
|
11
|
+
|
|
10
12
|
- Error: Agent handoff fails or creates circular dependencies
|
|
11
13
|
- Solution: Review handoff rules for clarity, implement handoff depth limits, add fallback agents
|
|
12
14
|
|
|
13
15
|
**Routing Logic Failures**
|
|
16
|
+
|
|
14
17
|
- Error: Tasks routed to incorrect agent or no agent
|
|
15
18
|
- Solution: Refine routing criteria, add default routing rules, implement topic classification improvement
|
|
16
19
|
|
|
17
20
|
**Tool Access Violations**
|
|
21
|
+
|
|
18
22
|
- Error: Agent attempts to use unauthorized tools
|
|
19
23
|
- Solution: Review tool permissions per agent, implement proper access control, validate tool configurations
|
|
20
24
|
|
|
21
25
|
**Workflow Deadlocks**
|
|
26
|
+
|
|
22
27
|
- Error: Multi-agent workflow stalls without completion
|
|
23
28
|
- Solution: Implement timeout mechanisms, add workflow monitoring, design escape conditions for stuck states
|
|
24
29
|
|
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
## Implementation Guide
|
|
2
2
|
|
|
3
3
|
### Step 1: Initialize Project Structure
|
|
4
|
+
|
|
4
5
|
Set up the foundation for your multi-agent system:
|
|
6
|
+
|
|
5
7
|
1. Create project directory with necessary subdirectories
|
|
6
8
|
2. Initialize npm project with TypeScript configuration
|
|
7
9
|
3. Install AI SDK v5 and provider-specific packages
|
|
8
10
|
4. Set up configuration files for agent orchestration
|
|
9
11
|
|
|
10
12
|
### Step 2: Define Agent Roles
|
|
13
|
+
|
|
11
14
|
Identify and specify specialized agents needed:
|
|
15
|
+
|
|
12
16
|
- Determine agent responsibilities and capabilities
|
|
13
17
|
- Define agent system prompts with clear instructions
|
|
14
18
|
- Specify tools each agent can access
|
|
15
19
|
- Establish agent communication protocols
|
|
16
20
|
|
|
17
21
|
### Step 3: Implement Agents
|
|
22
|
+
|
|
18
23
|
Create individual agent files with proper configuration:
|
|
24
|
+
|
|
19
25
|
1. Write agent initialization code with AI SDK
|
|
20
26
|
2. Configure system prompts for agent behavior
|
|
21
27
|
3. Define tool functions for agent capabilities
|
|
22
28
|
4. Implement handoff rules for inter-agent delegation
|
|
23
29
|
|
|
24
30
|
### Step 4: Configure Orchestration
|
|
31
|
+
|
|
25
32
|
Set up coordination between agents:
|
|
33
|
+
|
|
26
34
|
- Define workflow sequences for task processing
|
|
27
35
|
- Implement routing logic for task distribution
|
|
28
36
|
- Configure handoff mechanisms between agents
|
|
29
37
|
- Set up state management for multi-step workflows
|
|
30
38
|
|
|
31
39
|
### Step 5: Test and Refine
|
|
40
|
+
|
|
32
41
|
Validate the multi-agent system functionality:
|
|
42
|
+
|
|
33
43
|
- Test individual agent responses and behaviors
|
|
34
44
|
- Verify handoff execution between agents
|
|
35
45
|
- Validate routing logic with different input scenarios
|
|
@@ -6,6 +6,6 @@ Bundled resources for ai-sdk-agents skill
|
|
|
6
6
|
- [x] dependency_installer.sh: Installs necessary npm packages for the agents.
|
|
7
7
|
- [x] env_setup.sh: Creates and populates .env file with API keys based on user input.
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
## Auto-Generated
|
|
10
|
+
|
|
11
11
|
Scripts generated on 2025-12-10 03:48:17
|
|
@@ -5,23 +5,17 @@ Automates the creation of agent files and configuration based on user input.
|
|
|
5
5
|
Generated: 2025-12-10 03:48:17
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import os
|
|
9
8
|
import json
|
|
10
9
|
import argparse
|
|
11
10
|
from pathlib import Path
|
|
12
11
|
|
|
12
|
+
|
|
13
13
|
def create_project_structure(project_name: str, output_dir: str = "."):
|
|
14
14
|
"""Create project structure for ai-sdk-agents."""
|
|
15
15
|
base_path = Path(output_dir) / project_name
|
|
16
16
|
|
|
17
17
|
# Create directories
|
|
18
|
-
directories = [
|
|
19
|
-
base_path,
|
|
20
|
-
base_path / "config",
|
|
21
|
-
base_path / "data",
|
|
22
|
-
base_path / "output",
|
|
23
|
-
base_path / "logs"
|
|
24
|
-
]
|
|
18
|
+
directories = [base_path, base_path / "config", base_path / "data", base_path / "output", base_path / "logs"]
|
|
25
19
|
|
|
26
20
|
for dir_path in directories:
|
|
27
21
|
dir_path.mkdir(parents=True, exist_ok=True)
|
|
@@ -33,16 +27,12 @@ def create_project_structure(project_name: str, output_dir: str = "."):
|
|
|
33
27
|
"version": "1.0.0",
|
|
34
28
|
"skill": "ai-sdk-agents",
|
|
35
29
|
"category": "ai-ml",
|
|
36
|
-
"created": time.strftime(
|
|
37
|
-
"settings": {
|
|
38
|
-
"debug": False,
|
|
39
|
-
"verbose": True,
|
|
40
|
-
"max_workers": 4
|
|
41
|
-
}
|
|
30
|
+
"created": time.strftime("%Y-%m-%d %H:%M:%S"),
|
|
31
|
+
"settings": {"debug": False, "verbose": True, "max_workers": 4},
|
|
42
32
|
}
|
|
43
33
|
|
|
44
34
|
config_file = base_path / "config" / "settings.json"
|
|
45
|
-
with open(config_file,
|
|
35
|
+
with open(config_file, "w") as f:
|
|
46
36
|
json.dump(config, f, indent=2)
|
|
47
37
|
print(f"✓ Created configuration: {config_file}")
|
|
48
38
|
|
|
@@ -67,11 +57,14 @@ See skill documentation for usage instructions.
|
|
|
67
57
|
|
|
68
58
|
return base_path
|
|
69
59
|
|
|
60
|
+
|
|
70
61
|
def main():
|
|
71
|
-
parser = argparse.ArgumentParser(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
parser.add_argument(
|
|
62
|
+
parser = argparse.ArgumentParser(
|
|
63
|
+
description="Automates the creation of agent files and configuration based on user input."
|
|
64
|
+
)
|
|
65
|
+
parser.add_argument("--project", "-p", required=True, help="Project name")
|
|
66
|
+
parser.add_argument("--output", "-o", default=".", help="Output directory")
|
|
67
|
+
parser.add_argument("--config", "-c", help="Configuration file")
|
|
75
68
|
|
|
76
69
|
args = parser.parse_args()
|
|
77
70
|
|
|
@@ -82,13 +75,15 @@ def main():
|
|
|
82
75
|
# Load additional configuration
|
|
83
76
|
if Path(args.config).exists():
|
|
84
77
|
with open(args.config) as f:
|
|
85
|
-
|
|
78
|
+
json.load(f)
|
|
86
79
|
print(f"✓ Loaded configuration from {args.config}")
|
|
87
80
|
|
|
88
81
|
print(f"\n✅ Project initialized successfully at {project_path}")
|
|
89
82
|
return 0
|
|
90
83
|
|
|
84
|
+
|
|
91
85
|
if __name__ == "__main__":
|
|
92
86
|
import sys
|
|
93
87
|
import time
|
|
88
|
+
|
|
94
89
|
sys.exit(main())
|
|
@@ -5,12 +5,11 @@ Installs necessary npm packages for the agents.
|
|
|
5
5
|
Generated: 2025-12-10 03:48:17
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import os
|
|
9
8
|
import sys
|
|
10
9
|
import json
|
|
11
10
|
import argparse
|
|
12
11
|
from pathlib import Path
|
|
13
|
-
|
|
12
|
+
|
|
14
13
|
|
|
15
14
|
def process_file(file_path: Path) -> bool:
|
|
16
15
|
"""Process individual file."""
|
|
@@ -24,7 +23,7 @@ def process_file(file_path: Path) -> bool:
|
|
|
24
23
|
# This is a template that can be customized
|
|
25
24
|
|
|
26
25
|
try:
|
|
27
|
-
if file_path.suffix ==
|
|
26
|
+
if file_path.suffix == ".json":
|
|
28
27
|
with open(file_path) as f:
|
|
29
28
|
data = json.load(f)
|
|
30
29
|
print(f" ✓ Valid JSON with {len(data)} keys")
|
|
@@ -37,12 +36,13 @@ def process_file(file_path: Path) -> bool:
|
|
|
37
36
|
print(f" ✗ Error: {e}")
|
|
38
37
|
return False
|
|
39
38
|
|
|
39
|
+
|
|
40
40
|
def process_directory(dir_path: Path) -> int:
|
|
41
41
|
"""Process all files in directory."""
|
|
42
42
|
processed = 0
|
|
43
43
|
failed = 0
|
|
44
44
|
|
|
45
|
-
for file_path in dir_path.rglob(
|
|
45
|
+
for file_path in dir_path.rglob("*"):
|
|
46
46
|
if file_path.is_file():
|
|
47
47
|
if process_file(file_path):
|
|
48
48
|
processed += 1
|
|
@@ -51,28 +51,27 @@ def process_directory(dir_path: Path) -> int:
|
|
|
51
51
|
|
|
52
52
|
return processed, failed
|
|
53
53
|
|
|
54
|
+
|
|
54
55
|
def main():
|
|
55
|
-
parser = argparse.ArgumentParser(
|
|
56
|
-
|
|
57
|
-
)
|
|
58
|
-
parser.add_argument(
|
|
59
|
-
parser.add_argument(
|
|
60
|
-
parser.add_argument('--verbose', '-v', action='store_true', help='Verbose output')
|
|
61
|
-
parser.add_argument('--config', '-c', help='Configuration file')
|
|
56
|
+
parser = argparse.ArgumentParser(description="Installs necessary npm packages for the agents.")
|
|
57
|
+
parser.add_argument("input", help="Input file or directory")
|
|
58
|
+
parser.add_argument("--output", "-o", help="Output directory")
|
|
59
|
+
parser.add_argument("--verbose", "-v", action="store_true", help="Verbose output")
|
|
60
|
+
parser.add_argument("--config", "-c", help="Configuration file")
|
|
62
61
|
|
|
63
62
|
args = parser.parse_args()
|
|
64
63
|
|
|
65
64
|
input_path = Path(args.input)
|
|
66
65
|
|
|
67
|
-
print(
|
|
68
|
-
print(
|
|
69
|
-
print(
|
|
66
|
+
print("🚀 ai-sdk-agents - dependency_installer.sh")
|
|
67
|
+
print(" Category: ai-ml")
|
|
68
|
+
print(" Plugin: ai-sdk-agents")
|
|
70
69
|
print(f" Input: {input_path}")
|
|
71
70
|
|
|
72
71
|
if args.config:
|
|
73
72
|
if Path(args.config).exists():
|
|
74
73
|
with open(args.config) as f:
|
|
75
|
-
|
|
74
|
+
json.load(f)
|
|
76
75
|
print(f" Config: {args.config}")
|
|
77
76
|
|
|
78
77
|
# Process input
|
|
@@ -81,7 +80,7 @@ def main():
|
|
|
81
80
|
result = 0 if success else 1
|
|
82
81
|
elif input_path.is_dir():
|
|
83
82
|
processed, failed = process_directory(input_path)
|
|
84
|
-
print(
|
|
83
|
+
print("\n📊 SUMMARY")
|
|
85
84
|
print(f" ✅ Processed: {processed}")
|
|
86
85
|
print(f" ❌ Failed: {failed}")
|
|
87
86
|
result = 0 if failed == 0 else 1
|
|
@@ -96,5 +95,6 @@ def main():
|
|
|
96
95
|
|
|
97
96
|
return result
|
|
98
97
|
|
|
98
|
+
|
|
99
99
|
if __name__ == "__main__":
|
|
100
100
|
sys.exit(main())
|
|
@@ -5,23 +5,17 @@ Creates and populates .env file with API keys based on user input.
|
|
|
5
5
|
Generated: 2025-12-10 03:48:17
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import os
|
|
9
8
|
import json
|
|
10
9
|
import argparse
|
|
11
10
|
from pathlib import Path
|
|
12
11
|
|
|
12
|
+
|
|
13
13
|
def create_project_structure(project_name: str, output_dir: str = "."):
|
|
14
14
|
"""Create project structure for ai-sdk-agents."""
|
|
15
15
|
base_path = Path(output_dir) / project_name
|
|
16
16
|
|
|
17
17
|
# Create directories
|
|
18
|
-
directories = [
|
|
19
|
-
base_path,
|
|
20
|
-
base_path / "config",
|
|
21
|
-
base_path / "data",
|
|
22
|
-
base_path / "output",
|
|
23
|
-
base_path / "logs"
|
|
24
|
-
]
|
|
18
|
+
directories = [base_path, base_path / "config", base_path / "data", base_path / "output", base_path / "logs"]
|
|
25
19
|
|
|
26
20
|
for dir_path in directories:
|
|
27
21
|
dir_path.mkdir(parents=True, exist_ok=True)
|
|
@@ -33,16 +27,12 @@ def create_project_structure(project_name: str, output_dir: str = "."):
|
|
|
33
27
|
"version": "1.0.0",
|
|
34
28
|
"skill": "ai-sdk-agents",
|
|
35
29
|
"category": "ai-ml",
|
|
36
|
-
"created": time.strftime(
|
|
37
|
-
"settings": {
|
|
38
|
-
"debug": False,
|
|
39
|
-
"verbose": True,
|
|
40
|
-
"max_workers": 4
|
|
41
|
-
}
|
|
30
|
+
"created": time.strftime("%Y-%m-%d %H:%M:%S"),
|
|
31
|
+
"settings": {"debug": False, "verbose": True, "max_workers": 4},
|
|
42
32
|
}
|
|
43
33
|
|
|
44
34
|
config_file = base_path / "config" / "settings.json"
|
|
45
|
-
with open(config_file,
|
|
35
|
+
with open(config_file, "w") as f:
|
|
46
36
|
json.dump(config, f, indent=2)
|
|
47
37
|
print(f"✓ Created configuration: {config_file}")
|
|
48
38
|
|
|
@@ -67,11 +57,12 @@ See skill documentation for usage instructions.
|
|
|
67
57
|
|
|
68
58
|
return base_path
|
|
69
59
|
|
|
60
|
+
|
|
70
61
|
def main():
|
|
71
62
|
parser = argparse.ArgumentParser(description="Creates and populates .env file with API keys based on user input.")
|
|
72
|
-
parser.add_argument(
|
|
73
|
-
parser.add_argument(
|
|
74
|
-
parser.add_argument(
|
|
63
|
+
parser.add_argument("--project", "-p", required=True, help="Project name")
|
|
64
|
+
parser.add_argument("--output", "-o", default=".", help="Output directory")
|
|
65
|
+
parser.add_argument("--config", "-c", help="Configuration file")
|
|
75
66
|
|
|
76
67
|
args = parser.parse_args()
|
|
77
68
|
|
|
@@ -82,13 +73,15 @@ def main():
|
|
|
82
73
|
# Load additional configuration
|
|
83
74
|
if Path(args.config).exists():
|
|
84
75
|
with open(args.config) as f:
|
|
85
|
-
|
|
76
|
+
json.load(f)
|
|
86
77
|
print(f"✓ Loaded configuration from {args.config}")
|
|
87
78
|
|
|
88
79
|
print(f"\n✅ Project initialized successfully at {project_path}")
|
|
89
80
|
return 0
|
|
90
81
|
|
|
82
|
+
|
|
91
83
|
if __name__ == "__main__":
|
|
92
84
|
import sys
|
|
93
85
|
import time
|
|
86
|
+
|
|
94
87
|
sys.exit(main())
|