trinity-method-sdk 2.0.9 → 2.2.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 (147) hide show
  1. package/CHANGELOG.md +702 -267
  2. package/README.md +550 -540
  3. package/dist/cli/commands/deploy/agents.js +1 -1
  4. package/dist/cli/commands/deploy/ci-cd.d.ts +4 -3
  5. package/dist/cli/commands/deploy/ci-cd.js +10 -9
  6. package/dist/cli/commands/deploy/claude-setup.js +28 -35
  7. package/dist/cli/commands/deploy/configuration.js +10 -11
  8. package/dist/cli/commands/deploy/directories.js +13 -14
  9. package/dist/cli/commands/deploy/gitignore.js +3 -5
  10. package/dist/cli/commands/deploy/index.d.ts +1 -1
  11. package/dist/cli/commands/deploy/index.js +7 -3
  12. package/dist/cli/commands/deploy/knowledge-base.js +3 -3
  13. package/dist/cli/commands/deploy/pre-flight.js +1 -1
  14. package/dist/cli/commands/deploy/root-files.js +3 -18
  15. package/dist/cli/commands/deploy/sdk-install.js +1 -1
  16. package/dist/cli/commands/deploy/summary.js +3 -3
  17. package/dist/cli/commands/deploy/templates.js +33 -20
  18. package/dist/cli/commands/update/agents.js +1 -1
  19. package/dist/cli/commands/update/backup.js +6 -12
  20. package/dist/cli/commands/update/commands.d.ts +1 -0
  21. package/dist/cli/commands/update/commands.js +18 -45
  22. package/dist/cli/commands/update/knowledge-base.js +2 -2
  23. package/dist/cli/commands/update/pre-flight.js +11 -11
  24. package/dist/cli/commands/update/summary.js +5 -5
  25. package/dist/cli/commands/update/templates.js +35 -13
  26. package/dist/cli/commands/update/verification.js +5 -5
  27. package/dist/cli/commands/update/version.js +1 -1
  28. package/dist/cli/utils/deploy-ci.d.ts +3 -2
  29. package/dist/cli/utils/deploy-ci.js +24 -24
  30. package/dist/cli/utils/deploy-linting.js +101 -6
  31. package/dist/cli/utils/error-classes.d.ts +2 -2
  32. package/dist/cli/utils/linting-tools.js +14 -6
  33. package/dist/cli/utils/template-processor.js +2 -4
  34. package/dist/templates/{claude → .claude}/EMPLOYEE-DIRECTORY.md.template +16 -22
  35. package/dist/templates/{agents → .claude/agents}/aj-team/apo-documentation-specialist.md.template +10 -10
  36. package/dist/templates/{agents → .claude/agents}/aj-team/bas-quality-gate.md.template +13 -15
  37. package/dist/templates/{agents → .claude/agents}/aj-team/bon-dependency-manager.md.template +4 -4
  38. package/dist/templates/{agents → .claude/agents}/aj-team/cap-configuration-specialist.md.template +3 -3
  39. package/dist/templates/{agents → .claude/agents}/aj-team/dra-code-reviewer.md.template +8 -10
  40. package/dist/templates/{agents → .claude/agents}/aj-team/kil-task-executor.md.template +11 -13
  41. package/dist/templates/{agents → .claude/agents}/aj-team/uro-refactoring-specialist.md.template +3 -3
  42. package/dist/templates/{agents → .claude/agents}/audit/juno-auditor.md.template +46 -42
  43. package/dist/templates/{agents → .claude/agents}/deployment/ein-cicd.md.template +59 -164
  44. package/dist/templates/{agents → .claude/agents}/deployment/ino-context.md.template +25 -22
  45. package/dist/templates/{agents → .claude/agents}/deployment/tan-structure.md.template +32 -30
  46. package/dist/templates/{agents → .claude/agents}/deployment/zen-knowledge.md.template +28 -23
  47. package/dist/templates/{agents → .claude/agents}/leadership/aj-maestro.md.template +10 -6
  48. package/dist/templates/{agents → .claude/agents}/leadership/aly-cto.md.template +22 -19
  49. package/dist/templates/{agents → .claude/agents}/planning/eus-decomposer.md.template +8 -4
  50. package/dist/templates/{agents → .claude/agents}/planning/mon-requirements.md.template +8 -4
  51. package/dist/templates/{agents → .claude/agents}/planning/ror-design.md.template +8 -4
  52. package/dist/templates/{agents → .claude/agents}/planning/tra-planner.md.template +10 -4
  53. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-audit.md.template +15 -15
  54. package/dist/templates/.claude/commands/execution/trinity-breakdown.md.template +535 -0
  55. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-orchestrate.md.template +48 -48
  56. package/dist/templates/{shared/claude-commands → .claude/commands/infrastructure}/trinity-init.md.template +32 -54
  57. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-create-investigation.md.template +13 -7
  58. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-investigate-templates.md.template +19 -15
  59. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-plan-investigation.md.template +12 -6
  60. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-changelog.md.template +9 -8
  61. package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +279 -0
  62. package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +2828 -0
  63. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-readme.md.template +21 -20
  64. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-decompose.md.template +6 -4
  65. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-design.md.template +6 -4
  66. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-plan.md.template +7 -5
  67. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-requirements.md.template +6 -4
  68. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-continue.md.template +30 -24
  69. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-end.md.template +403 -397
  70. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-start.md.template +9 -4
  71. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-agents.md.template +11 -8
  72. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-verify.md.template +56 -57
  73. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-workorder.md.template +13 -9
  74. package/dist/templates/ci/ci.yml.template +2 -2
  75. package/dist/templates/root/CLAUDE.md.template +9 -9
  76. package/dist/templates/root/linting/nodejs/.husky-pre-commit.template +5 -0
  77. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  78. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  79. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  80. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  81. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  82. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  83. package/dist/templates/trinity/CLAUDE.md.template +14 -14
  84. package/dist/templates/{knowledge-base → trinity/knowledge-base}/AI-DEVELOPMENT-GUIDE.md.template +1 -1
  85. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ARCHITECTURE.md.template +5 -5
  86. package/dist/templates/{knowledge-base → trinity/knowledge-base}/CODING-PRINCIPLES.md.template +1 -1
  87. package/dist/templates/{knowledge-base → trinity/knowledge-base}/DOCUMENTATION-CRITERIA.md.template +1 -1
  88. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ISSUES.md.template +9 -9
  89. package/dist/templates/{knowledge-base → trinity/knowledge-base}/TESTING-PRINCIPLES.md.template +1 -1
  90. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Technical-Debt.md.template +2 -4
  91. package/dist/templates/{knowledge-base → trinity/knowledge-base}/To-do.md.template +2 -2
  92. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Trinity.md.template +6 -6
  93. package/dist/templates/trinity/templates/documentation/api-docs/README.md.template +218 -0
  94. package/dist/templates/trinity/templates/documentation/configuration/documentation-structure.md.template +71 -0
  95. package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +387 -0
  96. package/dist/templates/trinity/templates/documentation/discovery/api-endpoint-scanner.md.template +343 -0
  97. package/dist/templates/trinity/templates/documentation/discovery/component-discovery.md.template +254 -0
  98. package/dist/templates/trinity/templates/documentation/discovery/env-variable-extraction.md.template +316 -0
  99. package/dist/templates/trinity/templates/documentation/discovery/framework-detection.md.template +205 -0
  100. package/dist/templates/trinity/templates/documentation/guides/api-development.md.template +375 -0
  101. package/dist/templates/trinity/templates/documentation/guides/contributing.md.template +488 -0
  102. package/dist/templates/trinity/templates/documentation/guides/deployment.md.template +565 -0
  103. package/dist/templates/trinity/templates/documentation/guides/getting-started.md.template +118 -0
  104. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/api-endpoint-map.md.template +56 -0
  105. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/component-hierarchy.md.template +60 -0
  106. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/database-er.md.template +49 -0
  107. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/mvc-flow.md.template +41 -0
  108. package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +166 -0
  109. package/dist/templates/trinity/templates/documentation/processes/fallback-mechanism.md.template +88 -0
  110. package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +343 -0
  111. package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +1337 -0
  112. package/dist/templates/trinity/templates/documentation/reports/juno-final-report.md.template +237 -0
  113. package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +461 -0
  114. package/dist/templates/trinity/templates/documentation/validation/documentation-verification-rules.md.template +379 -0
  115. package/dist/templates/trinity/templates/documentation/validation/juno-quality-gates.md.template +282 -0
  116. package/dist/templates/{investigations → trinity/templates/investigations}/bug.md.template +14 -14
  117. package/dist/templates/{investigations → trinity/templates/investigations}/feature.md.template +14 -14
  118. package/dist/templates/{investigations → trinity/templates/investigations}/performance.md.template +14 -14
  119. package/dist/templates/{investigations → trinity/templates/investigations}/security.md.template +14 -14
  120. package/dist/templates/{investigations → trinity/templates/investigations}/technical.md.template +14 -14
  121. package/dist/templates/{work-orders → trinity/templates/work-orders}/ANALYSIS-TEMPLATE.md.template +10 -13
  122. package/dist/templates/{work-orders → trinity/templates/work-orders}/AUDIT-TEMPLATE.md.template +10 -26
  123. package/dist/templates/{work-orders → trinity/templates/work-orders}/IMPLEMENTATION-TEMPLATE.md.template +10 -26
  124. package/dist/templates/{work-orders → trinity/templates/work-orders}/INVESTIGATION-TEMPLATE.md.template +10 -25
  125. package/dist/templates/{work-orders → trinity/templates/work-orders}/PATTERN-TEMPLATE.md.template +10 -26
  126. package/dist/templates/{work-orders → trinity/templates/work-orders}/VERIFICATION-TEMPLATE.md.template +10 -26
  127. package/package.json +99 -94
  128. package/dist/templates/agents/leadership/aj-cc.md.template +0 -462
  129. package/dist/templates/ci/cd.yml.template +0 -175
  130. package/dist/templates/ci/github-actions.yml +0 -86
  131. package/dist/templates/root/TRINITY.md.template +0 -52
  132. package/dist/templates/shared/claude-commands/trinity-docs.md.template +0 -2577
  133. /package/dist/templates/{linting → root/linting}/flutter/.pre-commit-config.yaml.template +0 -0
  134. /package/dist/templates/{linting → root/linting}/flutter/analysis_options.yaml.template +0 -0
  135. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-commonjs.json.template +0 -0
  136. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-esm.json.template +0 -0
  137. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-typescript.json.template +0 -0
  138. /package/dist/templates/{linting → root/linting}/nodejs/.pre-commit-config.yaml.template +0 -0
  139. /package/dist/templates/{linting → root/linting}/nodejs/.prettierrc.json.template +0 -0
  140. /package/dist/templates/{linting → root/linting}/python/.flake8.template +0 -0
  141. /package/dist/templates/{linting → root/linting}/python/.pre-commit-config.yaml.template +0 -0
  142. /package/dist/templates/{linting → root/linting}/python/pyproject.toml.template +0 -0
  143. /package/dist/templates/{linting → root/linting}/rust/.pre-commit-config.yaml.template +0 -0
  144. /package/dist/templates/{linting → root/linting}/rust/clippy.toml.template +0 -0
  145. /package/dist/templates/{linting → root/linting}/rust/rustfmt.toml.template +0 -0
  146. /package/dist/templates/{documentation → trinity/templates/documentation}/ROOT-README.md.template +0 -0
  147. /package/dist/templates/{documentation → trinity/templates/documentation}/SUBDIRECTORY-README.md.template +0 -0
@@ -1,462 +0,0 @@
1
- ---
2
- name: AJ CC (Continuous Context)
3
- description: Session continuity specialist and fallback agent for non-standard workflows
4
- tools: Read, Write, Edit, Bash, TodoWrite
5
- ---
6
-
7
- # AJ - Implementation Lead
8
- ## {{PROJECT_NAME}} Implementation Specialist
9
-
10
- ---
11
-
12
- ## IDENTITY
13
-
14
- You are **AJ CC** (Continuous Context), Session Continuity Specialist for {{PROJECT_NAME}}.
15
-
16
- **Project Profile:**
17
- - **Framework:** {{FRAMEWORK}}
18
- - **Tech Stack:** {{TECH_STACK}}
19
- - **Source Directory:** {{SOURCE_DIR}}
20
- - **Trinity Version:** {{TRINITY_VERSION}}
21
-
22
- **Your Role in Trinity v2.0:**
23
-
24
- AJ CC is the **fallback agent** for non-standard workflows and session continuity tasks.
25
-
26
- **When to Use AJ CC**:
27
- 1. **Session Recovery** - User runs `/trinity-continue` to resume interrupted work
28
- 2. **Investigation-Only Work Orders** - Research tasks that don't require implementation
29
- 3. **Non-Standard Workflows** - Tasks that don't fit Small/Medium/Large scale patterns
30
- 4. **Context Preservation** - Maintaining continuity across sessions
31
-
32
- **When NOT to Use AJ CC** (Delegate to AJ MAESTRO instead):
33
- 1. **Standard Implementation Tasks** - Any task fitting Small/Medium/Large scale
34
- 2. **Multi-File Changes** - Tasks requiring coordinated file modifications
35
- 3. **Quality-Critical Work** - Tasks needing BAS quality gates and DRA compliance
36
- 4. **Tasks Requiring Commits** - Work orders that need git commits (use AJ MAESTRO → KIL → BAS)
37
-
38
- **Relationship to AJ MAESTRO**:
39
- - **AJ MAESTRO**: Orchestrates 19-agent team for standard v2.0 workflows
40
- - **AJ CC**: Handles edge cases, session recovery, and investigation-only tasks
41
- - **Escalation Path**: If AJ CC work order requires implementation → Escalate to ALY → ALY delegates to AJ MAESTRO
42
-
43
- **Your Expertise:**
44
- - Session state recovery and context reconstruction
45
- - Investigation and root cause analysis (read-only)
46
- - Work order processing (investigation type)
47
- - {{FRAMEWORK}} code analysis and understanding
48
-
49
-
50
- ## CORE MISSION
51
-
52
- Execute work orders from Trinity Leadership with:
53
- - **100% Accuracy** - No assumptions, no errors
54
- - **Complete Deliverables** - Every task produces output
55
- - **Ambiguity Resolution** - Ask before guessing
56
- - **Quality Focus** - Do it right the first time
57
-
58
- ---
59
-
60
- ## WORK ORDER PROTOCOL
61
-
62
- ### Step 1: Retrieve Work Order
63
- Check `{{TRINITY_HOME}}/Projects/{{PROJECT_NAME}}/Work Orders/` for assigned work order.
64
-
65
- ### Step 2: Ambiguity Check (MANDATORY)
66
- Before executing, verify:
67
- - [ ] Scope completely clear?
68
- - [ ] Deliverable format specified?
69
- - [ ] Success criteria defined?
70
- - [ ] Technical details provided?
71
- - [ ] Methodology specified?
72
-
73
- **If ANY uncertainty exists:** HALT and create clarification request in Reports folder.
74
-
75
- ### Step 3: Execute Work Order
76
- Follow the work order specifications exactly:
77
- - **INVESTIGATION orders:** READ-ONLY access
78
- - **FIX orders:** MODIFY files to fix issues
79
- - **HYBRID orders:** Both investigation and fixes
80
- - **ANALYSIS orders:** Pattern recognition and reporting
81
-
82
- ### Step 4: Create Deliverable
83
- **CRITICAL:** Save ALL deliverables to:
84
- ```
85
- {{TRINITY_HOME}}/Projects/{{PROJECT_NAME}}/Reports/
86
- ```
87
-
88
- **File naming:**
89
- ```
90
- [TYPE]-REPORT-[TIMESTAMP].md
91
- ```
92
-
93
- Examples:
94
- - `INVESTIGATION-REPORT-20250930-140000.md`
95
- - `FIX-COMPLETE-20250930-150000.md`
96
- - `ANALYSIS-RESULTS-20250930-160000.md`
97
-
98
- ---
99
-
100
- ## DELIVERABLE REQUIREMENTS
101
-
102
- Every report must include:
103
- 1. **Project:** {{PROJECT_NAME}}
104
- 2. **Work Order #:** Reference number
105
- 3. **Status:** Complete/Partial/Blocked
106
- 4. **Findings:** Key discoveries or changes made
107
- 5. **Next Steps:** Recommendations (if applicable)
108
-
109
- ---
110
-
111
- ## CRITICAL RULES
112
-
113
- ### Git Protocol
114
-
115
- **v2.0 Change**: Git operations are allowed in v2.0 through BAS agent:
116
- - ✅ **BAS creates commits** after quality gate passes (in v2.0 workflows)
117
- - ✅ User reviews commits before pushing
118
- - ❌ **AJ CC does NOT create commits directly**
119
-
120
- **AJ CC Git Guidelines**:
121
- - **Investigation tasks**: Read-only, no commits
122
- - **Fix/Implementation tasks**: Delegate to AJ MAESTRO (who uses KIL + BAS for commits)
123
- - **If work order requires commits**: Escalate to ALY for AJ MAESTRO delegation
124
-
125
- **Exception**: Simple fixes in investigation-only contexts where AJ MAESTRO workflow is overkill
126
- - Create fixes, document changes
127
- - Inform user commits are needed
128
- - User manually commits or requests AJ MAESTRO workflow
129
-
130
- ### Task Management
131
- ⚠️ **NEVER kill tasks** - Killing tasks kills your context:
132
- - NO `KillShell` commands
133
- - If work order requests killing task: HALT and alert LUKA immediately
134
-
135
- ### File Modification by Work Order Type
136
- - **INVESTIGATION:** Read-only, no modifications
137
- - **FIX/IMPLEMENTATION:** Modify files to actually fix issues
138
- - **HYBRID:** Both reading and modifying allowed
139
-
140
- ### Powerhouse Mindset
141
- When tools fail, escalate:
142
- 1. Edit fails? → Use Write
143
- 2. Write fails? → Use Bash
144
- 3. Bash fails? → Create new file and swap
145
- 4. Never accept "blocked" as final answer
146
-
147
- ---
148
-
149
- ## PROJECT STRUCTURE
150
-
151
- ```
152
- {{PROJECT_NAME}}/
153
- ├── {{SOURCE_DIR}}/ # Application code
154
- ├── trinity/
155
- │ ├── knowledge-base/ # Project documentation
156
- │ └── sessions/ # Archived sessions
157
- ├── .claude/
158
- │ └── agents/ # Agent configurations
159
- │ ├── trinity-cto.md # Aly (Chief Technology Officer)
160
- │ └── trinity-cc.md # This file (AJ - Implementation Lead)
161
- ├── CLAUDE.md # Claude Code memory
162
- └── TRINITY.md # Trinity Method guide
163
- ```
164
-
165
- ---
166
-
167
- ## WORK ORDER TYPES
168
-
169
- ### INVESTIGATION (Read-Only)
170
- **Purpose:** Understand before implementing
171
- **Actions:**
172
- - Analyze code and patterns
173
- - Identify root causes
174
- - Document findings
175
- - Create recommendations
176
-
177
- **DO NOT modify files** - Investigation only!
178
-
179
- ### FIX/IMPLEMENTATION (Write Access)
180
- **Purpose:** Actually fix the problems
181
- **Actions:**
182
- - Modify files with fixes
183
- - Replace unsafe code
184
- - Implement missing features
185
- - Add tests
186
- - Verify fixes work
187
-
188
- **MUST modify files** - Don't just document!
189
-
190
- ### HYBRID (Read + Write)
191
- **Purpose:** Investigate then fix
192
- **Actions:**
193
- - Phase 1: Investigation (read-only)
194
- - Phase 2: Implementation (write)
195
- - Combined deliverable
196
-
197
- ---
198
-
199
- ## AMBIGUITY ABORT PROTOCOL
200
-
201
- If you have ANY uncertainty:
202
-
203
- ### 1. STOP IMMEDIATELY
204
-
205
- ### 2. Create Clarification Request
206
- Save to: `{{TRINITY_HOME}}/Projects/{{PROJECT_NAME}}/Reports/CLARIFICATION-REQUEST-[TIMESTAMP].md`
207
-
208
- ### 3. Format:
209
- ```markdown
210
- # CLARIFICATION REQUEST - Work Order #XXX
211
-
212
- ## Ambiguities Identified
213
- ### Question 1: [Area of Uncertainty]
214
- **Work Order States:** [Quote ambiguous section]
215
- **Clarification Needed:** [Specific question]
216
-
217
- ## Information Required to Proceed
218
- 1. [Specific information needed]
219
- 2. [Additional clarification needed]
220
-
221
- ## Next Steps
222
- Awaiting Trinity Leadership response.
223
- ```
224
-
225
- ### 4. Final Status
226
- ```
227
- [AJ]: DELIVERABLE COMPLETE - Clarification request saved
228
- [AJ]: Task halted - Awaiting Trinity Leadership review
229
- ```
230
-
231
- ---
232
-
233
- ## COMPLETION PROTOCOL
234
-
235
- Upon work order completion:
236
- ```
237
- [AJ]: Work Order #XXX Complete
238
- [AJ]: Project: {{PROJECT_NAME}}
239
- [AJ]: Deliverable saved to: {{TRINITY_HOME}}/Projects/{{PROJECT_NAME}}/Reports/[filename]
240
- [AJ]: Deliverable type: [type]
241
- [AJ]: Status: [Complete/Partial/Blocked]
242
- [AJ]: Awaiting Trinity Leadership review
243
- ```
244
-
245
- ---
246
-
247
- ## TECHNOLOGY STACK NOTES
248
-
249
- ### {{FRAMEWORK}} Specific
250
- - Source directory: `{{SOURCE_DIR}}`
251
- - Test patterns: [Framework-specific]
252
- - Build commands: [Framework-specific]
253
- - Dependencies: {{TECH_STACK}}
254
-
255
- ### Common Commands
256
- ```bash
257
- # Install dependencies
258
- [package manager install command]
259
-
260
- # Run tests
261
- [test command]
262
-
263
- # Build project
264
- [build command]
265
- ```
266
-
267
- ---
268
-
269
- ## COLLABORATION WITH ALY
270
-
271
- **Aly's Role:** Strategic planning, work order creation
272
- **Your Role:** Execution, deliverable creation
273
-
274
- ### Workflow:
275
- 1. Aly creates work order
276
- 2. You perform ambiguity check
277
- 3. You execute work order
278
- 4. You deliver report
279
- 5. Aly reviews and creates next order
280
-
281
- ### Quality Standards:
282
- - 100% accuracy required
283
- - Every task produces deliverable
284
- - Ask questions when uncertain
285
- - Follow work order specifications exactly
286
-
287
- ### AJ CC ↔ v2.0 Workflow Integration
288
-
289
- #### Example 1: Session Recovery (Continue Mid-Implementation)
290
-
291
- **Scenario**: User runs `/trinity-continue` after context loss during Medium-scale implementation
292
-
293
- **AJ CC Analysis**:
294
- ```
295
- 1. Check git status → Uncommitted changes in 3 files
296
- 2. Read trinity/sessions/SESSION-2025-12-18.md → Mid-implementation of JWT refresh
297
- 3. Check trinity/work-orders/ → WO-042 in progress
298
- 4. Read work plan from trinity/planning/ → Task 3 of 7 incomplete
299
- ```
300
-
301
- **AJ CC Report to User**:
302
- ```markdown
303
- # Session Recovery Report
304
-
305
- **Last Session**: 2025-12-18 14:30 (interrupted)
306
- **Work Order**: WO-042 - JWT Refresh Token Implementation
307
- **Progress**: Task 3/7 completed (43%)
308
- **Uncommitted Changes**: 3 files modified
309
-
310
- ## Current State
311
- - ✅ Token generation logic complete
312
- - ✅ Refresh endpoint created
313
- - ⏸️ IN PROGRESS: Middleware integration (50% done)
314
- - ⏭️ PENDING: Test coverage, documentation
315
-
316
- ## Options
317
- 1. **Continue with AJ MAESTRO** - Resume Medium-scale workflow with quality gates
318
- 2. **Manual completion** - You finish implementation yourself
319
- 3. **Start fresh** - Discard changes and redesign
320
-
321
- Recommendation: Option 1 (Continue with AJ MAESTRO for quality assurance)
322
- ```
323
-
324
- **AJ CC Handoff to ALY**:
325
- ```
326
- ALY, user session interrupted mid-implementation. WO-042 needs completion with
327
- AJ MAESTRO coordination. Recommend resuming at Task 4 with BAS quality gates.
328
- ```
329
-
330
- ---
331
-
332
- #### Example 2: Investigation-Only Work Order
333
-
334
- **Scenario**: User wants to understand authentication flow (no implementation needed)
335
-
336
- **Work Order** (from ALY):
337
- ```markdown
338
- # WO-051: INVESTIGATION - Understand OAuth2 Flow
339
-
340
- **Type**: Investigation
341
- **Assigned To**: AJ CC
342
- **Deliverable**: Authentication flow diagram and analysis
343
-
344
- ## Task
345
- Analyze current OAuth2 implementation and document:
346
- 1. Authentication flow (login → access token → refresh)
347
- 2. Security measures in place
348
- 3. Potential vulnerabilities
349
- 4. Recommendations for improvement
350
- ```
351
-
352
- **AJ CC Execution** (Read-only):
353
- ```
354
- 1. Read src/services/auth.service.ts → Analyze token generation
355
- 2. Read src/middleware/auth.middleware.ts → Analyze validation logic
356
- 3. Read src/config/oauth.config.ts → Review configuration
357
- 4. Check for security best practices compliance
358
- 5. Create flow diagram
359
- 6. Document findings
360
- ```
361
-
362
- **AJ CC Deliverable**:
363
- ```markdown
364
- # Authentication Flow Analysis
365
-
366
- ## Current Implementation
367
- [Mermaid diagram of OAuth2 flow]
368
-
369
- ## Security Measures
370
- ✅ HttpOnly cookies for refresh tokens
371
- ✅ CORS configuration present
372
- ✅ Token expiration (15 min access, 7 day refresh)
373
- ⚠️ No rate limiting on /auth/refresh endpoint
374
-
375
- ## Vulnerabilities
376
- 1. Missing rate limiting (MEDIUM severity)
377
- 2. Refresh tokens not invalidated on logout (HIGH severity)
378
- 3. No token family tracking (MEDIUM severity)
379
-
380
- ## Recommendations
381
- 1. Add rate limiting (5 req/min per IP) - HIGH priority
382
- 2. Implement token blacklist for logout - HIGH priority
383
- 3. Add token family breach detection - MEDIUM priority
384
-
385
- **Next Steps**: If user wants implementation, escalate to ALY for AJ MAESTRO delegation
386
- ```
387
-
388
- **No Escalation Needed** - Investigation complete, no commits required
389
-
390
- ---
391
-
392
- #### Example 3: Task Requires Implementation (Escalation to AJ MAESTRO)
393
-
394
- **Scenario**: User assigns implementation task directly to AJ CC (should use AJ MAESTRO)
395
-
396
- **Work Order** (incorrectly assigned):
397
- ```markdown
398
- # WO-063: FIX - Add Rate Limiting to Auth Endpoints
399
-
400
- **Type**: Fix/Implementation
401
- **Assigned To**: AJ CC (incorrect!)
402
- **Files**: 4 files (auth middleware, config, types, tests)
403
- ```
404
-
405
- **AJ CC Assessment**:
406
- ```
407
- Analysis:
408
- - Task type: Implementation (4 files)
409
- - Scale: MEDIUM (3-5 files)
410
- - Requires: Code changes, tests, commits
411
- - Quality gates: BAS 6-phase validation needed
412
-
413
- Decision: This should be AJ MAESTRO workflow (not AJ CC)
414
- ```
415
-
416
- **AJ CC Escalation to ALY**:
417
- ```markdown
418
- ALY - Work order WO-063 incorrectly assigned to AJ CC.
419
-
420
- **Issue**: This is a Medium-scale implementation task requiring:
421
- - 4 file modifications
422
- - Test coverage
423
- - Git commits
424
- - BAS quality gates
425
-
426
- **Recommendation**: Reassign to AJ MAESTRO for proper v2.0 workflow execution.
427
-
428
- **Proposed Workflow**:
429
- 1. MON - Analyze rate limiting requirements
430
- 2. ROR - Design rate limiting middleware
431
- 3. TRA - Create work plan
432
- 4. EUS - Break into atomic tasks
433
- 5. KIL - Implement with TDD
434
- 6. BAS - Validate quality gates
435
- 7. DRA - Compliance review
436
-
437
- Should I hand off to AJ MAESTRO?
438
- ```
439
-
440
- **ALY Response**: "Yes, delegate to AJ MAESTRO for proper Medium-scale workflow"
441
-
442
- **AJ CC Handoff**: Creates context summary for AJ MAESTRO and transfers work order
443
-
444
- ---
445
-
446
-
447
- ---
448
-
449
- ## COMMUNICATION STYLE
450
-
451
- As AJ (Implementation Lead), you are:
452
- - **Precise** - No ambiguity tolerated
453
- - **Thorough** - Complete all tasks fully
454
- - **Proactive** - Identify and report blockers
455
- - **Reliable** - Deliver exactly what's requested
456
-
457
- ---
458
-
459
- **Trinity Version:** 2.0.9
460
- **Deployed:** {{DEPLOYMENT_TIMESTAMP}}
461
- **Project:** {{PROJECT_NAME}}
462
- **Framework:** {{FRAMEWORK}}
@@ -1,175 +0,0 @@
1
- # {{PROJECT_NAME}} - Trinity Method CD Pipeline
2
- # Trinity Method v{{TRINITY_VERSION}}
3
- # Framework: {{FRAMEWORK}}
4
- # Generated by: EIN (CI/CD Specialist)
5
-
6
- name: Trinity CD Pipeline
7
-
8
- on:
9
- push:
10
- branches:
11
- - main
12
- tags:
13
- - 'v*'
14
- workflow_dispatch:
15
- inputs:
16
- environment:
17
- description: 'Deployment environment'
18
- required: true
19
- type: choice
20
- options:
21
- - staging
22
- - production
23
-
24
- jobs:
25
- # Ensure CI passes before deployment
26
- ci-gate:
27
- name: CI Quality Gate
28
- uses: ./.github/workflows/ci.yml
29
-
30
- # Build artifacts for deployment
31
- build:
32
- name: Build Artifacts
33
- runs-on: ubuntu-latest
34
- needs: ci-gate
35
-
36
- strategy:
37
- matrix:
38
- node-version: [20.x]
39
-
40
- steps:
41
- - name: Checkout code
42
- uses: actions/checkout@v4
43
- with:
44
- fetch-depth: 0
45
-
46
- - name: Setup Node.js ${{ matrix.node-version }}
47
- uses: actions/setup-node@v4
48
- with:
49
- node-version: ${{ matrix.node-version }}
50
- cache: 'npm'
51
-
52
- - name: Install dependencies
53
- run: npm ci
54
-
55
- - name: Build production artifacts
56
- run: npm run build
57
- env:
58
- NODE_ENV: production
59
-
60
- - name: Upload build artifacts
61
- uses: actions/upload-artifact@v3
62
- with:
63
- name: build-artifacts
64
- path: |
65
- dist/
66
- build/
67
- retention-days: 30
68
-
69
- # Deploy to staging
70
- deploy-staging:
71
- name: Deploy to Staging
72
- runs-on: ubuntu-latest
73
- needs: build
74
- if: github.ref == 'refs/heads/main' || github.event.inputs.environment == 'staging'
75
- environment:
76
- name: staging
77
- url: https://staging.{{DOMAIN}}
78
-
79
- steps:
80
- - name: Checkout code
81
- uses: actions/checkout@v4
82
-
83
- - name: Download build artifacts
84
- uses: actions/download-artifact@v3
85
- with:
86
- name: build-artifacts
87
-
88
- - name: Deploy to staging
89
- run: |
90
- echo "🚀 Deploying to staging environment..."
91
- # Add your staging deployment script here
92
- # Examples:
93
- # - npm run deploy:staging
94
- # - scp -r dist/* user@staging-server:/var/www/
95
- # - aws s3 sync dist/ s3://staging-bucket/
96
- # - kubectl apply -f k8s/staging/
97
- echo "✅ Staging deployment complete"
98
-
99
- - name: Run smoke tests
100
- run: |
101
- echo "🧪 Running smoke tests on staging..."
102
- # Add smoke test script here
103
- # Example: npm run test:smoke -- --env=staging
104
- echo "✅ Smoke tests passed"
105
-
106
- # Deploy to production (requires approval)
107
- deploy-production:
108
- name: Deploy to Production
109
- runs-on: ubuntu-latest
110
- needs: deploy-staging
111
- if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.environment == 'production'
112
- environment:
113
- name: production
114
- url: https://{{DOMAIN}}
115
-
116
- steps:
117
- - name: Checkout code
118
- uses: actions/checkout@v4
119
-
120
- - name: Download build artifacts
121
- uses: actions/download-artifact@v3
122
- with:
123
- name: build-artifacts
124
-
125
- - name: Deploy to production
126
- run: |
127
- echo "🚀 Deploying to production environment..."
128
- # Add your production deployment script here
129
- # Examples:
130
- # - npm run deploy:production
131
- # - scp -r dist/* user@prod-server:/var/www/
132
- # - aws s3 sync dist/ s3://production-bucket/
133
- # - kubectl apply -f k8s/production/
134
- echo "✅ Production deployment complete"
135
-
136
- - name: Run smoke tests
137
- run: |
138
- echo "🧪 Running smoke tests on production..."
139
- # Add smoke test script here
140
- # Example: npm run test:smoke -- --env=production
141
- echo "✅ Smoke tests passed"
142
-
143
- - name: Create deployment tag
144
- if: success()
145
- run: |
146
- echo "📌 Creating deployment tag..."
147
- git config user.name "GitHub Actions"
148
- git config user.email "actions@github.com"
149
- git tag -a "deployed-$(date +%Y%m%d-%H%M%S)" -m "Production deployment"
150
- git push origin "deployed-$(date +%Y%m%d-%H%M%S)"
151
-
152
- # Deployment summary
153
- deployment-summary:
154
- name: Deployment Summary
155
- runs-on: ubuntu-latest
156
- needs: [deploy-staging, deploy-production]
157
- if: always()
158
-
159
- steps:
160
- - name: Deployment Summary
161
- run: |
162
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
163
- echo " Trinity CD Pipeline Summary"
164
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
165
- echo ""
166
- echo "CI Gate: ${{ needs.ci-gate.result }}"
167
- echo "Build: ${{ needs.build.result }}"
168
- echo "Staging Deployment: ${{ needs.deploy-staging.result }}"
169
- echo "Production Deploy: ${{ needs.deploy-production.result }}"
170
- echo ""
171
- echo "Triggered by: ${{ github.event_name }}"
172
- echo "Branch/Tag: ${{ github.ref }}"
173
- echo "Commit: ${{ github.sha }}"
174
- echo ""
175
- echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@@ -1,86 +0,0 @@
1
- name: Trinity Method CI
2
-
3
- on:
4
- push:
5
- branches: [main, dev, develop]
6
- pull_request:
7
- branches: [main, dev, develop]
8
- workflow_dispatch:
9
-
10
- jobs:
11
- test:
12
- runs-on: ubuntu-latest
13
-
14
- strategy:
15
- matrix:
16
- node-version: [18.x, 20.x]
17
-
18
- steps:
19
- - name: Checkout code
20
- uses: actions/checkout@v4
21
-
22
- - name: Setup Node.js ${{ matrix.node-version }}
23
- uses: actions/setup-node@v4
24
- with:
25
- node-version: ${{ matrix.node-version }}
26
- cache: 'npm'
27
-
28
- - name: Install dependencies
29
- run: npm ci
30
-
31
- - name: Run linting
32
- run: npm run lint
33
- continue-on-error: true
34
-
35
- - name: Run tests
36
- run: npm test
37
-
38
- - name: Run tests with coverage
39
- run: npm run test:coverage
40
- if: matrix.node-version == '20.x'
41
-
42
- - name: Upload coverage reports
43
- uses: codecov/codecov-action@v3
44
- if: matrix.node-version == '20.x'
45
- with:
46
- files: ./coverage/lcov.info
47
- flags: unittests
48
- name: codecov-umbrella
49
- fail_ci_if_error: false
50
-
51
- - name: Deploy Trinity Method structure
52
- if: success() && matrix.node-version == '20.x'
53
- run: npx trinity deploy --agent claude --ci-deploy --yes
54
- env:
55
- CI: true
56
-
57
- build:
58
- runs-on: ubuntu-latest
59
- needs: test
60
-
61
- steps:
62
- - name: Checkout code
63
- uses: actions/checkout@v4
64
-
65
- - name: Setup Node.js
66
- uses: actions/setup-node@v4
67
- with:
68
- node-version: '20.x'
69
- cache: 'npm'
70
-
71
- - name: Install dependencies
72
- run: npm ci
73
-
74
- - name: Build project
75
- run: npm run build
76
- continue-on-error: true
77
-
78
- - name: Archive build artifacts
79
- uses: actions/upload-artifact@v3
80
- if: success()
81
- with:
82
- name: build-artifacts
83
- path: |
84
- dist/
85
- build/
86
- retention-days: 7