trinity-method-sdk 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/LICENSE +21 -0
  3. package/README.md +555 -0
  4. package/dist/cli/commands/deploy/agents.d.ts +14 -0
  5. package/dist/cli/commands/deploy/agents.js +59 -0
  6. package/dist/cli/commands/deploy/ci-cd.d.ts +13 -0
  7. package/dist/cli/commands/deploy/ci-cd.js +50 -0
  8. package/dist/cli/commands/deploy/claude-setup.d.ts +17 -0
  9. package/dist/cli/commands/deploy/claude-setup.js +91 -0
  10. package/dist/cli/commands/deploy/configuration.d.ts +13 -0
  11. package/dist/cli/commands/deploy/configuration.js +215 -0
  12. package/dist/cli/commands/deploy/directories.d.ts +12 -0
  13. package/dist/cli/commands/deploy/directories.js +38 -0
  14. package/dist/cli/commands/deploy/gitignore.d.ts +12 -0
  15. package/dist/cli/commands/deploy/gitignore.js +53 -0
  16. package/dist/cli/commands/deploy/index.d.ts +38 -0
  17. package/dist/cli/commands/deploy/index.js +156 -0
  18. package/dist/cli/commands/deploy/knowledge-base.d.ts +16 -0
  19. package/dist/cli/commands/deploy/knowledge-base.js +75 -0
  20. package/dist/cli/commands/deploy/linting.d.ts +18 -0
  21. package/dist/cli/commands/deploy/linting.js +51 -0
  22. package/dist/cli/commands/deploy/metrics.d.ts +13 -0
  23. package/dist/cli/commands/deploy/metrics.js +34 -0
  24. package/dist/cli/commands/deploy/pre-flight.d.ts +13 -0
  25. package/dist/cli/commands/deploy/pre-flight.js +29 -0
  26. package/dist/cli/commands/deploy/root-files.d.ts +16 -0
  27. package/dist/cli/commands/deploy/root-files.js +178 -0
  28. package/dist/cli/commands/deploy/sdk-install.d.ts +12 -0
  29. package/dist/cli/commands/deploy/sdk-install.js +57 -0
  30. package/dist/cli/commands/deploy/summary.d.ts +14 -0
  31. package/dist/cli/commands/deploy/summary.js +130 -0
  32. package/dist/cli/commands/deploy/templates.d.ts +14 -0
  33. package/dist/cli/commands/deploy/templates.js +84 -0
  34. package/dist/cli/commands/deploy/types.d.ts +39 -0
  35. package/dist/cli/commands/deploy/types.js +5 -0
  36. package/dist/cli/commands/update/agents.d.ts +14 -0
  37. package/dist/cli/commands/update/agents.js +31 -0
  38. package/dist/cli/commands/update/backup.d.ts +31 -0
  39. package/dist/cli/commands/update/backup.js +97 -0
  40. package/dist/cli/commands/update/commands.d.ts +14 -0
  41. package/dist/cli/commands/update/commands.js +75 -0
  42. package/dist/cli/commands/update/index.d.ts +15 -0
  43. package/dist/cli/commands/update/index.js +118 -0
  44. package/dist/cli/commands/update/knowledge-base.d.ts +14 -0
  45. package/dist/cli/commands/update/knowledge-base.js +38 -0
  46. package/dist/cli/commands/update/pre-flight.d.ts +13 -0
  47. package/dist/cli/commands/update/pre-flight.js +37 -0
  48. package/dist/cli/commands/update/summary.d.ts +20 -0
  49. package/dist/cli/commands/update/summary.js +47 -0
  50. package/dist/cli/commands/update/templates.d.ts +14 -0
  51. package/dist/cli/commands/update/templates.js +25 -0
  52. package/dist/cli/commands/update/types.d.ts +13 -0
  53. package/dist/cli/commands/update/types.js +7 -0
  54. package/dist/cli/commands/update/utils.d.ts +11 -0
  55. package/dist/cli/commands/update/utils.js +19 -0
  56. package/dist/cli/commands/update/verification.d.ts +20 -0
  57. package/dist/cli/commands/update/verification.js +54 -0
  58. package/dist/cli/commands/update/version.d.ts +18 -0
  59. package/dist/cli/commands/update/version.js +36 -0
  60. package/dist/cli/commands/update.d.ts +7 -0
  61. package/dist/cli/commands/update.js +7 -0
  62. package/dist/cli/index.d.ts +3 -0
  63. package/dist/cli/index.js +36 -0
  64. package/dist/cli/types.d.ts +77 -0
  65. package/dist/cli/types.js +5 -0
  66. package/dist/cli/utils/deploy-ci.d.ts +22 -0
  67. package/dist/cli/utils/deploy-ci.js +138 -0
  68. package/dist/cli/utils/deploy-linting.d.ts +3 -0
  69. package/dist/cli/utils/deploy-linting.js +136 -0
  70. package/dist/cli/utils/detect-stack.d.ts +3 -0
  71. package/dist/cli/utils/detect-stack.js +270 -0
  72. package/dist/cli/utils/error-classes.d.ts +63 -0
  73. package/dist/cli/utils/error-classes.js +84 -0
  74. package/dist/cli/utils/error-handler.d.ts +59 -0
  75. package/dist/cli/utils/error-handler.js +127 -0
  76. package/dist/cli/utils/errors.d.ts +52 -0
  77. package/dist/cli/utils/errors.js +102 -0
  78. package/dist/cli/utils/get-sdk-path.d.ts +18 -0
  79. package/dist/cli/utils/get-sdk-path.js +31 -0
  80. package/dist/cli/utils/inject-dependencies.d.ts +2 -0
  81. package/dist/cli/utils/inject-dependencies.js +55 -0
  82. package/dist/cli/utils/linting-tools.d.ts +8 -0
  83. package/dist/cli/utils/linting-tools.js +206 -0
  84. package/dist/cli/utils/metrics/code-quality.d.ts +32 -0
  85. package/dist/cli/utils/metrics/code-quality.js +122 -0
  86. package/dist/cli/utils/metrics/dependency-parser.d.ts +21 -0
  87. package/dist/cli/utils/metrics/dependency-parser.js +153 -0
  88. package/dist/cli/utils/metrics/file-complexity.d.ts +26 -0
  89. package/dist/cli/utils/metrics/file-complexity.js +77 -0
  90. package/dist/cli/utils/metrics/framework-detector.d.ts +17 -0
  91. package/dist/cli/utils/metrics/framework-detector.js +120 -0
  92. package/dist/cli/utils/metrics/git-metrics.d.ts +30 -0
  93. package/dist/cli/utils/metrics/git-metrics.js +83 -0
  94. package/dist/cli/utils/metrics/index.d.ts +28 -0
  95. package/dist/cli/utils/metrics/index.js +100 -0
  96. package/dist/cli/utils/template-processor.d.ts +10 -0
  97. package/dist/cli/utils/template-processor.js +188 -0
  98. package/dist/cli/utils/validate-path.d.ts +80 -0
  99. package/dist/cli/utils/validate-path.js +180 -0
  100. package/dist/index.d.ts +6 -0
  101. package/dist/index.js +8 -0
  102. package/dist/templates/agents/aj-team/apo-documentation-specialist.md.template +572 -0
  103. package/dist/templates/agents/aj-team/bas-quality-gate.md.template +906 -0
  104. package/dist/templates/agents/aj-team/bon-dependency-manager.md.template +636 -0
  105. package/dist/templates/agents/aj-team/cap-configuration-specialist.md.template +670 -0
  106. package/dist/templates/agents/aj-team/dra-code-reviewer.md.template +768 -0
  107. package/dist/templates/agents/aj-team/kil-task-executor.md.template +764 -0
  108. package/dist/templates/agents/aj-team/uro-refactoring-specialist.md.template +759 -0
  109. package/dist/templates/agents/audit/juno-auditor.md.template +447 -0
  110. package/dist/templates/agents/deployment/ein-cicd.md.template +694 -0
  111. package/dist/templates/agents/deployment/ino-context.md.template +733 -0
  112. package/dist/templates/agents/deployment/tan-structure.md.template +661 -0
  113. package/dist/templates/agents/deployment/zen-knowledge.md.template +451 -0
  114. package/dist/templates/agents/leadership/aj-cc.md.template +462 -0
  115. package/dist/templates/agents/leadership/aj-maestro.md.template +943 -0
  116. package/dist/templates/agents/leadership/aly-cto.md.template +407 -0
  117. package/dist/templates/agents/planning/eus-decomposer.md.template +496 -0
  118. package/dist/templates/agents/planning/mon-requirements.md.template +323 -0
  119. package/dist/templates/agents/planning/ror-design.md.template +465 -0
  120. package/dist/templates/agents/planning/tra-planner.md.template +432 -0
  121. package/dist/templates/ci/cd.yml.template +175 -0
  122. package/dist/templates/ci/ci.yml.template +196 -0
  123. package/dist/templates/ci/generic-ci.yml +115 -0
  124. package/dist/templates/ci/github-actions.yml +86 -0
  125. package/dist/templates/ci/gitlab-ci.yml +103 -0
  126. package/dist/templates/claude/EMPLOYEE-DIRECTORY.md.template +545 -0
  127. package/dist/templates/documentation/ROOT-README.md.template +307 -0
  128. package/dist/templates/documentation/SUBDIRECTORY-README.md.template +261 -0
  129. package/dist/templates/investigations/bug.md.template +484 -0
  130. package/dist/templates/investigations/feature.md.template +564 -0
  131. package/dist/templates/investigations/performance.md.template +625 -0
  132. package/dist/templates/investigations/security.md.template +714 -0
  133. package/dist/templates/investigations/technical.md.template +433 -0
  134. package/dist/templates/knowledge-base/AI-DEVELOPMENT-GUIDE.md.template +957 -0
  135. package/dist/templates/knowledge-base/ARCHITECTURE.md.template +452 -0
  136. package/dist/templates/knowledge-base/CODING-PRINCIPLES.md.template +750 -0
  137. package/dist/templates/knowledge-base/DOCUMENTATION-CRITERIA.md.template +1118 -0
  138. package/dist/templates/knowledge-base/ISSUES.md.template +539 -0
  139. package/dist/templates/knowledge-base/TESTING-PRINCIPLES.md.template +894 -0
  140. package/dist/templates/knowledge-base/Technical-Debt.md.template +640 -0
  141. package/dist/templates/knowledge-base/To-do.md.template +407 -0
  142. package/dist/templates/knowledge-base/Trinity.md.template +464 -0
  143. package/dist/templates/linting/flutter/.pre-commit-config.yaml.template +27 -0
  144. package/dist/templates/linting/flutter/analysis_options.yaml.template +26 -0
  145. package/dist/templates/linting/nodejs/.eslintrc-commonjs.json.template +19 -0
  146. package/dist/templates/linting/nodejs/.eslintrc-esm.json.template +19 -0
  147. package/dist/templates/linting/nodejs/.eslintrc-typescript.json.template +22 -0
  148. package/dist/templates/linting/nodejs/.pre-commit-config.yaml.template +51 -0
  149. package/dist/templates/linting/nodejs/.prettierrc.json.template +10 -0
  150. package/dist/templates/linting/python/.flake8.template +16 -0
  151. package/dist/templates/linting/python/.pre-commit-config.yaml.template +30 -0
  152. package/dist/templates/linting/python/pyproject.toml.template +38 -0
  153. package/dist/templates/linting/rust/.pre-commit-config.yaml.template +28 -0
  154. package/dist/templates/linting/rust/clippy.toml.template +14 -0
  155. package/dist/templates/linting/rust/rustfmt.toml.template +12 -0
  156. package/dist/templates/root/CLAUDE.md.template +65 -0
  157. package/dist/templates/root/TRINITY.md.template +52 -0
  158. package/dist/templates/shared/claude-commands/trinity-agents.md.template +168 -0
  159. package/dist/templates/shared/claude-commands/trinity-audit.md.template +646 -0
  160. package/dist/templates/shared/claude-commands/trinity-changelog.md.template +624 -0
  161. package/dist/templates/shared/claude-commands/trinity-continue.md.template +549 -0
  162. package/dist/templates/shared/claude-commands/trinity-create-investigation.md.template +232 -0
  163. package/dist/templates/shared/claude-commands/trinity-decompose.md.template +181 -0
  164. package/dist/templates/shared/claude-commands/trinity-design.md.template +347 -0
  165. package/dist/templates/shared/claude-commands/trinity-docs.md.template +2093 -0
  166. package/dist/templates/shared/claude-commands/trinity-end.md.template +397 -0
  167. package/dist/templates/shared/claude-commands/trinity-init.md.template +606 -0
  168. package/dist/templates/shared/claude-commands/trinity-investigate-templates.md.template +725 -0
  169. package/dist/templates/shared/claude-commands/trinity-orchestrate.md.template +1061 -0
  170. package/dist/templates/shared/claude-commands/trinity-plan-investigation.md.template +135 -0
  171. package/dist/templates/shared/claude-commands/trinity-plan.md.template +201 -0
  172. package/dist/templates/shared/claude-commands/trinity-readme.md.template +1971 -0
  173. package/dist/templates/shared/claude-commands/trinity-requirements.md.template +148 -0
  174. package/dist/templates/shared/claude-commands/trinity-start.md.template +268 -0
  175. package/dist/templates/shared/claude-commands/trinity-verify.md.template +453 -0
  176. package/dist/templates/shared/claude-commands/trinity-workorder.md.template +249 -0
  177. package/dist/templates/source/base-CLAUDE.md.template +310 -0
  178. package/dist/templates/source/flutter-CLAUDE.md.template +593 -0
  179. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -0
  180. package/dist/templates/source/python-CLAUDE.md.template +510 -0
  181. package/dist/templates/source/react-CLAUDE.md.template +513 -0
  182. package/dist/templates/source/rust-CLAUDE.md.template +653 -0
  183. package/dist/templates/source/tests-CLAUDE.md.template +432 -0
  184. package/dist/templates/trinity/CLAUDE.md.template +372 -0
  185. package/dist/templates/work-orders/ANALYSIS-TEMPLATE.md.template +276 -0
  186. package/dist/templates/work-orders/AUDIT-TEMPLATE.md.template +262 -0
  187. package/dist/templates/work-orders/IMPLEMENTATION-TEMPLATE.md.template +260 -0
  188. package/dist/templates/work-orders/INVESTIGATION-TEMPLATE.md.template +206 -0
  189. package/dist/templates/work-orders/PATTERN-TEMPLATE.md.template +320 -0
  190. package/dist/templates/work-orders/VERIFICATION-TEMPLATE.md.template +273 -0
  191. package/package.json +94 -0
@@ -0,0 +1,452 @@
1
+ # {{PROJECT_NAME}} Architecture
2
+ **Trinity Method v2.0**
3
+ **Technology Stack**: {{TECHNOLOGY_STACK}}
4
+ **Framework**: {{PRIMARY_FRAMEWORK}}
5
+ **Last Updated**: {{CURRENT_DATE}}
6
+
7
+ ---
8
+
9
+ ## SYSTEM OVERVIEW
10
+
11
+ ### Technology Profile
12
+ ```{{LANGUAGE}}
13
+ const {{PROJECT_VAR_NAME}}Stack = {
14
+ framework: '{{PRIMARY_FRAMEWORK}}',
15
+ language: '{{LANGUAGE}}',
16
+ backend: '{{BACKEND_FRAMEWORK}}',
17
+ database: '{{DATABASE_TYPE}}',
18
+ authentication: '{{AUTH_TYPE}}',
19
+ styling: '{{STYLING_SOLUTION}}',
20
+ testing: '{{TESTING_FRAMEWORK}}',
21
+ buildTool: '{{BUILD_TOOL}}',
22
+ deployment: '{{DEPLOYMENT_PLATFORM}}'
23
+ };
24
+ ```
25
+
26
+ ### Repository Structure
27
+ ```
28
+ {{PROJECT_NAME}}/
29
+ ├── {{SOURCE_DIR}}/ # Main source code
30
+ ├── trinity/ # Trinity Method implementation
31
+ │ ├── knowledge-base/ # Architecture & documentation
32
+ ├── tests/ # Test suites
33
+ └── docs/ # Additional documentation
34
+ ```
35
+
36
+ ---
37
+
38
+ ## COMPONENT ARCHITECTURE
39
+
40
+ ### Core Components
41
+ | Component | Responsibility | Dependencies | Status |
42
+ |-----------|---------------|--------------|---------|
43
+ | {{COMPONENT_1}} | {{RESPONSIBILITY_1}} | {{DEPS_1}} | {{STATUS_1}} |
44
+ | {{COMPONENT_2}} | {{RESPONSIBILITY_2}} | {{DEPS_2}} | {{STATUS_2}} |
45
+ | {{COMPONENT_3}} | {{RESPONSIBILITY_3}} | {{DEPS_3}} | {{STATUS_3}} |
46
+
47
+ ### {{FRAMEWORK}}-Specific Architecture
48
+ - **Component Pattern**: {{COMPONENT_PATTERN}}
49
+ - **State Management**: {{STATE_MANAGEMENT}}
50
+ - **Routing Strategy**: {{ROUTING_STRATEGY}}
51
+ - **Data Flow Pattern**: {{DATA_FLOW_PATTERN}}
52
+
53
+ ### Integration Points
54
+ ```yaml
55
+ Internal_Integrations:
56
+ - Component: {{INTERNAL_1}}
57
+ Protocol: {{PROTOCOL_1}}
58
+ Data_Format: {{FORMAT_1}}
59
+
60
+ External_Integrations:
61
+ - Service: {{EXTERNAL_1}}
62
+ API_Type: {{API_TYPE_1}}
63
+ Authentication: {{AUTH_METHOD_1}}
64
+ ```
65
+
66
+ ---
67
+
68
+ ## DATA ARCHITECTURE
69
+
70
+ ### Data Models
71
+ ```{{LANGUAGE}}
72
+ // Core data structures
73
+ {{DATA_MODEL_EXAMPLE}}
74
+ ```
75
+
76
+ ### Database Schema
77
+ - **Primary Database**: {{DATABASE_TYPE}}
78
+ - **Schema Version**: {{SCHEMA_VERSION}}
79
+ - **Migration Strategy**: {{MIGRATION_STRATEGY}}
80
+
81
+ ### Data Flow
82
+ 1. **Input Layer**: {{INPUT_DESCRIPTION}}
83
+ 2. **Processing Layer**: {{PROCESSING_DESCRIPTION}}
84
+ 3. **Storage Layer**: {{STORAGE_DESCRIPTION}}
85
+ 4. **Output Layer**: {{OUTPUT_DESCRIPTION}}
86
+
87
+ ---
88
+
89
+ ## API ARCHITECTURE
90
+
91
+ ### API Design Pattern
92
+ - **Pattern**: {{API_PATTERN}} (REST/GraphQL/RPC)
93
+ - **Version**: {{API_VERSION}}
94
+ - **Documentation**: {{API_DOCS_LOCATION}}
95
+
96
+ ### Endpoint Structure
97
+ ```
98
+ {{API_BASE_URL}}/
99
+ ├── /auth/ # Authentication endpoints
100
+ ├── /api/v1/ # Main API endpoints
101
+ ├── /admin/ # Administrative endpoints
102
+ └── /health/ # Health check endpoints
103
+ ```
104
+
105
+ ### Authentication & Authorization
106
+ - **Auth Method**: {{AUTH_METHOD}}
107
+ - **Token Type**: {{TOKEN_TYPE}}
108
+ - **Session Management**: {{SESSION_MANAGEMENT}}
109
+ - **Permission Model**: {{PERMISSION_MODEL}}
110
+
111
+ ---
112
+
113
+ ## PERFORMANCE ARCHITECTURE
114
+
115
+ ### Performance Baselines
116
+ ```yaml
117
+ Performance_Targets:
118
+ Initial_Load: <{{LOAD_TIME_TARGET}}ms
119
+ API_Response: <{{API_RESPONSE_TARGET}}ms
120
+ Database_Query: <{{DB_QUERY_TARGET}}ms
121
+ Memory_Usage: <{{MEMORY_TARGET}}MB
122
+ CPU_Usage: <{{CPU_TARGET}}%
123
+ ```
124
+
125
+ ### Optimization Strategies
126
+ 1. **Caching**: {{CACHING_STRATEGY}}
127
+ 2. **Bundle Optimization**: {{BUNDLE_STRATEGY}}
128
+ 3. **Lazy Loading**: {{LAZY_LOADING_STRATEGY}}
129
+ 4. **Database Indexing**: {{INDEXING_STRATEGY}}
130
+
131
+ ### Monitoring Points
132
+ - Application Performance Monitoring (APM)
133
+ - Error tracking and alerting
134
+ - Performance metrics dashboard
135
+ - User experience metrics
136
+
137
+ ---
138
+
139
+ ## SECURITY ARCHITECTURE
140
+
141
+ ### Security Layers
142
+ 1. **Network Security**: {{NETWORK_SECURITY}}
143
+ 2. **Application Security**: {{APP_SECURITY}}
144
+ 3. **Data Security**: {{DATA_SECURITY}}
145
+ 4. **Infrastructure Security**: {{INFRA_SECURITY}}
146
+
147
+ ### Security Measures
148
+ ```yaml
149
+ Input_Validation:
150
+ - Type: {{VALIDATION_TYPE}}
151
+ - Library: {{VALIDATION_LIBRARY}}
152
+
153
+ Encryption:
154
+ - At_Rest: {{ENCRYPTION_AT_REST}}
155
+ - In_Transit: {{ENCRYPTION_IN_TRANSIT}}
156
+
157
+ Access_Control:
158
+ - Method: {{ACCESS_CONTROL_METHOD}}
159
+ - Granularity: {{ACCESS_GRANULARITY}}
160
+ ```
161
+
162
+ ---
163
+
164
+ ## DEPLOYMENT ARCHITECTURE
165
+
166
+ ### Deployment Environment
167
+ - **Development**: {{DEV_ENVIRONMENT}}
168
+ - **Staging**: {{STAGING_ENVIRONMENT}}
169
+ - **Production**: {{PROD_ENVIRONMENT}}
170
+
171
+ ### CI/CD Pipeline
172
+ ```yaml
173
+ Pipeline_Stages:
174
+ 1_Build:
175
+ - Compile code
176
+ - Run linters
177
+ - Generate assets
178
+
179
+ 2_Test:
180
+ - Unit tests
181
+ - Integration tests
182
+ - E2E tests
183
+
184
+ 3_Deploy:
185
+ - Environment validation
186
+ - Deployment execution
187
+ - Health checks
188
+ ```
189
+
190
+ ### Infrastructure
191
+ - **Hosting**: {{HOSTING_PROVIDER}}
192
+ - **Container**: {{CONTAINER_TECH}}
193
+ - **Orchestration**: {{ORCHESTRATION}}
194
+ - **Monitoring**: {{MONITORING_TOOLS}}
195
+
196
+ ---
197
+
198
+ ## SCALABILITY ARCHITECTURE
199
+
200
+ ### Current Capacity
201
+ - **Users**: {{CURRENT_USER_CAPACITY}}
202
+ - **Requests/sec**: {{CURRENT_RPS}}
203
+ - **Data Volume**: {{CURRENT_DATA_VOLUME}}
204
+
205
+ ### Scaling Strategy
206
+ 1. **Horizontal Scaling**: {{H_SCALING_STRATEGY}}
207
+ 2. **Vertical Scaling**: {{V_SCALING_STRATEGY}}
208
+ 3. **Database Scaling**: {{DB_SCALING_STRATEGY}}
209
+ 4. **Caching Layer**: {{CACHE_SCALING_STRATEGY}}
210
+
211
+ ### Bottleneck Analysis
212
+ | Component | Current Limit | Scaling Solution | Priority |
213
+ |-----------|--------------|------------------|----------|
214
+ | {{BOTTLENECK_1}} | {{LIMIT_1}} | {{SOLUTION_1}} | {{PRIORITY_1}} |
215
+ | {{BOTTLENECK_2}} | {{LIMIT_2}} | {{SOLUTION_2}} | {{PRIORITY_2}} |
216
+
217
+ ---
218
+
219
+ ## TESTING ARCHITECTURE
220
+
221
+ ### Test Strategy
222
+ ```yaml
223
+ Test_Coverage_Targets:
224
+ Unit_Tests: >{{UNIT_COVERAGE}}%
225
+ Integration_Tests: >{{INTEGRATION_COVERAGE}}%
226
+ E2E_Tests: Critical paths
227
+
228
+ Test_Execution:
229
+ Pre_Commit: Unit tests
230
+ Pre_Merge: All tests
231
+ Nightly: Full regression
232
+ ```
233
+
234
+ ### Testing Framework
235
+ - **Unit Testing**: {{UNIT_TEST_FRAMEWORK}}
236
+ - **Integration Testing**: {{INTEGRATION_TEST_FRAMEWORK}}
237
+ - **E2E Testing**: {{E2E_TEST_FRAMEWORK}}
238
+ - **Performance Testing**: {{PERF_TEST_FRAMEWORK}}
239
+
240
+ ---
241
+
242
+ ## MAINTENANCE ARCHITECTURE
243
+
244
+ ### Logging Strategy
245
+ - **Log Levels**: {{LOG_LEVELS}}
246
+ - **Log Aggregation**: {{LOG_AGGREGATION}}
247
+ - **Log Retention**: {{LOG_RETENTION}}
248
+
249
+ ### Error Handling
250
+ ```{{LANGUAGE}}
251
+ // Error handling pattern
252
+ {{ERROR_HANDLING_PATTERN}}
253
+ ```
254
+
255
+ ### Debugging Architecture
256
+ - **Debug Points**: Entry/Exit logging in all functions
257
+ - **Debug Tools**: {{DEBUG_TOOLS}}
258
+ - **Profiling Tools**: {{PROFILING_TOOLS}}
259
+
260
+ ---
261
+
262
+ ## TECHNICAL DECISIONS LOG
263
+
264
+ ### Key Decisions Made
265
+ 1. **{{DECISION_1}}**: {{RATIONALE_1}}
266
+ 2. **{{DECISION_2}}**: {{RATIONALE_2}}
267
+ 3. **{{DECISION_3}}**: {{RATIONALE_3}}
268
+
269
+ ### Technology Constraints
270
+ - {{CONSTRAINT_1}}
271
+ - {{CONSTRAINT_2}}
272
+ - {{CONSTRAINT_3}}
273
+
274
+ ---
275
+
276
+ ## ARCHITECTURE EVOLUTION
277
+
278
+ ### Planned Improvements
279
+ 1. **Short-term** (Next Sprint):
280
+ - {{SHORT_TERM_1}}
281
+ - {{SHORT_TERM_2}}
282
+
283
+ 2. **Medium-term** (Next Quarter):
284
+ - {{MEDIUM_TERM_1}}
285
+ - {{MEDIUM_TERM_2}}
286
+
287
+ 3. **Long-term** (Next Year):
288
+ - {{LONG_TERM_1}}
289
+ - {{LONG_TERM_2}}
290
+
291
+ ### Migration Path
292
+ ```mermaid
293
+ graph LR
294
+ A[Current State] --> B[Phase 1]
295
+ B --> C[Phase 2]
296
+ C --> D[Target State]
297
+ ```
298
+
299
+ ---
300
+
301
+ ## TRINITY METHOD INTEGRATION
302
+
303
+ ### Investigation Points
304
+ - Component boundaries for investigation
305
+ - Data flow checkpoints
306
+ - Integration test points
307
+ - Performance monitoring locations
308
+
309
+ ### Knowledge Capture
310
+ - Architecture decisions recorded here
311
+ - Patterns documented in trinity/patterns/
312
+ - Issues tracked in trinity/knowledge-base/ISSUES.md
313
+ - Sessions archived in trinity/sessions/
314
+
315
+ ---
316
+
317
+ ## 📝 WHEN TO UPDATE THIS DOCUMENT
318
+
319
+ This is a **living document** that should be updated throughout development to maintain accuracy.
320
+
321
+ ### Immediate Updates Required ⚠️
322
+
323
+ Update **within the same session** when:
324
+
325
+ - ✅ **New Components Added**: Add to Component Architecture table with dependencies and status
326
+ - ✅ **Technology Stack Changes**: Update Technology Profile (framework version, new libraries, tools)
327
+ - ✅ **API Changes**: Modify endpoint structure, add new APIs, change authentication method
328
+ - ✅ **New Integrations**: Add external service integrations to Integration Points
329
+ - ✅ **Architectural Refactoring**: Component reorganization, pattern changes, layer modifications
330
+ - ✅ **Major Architectural Decisions**: Add to Technical Decisions Log with rationale
331
+ - ✅ **Database Schema Changes**: Update Data Models, schema version, migration strategy
332
+ - ✅ **Performance Baseline Changes**: Update after optimization or when targets change
333
+
334
+ ### Regular Updates (Weekly) ⏰
335
+
336
+ Review and update during sprint planning or `/trinity-end`:
337
+
338
+ - Component status changes (in development → testing → production)
339
+ - Deployment environment updates
340
+ - Monitoring and alerting configuration changes
341
+ - Scaling strategy adjustments based on usage data
342
+ - Security measures updates (new vulnerabilities addressed)
343
+
344
+ ### Quarterly Reviews 📅
345
+
346
+ Deep architectural review and validation:
347
+
348
+ - Architecture evolution planning (next quarter roadmap)
349
+ - Technology constraint reassessment
350
+ - Bottleneck analysis update
351
+ - Migration path validation
352
+ - Long-term improvement planning
353
+
354
+ ### Cross-Document Update Triggers 🔗
355
+
356
+ **When updating ARCHITECTURE.md, also check:**
357
+
358
+ - **[ISSUES.md](./ISSUES.md)**: Add known issues for new components, document architectural issues discovered
359
+ - **[Technical-Debt.md](./Technical-Debt.md)**: Document architectural debt from shortcuts or legacy decisions
360
+ - **[To-do.md](./To-do.md)**: Add tasks for incomplete architecture work (testing, documentation, monitoring)
361
+ - **[CODING-PRINCIPLES.md](./CODING-PRINCIPLES.md)**: Update if component patterns establish new coding standards
362
+ - **[TESTING-PRINCIPLES.md](./TESTING-PRINCIPLES.md)**: Update if new component types need new testing strategies
363
+
364
+ ### Update Scenarios - What to Change
365
+
366
+ **Scenario: Added New Component**
367
+ ```yaml
368
+ Updates_Required:
369
+ - Component_Architecture_Table: Add new row with component details
370
+ - Integration_Points: Add if component integrates with external services
371
+ - Data_Flow: Update if component processes data
372
+ - API_Architecture: Add if component exposes endpoints
373
+ - Testing_Architecture: Add component test strategy
374
+ - Cross_References:
375
+ - ISSUES.md: Document any known component issues
376
+ - To-do.md: Add component testing/documentation tasks
377
+ ```
378
+
379
+ **Scenario: Framework/Technology Upgrade**
380
+ ```yaml
381
+ Updates_Required:
382
+ - Technology_Profile: Update framework version and dependencies
383
+ - Framework_Specific_Architecture: Update patterns for new version
384
+ - Performance_Baselines: Re-benchmark with new framework
385
+ - Testing_Framework: Update test setup for new version
386
+ - Technical_Decisions_Log: Document upgrade rationale
387
+ - Migration_Path: Add upgrade steps for future reference
388
+ - Cross_References:
389
+ - Technical-Debt.md: Mark deprecated patterns as resolved
390
+ - CODING-PRINCIPLES.md: Update framework-specific examples
391
+ ```
392
+
393
+ **Scenario: Performance Optimization**
394
+ ```yaml
395
+ Updates_Required:
396
+ - Performance_Baselines: Update with new metrics
397
+ - Optimization_Strategies: Document what optimization was applied
398
+ - Monitoring_Points: Add new performance metrics if needed
399
+ - Bottleneck_Analysis: Update resolved bottlenecks
400
+ - Cross_References:
401
+ - Technical-Debt.md: Mark performance debt as resolved
402
+ - ISSUES.md: Close performance-related issues
403
+ ```
404
+
405
+ **Scenario: New External Integration**
406
+ ```yaml
407
+ Updates_Required:
408
+ - Integration_Points: Add external service details
409
+ - API_Architecture: Document integration API usage
410
+ - Security_Architecture: Add authentication/authorization for integration
411
+ - Deployment_Architecture: Add integration environment config
412
+ - Cross_References:
413
+ - To-do.md: Add integration testing tasks
414
+ - ISSUES.md: Document integration limitations/issues
415
+ ```
416
+
417
+ ### How to Update
418
+
419
+ **Step-by-step process:**
420
+
421
+ 1. **Identify Section**: Find the relevant section based on what changed
422
+ 2. **Update Content**: Make specific changes (don't just update timestamp)
423
+ 3. **Verify Placeholders**: Ensure no `{{VARIABLE}}` syntax introduced
424
+ 4. **Check Cross-References**: Update related documents if needed
425
+ 5. **Update Timestamp**: Set `Last Updated: {{CURRENT_DATE}}` to actual date
426
+ 6. **Git Commit**: Commit with message like "docs: update ARCHITECTURE.md - added UserAuth component"
427
+
428
+ **Quality Checklist:**
429
+ - [ ] Changes are specific and meaningful (not generic)
430
+ - [ ] All component names consistent across document
431
+ - [ ] Cross-references to other files are valid
432
+ - [ ] Metrics and values are from actual project (not examples)
433
+ - [ ] Related documents updated (ISSUES, Technical-Debt, To-do)
434
+
435
+ ### When NOT to Update ❌
436
+
437
+ **Don't update if:**
438
+ - Only code comments changed (architecture unchanged)
439
+ - Minor bug fixes that don't affect architecture
440
+ - Code refactoring within existing components (no component changes)
441
+ - Test additions that don't change test architecture
442
+ - Documentation updates in code (no architectural documentation needed)
443
+
444
+ **Stale timestamps are okay** if architecture genuinely hasn't changed. Don't update just to update.
445
+
446
+ ---
447
+
448
+ **Document Status**: Living Documentation
449
+ **Update Frequency**: As needed (session-based)
450
+ **Maintained By**: Development team using Trinity Method
451
+ **Referenced By**: `/trinity-end` command for session updates
452
+ **Last Updated**: {{CURRENT_DATE}}