@devran-ai/kit 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/CheatSheet.md +350 -0
- package/.agent/README.md +76 -0
- package/.agent/agents/README.md +155 -0
- package/.agent/agents/architect.md +185 -0
- package/.agent/agents/backend-specialist.md +276 -0
- package/.agent/agents/build-error-resolver.md +207 -0
- package/.agent/agents/code-reviewer.md +162 -0
- package/.agent/agents/database-architect.md +138 -0
- package/.agent/agents/devops-engineer.md +144 -0
- package/.agent/agents/doc-updater.md +229 -0
- package/.agent/agents/e2e-runner.md +145 -0
- package/.agent/agents/explorer-agent.md +143 -0
- package/.agent/agents/frontend-specialist.md +144 -0
- package/.agent/agents/go-reviewer.md +128 -0
- package/.agent/agents/knowledge-agent.md +197 -0
- package/.agent/agents/mobile-developer.md +150 -0
- package/.agent/agents/performance-optimizer.md +175 -0
- package/.agent/agents/planner.md +133 -0
- package/.agent/agents/pr-reviewer.md +148 -0
- package/.agent/agents/python-reviewer.md +123 -0
- package/.agent/agents/refactor-cleaner.md +201 -0
- package/.agent/agents/reliability-engineer.md +156 -0
- package/.agent/agents/security-reviewer.md +141 -0
- package/.agent/agents/sprint-orchestrator.md +124 -0
- package/.agent/agents/tdd-guide.md +179 -0
- package/.agent/agents/typescript-reviewer.md +110 -0
- package/.agent/checklists/README.md +102 -0
- package/.agent/checklists/pre-commit.md +93 -0
- package/.agent/checklists/session-end.md +99 -0
- package/.agent/checklists/session-start.md +102 -0
- package/.agent/checklists/task-complete.md +81 -0
- package/.agent/commands/README.md +130 -0
- package/.agent/commands/adr.md +29 -0
- package/.agent/commands/ask.md +28 -0
- package/.agent/commands/build.md +30 -0
- package/.agent/commands/changelog.md +40 -0
- package/.agent/commands/checkpoint.md +28 -0
- package/.agent/commands/code-review.md +65 -0
- package/.agent/commands/compact.md +28 -0
- package/.agent/commands/cook.md +30 -0
- package/.agent/commands/db.md +30 -0
- package/.agent/commands/debug.md +31 -0
- package/.agent/commands/deploy.md +37 -0
- package/.agent/commands/design.md +29 -0
- package/.agent/commands/doc.md +30 -0
- package/.agent/commands/eval.md +30 -0
- package/.agent/commands/fix.md +32 -0
- package/.agent/commands/git.md +32 -0
- package/.agent/commands/help.md +273 -0
- package/.agent/commands/implement.md +30 -0
- package/.agent/commands/integrate.md +32 -0
- package/.agent/commands/learn.md +29 -0
- package/.agent/commands/perf.md +31 -0
- package/.agent/commands/plan.md +56 -0
- package/.agent/commands/pr-describe.md +65 -0
- package/.agent/commands/pr-fix.md +45 -0
- package/.agent/commands/pr-merge.md +45 -0
- package/.agent/commands/pr-review.md +50 -0
- package/.agent/commands/pr-split.md +54 -0
- package/.agent/commands/pr-status.md +56 -0
- package/.agent/commands/pr.md +58 -0
- package/.agent/commands/refactor.md +32 -0
- package/.agent/commands/research.md +28 -0
- package/.agent/commands/scout.md +30 -0
- package/.agent/commands/security-scan.md +33 -0
- package/.agent/commands/setup.md +31 -0
- package/.agent/commands/status.md +59 -0
- package/.agent/commands/tdd.md +73 -0
- package/.agent/commands/verify.md +58 -0
- package/.agent/contexts/brainstorm.md +26 -0
- package/.agent/contexts/debug.md +28 -0
- package/.agent/contexts/implement.md +29 -0
- package/.agent/contexts/plan-quality-log.md +30 -0
- package/.agent/contexts/review.md +27 -0
- package/.agent/contexts/ship.md +28 -0
- package/.agent/decisions/001-trust-grade-governance.md +46 -0
- package/.agent/decisions/002-cross-ide-generation.md +15 -0
- package/.agent/engine/identity.json +4 -0
- package/.agent/engine/loading-rules.json +193 -0
- package/.agent/engine/marketplace-index.json +29 -0
- package/.agent/engine/mcp-servers/filesystem.json +9 -0
- package/.agent/engine/mcp-servers/github.json +11 -0
- package/.agent/engine/mcp-servers/postgres.json +11 -0
- package/.agent/engine/mcp-servers/supabase.json +11 -0
- package/.agent/engine/mcp-servers/vercel.json +11 -0
- package/.agent/engine/reliability-config.json +14 -0
- package/.agent/engine/sdlc-map.json +50 -0
- package/.agent/engine/workflow-state.json +167 -0
- package/.agent/hooks/README.md +101 -0
- package/.agent/hooks/hooks.json +104 -0
- package/.agent/hooks/templates/session-end.md +110 -0
- package/.agent/hooks/templates/session-start.md +95 -0
- package/.agent/manifest.json +466 -0
- package/.agent/rules/agent-upgrade-policy.md +56 -0
- package/.agent/rules/architecture.md +111 -0
- package/.agent/rules/coding-style.md +75 -0
- package/.agent/rules/documentation.md +74 -0
- package/.agent/rules/git-workflow.md +140 -0
- package/.agent/rules/quality-gate.md +117 -0
- package/.agent/rules/security.md +67 -0
- package/.agent/rules/sprint-tracking.md +103 -0
- package/.agent/rules/testing.md +80 -0
- package/.agent/rules/workflow-standards.md +30 -0
- package/.agent/rules.md +293 -0
- package/.agent/session-context.md +69 -0
- package/.agent/session-state.json +27 -0
- package/.agent/skills/README.md +135 -0
- package/.agent/skills/api-patterns/SKILL.md +117 -0
- package/.agent/skills/app-builder/SKILL.md +202 -0
- package/.agent/skills/architecture/SKILL.md +101 -0
- package/.agent/skills/behavioral-modes/SKILL.md +295 -0
- package/.agent/skills/brainstorming/SKILL.md +156 -0
- package/.agent/skills/clean-code/SKILL.md +142 -0
- package/.agent/skills/context-budget/SKILL.md +78 -0
- package/.agent/skills/continuous-learning/SKILL.md +145 -0
- package/.agent/skills/database-design/SKILL.md +303 -0
- package/.agent/skills/debugging-strategies/SKILL.md +158 -0
- package/.agent/skills/deployment-procedures/SKILL.md +191 -0
- package/.agent/skills/docker-patterns/SKILL.md +161 -0
- package/.agent/skills/eval-harness/SKILL.md +89 -0
- package/.agent/skills/frontend-patterns/SKILL.md +141 -0
- package/.agent/skills/git-workflow/SKILL.md +159 -0
- package/.agent/skills/i18n-localization/SKILL.md +191 -0
- package/.agent/skills/intelligent-routing/SKILL.md +180 -0
- package/.agent/skills/mcp-integration/SKILL.md +240 -0
- package/.agent/skills/mobile-design/SKILL.md +191 -0
- package/.agent/skills/nodejs-patterns/SKILL.md +164 -0
- package/.agent/skills/parallel-agents/SKILL.md +200 -0
- package/.agent/skills/performance-profiling/SKILL.md +134 -0
- package/.agent/skills/plan-validation/SKILL.md +192 -0
- package/.agent/skills/plan-writing/SKILL.md +183 -0
- package/.agent/skills/plan-writing/domain-enhancers.md +184 -0
- package/.agent/skills/plan-writing/plan-retrospective.md +116 -0
- package/.agent/skills/plan-writing/plan-schema.md +119 -0
- package/.agent/skills/pr-toolkit/SKILL.md +174 -0
- package/.agent/skills/production-readiness/SKILL.md +126 -0
- package/.agent/skills/security-practices/SKILL.md +109 -0
- package/.agent/skills/shell-conventions/SKILL.md +92 -0
- package/.agent/skills/strategic-compact/SKILL.md +62 -0
- package/.agent/skills/testing-patterns/SKILL.md +141 -0
- package/.agent/skills/typescript-expert/SKILL.md +160 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +137 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.agent/skills/verification-loop/SKILL.md +89 -0
- package/.agent/skills/webapp-testing/SKILL.md +175 -0
- package/.agent/templates/adr-template.md +32 -0
- package/.agent/templates/bug-report.md +37 -0
- package/.agent/templates/feature-request.md +32 -0
- package/.agent/workflows/README.md +101 -0
- package/.agent/workflows/brainstorm.md +86 -0
- package/.agent/workflows/create.md +85 -0
- package/.agent/workflows/debug.md +83 -0
- package/.agent/workflows/deploy.md +114 -0
- package/.agent/workflows/enhance.md +85 -0
- package/.agent/workflows/orchestrate.md +106 -0
- package/.agent/workflows/plan.md +105 -0
- package/.agent/workflows/pr-fix.md +163 -0
- package/.agent/workflows/pr-merge.md +117 -0
- package/.agent/workflows/pr-review.md +178 -0
- package/.agent/workflows/pr-split.md +118 -0
- package/.agent/workflows/pr.md +184 -0
- package/.agent/workflows/preflight.md +107 -0
- package/.agent/workflows/preview.md +95 -0
- package/.agent/workflows/quality-gate.md +103 -0
- package/.agent/workflows/retrospective.md +100 -0
- package/.agent/workflows/review.md +104 -0
- package/.agent/workflows/status.md +89 -0
- package/.agent/workflows/test.md +98 -0
- package/.agent/workflows/ui-ux-pro-max.md +93 -0
- package/.agent/workflows/upgrade.md +97 -0
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/bin/kit.js +773 -0
- package/lib/agent-registry.js +228 -0
- package/lib/agent-reputation.js +343 -0
- package/lib/circuit-breaker.js +195 -0
- package/lib/cli-commands.js +322 -0
- package/lib/config-validator.js +274 -0
- package/lib/conflict-detector.js +252 -0
- package/lib/constants.js +47 -0
- package/lib/engineering-manager.js +336 -0
- package/lib/error-budget.js +370 -0
- package/lib/hook-system.js +256 -0
- package/lib/ide-generator.js +434 -0
- package/lib/identity.js +240 -0
- package/lib/io.js +146 -0
- package/lib/learning-engine.js +163 -0
- package/lib/loading-engine.js +421 -0
- package/lib/logger.js +118 -0
- package/lib/marketplace.js +321 -0
- package/lib/plugin-system.js +604 -0
- package/lib/plugin-verifier.js +197 -0
- package/lib/rate-limiter.js +113 -0
- package/lib/security-scanner.js +312 -0
- package/lib/self-healing.js +468 -0
- package/lib/session-manager.js +264 -0
- package/lib/skill-sandbox.js +244 -0
- package/lib/task-governance.js +522 -0
- package/lib/task-model.js +332 -0
- package/lib/updater.js +240 -0
- package/lib/verify.js +279 -0
- package/lib/workflow-engine.js +373 -0
- package/lib/workflow-events.js +166 -0
- package/lib/workflow-persistence.js +160 -0
- package/package.json +57 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: i18n-localization
|
|
3
|
+
description: Internationalization and localization patterns for multi-language applications
|
|
4
|
+
triggers:
|
|
5
|
+
[
|
|
6
|
+
i18n,
|
|
7
|
+
internationalization,
|
|
8
|
+
localization,
|
|
9
|
+
l10n,
|
|
10
|
+
translation,
|
|
11
|
+
multi-language,
|
|
12
|
+
locale,
|
|
13
|
+
rtl,
|
|
14
|
+
]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Internationalization & Localization
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
This skill provides patterns and best practices for building multi-language applications with proper internationalization (i18n) and localization (l10n) support.
|
|
22
|
+
|
|
23
|
+
## Core Principles
|
|
24
|
+
|
|
25
|
+
1. **Separate content from code**: All user-facing strings must be externalized
|
|
26
|
+
2. **Use ICU message format**: Support plurals, gender, and context
|
|
27
|
+
3. **Plan for RTL**: Layout should adapt to right-to-left languages
|
|
28
|
+
4. **Locale-aware formatting**: Dates, numbers, currencies must respect locale
|
|
29
|
+
5. **Fallback strategy**: Always have a default language fallback chain
|
|
30
|
+
|
|
31
|
+
## Recommended Libraries
|
|
32
|
+
|
|
33
|
+
### React / Next.js
|
|
34
|
+
|
|
35
|
+
| Library | Use Case |
|
|
36
|
+
| --------------------------- | ------------------------------------- |
|
|
37
|
+
| `next-intl` | Next.js App Router (recommended) |
|
|
38
|
+
| `react-intl` / `formatjs` | React apps with ICU support |
|
|
39
|
+
| `i18next` + `react-i18next` | Feature-rich, plugin ecosystem |
|
|
40
|
+
| `lingui` | Compile-time extraction, small bundle |
|
|
41
|
+
|
|
42
|
+
### React Native / Expo
|
|
43
|
+
|
|
44
|
+
| Library | Use Case |
|
|
45
|
+
| --------------------------- | ----------------------------- |
|
|
46
|
+
| `i18next` + `react-i18next` | Cross-platform (web + native) |
|
|
47
|
+
| `expo-localization` | Device locale detection |
|
|
48
|
+
| `react-native-localize` | Native locale detection |
|
|
49
|
+
|
|
50
|
+
### Backend (Node.js)
|
|
51
|
+
|
|
52
|
+
| Library | Use Case |
|
|
53
|
+
| --------------- | ------------------------ |
|
|
54
|
+
| `i18next` | Server-side translations |
|
|
55
|
+
| `messageformat` | ICU message compilation |
|
|
56
|
+
| `globalize` | CLDR-based formatting |
|
|
57
|
+
|
|
58
|
+
## File Structure
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
src/
|
|
62
|
+
├── locales/
|
|
63
|
+
│ ├── en/
|
|
64
|
+
│ │ ├── common.json # Shared translations
|
|
65
|
+
│ │ ├── auth.json # Auth-related strings
|
|
66
|
+
│ │ ├── dashboard.json # Dashboard strings
|
|
67
|
+
│ │ └── errors.json # Error messages
|
|
68
|
+
│ ├── tr/
|
|
69
|
+
│ │ ├── common.json
|
|
70
|
+
│ │ ├── auth.json
|
|
71
|
+
│ │ ├── dashboard.json
|
|
72
|
+
│ │ └── errors.json
|
|
73
|
+
│ └── de/
|
|
74
|
+
│ └── ...
|
|
75
|
+
├── i18n/
|
|
76
|
+
│ ├── config.ts # i18n configuration
|
|
77
|
+
│ ├── types.ts # Type-safe key definitions
|
|
78
|
+
│ └── middleware.ts # Locale detection middleware
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Translation Key Naming Convention
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"namespace.component.element": "Translation",
|
|
86
|
+
|
|
87
|
+
"auth.login.title": "Sign In",
|
|
88
|
+
"auth.login.emailLabel": "Email Address",
|
|
89
|
+
"auth.login.passwordLabel": "Password",
|
|
90
|
+
"auth.login.submitButton": "Sign In",
|
|
91
|
+
"auth.login.forgotPassword": "Forgot your password?",
|
|
92
|
+
|
|
93
|
+
"errors.validation.required": "{field} is required",
|
|
94
|
+
"errors.validation.minLength": "{field} must be at least {min} characters",
|
|
95
|
+
"errors.network.timeout": "Request timed out. Please try again."
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Key Patterns
|
|
100
|
+
|
|
101
|
+
### 1. Type-Safe Translations (TypeScript)
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// types.ts — Generate from default locale JSON
|
|
105
|
+
type TranslationKeys = keyof typeof import('./locales/en/common.json');
|
|
106
|
+
|
|
107
|
+
// Usage with next-intl
|
|
108
|
+
import { useTranslations } from 'next-intl';
|
|
109
|
+
|
|
110
|
+
function LoginForm() {
|
|
111
|
+
const t = useTranslations('auth.login');
|
|
112
|
+
return <h1>{t('title')}</h1>; // Type-checked!
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 2. Pluralization (ICU Format)
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"notifications.count": "{count, plural, =0 {No notifications} one {# notification} other {# notifications}}"
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 3. Date/Number Formatting
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
// Always use Intl API or library formatters
|
|
128
|
+
const formatted = new Intl.DateTimeFormat(locale, {
|
|
129
|
+
year: "numeric",
|
|
130
|
+
month: "long",
|
|
131
|
+
day: "numeric",
|
|
132
|
+
}).format(date);
|
|
133
|
+
|
|
134
|
+
const price = new Intl.NumberFormat(locale, {
|
|
135
|
+
style: "currency",
|
|
136
|
+
currency: "EUR",
|
|
137
|
+
}).format(amount);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 4. RTL Support
|
|
141
|
+
|
|
142
|
+
```css
|
|
143
|
+
/* Use logical properties instead of physical */
|
|
144
|
+
.container {
|
|
145
|
+
padding-inline-start: 1rem; /* Not padding-left */
|
|
146
|
+
margin-inline-end: 2rem; /* Not margin-right */
|
|
147
|
+
border-inline-start: 2px solid;
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### 5. Next.js App Router Integration
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
// middleware.ts
|
|
155
|
+
import createMiddleware from "next-intl/middleware";
|
|
156
|
+
|
|
157
|
+
export default createMiddleware({
|
|
158
|
+
locales: ["en", "tr", "de"],
|
|
159
|
+
defaultLocale: "en",
|
|
160
|
+
localeDetection: true,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export const config = {
|
|
164
|
+
matcher: ["/((?!api|_next|.*\\..*).*)"],
|
|
165
|
+
};
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Quality Checklist
|
|
169
|
+
|
|
170
|
+
- [ ] All user-facing strings externalized (no hardcoded text)
|
|
171
|
+
- [ ] Pluralization rules applied for countable items
|
|
172
|
+
- [ ] Date/time/number formatting uses locale-aware APIs
|
|
173
|
+
- [ ] RTL layout tested (if supporting RTL languages)
|
|
174
|
+
- [ ] Fallback language chain configured
|
|
175
|
+
- [ ] Translation keys are descriptive and namespaced
|
|
176
|
+
- [ ] Missing translation handling defined (fallback vs error)
|
|
177
|
+
- [ ] SEO: `<html lang="">` and `hreflang` tags set
|
|
178
|
+
- [ ] URL structure supports locale (`/en/about` or subdomain)
|
|
179
|
+
|
|
180
|
+
## Anti-Patterns to Avoid
|
|
181
|
+
|
|
182
|
+
❌ Hardcoding strings in components
|
|
183
|
+
❌ Using string concatenation for translated sentences
|
|
184
|
+
❌ Assuming left-to-right layout
|
|
185
|
+
❌ Using physical CSS properties (left/right) instead of logical (start/end)
|
|
186
|
+
❌ Formatting dates/numbers without locale context
|
|
187
|
+
❌ Storing translations in code instead of separate files
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
> **Source**: Devran AI Kit — [@devran-ai/kit](https://github.com/devran-ai/kit)
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: intelligent-routing
|
|
3
|
+
description: Automatic agent selection and intelligent task routing. Analyzes user requests and selects the best specialist agent(s) for Trust-Grade execution.
|
|
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 while maintaining Trust-Grade governance.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
### 1. Request Analysis
|
|
20
|
+
|
|
21
|
+
Before responding to ANY user request, perform automatic analysis:
|
|
22
|
+
|
|
23
|
+
```mermaid
|
|
24
|
+
graph TD
|
|
25
|
+
A[User Request] --> B[ANALYZE]
|
|
26
|
+
B --> C[Keywords]
|
|
27
|
+
B --> D[Domains]
|
|
28
|
+
B --> E[Complexity]
|
|
29
|
+
C --> F[SELECT AGENT]
|
|
30
|
+
D --> F
|
|
31
|
+
E --> F
|
|
32
|
+
F --> G[Apply Trust-Grade Context]
|
|
33
|
+
G --> H[AUTO-INVOKE with governance]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Agent Selection Matrix
|
|
37
|
+
|
|
38
|
+
| User Intent | Keywords | Selected Agent(s) | Auto-invoke? |
|
|
39
|
+
| ----------------- | ----------------------------------- | -------------------------- | ------------ |
|
|
40
|
+
| **Architecture** | "design", "structure", "pattern" | `architect` | ✅ YES |
|
|
41
|
+
| **Planning** | "plan", "roadmap", "sprint" | `planner` | ✅ YES |
|
|
42
|
+
| **Code Review** | "review", "check", "audit" | `code-reviewer` | ✅ YES |
|
|
43
|
+
| **Security** | "security", "vulnerability", "auth" | `security-reviewer` | ✅ YES |
|
|
44
|
+
| **Testing** | "test", "coverage", "e2e" | `tdd-guide` + `e2e-runner` | ✅ YES |
|
|
45
|
+
| **Build Errors** | "error", "build", "compile" | `build-error-resolver` | ✅ YES |
|
|
46
|
+
| **Refactoring** | "refactor", "clean", "improve" | `refactor-cleaner` | ✅ YES |
|
|
47
|
+
| **Documentation** | "docs", "readme", "document" | `doc-updater` | ✅ YES |
|
|
48
|
+
| **Knowledge** | "learn", "remember", "pattern" | `knowledge-agent` | ✅ YES |
|
|
49
|
+
| **Complex Task** | Multiple domains detected | `planner` → multi-agent | ⚠️ ASK FIRST |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Domain Detection Rules
|
|
54
|
+
|
|
55
|
+
### Single-Domain Tasks (Auto-invoke Single Agent)
|
|
56
|
+
|
|
57
|
+
| Domain | Patterns | Agent |
|
|
58
|
+
| ---------------- | ------------------------------------- | -------------------------- |
|
|
59
|
+
| **Architecture** | design, pattern, structure, layer | `architect` |
|
|
60
|
+
| **Planning** | plan, task, sprint, milestone | `planner` |
|
|
61
|
+
| **Security** | auth, jwt, password, vulnerability | `security-reviewer` |
|
|
62
|
+
| **Testing** | test, jest, coverage, e2e, playwright | `tdd-guide` / `e2e-runner` |
|
|
63
|
+
| **Build** | error, compile, typescript, lint | `build-error-resolver` |
|
|
64
|
+
| **Refactor** | clean, refactor, improve, optimize | `refactor-cleaner` |
|
|
65
|
+
| **Docs** | readme, document, api-docs | `doc-updater` |
|
|
66
|
+
|
|
67
|
+
### Multi-Domain Tasks (Orchestration Required)
|
|
68
|
+
|
|
69
|
+
If request matches **2+ domains from different categories**, escalate to `planner` for orchestration:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Example: "Create a secure login with tests"
|
|
73
|
+
→ Detected: Security + Testing + Backend
|
|
74
|
+
→ Auto-invoke: planner (orchestration mode)
|
|
75
|
+
→ Planner will handle: security-reviewer, architect, tdd-guide
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Complexity Assessment
|
|
81
|
+
|
|
82
|
+
### SIMPLE (Direct agent invocation)
|
|
83
|
+
|
|
84
|
+
- Single file edit
|
|
85
|
+
- Clear, specific task
|
|
86
|
+
- One domain only
|
|
87
|
+
- Example: "Fix the TypeScript error in auth.ts"
|
|
88
|
+
|
|
89
|
+
**Action**: Auto-invoke respective agent
|
|
90
|
+
|
|
91
|
+
### MODERATE (2-3 agents)
|
|
92
|
+
|
|
93
|
+
- 2-3 files affected
|
|
94
|
+
- Clear requirements
|
|
95
|
+
- 2 domains max
|
|
96
|
+
- Example: "Add API endpoint with tests"
|
|
97
|
+
|
|
98
|
+
**Action**: Auto-invoke relevant agents sequentially
|
|
99
|
+
|
|
100
|
+
### COMPLEX (Orchestration required)
|
|
101
|
+
|
|
102
|
+
- Multiple files/domains
|
|
103
|
+
- Architectural decisions needed
|
|
104
|
+
- Unclear requirements
|
|
105
|
+
- Example: "Build a new feature vertical"
|
|
106
|
+
|
|
107
|
+
**Action**: Auto-invoke `planner` → will ask Socratic questions
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Implementation Rules
|
|
112
|
+
|
|
113
|
+
### Rule 1: Silent Analysis
|
|
114
|
+
|
|
115
|
+
**DO NOT announce "I'm analyzing your request..."**
|
|
116
|
+
|
|
117
|
+
- ✅ Analyze silently
|
|
118
|
+
- ✅ Inform which agent is being applied
|
|
119
|
+
- ❌ Avoid verbose meta-commentary
|
|
120
|
+
|
|
121
|
+
### Rule 2: Inform Agent Selection
|
|
122
|
+
|
|
123
|
+
**DO inform which expertise is being applied:**
|
|
124
|
+
|
|
125
|
+
```markdown
|
|
126
|
+
🤖 **Applying `@security-reviewer` expertise...**
|
|
127
|
+
|
|
128
|
+
I will review the authentication implementation with the following focus:
|
|
129
|
+
[Continue with specialized response]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Rule 3: Trust-Grade Context
|
|
133
|
+
|
|
134
|
+
**Always apply project governance context:**
|
|
135
|
+
|
|
136
|
+
- Load relevant governance rules
|
|
137
|
+
- Apply session state context
|
|
138
|
+
- Enforce pre-task checklists
|
|
139
|
+
|
|
140
|
+
### Rule 4: Override Capability
|
|
141
|
+
|
|
142
|
+
**User can still explicitly mention agents:**
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
User: "Use @architect to review this"
|
|
146
|
+
→ Override auto-selection
|
|
147
|
+
→ Use explicitly mentioned agent
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Integration with Project Governance
|
|
153
|
+
|
|
154
|
+
### With Session State
|
|
155
|
+
|
|
156
|
+
- Check `session-state.json` for active context
|
|
157
|
+
- Inherit project-specific configurations
|
|
158
|
+
- Maintain Trust-Grade continuity
|
|
159
|
+
|
|
160
|
+
### With Governance Rules
|
|
161
|
+
|
|
162
|
+
- Apply relevant governance rules
|
|
163
|
+
- Enforce professional standards
|
|
164
|
+
- Maintain project architecture alignment
|
|
165
|
+
|
|
166
|
+
### With Checklists
|
|
167
|
+
|
|
168
|
+
- Trigger pre-task checks for complex operations
|
|
169
|
+
- Validate against session-end protocols
|
|
170
|
+
- Ensure documentation updates
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Summary
|
|
175
|
+
|
|
176
|
+
1. **Analyze every request** before responding
|
|
177
|
+
2. **Select best agent(s)** using the matrix
|
|
178
|
+
3. **Inform user** which expertise is applied
|
|
179
|
+
4. **Maintain governance** through Trust-Grade protocols
|
|
180
|
+
5. **Stay seamless** - user shouldn't notice the routing
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcp-integration
|
|
3
|
+
description: Model Context Protocol (MCP) integration patterns for extending AI capabilities with external tools and data sources.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
triggers: [mcp, tool, server, protocol, integration, external]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MCP Integration Skill
|
|
9
|
+
|
|
10
|
+
> **Purpose**: Guide the integration and effective use of Model Context Protocol (MCP) servers to extend AI agent capabilities with external tools, data sources, and services.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
The Model Context Protocol (MCP) is an open standard that connects AI systems with external tools and data sources through a unified interface. MCP servers act as capability providers — each server exposes a set of tools that the AI can invoke to perform actions beyond its native abilities.
|
|
17
|
+
|
|
18
|
+
This skill ensures that MCP integrations follow Trust-Grade principles: secure, reliable, and properly governed.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Core Concepts
|
|
23
|
+
|
|
24
|
+
### MCP Architecture
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
|
|
28
|
+
│ AI Agent │────▶│ MCP Client │────▶│ MCP Server │
|
|
29
|
+
│ (LLM + Kit) │◀────│ (IDE/Runtime) │◀────│ (Tool Provider)│
|
|
30
|
+
└─────────────────┘ └──────────────────┘ └─────────────────┘
|
|
31
|
+
│
|
|
32
|
+
┌────┴────┐
|
|
33
|
+
│ External │
|
|
34
|
+
│ Service │
|
|
35
|
+
└─────────┘
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Key Components
|
|
39
|
+
|
|
40
|
+
| Component | Role | Example |
|
|
41
|
+
|:----------|:-----|:--------|
|
|
42
|
+
| **MCP Server** | Exposes tools via protocol | GitHub MCP, GitKraken MCP, Database MCP |
|
|
43
|
+
| **MCP Client** | Connects AI to servers | VS Code extension, Cursor, IDE runtime |
|
|
44
|
+
| **Tools** | Individual capabilities | `create_issue`, `git_commit`, `run_query` |
|
|
45
|
+
| **Resources** | Data endpoints | File contents, database schemas, API docs |
|
|
46
|
+
| **Prompts** | Reusable templates | Code review template, deployment checklist |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Integration Patterns
|
|
51
|
+
|
|
52
|
+
### Pattern 1: Git Operations via MCP
|
|
53
|
+
|
|
54
|
+
**When to use**: Git operations that benefit from structured API access rather than raw CLI commands.
|
|
55
|
+
|
|
56
|
+
**Available servers**: GitKraken MCP, GitHub MCP
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Preferred for:
|
|
60
|
+
- Creating branches, commits, PRs (structured data)
|
|
61
|
+
- Reading git status, blame, diff (parsed output)
|
|
62
|
+
- Managing issues and reviews (API access)
|
|
63
|
+
|
|
64
|
+
Still use CLI for:
|
|
65
|
+
- Complex git operations (rebase, cherry-pick)
|
|
66
|
+
- Local-only operations (stash, worktree)
|
|
67
|
+
- Performance-critical batch operations
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Pattern 2: Issue and Project Management
|
|
71
|
+
|
|
72
|
+
**When to use**: Creating, updating, and querying issues across platforms.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
GitHub MCP Server provides:
|
|
76
|
+
- issue_write (create/update issues)
|
|
77
|
+
- issue_read (get details, comments, labels)
|
|
78
|
+
- search_issues (query with GitHub syntax)
|
|
79
|
+
- list_issues (paginated browsing)
|
|
80
|
+
|
|
81
|
+
Best practices:
|
|
82
|
+
- Use search_* for targeted queries with criteria
|
|
83
|
+
- Use list_* for broad retrieval with pagination
|
|
84
|
+
- Batch reads in groups of 5-10 items
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Pattern 3: Code Search and Analysis
|
|
88
|
+
|
|
89
|
+
**When to use**: Finding code patterns across repositories.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
GitHub MCP provides:
|
|
93
|
+
- search_code (cross-repo code search)
|
|
94
|
+
- get_file_contents (read specific files)
|
|
95
|
+
- get_commit (commit details with diff)
|
|
96
|
+
|
|
97
|
+
Usage guidance:
|
|
98
|
+
- Use search_code for finding symbols, functions, patterns
|
|
99
|
+
- Use get_file_contents for reading specific known files
|
|
100
|
+
- Combine with local grep_search for current workspace
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Pattern 4: Pull Request Workflow
|
|
104
|
+
|
|
105
|
+
**When to use**: Full PR lifecycle management.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Workflow:
|
|
109
|
+
1. create_branch → Create feature branch
|
|
110
|
+
2. push_files → Push code changes
|
|
111
|
+
3. create_pull_request → Open PR
|
|
112
|
+
4. request_copilot_review → Automated review
|
|
113
|
+
5. pull_request_read(get_status) → Check CI status
|
|
114
|
+
6. merge_pull_request → Merge when ready
|
|
115
|
+
|
|
116
|
+
Trust-Grade rules:
|
|
117
|
+
- Always create PR (never push directly to main)
|
|
118
|
+
- Always request review before merge
|
|
119
|
+
- Always check CI status before merge
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Security Guidelines
|
|
125
|
+
|
|
126
|
+
### Authentication
|
|
127
|
+
|
|
128
|
+
- MCP servers use token-based authentication
|
|
129
|
+
- Tokens are managed by the IDE/runtime, never by the AI agent
|
|
130
|
+
- Never log, display, or store authentication tokens
|
|
131
|
+
- Verify server identity before sending sensitive operations
|
|
132
|
+
|
|
133
|
+
### Permission Model
|
|
134
|
+
|
|
135
|
+
| Operation Type | Risk Level | Verification Required |
|
|
136
|
+
|:---------------|:-----------|:---------------------|
|
|
137
|
+
| Read (list, get, search) | Low | None |
|
|
138
|
+
| Create (new issue, branch, file) | Medium | Confirm with user |
|
|
139
|
+
| Modify (update, edit) | Medium | Confirm with user |
|
|
140
|
+
| Delete (remove file, close issue) | High | Explicit user approval |
|
|
141
|
+
| Deploy (merge, publish) | Critical | Double confirmation |
|
|
142
|
+
|
|
143
|
+
### Data Handling
|
|
144
|
+
|
|
145
|
+
- Never pass secrets through MCP tool parameters
|
|
146
|
+
- Sanitize user data before including in tool calls
|
|
147
|
+
- Respect repository visibility (public vs private)
|
|
148
|
+
- Log operations for audit trail (session-context.md)
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Server Selection Guide
|
|
153
|
+
|
|
154
|
+
| Task | Recommended Server | Why |
|
|
155
|
+
|:-----|:-------------------|:----|
|
|
156
|
+
| Git operations (commit, branch, status) | GitKraken MCP | Richer git-specific tools |
|
|
157
|
+
| GitHub issues and PRs | GitHub MCP | Native GitHub API access |
|
|
158
|
+
| Code review and analysis | GitHub MCP | PR review tools |
|
|
159
|
+
| Repository management | GitHub MCP | Repo CRUD operations |
|
|
160
|
+
| Complex git workflows | GitKraken MCP | Worktree, stash, blame |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Error Handling
|
|
165
|
+
|
|
166
|
+
### Common MCP Errors
|
|
167
|
+
|
|
168
|
+
| Error | Cause | Resolution |
|
|
169
|
+
|:------|:------|:-----------|
|
|
170
|
+
| `ENEEDAUTH` | Token expired/missing | Re-authenticate via IDE settings |
|
|
171
|
+
| `403 Forbidden` | Insufficient permissions | Check token scopes |
|
|
172
|
+
| `404 Not Found` | Resource doesn't exist | Verify owner/repo/branch names |
|
|
173
|
+
| `422 Unprocessable` | Invalid parameters | Check required fields and formats |
|
|
174
|
+
| `Rate Limited` | Too many requests | Implement exponential backoff |
|
|
175
|
+
|
|
176
|
+
### Fallback Strategy
|
|
177
|
+
|
|
178
|
+
When an MCP server is unavailable:
|
|
179
|
+
1. Log the failure in session context
|
|
180
|
+
2. Fall back to CLI equivalent if available
|
|
181
|
+
3. Notify user of degraded capability
|
|
182
|
+
4. Continue with remaining available tools
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Pre-configured Server Templates
|
|
187
|
+
|
|
188
|
+
Templates are available in `.agent/engine/mcp-servers/`:
|
|
189
|
+
|
|
190
|
+
| Server | Package | Required Env Var |
|
|
191
|
+
|--------|---------|-----------------|
|
|
192
|
+
| GitHub | `@modelcontextprotocol/server-github` | `GITHUB_TOKEN` |
|
|
193
|
+
| Supabase | `@supabase/mcp-server-supabase` | `SUPABASE_ACCESS_TOKEN` |
|
|
194
|
+
| Vercel | `@vercel/mcp` | `VERCEL_TOKEN` |
|
|
195
|
+
| Filesystem | `@modelcontextprotocol/server-filesystem` | (none) |
|
|
196
|
+
| PostgreSQL | `@modelcontextprotocol/server-postgres` | `DATABASE_URL` |
|
|
197
|
+
|
|
198
|
+
Templates use `${VAR}` placeholders — set the environment variable before starting the server.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Integration with Devran AI Kit
|
|
203
|
+
|
|
204
|
+
### Loading Rules Integration
|
|
205
|
+
|
|
206
|
+
MCP capabilities are registered in `engine/loading-rules.json` under domain rules:
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"domain": "git-operations",
|
|
211
|
+
"keywords": ["git", "commit", "branch", "pr", "merge"],
|
|
212
|
+
"loadAgents": ["devops-engineer"],
|
|
213
|
+
"loadSkills": ["git-workflow", "mcp-integration"],
|
|
214
|
+
"mcpServers": ["GitKraken", "github-mcp-server"]
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Session Context Tracking
|
|
219
|
+
|
|
220
|
+
Log MCP operations in session context for continuity:
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
## MCP Operations This Session
|
|
224
|
+
- Created branch `feature/auth` via GitKraken MCP
|
|
225
|
+
- Opened PR #42 via GitHub MCP
|
|
226
|
+
- Requested Copilot review via GitHub MCP
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Workflow State Integration
|
|
230
|
+
|
|
231
|
+
MCP operations map to workflow phases:
|
|
232
|
+
|
|
233
|
+
| Phase | MCP Operations |
|
|
234
|
+
|:------|:--------------|
|
|
235
|
+
| EXPLORE | `search_code`, `get_file_contents`, `list_issues` |
|
|
236
|
+
| PLAN | `issue_write` (create tracking issue) |
|
|
237
|
+
| IMPLEMENT | `create_branch`, `push_files` |
|
|
238
|
+
| VERIFY | `pull_request_read(get_status)` |
|
|
239
|
+
| REVIEW | `request_copilot_review`, `pull_request_review_write` |
|
|
240
|
+
| DEPLOY | `merge_pull_request` |
|