cp-toolkit 2.0.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 +130 -0
- package/bin/cp-kit.js +72 -0
- package/package.json +46 -0
- package/src/commands/add.js +212 -0
- package/src/commands/doctor.js +149 -0
- package/src/commands/init.js +662 -0
- package/src/commands/list.js +128 -0
- package/src/index.js +13 -0
- package/templates/agents/backend-specialist.md +263 -0
- package/templates/agents/code-archaeologist.md +106 -0
- package/templates/agents/database-architect.md +226 -0
- package/templates/agents/debugger.md +225 -0
- package/templates/agents/devops-engineer.md +242 -0
- package/templates/agents/documentation-writer.md +104 -0
- package/templates/agents/explorer-agent.md +73 -0
- package/templates/agents/frontend-specialist.md +556 -0
- package/templates/agents/game-developer.md +162 -0
- package/templates/agents/mobile-developer.md +377 -0
- package/templates/agents/orchestrator.md +416 -0
- package/templates/agents/penetration-tester.md +188 -0
- package/templates/agents/performance-optimizer.md +187 -0
- package/templates/agents/product-manager.md +112 -0
- package/templates/agents/product-owner.md +95 -0
- package/templates/agents/project-planner.md +406 -0
- package/templates/agents/qa-automation-engineer.md +103 -0
- package/templates/agents/security-auditor.md +170 -0
- package/templates/agents/seo-specialist.md +111 -0
- package/templates/agents/test-engineer.md +158 -0
- package/templates/github/agents/backend-specialist.md +67 -0
- package/templates/github/agents/code-archaeologist.md +61 -0
- package/templates/github/agents/database-architect.md +73 -0
- package/templates/github/agents/debugger.md +71 -0
- package/templates/github/agents/devops-engineer.md +85 -0
- package/templates/github/agents/documentation-writer.md +107 -0
- package/templates/github/agents/explorer-agent.md +87 -0
- package/templates/github/agents/frontend-specialist.md +54 -0
- package/templates/github/agents/game-developer.md +94 -0
- package/templates/github/agents/mobile-developer.md +75 -0
- package/templates/github/agents/orchestrator.md +48 -0
- package/templates/github/agents/penetration-tester.md +87 -0
- package/templates/github/agents/performance-optimizer.md +70 -0
- package/templates/github/agents/product-manager.md +85 -0
- package/templates/github/agents/product-owner.md +77 -0
- package/templates/github/agents/project-planner.md +83 -0
- package/templates/github/agents/qa-automation-engineer.md +95 -0
- package/templates/github/agents/security-auditor.md +72 -0
- package/templates/github/agents/seo-specialist.md +78 -0
- package/templates/github/agents/test-engineer.md +79 -0
- package/templates/github/instructions/database.instructions.md +74 -0
- package/templates/github/instructions/python.instructions.md +76 -0
- package/templates/github/instructions/security.instructions.md +73 -0
- package/templates/github/instructions/typescript.instructions.md +50 -0
- package/templates/rules/GEMINI.md +273 -0
- package/templates/scripts/mcp-server.js +704 -0
- package/templates/skills/core/behavioral-modes/SKILL.md +242 -0
- package/templates/skills/core/brainstorming/SKILL.md +163 -0
- package/templates/skills/core/brainstorming/dynamic-questioning.md +350 -0
- package/templates/skills/core/clean-code/SKILL.md +201 -0
- package/templates/skills/core/intelligent-routing/SKILL.md +335 -0
- package/templates/skills/core/mcp-builder/SKILL.md +176 -0
- package/templates/skills/core/parallel-agents/SKILL.md +175 -0
- package/templates/skills/core/plan-writing/SKILL.md +152 -0
- package/templates/skills/optional/api-patterns/SKILL.md +81 -0
- package/templates/skills/optional/api-patterns/api-style.md +42 -0
- package/templates/skills/optional/api-patterns/auth.md +24 -0
- package/templates/skills/optional/api-patterns/documentation.md +26 -0
- package/templates/skills/optional/api-patterns/graphql.md +41 -0
- package/templates/skills/optional/api-patterns/rate-limiting.md +31 -0
- package/templates/skills/optional/api-patterns/response.md +37 -0
- package/templates/skills/optional/api-patterns/rest.md +40 -0
- package/templates/skills/optional/api-patterns/scripts/api_validator.py +211 -0
- package/templates/skills/optional/api-patterns/security-testing.md +122 -0
- package/templates/skills/optional/api-patterns/trpc.md +41 -0
- package/templates/skills/optional/api-patterns/versioning.md +22 -0
- package/templates/skills/optional/app-builder/SKILL.md +75 -0
- package/templates/skills/optional/app-builder/agent-coordination.md +71 -0
- package/templates/skills/optional/app-builder/feature-building.md +53 -0
- package/templates/skills/optional/app-builder/project-detection.md +34 -0
- package/templates/skills/optional/app-builder/scaffolding.md +118 -0
- package/templates/skills/optional/app-builder/tech-stack.md +40 -0
- package/templates/skills/optional/app-builder/templates/SKILL.md +39 -0
- package/templates/skills/optional/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/templates/skills/optional/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/templates/skills/optional/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/templates/skills/optional/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/templates/skills/optional/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/templates/skills/optional/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/templates/skills/optional/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/templates/skills/optional/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/templates/skills/optional/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/templates/skills/optional/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/templates/skills/optional/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/templates/skills/optional/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/templates/skills/optional/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/templates/skills/optional/architecture/SKILL.md +55 -0
- package/templates/skills/optional/architecture/context-discovery.md +43 -0
- package/templates/skills/optional/architecture/examples.md +94 -0
- package/templates/skills/optional/architecture/pattern-selection.md +68 -0
- package/templates/skills/optional/architecture/patterns-reference.md +50 -0
- package/templates/skills/optional/architecture/trade-off-analysis.md +77 -0
- package/templates/skills/optional/bash-linux/SKILL.md +199 -0
- package/templates/skills/optional/code-review-checklist/SKILL.md +109 -0
- package/templates/skills/optional/database-design/SKILL.md +52 -0
- package/templates/skills/optional/database-design/database-selection.md +43 -0
- package/templates/skills/optional/database-design/indexing.md +39 -0
- package/templates/skills/optional/database-design/migrations.md +48 -0
- package/templates/skills/optional/database-design/optimization.md +36 -0
- package/templates/skills/optional/database-design/orm-selection.md +30 -0
- package/templates/skills/optional/database-design/schema-design.md +56 -0
- package/templates/skills/optional/database-design/scripts/schema_validator.py +172 -0
- package/templates/skills/optional/deployment-procedures/SKILL.md +241 -0
- package/templates/skills/optional/documentation-templates/SKILL.md +194 -0
- package/templates/skills/optional/frontend-design/SKILL.md +418 -0
- package/templates/skills/optional/frontend-design/animation-guide.md +331 -0
- package/templates/skills/optional/frontend-design/color-system.md +311 -0
- package/templates/skills/optional/frontend-design/decision-trees.md +418 -0
- package/templates/skills/optional/frontend-design/motion-graphics.md +306 -0
- package/templates/skills/optional/frontend-design/scripts/accessibility_checker.py +183 -0
- package/templates/skills/optional/frontend-design/scripts/ux_audit.py +722 -0
- package/templates/skills/optional/frontend-design/typography-system.md +345 -0
- package/templates/skills/optional/frontend-design/ux-psychology.md +541 -0
- package/templates/skills/optional/frontend-design/visual-effects.md +383 -0
- package/templates/skills/optional/game-development/2d-games/SKILL.md +119 -0
- package/templates/skills/optional/game-development/3d-games/SKILL.md +135 -0
- package/templates/skills/optional/game-development/SKILL.md +167 -0
- package/templates/skills/optional/game-development/game-art/SKILL.md +185 -0
- package/templates/skills/optional/game-development/game-audio/SKILL.md +190 -0
- package/templates/skills/optional/game-development/game-design/SKILL.md +129 -0
- package/templates/skills/optional/game-development/mobile-games/SKILL.md +108 -0
- package/templates/skills/optional/game-development/multiplayer/SKILL.md +132 -0
- package/templates/skills/optional/game-development/pc-games/SKILL.md +144 -0
- package/templates/skills/optional/game-development/vr-ar/SKILL.md +123 -0
- package/templates/skills/optional/game-development/web-games/SKILL.md +150 -0
- package/templates/skills/optional/geo-fundamentals/SKILL.md +156 -0
- package/templates/skills/optional/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/templates/skills/optional/i18n-localization/SKILL.md +154 -0
- package/templates/skills/optional/i18n-localization/scripts/i18n_checker.py +241 -0
- package/templates/skills/optional/lint-and-validate/SKILL.md +45 -0
- package/templates/skills/optional/lint-and-validate/scripts/lint_runner.py +172 -0
- package/templates/skills/optional/lint-and-validate/scripts/type_coverage.py +173 -0
- package/templates/skills/optional/mobile-design/SKILL.md +394 -0
- package/templates/skills/optional/mobile-design/decision-trees.md +516 -0
- package/templates/skills/optional/mobile-design/mobile-backend.md +491 -0
- package/templates/skills/optional/mobile-design/mobile-color-system.md +420 -0
- package/templates/skills/optional/mobile-design/mobile-debugging.md +122 -0
- package/templates/skills/optional/mobile-design/mobile-design-thinking.md +357 -0
- package/templates/skills/optional/mobile-design/mobile-navigation.md +458 -0
- package/templates/skills/optional/mobile-design/mobile-performance.md +767 -0
- package/templates/skills/optional/mobile-design/mobile-testing.md +356 -0
- package/templates/skills/optional/mobile-design/mobile-typography.md +433 -0
- package/templates/skills/optional/mobile-design/platform-android.md +666 -0
- package/templates/skills/optional/mobile-design/platform-ios.md +561 -0
- package/templates/skills/optional/mobile-design/scripts/mobile_audit.py +670 -0
- package/templates/skills/optional/mobile-design/touch-psychology.md +537 -0
- package/templates/skills/optional/nextjs-react-expert/1-async-eliminating-waterfalls.md +312 -0
- package/templates/skills/optional/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/templates/skills/optional/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/templates/skills/optional/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/templates/skills/optional/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/templates/skills/optional/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/templates/skills/optional/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/templates/skills/optional/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/templates/skills/optional/nextjs-react-expert/SKILL.md +267 -0
- package/templates/skills/optional/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/templates/skills/optional/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/templates/skills/optional/nodejs-best-practices/SKILL.md +333 -0
- package/templates/skills/optional/performance-profiling/SKILL.md +143 -0
- package/templates/skills/optional/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/templates/skills/optional/powershell-windows/SKILL.md +167 -0
- package/templates/skills/optional/python-patterns/SKILL.md +441 -0
- package/templates/skills/optional/red-team-tactics/SKILL.md +199 -0
- package/templates/skills/optional/seo-fundamentals/SKILL.md +129 -0
- package/templates/skills/optional/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/templates/skills/optional/server-management/SKILL.md +161 -0
- package/templates/skills/optional/systematic-debugging/SKILL.md +109 -0
- package/templates/skills/optional/tailwind-patterns/SKILL.md +269 -0
- package/templates/skills/optional/tdd-workflow/SKILL.md +149 -0
- package/templates/skills/optional/testing-patterns/SKILL.md +178 -0
- package/templates/skills/optional/testing-patterns/scripts/test_runner.py +219 -0
- package/templates/skills/optional/vulnerability-scanner/SKILL.md +276 -0
- package/templates/skills/optional/vulnerability-scanner/checklists.md +121 -0
- package/templates/skills/optional/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/templates/skills/optional/web-design-guidelines/SKILL.md +57 -0
- package/templates/skills/optional/webapp-testing/SKILL.md +187 -0
- package/templates/skills/optional/webapp-testing/scripts/playwright_runner.py +173 -0
- package/templates/workflows/brainstorm.md +113 -0
- package/templates/workflows/create.md +59 -0
- package/templates/workflows/debug.md +103 -0
- package/templates/workflows/deploy.md +176 -0
- package/templates/workflows/enhance.md +63 -0
- package/templates/workflows/orchestrate.md +237 -0
- package/templates/workflows/plan.md +89 -0
- package/templates/workflows/preview.md +81 -0
- package/templates/workflows/status.md +86 -0
- package/templates/workflows/test.md +144 -0
- package/templates/workflows/ui-ux-pro-max.md +296 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intelligent-routing
|
|
3
|
+
description: Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Intelligent Agent Routing
|
|
8
|
+
|
|
9
|
+
**Purpose**: Automatically analyze user requests and route them to the most appropriate specialist agent(s) without requiring explicit user mentions.
|
|
10
|
+
|
|
11
|
+
## Core Principle
|
|
12
|
+
|
|
13
|
+
> **The AI should act as an intelligent Project Manager**, analyzing each request and automatically selecting the best specialist(s) for the job.
|
|
14
|
+
|
|
15
|
+
## How It Works
|
|
16
|
+
|
|
17
|
+
### 1. Request Analysis
|
|
18
|
+
|
|
19
|
+
Before responding to ANY user request, perform automatic analysis:
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
graph TD
|
|
23
|
+
A[User Request: Add login] --> B[ANALYZE]
|
|
24
|
+
B --> C[Keywords]
|
|
25
|
+
B --> D[Domains]
|
|
26
|
+
B --> E[Complexity]
|
|
27
|
+
C --> F[SELECT AGENT]
|
|
28
|
+
D --> F
|
|
29
|
+
E --> F
|
|
30
|
+
F --> G[security-auditor + backend-specialist]
|
|
31
|
+
G --> H[AUTO-INVOKE with context]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 2. Agent Selection Matrix
|
|
35
|
+
|
|
36
|
+
**Use this matrix to automatically select agents:**
|
|
37
|
+
|
|
38
|
+
| User Intent | Keywords | Selected Agent(s) | Auto-invoke? |
|
|
39
|
+
| ------------------- | ------------------------------------------ | ------------------------------------------- | ------------ |
|
|
40
|
+
| **Authentication** | "login", "auth", "signup", "password" | `security-auditor` + `backend-specialist` | ✅ YES |
|
|
41
|
+
| **UI Component** | "button", "card", "layout", "style" | `frontend-specialist` | ✅ YES |
|
|
42
|
+
| **Mobile UI** | "screen", "navigation", "touch", "gesture" | `mobile-developer` | ✅ YES |
|
|
43
|
+
| **API Endpoint** | "endpoint", "route", "API", "POST", "GET" | `backend-specialist` | ✅ YES |
|
|
44
|
+
| **Database** | "schema", "migration", "query", "table" | `database-architect` + `backend-specialist` | ✅ YES |
|
|
45
|
+
| **Bug Fix** | "error", "bug", "not working", "broken" | `debugger` | ✅ YES |
|
|
46
|
+
| **Test** | "test", "coverage", "unit", "e2e" | `test-engineer` | ✅ YES |
|
|
47
|
+
| **Deployment** | "deploy", "production", "CI/CD", "docker" | `devops-engineer` | ✅ YES |
|
|
48
|
+
| **Security Review** | "security", "vulnerability", "exploit" | `security-auditor` + `penetration-tester` | ✅ YES |
|
|
49
|
+
| **Performance** | "slow", "optimize", "performance", "speed" | `performance-optimizer` | ✅ YES |
|
|
50
|
+
| **Product Def** | "requirements", "user story", "backlog", "MVP" | `product-owner` | ✅ YES |
|
|
51
|
+
| **New Feature** | "build", "create", "implement", "new app" | `orchestrator` → multi-agent | ⚠️ ASK FIRST |
|
|
52
|
+
| **Complex Task** | Multiple domains detected | `orchestrator` → multi-agent | ⚠️ ASK FIRST |
|
|
53
|
+
|
|
54
|
+
### 3. Automatic Routing Protocol
|
|
55
|
+
|
|
56
|
+
## TIER 0 - Automatic Analysis (ALWAYS ACTIVE)
|
|
57
|
+
|
|
58
|
+
Before responding to ANY request:
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
// Pseudo-code for decision tree
|
|
62
|
+
function analyzeRequest(userMessage) {
|
|
63
|
+
// 1. Classify request type
|
|
64
|
+
const requestType = classifyRequest(userMessage);
|
|
65
|
+
|
|
66
|
+
// 2. Detect domains
|
|
67
|
+
const domains = detectDomains(userMessage);
|
|
68
|
+
|
|
69
|
+
// 3. Determine complexity
|
|
70
|
+
const complexity = assessComplexity(domains);
|
|
71
|
+
|
|
72
|
+
// 4. Select agent(s)
|
|
73
|
+
if (complexity === "SIMPLE" && domains.length === 1) {
|
|
74
|
+
return selectSingleAgent(domains[0]);
|
|
75
|
+
} else if (complexity === "MODERATE" && domains.length <= 2) {
|
|
76
|
+
return selectMultipleAgents(domains);
|
|
77
|
+
} else {
|
|
78
|
+
return "orchestrator"; // Complex task
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 4. Response Format
|
|
84
|
+
|
|
85
|
+
**When auto-selecting an agent, inform the user concisely:**
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
🤖 **Applying knowledge of `@security-auditor` + `@backend-specialist`...**
|
|
89
|
+
|
|
90
|
+
[Proceed with specialized response]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Benefits:**
|
|
94
|
+
|
|
95
|
+
- ✅ User sees which expertise is being applied
|
|
96
|
+
- ✅ Transparent decision-making
|
|
97
|
+
- ✅ Still automatic (no /commands needed)
|
|
98
|
+
|
|
99
|
+
## Domain Detection Rules
|
|
100
|
+
|
|
101
|
+
### Single-Domain Tasks (Auto-invoke Single Agent)
|
|
102
|
+
|
|
103
|
+
| Domain | Patterns | Agent |
|
|
104
|
+
| --------------- | ------------------------------------------ | ----------------------- |
|
|
105
|
+
| **Security** | auth, login, jwt, password, hash, token | `security-auditor` |
|
|
106
|
+
| **Frontend** | component, react, vue, css, html, tailwind | `frontend-specialist` |
|
|
107
|
+
| **Backend** | api, server, express, fastapi, node | `backend-specialist` |
|
|
108
|
+
| **Mobile** | react native, flutter, ios, android, expo | `mobile-developer` |
|
|
109
|
+
| **Database** | prisma, sql, mongodb, schema, migration | `database-architect` |
|
|
110
|
+
| **Testing** | test, jest, vitest, playwright, cypress | `test-engineer` |
|
|
111
|
+
| **DevOps** | docker, kubernetes, ci/cd, pm2, nginx | `devops-engineer` |
|
|
112
|
+
| **Debug** | error, bug, crash, not working, issue | `debugger` |
|
|
113
|
+
| **Performance** | slow, lag, optimize, cache, performance | `performance-optimizer` |
|
|
114
|
+
| **SEO** | seo, meta, analytics, sitemap, robots | `seo-specialist` |
|
|
115
|
+
| **Game** | unity, godot, phaser, game, multiplayer | `game-developer` |
|
|
116
|
+
|
|
117
|
+
### Multi-Domain Tasks (Auto-invoke Orchestrator)
|
|
118
|
+
|
|
119
|
+
If request matches **2+ domains from different categories**, automatically use `orchestrator`:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
Example: "Create a secure login system with dark mode UI"
|
|
123
|
+
→ Detected: Security + Frontend
|
|
124
|
+
→ Auto-invoke: orchestrator
|
|
125
|
+
→ Orchestrator will handle: security-auditor, frontend-specialist, test-engineer
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Complexity Assessment
|
|
129
|
+
|
|
130
|
+
### SIMPLE (Direct agent invocation)
|
|
131
|
+
|
|
132
|
+
- Single file edit
|
|
133
|
+
- Clear, specific task
|
|
134
|
+
- One domain only
|
|
135
|
+
- Example: "Fix the login button style"
|
|
136
|
+
|
|
137
|
+
**Action**: Auto-invoke respective agent
|
|
138
|
+
|
|
139
|
+
### MODERATE (2-3 agents)
|
|
140
|
+
|
|
141
|
+
- 2-3 files affected
|
|
142
|
+
- Clear requirements
|
|
143
|
+
- 2 domains max
|
|
144
|
+
- Example: "Add API endpoint for user profile"
|
|
145
|
+
|
|
146
|
+
**Action**: Auto-invoke relevant agents sequentially
|
|
147
|
+
|
|
148
|
+
### COMPLEX (Orchestrator required)
|
|
149
|
+
|
|
150
|
+
- Multiple files/domains
|
|
151
|
+
- Architectural decisions needed
|
|
152
|
+
- Unclear requirements
|
|
153
|
+
- Example: "Build a social media app"
|
|
154
|
+
|
|
155
|
+
**Action**: Auto-invoke `orchestrator` → will ask Socratic questions
|
|
156
|
+
|
|
157
|
+
## Implementation Rules
|
|
158
|
+
|
|
159
|
+
### Rule 1: Silent Analysis
|
|
160
|
+
|
|
161
|
+
#### DO NOT announce "I'm analyzing your request..."
|
|
162
|
+
|
|
163
|
+
- ✅ Analyze silently
|
|
164
|
+
- ✅ Inform which agent is being applied
|
|
165
|
+
- ❌ Avoid verbose meta-commentary
|
|
166
|
+
|
|
167
|
+
### Rule 2: Inform Agent Selection
|
|
168
|
+
|
|
169
|
+
**DO inform which expertise is being applied:**
|
|
170
|
+
|
|
171
|
+
```markdown
|
|
172
|
+
🤖 **Applying knowledge of `@frontend-specialist`...**
|
|
173
|
+
|
|
174
|
+
I will create the component with the following characteristics:
|
|
175
|
+
[Continue with specialized response]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Rule 3: Seamless Experience
|
|
179
|
+
|
|
180
|
+
**The user should not notice a difference from talking to the right specialist directly.**
|
|
181
|
+
|
|
182
|
+
### Rule 4: Override Capability
|
|
183
|
+
|
|
184
|
+
**User can still explicitly mention agents:**
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
User: "Use @backend-specialist to review this"
|
|
188
|
+
→ Override auto-selection
|
|
189
|
+
→ Use explicitly mentioned agent
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Edge Cases
|
|
193
|
+
|
|
194
|
+
### Case 1: Generic Question
|
|
195
|
+
|
|
196
|
+
```text
|
|
197
|
+
User: "How does React work?"
|
|
198
|
+
→ Type: QUESTION
|
|
199
|
+
→ No agent needed
|
|
200
|
+
→ Respond directly with explanation
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Case 2: Extremely Vague Request
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
User: "Make it better"
|
|
207
|
+
→ Complexity: UNCLEAR
|
|
208
|
+
→ Action: Ask clarifying questions first
|
|
209
|
+
→ Then route to appropriate agent
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Case 3: Contradictory Patterns
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
User: "Add mobile support to the web app"
|
|
216
|
+
→ Conflict: mobile vs web
|
|
217
|
+
→ Action: Ask: "Do you want responsive web or native mobile app?"
|
|
218
|
+
→ Then route accordingly
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Integration with Existing Workflows
|
|
222
|
+
|
|
223
|
+
### With /orchestrate Command
|
|
224
|
+
|
|
225
|
+
- **User types `/orchestrate`**: Explicit orchestration mode
|
|
226
|
+
- **AI detects complex task**: Auto-invoke orchestrator (same result)
|
|
227
|
+
|
|
228
|
+
**Difference**: User doesn't need to know the command exists.
|
|
229
|
+
|
|
230
|
+
### With Socratic Gate
|
|
231
|
+
|
|
232
|
+
- **Auto-routing does NOT bypass Socratic Gate**
|
|
233
|
+
- If task is unclear, still ask questions first
|
|
234
|
+
- Then route to appropriate agent
|
|
235
|
+
|
|
236
|
+
### With GEMINI.md Rules
|
|
237
|
+
|
|
238
|
+
- **Priority**: GEMINI.md rules > intelligent-routing
|
|
239
|
+
- If GEMINI.md specifies explicit routing, follow it
|
|
240
|
+
- Intelligent routing is the DEFAULT when no explicit rule exists
|
|
241
|
+
|
|
242
|
+
## Testing the System
|
|
243
|
+
|
|
244
|
+
### Test Cases
|
|
245
|
+
|
|
246
|
+
#### Test 1: Simple Frontend Task
|
|
247
|
+
|
|
248
|
+
```text
|
|
249
|
+
User: "Create a dark mode toggle button"
|
|
250
|
+
Expected: Auto-invoke frontend-specialist
|
|
251
|
+
Verify: Response shows "Using @frontend-specialist"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### Test 2: Security Task
|
|
255
|
+
|
|
256
|
+
```text
|
|
257
|
+
User: "Review the authentication flow for vulnerabilities"
|
|
258
|
+
Expected: Auto-invoke security-auditor
|
|
259
|
+
Verify: Security-focused analysis
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
#### Test 3: Complex Multi-Domain
|
|
263
|
+
|
|
264
|
+
```text
|
|
265
|
+
User: "Build a chat application with real-time notifications"
|
|
266
|
+
Expected: Auto-invoke orchestrator
|
|
267
|
+
Verify: Multiple agents coordinated (backend, frontend, test)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
#### Test 4: Bug Fix
|
|
271
|
+
|
|
272
|
+
```text
|
|
273
|
+
User: "Login is not working, getting 401 error"
|
|
274
|
+
Expected: Auto-invoke debugger
|
|
275
|
+
Verify: Systematic debugging approach
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Performance Considerations
|
|
279
|
+
|
|
280
|
+
### Token Usage
|
|
281
|
+
|
|
282
|
+
- Analysis adds ~50-100 tokens per request
|
|
283
|
+
- Tradeoff: Better accuracy vs slight overhead
|
|
284
|
+
- Overall SAVES tokens by reducing back-and-forth
|
|
285
|
+
|
|
286
|
+
### Response Time
|
|
287
|
+
|
|
288
|
+
- Analysis is instant (pattern matching)
|
|
289
|
+
- No additional API calls required
|
|
290
|
+
- Agent selection happens before first response
|
|
291
|
+
|
|
292
|
+
## User Education
|
|
293
|
+
|
|
294
|
+
### Optional: First-Time Explanation
|
|
295
|
+
|
|
296
|
+
If this is the first interaction in a project:
|
|
297
|
+
|
|
298
|
+
```markdown
|
|
299
|
+
💡 **Tip**: I am configured with automatic specialist agent selection.
|
|
300
|
+
I will always choose the most suitable specialist for your task. You can
|
|
301
|
+
still mention agents explicitly with `@agent-name` if you prefer.
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
## Debugging Agent Selection
|
|
305
|
+
|
|
306
|
+
### Enable Debug Mode (for development)
|
|
307
|
+
|
|
308
|
+
Add to GEMINI.md temporarily:
|
|
309
|
+
|
|
310
|
+
```markdown
|
|
311
|
+
## DEBUG: Intelligent Routing
|
|
312
|
+
|
|
313
|
+
Show selection reasoning:
|
|
314
|
+
|
|
315
|
+
- Detected domains: [list]
|
|
316
|
+
- Selected agent: [name]
|
|
317
|
+
- Reasoning: [why]
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Summary
|
|
321
|
+
|
|
322
|
+
**intelligent-routing skill enables:**
|
|
323
|
+
|
|
324
|
+
✅ Zero-command operation (no need for `/orchestrate`)
|
|
325
|
+
✅ Automatic specialist selection based on request analysis
|
|
326
|
+
✅ Transparent communication of which expertise is being applied
|
|
327
|
+
✅ Seamless integration with existing workflows
|
|
328
|
+
✅ Override capability for explicit agent mentions
|
|
329
|
+
✅ Fallback to orchestrator for complex tasks
|
|
330
|
+
|
|
331
|
+
**Result**: User gets specialist-level responses without needing to know the system architecture.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
**Next Steps**: Integrate this skill into GEMINI.md TIER 0 rules.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcp-builder
|
|
3
|
+
description: MCP (Model Context Protocol) server building principles. Tool design, resource patterns, best practices.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MCP Builder
|
|
8
|
+
|
|
9
|
+
> Principles for building MCP servers.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. MCP Overview
|
|
14
|
+
|
|
15
|
+
### What is MCP?
|
|
16
|
+
|
|
17
|
+
Model Context Protocol - standard for connecting AI systems with external tools and data sources.
|
|
18
|
+
|
|
19
|
+
### Core Concepts
|
|
20
|
+
|
|
21
|
+
| Concept | Purpose |
|
|
22
|
+
|---------|---------|
|
|
23
|
+
| **Tools** | Functions AI can call |
|
|
24
|
+
| **Resources** | Data AI can read |
|
|
25
|
+
| **Prompts** | Pre-defined prompt templates |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Server Architecture
|
|
30
|
+
|
|
31
|
+
### Project Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
my-mcp-server/
|
|
35
|
+
├── src/
|
|
36
|
+
│ └── index.ts # Main entry
|
|
37
|
+
├── package.json
|
|
38
|
+
└── tsconfig.json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Transport Types
|
|
42
|
+
|
|
43
|
+
| Type | Use |
|
|
44
|
+
|------|-----|
|
|
45
|
+
| **Stdio** | Local, CLI-based |
|
|
46
|
+
| **SSE** | Web-based, streaming |
|
|
47
|
+
| **WebSocket** | Real-time, bidirectional |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 3. Tool Design Principles
|
|
52
|
+
|
|
53
|
+
### Good Tool Design
|
|
54
|
+
|
|
55
|
+
| Principle | Description |
|
|
56
|
+
|-----------|-------------|
|
|
57
|
+
| Clear name | Action-oriented (get_weather, create_user) |
|
|
58
|
+
| Single purpose | One thing well |
|
|
59
|
+
| Validated input | Schema with types and descriptions |
|
|
60
|
+
| Structured output | Predictable response format |
|
|
61
|
+
|
|
62
|
+
### Input Schema Design
|
|
63
|
+
|
|
64
|
+
| Field | Required? |
|
|
65
|
+
|-------|-----------|
|
|
66
|
+
| Type | Yes - object |
|
|
67
|
+
| Properties | Define each param |
|
|
68
|
+
| Required | List mandatory params |
|
|
69
|
+
| Description | Human-readable |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 4. Resource Patterns
|
|
74
|
+
|
|
75
|
+
### Resource Types
|
|
76
|
+
|
|
77
|
+
| Type | Use |
|
|
78
|
+
|------|-----|
|
|
79
|
+
| Static | Fixed data (config, docs) |
|
|
80
|
+
| Dynamic | Generated on request |
|
|
81
|
+
| Template | URI with parameters |
|
|
82
|
+
|
|
83
|
+
### URI Patterns
|
|
84
|
+
|
|
85
|
+
| Pattern | Example |
|
|
86
|
+
|---------|---------|
|
|
87
|
+
| Fixed | `docs://readme` |
|
|
88
|
+
| Parameterized | `users://{userId}` |
|
|
89
|
+
| Collection | `files://project/*` |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 5. Error Handling
|
|
94
|
+
|
|
95
|
+
### Error Types
|
|
96
|
+
|
|
97
|
+
| Situation | Response |
|
|
98
|
+
|-----------|----------|
|
|
99
|
+
| Invalid params | Validation error message |
|
|
100
|
+
| Not found | Clear "not found" |
|
|
101
|
+
| Server error | Generic error, log details |
|
|
102
|
+
|
|
103
|
+
### Best Practices
|
|
104
|
+
|
|
105
|
+
- Return structured errors
|
|
106
|
+
- Don't expose internal details
|
|
107
|
+
- Log for debugging
|
|
108
|
+
- Provide actionable messages
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 6. Multimodal Handling
|
|
113
|
+
|
|
114
|
+
### Supported Types
|
|
115
|
+
|
|
116
|
+
| Type | Encoding |
|
|
117
|
+
|------|----------|
|
|
118
|
+
| Text | Plain text |
|
|
119
|
+
| Images | Base64 + MIME type |
|
|
120
|
+
| Files | Base64 + MIME type |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 7. Security Principles
|
|
125
|
+
|
|
126
|
+
### Input Validation
|
|
127
|
+
|
|
128
|
+
- Validate all tool inputs
|
|
129
|
+
- Sanitize user-provided data
|
|
130
|
+
- Limit resource access
|
|
131
|
+
|
|
132
|
+
### API Keys
|
|
133
|
+
|
|
134
|
+
- Use environment variables
|
|
135
|
+
- Don't log secrets
|
|
136
|
+
- Validate permissions
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 8. Configuration
|
|
141
|
+
|
|
142
|
+
### Claude Desktop Config
|
|
143
|
+
|
|
144
|
+
| Field | Purpose |
|
|
145
|
+
|-------|---------|
|
|
146
|
+
| command | Executable to run |
|
|
147
|
+
| args | Command arguments |
|
|
148
|
+
| env | Environment variables |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 9. Testing
|
|
153
|
+
|
|
154
|
+
### Test Categories
|
|
155
|
+
|
|
156
|
+
| Type | Focus |
|
|
157
|
+
|------|-------|
|
|
158
|
+
| Unit | Tool logic |
|
|
159
|
+
| Integration | Full server |
|
|
160
|
+
| Contract | Schema validation |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 10. Best Practices Checklist
|
|
165
|
+
|
|
166
|
+
- [ ] Clear, action-oriented tool names
|
|
167
|
+
- [ ] Complete input schemas with descriptions
|
|
168
|
+
- [ ] Structured JSON output
|
|
169
|
+
- [ ] Error handling for all cases
|
|
170
|
+
- [ ] Input validation
|
|
171
|
+
- [ ] Environment-based configuration
|
|
172
|
+
- [ ] Logging for debugging
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
> **Remember:** MCP tools should be simple, focused, and well-documented. The AI relies on descriptions to use them correctly.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel-agents
|
|
3
|
+
description: Multi-agent orchestration patterns. Use when multiple independent tasks can run with different domain expertise or when comprehensive analysis requires multiple perspectives.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Native Parallel Agents
|
|
8
|
+
|
|
9
|
+
> Orchestration through Antigravity's built-in Agent Tool
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
This skill enables coordinating multiple specialized agents through Antigravity's native agent system. Unlike external scripts, this approach keeps all orchestration within Antigravity's control.
|
|
14
|
+
|
|
15
|
+
## When to Use Orchestration
|
|
16
|
+
|
|
17
|
+
✅ **Good for:**
|
|
18
|
+
- Complex tasks requiring multiple expertise domains
|
|
19
|
+
- Code analysis from security, performance, and quality perspectives
|
|
20
|
+
- Comprehensive reviews (architecture + security + testing)
|
|
21
|
+
- Feature implementation needing backend + frontend + database work
|
|
22
|
+
|
|
23
|
+
❌ **Not for:**
|
|
24
|
+
- Simple, single-domain tasks
|
|
25
|
+
- Quick fixes or small changes
|
|
26
|
+
- Tasks where one agent suffices
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Native Agent Invocation
|
|
31
|
+
|
|
32
|
+
### Single Agent
|
|
33
|
+
```
|
|
34
|
+
Use the security-auditor agent to review authentication
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Sequential Chain
|
|
38
|
+
```
|
|
39
|
+
First, use the explorer-agent to discover project structure.
|
|
40
|
+
Then, use the backend-specialist to review API endpoints.
|
|
41
|
+
Finally, use the test-engineer to identify test gaps.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### With Context Passing
|
|
45
|
+
```
|
|
46
|
+
Use the frontend-specialist to analyze React components.
|
|
47
|
+
Based on those findings, have the test-engineer generate component tests.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Resume Previous Work
|
|
51
|
+
```
|
|
52
|
+
Resume agent [agentId] and continue with additional requirements.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Orchestration Patterns
|
|
58
|
+
|
|
59
|
+
### Pattern 1: Comprehensive Analysis
|
|
60
|
+
```
|
|
61
|
+
Agents: explorer-agent → [domain-agents] → synthesis
|
|
62
|
+
|
|
63
|
+
1. explorer-agent: Map codebase structure
|
|
64
|
+
2. security-auditor: Security posture
|
|
65
|
+
3. backend-specialist: API quality
|
|
66
|
+
4. frontend-specialist: UI/UX patterns
|
|
67
|
+
5. test-engineer: Test coverage
|
|
68
|
+
6. Synthesize all findings
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Pattern 2: Feature Review
|
|
72
|
+
```
|
|
73
|
+
Agents: affected-domain-agents → test-engineer
|
|
74
|
+
|
|
75
|
+
1. Identify affected domains (backend? frontend? both?)
|
|
76
|
+
2. Invoke relevant domain agents
|
|
77
|
+
3. test-engineer verifies changes
|
|
78
|
+
4. Synthesize recommendations
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Pattern 3: Security Audit
|
|
82
|
+
```
|
|
83
|
+
Agents: security-auditor → penetration-tester → synthesis
|
|
84
|
+
|
|
85
|
+
1. security-auditor: Configuration and code review
|
|
86
|
+
2. penetration-tester: Active vulnerability testing
|
|
87
|
+
3. Synthesize with prioritized remediation
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Available Agents
|
|
93
|
+
|
|
94
|
+
| Agent | Expertise | Trigger Phrases |
|
|
95
|
+
|-------|-----------|-----------------|
|
|
96
|
+
| `orchestrator` | Coordination | "comprehensive", "multi-perspective" |
|
|
97
|
+
| `security-auditor` | Security | "security", "auth", "vulnerabilities" |
|
|
98
|
+
| `penetration-tester` | Security Testing | "pentest", "red team", "exploit" |
|
|
99
|
+
| `backend-specialist` | Backend | "API", "server", "Node.js", "Express" |
|
|
100
|
+
| `frontend-specialist` | Frontend | "React", "UI", "components", "Next.js" |
|
|
101
|
+
| `test-engineer` | Testing | "tests", "coverage", "TDD" |
|
|
102
|
+
| `devops-engineer` | DevOps | "deploy", "CI/CD", "infrastructure" |
|
|
103
|
+
| `database-architect` | Database | "schema", "Prisma", "migrations" |
|
|
104
|
+
| `mobile-developer` | Mobile | "React Native", "Flutter", "mobile" |
|
|
105
|
+
| `api-designer` | API Design | "REST", "GraphQL", "OpenAPI" |
|
|
106
|
+
| `debugger` | Debugging | "bug", "error", "not working" |
|
|
107
|
+
| `explorer-agent` | Discovery | "explore", "map", "structure" |
|
|
108
|
+
| `documentation-writer` | Documentation | "write docs", "create README", "generate API docs" |
|
|
109
|
+
| `performance-optimizer` | Performance | "slow", "optimize", "profiling" |
|
|
110
|
+
| `project-planner` | Planning | "plan", "roadmap", "milestones" |
|
|
111
|
+
| `seo-specialist` | SEO | "SEO", "meta tags", "search ranking" |
|
|
112
|
+
| `game-developer` | Game Development | "game", "Unity", "Godot", "Phaser" |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Antigravity Built-in Agents
|
|
117
|
+
|
|
118
|
+
These work alongside custom agents:
|
|
119
|
+
|
|
120
|
+
| Agent | Model | Purpose |
|
|
121
|
+
|-------|-------|---------|
|
|
122
|
+
| **Explore** | Haiku | Fast read-only codebase search |
|
|
123
|
+
| **Plan** | Sonnet | Research during plan mode |
|
|
124
|
+
| **General-purpose** | Sonnet | Complex multi-step modifications |
|
|
125
|
+
|
|
126
|
+
Use **Explore** for quick searches, **custom agents** for domain expertise.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Synthesis Protocol
|
|
131
|
+
|
|
132
|
+
After all agents complete, synthesize:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
## Orchestration Synthesis
|
|
136
|
+
|
|
137
|
+
### Task Summary
|
|
138
|
+
[What was accomplished]
|
|
139
|
+
|
|
140
|
+
### Agent Contributions
|
|
141
|
+
| Agent | Finding |
|
|
142
|
+
|-------|---------|
|
|
143
|
+
| security-auditor | Found X |
|
|
144
|
+
| backend-specialist | Identified Y |
|
|
145
|
+
|
|
146
|
+
### Consolidated Recommendations
|
|
147
|
+
1. **Critical**: [Issue from Agent A]
|
|
148
|
+
2. **Important**: [Issue from Agent B]
|
|
149
|
+
3. **Nice-to-have**: [Enhancement from Agent C]
|
|
150
|
+
|
|
151
|
+
### Action Items
|
|
152
|
+
- [ ] Fix critical security issue
|
|
153
|
+
- [ ] Refactor API endpoint
|
|
154
|
+
- [ ] Add missing tests
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Best Practices
|
|
160
|
+
|
|
161
|
+
1. **Available agents** - 17 specialized agents can be orchestrated
|
|
162
|
+
2. **Logical order** - Discovery → Analysis → Implementation → Testing
|
|
163
|
+
3. **Share context** - Pass relevant findings to subsequent agents
|
|
164
|
+
4. **Single synthesis** - One unified report, not separate outputs
|
|
165
|
+
5. **Verify changes** - Always include test-engineer for code modifications
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Key Benefits
|
|
170
|
+
|
|
171
|
+
- ✅ **Single session** - All agents share context
|
|
172
|
+
- ✅ **AI-controlled** - Claude orchestrates autonomously
|
|
173
|
+
- ✅ **Native integration** - Works with built-in Explore, Plan agents
|
|
174
|
+
- ✅ **Resume support** - Can continue previous agent work
|
|
175
|
+
- ✅ **Context passing** - Findings flow between agents
|