@techwavedev/agi-agent-kit 1.1.3

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 (196) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +147 -0
  3. package/bin/init.js +471 -0
  4. package/package.json +36 -0
  5. package/templates/.agent/agents/backend-specialist.md +263 -0
  6. package/templates/.agent/agents/code-archaeologist.md +106 -0
  7. package/templates/.agent/agents/database-architect.md +226 -0
  8. package/templates/.agent/agents/debugger.md +225 -0
  9. package/templates/.agent/agents/devops-engineer.md +242 -0
  10. package/templates/.agent/agents/documentation-writer.md +104 -0
  11. package/templates/.agent/agents/explorer-agent.md +73 -0
  12. package/templates/.agent/agents/frontend-specialist.md +556 -0
  13. package/templates/.agent/agents/game-developer.md +162 -0
  14. package/templates/.agent/agents/mobile-developer.md +377 -0
  15. package/templates/.agent/agents/orchestrator.md +416 -0
  16. package/templates/.agent/agents/penetration-tester.md +188 -0
  17. package/templates/.agent/agents/performance-optimizer.md +187 -0
  18. package/templates/.agent/agents/product-manager.md +112 -0
  19. package/templates/.agent/agents/project-planner.md +403 -0
  20. package/templates/.agent/agents/qa-automation-engineer.md +109 -0
  21. package/templates/.agent/agents/security-auditor.md +170 -0
  22. package/templates/.agent/agents/seo-specialist.md +111 -0
  23. package/templates/.agent/agents/test-engineer.md +158 -0
  24. package/templates/.agent/rules/GEMINI.md +253 -0
  25. package/templates/.agent/workflows/brainstorm.md +113 -0
  26. package/templates/.agent/workflows/create.md +59 -0
  27. package/templates/.agent/workflows/debug.md +103 -0
  28. package/templates/.agent/workflows/deploy.md +176 -0
  29. package/templates/.agent/workflows/enhance.md +63 -0
  30. package/templates/.agent/workflows/orchestrate.md +237 -0
  31. package/templates/.agent/workflows/plan.md +89 -0
  32. package/templates/.agent/workflows/preview.md +81 -0
  33. package/templates/.agent/workflows/status.md +86 -0
  34. package/templates/.agent/workflows/test.md +144 -0
  35. package/templates/.agent/workflows/ui-ux-pro-max.md +296 -0
  36. package/templates/base/.env.example +54 -0
  37. package/templates/base/AGENTS.md +463 -0
  38. package/templates/base/requirements.txt +6 -0
  39. package/templates/base/skill-creator/LICENSE.txt +202 -0
  40. package/templates/base/skill-creator/SKILL_skillcreator.md +389 -0
  41. package/templates/base/skill-creator/references/output-patterns.md +82 -0
  42. package/templates/base/skill-creator/references/workflows.md +28 -0
  43. package/templates/base/skill-creator/scripts/init_skill.py +304 -0
  44. package/templates/base/skill-creator/scripts/package_skill.py +110 -0
  45. package/templates/base/skill-creator/scripts/quick_validate.py +95 -0
  46. package/templates/base/skill-creator/scripts/update_catalog.py +371 -0
  47. package/templates/skills/core/README.md +21 -0
  48. package/templates/skills/core/documentation/SKILL.md +351 -0
  49. package/templates/skills/core/documentation/references/best_practices.md +201 -0
  50. package/templates/skills/core/documentation/scripts/analyze_code.py +307 -0
  51. package/templates/skills/core/documentation/scripts/detect_changes.py +460 -0
  52. package/templates/skills/core/documentation/scripts/generate_changelog.py +312 -0
  53. package/templates/skills/core/documentation/scripts/sync_docs.py +272 -0
  54. package/templates/skills/core/documentation/scripts/update_skill_docs.py +366 -0
  55. package/templates/skills/core/pdf-reader/SKILL.md +104 -0
  56. package/templates/skills/core/pdf-reader/references/pdf_libraries.md +83 -0
  57. package/templates/skills/core/pdf-reader/scripts/extract_text.py +295 -0
  58. package/templates/skills/core/qdrant-memory/SKILL.md +435 -0
  59. package/templates/skills/core/qdrant-memory/references/advanced_patterns.md +375 -0
  60. package/templates/skills/core/qdrant-memory/references/collection_schemas.md +229 -0
  61. package/templates/skills/core/qdrant-memory/references/complete_guide.md +724 -0
  62. package/templates/skills/core/qdrant-memory/references/embedding_models.md +325 -0
  63. package/templates/skills/core/qdrant-memory/scripts/benchmark_token_savings.py +640 -0
  64. package/templates/skills/core/qdrant-memory/scripts/embedding_utils.py +323 -0
  65. package/templates/skills/core/qdrant-memory/scripts/hybrid_search.py +214 -0
  66. package/templates/skills/core/qdrant-memory/scripts/init_collection.py +193 -0
  67. package/templates/skills/core/qdrant-memory/scripts/memory_retrieval.py +345 -0
  68. package/templates/skills/core/qdrant-memory/scripts/semantic_cache.py +282 -0
  69. package/templates/skills/core/qdrant-memory/scripts/test_skill.py +655 -0
  70. package/templates/skills/core/webcrawler/SKILL.md +292 -0
  71. package/templates/skills/core/webcrawler/references/advanced_crawling.md +181 -0
  72. package/templates/skills/core/webcrawler/scripts/crawl_docs.py +532 -0
  73. package/templates/skills/core/webcrawler/scripts/extract_page.py +189 -0
  74. package/templates/skills/core/webcrawler/scripts/filter_docs.py +200 -0
  75. package/templates/skills/knowledge/api-patterns/SKILL.md +81 -0
  76. package/templates/skills/knowledge/api-patterns/api-style.md +42 -0
  77. package/templates/skills/knowledge/api-patterns/auth.md +24 -0
  78. package/templates/skills/knowledge/api-patterns/documentation.md +26 -0
  79. package/templates/skills/knowledge/api-patterns/graphql.md +41 -0
  80. package/templates/skills/knowledge/api-patterns/rate-limiting.md +31 -0
  81. package/templates/skills/knowledge/api-patterns/response.md +37 -0
  82. package/templates/skills/knowledge/api-patterns/rest.md +40 -0
  83. package/templates/skills/knowledge/api-patterns/scripts/api_validator.py +211 -0
  84. package/templates/skills/knowledge/api-patterns/security-testing.md +122 -0
  85. package/templates/skills/knowledge/api-patterns/trpc.md +41 -0
  86. package/templates/skills/knowledge/api-patterns/versioning.md +22 -0
  87. package/templates/skills/knowledge/app-builder/SKILL.md +75 -0
  88. package/templates/skills/knowledge/app-builder/agent-coordination.md +71 -0
  89. package/templates/skills/knowledge/app-builder/feature-building.md +53 -0
  90. package/templates/skills/knowledge/app-builder/project-detection.md +34 -0
  91. package/templates/skills/knowledge/app-builder/scaffolding.md +118 -0
  92. package/templates/skills/knowledge/app-builder/tech-stack.md +40 -0
  93. package/templates/skills/knowledge/app-builder/templates/SKILL.md +39 -0
  94. package/templates/skills/knowledge/app-builder/templates/astro-static/TEMPLATE.md +76 -0
  95. package/templates/skills/knowledge/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
  96. package/templates/skills/knowledge/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  97. package/templates/skills/knowledge/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
  98. package/templates/skills/knowledge/app-builder/templates/express-api/TEMPLATE.md +83 -0
  99. package/templates/skills/knowledge/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
  100. package/templates/skills/knowledge/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
  101. package/templates/skills/knowledge/app-builder/templates/nextjs-fullstack/TEMPLATE.md +82 -0
  102. package/templates/skills/knowledge/app-builder/templates/nextjs-saas/TEMPLATE.md +100 -0
  103. package/templates/skills/knowledge/app-builder/templates/nextjs-static/TEMPLATE.md +106 -0
  104. package/templates/skills/knowledge/app-builder/templates/nuxt-app/TEMPLATE.md +101 -0
  105. package/templates/skills/knowledge/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
  106. package/templates/skills/knowledge/app-builder/templates/react-native-app/TEMPLATE.md +93 -0
  107. package/templates/skills/knowledge/architecture/SKILL.md +55 -0
  108. package/templates/skills/knowledge/architecture/context-discovery.md +43 -0
  109. package/templates/skills/knowledge/architecture/examples.md +94 -0
  110. package/templates/skills/knowledge/architecture/pattern-selection.md +68 -0
  111. package/templates/skills/knowledge/architecture/patterns-reference.md +50 -0
  112. package/templates/skills/knowledge/architecture/trade-off-analysis.md +77 -0
  113. package/templates/skills/knowledge/bash-linux/SKILL.md +199 -0
  114. package/templates/skills/knowledge/behavioral-modes/SKILL.md +242 -0
  115. package/templates/skills/knowledge/brainstorming/SKILL.md +163 -0
  116. package/templates/skills/knowledge/brainstorming/dynamic-questioning.md +350 -0
  117. package/templates/skills/knowledge/clean-code/SKILL.md +201 -0
  118. package/templates/skills/knowledge/code-review-checklist/SKILL.md +109 -0
  119. package/templates/skills/knowledge/database-design/SKILL.md +52 -0
  120. package/templates/skills/knowledge/database-design/database-selection.md +43 -0
  121. package/templates/skills/knowledge/database-design/indexing.md +39 -0
  122. package/templates/skills/knowledge/database-design/migrations.md +48 -0
  123. package/templates/skills/knowledge/database-design/optimization.md +36 -0
  124. package/templates/skills/knowledge/database-design/orm-selection.md +30 -0
  125. package/templates/skills/knowledge/database-design/schema-design.md +56 -0
  126. package/templates/skills/knowledge/database-design/scripts/schema_validator.py +172 -0
  127. package/templates/skills/knowledge/deployment-procedures/SKILL.md +241 -0
  128. package/templates/skills/knowledge/doc.md +177 -0
  129. package/templates/skills/knowledge/documentation-templates/SKILL.md +194 -0
  130. package/templates/skills/knowledge/frontend-design/SKILL.md +396 -0
  131. package/templates/skills/knowledge/frontend-design/animation-guide.md +331 -0
  132. package/templates/skills/knowledge/frontend-design/color-system.md +311 -0
  133. package/templates/skills/knowledge/frontend-design/decision-trees.md +418 -0
  134. package/templates/skills/knowledge/frontend-design/motion-graphics.md +306 -0
  135. package/templates/skills/knowledge/frontend-design/scripts/accessibility_checker.py +183 -0
  136. package/templates/skills/knowledge/frontend-design/scripts/ux_audit.py +722 -0
  137. package/templates/skills/knowledge/frontend-design/typography-system.md +345 -0
  138. package/templates/skills/knowledge/frontend-design/ux-psychology.md +541 -0
  139. package/templates/skills/knowledge/frontend-design/visual-effects.md +383 -0
  140. package/templates/skills/knowledge/game-development/2d-games/SKILL.md +119 -0
  141. package/templates/skills/knowledge/game-development/3d-games/SKILL.md +135 -0
  142. package/templates/skills/knowledge/game-development/SKILL.md +167 -0
  143. package/templates/skills/knowledge/game-development/game-art/SKILL.md +185 -0
  144. package/templates/skills/knowledge/game-development/game-audio/SKILL.md +190 -0
  145. package/templates/skills/knowledge/game-development/game-design/SKILL.md +129 -0
  146. package/templates/skills/knowledge/game-development/mobile-games/SKILL.md +108 -0
  147. package/templates/skills/knowledge/game-development/multiplayer/SKILL.md +132 -0
  148. package/templates/skills/knowledge/game-development/pc-games/SKILL.md +144 -0
  149. package/templates/skills/knowledge/game-development/vr-ar/SKILL.md +123 -0
  150. package/templates/skills/knowledge/game-development/web-games/SKILL.md +150 -0
  151. package/templates/skills/knowledge/geo-fundamentals/SKILL.md +156 -0
  152. package/templates/skills/knowledge/geo-fundamentals/scripts/geo_checker.py +289 -0
  153. package/templates/skills/knowledge/i18n-localization/SKILL.md +154 -0
  154. package/templates/skills/knowledge/i18n-localization/scripts/i18n_checker.py +241 -0
  155. package/templates/skills/knowledge/intelligent-routing/SKILL.md +334 -0
  156. package/templates/skills/knowledge/lint-and-validate/SKILL.md +45 -0
  157. package/templates/skills/knowledge/lint-and-validate/scripts/lint_runner.py +172 -0
  158. package/templates/skills/knowledge/lint-and-validate/scripts/type_coverage.py +173 -0
  159. package/templates/skills/knowledge/mcp-builder/SKILL.md +176 -0
  160. package/templates/skills/knowledge/mobile-design/SKILL.md +394 -0
  161. package/templates/skills/knowledge/mobile-design/decision-trees.md +516 -0
  162. package/templates/skills/knowledge/mobile-design/mobile-backend.md +491 -0
  163. package/templates/skills/knowledge/mobile-design/mobile-color-system.md +420 -0
  164. package/templates/skills/knowledge/mobile-design/mobile-debugging.md +122 -0
  165. package/templates/skills/knowledge/mobile-design/mobile-design-thinking.md +357 -0
  166. package/templates/skills/knowledge/mobile-design/mobile-navigation.md +458 -0
  167. package/templates/skills/knowledge/mobile-design/mobile-performance.md +767 -0
  168. package/templates/skills/knowledge/mobile-design/mobile-testing.md +356 -0
  169. package/templates/skills/knowledge/mobile-design/mobile-typography.md +433 -0
  170. package/templates/skills/knowledge/mobile-design/platform-android.md +666 -0
  171. package/templates/skills/knowledge/mobile-design/platform-ios.md +561 -0
  172. package/templates/skills/knowledge/mobile-design/scripts/mobile_audit.py +670 -0
  173. package/templates/skills/knowledge/mobile-design/touch-psychology.md +537 -0
  174. package/templates/skills/knowledge/nextjs-best-practices/SKILL.md +203 -0
  175. package/templates/skills/knowledge/nodejs-best-practices/SKILL.md +333 -0
  176. package/templates/skills/knowledge/parallel-agents/SKILL.md +175 -0
  177. package/templates/skills/knowledge/performance-profiling/SKILL.md +143 -0
  178. package/templates/skills/knowledge/performance-profiling/scripts/lighthouse_audit.py +76 -0
  179. package/templates/skills/knowledge/plan-writing/SKILL.md +152 -0
  180. package/templates/skills/knowledge/powershell-windows/SKILL.md +167 -0
  181. package/templates/skills/knowledge/python-patterns/SKILL.md +441 -0
  182. package/templates/skills/knowledge/react-patterns/SKILL.md +198 -0
  183. package/templates/skills/knowledge/red-team-tactics/SKILL.md +199 -0
  184. package/templates/skills/knowledge/seo-fundamentals/SKILL.md +129 -0
  185. package/templates/skills/knowledge/seo-fundamentals/scripts/seo_checker.py +219 -0
  186. package/templates/skills/knowledge/server-management/SKILL.md +161 -0
  187. package/templates/skills/knowledge/systematic-debugging/SKILL.md +109 -0
  188. package/templates/skills/knowledge/tailwind-patterns/SKILL.md +269 -0
  189. package/templates/skills/knowledge/tdd-workflow/SKILL.md +149 -0
  190. package/templates/skills/knowledge/testing-patterns/SKILL.md +178 -0
  191. package/templates/skills/knowledge/testing-patterns/scripts/test_runner.py +219 -0
  192. package/templates/skills/knowledge/vulnerability-scanner/SKILL.md +276 -0
  193. package/templates/skills/knowledge/vulnerability-scanner/checklists.md +121 -0
  194. package/templates/skills/knowledge/vulnerability-scanner/scripts/security_scan.py +458 -0
  195. package/templates/skills/knowledge/webapp-testing/SKILL.md +187 -0
  196. package/templates/skills/knowledge/webapp-testing/scripts/playwright_runner.py +173 -0
@@ -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
@@ -0,0 +1,77 @@
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
+ ```
@@ -0,0 +1,199 @@
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!