@zimezone/z-command 1.1.1 → 1.1.2

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 (282) hide show
  1. package/README.md +13 -1
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +34 -9
  4. package/dist/commands/init.js.map +1 -1
  5. package/package.json +8 -3
  6. package/templates.zip +0 -0
  7. package/templates/agents/accessibility-expert.agent.md +0 -56
  8. package/templates/agents/ai-engineer.agent.md +0 -61
  9. package/templates/agents/angular-architect.agent.md +0 -49
  10. package/templates/agents/api-designer.agent.md +0 -40
  11. package/templates/agents/api-documenter.agent.md +0 -161
  12. package/templates/agents/architect-review.agent.md +0 -146
  13. package/templates/agents/arm-cortex-expert.agent.md +0 -288
  14. package/templates/agents/azure-infra-engineer.agent.md +0 -57
  15. package/templates/agents/backend-architect.agent.md +0 -309
  16. package/templates/agents/backend-developer.agent.md +0 -61
  17. package/templates/agents/backend-security-coder.agent.md +0 -152
  18. package/templates/agents/bash-pro.agent.md +0 -285
  19. package/templates/agents/blockchain-developer.agent.md +0 -57
  20. package/templates/agents/build-engineer.agent.md +0 -56
  21. package/templates/agents/business-analyst.agent.md +0 -47
  22. package/templates/agents/c-pro.agent.md +0 -35
  23. package/templates/agents/c4-code.agent.md +0 -320
  24. package/templates/agents/c4-component.agent.md +0 -227
  25. package/templates/agents/c4-container.agent.md +0 -248
  26. package/templates/agents/c4-context.agent.md +0 -235
  27. package/templates/agents/cli-developer.agent.md +0 -57
  28. package/templates/agents/cloud-architect.agent.md +0 -56
  29. package/templates/agents/code-architect.agent.md +0 -63
  30. package/templates/agents/code-reviewer.agent.md +0 -49
  31. package/templates/agents/competitive-analyst.agent.md +0 -48
  32. package/templates/agents/conductor-validator.agent.md +0 -245
  33. package/templates/agents/context-manager.agent.md +0 -55
  34. package/templates/agents/cpp-pro.agent.md +0 -59
  35. package/templates/agents/csharp-developer.agent.md +0 -57
  36. package/templates/agents/csharp-pro.agent.md +0 -38
  37. package/templates/agents/customer-support.agent.md +0 -148
  38. package/templates/agents/data-engineer.agent.md +0 -55
  39. package/templates/agents/data-researcher.agent.md +0 -55
  40. package/templates/agents/data-scientist.agent.md +0 -56
  41. package/templates/agents/database-admin.agent.md +0 -142
  42. package/templates/agents/database-administrator.agent.md +0 -50
  43. package/templates/agents/database-architect.agent.md +0 -238
  44. package/templates/agents/database-optimizer.agent.md +0 -144
  45. package/templates/agents/debugger.agent.md +0 -30
  46. package/templates/agents/deployment-engineer.agent.md +0 -0
  47. package/templates/agents/devops-engineer.agent.md +0 -59
  48. package/templates/agents/devops-troubleshooter.agent.md +0 -138
  49. package/templates/agents/django-developer.agent.md +0 -50
  50. package/templates/agents/django-pro.agent.md +0 -159
  51. package/templates/agents/docs-architect.agent.md +0 -77
  52. package/templates/agents/documentation-engineer.agent.md +0 -57
  53. package/templates/agents/dotnet-architect.agent.md +0 -175
  54. package/templates/agents/dx-optimizer.agent.md +0 -63
  55. package/templates/agents/electron-pro.agent.md +0 -56
  56. package/templates/agents/elixir-pro.agent.md +0 -38
  57. package/templates/agents/embedded-systems.agent.md +0 -55
  58. package/templates/agents/error-detective.agent.md +0 -32
  59. package/templates/agents/event-sourcing-architect.agent.md +0 -42
  60. package/templates/agents/fastapi-pro.agent.md +0 -171
  61. package/templates/agents/fintech-engineer.agent.md +0 -57
  62. package/templates/agents/firmware-analyst.agent.md +0 -330
  63. package/templates/agents/flutter-expert.agent.md +0 -50
  64. package/templates/agents/frontend-developer.agent.md +0 -59
  65. package/templates/agents/frontend-security-coder.agent.md +0 -149
  66. package/templates/agents/fullstack-developer.agent.md +0 -46
  67. package/templates/agents/git-workflow-manager.agent.md +0 -57
  68. package/templates/agents/golang-pro.agent.md +0 -50
  69. package/templates/agents/graphql-architect.agent.md +0 -48
  70. package/templates/agents/haskell-pro.agent.md +0 -37
  71. package/templates/agents/hr-pro.agent.md +0 -105
  72. package/templates/agents/incident-responder.agent.md +0 -190
  73. package/templates/agents/ios-developer.agent.md +0 -198
  74. package/templates/agents/iot-engineer.agent.md +0 -56
  75. package/templates/agents/java-architect.agent.md +0 -48
  76. package/templates/agents/java-pro.agent.md +0 -156
  77. package/templates/agents/javascript-pro.agent.md +0 -35
  78. package/templates/agents/julia-pro.agent.md +0 -187
  79. package/templates/agents/kotlin-specialist.agent.md +0 -50
  80. package/templates/agents/laravel-specialist.agent.md +0 -50
  81. package/templates/agents/legacy-modernizer.agent.md +0 -56
  82. package/templates/agents/legal-advisor.agent.md +0 -49
  83. package/templates/agents/llm-architect.agent.md +0 -58
  84. package/templates/agents/malware-analyst.agent.md +0 -272
  85. package/templates/agents/mcp-developer.agent.md +0 -54
  86. package/templates/agents/mermaid-expert.agent.md +0 -39
  87. package/templates/agents/microservices-architect.agent.md +0 -47
  88. package/templates/agents/minecraft-bukkit-pro.agent.md +0 -104
  89. package/templates/agents/ml-engineer.agent.md +0 -56
  90. package/templates/agents/mlops-engineer.agent.md +0 -56
  91. package/templates/agents/mobile-developer.agent.md +0 -45
  92. package/templates/agents/mobile-security-coder.agent.md +0 -163
  93. package/templates/agents/monorepo-architect.agent.md +0 -44
  94. package/templates/agents/multi-agent-coordinator.agent.md +0 -55
  95. package/templates/agents/network-engineer.agent.md +0 -57
  96. package/templates/agents/nextjs-developer.agent.md +0 -48
  97. package/templates/agents/nlp-engineer.agent.md +0 -58
  98. package/templates/agents/observability-engineer.agent.md +0 -228
  99. package/templates/agents/payment-integration.agent.md +0 -56
  100. package/templates/agents/performance-engineer.agent.md +0 -167
  101. package/templates/agents/performance-optimizer.agent.md +0 -57
  102. package/templates/agents/php-pro.agent.md +0 -43
  103. package/templates/agents/platform-engineer.agent.md +0 -57
  104. package/templates/agents/posix-shell-pro.agent.md +0 -284
  105. package/templates/agents/postgres-pro.agent.md +0 -58
  106. package/templates/agents/product-manager.agent.md +0 -55
  107. package/templates/agents/project-manager.agent.md +0 -57
  108. package/templates/agents/prompt-engineer.agent.md +0 -58
  109. package/templates/agents/python-pro.agent.md +0 -48
  110. package/templates/agents/quant-analyst.agent.md +0 -32
  111. package/templates/agents/rails-expert.agent.md +0 -50
  112. package/templates/agents/react-specialist.agent.md +0 -49
  113. package/templates/agents/refactoring-specialist.agent.md +0 -56
  114. package/templates/agents/reference-builder.agent.md +0 -167
  115. package/templates/agents/research-analyst.agent.md +0 -63
  116. package/templates/agents/reverse-engineer.agent.md +0 -202
  117. package/templates/agents/risk-manager.agent.md +0 -41
  118. package/templates/agents/ruby-pro.agent.md +0 -35
  119. package/templates/agents/rust-pro.agent.md +0 -156
  120. package/templates/agents/sales-automator.agent.md +0 -35
  121. package/templates/agents/scala-pro.agent.md +0 -60
  122. package/templates/agents/scrum-master.agent.md +0 -54
  123. package/templates/agents/search-specialist.agent.md +0 -59
  124. package/templates/agents/security-analyst.agent.md +0 -57
  125. package/templates/agents/security-auditor.agent.md +0 -138
  126. package/templates/agents/security-engineer.agent.md +0 -57
  127. package/templates/agents/seo-authority-builder.agent.md +0 -116
  128. package/templates/agents/seo-cannibalization-detector.agent.md +0 -103
  129. package/templates/agents/seo-content-auditor.agent.md +0 -63
  130. package/templates/agents/seo-content-planner.agent.md +0 -88
  131. package/templates/agents/seo-content-refresher.agent.md +0 -98
  132. package/templates/agents/seo-content-writer.agent.md +0 -76
  133. package/templates/agents/seo-keyword-strategist.agent.md +0 -75
  134. package/templates/agents/seo-meta-optimizer.agent.md +0 -72
  135. package/templates/agents/seo-snippet-hunter.agent.md +0 -94
  136. package/templates/agents/seo-specialist.agent.md +0 -57
  137. package/templates/agents/seo-structure-architect.agent.md +0 -88
  138. package/templates/agents/service-mesh-expert.agent.md +0 -41
  139. package/templates/agents/sql-pro.agent.md +0 -146
  140. package/templates/agents/sre-engineer.agent.md +0 -58
  141. package/templates/agents/swift-expert.agent.md +0 -49
  142. package/templates/agents/task-distributor.agent.md +0 -47
  143. package/templates/agents/tdd-orchestrator.agent.md +0 -183
  144. package/templates/agents/technical-writer.agent.md +0 -48
  145. package/templates/agents/temporal-python-pro.agent.md +0 -349
  146. package/templates/agents/terraform-engineer.agent.md +0 -57
  147. package/templates/agents/terraform-specialist.agent.md +0 -137
  148. package/templates/agents/test-automator.agent.md +0 -203
  149. package/templates/agents/test-engineer.agent.md +0 -55
  150. package/templates/agents/threat-modeling-expert.agent.md +0 -44
  151. package/templates/agents/trend-analyst.agent.md +0 -47
  152. package/templates/agents/tutorial-engineer.agent.md +0 -118
  153. package/templates/agents/typescript-pro.agent.md +0 -48
  154. package/templates/agents/ui-designer.agent.md +0 -48
  155. package/templates/agents/ui-ux-designer.agent.md +0 -188
  156. package/templates/agents/ui-visual-validator.agent.md +0 -192
  157. package/templates/agents/ux-researcher.agent.md +0 -48
  158. package/templates/agents/vector-database-engineer.agent.md +0 -43
  159. package/templates/agents/vue-expert.agent.md +0 -48
  160. package/templates/agents/websocket-engineer.agent.md +0 -49
  161. package/templates/agents/workflow-orchestrator.agent.md +0 -48
  162. package/templates/skills/angular-migration/SKILL.md +0 -410
  163. package/templates/skills/api-design-principles/SKILL.md +0 -528
  164. package/templates/skills/api-design-principles/assets/api-design-checklist.md +0 -155
  165. package/templates/skills/api-design-principles/assets/rest-api-template.py +0 -182
  166. package/templates/skills/api-design-principles/references/graphql-schema-design.md +0 -583
  167. package/templates/skills/api-design-principles/references/rest-best-practices.md +0 -408
  168. package/templates/skills/architecture-decision-records/SKILL.md +0 -428
  169. package/templates/skills/architecture-patterns/SKILL.md +0 -494
  170. package/templates/skills/async-python-patterns/SKILL.md +0 -694
  171. package/templates/skills/auth-implementation-patterns/SKILL.md +0 -634
  172. package/templates/skills/changelog-automation/SKILL.md +0 -552
  173. package/templates/skills/code-review/SKILL.md +0 -62
  174. package/templates/skills/code-review-excellence/SKILL.md +0 -520
  175. package/templates/skills/competitive-landscape/SKILL.md +0 -479
  176. package/templates/skills/context-driven-development/SKILL.md +0 -385
  177. package/templates/skills/cost-optimization/SKILL.md +0 -274
  178. package/templates/skills/cqrs-implementation/SKILL.md +0 -554
  179. package/templates/skills/data-quality-frameworks/SKILL.md +0 -587
  180. package/templates/skills/data-storytelling/SKILL.md +0 -453
  181. package/templates/skills/database-migration/SKILL.md +0 -424
  182. package/templates/skills/dbt-transformation-patterns/SKILL.md +0 -561
  183. package/templates/skills/debugging-strategies/SKILL.md +0 -527
  184. package/templates/skills/defi-protocol-templates/SKILL.md +0 -454
  185. package/templates/skills/dependency-upgrade/SKILL.md +0 -409
  186. package/templates/skills/deployment-pipeline-design/SKILL.md +0 -359
  187. package/templates/skills/distributed-tracing/SKILL.md +0 -438
  188. package/templates/skills/dotnet-backend-patterns/SKILL.md +0 -815
  189. package/templates/skills/dotnet-backend-patterns/assets/repository-template.cs +0 -523
  190. package/templates/skills/dotnet-backend-patterns/assets/service-template.cs +0 -336
  191. package/templates/skills/dotnet-backend-patterns/references/dapper-patterns.md +0 -544
  192. package/templates/skills/dotnet-backend-patterns/references/ef-core-best-practices.md +0 -355
  193. package/templates/skills/e2e-testing-patterns/SKILL.md +0 -547
  194. package/templates/skills/employment-contract-templates/SKILL.md +0 -507
  195. package/templates/skills/error-handling-patterns/SKILL.md +0 -636
  196. package/templates/skills/event-store-design/SKILL.md +0 -437
  197. package/templates/skills/fastapi-templates/SKILL.md +0 -567
  198. package/templates/skills/git-advanced-workflows/SKILL.md +0 -400
  199. package/templates/skills/github-actions-templates/SKILL.md +0 -333
  200. package/templates/skills/go-concurrency-patterns/SKILL.md +0 -655
  201. package/templates/skills/grafana-dashboards/SKILL.md +0 -369
  202. package/templates/skills/helm-chart-scaffolding/SKILL.md +0 -544
  203. package/templates/skills/helm-chart-scaffolding/assets/Chart.yaml.template +0 -42
  204. package/templates/skills/helm-chart-scaffolding/assets/values.yaml.template +0 -185
  205. package/templates/skills/helm-chart-scaffolding/references/chart-structure.md +0 -500
  206. package/templates/skills/helm-chart-scaffolding/scripts/validate-chart.sh +0 -244
  207. package/templates/skills/javascript-testing-patterns/SKILL.md +0 -1025
  208. package/templates/skills/langchain-architecture/SKILL.md +0 -338
  209. package/templates/skills/llm-evaluation/SKILL.md +0 -471
  210. package/templates/skills/microservices-patterns/SKILL.md +0 -595
  211. package/templates/skills/modern-javascript-patterns/SKILL.md +0 -911
  212. package/templates/skills/monorepo-management/SKILL.md +0 -622
  213. package/templates/skills/nextjs-app-router-patterns/SKILL.md +0 -544
  214. package/templates/skills/nodejs-backend-patterns/SKILL.md +0 -1020
  215. package/templates/skills/nx-workspace-patterns/SKILL.md +0 -452
  216. package/templates/skills/openapi-spec-generation/SKILL.md +0 -1028
  217. package/templates/skills/paypal-integration/SKILL.md +0 -467
  218. package/templates/skills/pci-compliance/SKILL.md +0 -466
  219. package/templates/skills/postgresql/SKILL.md +0 -204
  220. package/templates/skills/projection-patterns/SKILL.md +0 -490
  221. package/templates/skills/prometheus-configuration/SKILL.md +0 -392
  222. package/templates/skills/prompt-engineering-patterns/SKILL.md +0 -201
  223. package/templates/skills/prompt-engineering-patterns/assets/few-shot-examples.json +0 -106
  224. package/templates/skills/prompt-engineering-patterns/assets/prompt-template-library.md +0 -246
  225. package/templates/skills/prompt-engineering-patterns/references/chain-of-thought.md +0 -399
  226. package/templates/skills/prompt-engineering-patterns/references/few-shot-learning.md +0 -369
  227. package/templates/skills/prompt-engineering-patterns/references/prompt-optimization.md +0 -414
  228. package/templates/skills/prompt-engineering-patterns/references/prompt-templates.md +0 -470
  229. package/templates/skills/prompt-engineering-patterns/references/system-prompts.md +0 -189
  230. package/templates/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +0 -279
  231. package/templates/skills/python-packaging/SKILL.md +0 -870
  232. package/templates/skills/python-performance-optimization/SKILL.md +0 -869
  233. package/templates/skills/python-testing-patterns/SKILL.md +0 -907
  234. package/templates/skills/rag-implementation/SKILL.md +0 -403
  235. package/templates/skills/react-modernization/SKILL.md +0 -513
  236. package/templates/skills/react-native-architecture/SKILL.md +0 -671
  237. package/templates/skills/react-state-management/SKILL.md +0 -429
  238. package/templates/skills/risk-metrics-calculation/SKILL.md +0 -555
  239. package/templates/skills/rust-async-patterns/SKILL.md +0 -517
  240. package/templates/skills/secrets-management/SKILL.md +0 -346
  241. package/templates/skills/security-requirement-extraction/SKILL.md +0 -677
  242. package/templates/skills/security-review/SKILL.md +0 -78
  243. package/templates/skills/shellcheck-configuration/SKILL.md +0 -454
  244. package/templates/skills/similarity-search-patterns/SKILL.md +0 -558
  245. package/templates/skills/slo-implementation/SKILL.md +0 -329
  246. package/templates/skills/sql-optimization-patterns/SKILL.md +0 -493
  247. package/templates/skills/stripe-integration/SKILL.md +0 -442
  248. package/templates/skills/systematic-debugging/SKILL.md +0 -57
  249. package/templates/skills/tailwind-design-system/SKILL.md +0 -666
  250. package/templates/skills/temporal-python-testing/SKILL.md +0 -158
  251. package/templates/skills/temporal-python-testing/resources/integration-testing.md +0 -455
  252. package/templates/skills/temporal-python-testing/resources/local-setup.md +0 -553
  253. package/templates/skills/temporal-python-testing/resources/replay-testing.md +0 -462
  254. package/templates/skills/temporal-python-testing/resources/unit-testing.md +0 -328
  255. package/templates/skills/terraform-module-library/SKILL.md +0 -249
  256. package/templates/skills/terraform-module-library/references/aws-modules.md +0 -63
  257. package/templates/skills/test-driven-development/SKILL.md +0 -46
  258. package/templates/skills/threat-mitigation-mapping/SKILL.md +0 -745
  259. package/templates/skills/track-management/SKILL.md +0 -593
  260. package/templates/skills/typescript-advanced-types/SKILL.md +0 -717
  261. package/templates/skills/ui-ux-pro-max/SKILL.md +0 -352
  262. package/templates/skills/ui-ux-pro-max/data/charts.csv +0 -26
  263. package/templates/skills/ui-ux-pro-max/data/colors.csv +0 -97
  264. package/templates/skills/ui-ux-pro-max/data/icons.csv +0 -101
  265. package/templates/skills/ui-ux-pro-max/data/landing.csv +0 -31
  266. package/templates/skills/ui-ux-pro-max/data/products.csv +0 -97
  267. package/templates/skills/ui-ux-pro-max/data/prompts.csv +0 -24
  268. package/templates/skills/ui-ux-pro-max/data/react-performance.csv +0 -45
  269. package/templates/skills/ui-ux-pro-max/data/styles.csv +0 -59
  270. package/templates/skills/ui-ux-pro-max/data/typography.csv +0 -58
  271. package/templates/skills/ui-ux-pro-max/data/ui-reasoning.csv +0 -101
  272. package/templates/skills/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
  273. package/templates/skills/ui-ux-pro-max/data/web-interface.csv +0 -31
  274. package/templates/skills/ui-ux-pro-max/scripts/core.py +0 -258
  275. package/templates/skills/ui-ux-pro-max/scripts/design_system.py +0 -547
  276. package/templates/skills/ui-ux-pro-max/scripts/search.py +0 -76
  277. package/templates/skills/uv-package-manager/SKILL.md +0 -831
  278. package/templates/skills/vector-index-tuning/SKILL.md +0 -521
  279. package/templates/skills/wcag-audit-patterns/SKILL.md +0 -555
  280. package/templates/skills/workflow-orchestration-patterns/SKILL.md +0 -316
  281. package/templates/skills/workflow-patterns/SKILL.md +0 -623
  282. package/templates/skills/writing-plans/SKILL.md +0 -64
@@ -1,428 +0,0 @@
1
- ---
2
- name: architecture-decision-records
3
- description: Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation. Use when documenting significant technical decisions, reviewing past architectural choices, or establishing decision processes.
4
- ---
5
-
6
- # Architecture Decision Records
7
-
8
- Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the context and rationale behind significant technical decisions.
9
-
10
- ## When to Use This Skill
11
-
12
- - Making significant architectural decisions
13
- - Documenting technology choices
14
- - Recording design trade-offs
15
- - Onboarding new team members
16
- - Reviewing historical decisions
17
- - Establishing decision-making processes
18
-
19
- ## Core Concepts
20
-
21
- ### 1. What is an ADR?
22
-
23
- An Architecture Decision Record captures:
24
- - **Context**: Why we needed to make a decision
25
- - **Decision**: What we decided
26
- - **Consequences**: What happens as a result
27
-
28
- ### 2. When to Write an ADR
29
-
30
- | Write ADR | Skip ADR |
31
- |-----------|----------|
32
- | New framework adoption | Minor version upgrades |
33
- | Database technology choice | Bug fixes |
34
- | API design patterns | Implementation details |
35
- | Security architecture | Routine maintenance |
36
- | Integration patterns | Configuration changes |
37
-
38
- ### 3. ADR Lifecycle
39
-
40
- ```
41
- Proposed → Accepted → Deprecated → Superseded
42
-
43
- Rejected
44
- ```
45
-
46
- ## Templates
47
-
48
- ### Template 1: Standard ADR (MADR Format)
49
-
50
- ```markdown
51
- # ADR-0001: Use PostgreSQL as Primary Database
52
-
53
- ## Status
54
-
55
- Accepted
56
-
57
- ## Context
58
-
59
- We need to select a primary database for our new e-commerce platform. The system
60
- will handle:
61
- - ~10,000 concurrent users
62
- - Complex product catalog with hierarchical categories
63
- - Transaction processing for orders and payments
64
- - Full-text search for products
65
- - Geospatial queries for store locator
66
-
67
- The team has experience with MySQL, PostgreSQL, and MongoDB. We need ACID
68
- compliance for financial transactions.
69
-
70
- ## Decision Drivers
71
-
72
- * **Must have ACID compliance** for payment processing
73
- * **Must support complex queries** for reporting
74
- * **Should support full-text search** to reduce infrastructure complexity
75
- * **Should have good JSON support** for flexible product attributes
76
- * **Team familiarity** reduces onboarding time
77
-
78
- ## Considered Options
79
-
80
- ### Option 1: PostgreSQL
81
- - **Pros**: ACID compliant, excellent JSON support (JSONB), built-in full-text
82
- search, PostGIS for geospatial, team has experience
83
- - **Cons**: Slightly more complex replication setup than MySQL
84
-
85
- ### Option 2: MySQL
86
- - **Pros**: Very familiar to team, simple replication, large community
87
- - **Cons**: Weaker JSON support, no built-in full-text search (need
88
- Elasticsearch), no geospatial without extensions
89
-
90
- ### Option 3: MongoDB
91
- - **Pros**: Flexible schema, native JSON, horizontal scaling
92
- - **Cons**: No ACID for multi-document transactions (at decision time),
93
- team has limited experience, requires schema design discipline
94
-
95
- ## Decision
96
-
97
- We will use **PostgreSQL 15** as our primary database.
98
-
99
- ## Rationale
100
-
101
- PostgreSQL provides the best balance of:
102
- 1. **ACID compliance** essential for e-commerce transactions
103
- 2. **Built-in capabilities** (full-text search, JSONB, PostGIS) reduce
104
- infrastructure complexity
105
- 3. **Team familiarity** with SQL databases reduces learning curve
106
- 4. **Mature ecosystem** with excellent tooling and community support
107
-
108
- The slight complexity in replication is outweighed by the reduction in
109
- additional services (no separate Elasticsearch needed).
110
-
111
- ## Consequences
112
-
113
- ### Positive
114
- - Single database handles transactions, search, and geospatial queries
115
- - Reduced operational complexity (fewer services to manage)
116
- - Strong consistency guarantees for financial data
117
- - Team can leverage existing SQL expertise
118
-
119
- ### Negative
120
- - Need to learn PostgreSQL-specific features (JSONB, full-text search syntax)
121
- - Vertical scaling limits may require read replicas sooner
122
- - Some team members need PostgreSQL-specific training
123
-
124
- ### Risks
125
- - Full-text search may not scale as well as dedicated search engines
126
- - Mitigation: Design for potential Elasticsearch addition if needed
127
-
128
- ## Implementation Notes
129
-
130
- - Use JSONB for flexible product attributes
131
- - Implement connection pooling with PgBouncer
132
- - Set up streaming replication for read replicas
133
- - Use pg_trgm extension for fuzzy search
134
-
135
- ## Related Decisions
136
-
137
- - ADR-0002: Caching Strategy (Redis) - complements database choice
138
- - ADR-0005: Search Architecture - may supersede if Elasticsearch needed
139
-
140
- ## References
141
-
142
- - [PostgreSQL JSON Documentation](https://www.postgresql.org/docs/current/datatype-json.html)
143
- - [PostgreSQL Full Text Search](https://www.postgresql.org/docs/current/textsearch.html)
144
- - Internal: Performance benchmarks in `/docs/benchmarks/database-comparison.md`
145
- ```
146
-
147
- ### Template 2: Lightweight ADR
148
-
149
- ```markdown
150
- # ADR-0012: Adopt TypeScript for Frontend Development
151
-
152
- **Status**: Accepted
153
- **Date**: 2024-01-15
154
- **Deciders**: @alice, @bob, @charlie
155
-
156
- ## Context
157
-
158
- Our React codebase has grown to 50+ components with increasing bug reports
159
- related to prop type mismatches and undefined errors. PropTypes provide
160
- runtime-only checking.
161
-
162
- ## Decision
163
-
164
- Adopt TypeScript for all new frontend code. Migrate existing code incrementally.
165
-
166
- ## Consequences
167
-
168
- **Good**: Catch type errors at compile time, better IDE support, self-documenting
169
- code.
170
-
171
- **Bad**: Learning curve for team, initial slowdown, build complexity increase.
172
-
173
- **Mitigations**: TypeScript training sessions, allow gradual adoption with
174
- `allowJs: true`.
175
- ```
176
-
177
- ### Template 3: Y-Statement Format
178
-
179
- ```markdown
180
- # ADR-0015: API Gateway Selection
181
-
182
- In the context of **building a microservices architecture**,
183
- facing **the need for centralized API management, authentication, and rate limiting**,
184
- we decided for **Kong Gateway**
185
- and against **AWS API Gateway and custom Nginx solution**,
186
- to achieve **vendor independence, plugin extensibility, and team familiarity with Lua**,
187
- accepting that **we need to manage Kong infrastructure ourselves**.
188
- ```
189
-
190
- ### Template 4: ADR for Deprecation
191
-
192
- ```markdown
193
- # ADR-0020: Deprecate MongoDB in Favor of PostgreSQL
194
-
195
- ## Status
196
-
197
- Accepted (Supersedes ADR-0003)
198
-
199
- ## Context
200
-
201
- ADR-0003 (2021) chose MongoDB for user profile storage due to schema flexibility
202
- needs. Since then:
203
- - MongoDB's multi-document transactions remain problematic for our use case
204
- - Our schema has stabilized and rarely changes
205
- - We now have PostgreSQL expertise from other services
206
- - Maintaining two databases increases operational burden
207
-
208
- ## Decision
209
-
210
- Deprecate MongoDB and migrate user profiles to PostgreSQL.
211
-
212
- ## Migration Plan
213
-
214
- 1. **Phase 1** (Week 1-2): Create PostgreSQL schema, dual-write enabled
215
- 2. **Phase 2** (Week 3-4): Backfill historical data, validate consistency
216
- 3. **Phase 3** (Week 5): Switch reads to PostgreSQL, monitor
217
- 4. **Phase 4** (Week 6): Remove MongoDB writes, decommission
218
-
219
- ## Consequences
220
-
221
- ### Positive
222
- - Single database technology reduces operational complexity
223
- - ACID transactions for user data
224
- - Team can focus PostgreSQL expertise
225
-
226
- ### Negative
227
- - Migration effort (~4 weeks)
228
- - Risk of data issues during migration
229
- - Lose some schema flexibility
230
-
231
- ## Lessons Learned
232
-
233
- Document from ADR-0003 experience:
234
- - Schema flexibility benefits were overestimated
235
- - Operational cost of multiple databases was underestimated
236
- - Consider long-term maintenance in technology decisions
237
- ```
238
-
239
- ### Template 5: Request for Comments (RFC) Style
240
-
241
- ```markdown
242
- # RFC-0025: Adopt Event Sourcing for Order Management
243
-
244
- ## Summary
245
-
246
- Propose adopting event sourcing pattern for the order management domain to
247
- improve auditability, enable temporal queries, and support business analytics.
248
-
249
- ## Motivation
250
-
251
- Current challenges:
252
- 1. Audit requirements need complete order history
253
- 2. "What was the order state at time X?" queries are impossible
254
- 3. Analytics team needs event stream for real-time dashboards
255
- 4. Order state reconstruction for customer support is manual
256
-
257
- ## Detailed Design
258
-
259
- ### Event Store
260
-
261
- ```
262
- OrderCreated { orderId, customerId, items[], timestamp }
263
- OrderItemAdded { orderId, item, timestamp }
264
- OrderItemRemoved { orderId, itemId, timestamp }
265
- PaymentReceived { orderId, amount, paymentId, timestamp }
266
- OrderShipped { orderId, trackingNumber, timestamp }
267
- ```
268
-
269
- ### Projections
270
-
271
- - **CurrentOrderState**: Materialized view for queries
272
- - **OrderHistory**: Complete timeline for audit
273
- - **DailyOrderMetrics**: Analytics aggregation
274
-
275
- ### Technology
276
-
277
- - Event Store: EventStoreDB (purpose-built, handles projections)
278
- - Alternative considered: Kafka + custom projection service
279
-
280
- ## Drawbacks
281
-
282
- - Learning curve for team
283
- - Increased complexity vs. CRUD
284
- - Need to design events carefully (immutable once stored)
285
- - Storage growth (events never deleted)
286
-
287
- ## Alternatives
288
-
289
- 1. **Audit tables**: Simpler but doesn't enable temporal queries
290
- 2. **CDC from existing DB**: Complex, doesn't change data model
291
- 3. **Hybrid**: Event source only for order state changes
292
-
293
- ## Unresolved Questions
294
-
295
- - [ ] Event schema versioning strategy
296
- - [ ] Retention policy for events
297
- - [ ] Snapshot frequency for performance
298
-
299
- ## Implementation Plan
300
-
301
- 1. Prototype with single order type (2 weeks)
302
- 2. Team training on event sourcing (1 week)
303
- 3. Full implementation and migration (4 weeks)
304
- 4. Monitoring and optimization (ongoing)
305
-
306
- ## References
307
-
308
- - [Event Sourcing by Martin Fowler](https://martinfowler.com/eaaDev/EventSourcing.html)
309
- - [EventStoreDB Documentation](https://www.eventstore.com/docs)
310
- ```
311
-
312
- ## ADR Management
313
-
314
- ### Directory Structure
315
-
316
- ```
317
- docs/
318
- ├── adr/
319
- │ ├── README.md # Index and guidelines
320
- │ ├── template.md # Team's ADR template
321
- │ ├── 0001-use-postgresql.md
322
- │ ├── 0002-caching-strategy.md
323
- │ ├── 0003-mongodb-user-profiles.md # [DEPRECATED]
324
- │ └── 0020-deprecate-mongodb.md # Supersedes 0003
325
- ```
326
-
327
- ### ADR Index (README.md)
328
-
329
- ```markdown
330
- # Architecture Decision Records
331
-
332
- This directory contains Architecture Decision Records (ADRs) for [Project Name].
333
-
334
- ## Index
335
-
336
- | ADR | Title | Status | Date |
337
- |-----|-------|--------|------|
338
- | [0001](0001-use-postgresql.md) | Use PostgreSQL as Primary Database | Accepted | 2024-01-10 |
339
- | [0002](0002-caching-strategy.md) | Caching Strategy with Redis | Accepted | 2024-01-12 |
340
- | [0003](0003-mongodb-user-profiles.md) | MongoDB for User Profiles | Deprecated | 2023-06-15 |
341
- | [0020](0020-deprecate-mongodb.md) | Deprecate MongoDB | Accepted | 2024-01-15 |
342
-
343
- ## Creating a New ADR
344
-
345
- 1. Copy `template.md` to `NNNN-title-with-dashes.md`
346
- 2. Fill in the template
347
- 3. Submit PR for review
348
- 4. Update this index after approval
349
-
350
- ## ADR Status
351
-
352
- - **Proposed**: Under discussion
353
- - **Accepted**: Decision made, implementing
354
- - **Deprecated**: No longer relevant
355
- - **Superseded**: Replaced by another ADR
356
- - **Rejected**: Considered but not adopted
357
- ```
358
-
359
- ### Automation (adr-tools)
360
-
361
- ```bash
362
- # Install adr-tools
363
- brew install adr-tools
364
-
365
- # Initialize ADR directory
366
- adr init docs/adr
367
-
368
- # Create new ADR
369
- adr new "Use PostgreSQL as Primary Database"
370
-
371
- # Supersede an ADR
372
- adr new -s 3 "Deprecate MongoDB in Favor of PostgreSQL"
373
-
374
- # Generate table of contents
375
- adr generate toc > docs/adr/README.md
376
-
377
- # Link related ADRs
378
- adr link 2 "Complements" 1 "Is complemented by"
379
- ```
380
-
381
- ## Review Process
382
-
383
- ```markdown
384
- ## ADR Review Checklist
385
-
386
- ### Before Submission
387
- - [ ] Context clearly explains the problem
388
- - [ ] All viable options considered
389
- - [ ] Pros/cons balanced and honest
390
- - [ ] Consequences (positive and negative) documented
391
- - [ ] Related ADRs linked
392
-
393
- ### During Review
394
- - [ ] At least 2 senior engineers reviewed
395
- - [ ] Affected teams consulted
396
- - [ ] Security implications considered
397
- - [ ] Cost implications documented
398
- - [ ] Reversibility assessed
399
-
400
- ### After Acceptance
401
- - [ ] ADR index updated
402
- - [ ] Team notified
403
- - [ ] Implementation tickets created
404
- - [ ] Related documentation updated
405
- ```
406
-
407
- ## Best Practices
408
-
409
- ### Do's
410
- - **Write ADRs early** - Before implementation starts
411
- - **Keep them short** - 1-2 pages maximum
412
- - **Be honest about trade-offs** - Include real cons
413
- - **Link related decisions** - Build decision graph
414
- - **Update status** - Deprecate when superseded
415
-
416
- ### Don'ts
417
- - **Don't change accepted ADRs** - Write new ones to supersede
418
- - **Don't skip context** - Future readers need background
419
- - **Don't hide failures** - Rejected decisions are valuable
420
- - **Don't be vague** - Specific decisions, specific consequences
421
- - **Don't forget implementation** - ADR without action is waste
422
-
423
- ## Resources
424
-
425
- - [Documenting Architecture Decisions (Michael Nygard)](https://cognitect.com/blog/2011/11/15/documenting-architecture-decisions)
426
- - [MADR Template](https://adr.github.io/madr/)
427
- - [ADR GitHub Organization](https://adr.github.io/)
428
- - [adr-tools](https://github.com/npryce/adr-tools)