@mrtrinhvn/ag-kit 1.0.11 → 1.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.
Files changed (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/bin/cli.js +62 -0
  4. package/package.json +7 -1
  5. package/template/.agent/rules/GEMINI.md +1 -1
  6. package/template/.agent/skills/regent-orchestrator/SKILL.md +31 -0
  7. package/template/.agent/skills/telegram-bridge/SKILL.md +30 -0
  8. package/.agent/.shared/ui-ux-pro-max/data/charts.csv +0 -26
  9. package/.agent/.shared/ui-ux-pro-max/data/colors.csv +0 -97
  10. package/.agent/.shared/ui-ux-pro-max/data/icons.csv +0 -101
  11. package/.agent/.shared/ui-ux-pro-max/data/landing.csv +0 -31
  12. package/.agent/.shared/ui-ux-pro-max/data/products.csv +0 -97
  13. package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +0 -24
  14. package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +0 -45
  15. package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
  16. package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
  17. package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
  18. package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
  19. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -51
  20. package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
  21. package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
  22. package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +0 -54
  23. package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
  24. package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
  25. package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
  26. package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +0 -50
  27. package/.agent/.shared/ui-ux-pro-max/data/styles.csv +0 -59
  28. package/.agent/.shared/ui-ux-pro-max/data/typography.csv +0 -58
  29. package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +0 -101
  30. package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
  31. package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +0 -31
  32. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
  33. package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
  34. package/.agent/.shared/ui-ux-pro-max/scripts/core.py +0 -258
  35. package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +0 -1067
  36. package/.agent/.shared/ui-ux-pro-max/scripts/search.py +0 -106
  37. package/.agent/ARCHITECTURE.md +0 -288
  38. package/.agent/agents/backend-specialist.md +0 -263
  39. package/.agent/agents/code-archaeologist.md +0 -106
  40. package/.agent/agents/database-architect.md +0 -226
  41. package/.agent/agents/debugger.md +0 -225
  42. package/.agent/agents/devops-engineer.md +0 -242
  43. package/.agent/agents/documentation-writer.md +0 -104
  44. package/.agent/agents/explorer-agent.md +0 -73
  45. package/.agent/agents/frontend-specialist.md +0 -556
  46. package/.agent/agents/game-developer.md +0 -162
  47. package/.agent/agents/mobile-developer.md +0 -377
  48. package/.agent/agents/orchestrator.md +0 -416
  49. package/.agent/agents/penetration-tester.md +0 -188
  50. package/.agent/agents/performance-optimizer.md +0 -187
  51. package/.agent/agents/product-manager.md +0 -112
  52. package/.agent/agents/product-owner.md +0 -95
  53. package/.agent/agents/project-planner.md +0 -406
  54. package/.agent/agents/qa-automation-engineer.md +0 -103
  55. package/.agent/agents/quant-architect.md +0 -31
  56. package/.agent/agents/security-auditor.md +0 -170
  57. package/.agent/agents/seo-specialist.md +0 -111
  58. package/.agent/agents/test-engineer.md +0 -158
  59. package/.agent/mcp_config.json +0 -24
  60. package/.agent/rules/GEMINI.md +0 -280
  61. package/.agent/scripts/auto_preview.py +0 -148
  62. package/.agent/scripts/checklist.py +0 -217
  63. package/.agent/scripts/session_manager.py +0 -120
  64. package/.agent/scripts/verify_all.py +0 -327
  65. package/.agent/skills/api-patterns/SKILL.md +0 -81
  66. package/.agent/skills/api-patterns/api-style.md +0 -42
  67. package/.agent/skills/api-patterns/auth.md +0 -24
  68. package/.agent/skills/api-patterns/documentation.md +0 -26
  69. package/.agent/skills/api-patterns/graphql.md +0 -41
  70. package/.agent/skills/api-patterns/rate-limiting.md +0 -31
  71. package/.agent/skills/api-patterns/response.md +0 -37
  72. package/.agent/skills/api-patterns/rest.md +0 -40
  73. package/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
  74. package/.agent/skills/api-patterns/security-testing.md +0 -122
  75. package/.agent/skills/api-patterns/trpc.md +0 -41
  76. package/.agent/skills/api-patterns/versioning.md +0 -22
  77. package/.agent/skills/app-builder/SKILL.md +0 -75
  78. package/.agent/skills/app-builder/agent-coordination.md +0 -71
  79. package/.agent/skills/app-builder/feature-building.md +0 -53
  80. package/.agent/skills/app-builder/project-detection.md +0 -34
  81. package/.agent/skills/app-builder/scaffolding.md +0 -118
  82. package/.agent/skills/app-builder/tech-stack.md +0 -40
  83. package/.agent/skills/app-builder/templates/SKILL.md +0 -39
  84. package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
  85. package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
  86. package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
  87. package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
  88. package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
  89. package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
  90. package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
  91. package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -82
  92. package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -100
  93. package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -106
  94. package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -101
  95. package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
  96. package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -93
  97. package/.agent/skills/architecture/SKILL.md +0 -55
  98. package/.agent/skills/architecture/context-discovery.md +0 -43
  99. package/.agent/skills/architecture/examples.md +0 -94
  100. package/.agent/skills/architecture/pattern-selection.md +0 -68
  101. package/.agent/skills/architecture/patterns-reference.md +0 -50
  102. package/.agent/skills/architecture/trade-off-analysis.md +0 -77
  103. package/.agent/skills/bash-linux/SKILL.md +0 -199
  104. package/.agent/skills/behavioral-modes/SKILL.md +0 -242
  105. package/.agent/skills/brainstorming/SKILL.md +0 -168
  106. package/.agent/skills/brainstorming/dynamic-questioning.md +0 -350
  107. package/.agent/skills/business-ops/SKILL.md +0 -26
  108. package/.agent/skills/clean-code/SKILL.md +0 -202
  109. package/.agent/skills/cli-generator/SKILL.md +0 -48
  110. package/.agent/skills/code-review-checklist/SKILL.md +0 -109
  111. package/.agent/skills/cognitive-session/SKILL.md +0 -28
  112. package/.agent/skills/data-science/SKILL.md +0 -28
  113. package/.agent/skills/database-design/SKILL.md +0 -52
  114. package/.agent/skills/database-design/database-selection.md +0 -43
  115. package/.agent/skills/database-design/indexing.md +0 -39
  116. package/.agent/skills/database-design/migrations.md +0 -48
  117. package/.agent/skills/database-design/optimization.md +0 -36
  118. package/.agent/skills/database-design/orm-selection.md +0 -30
  119. package/.agent/skills/database-design/schema-design.md +0 -56
  120. package/.agent/skills/database-design/scripts/schema_validator.py +0 -172
  121. package/.agent/skills/deployment-procedures/SKILL.md +0 -241
  122. package/.agent/skills/doc.md +0 -177
  123. package/.agent/skills/documentation-templates/SKILL.md +0 -194
  124. package/.agent/skills/frontend-design/SKILL.md +0 -418
  125. package/.agent/skills/frontend-design/animation-guide.md +0 -331
  126. package/.agent/skills/frontend-design/color-system.md +0 -311
  127. package/.agent/skills/frontend-design/decision-trees.md +0 -418
  128. package/.agent/skills/frontend-design/motion-graphics.md +0 -306
  129. package/.agent/skills/frontend-design/scripts/accessibility_checker.py +0 -183
  130. package/.agent/skills/frontend-design/scripts/ux_audit.py +0 -722
  131. package/.agent/skills/frontend-design/typography-system.md +0 -345
  132. package/.agent/skills/frontend-design/ux-psychology.md +0 -541
  133. package/.agent/skills/frontend-design/visual-effects.md +0 -383
  134. package/.agent/skills/game-development/2d-games/SKILL.md +0 -119
  135. package/.agent/skills/game-development/3d-games/SKILL.md +0 -135
  136. package/.agent/skills/game-development/SKILL.md +0 -167
  137. package/.agent/skills/game-development/game-art/SKILL.md +0 -185
  138. package/.agent/skills/game-development/game-audio/SKILL.md +0 -190
  139. package/.agent/skills/game-development/game-design/SKILL.md +0 -129
  140. package/.agent/skills/game-development/mobile-games/SKILL.md +0 -108
  141. package/.agent/skills/game-development/multiplayer/SKILL.md +0 -132
  142. package/.agent/skills/game-development/pc-games/SKILL.md +0 -144
  143. package/.agent/skills/game-development/vr-ar/SKILL.md +0 -123
  144. package/.agent/skills/game-development/web-games/SKILL.md +0 -150
  145. package/.agent/skills/geo-fundamentals/SKILL.md +0 -156
  146. package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
  147. package/.agent/skills/i18n-localization/SKILL.md +0 -154
  148. package/.agent/skills/i18n-localization/scripts/i18n_checker.py +0 -241
  149. package/.agent/skills/intelligent-routing/SKILL.md +0 -335
  150. package/.agent/skills/knowledge-management/SKILL.md +0 -66
  151. package/.agent/skills/lint-and-validate/SKILL.md +0 -45
  152. package/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -172
  153. package/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
  154. package/.agent/skills/llm-routing-quirks/SKILL.md +0 -41
  155. package/.agent/skills/mcp-builder/SKILL.md +0 -176
  156. package/.agent/skills/memory-architecture/SKILL.md +0 -107
  157. package/.agent/skills/mini-antigravity-injection/SKILL.md +0 -66
  158. package/.agent/skills/mobile-design/SKILL.md +0 -394
  159. package/.agent/skills/mobile-design/decision-trees.md +0 -516
  160. package/.agent/skills/mobile-design/mobile-backend.md +0 -491
  161. package/.agent/skills/mobile-design/mobile-color-system.md +0 -420
  162. package/.agent/skills/mobile-design/mobile-debugging.md +0 -122
  163. package/.agent/skills/mobile-design/mobile-design-thinking.md +0 -357
  164. package/.agent/skills/mobile-design/mobile-navigation.md +0 -458
  165. package/.agent/skills/mobile-design/mobile-performance.md +0 -767
  166. package/.agent/skills/mobile-design/mobile-testing.md +0 -356
  167. package/.agent/skills/mobile-design/mobile-typography.md +0 -433
  168. package/.agent/skills/mobile-design/platform-android.md +0 -666
  169. package/.agent/skills/mobile-design/platform-ios.md +0 -561
  170. package/.agent/skills/mobile-design/scripts/mobile_audit.py +0 -670
  171. package/.agent/skills/mobile-design/touch-psychology.md +0 -537
  172. package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +0 -312
  173. package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +0 -240
  174. package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +0 -490
  175. package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +0 -264
  176. package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +0 -581
  177. package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +0 -432
  178. package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +0 -684
  179. package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +0 -150
  180. package/.agent/skills/nextjs-react-expert/9-cache-components.md +0 -103
  181. package/.agent/skills/nextjs-react-expert/SKILL.md +0 -267
  182. package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +0 -222
  183. package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +0 -252
  184. package/.agent/skills/nodejs-best-practices/SKILL.md +0 -333
  185. package/.agent/skills/parallel-agents/SKILL.md +0 -175
  186. package/.agent/skills/performance-profiling/SKILL.md +0 -143
  187. package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
  188. package/.agent/skills/plan-writing/SKILL.md +0 -153
  189. package/.agent/skills/powershell-windows/SKILL.md +0 -167
  190. package/.agent/skills/product-management/SKILL.md +0 -30
  191. package/.agent/skills/python-patterns/SKILL.md +0 -441
  192. package/.agent/skills/red-team-tactics/SKILL.md +0 -199
  193. package/.agent/skills/rust-pro/SKILL.md +0 -176
  194. package/.agent/skills/seo-fundamentals/SKILL.md +0 -129
  195. package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
  196. package/.agent/skills/server-management/SKILL.md +0 -161
  197. package/.agent/skills/systematic-debugging/SKILL.md +0 -120
  198. package/.agent/skills/tailwind-patterns/SKILL.md +0 -269
  199. package/.agent/skills/tdd-workflow/SKILL.md +0 -148
  200. package/.agent/skills/telegram-agentic-gateway/SKILL.md +0 -80
  201. package/.agent/skills/testing-patterns/SKILL.md +0 -178
  202. package/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
  203. package/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
  204. package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
  205. package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
  206. package/.agent/skills/web-design-guidelines/SKILL.md +0 -57
  207. package/.agent/skills/webapp-testing/SKILL.md +0 -187
  208. package/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
  209. package/.agent/workflows/brainstorm.md +0 -113
  210. package/.agent/workflows/create.md +0 -59
  211. package/.agent/workflows/debug.md +0 -103
  212. package/.agent/workflows/deploy.md +0 -176
  213. package/.agent/workflows/enhance.md +0 -63
  214. package/.agent/workflows/orchestrate.md +0 -237
  215. package/.agent/workflows/plan.md +0 -89
  216. package/.agent/workflows/preview.md +0 -81
  217. package/.agent/workflows/status.md +0 -86
  218. package/.agent/workflows/test.md +0 -144
  219. package/.agent/workflows/ui-ux-pro-max.md +0 -296
@@ -1,93 +0,0 @@
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
@@ -1,55 +0,0 @@
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
@@ -1,43 +0,0 @@
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
- ```
@@ -1,94 +0,0 @@
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
- ```
@@ -1,68 +0,0 @@
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 |
@@ -1,50 +0,0 @@
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
@@ -1,77 +0,0 @@
1
- # Trade-off Analysis & ADR
2
-
3
- > Document every architectural decision with trade-offs.
4
-
5
- ## Decision Framework
6
-
7
- For EACH architectural component, document:
8
-
9
- ```markdown
10
- ## Architecture Decision Record
11
-
12
- ### Context
13
- - **Problem**: [What problem are we solving?]
14
- - **Constraints**: [Team size, scale, timeline, budget]
15
-
16
- ### Options Considered
17
-
18
- | Option | Pros | Cons | Complexity | When Valid |
19
- |--------|------|------|------------|-----------|
20
- | Option A | Benefit 1 | Cost 1 | Low | [Conditions] |
21
- | Option B | Benefit 2 | Cost 2 | High | [Conditions] |
22
-
23
- ### Decision
24
- **Chosen**: [Option B]
25
-
26
- ### Rationale
27
- 1. [Reason 1 - tied to constraints]
28
- 2. [Reason 2 - tied to requirements]
29
-
30
- ### Trade-offs Accepted
31
- - [What we're giving up]
32
- - [Why this is acceptable]
33
-
34
- ### Consequences
35
- - **Positive**: [Benefits we gain]
36
- - **Negative**: [Costs/risks we accept]
37
- - **Mitigation**: [How we'll address negatives]
38
-
39
- ### Revisit Trigger
40
- - [When to reconsider this decision]
41
- ```
42
-
43
- ## ADR Template
44
-
45
- ```markdown
46
- # ADR-[XXX]: [Decision Title]
47
-
48
- ## Status
49
- Proposed | Accepted | Deprecated | Superseded by [ADR-YYY]
50
-
51
- ## Context
52
- [What problem? What constraints?]
53
-
54
- ## Decision
55
- [What we chose - be specific]
56
-
57
- ## Rationale
58
- [Why - tie to requirements and constraints]
59
-
60
- ## Trade-offs
61
- [What we're giving up - be honest]
62
-
63
- ## Consequences
64
- - **Positive**: [Benefits]
65
- - **Negative**: [Costs]
66
- - **Mitigation**: [How to address]
67
- ```
68
-
69
- ## ADR Storage
70
-
71
- ```
72
- docs/
73
- └── architecture/
74
- ├── adr-001-use-nextjs.md
75
- ├── adr-002-postgresql-over-mongodb.md
76
- └── adr-003-adopt-repository-pattern.md
77
- ```
@@ -1,199 +0,0 @@
1
- ---
2
- name: bash-linux
3
- description: Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
4
- allowed-tools: Read, Write, Edit, Glob, Grep, Bash
5
- ---
6
-
7
- # Bash Linux Patterns
8
-
9
- > Essential patterns for Bash on Linux/macOS.
10
-
11
- ---
12
-
13
- ## 1. Operator Syntax
14
-
15
- ### Chaining Commands
16
-
17
- | Operator | Meaning | Example |
18
- |----------|---------|---------|
19
- | `;` | Run sequentially | `cmd1; cmd2` |
20
- | `&&` | Run if previous succeeded | `npm install && npm run dev` |
21
- | `\|\|` | Run if previous failed | `npm test \|\| echo "Tests failed"` |
22
- | `\|` | Pipe output | `ls \| grep ".js"` |
23
-
24
- ---
25
-
26
- ## 2. File Operations
27
-
28
- ### Essential Commands
29
-
30
- | Task | Command |
31
- |------|---------|
32
- | List all | `ls -la` |
33
- | Find files | `find . -name "*.js" -type f` |
34
- | File content | `cat file.txt` |
35
- | First N lines | `head -n 20 file.txt` |
36
- | Last N lines | `tail -n 20 file.txt` |
37
- | Follow log | `tail -f log.txt` |
38
- | Search in files | `grep -r "pattern" --include="*.js"` |
39
- | File size | `du -sh *` |
40
- | Disk usage | `df -h` |
41
-
42
- ---
43
-
44
- ## 3. Process Management
45
-
46
- | Task | Command |
47
- |------|---------|
48
- | List processes | `ps aux` |
49
- | Find by name | `ps aux \| grep node` |
50
- | Kill by PID | `kill -9 <PID>` |
51
- | Find port user | `lsof -i :3000` |
52
- | Kill port | `kill -9 $(lsof -t -i :3000)` |
53
- | Background | `npm run dev &` |
54
- | Jobs | `jobs -l` |
55
- | Bring to front | `fg %1` |
56
-
57
- ---
58
-
59
- ## 4. Text Processing
60
-
61
- ### Core Tools
62
-
63
- | Tool | Purpose | Example |
64
- |------|---------|---------|
65
- | `grep` | Search | `grep -rn "TODO" src/` |
66
- | `sed` | Replace | `sed -i 's/old/new/g' file.txt` |
67
- | `awk` | Extract columns | `awk '{print $1}' file.txt` |
68
- | `cut` | Cut fields | `cut -d',' -f1 data.csv` |
69
- | `sort` | Sort lines | `sort -u file.txt` |
70
- | `uniq` | Unique lines | `sort file.txt \| uniq -c` |
71
- | `wc` | Count | `wc -l file.txt` |
72
-
73
- ---
74
-
75
- ## 5. Environment Variables
76
-
77
- | Task | Command |
78
- |------|---------|
79
- | View all | `env` or `printenv` |
80
- | View one | `echo $PATH` |
81
- | Set temporary | `export VAR="value"` |
82
- | Set in script | `VAR="value" command` |
83
- | Add to PATH | `export PATH="$PATH:/new/path"` |
84
-
85
- ---
86
-
87
- ## 6. Network
88
-
89
- | Task | Command |
90
- |------|---------|
91
- | Download | `curl -O https://example.com/file` |
92
- | API request | `curl -X GET https://api.example.com` |
93
- | POST JSON | `curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' URL` |
94
- | Check port | `nc -zv localhost 3000` |
95
- | Network info | `ifconfig` or `ip addr` |
96
-
97
- ---
98
-
99
- ## 7. Script Template
100
-
101
- ```bash
102
- #!/bin/bash
103
- set -euo pipefail # Exit on error, undefined var, pipe fail
104
-
105
- # Colors (optional)
106
- RED='\033[0;31m'
107
- GREEN='\033[0;32m'
108
- NC='\033[0m'
109
-
110
- # Script directory
111
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
112
-
113
- # Functions
114
- log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
115
- log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; }
116
-
117
- # Main
118
- main() {
119
- log_info "Starting..."
120
- # Your logic here
121
- log_info "Done!"
122
- }
123
-
124
- main "$@"
125
- ```
126
-
127
- ---
128
-
129
- ## 8. Common Patterns
130
-
131
- ### Check if command exists
132
-
133
- ```bash
134
- if command -v node &> /dev/null; then
135
- echo "Node is installed"
136
- fi
137
- ```
138
-
139
- ### Default variable value
140
-
141
- ```bash
142
- NAME=${1:-"default_value"}
143
- ```
144
-
145
- ### Read file line by line
146
-
147
- ```bash
148
- while IFS= read -r line; do
149
- echo "$line"
150
- done < file.txt
151
- ```
152
-
153
- ### Loop over files
154
-
155
- ```bash
156
- for file in *.js; do
157
- echo "Processing $file"
158
- done
159
- ```
160
-
161
- ---
162
-
163
- ## 9. Differences from PowerShell
164
-
165
- | Task | PowerShell | Bash |
166
- |------|------------|------|
167
- | List files | `Get-ChildItem` | `ls -la` |
168
- | Find files | `Get-ChildItem -Recurse` | `find . -type f` |
169
- | Environment | `$env:VAR` | `$VAR` |
170
- | String concat | `"$a$b"` | `"$a$b"` (same) |
171
- | Null check | `if ($x)` | `if [ -n "$x" ]` |
172
- | Pipeline | Object-based | Text-based |
173
-
174
- ---
175
-
176
- ## 10. Error Handling
177
-
178
- ### Set options
179
-
180
- ```bash
181
- set -e # Exit on error
182
- set -u # Exit on undefined variable
183
- set -o pipefail # Exit on pipe failure
184
- set -x # Debug: print commands
185
- ```
186
-
187
- ### Trap for cleanup
188
-
189
- ```bash
190
- cleanup() {
191
- echo "Cleaning up..."
192
- rm -f /tmp/tempfile
193
- }
194
- trap cleanup EXIT
195
- ```
196
-
197
- ---
198
-
199
- > **Remember:** Bash is text-based. Use `&&` for success chains, `set -e` for safety, and quote your variables!