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,232 @@
1
+ ---
2
+ description: Launch the Investigation Wizard to create structured investigations
3
+ ---
4
+
5
+ Launch the Trinity Method Investigation Wizard to create a structured investigation interactively.
6
+
7
+ **Investigation Wizard Flow:**
8
+
9
+ **Step 1: Investigation Type**
10
+ Ask user to select:
11
+ - Bug Investigation
12
+ - Feature Analysis
13
+ - Performance Investigation
14
+ - Security Audit
15
+ - Technical Debt Assessment
16
+ - Architecture Review
17
+ - Custom Investigation
18
+
19
+ **Step 2: Investigation Details**
20
+ Gather:
21
+ - Investigation title
22
+ - Problem statement
23
+ - Affected components/files
24
+ - Priority (Low/Medium/High/Critical)
25
+ - Estimated complexity
26
+
27
+ **Step 3: Objectives**
28
+ Define investigation objectives (numbered list):
29
+ - What questions need answering?
30
+ - What hypotheses to test?
31
+ - What outcomes are expected?
32
+
33
+ **Step 4: Scope**
34
+ Determine investigation scope:
35
+ - Files to analyze
36
+ - Time constraints
37
+ - Resource limits
38
+ - Out-of-scope items
39
+
40
+ **Step 5: Success Criteria**
41
+ Define completion criteria:
42
+ - What constitutes a successful investigation?
43
+ - Required deliverables
44
+ - Acceptance criteria
45
+
46
+ **Step 6: Template Selection**
47
+ Offer templates based on investigation type:
48
+ - Standard templates (from trinity/templates/investigations/)
49
+ - Custom templates (from user's template library)
50
+ - Generate new template
51
+
52
+ **Step 7: Review & Create**
53
+ Show investigation summary and confirm creation.
54
+
55
+ **Output:**
56
+ Create investigation file at:
57
+ `trinity/investigations/INV-XXX-{title}.md`
58
+
59
+ **Post-Creation:**
60
+ Ask if user wants to:
61
+ - Start investigation immediately with `/trinity-orchestrate @INV-XXX-{title}.md`
62
+ - Generate investigation plan first (/trinity-plan-investigation)
63
+ - Schedule for later
64
+
65
+ **Orchestration:**
66
+ Once investigation is created in `trinity/investigations/`, execute it:
67
+
68
+ ```bash
69
+ /trinity-orchestrate @INV-001-example-investigation.md
70
+ ```
71
+
72
+ **AJ MAESTRO** picks up the investigation from `trinity/investigations/` and orchestrates the investigation, leaving findings in `trinity/reports/`.
73
+
74
+ **CRITICAL: Investigation Protocol**
75
+ ⚠️ **INVESTIGATIONS ARE READ-ONLY OPERATIONS**
76
+
77
+ When executing an investigation:
78
+ - **NO file modifications allowed**
79
+ - **NO code implementations**
80
+ - **NO fixes applied**
81
+ - **ONLY analyze, document, and report findings**
82
+
83
+ Investigation deliverables:
84
+ - Findings document (what was discovered)
85
+ - Root cause analysis
86
+ - Recommendations (what SHOULD be done)
87
+ - Impact assessment
88
+
89
+ **Implementation happens SEPARATELY** only after user explicitly requests it based on investigation findings.
90
+
91
+ ---
92
+
93
+ ## Investigation Naming Convention
94
+
95
+ **Format**: `INV-XXX-{brief-description}.md`
96
+
97
+ **Components**:
98
+ - **INV**: Investigation prefix (always uppercase)
99
+ - **XXX**: Three-digit sequential number (001, 002, 003...)
100
+ - **brief-description**: Lowercase, hyphenated
101
+
102
+ **Examples**:
103
+ ```
104
+ INV-001-performance-bottleneck-analysis.md
105
+ INV-012-authentication-flow-review.md
106
+ INV-025-database-query-optimization.md
107
+ ```
108
+
109
+ **Auto-Numbering**: System scans `trinity/investigations/` and assigns next number
110
+
111
+ ---
112
+
113
+ ## Real-World Examples
114
+
115
+ ### Example 1: Bug Investigation
116
+ **Title:** "JWT token refresh fails after 24 hours"
117
+ **Template:** Bug Investigation (`bug.md`)
118
+ **Investigation Type:** Bug/Defect
119
+ **Priority:** High
120
+
121
+ **Key Findings:**
122
+ - Used Five Whys analysis to discover hardcoded 24h token expiration limit
123
+ - Root cause: Configuration constant set during initial development
124
+ - No test coverage for long-lived sessions
125
+
126
+ **Outcome:**
127
+ - Fixed expiration logic to use configurable value
128
+ - Added tests for token refresh at various time intervals
129
+ - Pattern learned: "Always check for hardcoded time limits in authentication code"
130
+
131
+ ---
132
+
133
+ ### Example 2: Performance Investigation
134
+ **Title:** "Dashboard loads in 8 seconds (target <2s)"
135
+ **Template:** Performance Investigation (`performance.md`)
136
+ **Investigation Type:** Performance Optimization
137
+ **Priority:** Critical
138
+
139
+ **Key Findings:**
140
+ - Chrome DevTools profiling revealed N+1 query pattern
141
+ - User data loaded individually in loop (500+ queries per page load)
142
+ - No database indexes on frequently queried columns
143
+
144
+ **Outcome:**
145
+ - Added eager loading to fetch all user data in single query
146
+ - Created compound index on user lookup columns
147
+ - Page load reduced to 1.8s (78% improvement)
148
+ - Set up performance budget alerts to prevent regressions
149
+
150
+ ---
151
+
152
+ ### Example 3: Security Investigation
153
+ **Title:** "SQL injection vulnerability in user search endpoint"
154
+ **Template:** Security Investigation (`security.md`)
155
+ **Investigation Type:** Security Audit
156
+ **Priority:** Critical
157
+
158
+ **Key Findings:**
159
+ - CVSS Score: 9.1 (Critical)
160
+ - Proof-of-concept demonstrated full database access
161
+ - User input concatenated directly into SQL queries
162
+ - Attack vector: Network-based, no authentication required
163
+
164
+ **Outcome:**
165
+ - Replaced string concatenation with parameterized queries
166
+ - Added input validation and sanitization layer
167
+ - Implemented Web Application Firewall (WAF) rules
168
+ - Security audit passed, no similar vulnerabilities found
169
+
170
+ ---
171
+
172
+ ### Example 4: Technical Investigation
173
+ **Title:** "Choose state management solution for React dashboard"
174
+ **Template:** Technical Investigation (`technical.md`)
175
+ **Investigation Type:** Architecture Decision
176
+ **Priority:** Medium
177
+
178
+ **Key Findings:**
179
+ - Evaluated 3 options: Redux, Zustand, React Context
180
+ - Decision matrix weighted: simplicity (30%), performance (25%), learning curve (20%)
181
+ - Zustand scored highest (8.2/10) vs Redux (7.1/10) and Context (6.8/10)
182
+
183
+ **Outcome:**
184
+ - Architecture Decision Record (ADR) documented choice
185
+ - Zustand selected for lightweight API and minimal boilerplate
186
+ - Migration plan: 3 phases over 2 weeks
187
+ - Team training completed, implementation successful
188
+
189
+ ---
190
+
191
+ ### Example 5: Feature Investigation
192
+ **Title:** "Add two-factor authentication for user accounts"
193
+ **Template:** Feature Investigation (`feature.md`)
194
+ **Investigation Type:** New Feature
195
+ **Priority:** High
196
+
197
+ **Key Findings:**
198
+ - 12 user stories defined with acceptance criteria
199
+ - Epic breakdown: Setup (2 stories), Core (6 stories), Polish (4 stories)
200
+ - 4-phase implementation plan with rollout strategy
201
+ - Feature flag for gradual deployment (10% → 50% → 100%)
202
+
203
+ **Outcome:**
204
+ - Successfully launched to 100% of users
205
+ - 40% adoption rate in first 30 days (exceeded 25% target)
206
+ - No security incidents reported
207
+ - User satisfaction (NPS): +15 points
208
+
209
+ ---
210
+
211
+ ## Template Selection Guide
212
+
213
+ **Use this decision tree:**
214
+
215
+ ```
216
+ Is it a defect or broken functionality?
217
+ → YES: Use Bug Investigation Template
218
+
219
+ Is it slow or using too many resources?
220
+ → YES: Use Performance Investigation Template
221
+
222
+ Is it a security vulnerability or audit finding?
223
+ → YES: Use Security Investigation Template
224
+
225
+ Is it an architecture decision or technical design question?
226
+ → YES: Use Technical Investigation Template
227
+
228
+ Is it new functionality or a feature request?
229
+ → YES: Use Feature Investigation Template
230
+ ```
231
+
232
+ ---
@@ -0,0 +1,181 @@
1
+ ---
2
+ description: Decompose work into atomic tasks using EUS (Task Decomposer)
3
+ ---
4
+
5
+ # Trinity Task Decomposition - EUS
6
+
7
+ **Agent:** EUS (Task Decomposer)
8
+ **Role:** Break work into atomic tasks following "1 task = 1 commit" rule
9
+
10
+ ## What EUS Does
11
+
12
+ 1. **Atomic Task Breakdown:**
13
+ - Each task = 1 commit
14
+ - Maximum 2 hours per task
15
+ - Single responsibility per task
16
+ - Clear success criteria
17
+
18
+ 2. **Task Independence:**
19
+ - Minimal cross-dependencies
20
+ - Can be tested in isolation
21
+ - Clear input/output boundaries
22
+
23
+ 3. **Commit Message Planning:**
24
+ - Conventional commits format
25
+ - `feat:`, `fix:`, `refactor:`, `test:`, `docs:`
26
+ - Descriptive and concise
27
+
28
+ 4. **TDD Enforcement:**
29
+ - RED: Write failing test
30
+ - GREEN: Minimal code to pass
31
+ - REFACTOR: Clean up
32
+ - Each cycle = 1 commit
33
+
34
+ ## Output Format
35
+
36
+ EUS produces structured JSON handoff:
37
+ ```json
38
+ {
39
+ "atomicTasks": [
40
+ {
41
+ "id": 1,
42
+ "description": "Implement validation logic",
43
+ "commitMessage": "feat(validator): add input validation",
44
+ "estimatedTime": "45min",
45
+ "testStrategy": "Unit tests for edge cases",
46
+ "successCriteria": "All validation tests pass",
47
+ "dependencies": []
48
+ }
49
+ ],
50
+ "tddCycles": [
51
+ {
52
+ "test": "test description",
53
+ "implementation": "impl description",
54
+ "refactor": "refactor description"
55
+ }
56
+ ]
57
+ }
58
+ ```
59
+
60
+ ## EUS Agent Capabilities
61
+
62
+ EUS specializes in atomic task decomposition following Trinity principles:
63
+ - **Atomic Breakdown:** "1 task = 1 commit" rule ensures clean version control
64
+ - **TDD Enforcement:** Every task follows RED-GREEN-REFACTOR cycle
65
+ - **Task Independence:** Minimal cross-dependencies enable parallel development
66
+ - **Time Boxing:** Maximum 2 hours per task for manageable implementation
67
+
68
+ ## Integration with Trinity Workflow
69
+
70
+ EUS's task decomposition follows TRA's strategic planning:
71
+
72
+ 1. **After TRA:** Strategic plan created with high-level tasks
73
+ 2. **EUS Decomposition (Claude adopts EUS persona):** Breaks tasks into atomic units (1 commit each)
74
+ 3. **KIL Execution:** Each atomic task implemented following TDD cycle
75
+ 4. **TDD Cycles:** RED (test) → GREEN (implement) → REFACTOR (clean)
76
+ 5. **BAS Quality Gates:** Validate after each atomic task commit
77
+
78
+ **Example workflow:**
79
+ ```
80
+ Phase 3: Implementation
81
+ ├── EUS Decomposition: Break plan into atomic tasks
82
+ │ Output: 12 atomic tasks (each ≤2 hours)
83
+ │ Each task = 1 TDD cycle = 1 commit
84
+
85
+ └── KIL Implementation: Execute atomic tasks
86
+ ├── Atomic Task 1: Add validation logic → BAS gates
87
+ ├── Atomic Task 2: Create service layer → BAS gates
88
+ ├── Atomic Task 3: Implement error handling → BAS gates
89
+ └── ... (continue until all tasks complete)
90
+ ```
91
+
92
+ **See Also:** `/trinity-orchestrate` for complete workflow planning
93
+
94
+ ## Scale-Based Task Decomposition
95
+
96
+ EUS adjusts decomposition granularity based on task scale:
97
+ - **Small workflows:** 2-4 atomic tasks (direct implementation)
98
+ - **Medium workflows:** 6-10 atomic tasks (phased approach)
99
+ - **Large workflows:** 12-20 atomic tasks (comprehensive breakdown)
100
+
101
+ Each atomic task always follows Trinity principles:
102
+ - Maximum 2 hours duration
103
+ - Single responsibility (one purpose)
104
+ - Clear success criteria (testable)
105
+ - BAS quality gate validation (6 phases)
106
+
107
+ ## Usage
108
+
109
+ **Provide implementation plan and Claude (as EUS) will decompose into atomic tasks:**
110
+
111
+ What is the implementation plan? (Or provide TRA's output)
112
+
113
+ **For complete workflow planning:**
114
+
115
+ Use `/trinity-orchestrate` to plan your implementation with EUS decomposition as a key phase
116
+
117
+ ---
118
+
119
+ ## Conventional Commits Quick Reference
120
+
121
+ Trinity uses Conventional Commits for atomic task commits (1 task = 1 commit).
122
+
123
+ ### Format
124
+
125
+ ```
126
+ <type>(<scope>): <subject>
127
+
128
+ <body>
129
+
130
+ <footer>
131
+ ```
132
+
133
+ ### Types
134
+
135
+ - **feat**: New feature
136
+ - **fix**: Bug fix
137
+ - **refactor**: Code change (no feature/fix)
138
+ - **test**: Add/update tests
139
+ - **docs**: Documentation only
140
+ - **style**: Formatting (no code change)
141
+ - **perf**: Performance improvement
142
+ - **chore**: Build/tooling changes
143
+
144
+ ### Examples
145
+
146
+ **Feature**:
147
+ ```
148
+ feat(auth): add JWT refresh token endpoint
149
+
150
+ Implement POST /auth/refresh endpoint with token rotation.
151
+ Uses HttpOnly cookies for security.
152
+
153
+ Closes #42
154
+ ```
155
+
156
+ **Fix**:
157
+ ```
158
+ fix(auth): validate token expiration correctly
159
+
160
+ Token expiration was checked against wrong timestamp.
161
+ Now uses UTC comparison.
162
+
163
+ Fixes #128
164
+ ```
165
+
166
+ **Refactor**:
167
+ ```
168
+ refactor(validation): extract email validator to utility
169
+
170
+ Reduces code duplication across 3 files.
171
+ Maintains same validation logic.
172
+ ```
173
+
174
+ ### Trinity Best Practices
175
+
176
+ 1. **One Task = One Commit**: Each EUS task gets exactly one commit
177
+ 2. **Atomic**: Commit must be complete (tests pass, build succeeds)
178
+ 3. **Descriptive**: Subject line explains "what", body explains "why"
179
+ 4. **Reference Issues**: Link to work orders (e.g., "WO-042")
180
+
181
+ ---