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,372 @@
1
+ # CLAUDE.md - Trinity Method Enforcement
2
+ ## {{PROJECT_NAME}} - Trinity Protocols
3
+
4
+ **Framework:** {{FRAMEWORK}}
5
+ **Trinity Version:** {{TRINITY_VERSION}}
6
+ **Source Directory:** {{SOURCE_DIR}}
7
+
8
+ ---
9
+
10
+ ## Trinity Method Core Principles
11
+
12
+ ### The Fundamental Law
13
+ **"No updates without investigation. No changes without Trinity consensus. No shortcuts without consequences."**
14
+
15
+ ### Investigation-First Requirements
16
+ - **Mandatory Investigation**: Every code change, feature addition, or bug fix must begin with thorough investigation
17
+ - **Evidence-Based Decisions**: All implementation decisions backed by documented evidence
18
+ - **Pattern Recognition**: Leverage existing patterns and solutions from knowledge base
19
+ - **Quality Gates**: No code moves forward without passing all Trinity quality standards
20
+
21
+ ### ⚠️ CRITICAL: Investigation vs Implementation Protocol
22
+
23
+ **INVESTIGATIONS ARE READ-ONLY:**
24
+ - Investigations analyze, document, and report findings ONLY
25
+ - **NO file modifications** during investigations
26
+ - **NO code implementations** during investigations
27
+ - **NO fixes applied** during investigations
28
+
29
+ **IMPLEMENTATIONS ARE SEPARATE:**
30
+ - Implementation happens ONLY after investigation is complete
31
+ - Implementation requires explicit user approval
32
+ - User must explicitly request implementation based on investigation findings
33
+ - Never assume investigation = permission to implement
34
+
35
+ ---
36
+
37
+ ## Session Workflow Protocols
38
+
39
+ ### Session Initialization
40
+ ```markdown
41
+ ## Required Steps at Session Start:
42
+ 1. Load project context from ../CLAUDE.md
43
+ 2. Review outstanding tasks in knowledge-base/To-do.md
44
+ 3. Check system health and performance metrics
45
+ 4. Update dependencies if needed
46
+ 5. Verify integrity checks
47
+ 6. Initialize debugging frameworks
48
+ 7. Load Trinity knowledge base patterns
49
+ ```
50
+
51
+ ### Session Completion
52
+ ```markdown
53
+ ## Required Steps at Session End:
54
+ 1. Document all changes in knowledge-base/ARCHITECTURE.md
55
+ 2. Update knowledge-base/To-do.md with completed/new items
56
+ 3. Record new issues and patterns in knowledge-base/ISSUES.md
57
+ 4. Plan next session requirements
58
+ 5. Update performance metrics
59
+ 6. Archive session artifacts to sessions/
60
+ 7. Update Technical-Debt.md with any new debt identified
61
+ ```
62
+
63
+ ### Session Artifacts Management
64
+ ```yaml
65
+ Session Artifacts:
66
+ Location: trinity/sessions/[YYYY-MM-DD]-[HHMMSS]/
67
+ Required Files:
68
+ - SESSION-SUMMARY.md # Session overview and accomplishments
69
+ - investigation-summary.md # What was investigated
70
+ - patterns-discovered.md # New patterns found
71
+ - issues-resolved.md # Problems solved
72
+ - performance-report.md # Metrics and baselines
73
+ - next-session-plan.md # Planning for continuation
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Crisis Management Protocols
79
+
80
+ ### Console Error Crisis Protocol
81
+ ```markdown
82
+ ## Immediate Response for Console Errors:
83
+ 1. STOP all development activity
84
+ 2. Capture complete error stack trace
85
+ 3. Investigate root cause using Trinity Method
86
+ 4. Document error pattern in knowledge-base/ISSUES.md
87
+ 5. Implement comprehensive debugging
88
+ 6. Verify fix with extensive testing
89
+ 7. Update error prevention measures
90
+ 8. Resume development only after verification
91
+ ```
92
+
93
+ ### Performance Crisis Protocol
94
+ ```markdown
95
+ ## Response for Performance Degradation:
96
+ 1. Measure current performance metrics
97
+ 2. Compare against established baselines in ../CLAUDE.md
98
+ 3. Identify performance bottlenecks
99
+ 4. Investigate using Trinity methodology
100
+ 5. Implement targeted optimizations
101
+ 6. Validate improvements with metrics
102
+ 7. Update performance baselines
103
+ 8. Document optimization patterns
104
+ ```
105
+
106
+ ### Data Integrity Crisis Protocol
107
+ ```markdown
108
+ ## Response for Data Inconsistencies:
109
+ 1. Immediately assess data corruption scope
110
+ 2. Audit all data sources and relationships
111
+ 3. Identify inconsistencies
112
+ 4. Backup current state before changes
113
+ 5. Restore data integrity systematically
114
+ 6. Verify data accuracy across all systems
115
+ 7. Implement additional integrity checks
116
+ 8. Document data recovery procedures
117
+ ```
118
+
119
+ ### Framework-Specific Crisis Protocol
120
+ ```markdown
121
+ ## Response for Framework Failures:
122
+ 1. Check framework version compatibility
123
+ 2. Analyze API rate limits and quotas
124
+ 3. Review recent framework updates
125
+ 4. Investigate connection and authentication
126
+ 5. Verify external service dependencies
127
+ 6. Implement fallback mechanisms
128
+ 7. Test all functionality end-to-end
129
+ 8. Monitor for recurring issues
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Quality Standards & Checklists
135
+
136
+ ### Pre-Commit Quality Checklist
137
+ ```markdown
138
+ ## Mandatory Checks Before Any Commit:
139
+ - [ ] Trinity investigation completed and documented
140
+ - [ ] All tests passing (unit, integration, end-to-end)
141
+ - [ ] Debugging statements implemented and verified
142
+ - [ ] Performance standards met or exceeded
143
+ - [ ] Zero console errors in development/production
144
+ - [ ] User experience audit passed (if applicable)
145
+ - [ ] Data integrity verified
146
+ - [ ] Framework-specific functionality tested
147
+ - [ ] Security review completed
148
+ - [ ] Documentation updated and synchronized
149
+ ```
150
+
151
+ ### Code Quality Requirements
152
+ ```javascript
153
+ // Mandatory debugging format for all critical functions
154
+ const debugLog = (functionName, context, data) => {
155
+ console.log(`[TRINITY] ${functionName}`, {
156
+ timestamp: Date.now(),
157
+ context: context,
158
+ data: data,
159
+ framework: '{{FRAMEWORK}}',
160
+ session: process.env.SESSION_ID || 'unknown'
161
+ });
162
+ };
163
+
164
+ // Example implementation
165
+ function criticalOperation(params) {
166
+ debugLog('criticalOperation', 'ENTRY', {
167
+ params: params,
168
+ source: '{{SOURCE_DIR}}'
169
+ });
170
+
171
+ // Function implementation...
172
+
173
+ debugLog('criticalOperation', 'EXIT', {
174
+ result: 'success',
175
+ responseTime: Date.now() - startTime
176
+ });
177
+ }
178
+ ```
179
+
180
+ ### Trinity Method Investigation Standards
181
+ ```markdown
182
+ ## Investigation Requirements:
183
+ 1. **Scope Definition**: Clearly define what needs investigation
184
+ 2. **Time Boxing**: Set maximum investigation time (default: 2 hours)
185
+ 3. **Evidence Collection**: Gather all relevant data and patterns
186
+ 4. **Pattern Analysis**: Check existing solutions in knowledge-base/
187
+ 5. **Root Cause Analysis**: Identify underlying causes, not symptoms
188
+ 6. **Solution Documentation**: Document all findings in investigations/
189
+ 7. **Implementation Planning**: Create detailed implementation plan
190
+ 8. **Risk Assessment**: Identify potential complications and mitigations
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Success Metrics Tracking
196
+
197
+ ### Trinity Performance Indicators
198
+ ```javascript
199
+ const trinityMetrics = {
200
+ // Investigation Metrics
201
+ investigationSuccessRate: 0, // % of investigations leading to successful solutions
202
+ investigationTimeEfficiency: 0, // Average investigation time vs planned time
203
+ investigationScopeControl: 0, // % of investigations staying within scope
204
+
205
+ // Quality Metrics
206
+ issuesPreventedByPatterns: 0, // Issues caught by existing patterns
207
+ knowledgeReuseRate: 0, // % of solutions reused from knowledge base
208
+ qualityGatePassRate: 0, // % of commits passing all quality gates
209
+
210
+ // Crisis Metrics
211
+ crisisProtocolActivations: 0, // Number of crisis protocols triggered
212
+ crisisResolutionTime: 0, // Average time to resolve crises
213
+ preventativeMeasuresEffective: 0, // % of issues prevented by measures
214
+
215
+ // Framework Specific
216
+ frameworkUptimePercentage: 0, // Framework availability metrics
217
+ functionalitySuccessRate: 0, // % of features working correctly
218
+ apiErrorRate: 0, // External API error frequency
219
+
220
+ // Development Efficiency
221
+ sessionProductivity: 0, // Features/fixes per session
222
+ documentationSyncRate: 0, // % of code changes with docs
223
+ crossSessionKnowledgeTransfer: 0 // Knowledge retention between sessions
224
+ };
225
+ ```
226
+
227
+ ### Metric Collection Requirements
228
+ - Metrics collected at start/end of each session
229
+ - Weekly metric review and trend analysis
230
+ - Automated alerts for metric degradation
231
+ - Monthly metric reporting and process improvement
232
+
233
+ ---
234
+
235
+ ## Cross-Session Knowledge Structure
236
+
237
+ ### Knowledge Persistence Framework
238
+ ```yaml
239
+ Knowledge Base Structure:
240
+ trinity/knowledge-base/
241
+ - ISSUES.md # Common problems and solutions
242
+ - Trinity.md # Trinity Method project guide
243
+ - ARCHITECTURE.md # System architecture documentation
244
+ - Technical-Debt.md # Technical debt tracking
245
+ - To-do.md # Task tracking and planning
246
+
247
+ trinity/sessions/
248
+ - [YYYY-MM-DD]-[HHMMSS]/ # Session artifacts
249
+ - SESSION-SUMMARY.md
250
+ - investigation-summary.md
251
+ - patterns-discovered.md
252
+ - issues-resolved.md
253
+ - performance-report.md
254
+
255
+ trinity/investigations/
256
+ - [investigation-name]/ # Investigation work products
257
+
258
+ trinity/patterns/
259
+ - [pattern-name].md # Reusable solution patterns
260
+
261
+ trinity/work-orders/
262
+ - WORKORDER-XXX.md # Active work orders
263
+ ```
264
+
265
+ ### Knowledge Transfer Protocols
266
+ - Session handoffs must include knowledge summary
267
+ - All discoveries added to appropriate knowledge base files
268
+ - Pattern extraction and generalization required
269
+ - Cross-reference related knowledge base entries
270
+
271
+ ---
272
+
273
+ ## Trinity Method Commands
274
+
275
+ ### Investigation Commands
276
+ ```bash
277
+ # Start Trinity Investigation
278
+ Begin Trinity Method investigation for [feature/bug/task]
279
+
280
+ # Complete Investigation
281
+ Finalize investigation with implementation plan
282
+
283
+ # Scope Control
284
+ Set investigation time limit: [X hours]
285
+ Check investigation scope boundaries
286
+ ```
287
+
288
+ ### Quality Enforcement Commands
289
+ ```bash
290
+ # Quality Gates
291
+ Execute pre-commit checklist
292
+ Verify Trinity quality standards
293
+ Run comprehensive test suite
294
+ Validate performance baselines
295
+ ```
296
+
297
+ ### Crisis Management Commands
298
+ ```bash
299
+ # Crisis Response
300
+ Execute Console Error Crisis Protocol
301
+ Execute Performance Crisis Protocol
302
+ Execute Data Integrity Crisis Protocol
303
+ Execute Framework Crisis Protocol
304
+ ```
305
+
306
+ ---
307
+
308
+ ## Technology-Specific Adaptations
309
+
310
+ ### {{FRAMEWORK}} Integration
311
+ - Trinity Method protocols adapt to {{FRAMEWORK}} architecture
312
+ - Framework-specific debugging and monitoring standards
313
+ - Performance optimization for {{FRAMEWORK}} runtime
314
+ - Security protocols for {{FRAMEWORK}} applications
315
+ - Refer to {{SOURCE_DIR}}/CLAUDE.md for detailed framework guidance
316
+
317
+ ### Framework Compliance
318
+ - All Trinity protocols adapt to project's tech stack
319
+ - Data integrity crucial for application state management
320
+ - Performance monitoring for framework-specific operations
321
+ - Security protocols for framework-specific vulnerabilities
322
+
323
+ ---
324
+
325
+ ## Context Hierarchy
326
+
327
+ ### Hierarchical Context Loading
328
+ ```
329
+ 1. ../CLAUDE.md → Global project context (load FIRST)
330
+ 2. trinity/CLAUDE.md (this file) → Trinity Method enforcement (load SECOND)
331
+ 3. ../{{SOURCE_DIR}}/CLAUDE.md → Technology-specific rules (load THIRD)
332
+ ```
333
+
334
+ ### Context Priority Rules
335
+ - **Global context** provides project overview, performance baselines, team standards
336
+ - **Trinity context** enforces investigation workflow, quality gates, session protocols
337
+ - **Source context** provides technology-specific debugging, patterns, and conventions
338
+ - When conflicts arise, **Trinity context takes precedence** for workflow enforcement
339
+
340
+ ---
341
+
342
+ ## Reference to Parent Context
343
+
344
+ This file extends and enforces the global requirements defined in `../CLAUDE.md`. All Trinity Method protocols must comply with:
345
+ - Global performance baselines
346
+ - Project-wide behavioral requirements
347
+ - Technology stack specifications
348
+ - Quality gate requirements
349
+
350
+ For technology-specific implementation details, see: `../src/CLAUDE.md`
351
+
352
+ ---
353
+
354
+ ## Context Hierarchy
355
+
356
+ This file enforces Trinity Method protocols for all development work.
357
+
358
+ **Parent Context**: [../CLAUDE.md](../CLAUDE.md) - Project overview and global requirements
359
+ **Child Context**: [../src/CLAUDE.md](../src/CLAUDE.md) - Framework-specific implementation rules
360
+ **Related Resources**:
361
+ - [Agent Directory](../.claude/EMPLOYEE-DIRECTORY.md) - 19-agent Trinity team guide
362
+ - [Architecture Documentation](knowledge-base/ARCHITECTURE.md) - System architecture and patterns
363
+ - [Known Issues](knowledge-base/ISSUES.md) - Issue patterns and resolutions
364
+ - [Technical Debt](knowledge-base/Technical-Debt.md) - Debt tracking and reduction plans
365
+
366
+ ---
367
+
368
+ **Trinity Method Enforcement Active**
369
+ **Project:** {{PROJECT_NAME}}
370
+ **Framework:** {{FRAMEWORK}}
371
+ **Trinity Version**: {{TRINITY_VERSION}}
372
+ **Last Updated**: {{CURRENT_DATE}}
@@ -0,0 +1,276 @@
1
+ # ORCHESTRATOR WORK ORDER #XXX
2
+ ## Type: ANALYSIS
3
+ ## [Analysis Title]
4
+
5
+ ---
6
+
7
+ ## AUTHORIZATION
8
+
9
+ ```
10
+ TRINITY COUNCIL APPROVAL:
11
+ ☑ LUKA: APPROVED - [Strategic value of analysis]
12
+ ☑ TRINITY: APPROVED - [Technical approach validation]
13
+ ☑ CC: PENDING - Awaiting your acknowledgment
14
+
15
+ STATUS: APPROVED FOR EXECUTION
16
+ ```
17
+
18
+ ---
19
+
20
+ ## MISSION OBJECTIVE
21
+
22
+ [Clear statement of what needs deep analysis and the expected insights]
23
+
24
+ **Analysis Goal:** [What understanding we need to gain]
25
+ **Decision It Informs:** [How this analysis will be used]
26
+
27
+ ---
28
+
29
+ ## ANALYSIS SCOPE
30
+
31
+ ### Focus Area
32
+ **Primary Target:** [Specific system/component/pattern to analyze]
33
+ **Boundaries:** [What is IN scope vs OUT of scope]
34
+ **Depth Level:** [Surface/Medium/Deep dive]
35
+
36
+ ### Key Questions
37
+ 1. **[Question #1]** - [Why this matters]
38
+ 2. **[Question #2]** - [Why this matters]
39
+ 3. **[Question #3]** - [Why this matters]
40
+
41
+ ### Mobile-First Analysis Requirements
42
+ **MANDATORY for all UI-related analyses:**
43
+ - [ ] **Mobile Viewport Analysis** - Analyze on mobile device emulation
44
+ - [ ] **Touch Interaction Assessment** - Evaluate touch-based interactions
45
+ - [ ] **Mobile Browser Compatibility** - Consider iOS Safari, Chrome Mobile, Android browsers
46
+ - [ ] **Dynamic Viewport Impact** - Account for browser UI showing/hiding
47
+ - [ ] **Mobile Performance Analysis** - Include mobile-specific performance considerations
48
+ - [ ] **Mobile-Specific Patterns** - Identify mobile-unique usage patterns
49
+
50
+ ### Data Sources
51
+ - **Source #1:** [What data/files/metrics]
52
+ - Collection method: [How to gather]
53
+ - Expected volume: [Amount of data]
54
+
55
+ - **Source #2:** [What data/files/metrics]
56
+ - Collection method: [How to gather]
57
+ - Expected volume: [Amount of data]
58
+
59
+ ---
60
+
61
+ ## ANALYSIS METHODOLOGY
62
+
63
+ ### Phase 1: Data Collection
64
+ - [ ] Gather [specific data type]
65
+ - [ ] Extract [specific metrics]
66
+ - [ ] Compile [specific lists]
67
+ - [ ] Document [specific patterns]
68
+
69
+ ### Phase 2: Analysis Techniques
70
+ #### Technique 1: [Pattern Analysis]
71
+ - Approach: [How to analyze]
72
+ - Tool/Method: [What to use]
73
+ - Expected output: [What you'll produce]
74
+
75
+ #### Technique 2: [Statistical Analysis]
76
+ - Approach: [How to analyze]
77
+ - Tool/Method: [What to use]
78
+ - Expected output: [What you'll produce]
79
+
80
+ #### Technique 3: [Root Cause Analysis]
81
+ - Approach: [How to analyze]
82
+ - Tool/Method: [What to use]
83
+ - Expected output: [What you'll produce]
84
+
85
+ ### Phase 3: Synthesis
86
+ - [ ] Correlate findings across data sources
87
+ - [ ] Identify causation vs correlation
88
+ - [ ] Build mental model of system behavior
89
+ - [ ] Generate actionable insights
90
+
91
+ ---
92
+
93
+ ## DELIVERABLE REQUIREMENTS
94
+
95
+ ### Document Format
96
+ **Filename:** `[COMPONENT]-ANALYSIS-[TIMESTAMP].md`
97
+ **Location:** `${PROJECT_REPORTS}/` (Project-specific Reports folder)
98
+
99
+ ### Required Sections
100
+ 1. **Executive Summary** - Key insights and their implications
101
+ 2. **Methodology** - How analysis was conducted
102
+ 3. **Data Overview** - What was analyzed (volume, scope)
103
+ 4. **Findings** - Detailed analysis results
104
+ 5. **Patterns Identified** - Recurring themes or issues
105
+ 6. **Correlations** - Related factors discovered
106
+ 7. **Root Causes** - Fundamental issues identified
107
+ 8. **Mobile Compatibility Analysis** - Mobile-specific findings (if applicable)
108
+ 9. **Visualizations** - Charts/diagrams if applicable
109
+ 10. **Recommendations** - Action items based on analysis
110
+ 11. **Confidence Levels** - Certainty of conclusions
111
+
112
+ ### Analysis Artifacts
113
+ - Raw data summary
114
+ - Pattern library additions
115
+ - Correlation matrices
116
+ - Decision trees if applicable
117
+ - Risk assessments
118
+ - Mobile compatibility scores (if applicable)
119
+
120
+ ---
121
+
122
+ ## ✅ AFTER COMPLETION
123
+
124
+ ### ⚠️ CRITICAL: Complete ALL Steps Below - NO EXCEPTIONS
125
+
126
+ **Step 1: Create Completion Report** ✅
127
+ - [ ] Analysis deliverable created in `${PROJECT_REPORTS}/`
128
+ - [ ] Follow format: `[COMPONENT]-ANALYSIS-[TIMESTAMP].md`
129
+ - [ ] JUNO audit report generated automatically (if applicable)
130
+ - [ ] All deliverables include required sections listed above
131
+
132
+ **Step 2: 🚨 MOVE THIS WORK ORDER FILE 🚨** ✅
133
+ - [ ] **IMMEDIATELY** move this file from `trinity/work-orders/` to `trinity/sessions/`
134
+ - [ ] **THIS STEP IS MANDATORY** - Work orders left in trinity/work-orders/ are considered incomplete
135
+
136
+ **Execute this exact command:**
137
+ ```bash
138
+ mv trinity/work-orders/{{workOrderFilename}} trinity/sessions/
139
+ ```
140
+
141
+ **Step 3: Verify File Locations** ✅
142
+ - [ ] This work order file NOW EXISTS in: `trinity/sessions/{{workOrderFilename}}`
143
+ - [ ] Completion report exists in: `${PROJECT_REPORTS}/[COMPONENT]-ANALYSIS-[TIMESTAMP].md`
144
+ - [ ] This work order NO LONGER EXISTS in: `trinity/work-orders/`
145
+
146
+ **If any verification fails, the work order is NOT complete. Fix immediately.**
147
+
148
+ **Step 4: Session Cleanup (when entire session complete):**
149
+ - [ ] When session is complete, run `/trinity-end`
150
+ - [ ] trinity-end will archive ALL files from `trinity/sessions/` and `${PROJECT_REPORTS}/`
151
+ - [ ] Next session starts with empty sessions/ and reports/ folders
152
+
153
+ **Archive Destination (via trinity-end):**
154
+ - Work order → `trinity/archive/work-orders/YYYY-MM-DD/`
155
+ - Completion report → `trinity/archive/reports/YYYY-MM-DD/`
156
+ - JUNO audit report → `trinity/archive/reports/YYYY-MM-DD/` (if applicable)
157
+ - Session summary → `trinity/archive/sessions/YYYY-MM-DD/`
158
+
159
+ ---
160
+
161
+ ## SUCCESS CRITERIA
162
+
163
+ The analysis is complete when:
164
+ - [ ] All key questions have been answered
165
+ - [ ] Data has been thoroughly examined
166
+ - [ ] Patterns have been identified and validated
167
+ - [ ] Root causes have been determined
168
+ - [ ] Mobile compatibility analyzed (if UI analysis)
169
+ - [ ] Actionable insights have been generated
170
+ - [ ] Confidence levels have been assessed
171
+ - [ ] Analysis report submitted to project Reports folder
172
+
173
+ ---
174
+
175
+ ## ⚠️ CRITICAL RESTRICTIONS - GIT OPERATIONS FORBIDDEN
176
+
177
+ **ANALYSES ARE READ-ONLY OPERATIONS:**
178
+ ALL team members (CC, TRINITY, specialists) are PERMANENTLY FORBIDDEN from performing ANY git operations during analyses:
179
+
180
+ - [ ] **git add** - FORBIDDEN - Only LUKA has permission
181
+ - [ ] **git commit** - FORBIDDEN - Only LUKA has permission
182
+ - [ ] **git push** - FORBIDDEN - Only LUKA has permission
183
+ - [ ] **git pull** - FORBIDDEN - Only LUKA has permission
184
+ - [ ] **git merge** - FORBIDDEN - Only LUKA has permission
185
+ - [ ] **git checkout -b** - FORBIDDEN - Only LUKA has permission
186
+ - [ ] **git branch** - FORBIDDEN - Only LUKA has permission
187
+ - [ ] **git tag** - FORBIDDEN - Only LUKA has permission
188
+ - [ ] **git rebase** - FORBIDDEN - Only LUKA has permission
189
+ - [ ] **git reset** - FORBIDDEN - Only LUKA has permission
190
+ - [ ] **git revert** - FORBIDDEN - Only LUKA has permission
191
+ - [ ] **git stash** - FORBIDDEN - Only LUKA has permission
192
+ - [ ] **Any git operation that modifies repository state**
193
+
194
+ **ANALYSIS PROTOCOL:**
195
+ 1. Analyze files and data in current state
196
+ 2. Document all findings and insights
197
+ 3. Report analysis results to LUKA
198
+ 4. No file modifications during analysis phase
199
+ 5. If changes are needed, LUKA will issue separate implementation work order
200
+
201
+ ---
202
+
203
+ ## ANALYSIS CONSTRAINTS
204
+
205
+ ### Time Boundaries
206
+ - Data from: [Start date/version]
207
+ - Data to: [End date/version]
208
+ - Analysis boundaries: [What to include/exclude]
209
+
210
+ ### Technical Constraints
211
+ - Available tools: [What you can use]
212
+ - Data access: [What you can access]
213
+ - Processing limits: [Any limitations]
214
+
215
+ ### Assumptions
216
+ 1. [Assumption #1]
217
+ 2. [Assumption #2]
218
+ 3. [Document any assumptions made]
219
+
220
+ ---
221
+
222
+ ## INTERPRETATION GUIDELINES
223
+
224
+ ### Statistical Significance
225
+ - Minimum sample size: [X]
226
+ - Confidence threshold: [95%/99%]
227
+ - Correlation strength: [Weak <0.3, Moderate 0.3-0.7, Strong >0.7]
228
+
229
+ ### Pattern Recognition
230
+ - Minimum frequency: [X occurrences to be considered a pattern]
231
+ - Context requirements: [What context must be similar]
232
+
233
+ ### Causation Criteria
234
+ Evidence required to claim causation:
235
+ 1. Temporal precedence
236
+ 2. Covariation
237
+ 3. No spurious relationships
238
+
239
+ ---
240
+
241
+ ## CONTEXT FROM PREVIOUS WORK
242
+
243
+ **Related Analyses:** [Work Order #XXX, #XXX]
244
+ **Building On:** [Previous findings to extend]
245
+ **Hypothesis:** [If testing specific hypothesis]
246
+
247
+ ---
248
+
249
+
250
+ ## PACE AND COMPLETENESS NOTICE
251
+
252
+ **IMPORTANT:** There are NO time constraints on this work.
253
+ The scope indicators are for planning purposes only, NOT deadlines.
254
+ Take as much time as needed to achieve 100% completion with precision.
255
+ Partial completion is unacceptable.
256
+ Quality and completeness are the ONLY metrics that matter.
257
+
258
+ ## PRIORITY & IMPACT
259
+
260
+ **Analysis Scope:** [COMPREHENSIVE/STANDARD/FOCUSED]
261
+ **Completeness Required:** 100% - Full analysis must be completed
262
+ **Strategic Impact:** [How this affects decisions]
263
+ **Technical Impact:** [What implementations this guides]
264
+
265
+ ---
266
+
267
+ ## SPECIAL CONSIDERATIONS
268
+
269
+ [Any domain expertise needed, special tools required, or unique aspects of this analysis]
270
+
271
+ ---
272
+
273
+ **Remember:** Analysis should be objective, evidence-based, and actionable. Present findings clearly with appropriate confidence levels. When uncertain, state limitations explicitly. Analyses are read-only - no file modifications or git operations.
274
+
275
+ *Trinity Method v2.0 - Analysis Work Order Template*
276
+ *Project-Isolated Architecture with Dynamic Paths*