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,148 @@
1
+ ---
2
+ description: Analyze requirements using MON (Requirements Analyst)
3
+ ---
4
+
5
+ # Trinity Requirements Analysis - MON
6
+
7
+ **Agent:** MON (Requirements Analyst)
8
+ **Role:** Scale determination, acceptance criteria, and requirements documentation
9
+
10
+ ## What MON Does
11
+
12
+ 1. **Scale Determination:**
13
+ - Analyzes task complexity
14
+ - Counts affected files
15
+ - Determines workflow (Small/Medium/Large)
16
+
17
+ 2. **Requirements Documentation:**
18
+ - Captures functional requirements
19
+ - Defines acceptance criteria (testable)
20
+ - Identifies constraints and dependencies
21
+
22
+ 3. **Acceptance Criteria Format:**
23
+ ```
24
+ ✅ Given [context]
25
+ ✅ When [action]
26
+ ✅ Then [expected outcome]
27
+ ```
28
+
29
+ 4. **Risk Assessment:**
30
+ - Breaking changes?
31
+ - Dependencies affected?
32
+ - Performance implications?
33
+
34
+ ## Output Format
35
+
36
+ MON produces structured JSON handoff:
37
+ ```json
38
+ {
39
+ "scale": "Small|Medium|Large",
40
+ "fileCount": <number>,
41
+ "requirements": ["req1", "req2"],
42
+ "acceptanceCriteria": ["✅ criterion 1", "✅ criterion 2"],
43
+ "risks": ["risk1", "risk2"],
44
+ "dependencies": ["dep1", "dep2"]
45
+ }
46
+ ```
47
+
48
+ ## MON Agent Capabilities
49
+
50
+ MON specializes in requirements analysis following Trinity principles:
51
+ - **Systematic Analysis:** Structured approach to capturing functional and non-functional requirements
52
+ - **Scale Determination:** Objective criteria for Small/Medium/Large classification
53
+ - **Acceptance Criteria:** Testable Given/When/Then format for clear validation
54
+ - **Risk Assessment:** Proactive identification of constraints and dependencies
55
+
56
+ ## Integration with Trinity Workflow
57
+
58
+ MON's requirements analysis is the first phase in Trinity workflows:
59
+
60
+ 1. **Investigation Start:** User describes task or investigation
61
+ 2. **MON Analysis (Claude adopts MON persona):** Determines scale, documents requirements, identifies risks
62
+ 3. **Scale-Based Workflow:** Small/Medium/Large determines next steps
63
+ 4. **Phase 1 Output:** Requirements with acceptance criteria in JSON format
64
+ 5. **Handoff to ROR:** Requirements feed into technical design phase
65
+
66
+ **Example in Large-scale workflow:**
67
+ ```
68
+ Phase 1: Requirements Analysis
69
+ ├── Analyze functional requirements
70
+ └── Analyze non-functional requirements
71
+
72
+ Output: JSON handoff with scale, requirements, acceptance criteria, risks
73
+ Next: ROR technical design phase
74
+ ```
75
+
76
+ **See Also:** `/trinity-orchestrate` for complete workflow planning
77
+
78
+ ## Quality Standards
79
+
80
+ MON follows Trinity quality standards for requirements:
81
+ - **Clear acceptance criteria:** Testable with Given/When/Then format
82
+ - **Risk identification:** Proactive constraint and dependency mapping
83
+ - **Scale determination:** Objective criteria (file count, complexity)
84
+ - **Structured handoff:** JSON format for downstream agents
85
+
86
+ ## Usage
87
+
88
+ **Describe your task and Claude (as MON) will analyze requirements:**
89
+
90
+ What functionality needs to be implemented?
91
+
92
+ **For complete workflow planning:**
93
+
94
+ Use `/trinity-orchestrate` to plan your implementation approach with MON as the first phase
95
+
96
+ ---
97
+
98
+ ## Requirements Extraction Template
99
+
100
+ Use this template to extract requirements from user requests:
101
+
102
+ ### 1. Functional Requirements
103
+ **What the system must do**:
104
+ - [ ] Requirement 1: [Action] when [condition]
105
+ - [ ] Requirement 2: [System] shall [capability]
106
+ - [ ] Requirement 3: [Feature] must support [scenario]
107
+
108
+ **Example**:
109
+ - [ ] System shall validate JWT tokens on every authenticated request
110
+ - [ ] Refresh endpoint must return new access token within 100ms
111
+ - [ ] Invalid tokens must return 401 Unauthorized with error message
112
+
113
+ ### 2. Non-Functional Requirements
114
+ **How the system must perform**:
115
+ - **Performance**: Response time, throughput targets
116
+ - **Security**: Authentication, authorization, data protection
117
+ - **Scalability**: Concurrent users, data volume
118
+ - **Reliability**: Uptime, error handling
119
+ - **Maintainability**: Code quality, documentation
120
+
121
+ **Example**:
122
+ - Performance: Token refresh <100ms (p95)
123
+ - Security: HttpOnly cookies, HTTPS only
124
+ - Scalability: Support 10k concurrent sessions
125
+
126
+ ### 3. Constraints & Assumptions
127
+ **Limitations and dependencies**:
128
+ - Technology constraints (must use X, cannot use Y)
129
+ - Timeline constraints
130
+ - Resource constraints
131
+ - Third-party dependencies
132
+ - Assumptions about user behavior
133
+
134
+ **Example**:
135
+ - Must use existing PostgreSQL database
136
+ - Cannot modify user table schema (constraint)
137
+ - Assume users refresh tokens before expiration (assumption)
138
+
139
+ ### 4. Acceptance Criteria
140
+ **How to verify requirements are met**:
141
+ - Given [context], When [action], Then [expected outcome]
142
+
143
+ **Example**:
144
+ - Given valid refresh token, When POST /auth/refresh, Then return 200 with new tokens
145
+ - Given expired token, When POST /auth/refresh, Then return 401 with error
146
+ - Given invalid token, When POST /auth/refresh, Then return 401 and log attempt
147
+
148
+ ---
@@ -0,0 +1,268 @@
1
+ ---
2
+ description: Guide through your first Trinity workflow
3
+ ---
4
+
5
+ Guide the user through starting their first Trinity Method workflow.
6
+
7
+ **Important:** Claude doesn't "delegate" to agents. When you use a slash command or agent, Claude adopts that persona and expertise to help you.
8
+
9
+ ## Workflow Selection Process
10
+
11
+ ### Step 1: Understand the Task
12
+ Ask the user what they want to work on:
13
+ - New feature implementation
14
+ - Bug fix
15
+ - Refactoring existing code
16
+ - Performance optimization
17
+ - Documentation updates
18
+ - Testing improvements
19
+
20
+ ### Step 2: Determine Task Scale
21
+ **Small Tasks (1-2 files, <4 hours):**
22
+ - Direct implementation without formal workflow
23
+ - Quick analysis and coding
24
+ - Minimal planning needed
25
+
26
+ **Medium Tasks (3-5 files, 4-8 hours):**
27
+ - Structured workflow: Requirements → Design → Implementation → Review
28
+ - Design approval checkpoint
29
+ - BAS quality gates
30
+
31
+ **Large Tasks (6+ files, >8 hours):**
32
+ - Full workflow: Requirements → Design → Planning → Decomposition → Implementation → Audit
33
+ - Multiple approval checkpoints
34
+ - Comprehensive planning and documentation
35
+
36
+ ### Step 3: Route to Appropriate Workflow
37
+
38
+ **For Small Tasks:**
39
+ → Direct implementation (Claude as developer persona)
40
+
41
+ **For Medium Tasks:**
42
+ 1. `/trinity-requirements` - MON analyzes requirements and scale
43
+ 2. `/trinity-design` - ROR creates technical design
44
+ 3. `/trinity-plan` - TRA plans implementation approach
45
+ 4. Direct implementation with BAS quality gates
46
+
47
+ **For Large Tasks:**
48
+ 1. `/trinity-requirements` - MON analyzes requirements
49
+ 2. `/trinity-design` - ROR creates technical design with ADRs
50
+ 3. `/trinity-plan` - TRA creates strategic plan
51
+ 4. `/trinity-decompose` - EUS breaks into atomic tasks
52
+ 5. Implementation with KIL following TDD
53
+ 6. `/trinity-orchestrate` - For guidance on complete workflow
54
+
55
+ ### Step 4: Work Order Creation (Optional)
56
+
57
+ For complex or long-running tasks, suggest creating a work order:
58
+ ```
59
+ /trinity-workorder
60
+ ```
61
+
62
+ This creates a structured investigation in `trinity/work-orders/` with:
63
+ - Problem statement
64
+ - Requirements and acceptance criteria
65
+ - Design decisions
66
+ - Implementation plan
67
+ - Progress tracking
68
+
69
+ ## Agent Quick Reference
70
+
71
+ **Leadership:**
72
+ - ALY (CTO) - Strategic planning, architecture decisions
73
+ - AJ MAESTRO - Workflow orchestration and planning
74
+ - AJ CC - Code quality oversight
75
+
76
+ **Deployment:**
77
+ - TAN - Trinity structure deployment
78
+ - ZEN - Knowledge base management
79
+ - INO - Context hierarchy (CLAUDE.md, ISSUES.md)
80
+ - EIN - CI/CD pipeline setup
81
+
82
+ **Planning:**
83
+ - MON - Requirements analysis and scale determination
84
+ - ROR - Technical design and ADRs
85
+ - TRA - Implementation planning
86
+ - EUS - Atomic task decomposition
87
+
88
+ **Implementation:**
89
+ - KIL - TDD implementation (RED-GREEN-REFACTOR)
90
+ - BAS - Quality gate validation (6 phases)
91
+ - DRA - Design Doc compliance review
92
+ - APO - API documentation
93
+ - BON - Dependency management
94
+ - CAP - Configuration management
95
+ - URO - Code refactoring
96
+
97
+ **Audit:**
98
+ - JUNO - Comprehensive quality audits
99
+
100
+ ## Usage
101
+
102
+ Describe your task and Claude will help you choose the right workflow and guide you through the process.
103
+
104
+ ---
105
+
106
+ ## Scale Determination Criteria
107
+
108
+ ### File Count Assessment
109
+
110
+ **SMALL Scale (1-2 files)**:
111
+ - Single feature file + test file
112
+ - Bug fix in one location
113
+ - Configuration change
114
+ - Documentation update
115
+ **Examples**:
116
+ - Fix validation bug in user.service.ts + add test
117
+ - Update API endpoint in auth.controller.ts
118
+ - Add utility function to string-utils.ts
119
+
120
+ **MEDIUM Scale (3-5 files)**:
121
+ - Feature spanning multiple files
122
+ - Service + controller + types + tests
123
+ - Refactoring with dependencies
124
+ **Examples**:
125
+ - JWT refresh tokens: service (2 files) + middleware + types + tests (4 files total)
126
+ - Add pagination: controller + service + types + tests (4 files)
127
+ - Extract shared logic: create new utility + update 3 consumers + tests (5 files)
128
+
129
+ **LARGE Scale (6+ files)**:
130
+ - Full module implementation
131
+ - Cross-cutting concerns
132
+ - Major refactoring
133
+ **Examples**:
134
+ - User management module: 12 files (services, controllers, middleware, types, tests, validators)
135
+ - Payment integration: 8 files (service, webhook handler, types, models, tests, config)
136
+ - Database migration: 10+ files (migration scripts, model updates, service changes, tests)
137
+
138
+ ### Complexity Factors (May Increase Scale)
139
+
140
+ Consider bumping scale up if:
141
+ - **High Security Impact**: Auth, payments, data access → Add stop points
142
+ - **Complex Logic**: Multiple algorithms, state machines → Need design review
143
+ - **External Dependencies**: Third-party APIs, new libraries → Requires planning
144
+ - **Cross-Team Impact**: Changes affect multiple teams/services → Need coordination
145
+
146
+ **Example**: 2-file auth change might be MEDIUM due to security impact requiring design review.
147
+
148
+ ---
149
+
150
+ ## Decision Tree
151
+
152
+ ```
153
+ User Request
154
+
155
+ How many files affected?
156
+ ├─ 1-2 files ──→ SMALL
157
+ ├─ 3-5 files ──→ MEDIUM
158
+ └─ 6+ files ──→ LARGE
159
+
160
+ [Check Complexity Factors]
161
+
162
+ High security/complexity?
163
+ ├─ Yes → Increase scale
164
+ └─ No → Keep scale
165
+
166
+ [Determine Workflow]
167
+
168
+ SMALL → KIL + BAS (0 stops)
169
+ MEDIUM → MON/ROR + KIL + BAS + DRA (2 stops)
170
+ LARGE → MON + ROR + TRA + EUS + KIL + BAS + DRA (4 stops)
171
+ ```
172
+
173
+ ### Scale-to-Workflow Mapping
174
+
175
+ | Scale | Files | Agents | Stop Points | Duration |
176
+ |-------|-------|--------|-------------|----------|
177
+ | SMALL | 1-2 | KIL, BAS | 0 | <1 hour |
178
+ | MEDIUM | 3-5 | MON/ROR, KIL, BAS, DRA | 2 | 2-6 hours |
179
+ | LARGE | 6+ | MON, ROR, TRA, EUS, KIL, BAS, DRA | 4 | 1-2 days |
180
+
181
+ **Stop Points**:
182
+ - SMALL: No stops (direct execution)
183
+ - MEDIUM: Design review + Final review
184
+ - LARGE: Requirements + Design + Plan + Final review
185
+
186
+ ---
187
+
188
+ ---
189
+
190
+ ## /trinity-start vs /trinity-orchestrate
191
+
192
+ ### When to Use Each
193
+
194
+ **Use /trinity-start** when:
195
+ - ✅ Starting fresh work (no investigation file exists)
196
+ - ✅ User request is clear
197
+ - ✅ Want ALY to determine scale and delegate
198
+
199
+ **Use /trinity-orchestrate** when:
200
+ - ✅ Have existing work order file
201
+ - ✅ Want to execute specific WO-XXX
202
+ - ✅ Resuming paused work order
203
+
204
+ ### Workflow Difference
205
+
206
+ **/trinity-start**:
207
+ ```
208
+ User request → ALY assesses → Determines scale → Delegates to AJ MAESTRO
209
+ ```
210
+
211
+ **/trinity-orchestrate @WO-042**:
212
+ ```
213
+ Read WO-042 → AJ MAESTRO executes directly (skip ALY assessment)
214
+ ```
215
+
216
+ **Example**:
217
+ - "Add JWT refresh tokens" → Use `/trinity-start`
218
+ - "Execute WO-042" → Use `/trinity-orchestrate @WO-042`
219
+
220
+ ---
221
+
222
+ ---
223
+
224
+ ## Visual Workflow Guide
225
+
226
+ ```
227
+ START HERE: User has a task
228
+
229
+ ┌───────────────────────────────────────┐
230
+ │ Is Trinity deployed in this project? │
231
+ └────────┬──────────────────┬───────────┘
232
+ │ No │ Yes
233
+ ↓ ↓
234
+ /trinity-init Is this a new task?
235
+ │ │
236
+ │ ┌─────┴──────┐
237
+ │ │ Yes │ No (resuming)
238
+ │ ↓ ↓
239
+ │ /trinity-start /trinity-continue
240
+ │ │ │
241
+ └────────────┴────────────┘
242
+
243
+ ALY determines scale
244
+
245
+ ┌────────────┼────────────┐
246
+ │ │ │
247
+ SMALL (0) MEDIUM (2) LARGE (4)
248
+ KIL+BAS +Design +Full planning
249
+ │ │ │
250
+ └────────────┼────────────┘
251
+
252
+ AJ MAESTRO executes
253
+
254
+ BAS validates (6 phases)
255
+
256
+ DRA reviews compliance
257
+
258
+ ┌───────┴────────┐
259
+ │ Complete? │
260
+ └───┬────────┬───┘
261
+ │ Yes │ No
262
+ ↓ ↓
263
+ /trinity-end Continue next task
264
+ ```
265
+
266
+ **Numbers in parentheses** = Stop points for ALY review
267
+
268
+ ---