agentic-flow 1.6.6 → 1.7.2

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.
Files changed (32) hide show
  1. package/.claude/agents/test-neural.md +5 -0
  2. package/.claude/settings.json +20 -19
  3. package/.claude/skills/.claude-flow/metrics/agent-metrics.json +1 -0
  4. package/.claude/skills/.claude-flow/metrics/performance.json +87 -0
  5. package/.claude/skills/.claude-flow/metrics/task-metrics.json +10 -0
  6. package/.claude/skills/agentdb-memory-patterns/SKILL.md +166 -0
  7. package/.claude/skills/agentdb-vector-search/SKILL.md +126 -0
  8. package/.claude/skills/agentic-flow/agentdb-memory-patterns/SKILL.md +166 -0
  9. package/.claude/skills/agentic-flow/agentdb-vector-search/SKILL.md +126 -0
  10. package/.claude/skills/agentic-flow/reasoningbank-intelligence/SKILL.md +201 -0
  11. package/.claude/skills/agentic-flow/swarm-orchestration/SKILL.md +179 -0
  12. package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
  13. package/.claude/skills/skill-builder/.claude-flow/metrics/agent-metrics.json +1 -0
  14. package/.claude/skills/skill-builder/.claude-flow/metrics/performance.json +87 -0
  15. package/.claude/skills/skill-builder/.claude-flow/metrics/task-metrics.json +10 -0
  16. package/.claude/skills/skill-builder/README.md +308 -0
  17. package/.claude/skills/skill-builder/SKILL.md +910 -0
  18. package/.claude/skills/skill-builder/docs/SPECIFICATION.md +358 -0
  19. package/.claude/skills/skill-builder/resources/schemas/skill-frontmatter.schema.json +41 -0
  20. package/.claude/skills/skill-builder/resources/templates/full-skill.template +118 -0
  21. package/.claude/skills/skill-builder/resources/templates/minimal-skill.template +38 -0
  22. package/.claude/skills/skill-builder/scripts/generate-skill.sh +334 -0
  23. package/.claude/skills/skill-builder/scripts/validate-skill.sh +198 -0
  24. package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
  25. package/CHANGELOG.md +61 -0
  26. package/README.md +79 -1
  27. package/dist/cli/skills-manager.js +1295 -0
  28. package/dist/cli/update-message.js +175 -0
  29. package/dist/cli-proxy.js +8 -1
  30. package/dist/utils/cli.js +17 -0
  31. package/package.json +2 -2
  32. package/.claude/answer.md +0 -1
@@ -0,0 +1,334 @@
1
+ #!/bin/bash
2
+ # Skill Builder - Generate New Skill Script
3
+ # Usage: ./scripts/generate-skill.sh <skill-name> <location>
4
+ # Location: personal | project | both (default: personal)
5
+
6
+ set -e
7
+
8
+ # Colors for output
9
+ GREEN='\033[0;32m'
10
+ BLUE='\033[0;34m'
11
+ YELLOW='\033[1;33m'
12
+ NC='\033[0m' # No Color
13
+
14
+ # Parse arguments
15
+ SKILL_NAME="${1:-my-new-skill}"
16
+ LOCATION="${2:-personal}"
17
+
18
+ # Paths
19
+ PERSONAL_SKILLS="$HOME/.claude/skills"
20
+ PROJECT_SKILLS="$(git rev-parse --show-toplevel 2>/dev/null)/.claude/skills" || PROJECT_SKILLS="$(pwd)/.claude/skills"
21
+
22
+ echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
23
+ echo -e "${BLUE}🎨 Skill Builder - Generate New Skill${NC}"
24
+ echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
25
+ echo ""
26
+
27
+ # Prompt for skill details
28
+ read -p "Skill name (display name, max 64 chars): " DISPLAY_NAME
29
+ DISPLAY_NAME="${DISPLAY_NAME:-$SKILL_NAME}"
30
+
31
+ read -p "Skill description (what it does and when to use, max 1024 chars): " DESCRIPTION
32
+ DESCRIPTION="${DESCRIPTION:-Describe what this skill does and when to use it.}"
33
+
34
+ read -p "Category/Namespace (e.g., 'my-skills', 'dev-tools'): " NAMESPACE
35
+ NAMESPACE="${NAMESPACE:-my-skills}"
36
+
37
+ read -p "Include scripts directory? (y/n): " INCLUDE_SCRIPTS
38
+ read -p "Include resources directory? (y/n): " INCLUDE_RESOURCES
39
+ read -p "Include docs directory? (y/n): " INCLUDE_DOCS
40
+
41
+ # Function to create skill
42
+ create_skill() {
43
+ local base_dir="$1"
44
+ local skill_path="$base_dir/$NAMESPACE/$SKILL_NAME"
45
+
46
+ echo ""
47
+ echo -e "${GREEN}Creating skill at: ${BLUE}$skill_path${NC}"
48
+
49
+ # Create directories
50
+ mkdir -p "$skill_path"
51
+
52
+ if [[ "$INCLUDE_SCRIPTS" == "y" ]]; then
53
+ mkdir -p "$skill_path/scripts"
54
+ echo -e "${GREEN}✓${NC} Created scripts/ directory"
55
+ fi
56
+
57
+ if [[ "$INCLUDE_RESOURCES" == "y" ]]; then
58
+ mkdir -p "$skill_path/resources/templates"
59
+ mkdir -p "$skill_path/resources/examples"
60
+ mkdir -p "$skill_path/resources/schemas"
61
+ echo -e "${GREEN}✓${NC} Created resources/ directory structure"
62
+ fi
63
+
64
+ if [[ "$INCLUDE_DOCS" == "y" ]]; then
65
+ mkdir -p "$skill_path/docs"
66
+ echo -e "${GREEN}✓${NC} Created docs/ directory"
67
+ fi
68
+
69
+ # Create SKILL.md
70
+ cat > "$skill_path/SKILL.md" << EOF
71
+ ---
72
+ name: "$DISPLAY_NAME"
73
+ description: "$DESCRIPTION"
74
+ ---
75
+
76
+ # $DISPLAY_NAME
77
+
78
+ ## What This Skill Does
79
+
80
+ $DESCRIPTION
81
+
82
+ ## Prerequisites
83
+
84
+ - Prerequisite 1
85
+ - Prerequisite 2
86
+
87
+ ## Quick Start
88
+
89
+ \`\`\`bash
90
+ # Basic usage command
91
+ command --option value
92
+ \`\`\`
93
+
94
+ ## Step-by-Step Guide
95
+
96
+ ### Step 1: Initial Setup
97
+
98
+ \`\`\`bash
99
+ # Setup commands
100
+ \`\`\`
101
+
102
+ Expected output:
103
+ \`\`\`
104
+ ✓ Setup complete
105
+ \`\`\`
106
+
107
+ ### Step 2: Main Operation
108
+
109
+ 1. Action 1
110
+ 2. Action 2
111
+ 3. Action 3
112
+
113
+ ### Step 3: Verification
114
+
115
+ \`\`\`bash
116
+ # Verify installation/setup
117
+ \`\`\`
118
+
119
+ ## Advanced Options
120
+
121
+ ### Option 1: Custom Configuration
122
+
123
+ \`\`\`bash
124
+ # Advanced usage
125
+ \`\`\`
126
+
127
+ ### Option 2: Integration
128
+
129
+ \`\`\`bash
130
+ # Integration steps
131
+ \`\`\`
132
+
133
+ ## Troubleshooting
134
+
135
+ ### Issue: Common Problem
136
+
137
+ **Symptoms**: What you might see
138
+ **Cause**: Why it happens
139
+ **Solution**: How to fix it
140
+
141
+ \`\`\`bash
142
+ # Fix command
143
+ \`\`\`
144
+
145
+ ## Learn More
146
+
147
+ - [Related Documentation](#)
148
+ - [Examples](#)
149
+ - [API Reference](#)
150
+
151
+ ---
152
+
153
+ **Created**: $(date +%Y-%m-%d)
154
+ **Category**: $NAMESPACE
155
+ **Status**: Draft
156
+ EOF
157
+
158
+ echo -e "${GREEN}✓${NC} Created SKILL.md"
159
+
160
+ # Create README.md
161
+ cat > "$skill_path/README.md" << EOF
162
+ # $DISPLAY_NAME
163
+
164
+ $DESCRIPTION
165
+
166
+ ## Directory Structure
167
+
168
+ \`\`\`
169
+ $SKILL_NAME/
170
+ ├── SKILL.md # Main skill file (Claude reads this)
171
+ ├── README.md # This file (human-readable documentation)
172
+ EOF
173
+
174
+ if [[ "$INCLUDE_SCRIPTS" == "y" ]]; then
175
+ cat >> "$skill_path/README.md" << EOF
176
+ ├── scripts/ # Executable scripts
177
+ EOF
178
+ fi
179
+
180
+ if [[ "$INCLUDE_RESOURCES" == "y" ]]; then
181
+ cat >> "$skill_path/README.md" << EOF
182
+ ├── resources/ # Templates, examples, schemas
183
+ │ ├── templates/
184
+ │ ├── examples/
185
+ │ └── schemas/
186
+ EOF
187
+ fi
188
+
189
+ if [[ "$INCLUDE_DOCS" == "y" ]]; then
190
+ cat >> "$skill_path/README.md" << EOF
191
+ └── docs/ # Additional documentation
192
+ EOF
193
+ fi
194
+
195
+ cat >> "$skill_path/README.md" << EOF
196
+ \`\`\`
197
+
198
+ ## Usage
199
+
200
+ This skill is automatically discovered by Claude Code when placed in:
201
+ - Personal: \`~/.claude/skills/\`
202
+ - Project: \`<project>/.claude/skills/\`
203
+
204
+ ## Development
205
+
206
+ 1. Edit \`SKILL.md\` to add instructions
207
+ 2. Add scripts to \`scripts/\` directory (if needed)
208
+ 3. Add resources to \`resources/\` directory (if needed)
209
+ 4. Test with Claude Code
210
+
211
+ ## Testing
212
+
213
+ 1. Restart Claude Code (or refresh Claude.ai)
214
+ 2. Verify skill appears in skills list
215
+ 3. Test skill by asking Claude to use it
216
+
217
+ ---
218
+
219
+ **Created**: $(date +%Y-%m-%d)
220
+ EOF
221
+
222
+ echo -e "${GREEN}✓${NC} Created README.md"
223
+
224
+ # Create example script if scripts directory
225
+ if [[ "$INCLUDE_SCRIPTS" == "y" ]]; then
226
+ cat > "$skill_path/scripts/example.sh" << 'EOF'
227
+ #!/bin/bash
228
+ # Example script for skill
229
+
230
+ echo "Example script executed successfully!"
231
+ echo "Skill: $DISPLAY_NAME"
232
+ EOF
233
+ chmod +x "$skill_path/scripts/example.sh"
234
+ echo -e "${GREEN}✓${NC} Created example script"
235
+ fi
236
+
237
+ # Create example template if resources directory
238
+ if [[ "$INCLUDE_RESOURCES" == "y" ]]; then
239
+ cat > "$skill_path/resources/templates/example.template" << EOF
240
+ # Example Template
241
+ # Replace placeholders with actual values
242
+
243
+ Name: {{NAME}}
244
+ Description: {{DESCRIPTION}}
245
+ Created: {{DATE}}
246
+ EOF
247
+ echo -e "${GREEN}✓${NC} Created example template"
248
+
249
+ # Create example schema
250
+ cat > "$skill_path/resources/schemas/config.schema.json" << 'EOF'
251
+ {
252
+ "$schema": "http://json-schema.org/draft-07/schema#",
253
+ "type": "object",
254
+ "properties": {
255
+ "name": {
256
+ "type": "string",
257
+ "description": "Configuration name"
258
+ },
259
+ "enabled": {
260
+ "type": "boolean",
261
+ "default": true
262
+ }
263
+ },
264
+ "required": ["name"]
265
+ }
266
+ EOF
267
+ echo -e "${GREEN}✓${NC} Created example schema"
268
+ fi
269
+
270
+ # Create docs if docs directory
271
+ if [[ "$INCLUDE_DOCS" == "y" ]]; then
272
+ cat > "$skill_path/docs/ADVANCED.md" << EOF
273
+ # Advanced Usage - $DISPLAY_NAME
274
+
275
+ ## Complex Scenarios
276
+
277
+ ### Scenario 1
278
+
279
+ [Description and instructions]
280
+
281
+ ### Scenario 2
282
+
283
+ [Description and instructions]
284
+
285
+ ## Best Practices
286
+
287
+ 1. Best practice 1
288
+ 2. Best practice 2
289
+ 3. Best practice 3
290
+
291
+ ## Performance Optimization
292
+
293
+ [Optimization tips]
294
+ EOF
295
+ echo -e "${GREEN}✓${NC} Created advanced documentation"
296
+ fi
297
+
298
+ echo ""
299
+ echo -e "${GREEN}✨ Skill created successfully!${NC}"
300
+ echo ""
301
+ echo -e "${BLUE}Location:${NC} $skill_path"
302
+ echo -e "${BLUE}Name:${NC} $DISPLAY_NAME"
303
+ echo -e "${BLUE}Namespace:${NC} $NAMESPACE"
304
+ echo ""
305
+ echo -e "${YELLOW}Next steps:${NC}"
306
+ echo -e " 1. Edit ${BLUE}$skill_path/SKILL.md${NC} with your instructions"
307
+ echo -e " 2. Add scripts to ${BLUE}$skill_path/scripts/${NC} (optional)"
308
+ echo -e " 3. Add resources to ${BLUE}$skill_path/resources/${NC} (optional)"
309
+ echo -e " 4. Restart Claude Code or refresh Claude.ai to test"
310
+ echo ""
311
+ }
312
+
313
+ # Create skill based on location
314
+ case "$LOCATION" in
315
+ personal)
316
+ create_skill "$PERSONAL_SKILLS"
317
+ ;;
318
+ project)
319
+ create_skill "$PROJECT_SKILLS"
320
+ ;;
321
+ both)
322
+ echo -e "${BLUE}Creating in both locations...${NC}"
323
+ create_skill "$PERSONAL_SKILLS"
324
+ create_skill "$PROJECT_SKILLS"
325
+ ;;
326
+ *)
327
+ echo -e "${YELLOW}Unknown location: $LOCATION${NC}"
328
+ echo "Usage: $0 <skill-name> [personal|project|both]"
329
+ exit 1
330
+ ;;
331
+ esac
332
+
333
+ echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
334
+ echo ""
@@ -0,0 +1,198 @@
1
+ #!/bin/bash
2
+ # Skill Builder - Validate Skill Script
3
+ # Usage: ./scripts/validate-skill.sh <path-to-skill-directory>
4
+
5
+ set -e
6
+
7
+ # Colors
8
+ GREEN='\033[0;32m'
9
+ RED='\033[0;31m'
10
+ YELLOW='\033[1;33m'
11
+ BLUE='\033[0;34m'
12
+ NC='\033[0m'
13
+
14
+ SKILL_DIR="${1:-.}"
15
+ ERRORS=0
16
+ WARNINGS=0
17
+
18
+ echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
19
+ echo -e "${BLUE}🔍 Skill Builder - Validate Skill${NC}"
20
+ echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
21
+ echo ""
22
+ echo -e "Validating: ${BLUE}$SKILL_DIR${NC}"
23
+ echo ""
24
+
25
+ # Check if SKILL.md exists
26
+ echo -e "${BLUE}[1/10]${NC} Checking SKILL.md exists..."
27
+ if [[ ! -f "$SKILL_DIR/SKILL.md" ]]; then
28
+ echo -e "${RED}✗ SKILL.md not found${NC}"
29
+ ((ERRORS++))
30
+ else
31
+ echo -e "${GREEN}✓ SKILL.md found${NC}"
32
+ fi
33
+
34
+ # Check YAML frontmatter exists
35
+ echo -e "${BLUE}[2/10]${NC} Checking YAML frontmatter..."
36
+ if ! grep -q "^---$" "$SKILL_DIR/SKILL.md" 2>/dev/null; then
37
+ echo -e "${RED}✗ YAML frontmatter not found (missing --- delimiters)${NC}"
38
+ ((ERRORS++))
39
+ else
40
+ # Extract frontmatter
41
+ FRONTMATTER=$(sed -n '/^---$/,/^---$/p' "$SKILL_DIR/SKILL.md" | head -n -1 | tail -n +2)
42
+ echo -e "${GREEN}✓ YAML frontmatter found${NC}"
43
+ fi
44
+
45
+ # Check name field
46
+ echo -e "${BLUE}[3/10]${NC} Checking 'name' field..."
47
+ if ! echo "$FRONTMATTER" | grep -q "^name:"; then
48
+ echo -e "${RED}✗ 'name' field missing in YAML frontmatter${NC}"
49
+ ((ERRORS++))
50
+ else
51
+ NAME=$(echo "$FRONTMATTER" | grep "^name:" | sed 's/name: *//; s/"//g; s/'"'"'//g')
52
+ NAME_LENGTH=${#NAME}
53
+
54
+ if [[ $NAME_LENGTH -gt 64 ]]; then
55
+ echo -e "${RED}✗ name too long: $NAME_LENGTH chars (max 64)${NC}"
56
+ ((ERRORS++))
57
+ elif [[ $NAME_LENGTH -eq 0 ]]; then
58
+ echo -e "${RED}✗ name is empty${NC}"
59
+ ((ERRORS++))
60
+ else
61
+ echo -e "${GREEN}✓ name valid: $NAME_LENGTH chars${NC}"
62
+ fi
63
+ fi
64
+
65
+ # Check description field
66
+ echo -e "${BLUE}[4/10]${NC} Checking 'description' field..."
67
+ if ! echo "$FRONTMATTER" | grep -q "^description:"; then
68
+ echo -e "${RED}✗ 'description' field missing in YAML frontmatter${NC}"
69
+ ((ERRORS++))
70
+ else
71
+ DESCRIPTION=$(echo "$FRONTMATTER" | grep "^description:" | sed 's/description: *//; s/"//g; s/'"'"'//g')
72
+ DESC_LENGTH=${#DESCRIPTION}
73
+
74
+ if [[ $DESC_LENGTH -gt 1024 ]]; then
75
+ echo -e "${RED}✗ description too long: $DESC_LENGTH chars (max 1024)${NC}"
76
+ ((ERRORS++))
77
+ elif [[ $DESC_LENGTH -eq 0 ]]; then
78
+ echo -e "${RED}✗ description is empty${NC}"
79
+ ((ERRORS++))
80
+ elif [[ $DESC_LENGTH -lt 50 ]]; then
81
+ echo -e "${YELLOW}⚠ description short: $DESC_LENGTH chars (recommended 50+ for better matching)${NC}"
82
+ ((WARNINGS++))
83
+ else
84
+ echo -e "${GREEN}✓ description valid: $DESC_LENGTH chars${NC}"
85
+ fi
86
+
87
+ # Check if description includes "when" clause
88
+ if ! echo "$DESCRIPTION" | grep -qi "use when\|when to use\|use it when\|when you need"; then
89
+ echo -e "${YELLOW}⚠ description should include 'when to use' clause for better matching${NC}"
90
+ ((WARNINGS++))
91
+ fi
92
+ fi
93
+
94
+ # Check YAML syntax
95
+ echo -e "${BLUE}[5/10]${NC} Checking YAML syntax..."
96
+ if command -v python3 &> /dev/null; then
97
+ YAML_CHECK=$(echo "$FRONTMATTER" | python3 -c "import sys, yaml; yaml.safe_load(sys.stdin)" 2>&1)
98
+ if [[ $? -ne 0 ]]; then
99
+ echo -e "${RED}✗ YAML syntax error:${NC}"
100
+ echo "$YAML_CHECK"
101
+ ((ERRORS++))
102
+ else
103
+ echo -e "${GREEN}✓ YAML syntax valid${NC}"
104
+ fi
105
+ else
106
+ echo -e "${YELLOW}⚠ python3 not available, skipping YAML syntax check${NC}"
107
+ ((WARNINGS++))
108
+ fi
109
+
110
+ # Check content structure
111
+ echo -e "${BLUE}[6/10]${NC} Checking content structure..."
112
+ REQUIRED_SECTIONS=("What This Skill Does" "Quick Start" "Step-by-Step")
113
+ for section in "${REQUIRED_SECTIONS[@]}"; do
114
+ if ! grep -qi "$section" "$SKILL_DIR/SKILL.md"; then
115
+ echo -e "${YELLOW}⚠ Recommended section missing: $section${NC}"
116
+ ((WARNINGS++))
117
+ fi
118
+ done
119
+
120
+ if grep -qi "What This Skill Does\|Quick Start\|Step-by-Step"; then
121
+ echo -e "${GREEN}✓ Content structure looks good${NC}"
122
+ fi
123
+
124
+ # Check file size
125
+ echo -e "${BLUE}[7/10]${NC} Checking file size..."
126
+ FILE_SIZE=$(wc -c < "$SKILL_DIR/SKILL.md")
127
+ FILE_SIZE_KB=$((FILE_SIZE / 1024))
128
+
129
+ if [[ $FILE_SIZE_KB -gt 50 ]]; then
130
+ echo -e "${YELLOW}⚠ SKILL.md is large: ${FILE_SIZE_KB}KB (consider moving content to separate files)${NC}"
131
+ ((WARNINGS++))
132
+ elif [[ $FILE_SIZE_KB -gt 100 ]]; then
133
+ echo -e "${RED}✗ SKILL.md too large: ${FILE_SIZE_KB}KB (should be < 50KB for optimal performance)${NC}"
134
+ ((ERRORS++))
135
+ else
136
+ echo -e "${GREEN}✓ File size appropriate: ${FILE_SIZE_KB}KB${NC}"
137
+ fi
138
+
139
+ # Check for executable scripts
140
+ echo -e "${BLUE}[8/10]${NC} Checking scripts..."
141
+ if [[ -d "$SKILL_DIR/scripts" ]]; then
142
+ SCRIPT_COUNT=$(find "$SKILL_DIR/scripts" -type f | wc -l)
143
+ echo -e "${GREEN}✓ Found $SCRIPT_COUNT script(s)${NC}"
144
+
145
+ # Check if scripts are executable
146
+ NON_EXECUTABLE=$(find "$SKILL_DIR/scripts" -type f ! -executable | wc -l)
147
+ if [[ $NON_EXECUTABLE -gt 0 ]]; then
148
+ echo -e "${YELLOW}⚠ $NON_EXECUTABLE script(s) not executable (run: chmod +x scripts/*.sh)${NC}"
149
+ ((WARNINGS++))
150
+ fi
151
+ else
152
+ echo -e "${BLUE}ℹ No scripts directory${NC}"
153
+ fi
154
+
155
+ # Check for resources
156
+ echo -e "${BLUE}[9/10]${NC} Checking resources..."
157
+ if [[ -d "$SKILL_DIR/resources" ]]; then
158
+ RESOURCE_COUNT=$(find "$SKILL_DIR/resources" -type f | wc -l)
159
+ echo -e "${GREEN}✓ Found $RESOURCE_COUNT resource file(s)${NC}"
160
+ else
161
+ echo -e "${BLUE}ℹ No resources directory${NC}"
162
+ fi
163
+
164
+ # Check for documentation
165
+ echo -e "${BLUE}[10/10]${NC} Checking documentation..."
166
+ if [[ -f "$SKILL_DIR/README.md" ]]; then
167
+ echo -e "${GREEN}✓ README.md found${NC}"
168
+ else
169
+ echo -e "${YELLOW}⚠ README.md not found (recommended for human-readable docs)${NC}"
170
+ ((WARNINGS++))
171
+ fi
172
+
173
+ # Summary
174
+ echo ""
175
+ echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
176
+ echo -e "${BLUE}Validation Summary${NC}"
177
+ echo -e "${BLUE}═══════════════════════════════════════════════════════════════${NC}"
178
+ echo ""
179
+
180
+ if [[ $ERRORS -eq 0 && $WARNINGS -eq 0 ]]; then
181
+ echo -e "${GREEN}✅ Skill validation passed!${NC}"
182
+ echo -e "${GREEN}No errors or warnings found.${NC}"
183
+ exit 0
184
+ elif [[ $ERRORS -eq 0 ]]; then
185
+ echo -e "${YELLOW}⚠ Skill validation passed with warnings${NC}"
186
+ echo -e "${YELLOW}Errors: 0${NC}"
187
+ echo -e "${YELLOW}Warnings: $WARNINGS${NC}"
188
+ echo ""
189
+ echo "The skill will work, but consider addressing the warnings above."
190
+ exit 0
191
+ else
192
+ echo -e "${RED}❌ Skill validation failed${NC}"
193
+ echo -e "${RED}Errors: $ERRORS${NC}"
194
+ echo -e "${YELLOW}Warnings: $WARNINGS${NC}"
195
+ echo ""
196
+ echo "Please fix the errors above before using this skill."
197
+ exit 1
198
+ fi
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: "Swarm Orchestration"
3
+ description: "Orchestrate multi-agent swarms with agentic-flow for parallel task execution, dynamic topology, and intelligent coordination. Use when scaling beyond single agents, implementing complex workflows, or building distributed AI systems."
4
+ ---
5
+
6
+ # Swarm Orchestration
7
+
8
+ ## What This Skill Does
9
+
10
+ Orchestrates multi-agent swarms using agentic-flow's advanced coordination system. Supports mesh, hierarchical, and adaptive topologies with automatic task distribution, load balancing, and fault tolerance.
11
+
12
+ ## Prerequisites
13
+
14
+ - agentic-flow v1.5.11+
15
+ - Node.js 18+
16
+ - Understanding of distributed systems (helpful)
17
+
18
+ ## Quick Start
19
+
20
+ ```bash
21
+ # Initialize swarm
22
+ npx agentic-flow hooks swarm-init --topology mesh --max-agents 5
23
+
24
+ # Spawn agents
25
+ npx agentic-flow hooks agent-spawn --type coder
26
+ npx agentic-flow hooks agent-spawn --type tester
27
+ npx agentic-flow hooks agent-spawn --type reviewer
28
+
29
+ # Orchestrate task
30
+ npx agentic-flow hooks task-orchestrate \
31
+ --task "Build REST API with tests" \
32
+ --mode parallel
33
+ ```
34
+
35
+ ## Topology Patterns
36
+
37
+ ### 1. Mesh (Peer-to-Peer)
38
+ ```typescript
39
+ // Equal peers, distributed decision-making
40
+ await swarm.init({
41
+ topology: 'mesh',
42
+ agents: ['coder', 'tester', 'reviewer'],
43
+ communication: 'broadcast'
44
+ });
45
+ ```
46
+
47
+ ### 2. Hierarchical (Queen-Worker)
48
+ ```typescript
49
+ // Centralized coordination, specialized workers
50
+ await swarm.init({
51
+ topology: 'hierarchical',
52
+ queen: 'architect',
53
+ workers: ['backend-dev', 'frontend-dev', 'db-designer']
54
+ });
55
+ ```
56
+
57
+ ### 3. Adaptive (Dynamic)
58
+ ```typescript
59
+ // Automatically switches topology based on task
60
+ await swarm.init({
61
+ topology: 'adaptive',
62
+ optimization: 'task-complexity'
63
+ });
64
+ ```
65
+
66
+ ## Task Orchestration
67
+
68
+ ### Parallel Execution
69
+ ```typescript
70
+ // Execute tasks concurrently
71
+ const results = await swarm.execute({
72
+ tasks: [
73
+ { agent: 'coder', task: 'Implement API endpoints' },
74
+ { agent: 'frontend', task: 'Build UI components' },
75
+ { agent: 'tester', task: 'Write test suite' }
76
+ ],
77
+ mode: 'parallel',
78
+ timeout: 300000 // 5 minutes
79
+ });
80
+ ```
81
+
82
+ ### Pipeline Execution
83
+ ```typescript
84
+ // Sequential pipeline with dependencies
85
+ await swarm.pipeline([
86
+ { stage: 'design', agent: 'architect' },
87
+ { stage: 'implement', agent: 'coder', after: 'design' },
88
+ { stage: 'test', agent: 'tester', after: 'implement' },
89
+ { stage: 'review', agent: 'reviewer', after: 'test' }
90
+ ]);
91
+ ```
92
+
93
+ ### Adaptive Execution
94
+ ```typescript
95
+ // Let swarm decide execution strategy
96
+ await swarm.autoOrchestrate({
97
+ goal: 'Build production-ready API',
98
+ constraints: {
99
+ maxTime: 3600,
100
+ maxAgents: 8,
101
+ quality: 'high'
102
+ }
103
+ });
104
+ ```
105
+
106
+ ## Memory Coordination
107
+
108
+ ```typescript
109
+ // Share state across swarm
110
+ await swarm.memory.store('api-schema', {
111
+ endpoints: [...],
112
+ models: [...]
113
+ });
114
+
115
+ // Agents read shared memory
116
+ const schema = await swarm.memory.retrieve('api-schema');
117
+ ```
118
+
119
+ ## Advanced Features
120
+
121
+ ### Load Balancing
122
+ ```typescript
123
+ // Automatic work distribution
124
+ await swarm.enableLoadBalancing({
125
+ strategy: 'dynamic',
126
+ metrics: ['cpu', 'memory', 'task-queue']
127
+ });
128
+ ```
129
+
130
+ ### Fault Tolerance
131
+ ```typescript
132
+ // Handle agent failures
133
+ await swarm.setResiliency({
134
+ retry: { maxAttempts: 3, backoff: 'exponential' },
135
+ fallback: 'reassign-task'
136
+ });
137
+ ```
138
+
139
+ ### Performance Monitoring
140
+ ```typescript
141
+ // Track swarm metrics
142
+ const metrics = await swarm.getMetrics();
143
+ // { throughput, latency, success_rate, agent_utilization }
144
+ ```
145
+
146
+ ## Integration with Hooks
147
+
148
+ ```bash
149
+ # Pre-task coordination
150
+ npx agentic-flow hooks pre-task --description "Build API"
151
+
152
+ # Post-task synchronization
153
+ npx agentic-flow hooks post-task --task-id "task-123"
154
+
155
+ # Session restore
156
+ npx agentic-flow hooks session-restore --session-id "swarm-001"
157
+ ```
158
+
159
+ ## Best Practices
160
+
161
+ 1. **Start small**: Begin with 2-3 agents, scale up
162
+ 2. **Use memory**: Share context through swarm memory
163
+ 3. **Monitor metrics**: Track performance and bottlenecks
164
+ 4. **Enable hooks**: Automatic coordination and sync
165
+ 5. **Set timeouts**: Prevent hung tasks
166
+
167
+ ## Troubleshooting
168
+
169
+ ### Issue: Agents not coordinating
170
+ **Solution**: Verify memory access and enable hooks
171
+
172
+ ### Issue: Poor performance
173
+ **Solution**: Check topology (use adaptive) and enable load balancing
174
+
175
+ ## Learn More
176
+
177
+ - Swarm Guide: docs/swarm/orchestration.md
178
+ - Topology Patterns: docs/swarm/topologies.md
179
+ - Hooks Integration: docs/hooks/coordination.md