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,539 @@
1
+ # ISSUES.md - {{PROJECT_NAME}}
2
+ **Trinity Method v2.0 - Issue Intelligence System**
3
+ **Technology Stack**: {{TECHNOLOGY_STACK}}
4
+ **Framework**: {{PRIMARY_FRAMEWORK}}
5
+ **Last Updated**: {{CURRENT_DATE}}
6
+
7
+ ---
8
+
9
+ ## 🔴 ACTIVE ISSUES
10
+
11
+ ### Critical (P0) - Immediate Action Required
12
+ ```yaml
13
+ Issue_ID: {{PROJECT_PREFIX}}-C001
14
+ Title: {{CRITICAL_ISSUE_TITLE}}
15
+ Component: {{AFFECTED_COMPONENT}}
16
+ Impact: {{IMPACT_DESCRIPTION}}
17
+ Status: ACTIVE
18
+ First_Seen: {{DATE}}
19
+ Last_Seen: {{DATE}}
20
+ Occurrences: {{COUNT}}
21
+
22
+ Symptoms:
23
+ - {{SYMPTOM_1}}
24
+ - {{SYMPTOM_2}}
25
+
26
+ Root_Cause: {{ROOT_CAUSE}}
27
+
28
+ Investigation_Path:
29
+ 1. {{INVESTIGATION_STEP_1}}
30
+ 2. {{INVESTIGATION_STEP_2}}
31
+ 3. {{INVESTIGATION_STEP_3}}
32
+
33
+ Solution:
34
+ ```{{LANGUAGE}}
35
+ {{SOLUTION_CODE}}
36
+ ```
37
+
38
+ Prevention:
39
+ - {{PREVENTION_1}}
40
+ - {{PREVENTION_2}}
41
+ ```
42
+
43
+ ### High Priority (P1) - Core Functionality
44
+ [High priority issues affecting core features]
45
+
46
+ ### Medium Priority (P2) - User Experience
47
+ [Issues affecting user experience but not blocking]
48
+
49
+ ### Low Priority (P3) - Enhancements
50
+ [Minor issues and improvement opportunities]
51
+
52
+ ---
53
+
54
+ ## 📊 {{FRAMEWORK}}-SPECIFIC PATTERNS
55
+
56
+ ### Common {{FRAMEWORK}} Issues
57
+
58
+ #### Pattern: {{FRAMEWORK_PATTERN_1}}
59
+ **Frequency**: HIGH
60
+ **Impact**: Performance/Functionality/Security
61
+ **Category**: {{CATEGORY}}
62
+
63
+ **Problem Description**:
64
+ {{PROBLEM_DESCRIPTION}}
65
+
66
+ **Typical Symptoms**:
67
+ 1. {{SYMPTOM_1}}
68
+ 2. {{SYMPTOM_2}}
69
+ 3. {{SYMPTOM_3}}
70
+
71
+ **Investigation Approach**:
72
+ ```bash
73
+ # {{FRAMEWORK}} specific investigation
74
+ {{INVESTIGATION_COMMANDS}}
75
+ ```
76
+
77
+ **Known Solutions**:
78
+ ```{{LANGUAGE}}
79
+ // {{FRAMEWORK}} specific solution
80
+ {{SOLUTION_PATTERN}}
81
+ ```
82
+
83
+ **Prevention Measures**:
84
+ - {{PREVENTION_MEASURE_1}}
85
+ - {{PREVENTION_MEASURE_2}}
86
+ - {{PREVENTION_MEASURE_3}}
87
+
88
+ **Related Issues**: [{{RELATED_ISSUE_IDS}}]
89
+
90
+ ---
91
+
92
+ ## 🌍 UNIVERSAL DEVELOPMENT PATTERNS
93
+
94
+ ### State Management Issues
95
+
96
+ #### Pattern: State Synchronization Failure
97
+ **Frequency**: MEDIUM
98
+ **Impact**: Data Integrity
99
+ **Applicable To**: All frameworks with state management
100
+
101
+ **Problem**: State becomes out of sync between components
102
+ **Root Causes**:
103
+ 1. Race conditions in async operations
104
+ 2. Improper state mutation
105
+ 3. Missing state update propagation
106
+
107
+ **Universal Solution Pattern**:
108
+ ```{{LANGUAGE}}
109
+ // State synchronization pattern
110
+ {{STATE_SYNC_PATTERN}}
111
+ ```
112
+
113
+ ### Performance Optimization Patterns
114
+
115
+ #### Pattern: Render Performance Degradation
116
+ **Frequency**: HIGH
117
+ **Impact**: User Experience
118
+
119
+ **Detection**:
120
+ ```javascript
121
+ // Performance monitoring
122
+ const performanceMonitor = {
123
+ measureRender: (component) => {
124
+ const startTime = performance.now();
125
+ // Render logic
126
+ const endTime = performance.now();
127
+ if (endTime - startTime > THRESHOLD) {
128
+ console.warn(`Slow render: ${component}`);
129
+ }
130
+ }
131
+ };
132
+ ```
133
+
134
+ ### Security Patterns
135
+
136
+ #### Pattern: Input Validation Bypass
137
+ **Frequency**: MEDIUM
138
+ **Impact**: CRITICAL
139
+
140
+ **Prevention Strategy**:
141
+ ```{{LANGUAGE}}
142
+ // Input validation pattern
143
+ {{VALIDATION_PATTERN}}
144
+ ```
145
+
146
+ ---
147
+
148
+ ## 🔬 TRINITY METHOD PATTERNS
149
+
150
+ ### Investigation Protocol Issues
151
+
152
+ #### Pattern: Investigation Scope Creep
153
+ **Frequency**: HIGH
154
+ **Impact**: Development Velocity
155
+
156
+ **Problem**: Investigations expand beyond intended scope
157
+ **Solution**:
158
+ 1. Set strict time boxes (30 min max)
159
+ 2. Document tangential findings separately
160
+ 3. Create follow-up investigations
161
+
162
+ ### Knowledge Capture Issues
163
+
164
+ #### Pattern: Pattern Documentation Lag
165
+ **Frequency**: MEDIUM
166
+ **Impact**: Knowledge Reuse
167
+
168
+ **Problem**: Patterns discovered but not documented immediately
169
+ **Solution**:
170
+ - Document patterns within the same session
171
+ - Use pattern template immediately
172
+ - Link to investigation that discovered it
173
+
174
+ ---
175
+
176
+ ## 📈 ISSUE METRICS
177
+
178
+ ### Pattern Recognition Statistics
179
+ ```yaml
180
+ Total_Patterns_Identified: {{COUNT}}
181
+ Patterns_This_Month: {{COUNT}}
182
+ Most_Frequent_Pattern: {{PATTERN_NAME}}
183
+ Success_Rate: {{PERCENTAGE}}%
184
+
185
+ By_Category:
186
+ Performance: {{COUNT}}
187
+ Security: {{COUNT}}
188
+ State_Management: {{COUNT}}
189
+ Integration: {{COUNT}}
190
+ UI_UX: {{COUNT}}
191
+ ```
192
+
193
+ ### Issue Resolution Metrics
194
+ ```yaml
195
+ Average_Resolution_Time:
196
+ P0_Critical: {{TIME}}
197
+ P1_High: {{TIME}}
198
+ P2_Medium: {{TIME}}
199
+ P3_Low: {{TIME}}
200
+
201
+ First_Time_Fix_Rate: {{PERCENTAGE}}%
202
+ Regression_Rate: {{PERCENTAGE}}%
203
+ Pattern_Prevention_Rate: {{PERCENTAGE}}%
204
+ ```
205
+
206
+ ### Recurrence Tracking
207
+ | Issue Pattern | First Seen | Last Seen | Occurrences | Status |
208
+ |--------------|------------|-----------|-------------|---------|
209
+ | {{PATTERN_1}} | {{DATE}} | {{DATE}} | {{COUNT}} | {{STATUS}} |
210
+ | {{PATTERN_2}} | {{DATE}} | {{DATE}} | {{COUNT}} | {{STATUS}} |
211
+
212
+ ---
213
+
214
+ ## 🛠️ INVESTIGATION QUEUE
215
+
216
+ ### Pending Investigations
217
+ 1. **{{INVESTIGATION_1}}**
218
+ - Scope: {{SCOPE}}
219
+ - Estimated Time: {{TIME}}
220
+ - Dependencies: {{DEPENDENCIES}}
221
+
222
+ 2. **{{INVESTIGATION_2}}**
223
+ - Scope: {{SCOPE}}
224
+ - Estimated Time: {{TIME}}
225
+ - Dependencies: {{DEPENDENCIES}}
226
+
227
+ ### Completed Investigations (This Session)
228
+ - [x] {{COMPLETED_1}} - See: trinity/investigations/{{DATE}}-{{INVESTIGATION}}.md
229
+ - [x] {{COMPLETED_2}} - See: trinity/investigations/{{DATE}}-{{INVESTIGATION}}.md
230
+
231
+ ---
232
+
233
+ ## 🔄 ISSUE LIFECYCLE
234
+
235
+ ### Issue States
236
+ ```mermaid
237
+ graph LR
238
+ A[Discovered] --> B[Investigated]
239
+ B --> C[Documented]
240
+ C --> D[Solution Implemented]
241
+ D --> E[Verified]
242
+ E --> F[Pattern Extracted]
243
+ F --> G[Closed]
244
+ ```
245
+
246
+ ### State Definitions
247
+ 1. **Discovered**: Issue identified but not investigated
248
+ 2. **Investigated**: Root cause analysis complete
249
+ 3. **Documented**: Full documentation in ISSUES.md
250
+ 4. **Solution Implemented**: Fix applied to codebase
251
+ 5. **Verified**: Fix confirmed working
252
+ 6. **Pattern Extracted**: Reusable pattern documented
253
+ 7. **Closed**: Issue resolved and knowledge captured
254
+
255
+ ---
256
+
257
+ ## 📝 ISSUE TEMPLATE
258
+
259
+ ```yaml
260
+ Issue_ID: {{PROJECT_PREFIX}}-{{CATEGORY}}{{NUMBER}}
261
+ Title: {{DESCRIPTIVE_TITLE}}
262
+ Component: {{AFFECTED_COMPONENT}}
263
+ Framework_Specific: {{YES/NO}}
264
+ Impact: {{CRITICAL/HIGH/MEDIUM/LOW}}
265
+ Status: {{ACTIVE/INVESTIGATING/RESOLVED}}
266
+
267
+ Discovery:
268
+ Date: {{DATE}}
269
+ Discovered_By: {{METHOD/PERSON}}
270
+ Session: {{SESSION_ID}}
271
+
272
+ Symptoms:
273
+ - {{SYMPTOM_1}}
274
+ - {{SYMPTOM_2}}
275
+
276
+ Root_Cause_Analysis:
277
+ Investigation_Time: {{MINUTES}}
278
+ Root_Cause: {{DESCRIPTION}}
279
+ Contributing_Factors: [{{LIST}}]
280
+
281
+ Solution:
282
+ Implementation_Time: {{MINUTES}}
283
+ Code_Changes: {{FILES_CHANGED}}
284
+ Tests_Added: {{TEST_COUNT}}
285
+
286
+ Prevention:
287
+ Pattern_Created: {{YES/NO}}
288
+ Pattern_Location: trinity/patterns/{{PATTERN_FILE}}
289
+ Guidelines_Updated: {{YES/NO}}
290
+
291
+ Metrics:
292
+ Recurrence_Risk: {{HIGH/MEDIUM/LOW}}
293
+ Similar_Issues_Prevented: {{COUNT}}
294
+ ```
295
+
296
+ ---
297
+
298
+ ## 🎯 PREVENTION STRATEGIES
299
+
300
+ ### Proactive Measures by Category
301
+
302
+ #### Performance Issues
303
+ 1. Implement performance monitoring from start
304
+ 2. Set up automated performance testing
305
+ 3. Regular performance audits
306
+
307
+ #### State Management Issues
308
+ 1. Define clear state ownership
309
+ 2. Implement state validation
310
+ 3. Use immutable state patterns
311
+
312
+ #### Security Issues
313
+ 1. Input validation on all boundaries
314
+ 2. Regular security scanning
315
+ 3. Security review checklist
316
+
317
+ #### Integration Issues
318
+ 1. Contract testing between components
319
+ 2. Mock external dependencies
320
+ 3. Integration test suite
321
+
322
+ ---
323
+
324
+ ## 📊 WEEKLY ISSUE REVIEW
325
+
326
+ ### Issues This Week
327
+ - **New Issues**: {{COUNT}}
328
+ - **Resolved Issues**: {{COUNT}}
329
+ - **Patterns Discovered**: {{COUNT}}
330
+ - **Investigations Completed**: {{COUNT}}
331
+
332
+ ### Trending Patterns
333
+ 1. {{TRENDING_PATTERN_1}} - {{OCCURRENCE_INCREASE}}%
334
+ 2. {{TRENDING_PATTERN_2}} - {{OCCURRENCE_INCREASE}}%
335
+
336
+ ### Action Items
337
+ - [ ] Investigate {{HIGH_PRIORITY_PATTERN}}
338
+ - [ ] Document {{UNDOCUMENTED_PATTERN}}
339
+ - [ ] Implement prevention for {{RECURRING_ISSUE}}
340
+
341
+ ---
342
+
343
+ ## 🔗 RELATED DOCUMENTS
344
+
345
+ - **Technical-Debt.md**: Detailed debt tracking
346
+ - **ARCHITECTURE.md**: System design and components
347
+ - **Trinity.md**: Methodology implementation
348
+ - **To-do.md**: Pending fixes and improvements
349
+ - **Pattern Library**: trinity/patterns/
350
+
351
+ ---
352
+
353
+ ## 📝 WHEN TO UPDATE THIS DOCUMENT
354
+
355
+ This is a **living issue intelligence system** that should be updated continuously to capture patterns and prevent recurring issues.
356
+
357
+ ### Immediate Updates Required ⚠️
358
+
359
+ Update **as soon as discovered** (real-time):
360
+
361
+ - ✅ **New Issue Discovered**: Add to Active Issues with full details (symptoms, root cause, solution)
362
+ - ✅ **Issue Resolved**: Move from Active to documented pattern, mark resolution date
363
+ - ✅ **Pattern Recognized**: When same issue appears 2+ times, create pattern entry
364
+ - ✅ **Investigation Complete**: Link investigation file, add root cause analysis
365
+ - ✅ **New Framework Issue**: Add to {{FRAMEWORK}}-Specific Patterns section
366
+ - ✅ **Universal Pattern Found**: Add to Universal Development Patterns (applies to all frameworks)
367
+ - ✅ **Trinity Method Issue**: Document methodology issues in Trinity Method Patterns
368
+
369
+ ### Session Updates (Via `/trinity-end`) 🔄
370
+
371
+ Update at end of each development session:
372
+
373
+ - Close resolved issues from current session
374
+ - Add new issues encountered during session
375
+ - Update issue metrics (resolution time, recurrence rate)
376
+ - Update pattern frequency counts
377
+ - Link to completed investigations
378
+ - Update weekly issue review section
379
+ - Refresh trending patterns analysis
380
+
381
+ ### Weekly Reviews ⏰
382
+
383
+ Track issue trends and prevention effectiveness:
384
+
385
+ - Review issues added this week
386
+ - Calculate pattern prevention success rate
387
+ - Identify trending patterns (increasing occurrences)
388
+ - Update action items for high-priority patterns
389
+ - Assess investigation queue priorities
390
+
391
+ ### Monthly Audits 📅
392
+
393
+ Deep pattern analysis and prevention strategy:
394
+
395
+ - Pattern effectiveness review (which patterns prevent most issues)
396
+ - Update prevention strategies based on learnings
397
+ - Consolidate similar patterns
398
+ - Archive resolved patterns that haven't recurred
399
+ - Measure issue recurrence rate
400
+
401
+ ### Cross-Document Update Triggers 🔗
402
+
403
+ **When updating ISSUES.md, also check:**
404
+
405
+ - **[Technical-Debt.md](./Technical-Debt.md)**: Add technical debt items for issues that reveal debt
406
+ - **[To-do.md](./To-do.md)**: Create tasks to fix active issues or implement prevention
407
+ - **[ARCHITECTURE.md](./ARCHITECTURE.md)**: Update if issue reveals architectural problem
408
+ - **[Trinity.md](./Trinity.md)**: Update investigation protocols if new investigation approach discovered
409
+ - **[CODING-PRINCIPLES.md](./CODING-PRINCIPLES.md)**: Add principle if issue reveals coding standard gap
410
+ - **[TESTING-PRINCIPLES.md](./TESTING-PRINCIPLES.md)**: Add test requirement if issue was missed by tests
411
+
412
+ ### Update Scenarios - What to Change
413
+
414
+ **Scenario: Bug Found During Development**
415
+ ```yaml
416
+ Updates_Required:
417
+ - Active_Issues: Add new issue with P0/P1/P2/P3 priority
418
+ - Issue_Template: Fill with symptoms, root cause, solution
419
+ - Pattern_Check: Is this a recurring issue? Create pattern if yes
420
+ - Investigation_Link: Link to trinity/investigations/ file if investigation done
421
+ - Cross_References:
422
+ - To-do.md: Add fix task with priority
423
+ - Technical-Debt.md: Add debt if issue reveals shortcuts
424
+ ```
425
+
426
+ **Scenario: Issue Resolved**
427
+ ```yaml
428
+ Updates_Required:
429
+ - Active_Issues: Remove from active section
430
+ - Pattern_Extraction: If issue can recur, create pattern template
431
+ - Issue_Metrics: Update resolution metrics
432
+ - Prevention_Strategy: Add prevention measures to relevant section
433
+ - Cross_References:
434
+ - To-do.md: Mark related task complete
435
+ - Technical-Debt.md: Mark related debt resolved
436
+ ```
437
+
438
+ **Scenario: Pattern Recognized (3+ occurrences)**
439
+ ```yaml
440
+ Updates_Required:
441
+ - Pattern_Section: Create new pattern entry or update existing
442
+ - Pattern_Frequency: Update occurrence count
443
+ - Related_Issues: Link all issue IDs that match this pattern
444
+ - Prevention_Measures: Document how to prevent this pattern
445
+ - Pattern_Library: Create pattern file in trinity/patterns/
446
+ - Cross_References:
447
+ - Technical-Debt.md: Link pattern to debt if applicable
448
+ - CODING-PRINCIPLES.md: Add principle if pattern reveals standard gap
449
+ ```
450
+
451
+ **Scenario: Investigation Completed**
452
+ ```yaml
453
+ Updates_Required:
454
+ - Issue_Entry: Add investigation findings to root cause section
455
+ - Investigation_Queue: Remove from pending, add to completed
456
+ - Pattern_Discovery: Create pattern if investigation revealed one
457
+ - Resolution_Path: Document solution from investigation
458
+ - Cross_References:
459
+ - Trinity.md: Link investigation file
460
+ - Pattern_Library: Create pattern file if reusable solution found
461
+ ```
462
+
463
+ **Scenario: Framework-Specific Issue Found**
464
+ ```yaml
465
+ Updates_Required:
466
+ - Framework_Specific_Patterns: Add issue to {{FRAMEWORK}} section
467
+ - Frequency_Tracking: Mark as HIGH/MEDIUM/LOW based on likelihood
468
+ - Known_Solutions: Add framework-specific solution code
469
+ - Prevention_Measures: Add framework best practices to prevent
470
+ - Cross_References:
471
+ - AI-DEVELOPMENT-GUIDE.md: Update if framework workflow needs adjustment
472
+ ```
473
+
474
+ ### How to Update
475
+
476
+ **Step-by-step process:**
477
+
478
+ 1. **Categorize Issue**: Is it Critical/High/Medium/Low priority? Framework-specific or universal?
479
+ 2. **Document Completely**: Fill issue template with all details (don't leave partial entries)
480
+ 3. **Check for Patterns**: Search document for similar issues (2+ = pattern)
481
+ 4. **Link Investigation**: If investigation file exists, link it
482
+ 5. **Update Metrics**: Increment counts, update averages
483
+ 6. **Cross-Reference**: Update related documents (To-do, Technical-Debt, etc.)
484
+ 7. **Pattern Library**: Create trinity/patterns/ file if reusable solution
485
+ 8. **Update Timestamp**: Set `Last Updated: {{CURRENT_DATE}}` to actual date
486
+
487
+ **Quality Checklist:**
488
+ - [ ] Issue has complete symptoms, root cause, and solution
489
+ - [ ] Priority matches impact (P0 = production down, P1 = core feature broken, etc.)
490
+ - [ ] Pattern frequency accurate (count all occurrences)
491
+ - [ ] Links to investigation files valid
492
+ - [ ] Cross-references to other docs updated
493
+ - [ ] Prevention measures actionable
494
+
495
+ ### When NOT to Update ❌
496
+
497
+ **Don't add to ISSUES.md if:**
498
+ - Simple typo fixes (not a pattern)
499
+ - Expected behavior misunderstood (user error, not issue)
500
+ - Third-party library bugs (document in ARCHITECTURE dependencies instead)
501
+ - One-time environment issues (not reproducible)
502
+ - Feature requests (add to To-do.md instead)
503
+
504
+ **When to merge issues:**
505
+ - If two issues have same root cause, merge into single pattern
506
+ - Update pattern frequency count to reflect all occurrences
507
+
508
+ ### Issue vs. Debt vs. Todo 🤔
509
+
510
+ **Add to ISSUES.md when:**
511
+ - Bug that can recur
512
+ - Pattern that should be prevented
513
+ - Framework-specific problem to watch for
514
+
515
+ **Add to Technical-Debt.md when:**
516
+ - Code quality problem (TODOs, complexity, coverage)
517
+ - Known shortcut that needs refactoring
518
+ - Accumulating technical burden
519
+
520
+ **Add to To-do.md when:**
521
+ - Task to complete
522
+ - Feature to implement
523
+ - One-time action item
524
+
525
+ **Many items belong in multiple documents** (issue + debt + todo for fix).
526
+
527
+ ---
528
+
529
+ **Document Status**: Living Issue Intelligence System
530
+ **Update Frequency**: Real-time (as issues discovered) + session-based
531
+ **Maintained By**: Development team using Trinity Method
532
+ **Referenced By**: `/trinity-end` command for session updates
533
+ **Pattern Library**: Creates trinity/patterns/ files
534
+ **Last Updated**: {{CURRENT_DATE}}
535
+
536
+ ---
537
+
538
+ *Issue tracking powered by Trinity Method v2.0*
539
+ *Continuous pattern recognition and prevention system*