@musashishao/agent-kit 1.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/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +487 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/search.py +76 -0
- package/.agent/ARCHITECTURE.md +225 -0
- package/.agent/CONTEXT.md +229 -0
- package/.agent/FEATURE_ROADMAP.md +435 -0
- package/.agent/PROMPT_TEMPLATES.md +261 -0
- package/.agent/agents/backend-specialist.md +263 -0
- package/.agent/agents/database-architect.md +226 -0
- package/.agent/agents/debugger.md +225 -0
- package/.agent/agents/devops-engineer.md +242 -0
- package/.agent/agents/documentation-writer.md +104 -0
- package/.agent/agents/explorer-agent.md +73 -0
- package/.agent/agents/frontend-specialist.md +556 -0
- package/.agent/agents/game-developer.md +162 -0
- package/.agent/agents/mobile-developer.md +377 -0
- package/.agent/agents/orchestrator.md +416 -0
- package/.agent/agents/penetration-tester.md +188 -0
- package/.agent/agents/performance-optimizer.md +187 -0
- package/.agent/agents/project-planner.md +403 -0
- package/.agent/agents/security-auditor.md +170 -0
- package/.agent/agents/seo-specialist.md +111 -0
- package/.agent/agents/test-engineer.md +158 -0
- package/.agent/rules/GEMINI.md +251 -0
- package/.agent/skills/api-patterns/SKILL.md +81 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +40 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
- package/.agent/skills/architecture/SKILL.md +55 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/bash-linux/SKILL.md +199 -0
- package/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/.agent/skills/brainstorming/SKILL.md +163 -0
- package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/.agent/skills/clean-code/SKILL.md +201 -0
- package/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/.agent/skills/database-design/SKILL.md +52 -0
- package/.agent/skills/database-design/database-selection.md +43 -0
- package/.agent/skills/database-design/indexing.md +39 -0
- package/.agent/skills/database-design/migrations.md +48 -0
- package/.agent/skills/database-design/optimization.md +36 -0
- package/.agent/skills/database-design/orm-selection.md +30 -0
- package/.agent/skills/database-design/schema-design.md +56 -0
- package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/docker-expert/SKILL.md +409 -0
- package/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/.agent/skills/frontend-design/SKILL.md +396 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +311 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +541 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +172 -0
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/.agent/skills/mobile-design/SKILL.md +394 -0
- package/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/.agent/skills/mobile-design/platform-android.md +666 -0
- package/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/.agent/skills/nestjs-expert/SKILL.md +552 -0
- package/.agent/skills/nextjs-best-practices/SKILL.md +203 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.agent/skills/plan-writing/SKILL.md +152 -0
- package/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/.agent/skills/prisma-expert/SKILL.md +355 -0
- package/.agent/skills/python-patterns/SKILL.md +441 -0
- package/.agent/skills/react-patterns/SKILL.md +198 -0
- package/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/.agent/skills/server-management/SKILL.md +161 -0
- package/.agent/skills/systematic-debugging/SKILL.md +109 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.agent/skills/typescript-expert/SKILL.md +429 -0
- package/.agent/skills/typescript-expert/references/tsconfig-strict.json +92 -0
- package/.agent/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/.agent/skills/typescript-expert/references/utility-types.ts +335 -0
- package/.agent/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +351 -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/prompts.csv +24 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -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/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 +59 -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 +257 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +487 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +76 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/orchestrate.md +237 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +80 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +231 -0
- package/LICENSE +21 -0
- package/README.md +101 -0
- package/bin/cli.js +235 -0
- package/index.js +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nextjs-static
|
|
3
|
+
description: Next.js static site template principles. Landing pages, portfolios, marketing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Next.js Static Site Template
|
|
7
|
+
|
|
8
|
+
## Tech Stack
|
|
9
|
+
|
|
10
|
+
| Component | Technology |
|
|
11
|
+
|-----------|------------|
|
|
12
|
+
| Framework | Next.js 14 (Static Export) |
|
|
13
|
+
| Language | TypeScript |
|
|
14
|
+
| Styling | Tailwind CSS |
|
|
15
|
+
| Animations | Framer Motion |
|
|
16
|
+
| Icons | Lucide React |
|
|
17
|
+
| SEO | Next SEO |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Directory Structure
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
project-name/
|
|
25
|
+
├── src/
|
|
26
|
+
│ ├── app/
|
|
27
|
+
│ │ ├── layout.tsx
|
|
28
|
+
│ │ ├── page.tsx # Landing
|
|
29
|
+
│ │ ├── about/
|
|
30
|
+
│ │ ├── contact/
|
|
31
|
+
│ │ └── blog/
|
|
32
|
+
│ ├── components/
|
|
33
|
+
│ │ ├── layout/ # Header, Footer
|
|
34
|
+
│ │ ├── sections/ # Hero, Features, CTA
|
|
35
|
+
│ │ └── ui/
|
|
36
|
+
│ └── lib/
|
|
37
|
+
├── content/ # Markdown content
|
|
38
|
+
├── public/
|
|
39
|
+
└── next.config.js
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Static Export Config
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
// next.config.js
|
|
48
|
+
const nextConfig = {
|
|
49
|
+
output: 'export',
|
|
50
|
+
images: { unoptimized: true },
|
|
51
|
+
trailingSlash: true,
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Landing Page Sections
|
|
58
|
+
|
|
59
|
+
| Section | Purpose |
|
|
60
|
+
|---------|---------|
|
|
61
|
+
| Hero | Main headline, CTA |
|
|
62
|
+
| Features | Product benefits |
|
|
63
|
+
| Testimonials | Social proof |
|
|
64
|
+
| Pricing | Plans |
|
|
65
|
+
| CTA | Final conversion |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Animation Patterns
|
|
70
|
+
|
|
71
|
+
| Pattern | Use |
|
|
72
|
+
|---------|-----|
|
|
73
|
+
| Fade up | Content entry |
|
|
74
|
+
| Stagger | List items |
|
|
75
|
+
| Scroll reveal | On viewport |
|
|
76
|
+
| Hover | Interactive feedback |
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Setup Steps
|
|
81
|
+
|
|
82
|
+
1. `npx create-next-app {{name}} --typescript --tailwind --app`
|
|
83
|
+
2. Install: `npm install framer-motion lucide-react next-seo`
|
|
84
|
+
3. Configure static export
|
|
85
|
+
4. Create sections
|
|
86
|
+
5. `npm run dev`
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Deployment
|
|
91
|
+
|
|
92
|
+
| Platform | Method |
|
|
93
|
+
|----------|--------|
|
|
94
|
+
| Vercel | Auto |
|
|
95
|
+
| Netlify | Auto |
|
|
96
|
+
| GitHub Pages | gh-pages branch |
|
|
97
|
+
| Any host | Upload `out` folder |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Best Practices
|
|
102
|
+
|
|
103
|
+
- Static export for maximum performance
|
|
104
|
+
- Framer Motion for premium animations
|
|
105
|
+
- Responsive mobile-first design
|
|
106
|
+
- SEO metadata on every page
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nuxt-app
|
|
3
|
+
description: Nuxt 3 full-stack template. Vue 3, Pinia, Tailwind, Prisma.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Nuxt 3 Full-Stack Template
|
|
7
|
+
|
|
8
|
+
## Tech Stack
|
|
9
|
+
|
|
10
|
+
| Component | Technology |
|
|
11
|
+
|-----------|------------|
|
|
12
|
+
| Framework | Nuxt 3 |
|
|
13
|
+
| Language | TypeScript |
|
|
14
|
+
| UI | Vue 3 (Composition API) |
|
|
15
|
+
| State | Pinia |
|
|
16
|
+
| Database | PostgreSQL + Prisma |
|
|
17
|
+
| Styling | Tailwind CSS |
|
|
18
|
+
| Validation | Zod |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Directory Structure
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
project-name/
|
|
26
|
+
├── prisma/
|
|
27
|
+
│ └── schema.prisma
|
|
28
|
+
├── server/
|
|
29
|
+
│ ├── api/
|
|
30
|
+
│ │ └── [resource]/
|
|
31
|
+
│ │ └── index.ts
|
|
32
|
+
│ └── utils/
|
|
33
|
+
│ └── db.ts # Prisma client
|
|
34
|
+
├── composables/
|
|
35
|
+
│ └── useAuth.ts
|
|
36
|
+
├── stores/
|
|
37
|
+
│ └── user.ts # Pinia store
|
|
38
|
+
├── components/
|
|
39
|
+
│ └── ui/
|
|
40
|
+
├── pages/
|
|
41
|
+
│ ├── index.vue
|
|
42
|
+
│ └── [...slug].vue
|
|
43
|
+
├── layouts/
|
|
44
|
+
│ └── default.vue
|
|
45
|
+
├── assets/
|
|
46
|
+
│ └── css/
|
|
47
|
+
│ └── main.css
|
|
48
|
+
├── .env.example
|
|
49
|
+
├── nuxt.config.ts
|
|
50
|
+
└── package.json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Key Concepts
|
|
56
|
+
|
|
57
|
+
| Concept | Description |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| Auto-imports | Components, composables, utils |
|
|
60
|
+
| File-based routing | pages/ → routes |
|
|
61
|
+
| Server Routes | server/api/ → API endpoints |
|
|
62
|
+
| Composables | Reusable reactive logic |
|
|
63
|
+
| Pinia | State management |
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Environment Variables
|
|
68
|
+
|
|
69
|
+
| Variable | Purpose |
|
|
70
|
+
|----------|---------|
|
|
71
|
+
| DATABASE_URL | Prisma connection |
|
|
72
|
+
| NUXT_PUBLIC_APP_URL | Public URL |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Setup Steps
|
|
77
|
+
|
|
78
|
+
1. `npx nuxi@latest init {{name}}`
|
|
79
|
+
2. `cd {{name}}`
|
|
80
|
+
3. `npm install @pinia/nuxt @prisma/client prisma zod`
|
|
81
|
+
4. `npm install -D @nuxtjs/tailwindcss`
|
|
82
|
+
5. Add modules to `nuxt.config.ts`:
|
|
83
|
+
```ts
|
|
84
|
+
modules: ['@pinia/nuxt', '@nuxtjs/tailwindcss']
|
|
85
|
+
```
|
|
86
|
+
6. `npx prisma init`
|
|
87
|
+
7. Configure schema
|
|
88
|
+
8. `npx prisma db push`
|
|
89
|
+
9. `npm run dev`
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Best Practices
|
|
94
|
+
|
|
95
|
+
- Use `<script setup>` for components
|
|
96
|
+
- Composables for reusable logic
|
|
97
|
+
- Pinia stores in `stores/` folder
|
|
98
|
+
- Server routes for API logic
|
|
99
|
+
- Auto-import for clean code
|
|
100
|
+
- TypeScript for type safety
|
|
101
|
+
- See `@[skills/vue-expert]` for Vue patterns
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: python-fastapi
|
|
3
|
+
description: FastAPI REST API template principles. SQLAlchemy, Pydantic, Alembic.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FastAPI API Template
|
|
7
|
+
|
|
8
|
+
## Tech Stack
|
|
9
|
+
|
|
10
|
+
| Component | Technology |
|
|
11
|
+
|-----------|------------|
|
|
12
|
+
| Framework | FastAPI |
|
|
13
|
+
| Language | Python 3.11+ |
|
|
14
|
+
| ORM | SQLAlchemy 2.0 |
|
|
15
|
+
| Validation | Pydantic v2 |
|
|
16
|
+
| Migrations | Alembic |
|
|
17
|
+
| Auth | JWT + passlib |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Directory Structure
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
project-name/
|
|
25
|
+
├── alembic/ # Migrations
|
|
26
|
+
├── app/
|
|
27
|
+
│ ├── main.py # FastAPI app
|
|
28
|
+
│ ├── config.py # Settings
|
|
29
|
+
│ ├── database.py # DB connection
|
|
30
|
+
│ ├── models/ # SQLAlchemy models
|
|
31
|
+
│ ├── schemas/ # Pydantic schemas
|
|
32
|
+
│ ├── routers/ # API routes
|
|
33
|
+
│ ├── services/ # Business logic
|
|
34
|
+
│ ├── dependencies/ # DI
|
|
35
|
+
│ └── utils/
|
|
36
|
+
├── tests/
|
|
37
|
+
├── .env.example
|
|
38
|
+
└── requirements.txt
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Key Concepts
|
|
44
|
+
|
|
45
|
+
| Concept | Description |
|
|
46
|
+
|---------|-------------|
|
|
47
|
+
| Async | async/await throughout |
|
|
48
|
+
| Dependency Injection | FastAPI Depends |
|
|
49
|
+
| Pydantic v2 | Validation + serialization |
|
|
50
|
+
| SQLAlchemy 2.0 | Async sessions |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## API Structure
|
|
55
|
+
|
|
56
|
+
| Layer | Responsibility |
|
|
57
|
+
|-------|---------------|
|
|
58
|
+
| Routers | HTTP handling |
|
|
59
|
+
| Dependencies | Auth, validation |
|
|
60
|
+
| Services | Business logic |
|
|
61
|
+
| Models | Database entities |
|
|
62
|
+
| Schemas | Request/response |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Setup Steps
|
|
67
|
+
|
|
68
|
+
1. `python -m venv venv`
|
|
69
|
+
2. `source venv/bin/activate`
|
|
70
|
+
3. `pip install fastapi uvicorn sqlalchemy alembic pydantic`
|
|
71
|
+
4. Create `.env`
|
|
72
|
+
5. `alembic upgrade head`
|
|
73
|
+
6. `uvicorn app.main:app --reload`
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Best Practices
|
|
78
|
+
|
|
79
|
+
- Use async everywhere
|
|
80
|
+
- Pydantic v2 for validation
|
|
81
|
+
- SQLAlchemy 2.0 async sessions
|
|
82
|
+
- Alembic for migrations
|
|
83
|
+
- pytest-asyncio for tests
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-native-app
|
|
3
|
+
description: React Native mobile app template principles. Expo, TypeScript, navigation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# React Native App Template
|
|
7
|
+
|
|
8
|
+
## Tech Stack
|
|
9
|
+
|
|
10
|
+
| Component | Technology |
|
|
11
|
+
|-----------|------------|
|
|
12
|
+
| Framework | React Native + Expo |
|
|
13
|
+
| Language | TypeScript |
|
|
14
|
+
| Navigation | Expo Router |
|
|
15
|
+
| State | Zustand + React Query |
|
|
16
|
+
| Styling | NativeWind |
|
|
17
|
+
| Testing | Jest + RNTL |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Directory Structure
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
project-name/
|
|
25
|
+
├── app/ # Expo Router (file-based)
|
|
26
|
+
│ ├── _layout.tsx # Root layout
|
|
27
|
+
│ ├── index.tsx # Home
|
|
28
|
+
│ ├── (tabs)/ # Tab navigation
|
|
29
|
+
│ └── [id].tsx # Dynamic route
|
|
30
|
+
├── components/
|
|
31
|
+
│ ├── ui/ # Reusable
|
|
32
|
+
│ └── features/
|
|
33
|
+
├── hooks/
|
|
34
|
+
├── lib/
|
|
35
|
+
│ ├── api.ts
|
|
36
|
+
│ └── storage.ts
|
|
37
|
+
├── store/
|
|
38
|
+
├── constants/
|
|
39
|
+
└── app.json
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Navigation Patterns
|
|
45
|
+
|
|
46
|
+
| Pattern | Use |
|
|
47
|
+
|---------|-----|
|
|
48
|
+
| Stack | Page hierarchy |
|
|
49
|
+
| Tabs | Bottom navigation |
|
|
50
|
+
| Drawer | Side menu |
|
|
51
|
+
| Modal | Overlay screens |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## State Management
|
|
56
|
+
|
|
57
|
+
| Type | Tool |
|
|
58
|
+
|------|------|
|
|
59
|
+
| Local | Zustand |
|
|
60
|
+
| Server | React Query |
|
|
61
|
+
| Forms | React Hook Form |
|
|
62
|
+
| Storage | Expo SecureStore |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Key Packages
|
|
67
|
+
|
|
68
|
+
| Package | Purpose |
|
|
69
|
+
|---------|---------|
|
|
70
|
+
| expo-router | File-based routing |
|
|
71
|
+
| zustand | Local state |
|
|
72
|
+
| @tanstack/react-query | Server state |
|
|
73
|
+
| nativewind | Tailwind styling |
|
|
74
|
+
| expo-secure-store | Secure storage |
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Setup Steps
|
|
79
|
+
|
|
80
|
+
1. `npx create-expo-app {{name}} -t expo-template-blank-typescript`
|
|
81
|
+
2. `npx expo install expo-router react-native-safe-area-context`
|
|
82
|
+
3. Install state: `npm install zustand @tanstack/react-query`
|
|
83
|
+
4. `npx expo start`
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Best Practices
|
|
88
|
+
|
|
89
|
+
- Expo Router for navigation
|
|
90
|
+
- Zustand for local, React Query for server state
|
|
91
|
+
- NativeWind for consistent styling
|
|
92
|
+
- Expo SecureStore for tokens
|
|
93
|
+
- Test on both iOS and Android
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architecture
|
|
3
|
+
description: Architectural decision-making framework. Requirements analysis, trade-off evaluation, ADR documentation. Use when making architecture decisions or analyzing system design.
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Architecture Decision Framework
|
|
8
|
+
|
|
9
|
+
> "Requirements drive architecture. Trade-offs inform decisions. ADRs capture rationale."
|
|
10
|
+
|
|
11
|
+
## 🎯 Selective Reading Rule
|
|
12
|
+
|
|
13
|
+
**Read ONLY files relevant to the request!** Check the content map, find what you need.
|
|
14
|
+
|
|
15
|
+
| File | Description | When to Read |
|
|
16
|
+
|------|-------------|--------------|
|
|
17
|
+
| `context-discovery.md` | Questions to ask, project classification | Starting architecture design |
|
|
18
|
+
| `trade-off-analysis.md` | ADR templates, trade-off framework | Documenting decisions |
|
|
19
|
+
| `pattern-selection.md` | Decision trees, anti-patterns | Choosing patterns |
|
|
20
|
+
| `examples.md` | MVP, SaaS, Enterprise examples | Reference implementations |
|
|
21
|
+
| `patterns-reference.md` | Quick lookup for patterns | Pattern comparison |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🔗 Related Skills
|
|
26
|
+
|
|
27
|
+
| Skill | Use For |
|
|
28
|
+
|-------|---------|
|
|
29
|
+
| `@[skills/database-design]` | Database schema design |
|
|
30
|
+
| `@[skills/api-patterns]` | API design patterns |
|
|
31
|
+
| `@[skills/deployment-procedures]` | Deployment architecture |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Core Principle
|
|
36
|
+
|
|
37
|
+
**"Simplicity is the ultimate sophistication."**
|
|
38
|
+
|
|
39
|
+
- Start simple
|
|
40
|
+
- Add complexity ONLY when proven necessary
|
|
41
|
+
- You can always add patterns later
|
|
42
|
+
- Removing complexity is MUCH harder than adding it
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Validation Checklist
|
|
47
|
+
|
|
48
|
+
Before finalizing architecture:
|
|
49
|
+
|
|
50
|
+
- [ ] Requirements clearly understood
|
|
51
|
+
- [ ] Constraints identified
|
|
52
|
+
- [ ] Each decision has trade-off analysis
|
|
53
|
+
- [ ] Simpler alternatives considered
|
|
54
|
+
- [ ] ADRs written for significant decisions
|
|
55
|
+
- [ ] Team expertise matches chosen patterns
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Context Discovery
|
|
2
|
+
|
|
3
|
+
> Before suggesting any architecture, gather context.
|
|
4
|
+
|
|
5
|
+
## Question Hierarchy (Ask User FIRST)
|
|
6
|
+
|
|
7
|
+
1. **Scale**
|
|
8
|
+
- How many users? (10, 1K, 100K, 1M+)
|
|
9
|
+
- Data volume? (MB, GB, TB)
|
|
10
|
+
- Transaction rate? (per second/minute)
|
|
11
|
+
|
|
12
|
+
2. **Team**
|
|
13
|
+
- Solo developer or team?
|
|
14
|
+
- Team size and expertise?
|
|
15
|
+
- Distributed or co-located?
|
|
16
|
+
|
|
17
|
+
3. **Timeline**
|
|
18
|
+
- MVP/Prototype or long-term product?
|
|
19
|
+
- Time to market pressure?
|
|
20
|
+
|
|
21
|
+
4. **Domain**
|
|
22
|
+
- CRUD-heavy or business logic complex?
|
|
23
|
+
- Real-time requirements?
|
|
24
|
+
- Compliance/regulations?
|
|
25
|
+
|
|
26
|
+
5. **Constraints**
|
|
27
|
+
- Budget limitations?
|
|
28
|
+
- Legacy systems to integrate?
|
|
29
|
+
- Technology stack preferences?
|
|
30
|
+
|
|
31
|
+
## Project Classification Matrix
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
MVP SaaS Enterprise
|
|
35
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
36
|
+
│ Scale │ <1K │ 1K-100K │ 100K+ │
|
|
37
|
+
│ Team │ Solo │ 2-10 │ 10+ │
|
|
38
|
+
│ Timeline │ Fast (weeks) │ Medium (months)│ Long (years)│
|
|
39
|
+
│ Architecture │ Simple │ Modular │ Distributed │
|
|
40
|
+
│ Patterns │ Minimal │ Selective │ Comprehensive│
|
|
41
|
+
│ Example │ Next.js API │ NestJS │ Microservices│
|
|
42
|
+
└─────────────────────────────────────────────────────────────┘
|
|
43
|
+
```
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Architecture Examples
|
|
2
|
+
|
|
3
|
+
> Real-world architecture decisions by project type.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Example 1: MVP E-commerce (Solo Developer)
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
Requirements:
|
|
11
|
+
- <1000 users initially
|
|
12
|
+
- Solo developer
|
|
13
|
+
- Fast to market (8 weeks)
|
|
14
|
+
- Budget-conscious
|
|
15
|
+
|
|
16
|
+
Architecture Decisions:
|
|
17
|
+
App Structure: Monolith (simpler for solo)
|
|
18
|
+
Framework: Next.js (full-stack, fast)
|
|
19
|
+
Data Layer: Prisma direct (no over-abstraction)
|
|
20
|
+
Authentication: JWT (simpler than OAuth)
|
|
21
|
+
Payment: Stripe (hosted solution)
|
|
22
|
+
Database: PostgreSQL (ACID for orders)
|
|
23
|
+
|
|
24
|
+
Trade-offs Accepted:
|
|
25
|
+
- Monolith → Can't scale independently (team doesn't justify it)
|
|
26
|
+
- No Repository → Less testable (simple CRUD doesn't need it)
|
|
27
|
+
- JWT → No social login initially (can add later)
|
|
28
|
+
|
|
29
|
+
Future Migration Path:
|
|
30
|
+
- Users > 10K → Extract payment service
|
|
31
|
+
- Team > 3 → Add Repository pattern
|
|
32
|
+
- Social login requested → Add OAuth
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Example 2: SaaS Product (5-10 Developers)
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
Requirements:
|
|
41
|
+
- 1K-100K users
|
|
42
|
+
- 5-10 developers
|
|
43
|
+
- Long-term (12+ months)
|
|
44
|
+
- Multiple domains (billing, users, core)
|
|
45
|
+
|
|
46
|
+
Architecture Decisions:
|
|
47
|
+
App Structure: Modular Monolith (team size optimal)
|
|
48
|
+
Framework: NestJS (modular by design)
|
|
49
|
+
Data Layer: Repository pattern (testing, flexibility)
|
|
50
|
+
Domain Model: Partial DDD (rich entities)
|
|
51
|
+
Authentication: OAuth + JWT
|
|
52
|
+
Caching: Redis
|
|
53
|
+
Database: PostgreSQL
|
|
54
|
+
|
|
55
|
+
Trade-offs Accepted:
|
|
56
|
+
- Modular Monolith → Some module coupling (microservices not justified)
|
|
57
|
+
- Partial DDD → No full aggregates (no domain experts)
|
|
58
|
+
- RabbitMQ later → Initial synchronous (add when proven needed)
|
|
59
|
+
|
|
60
|
+
Migration Path:
|
|
61
|
+
- Team > 10 → Consider microservices
|
|
62
|
+
- Domains conflict → Extract bounded contexts
|
|
63
|
+
- Read performance issues → Add CQRS
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Example 3: Enterprise (100K+ Users)
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
Requirements:
|
|
72
|
+
- 100K+ users
|
|
73
|
+
- 10+ developers
|
|
74
|
+
- Multiple business domains
|
|
75
|
+
- Different scaling needs
|
|
76
|
+
- 24/7 availability
|
|
77
|
+
|
|
78
|
+
Architecture Decisions:
|
|
79
|
+
App Structure: Microservices (independent scale)
|
|
80
|
+
API Gateway: Kong/AWS API GW
|
|
81
|
+
Domain Model: Full DDD
|
|
82
|
+
Consistency: Event-driven (eventual OK)
|
|
83
|
+
Message Bus: Kafka
|
|
84
|
+
Authentication: OAuth + SAML (enterprise SSO)
|
|
85
|
+
Database: Polyglot (right tool per job)
|
|
86
|
+
CQRS: Selected services
|
|
87
|
+
|
|
88
|
+
Operational Requirements:
|
|
89
|
+
- Service mesh (Istio/Linkerd)
|
|
90
|
+
- Distributed tracing (Jaeger/Tempo)
|
|
91
|
+
- Centralized logging (ELK/Loki)
|
|
92
|
+
- Circuit breakers (Resilience4j)
|
|
93
|
+
- Kubernetes/Helm
|
|
94
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Pattern Selection Guidelines
|
|
2
|
+
|
|
3
|
+
> Decision trees for choosing architectural patterns.
|
|
4
|
+
|
|
5
|
+
## Main Decision Tree
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
START: What's your MAIN concern?
|
|
9
|
+
|
|
10
|
+
┌─ Data Access Complexity?
|
|
11
|
+
│ ├─ HIGH (complex queries, testing needed)
|
|
12
|
+
│ │ → Repository Pattern + Unit of Work
|
|
13
|
+
│ │ VALIDATE: Will data source change frequently?
|
|
14
|
+
│ │ ├─ YES → Repository worth the indirection
|
|
15
|
+
│ │ └─ NO → Consider simpler ORM direct access
|
|
16
|
+
│ └─ LOW (simple CRUD, single database)
|
|
17
|
+
│ → ORM directly (Prisma, Drizzle)
|
|
18
|
+
│ Simpler = Better, Faster
|
|
19
|
+
│
|
|
20
|
+
├─ Business Rules Complexity?
|
|
21
|
+
│ ├─ HIGH (domain logic, rules vary by context)
|
|
22
|
+
│ │ → Domain-Driven Design
|
|
23
|
+
│ │ VALIDATE: Do you have domain experts on team?
|
|
24
|
+
│ │ ├─ YES → Full DDD (Aggregates, Value Objects)
|
|
25
|
+
│ │ └─ NO → Partial DDD (rich entities, clear boundaries)
|
|
26
|
+
│ └─ LOW (mostly CRUD, simple validation)
|
|
27
|
+
│ → Transaction Script pattern
|
|
28
|
+
│ Simpler = Better, Faster
|
|
29
|
+
│
|
|
30
|
+
├─ Independent Scaling Needed?
|
|
31
|
+
│ ├─ YES (different components scale differently)
|
|
32
|
+
│ │ → Microservices WORTH the complexity
|
|
33
|
+
│ │ REQUIREMENTS (ALL must be true):
|
|
34
|
+
│ │ - Clear domain boundaries
|
|
35
|
+
│ │ - Team > 10 developers
|
|
36
|
+
│ │ - Different scaling needs per service
|
|
37
|
+
│ │ IF NOT ALL MET → Modular Monolith instead
|
|
38
|
+
│ └─ NO (everything scales together)
|
|
39
|
+
│ → Modular Monolith
|
|
40
|
+
│ Can extract services later when proven needed
|
|
41
|
+
│
|
|
42
|
+
└─ Real-time Requirements?
|
|
43
|
+
├─ HIGH (immediate updates, multi-user sync)
|
|
44
|
+
│ → Event-Driven Architecture
|
|
45
|
+
│ → Message Queue (RabbitMQ, Redis, Kafka)
|
|
46
|
+
│ VALIDATE: Can you handle eventual consistency?
|
|
47
|
+
│ ├─ YES → Event-driven valid
|
|
48
|
+
│ └─ NO → Synchronous with polling
|
|
49
|
+
└─ LOW (eventual consistency acceptable)
|
|
50
|
+
→ Synchronous (REST/GraphQL)
|
|
51
|
+
Simpler = Better, Faster
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## The 3 Questions (Before ANY Pattern)
|
|
55
|
+
|
|
56
|
+
1. **Problem Solved**: What SPECIFIC problem does this pattern solve?
|
|
57
|
+
2. **Simpler Alternative**: Is there a simpler solution?
|
|
58
|
+
3. **Deferred Complexity**: Can we add this LATER when needed?
|
|
59
|
+
|
|
60
|
+
## Red Flags (Anti-patterns)
|
|
61
|
+
|
|
62
|
+
| Pattern | Anti-pattern | Simpler Alternative |
|
|
63
|
+
|---------|-------------|-------------------|
|
|
64
|
+
| Microservices | Premature splitting | Start monolith, extract later |
|
|
65
|
+
| Clean/Hexagonal | Over-abstraction | Concrete first, interfaces later |
|
|
66
|
+
| Event Sourcing | Over-engineering | Append-only audit log |
|
|
67
|
+
| CQRS | Unnecessary complexity | Single model |
|
|
68
|
+
| Repository | YAGNI for simple CRUD | ORM direct access |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Architecture Patterns Reference
|
|
2
|
+
|
|
3
|
+
> Quick reference for common patterns with usage guidance.
|
|
4
|
+
|
|
5
|
+
## Data Access Patterns
|
|
6
|
+
|
|
7
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
8
|
+
|---------|-------------|-----------------|------------|
|
|
9
|
+
| **Active Record** | Simple CRUD, rapid prototyping | Complex queries, multiple sources | Low |
|
|
10
|
+
| **Repository** | Testing needed, multiple sources | Simple CRUD, single database | Medium |
|
|
11
|
+
| **Unit of Work** | Complex transactions | Simple operations | High |
|
|
12
|
+
| **Data Mapper** | Complex domain, performance | Simple CRUD, rapid dev | High |
|
|
13
|
+
|
|
14
|
+
## Domain Logic Patterns
|
|
15
|
+
|
|
16
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
17
|
+
|---------|-------------|-----------------|------------|
|
|
18
|
+
| **Transaction Script** | Simple CRUD, procedural | Complex business rules | Low |
|
|
19
|
+
| **Table Module** | Record-based logic | Rich behavior needed | Low |
|
|
20
|
+
| **Domain Model** | Complex business logic | Simple CRUD | Medium |
|
|
21
|
+
| **DDD (Full)** | Complex domain, domain experts | Simple domain, no experts | High |
|
|
22
|
+
|
|
23
|
+
## Distributed System Patterns
|
|
24
|
+
|
|
25
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
26
|
+
|---------|-------------|-----------------|------------|
|
|
27
|
+
| **Modular Monolith** | Small teams, unclear boundaries | Clear contexts, different scales | Medium |
|
|
28
|
+
| **Microservices** | Different scales, large teams | Small teams, simple domain | Very High |
|
|
29
|
+
| **Event-Driven** | Real-time, loose coupling | Simple workflows, strong consistency | High |
|
|
30
|
+
| **CQRS** | Read/write performance diverges | Simple CRUD, same model | High |
|
|
31
|
+
| **Saga** | Distributed transactions | Single database, simple ACID | High |
|
|
32
|
+
|
|
33
|
+
## API Patterns
|
|
34
|
+
|
|
35
|
+
| Pattern | When to Use | When NOT to Use | Complexity |
|
|
36
|
+
|---------|-------------|-----------------|------------|
|
|
37
|
+
| **REST** | Standard CRUD, resources | Real-time, complex queries | Low |
|
|
38
|
+
| **GraphQL** | Flexible queries, multiple clients | Simple CRUD, caching needs | Medium |
|
|
39
|
+
| **gRPC** | Internal services, performance | Public APIs, browser clients | Medium |
|
|
40
|
+
| **WebSocket** | Real-time updates | Simple request/response | Medium |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Simplicity Principle
|
|
45
|
+
|
|
46
|
+
**"Start simple, add complexity only when proven necessary."**
|
|
47
|
+
|
|
48
|
+
- You can always add patterns later
|
|
49
|
+
- Removing complexity is MUCH harder than adding it
|
|
50
|
+
- When in doubt, choose simpler option
|