@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: mobile-design
|
|
3
|
+
description: Mobile UI/UX patterns for iOS and Android. Touch-first, platform-respectful design with React Native/Expo focus.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
allowed-tools: Read, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Mobile Design System
|
|
9
|
+
|
|
10
|
+
> **Philosophy:** Touch-first. Battery-conscious. Platform-respectful. Offline-capable.
|
|
11
|
+
> **Core Principle:** Mobile is NOT a small desktop. THINK mobile constraints, ASK platform choice.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ⚠️ CRITICAL: ASK BEFORE ASSUMING
|
|
16
|
+
|
|
17
|
+
### You MUST Ask If Not Specified:
|
|
18
|
+
|
|
19
|
+
- **Platform**: iOS only? Android only? Both?
|
|
20
|
+
- **Framework**: React Native/Expo? Flutter?
|
|
21
|
+
- **Navigation**: Tab-based? Stack? Drawer?
|
|
22
|
+
- **Offline**: Required? Nice-to-have? Not needed?
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 📱 Platform Decision Matrix
|
|
27
|
+
|
|
28
|
+
### When to Unify vs Diverge
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
UNIFY (same on both) DIVERGE (platform-specific)
|
|
32
|
+
─────────────────── ──────────────────────────
|
|
33
|
+
Business Logic ✅ Always -
|
|
34
|
+
Data Layer ✅ Always -
|
|
35
|
+
Core Features ✅ Always -
|
|
36
|
+
|
|
37
|
+
Navigation - ✅ iOS: edge swipe, Android: back button
|
|
38
|
+
Gestures - ✅ Platform-native feel
|
|
39
|
+
Icons - ✅ SF Symbols vs Material Icons
|
|
40
|
+
Date Pickers - ✅ Native pickers feel right
|
|
41
|
+
Modals/Sheets - ✅ iOS: bottom sheet vs Android: dialog
|
|
42
|
+
Typography - ✅ SF Pro vs Roboto (or custom)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Quick Reference: Platform Defaults
|
|
46
|
+
|
|
47
|
+
| Element | iOS | Android |
|
|
48
|
+
| -------------------- | ------------------------- | -------------------------- |
|
|
49
|
+
| **Primary Font** | SF Pro / SF Compact | Roboto |
|
|
50
|
+
| **Min Touch Target** | 44pt × 44pt | 48dp × 48dp |
|
|
51
|
+
| **Back Navigation** | Edge swipe left | System back button/gesture |
|
|
52
|
+
| **Bottom Tab Icons** | SF Symbols | Material Symbols |
|
|
53
|
+
| **Action Sheet** | UIActionSheet from bottom | Bottom Sheet / Dialog |
|
|
54
|
+
| **Progress** | Spinner | Linear progress (Material) |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🧠 Mobile UX Psychology
|
|
59
|
+
|
|
60
|
+
### Fitts' Law for Touch
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Desktop: Cursor is precise (1px)
|
|
64
|
+
Mobile: Finger is imprecise (~7mm contact area)
|
|
65
|
+
|
|
66
|
+
→ Touch targets MUST be 44-48px minimum
|
|
67
|
+
→ Important actions in THUMB ZONE (bottom of screen)
|
|
68
|
+
→ Destructive actions AWAY from easy reach
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Thumb Zone (One-Handed Usage)
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
┌─────────────────────────────┐
|
|
75
|
+
│ HARD TO REACH │ ← Navigation, menu, back
|
|
76
|
+
│ (stretch) │
|
|
77
|
+
├─────────────────────────────┤
|
|
78
|
+
│ OK TO REACH │ ← Secondary actions
|
|
79
|
+
│ (natural) │
|
|
80
|
+
├─────────────────────────────┤
|
|
81
|
+
│ EASY TO REACH │ ← PRIMARY CTAs, tab bar
|
|
82
|
+
│ (thumb's natural arc) │ ← Main content interaction
|
|
83
|
+
└─────────────────────────────┘
|
|
84
|
+
[ HOME ]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Mobile-Specific Cognitive Load
|
|
88
|
+
|
|
89
|
+
| Desktop | Mobile Difference |
|
|
90
|
+
| ------------------ | ------------------------------ |
|
|
91
|
+
| Multiple windows | ONE task at a time |
|
|
92
|
+
| Keyboard shortcuts | Touch gestures |
|
|
93
|
+
| Hover states | NO hover (tap or nothing) |
|
|
94
|
+
| Large viewport | Limited space, scroll vertical |
|
|
95
|
+
| Stable attention | Interrupted constantly |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ⚡ React Native/Expo Performance
|
|
100
|
+
|
|
101
|
+
### FlatList Optimization
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// ✅ CORRECT: Memoized renderItem + React.memo wrapper
|
|
105
|
+
const ListItem = React.memo(({ item }: { item: Item }) => (
|
|
106
|
+
<View style={styles.item}>
|
|
107
|
+
<Text>{item.title}</Text>
|
|
108
|
+
</View>
|
|
109
|
+
));
|
|
110
|
+
|
|
111
|
+
const renderItem = useCallback(
|
|
112
|
+
({ item }: { item: Item }) => <ListItem item={item} />,
|
|
113
|
+
[]
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
// ✅ CORRECT: FlatList with all optimizations
|
|
117
|
+
<FlatList
|
|
118
|
+
data={items}
|
|
119
|
+
renderItem={renderItem}
|
|
120
|
+
keyExtractor={(item) => item.id} // Stable ID, NOT index
|
|
121
|
+
getItemLayout={(data, index) => ({
|
|
122
|
+
length: ITEM_HEIGHT,
|
|
123
|
+
offset: ITEM_HEIGHT * index,
|
|
124
|
+
index,
|
|
125
|
+
})}
|
|
126
|
+
removeClippedSubviews={true}
|
|
127
|
+
maxToRenderPerBatch={10}
|
|
128
|
+
windowSize={5}
|
|
129
|
+
/>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Animation Performance
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
GPU-accelerated (FAST): CPU-bound (SLOW):
|
|
136
|
+
├── transform ├── width, height
|
|
137
|
+
├── opacity ├── top, left, right, bottom
|
|
138
|
+
└── (use these ONLY) ├── margin, padding
|
|
139
|
+
└── (AVOID animating these)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 📝 Pre-Development Checklist
|
|
145
|
+
|
|
146
|
+
### Before Starting ANY Mobile Project
|
|
147
|
+
|
|
148
|
+
- [ ] Platform(s) confirmed (iOS/Android/Both)
|
|
149
|
+
- [ ] Framework chosen (Expo recommended)
|
|
150
|
+
- [ ] Navigation pattern decided
|
|
151
|
+
- [ ] Offline requirements clarified
|
|
152
|
+
- [ ] Design system tokens defined
|
|
153
|
+
|
|
154
|
+
### Before Every Screen
|
|
155
|
+
|
|
156
|
+
- [ ] Touch targets ≥ 44pt
|
|
157
|
+
- [ ] Primary actions in thumb zone
|
|
158
|
+
- [ ] Safe area insets handled
|
|
159
|
+
- [ ] Both orientations considered (or locked)
|
|
160
|
+
|
|
161
|
+
### Before Release
|
|
162
|
+
|
|
163
|
+
- [ ] Performance profiled
|
|
164
|
+
- [ ] Memory usage checked
|
|
165
|
+
- [ ] Battery impact tested
|
|
166
|
+
- [ ] Accessibility verified
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 🔗 Recommended Mobile Stack
|
|
171
|
+
|
|
172
|
+
| Layer | Technology |
|
|
173
|
+
| ---------- | -------------------------------- |
|
|
174
|
+
| Framework | Expo (managed workflow) |
|
|
175
|
+
| Navigation | Expo Router |
|
|
176
|
+
| State | Zustand + React Query |
|
|
177
|
+
| Storage | expo-secure-store + AsyncStorage |
|
|
178
|
+
| UI | Custom + NativeWind (if needed) |
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## ❌ Mobile Anti-Patterns
|
|
183
|
+
|
|
184
|
+
| ❌ Don't | ✅ Do |
|
|
185
|
+
| --------------------------- | ------------------------- |
|
|
186
|
+
| Assume platform conventions | Ask or detect platform |
|
|
187
|
+
| Use web-style hover states | Use pressable feedback |
|
|
188
|
+
| Put CTAs at top of screen | Keep CTAs in thumb zone |
|
|
189
|
+
| Use tiny touch targets | Minimum 44-48px |
|
|
190
|
+
| Ignore safe areas | Always respect insets |
|
|
191
|
+
| Over-animate | Subtle, purposeful motion |
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nodejs-patterns
|
|
3
|
+
description: Node.js and backend framework best practices
|
|
4
|
+
triggers: [context, nodejs, nestjs, express, backend]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Node.js Patterns Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Apply professional Node.js patterns for backend development
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill provides best practices for building scalable, maintainable Node.js applications.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Project Structure
|
|
20
|
+
|
|
21
|
+
### NestJS Structure
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
src/
|
|
25
|
+
├── main.ts # Entry point
|
|
26
|
+
├── app.module.ts # Root module
|
|
27
|
+
├── common/ # Shared utilities
|
|
28
|
+
│ ├── decorators/
|
|
29
|
+
│ ├── filters/
|
|
30
|
+
│ ├── guards/
|
|
31
|
+
│ ├── interceptors/
|
|
32
|
+
│ └── pipes/
|
|
33
|
+
├── config/ # Configuration
|
|
34
|
+
│ ├── database.config.ts
|
|
35
|
+
│ └── app.config.ts
|
|
36
|
+
└── domains/ # Feature modules
|
|
37
|
+
├── users/
|
|
38
|
+
│ ├── users.module.ts
|
|
39
|
+
│ ├── users.controller.ts
|
|
40
|
+
│ ├── users.service.ts
|
|
41
|
+
│ ├── dto/
|
|
42
|
+
│ └── entities/
|
|
43
|
+
└── orders/
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Dependency Injection
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// Service
|
|
52
|
+
@Injectable()
|
|
53
|
+
export class UserService {
|
|
54
|
+
constructor(
|
|
55
|
+
private readonly userRepository: UserRepository,
|
|
56
|
+
private readonly emailService: EmailService,
|
|
57
|
+
) {}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Controller
|
|
61
|
+
@Controller("users")
|
|
62
|
+
export class UserController {
|
|
63
|
+
constructor(private readonly userService: UserService) {}
|
|
64
|
+
|
|
65
|
+
@Get(":id")
|
|
66
|
+
async getUser(@Param("id") id: string) {
|
|
67
|
+
return this.userService.findById(id);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Error Handling
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
// Custom Exception
|
|
78
|
+
export class UserNotFoundException extends NotFoundException {
|
|
79
|
+
constructor(userId: string) {
|
|
80
|
+
super(`User with ID ${userId} not found`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Global Exception Filter
|
|
85
|
+
@Catch()
|
|
86
|
+
export class GlobalExceptionFilter implements ExceptionFilter {
|
|
87
|
+
catch(exception: unknown, host: ArgumentsHost) {
|
|
88
|
+
const ctx = host.switchToHttp();
|
|
89
|
+
const response = ctx.getResponse<Response>();
|
|
90
|
+
|
|
91
|
+
const status =
|
|
92
|
+
exception instanceof HttpException
|
|
93
|
+
? exception.getStatus()
|
|
94
|
+
: HttpStatus.INTERNAL_SERVER_ERROR;
|
|
95
|
+
|
|
96
|
+
response.status(status).json({
|
|
97
|
+
statusCode: status,
|
|
98
|
+
message: exception.message || "Internal server error",
|
|
99
|
+
timestamp: new Date().toISOString(),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Validation
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// DTO with class-validator
|
|
111
|
+
export class CreateUserDto {
|
|
112
|
+
@IsEmail()
|
|
113
|
+
email: string;
|
|
114
|
+
|
|
115
|
+
@IsString()
|
|
116
|
+
@MinLength(8)
|
|
117
|
+
@Matches(/^(?=.*[A-Z])(?=.*[0-9])/)
|
|
118
|
+
password: string;
|
|
119
|
+
|
|
120
|
+
@IsOptional()
|
|
121
|
+
@IsString()
|
|
122
|
+
name?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Controller with validation pipe
|
|
126
|
+
@Post()
|
|
127
|
+
@UsePipes(new ValidationPipe({ transform: true }))
|
|
128
|
+
async create(@Body() createUserDto: CreateUserDto) {
|
|
129
|
+
return this.userService.create(createUserDto);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Async Patterns
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// Async/Await
|
|
139
|
+
async function processOrders() {
|
|
140
|
+
const orders = await Order.findAll({ where: { status: "pending" } });
|
|
141
|
+
await Promise.all(orders.map((order) => processOrder(order)));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Concurrent Limit
|
|
145
|
+
import pLimit from "p-limit";
|
|
146
|
+
const limit = pLimit(5); // Max 5 concurrent
|
|
147
|
+
|
|
148
|
+
await Promise.all(items.map((item) => limit(() => processItem(item))));
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Quick Reference
|
|
154
|
+
|
|
155
|
+
| Pattern | Usage |
|
|
156
|
+
| :---------- | :------------------------ |
|
|
157
|
+
| Module | Feature encapsulation |
|
|
158
|
+
| Service | Business logic |
|
|
159
|
+
| Controller | HTTP handling |
|
|
160
|
+
| Repository | Data access |
|
|
161
|
+
| DTO | Data transfer |
|
|
162
|
+
| Guard | Authorization |
|
|
163
|
+
| Interceptor | Cross-cutting |
|
|
164
|
+
| Pipe | Transformation/Validation |
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel-agents
|
|
3
|
+
description: Multi-agent orchestration patterns for complex tasks requiring multiple domain expertise or comprehensive analysis.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
allowed-tools: Read, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Native Parallel Agents
|
|
9
|
+
|
|
10
|
+
> **Purpose**: Enable coordinating multiple specialized agents through Devran AI Kit's native agent system while maintaining Trust-Grade governance.
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
This skill enables coordinating multiple specialized agents for complex tasks. Unlike external scripts, this approach keeps all orchestration within the kit's control while applying Trust-Grade governance protocols.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## When to Use Orchestration
|
|
19
|
+
|
|
20
|
+
✅ **Good for:**
|
|
21
|
+
|
|
22
|
+
- Complex tasks requiring multiple expertise domains
|
|
23
|
+
- Code analysis from security, performance, and quality perspectives
|
|
24
|
+
- Comprehensive reviews (architecture + security + testing)
|
|
25
|
+
- Feature implementation needing backend + frontend + database work
|
|
26
|
+
- Trust-Grade verticals (Auth, Payment, etc.)
|
|
27
|
+
|
|
28
|
+
❌ **Not for:**
|
|
29
|
+
|
|
30
|
+
- Simple, single-domain tasks
|
|
31
|
+
- Quick fixes or small changes
|
|
32
|
+
- Tasks where one agent suffices
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Native Agent Invocation
|
|
37
|
+
|
|
38
|
+
### Single Agent
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Use the security-reviewer agent to audit authentication
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Sequential Chain
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
First, use the architect to review structure.
|
|
48
|
+
Then, use the code-reviewer to check implementation.
|
|
49
|
+
Finally, use the tdd-guide to verify test coverage.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### With Context Passing
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Use the planner to break down the feature.
|
|
56
|
+
Based on that plan, have the architect design the structure.
|
|
57
|
+
Then, have the tdd-guide create test specifications.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Resume Previous Work
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Resume agent [agentId] and continue with additional requirements.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Orchestration Patterns
|
|
69
|
+
|
|
70
|
+
### Pattern 1: Feature Vertical (Trust-Grade Standard)
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Agents: planner → architect → [domain-agents] → tdd-guide → e2e-runner
|
|
74
|
+
|
|
75
|
+
1. planner: Break down feature into tasks
|
|
76
|
+
2. architect: Design component structure
|
|
77
|
+
3. [domain-agents]: Implement by domain
|
|
78
|
+
4. tdd-guide: Create/verify unit tests
|
|
79
|
+
5. e2e-runner: Create/verify E2E tests
|
|
80
|
+
6. Synthesize all deliverables
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Pattern 2: Code Review Comprehensive
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
Agents: code-reviewer → security-reviewer → synthesis
|
|
87
|
+
|
|
88
|
+
1. code-reviewer: Quality and patterns review
|
|
89
|
+
2. security-reviewer: Security posture audit
|
|
90
|
+
3. Synthesize with prioritized findings
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Pattern 3: Security Audit
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Agents: security-reviewer → architect → tdd-guide
|
|
97
|
+
|
|
98
|
+
1. security-reviewer: Vulnerability assessment
|
|
99
|
+
2. architect: Secure architecture patterns
|
|
100
|
+
3. tdd-guide: Security test specifications
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Pattern 4: Build Recovery
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Agents: build-error-resolver → refactor-cleaner → tdd-guide
|
|
107
|
+
|
|
108
|
+
1. build-error-resolver: Fix immediate errors
|
|
109
|
+
2. refactor-cleaner: Clean up technical debt
|
|
110
|
+
3. tdd-guide: Add regression tests
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Available Agents
|
|
116
|
+
|
|
117
|
+
| Agent | Expertise | Trigger Phrases |
|
|
118
|
+
| ---------------------- | ------------- | ----------------------------------- |
|
|
119
|
+
| `architect` | System Design | "design", "structure", "pattern" |
|
|
120
|
+
| `planner` | Task Planning | "plan", "roadmap", "breakdown" |
|
|
121
|
+
| `code-reviewer` | Code Quality | "review", "check", "audit" |
|
|
122
|
+
| `security-reviewer` | Security | "security", "auth", "vulnerability" |
|
|
123
|
+
| `tdd-guide` | Unit Testing | "test", "TDD", "coverage" |
|
|
124
|
+
| `e2e-runner` | E2E Testing | "e2e", "playwright", "integration" |
|
|
125
|
+
| `build-error-resolver` | Build Issues | "error", "compile", "typescript" |
|
|
126
|
+
| `refactor-cleaner` | Refactoring | "refactor", "clean", "improve" |
|
|
127
|
+
| `doc-updater` | Documentation | "docs", "readme", "document" |
|
|
128
|
+
| `knowledge-agent` | Knowledge | "learn", "pattern", "remember" |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Synthesis Protocol
|
|
133
|
+
|
|
134
|
+
After all agents complete, synthesize findings:
|
|
135
|
+
|
|
136
|
+
```markdown
|
|
137
|
+
## Orchestration Synthesis
|
|
138
|
+
|
|
139
|
+
### Task Summary
|
|
140
|
+
|
|
141
|
+
[What was accomplished]
|
|
142
|
+
|
|
143
|
+
### Agent Contributions
|
|
144
|
+
|
|
145
|
+
| Agent | Finding |
|
|
146
|
+
| ----------------- | --------------- |
|
|
147
|
+
| architect | Designed X |
|
|
148
|
+
| security-reviewer | Identified Y |
|
|
149
|
+
| tdd-guide | Created Z tests |
|
|
150
|
+
|
|
151
|
+
### Consolidated Deliverables
|
|
152
|
+
|
|
153
|
+
1. **Code Changes**: [summary]
|
|
154
|
+
2. **Test Coverage**: [metrics]
|
|
155
|
+
3. **Documentation**: [updates]
|
|
156
|
+
|
|
157
|
+
### Action Items
|
|
158
|
+
|
|
159
|
+
- [ ] Complete remaining tasks
|
|
160
|
+
- [ ] Run verification loop
|
|
161
|
+
- [ ] Update session state
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Trust-Grade Integration
|
|
167
|
+
|
|
168
|
+
### Pre-Orchestration Checklist
|
|
169
|
+
|
|
170
|
+
- [ ] Verify session state is current
|
|
171
|
+
- [ ] Check for active blockers
|
|
172
|
+
- [ ] Load relevant governance rules
|
|
173
|
+
- [ ] Confirm scope with user if complex
|
|
174
|
+
|
|
175
|
+
### Post-Orchestration Protocol
|
|
176
|
+
|
|
177
|
+
- [ ] Run verification-loop skill
|
|
178
|
+
- [ ] Update session-state.json
|
|
179
|
+
- [ ] Trigger continuous-learning if patterns detected
|
|
180
|
+
- [ ] Document in knowledge base if novel approach
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Best Practices
|
|
185
|
+
|
|
186
|
+
1. **Logical Order**: Discovery → Design → Implementation → Testing
|
|
187
|
+
2. **Share Context**: Pass relevant findings to subsequent agents
|
|
188
|
+
3. **Single Synthesis**: One unified report, not separate outputs
|
|
189
|
+
4. **Verify Changes**: Always include tdd-guide for code modifications
|
|
190
|
+
5. **Maintain Governance**: Apply Trust-Grade protocols throughout
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Key Benefits
|
|
195
|
+
|
|
196
|
+
- ✅ **Single session** - All agents share context
|
|
197
|
+
- ✅ **AI-controlled** - Orchestrated autonomously
|
|
198
|
+
- ✅ **Trust-Grade** - Governance maintained throughout
|
|
199
|
+
- ✅ **Resume support** - Can continue previous agent work
|
|
200
|
+
- ✅ **Context passing** - Findings flow between agents
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-profiling
|
|
3
|
+
description: Performance profiling principles. Core Web Vitals, measurement, analysis, and optimization.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Performance Profiling
|
|
9
|
+
|
|
10
|
+
> Measure, analyze, optimize — in that order.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 1. Core Web Vitals
|
|
15
|
+
|
|
16
|
+
### Targets
|
|
17
|
+
|
|
18
|
+
| Metric | Good | Poor | Measures |
|
|
19
|
+
| ------- | ------- | ------- | ------------- |
|
|
20
|
+
| **LCP** | < 2.5s | > 4.0s | Loading |
|
|
21
|
+
| **INP** | < 200ms | > 500ms | Interactivity |
|
|
22
|
+
| **CLS** | < 0.1 | > 0.25 | Stability |
|
|
23
|
+
|
|
24
|
+
### When to Measure
|
|
25
|
+
|
|
26
|
+
| Stage | Tool |
|
|
27
|
+
| ----------- | -------------------------- |
|
|
28
|
+
| Development | Local Lighthouse |
|
|
29
|
+
| CI/CD | Lighthouse CI |
|
|
30
|
+
| Production | RUM (Real User Monitoring) |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Profiling Workflow
|
|
35
|
+
|
|
36
|
+
### The 4-Step Process
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
1. BASELINE → Measure current state
|
|
40
|
+
2. IDENTIFY → Find the bottleneck
|
|
41
|
+
3. FIX → Make targeted change
|
|
42
|
+
4. VALIDATE → Confirm improvement
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Tool Selection
|
|
46
|
+
|
|
47
|
+
| Problem | Tool |
|
|
48
|
+
| ----------- | -------------------- |
|
|
49
|
+
| Page load | Lighthouse |
|
|
50
|
+
| Bundle size | Bundle analyzer |
|
|
51
|
+
| Runtime | DevTools Performance |
|
|
52
|
+
| Memory | DevTools Memory |
|
|
53
|
+
| Network | DevTools Network |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 3. Bundle Analysis
|
|
58
|
+
|
|
59
|
+
### What to Look For
|
|
60
|
+
|
|
61
|
+
| Issue | Indicator |
|
|
62
|
+
| ------------------ | ------------------ |
|
|
63
|
+
| Large dependencies | Top of bundle |
|
|
64
|
+
| Duplicate code | Multiple chunks |
|
|
65
|
+
| Unused code | Low coverage |
|
|
66
|
+
| Missing splits | Single large chunk |
|
|
67
|
+
|
|
68
|
+
### Optimization Actions
|
|
69
|
+
|
|
70
|
+
| Finding | Action |
|
|
71
|
+
| -------------- | ----------------------- |
|
|
72
|
+
| Big library | Import specific modules |
|
|
73
|
+
| Duplicate deps | Dedupe, update versions |
|
|
74
|
+
| Route in main | Code split |
|
|
75
|
+
| Unused exports | Tree shake |
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 4. Runtime Profiling
|
|
80
|
+
|
|
81
|
+
### Performance Tab
|
|
82
|
+
|
|
83
|
+
| Pattern | Meaning |
|
|
84
|
+
| ------------------ | -------------------- |
|
|
85
|
+
| Long tasks (>50ms) | UI blocking |
|
|
86
|
+
| Many small tasks | Batching opportunity |
|
|
87
|
+
| Layout/paint | Rendering bottleneck |
|
|
88
|
+
| Script | JS execution |
|
|
89
|
+
|
|
90
|
+
### Memory Tab
|
|
91
|
+
|
|
92
|
+
| Pattern | Meaning |
|
|
93
|
+
| -------------- | ---------------- |
|
|
94
|
+
| Growing heap | Possible leak |
|
|
95
|
+
| Large retained | Check references |
|
|
96
|
+
| Detached DOM | Not cleaned up |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## 5. Common Bottlenecks
|
|
101
|
+
|
|
102
|
+
| Symptom | Likely Cause |
|
|
103
|
+
| ------------------ | ------------------------- |
|
|
104
|
+
| Slow initial load | Large JS, render blocking |
|
|
105
|
+
| Slow interactions | Heavy event handlers |
|
|
106
|
+
| Jank during scroll | Layout thrashing |
|
|
107
|
+
| Growing memory | Leaks, retained refs |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 6. Quick Win Priorities
|
|
112
|
+
|
|
113
|
+
| Priority | Action | Impact |
|
|
114
|
+
| -------- | ------------------- | ------ |
|
|
115
|
+
| 1 | Enable compression | High |
|
|
116
|
+
| 2 | Lazy load images | High |
|
|
117
|
+
| 3 | Code split routes | High |
|
|
118
|
+
| 4 | Cache static assets | Medium |
|
|
119
|
+
| 5 | Optimize images | Medium |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 7. Anti-Patterns
|
|
124
|
+
|
|
125
|
+
| ❌ Don't | ✅ Do |
|
|
126
|
+
| ----------------- | -------------------- |
|
|
127
|
+
| Guess at problems | Profile first |
|
|
128
|
+
| Micro-optimize | Fix biggest issue |
|
|
129
|
+
| Optimize early | Optimize when needed |
|
|
130
|
+
| Ignore real users | Use RUM data |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
> **Remember:** The fastest code is code that doesn't run. Remove before optimizing.
|