trinity-method-sdk 2.0.8 → 2.1.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 (123) hide show
  1. package/CHANGELOG.md +235 -0
  2. package/README.md +34 -35
  3. package/dist/cli/commands/deploy/agents.js +1 -1
  4. package/dist/cli/commands/deploy/claude-setup.js +28 -35
  5. package/dist/cli/commands/deploy/index.js +1 -1
  6. package/dist/cli/commands/deploy/knowledge-base.js +1 -1
  7. package/dist/cli/commands/deploy/root-files.js +1 -1
  8. package/dist/cli/commands/deploy/sdk-install.js +1 -1
  9. package/dist/cli/commands/deploy/templates.js +29 -16
  10. package/dist/cli/commands/update/agents.js +1 -1
  11. package/dist/cli/commands/update/commands.d.ts +1 -0
  12. package/dist/cli/commands/update/commands.js +18 -45
  13. package/dist/cli/commands/update/knowledge-base.js +1 -1
  14. package/dist/cli/commands/update/templates.js +34 -12
  15. package/dist/cli/utils/deploy-linting.js +1 -1
  16. package/dist/cli/utils/template-processor.js +1 -1
  17. package/dist/templates/{claude → .claude}/EMPLOYEE-DIRECTORY.md.template +1 -1
  18. package/dist/templates/{agents → .claude/agents}/aj-team/apo-documentation-specialist.md.template +3 -3
  19. package/dist/templates/{agents → .claude/agents}/aj-team/bas-quality-gate.md.template +6 -8
  20. package/dist/templates/{agents → .claude/agents}/aj-team/bon-dependency-manager.md.template +8 -8
  21. package/dist/templates/{agents → .claude/agents}/aj-team/cap-configuration-specialist.md.template +3 -3
  22. package/dist/templates/{agents → .claude/agents}/aj-team/dra-code-reviewer.md.template +5 -7
  23. package/dist/templates/{agents → .claude/agents}/aj-team/kil-task-executor.md.template +5 -7
  24. package/dist/templates/{agents → .claude/agents}/aj-team/uro-refactoring-specialist.md.template +3 -3
  25. package/dist/templates/{agents → .claude/agents}/audit/juno-auditor.md.template +7 -2
  26. package/dist/templates/{agents → .claude/agents}/deployment/ein-cicd.md.template +3 -4
  27. package/dist/templates/{agents → .claude/agents}/deployment/ino-context.md.template +6 -3
  28. package/dist/templates/{agents → .claude/agents}/deployment/tan-structure.md.template +4 -1
  29. package/dist/templates/{agents → .claude/agents}/deployment/zen-knowledge.md.template +11 -5
  30. package/dist/templates/{agents → .claude/agents}/leadership/aj-cc.md.template +7 -2
  31. package/dist/templates/{agents → .claude/agents}/leadership/aj-maestro.md.template +4 -0
  32. package/dist/templates/{agents → .claude/agents}/leadership/aly-cto.md.template +5 -1
  33. package/dist/templates/{agents → .claude/agents}/planning/eus-decomposer.md.template +4 -0
  34. package/dist/templates/{agents → .claude/agents}/planning/mon-requirements.md.template +4 -0
  35. package/dist/templates/{agents → .claude/agents}/planning/ror-design.md.template +4 -0
  36. package/dist/templates/{agents → .claude/agents}/planning/tra-planner.md.template +6 -0
  37. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-audit.md.template +6 -6
  38. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-orchestrate.md.template +5 -5
  39. package/dist/templates/{shared/claude-commands → .claude/commands/infrastructure}/trinity-init.md.template +12 -11
  40. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-create-investigation.md.template +8 -2
  41. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-investigate-templates.md.template +9 -5
  42. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-plan-investigation.md.template +11 -5
  43. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-changelog.md.template +5 -4
  44. package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +279 -0
  45. package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +2828 -0
  46. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-readme.md.template +144 -35
  47. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-decompose.md.template +6 -4
  48. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-design.md.template +6 -4
  49. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-plan.md.template +7 -5
  50. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-requirements.md.template +6 -4
  51. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-continue.md.template +9 -3
  52. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-end.md.template +8 -2
  53. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-start.md.template +8 -2
  54. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-agents.md.template +8 -2
  55. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-verify.md.template +9 -4
  56. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-workorder.md.template +8 -4
  57. package/dist/templates/root/TRINITY.md.template +1 -1
  58. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  59. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  60. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  61. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  62. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  63. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  64. package/dist/templates/{knowledge-base → trinity/knowledge-base}/AI-DEVELOPMENT-GUIDE.md.template +1 -1
  65. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ARCHITECTURE.md.template +3 -3
  66. package/dist/templates/{knowledge-base → trinity/knowledge-base}/CODING-PRINCIPLES.md.template +1 -1
  67. package/dist/templates/{knowledge-base → trinity/knowledge-base}/DOCUMENTATION-CRITERIA.md.template +1 -1
  68. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ISSUES.md.template +3 -3
  69. package/dist/templates/{knowledge-base → trinity/knowledge-base}/TESTING-PRINCIPLES.md.template +1 -1
  70. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Technical-Debt.md.template +3 -3
  71. package/dist/templates/{knowledge-base → trinity/knowledge-base}/To-do.md.template +3 -3
  72. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Trinity.md.template +4 -3
  73. package/dist/templates/{documentation → trinity/templates/documentation}/SUBDIRECTORY-README.md.template +1 -1
  74. package/dist/templates/trinity/templates/documentation/api-docs/README.md.template +218 -0
  75. package/dist/templates/trinity/templates/documentation/configuration/documentation-structure.md.template +71 -0
  76. package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +387 -0
  77. package/dist/templates/trinity/templates/documentation/discovery/api-endpoint-scanner.md.template +343 -0
  78. package/dist/templates/trinity/templates/documentation/discovery/component-discovery.md.template +254 -0
  79. package/dist/templates/trinity/templates/documentation/discovery/env-variable-extraction.md.template +316 -0
  80. package/dist/templates/trinity/templates/documentation/discovery/framework-detection.md.template +205 -0
  81. package/dist/templates/trinity/templates/documentation/guides/api-development.md.template +375 -0
  82. package/dist/templates/trinity/templates/documentation/guides/contributing.md.template +488 -0
  83. package/dist/templates/trinity/templates/documentation/guides/deployment.md.template +565 -0
  84. package/dist/templates/trinity/templates/documentation/guides/getting-started.md.template +118 -0
  85. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/api-endpoint-map.md.template +56 -0
  86. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/component-hierarchy.md.template +60 -0
  87. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/database-er.md.template +49 -0
  88. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/mvc-flow.md.template +41 -0
  89. package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +166 -0
  90. package/dist/templates/trinity/templates/documentation/processes/fallback-mechanism.md.template +88 -0
  91. package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +343 -0
  92. package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +1337 -0
  93. package/dist/templates/trinity/templates/documentation/reports/juno-final-report.md.template +237 -0
  94. package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +461 -0
  95. package/dist/templates/trinity/templates/documentation/validation/documentation-verification-rules.md.template +379 -0
  96. package/dist/templates/trinity/templates/documentation/validation/juno-quality-gates.md.template +282 -0
  97. package/dist/templates/{investigations → trinity/templates/investigations}/bug.md.template +2 -2
  98. package/dist/templates/{investigations → trinity/templates/investigations}/feature.md.template +2 -2
  99. package/dist/templates/{investigations → trinity/templates/investigations}/performance.md.template +2 -2
  100. package/dist/templates/{investigations → trinity/templates/investigations}/security.md.template +2 -2
  101. package/dist/templates/{investigations → trinity/templates/investigations}/technical.md.template +2 -2
  102. package/dist/templates/{work-orders → trinity/templates/work-orders}/ANALYSIS-TEMPLATE.md.template +0 -3
  103. package/dist/templates/{work-orders → trinity/templates/work-orders}/AUDIT-TEMPLATE.md.template +0 -16
  104. package/dist/templates/{work-orders → trinity/templates/work-orders}/IMPLEMENTATION-TEMPLATE.md.template +0 -16
  105. package/dist/templates/{work-orders → trinity/templates/work-orders}/INVESTIGATION-TEMPLATE.md.template +0 -15
  106. package/dist/templates/{work-orders → trinity/templates/work-orders}/PATTERN-TEMPLATE.md.template +0 -16
  107. package/dist/templates/{work-orders → trinity/templates/work-orders}/VERIFICATION-TEMPLATE.md.template +0 -16
  108. package/package.json +1 -1
  109. package/dist/templates/shared/claude-commands/trinity-docs.md.template +0 -2208
  110. /package/dist/templates/{linting → root/linting}/flutter/.pre-commit-config.yaml.template +0 -0
  111. /package/dist/templates/{linting → root/linting}/flutter/analysis_options.yaml.template +0 -0
  112. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-commonjs.json.template +0 -0
  113. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-esm.json.template +0 -0
  114. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-typescript.json.template +0 -0
  115. /package/dist/templates/{linting → root/linting}/nodejs/.pre-commit-config.yaml.template +0 -0
  116. /package/dist/templates/{linting → root/linting}/nodejs/.prettierrc.json.template +0 -0
  117. /package/dist/templates/{linting → root/linting}/python/.flake8.template +0 -0
  118. /package/dist/templates/{linting → root/linting}/python/.pre-commit-config.yaml.template +0 -0
  119. /package/dist/templates/{linting → root/linting}/python/pyproject.toml.template +0 -0
  120. /package/dist/templates/{linting → root/linting}/rust/.pre-commit-config.yaml.template +0 -0
  121. /package/dist/templates/{linting → root/linting}/rust/clippy.toml.template +0 -0
  122. /package/dist/templates/{linting → root/linting}/rust/rustfmt.toml.template +0 -0
  123. /package/dist/templates/{documentation → trinity/templates/documentation}/ROOT-README.md.template +0 -0
package/CHANGELOG.md CHANGED
@@ -7,18 +7,253 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.1.0] - 2026-01-21
11
+
10
12
  ### Added
11
13
 
14
+ - **NEW: Trinity-docs-update command** - Comprehensive documentation update system for maintaining existing docs
15
+ - **Command:** `/maintenance:trinity-docs-update` - Updates existing documentation to reflect codebase changes
16
+ - **Architecture:** JUNO audit → 3 parallel APO instances → JUNO verification loop → Final quality audit
17
+ - **Autonomous Execution:** Runs from start to finish without user intervention unless errors occur
18
+ - **Version:** 2.0.9
19
+ - **Last Updated:** 2026-01-19
20
+
21
+ - **Trinity-docs-update - JUNO audit system** - Phase 1 comprehensive codebase analysis with mandatory verification protocols
22
+ - **Database Verification Protocol (Mandatory):**
23
+ - Step 1: Detect database presence via bash detection script
24
+ - Step 2: **MANDATORY** production database connection attempt if database detected
25
+ - Documents connection info search (.env, docker-compose.yml, config files)
26
+ - Documents connection attempt method and result (success/failure with reason)
27
+ - Falls back to schema files ONLY after documented connection failure
28
+ - Prevents documentation based on outdated schema files
29
+ - **Environment Configuration Verification Protocol (All Projects):**
30
+ - Priority 1: Check actual environment files (.env, .env.local) FIRST
31
+ - Priority 2: Check template files (.env.example)
32
+ - Priority 3: Check code defaults (|| fallback values)
33
+ - Documents all findings and discrepancies
34
+ - Source of truth order: Actual config > Template > Code defaults
35
+ - **Prevents false positives:** Won't flag correct docs as wrong by verifying against actual config
36
+ - **Business Logic Discovery:** Scans controllers, services, models, utilities at function-level granularity
37
+ - **Output:** `trinity/reports/DOCS-UPDATE-AUDIT-{{DATE}}.md` with APO work assignments
38
+
39
+ - **Trinity-docs-update - Configuration false positive prevention** - Resolution rules prevent incorrect audit findings
40
+ - **Resolution Rule 1:** If .env sets value X, then X is correct (docs showing X are correct)
41
+ - **Resolution Rule 2:** Code defaults contradicting .env should be fixed (not docs)
42
+ - **Resolution Rule 3:** Documentation showing actual config value is NEVER wrong
43
+ - **Example:** Port 3001 in docs + .env, but code shows `|| 4000` → docs are correct, code default needs fixing
44
+ - **Impact:** Eliminates false positives where JUNO would flag correct documentation as wrong
45
+
46
+ - **Trinity-docs-update - Scope boundary with consistency exceptions** - Defines strict boundaries with limited exceptions
47
+ - **ALLOWED:** Read any file, write/edit files in docs/ directory only
48
+ - **FORBIDDEN:** Modify source code, database schemas, config files, build files, tests
49
+ - **EXCEPTIONS (APO-1 only):**
50
+ - Fix hardcoded default values contradicting documented standards (e.g., `|| 4000` → `|| 3001`)
51
+ - Update .env.example template values to match actual standards
52
+ - ONLY simple constant/default changes (no logic modifications)
53
+ - MUST verify against actual .env first
54
+ - **Scenario C Example:** Docs show port 3001, .env has 3001, code default is 4000 → Fix code default to 3001
55
+
56
+ - **Trinity-docs-update - APO parallel execution system** - Phase 2 launches three documentation specialists concurrently
57
+ - **APO-1:** Base documentation updates (architecture, setup, guides)
58
+ - **NEW:** Configuration consistency fixes (simple defaults that contradict standards)
59
+ - Update .env.example to match actual standards
60
+ - Align configuration values across codebase and docs
61
+ - Restriction: Only simple constants (no logic changes)
62
+ - **APO-2:** Update existing business logic documentation OR new docs (first half)
63
+ - **APO-3:** New business logic documentation (second half)
64
+ - Each APO creates personal checklist from JUNO's audit report
65
+ - All APOs verify changes against actual codebase (not assumptions)
66
+ - Output: Updated/new documentation files in docs/
67
+
68
+ - **Trinity-docs-update - APO verification requirements** - Mandatory codebase verification for all documentation changes
69
+ - **For EVERY change, APO must:**
70
+ 1. Identify what needs to change (from JUNO's assignment)
71
+ 2. Verify correct value in codebase (read .env, source files, config)
72
+ 3. Document verification in task (which files read, what found)
73
+ 4. Use Read tool BEFORE making changes
74
+ 5. Use Edit tool with verified information only
75
+ 6. DO NOT make assumptions or guesses
76
+ - **Verification examples:**
77
+ - API ports → Read .env, server.js, app.js
78
+ - Table names → Read init.sql or check production database
79
+ - Endpoint URLs → Read route files
80
+ - Method signatures → Read actual source file
81
+ - Configuration values → Read config files
82
+ - **Documentation format:**
83
+ ```markdown
84
+ - [x] docs/api/README.md
85
+ - Verification: Read backend/.env - confirmed port is 3001
86
+ - Changes made: Updated 49 instances of port number to 3001
87
+ ```
88
+
89
+ - **Trinity-docs-update - JUNO verification loop** - Phase 3 ensures 100% completion before final audit
90
+ - **Step 3.1:** JUNO checks all three APO checklists for completion status
91
+ - Counts total tasks vs completed tasks per APO
92
+ - Calculates completion percentage
93
+ - Determines next action (PROCEED or RESTART)
94
+ - **Step 3.1A:** Re-launch incomplete APOs automatically
95
+ - Identifies incomplete APOs from JUNO's report
96
+ - Restarts only incomplete APOs with resume instructions
97
+ - Loops until all APOs reach 100%
98
+ - **Step 3.2:** JUNO final quality audit (only when all APOs 100% complete)
99
+ - Verifies files created/updated
100
+ - Checks content accuracy against codebase
101
+ - Validates no hallucinated components
102
+ - Generates verification report with pass/fail status
103
+ - **Output:** `trinity/reports/DOCS-UPDATE-VERIFICATION-{{DATE}}.md`
104
+
105
+ - **Trinity-docs-update - Three template files** - Command template and two checklist templates deployed via CLI
106
+ - **Command Template:** `src/templates/.claude/commands/maintenance/trinity-docs-update.md.template`
107
+ - Deployed to: `.claude/commands/maintenance/trinity-docs-update.md`
108
+ - Updated by: `trinity update` command via `updateCommands()` function
109
+ - **JUNO Checklist:** `src/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template`
110
+ - Deployed to: `trinity/templates/documentation/reports/juno-docs-update-checklist.md`
111
+ - Updated by: `trinity update` command via `updateTemplates()` function (recursively copies all documentation templates)
112
+ - **APO Checklist:** `src/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template`
113
+ - Deployed to: `trinity/templates/documentation/reports/apo-docs-update-checklist.md`
114
+ - Updated by: `trinity update` command via `updateTemplates()` function (recursively copies all documentation templates)
115
+ - All templates automatically deployed during `trinity deploy` and updated during `trinity update`
116
+
117
+ - **Trinity-docs command - Complete architectural overhaul** - Transformed from single-agent to multi-agent orchestration
118
+ - **New Architecture:** JUNO audit → 3 parallel APO instances → Verification
119
+ - **JUNO Agent Integration:** Read-only codebase audit creates documentation checklist before generation
120
+ - **Parallel APO Execution:** APO-1 (diagrams), APO-2 (guides/API), APO-3 (config) run concurrently
121
+ - **Performance:** 3x faster execution via parallel agent orchestration
122
+ - **Context Efficiency:** Each agent receives focused instructions (<100 lines) vs single 2,577-line spec
123
+
124
+ - **Trinity-docs command - External template system** - Created 28 reusable documentation templates
125
+ - **Template Directory:** `trinity/templates/documentation/` with 8 categories
126
+ - **Mermaid Diagrams (4 templates):** MVC flow, database ER, API endpoint map, component hierarchy
127
+ - **Guides (4 templates):** Getting started, API development, deployment, contributing
128
+ - **API Documentation (1 template):** API README with endpoint structure
129
+ - **Configuration (2 templates):** Documentation structure, env-example generator
130
+ - **Discovery (4 templates):** Framework detection, component discovery, API endpoint scanner, env variable extraction
131
+ - **Validation (3 templates):** APO self-validation checklists for all 3 agents
132
+ - **Processes (6 templates):** APO workflows (common, diagram-specific, guide-specific, config-specific), error handling, fallback mechanisms
133
+ - **Reports (2 templates):** JUNO internal report, ROOT-README for template organization
134
+ - **Template Variables:** All templates use `{{UPPERCASE_UNDERSCORE}}` syntax for dynamic content replacement
135
+
136
+ - **Trinity-docs command - Template validation phase** - Optional Phase 0.2 validates template syntax
137
+ - Validates `{{VARIABLE}}` syntax (must be UPPERCASE_UNDERSCORE)
138
+ - Detects nested variables (not supported)
139
+ - Checks balanced braces
140
+ - Non-blocking warnings for template issues
141
+
142
+ - **Trinity-docs command - Retry mechanism** - Phase 0.25 handles transient failures
143
+ - Retries operations up to 3 times with 500ms delay
144
+ - Handles filesystem delays and race conditions
145
+ - Graceful degradation for non-critical operations
146
+
147
+ - **Trinity-docs command - JUNO documentation audit** - Phase 1 performs comprehensive codebase analysis
148
+ - **Framework Detection:** Analyzes package.json for Express, NestJS, React, Next.js, Django, Flask, FastAPI
149
+ - **Component Discovery:** Scans for React/Vue/Angular/Svelte components with zero-tolerance for fake components
150
+ - **API Endpoint Scanning:** Detects Express/Fastify/NestJS/Koa routes with enhanced patterns
151
+ - **Database Detection:** PostgreSQL, MySQL, MongoDB, SQLite, Redis via dependency analysis
152
+ - **Environment Variables:** Extracts from .env and process.env usage patterns
153
+ - **Checklist Report:** Generates `trinity/templates/documentation/reports/juno-internal-report.md` with all discovered metadata
154
+
155
+ - **Trinity-docs command - Fallback mechanism** - Handles missing JUNO data gracefully
156
+ - Uses discovery templates when JUNO variables missing
157
+ - Framework detection fallback via package.json analysis
158
+ - Component discovery fallback for frontend frameworks
159
+ - API endpoint scanner fallback for backend frameworks
160
+ - Environment variable extraction fallback
161
+ - Default template paths when discovery fails
162
+
163
+ - **Trinity-docs command - APO self-validation** - Each APO validates its own work before completion
164
+ - APO-1 validates: 4 diagram files created, correct paths, no placeholders, proper Mermaid syntax
165
+ - APO-2 validates: Guide completeness, API documentation accuracy, no fake examples
166
+ - APO-3 validates: Config files exist, no hardcoded secrets, proper .env.example format
167
+ - Security checks for APO-3: No API keys, passwords, tokens, or sensitive data in generated files
168
+
169
+ - **Trinity-docs command - Enhanced verification phase** - Phase 4 performs comprehensive quality checks
170
+ - Verifies all JUNO checklist items completed
171
+ - Validates file existence and content quality
172
+ - Checks for placeholders and fake data
173
+ - Ensures proper Mermaid syntax in diagrams
174
+ - Validates security (no secrets in config files)
175
+ - Generates final completion report with pass/fail status
176
+
12
177
  ### Changed
13
178
 
179
+ - **Trinity-docs command - File relocation** - Moved from `src/templates/shared/claude-commands/` to `src/templates/.claude/commands/execution/`
180
+ - Aligns with new command categorization structure
181
+ - Distinguishes execution commands from utility/session/planning commands
182
+
183
+ - **Trinity-docs command - Diagram output path** - Changed from `docs/architecture/diagrams/` to `docs/architecture/`
184
+ - Simplified directory structure
185
+ - All architecture files (diagrams, overview, ADRs) now in single directory
186
+ - Updated all references throughout command specification (lines 1079, 1205-1208)
187
+
188
+ - **Trinity-docs command - API endpoint scanner enhancement** - Added 3 missing route detection patterns
189
+ - Added `router.route('...').get|post|put|patch|delete()` pattern
190
+ - Added `app.route('...').get|post|put|patch|delete()` pattern
191
+ - Added `router.all('...')` wildcard route pattern
192
+ - Fixes endpoint count variance (33 vs 34 detected endpoints)
193
+
194
+ - **Trinity-docs command - Configuration directory consolidation** - Merged `config/` into `configuration/`
195
+ - Moved `env-example-generator.md.template` from `config/` to `configuration/`
196
+ - Removed duplicate directory structure
197
+ - Now single `configuration/` directory with 2 templates
198
+
199
+ - **Trinity-docs command - Version update** - Updated to v2.0.9
200
+ - Reflects architectural overhaul and template externalization
201
+ - Command now references 28 external templates vs inline logic
202
+
14
203
  ### Deprecated
15
204
 
16
205
  ### Removed
17
206
 
207
+ - **Trinity-docs command - Inline documentation logic** - Removed 808+ lines of inline instructions (WO-004)
208
+ - Phase 1 codebase analysis logic → `trinity/templates/documentation/discovery/` templates
209
+ - Phase 2 content seeding → `trinity/templates/documentation/guides/` templates
210
+ - Diagram generation → `trinity/templates/documentation/mermaid-diagrams/` templates
211
+ - Validation logic → `trinity/templates/documentation/validation/` templates
212
+
213
+ - **Trinity-docs command - Single-agent architecture** - Replaced with multi-agent orchestration
214
+ - Old: Single APO reads 2,577-line spec and performs all work
215
+ - New: JUNO audit + 3 parallel APO instances with focused instructions
216
+ - Reduces context fatigue and improves reliability
217
+
18
218
  ### Fixed
19
219
 
20
220
  ### Security
21
221
 
222
+ ## [2.0.9] - 2026-01-12
223
+
224
+ ### Changed
225
+
226
+ - **Trinity-docs command specification** - Added evidence-based documentation verification
227
+ - Added Rule 2: Evidence-Based Documentation Only - prevents documenting uninstalled tools
228
+ - Added Phase 1 Step 6: Tool & Feature Verification for all project types
229
+ - Added tool verification report to Phase 5 output
230
+ - Prevents aspirational/best-practice content that doesn't exist in codebase
231
+ - Addresses incident where Lighthouse was documented without being installed
232
+
233
+ - **Trinity-readme command specification** - Removed Trinity self-documentation conflicts
234
+ - Deleted Type C Template that documented Trinity infrastructure (violated Rule 1)
235
+ - Added Rule 1 Enforcement Checklist with verification commands
236
+ - Added Phase 1 Step 4.5: Filter Gitignored and Trinity Directories
237
+ - Added Trinity Detection Warning to explicitly skip trinity/ and .claude/
238
+ - Removed trinity/ from glob patterns and project structure examples
239
+ - Addresses incident where trinity/ was included in README file tree despite being gitignored
240
+
241
+ - **Trinity-readme command specification** - Added LICENSE file verification for badges
242
+ - Added Phase 1 Step 7: License Verification - reads actual LICENSE file
243
+ - LICENSE file is now source of truth (priority over package.json)
244
+ - Detects license type from file header (MIT, ISC, Apache, GPL, BSD, etc.)
245
+ - Warns when package.json license field doesn't match LICENSE file
246
+ - Falls back to package.json only if LICENSE file doesn't exist
247
+ - Addresses incident where ISC badge was generated despite MIT LICENSE file
248
+
249
+ - **Trinity-docs command specification** - Added Trinity reference sanitization enforcement
250
+ - Added Rule 1 Forbidden Patterns - explicit list of patterns that must not appear in docs/
251
+ - Added Phase 4.5: Trinity Reference Sanitization - scans and removes Trinity references
252
+ - Added Rule 1 Compliance verification to Phase 5 report with pass/fail status
253
+ - Removed Trinity report link from docs/README.md template footer
254
+ - Prevents Trinity Method, agent names, commands, and infrastructure references in user docs
255
+ - Addresses incident where 7 documentation files contained Trinity Method references
256
+
22
257
  ## [2.0.8] - 2026-01-08
23
258
 
24
259
  ### Added
package/README.md CHANGED
@@ -89,7 +89,7 @@ Trinity Method SDK is a **production-ready development methodology** that transf
89
89
 
90
90
  ### The 19-Agent Team
91
91
 
92
- Trinity SDK includes **19 specialized agents** (core team of 14 primary agents + 5 infrastructure agents):
92
+ Trinity SDK includes **19 specialized agents** organized across 5 functional teams:
93
93
 
94
94
  **Planning Layer:**
95
95
 
@@ -116,17 +116,18 @@ Trinity SDK includes **19 specialized agents** (core team of 14 primary agents +
116
116
  - **ALY** - Chief Technology Officer (investigation orchestration, strategic coordination)
117
117
  - **JUNO** - Quality Auditor (comprehensive codebase audits, deployment verification)
118
118
 
119
- **Infrastructure (5 agents):**
119
+ **Infrastructure & Legacy:**
120
120
 
121
121
  - **TAN** - Structure Specialist (directory structure validation)
122
122
  - **ZEN** - Knowledge Base Specialist (comprehensive documentation)
123
123
  - **INO** - Context Specialist (CLAUDE.md hierarchy management)
124
124
  - **EIN** - CI/CD Specialist (continuous integration/deployment automation)
125
+ - **AJ-CC** - Claude Code Orchestrator (specialized v2.0 orchestration)
125
126
  - **AJ MAESTRO** - Legacy Orchestrator (deprecated v1.0, replaced by ALY in v2.0)
126
127
 
127
128
  ### What Gets Deployed
128
129
 
129
- Trinity deploys **64 production-ready components** in 90 seconds:
130
+ Trinity deploys **88 production-ready components** in 90 seconds:
130
131
 
131
132
  **Methodology Infrastructure:**
132
133
 
@@ -141,9 +142,9 @@ Trinity deploys **64 production-ready components** in 90 seconds:
141
142
  - DOCUMENTATION-CRITERIA.md (documentation standards)
142
143
  - AI-DEVELOPMENT-GUIDE.md (AI-assisted development best practices)
143
144
  - `trinity/templates/` - Reusable templates
144
- - `documentation/` - Documentation templates
145
- - `investigations/` - 5 investigation templates (Bug, Performance, Security, System Analysis, Incident)
146
- - `work-orders/` - Work order templates
145
+ - `documentation/` - Documentation templates (2 README templates + 23 report templates)
146
+ - `investigations/` - 5 investigation templates (bug, feature, performance, security, technical)
147
+ - `work-orders/` - 6 work order templates
147
148
  - `trinity/investigations/` - Active investigations with execution plans
148
149
  - `trinity/sessions/` - Session archives
149
150
  - `trinity/reports/` - Audit and integration reports
@@ -154,15 +155,16 @@ Trinity deploys **64 production-ready components** in 90 seconds:
154
155
  **Agent System:**
155
156
 
156
157
  - `.claude/agents/` - 19 specialized agents organized by category:
157
- - `aj-team/` - AJ MAESTRO orchestration agents
158
- - `audit/` - JUNO quality auditor
159
- - `deployment/` - 6 deployment specialists (BON, CAP, EIN, INO, TAN, ZEN)
160
- - `leadership/` - ALY strategic leadership
158
+ - `aj-team/` - 7 execution agents (APO, BAS, BON, CAP, DRA, KIL, URO)
159
+ - `audit/` - 1 quality auditor (JUNO)
160
+ - `deployment/` - 4 infrastructure agents (EIN, INO, TAN, ZEN)
161
+ - `leadership/` - 3 orchestration agents (ALY, AJ-CC, AJ-MAESTRO)
161
162
  - `planning/` - 4 planning agents (MON, ROR, EUS, TRA)
162
- - `.claude/commands/` - 20 slash commands organized in 6 categories:
163
- - `execution/` - 5 commands (orchestrate, audit, readme, docs, changelog)
164
- - `infrastructure/` - 1 command (trinity-init)
165
- - `investigation/` - 3 commands (create, plan, templates)
163
+ - `.claude/commands/` - 20 slash commands organized in 7 categories:
164
+ - `execution/` - 2 commands (orchestrate, audit)
165
+ - `infrastructure/` - 1 command (init)
166
+ - `investigation/` - 3 commands (create-investigation, plan-investigation, investigate-templates)
167
+ - `maintenance/` - 4 commands (readme, docs, docs-update, changelog)
166
168
  - `planning/` - 4 commands (requirements, design, decompose, plan)
167
169
  - `session/` - 3 commands (start, continue, end)
168
170
  - `utility/` - 3 commands (verify, agents, workorder)
@@ -256,7 +258,8 @@ After deployment, access Trinity functionality through Claude Code slash command
256
258
  - `/trinity-orchestrate` - Execute with ALY orchestration
257
259
  - `/trinity-audit` - Run codebase audit (JUNO)
258
260
  - `/trinity-readme` - Update README coverage (APO)
259
- - `/trinity-docs` - Organize docs/ directory (APO)
261
+ - `/trinity-docs` - Generate new documentation (JUNO + 3 parallel APOs)
262
+ - `/trinity-docs-update` - Update existing documentation (JUNO audit → 3 APOs → verification loop)
260
263
  - `/trinity-changelog` - Maintain CHANGELOG.md (APO)
261
264
 
262
265
  **Investigation:**
@@ -364,11 +367,11 @@ After deploying Trinity to your project, comprehensive documentation is availabl
364
367
 
365
368
  Your project contains:
366
369
 
367
- - **64 production-ready components** deployed in 90 seconds
368
- - **19 specialized agents** in `.claude/agents/` (organized by category: aj-team, audit, deployment, leadership, planning)
369
- - **20 slash commands** in `.claude/commands/` (organized by category: execution, infrastructure, investigation, planning, session, utility)
370
+ - **88 production-ready components** deployed in 90 seconds
371
+ - **19 specialized agents** in `.claude/agents/` (7 execution + 1 audit + 4 infrastructure + 3 leadership + 4 planning)
372
+ - **20 slash commands** in `.claude/commands/` (2 execution + 1 infrastructure + 3 investigation + 4 maintenance + 4 planning + 3 session + 3 utility)
370
373
  - **Complete knowledge base** in `trinity/knowledge-base/` (ARCHITECTURE.md, ISSUES.md, To-do.md, Technical-Debt.md)
371
- - **Investigation templates** in `trinity/templates/investigations/` (bug, performance, security, system analysis, incident)
374
+ - **Investigation templates** in `trinity/templates/investigations/` (bug, feature, performance, security, technical)
372
375
  - **Work order templates** in `trinity/templates/work-orders/`
373
376
  - **Session archives** in `trinity/sessions/`
374
377
  - **Audit reports** in `trinity/reports/`
@@ -380,15 +383,16 @@ Your project contains:
380
383
  your-project/
381
384
  ├── .claude/
382
385
  │ ├── agents/
383
- │ │ ├── aj-team/ # AJ MAESTRO orchestration agents
384
- │ │ ├── audit/ # JUNO quality auditor
385
- │ │ ├── deployment/ # Deployment specialists (BON, CAP, EIN, INO, TAN, ZEN)
386
- │ │ ├── leadership/ # ALY strategic leadership
387
- │ │ └── planning/ # MON, ROR, EUS, TRA agents
386
+ │ │ ├── aj-team/ # 7 execution agents (APO, BAS, BON, CAP, DRA, KIL, URO)
387
+ │ │ ├── audit/ # 1 quality auditor (JUNO)
388
+ │ │ ├── deployment/ # 4 infrastructure agents (EIN, INO, TAN, ZEN)
389
+ │ │ ├── leadership/ # 3 orchestration agents (ALY, AJ-CC, AJ-MAESTRO)
390
+ │ │ └── planning/ # 4 planning agents (MON, ROR, EUS, TRA)
388
391
  │ ├── commands/
389
- │ │ ├── execution/ # trinity-orchestrate, trinity-audit, trinity-readme, trinity-docs, trinity-changelog
392
+ │ │ ├── execution/ # trinity-orchestrate, trinity-audit
390
393
  │ │ ├── infrastructure/ # trinity-init
391
394
  │ │ ├── investigation/ # trinity-create-investigation, trinity-plan-investigation, trinity-investigate-templates
395
+ │ │ ├── maintenance/ # trinity-readme, trinity-docs, trinity-docs-update, trinity-changelog
392
396
  │ │ ├── planning/ # trinity-requirements, trinity-design, trinity-decompose, trinity-plan
393
397
  │ │ ├── session/ # trinity-start, trinity-continue, trinity-end
394
398
  │ │ └── utility/ # trinity-verify, trinity-agents, trinity-workorder
@@ -396,9 +400,9 @@ your-project/
396
400
  ├── trinity/
397
401
  │ ├── knowledge-base/ # ARCHITECTURE.md, ISSUES.md, To-do.md, Technical-Debt.md, Trinity.md
398
402
  │ ├── templates/
399
- │ │ ├── documentation/ # Documentation templates
400
- │ │ ├── investigations/ # Bug, performance, security, system analysis, incident templates
401
- │ │ └── work-orders/ # Work order templates
403
+ │ │ ├── documentation/ # 2 README templates + 23 report templates
404
+ │ │ ├── investigations/ # 5 investigation templates (bug, feature, performance, security, technical)
405
+ │ │ └── work-orders/ # 6 work order templates
402
406
  │ ├── investigations/ # Active investigations
403
407
  │ │ └── plans/ # Investigation execution plans
404
408
  │ ├── sessions/ # Session archives
@@ -460,7 +464,7 @@ Trinity uses GitHub Actions for comprehensive continuous integration and deploym
460
464
 
461
465
  - ✅ Multi-platform testing (Ubuntu, Windows, macOS)
462
466
  - ✅ Multi-version testing (Node.js 18.x, 20.x, 22.x)
463
- - ✅ Trinity component validation (19 agents, 19+ slash commands, knowledge base, CI/CD templates)
467
+ - ✅ Trinity component validation (19 agents, 20 slash commands, knowledge base, CI/CD templates)
464
468
  - ✅ Test suite execution (unit, integration, e2e, performance)
465
469
  - ✅ Code coverage validation (80%+ threshold enforced)
466
470
  - ✅ Linting and type checking
@@ -492,7 +496,7 @@ npm run build
492
496
  npm publish --access public
493
497
 
494
498
  # 3. Create git tag and push
495
- git tag -a v2.0.8 -m "Release v2.0.8"
499
+ git tag -a v2.0.9 -m "Release v2.0.9"
496
500
  git push origin main --follow-tags
497
501
  ```
498
502
 
@@ -526,11 +530,6 @@ MIT License - see [LICENSE](LICENSE) for details
526
530
 
527
531
  - **API Documentation**: [docs/](docs/) - Generated TypeDoc API reference
528
532
  - **Contributing Guide**: [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup, workflow, and standards
529
- - **Architectural Decisions**: [docs/adr/](docs/adr/) - ADRs documenting major technical decisions
530
- - [ADR-001: CLI Architecture](docs/adr/ADR-001-cli-architecture.md)
531
- - [ADR-002: Template System Design](docs/adr/ADR-002-template-system-design.md)
532
- - [ADR-003: ESLint Flat Config](docs/adr/ADR-003-eslint-flat-config.md)
533
- - [ADR-004: Test Strategy](docs/adr/ADR-004-test-strategy.md)
534
533
  - **Changelog**: [CHANGELOG.md](CHANGELOG.md) - Version history and release notes
535
534
 
536
535
  ---
@@ -42,7 +42,7 @@ export async function deployAgents(templatesPath, variables, spinner) {
42
42
  ];
43
43
  for (const { dir, agents } of agentDirs) {
44
44
  for (const agent of agents) {
45
- const templatePath = path.join(templatesPath, 'agents', dir, `${agent}.template`);
45
+ const templatePath = path.join(templatesPath, '.claude/agents', dir, `${agent}.template`);
46
46
  if (await fs.pathExists(templatePath)) {
47
47
  const content = await fs.readFile(templatePath, 'utf8');
48
48
  const processed = processTemplate(content, variables);
@@ -26,7 +26,7 @@ export async function deployClaudeSetup(templatesPath, variables, spinner) {
26
26
  spinner.succeed('Claude Code settings created (empty - customize as needed)');
27
27
  // Deploy Employee Directory
28
28
  spinner.start('Deploying Employee Directory...');
29
- const employeeDirectoryTemplate = path.join(templatesPath, 'claude', 'EMPLOYEE-DIRECTORY.md.template');
29
+ const employeeDirectoryTemplate = path.join(templatesPath, '.claude', 'EMPLOYEE-DIRECTORY.md.template');
30
30
  if (await fs.pathExists(employeeDirectoryTemplate)) {
31
31
  const content = await fs.readFile(employeeDirectoryTemplate, 'utf8');
32
32
  const processed = processTemplate(content, variables);
@@ -48,41 +48,34 @@ export async function deployClaudeSetup(templatesPath, variables, spinner) {
48
48
  await fs.ensureDir(`${commandsDir}/execution`);
49
49
  await fs.ensureDir(`${commandsDir}/investigation`);
50
50
  await fs.ensureDir(`${commandsDir}/infrastructure`);
51
+ await fs.ensureDir(`${commandsDir}/maintenance`);
51
52
  await fs.ensureDir(`${commandsDir}/utility`);
52
- // Command categorization map
53
- const commandCategories = {
54
- 'trinity-start.md.template': 'session',
55
- 'trinity-continue.md.template': 'session',
56
- 'trinity-end.md.template': 'session',
57
- 'trinity-requirements.md.template': 'planning',
58
- 'trinity-design.md.template': 'planning',
59
- 'trinity-decompose.md.template': 'planning',
60
- 'trinity-plan.md.template': 'planning',
61
- 'trinity-orchestrate.md.template': 'execution',
62
- 'trinity-audit.md.template': 'execution',
63
- 'trinity-readme.md.template': 'execution',
64
- 'trinity-docs.md.template': 'execution',
65
- 'trinity-changelog.md.template': 'execution',
66
- 'trinity-create-investigation.md.template': 'investigation',
67
- 'trinity-plan-investigation.md.template': 'investigation',
68
- 'trinity-investigate-templates.md.template': 'investigation',
69
- 'trinity-init.md.template': 'infrastructure',
70
- 'trinity-agents.md.template': 'utility',
71
- 'trinity-verify.md.template': 'utility',
72
- 'trinity-workorder.md.template': 'utility',
73
- };
74
- const commandsTemplatePath = path.join(templatesPath, 'shared/claude-commands');
75
- const commandFiles = await fs.readdir(commandsTemplatePath);
76
- for (const file of commandFiles) {
77
- if (file.endsWith('.md.template') && commandCategories[file]) {
78
- const sourcePath = path.join(commandsTemplatePath, file);
79
- const category = commandCategories[file];
80
- // Remove .template extension for deployed files
81
- const deployedName = file.replace('.template', '');
82
- const destPath = path.join(commandsDir, category, deployedName);
83
- await fs.copy(sourcePath, destPath);
84
- commandsDeployed++;
85
- filesDeployed++;
53
+ // Commands are now organized by category in source templates
54
+ const commandsTemplatePath = path.join(templatesPath, '.claude/commands');
55
+ const categories = [
56
+ 'session',
57
+ 'planning',
58
+ 'execution',
59
+ 'investigation',
60
+ 'infrastructure',
61
+ 'maintenance',
62
+ 'utility',
63
+ ];
64
+ for (const category of categories) {
65
+ const categoryPath = path.join(commandsTemplatePath, category);
66
+ if (await fs.pathExists(categoryPath)) {
67
+ const commandFiles = await fs.readdir(categoryPath);
68
+ for (const file of commandFiles) {
69
+ if (file.endsWith('.md.template')) {
70
+ const sourcePath = path.join(categoryPath, file);
71
+ // Remove .template extension for deployed files
72
+ const deployedName = file.replace('.template', '');
73
+ const destPath = path.join(commandsDir, category, deployedName);
74
+ await fs.copy(sourcePath, destPath);
75
+ commandsDeployed++;
76
+ filesDeployed++;
77
+ }
78
+ }
86
79
  }
87
80
  }
88
81
  spinner.succeed(`Deployed ${commandsDeployed} Trinity slash commands (6 categories)`);
@@ -98,7 +98,7 @@ export async function deploy(options) {
98
98
  PACKAGE_MANAGER: stack.packageManager || 'npm',
99
99
  BACKEND_FRAMEWORK: stack.framework,
100
100
  CURRENT_DATE: new Date().toISOString(),
101
- TRINITY_VERSION: pkg.version || '2.0.8',
101
+ TRINITY_VERSION: pkg.version || '2.1.0',
102
102
  };
103
103
  // STEP 4: Create directory structure
104
104
  const directoriesCreated = await createDirectories(spinner);
@@ -30,7 +30,7 @@ export async function deployKnowledgeBase(templatesPath, variables, stack, metri
30
30
  'DOCUMENTATION-CRITERIA.md',
31
31
  ];
32
32
  for (const template of kbTemplates) {
33
- const templatePath = path.join(templatesPath, 'knowledge-base', `${template}.template`);
33
+ const templatePath = path.join(templatesPath, 'trinity/knowledge-base', `${template}.template`);
34
34
  if (await fs.pathExists(templatePath)) {
35
35
  const content = await fs.readFile(templatePath, 'utf8');
36
36
  const processed = processTemplate(content, variables);
@@ -39,7 +39,7 @@ async function deployRootClaudeMarkdown(templatesPath, variables) {
39
39
  */
40
40
  async function deployVersionFile(pkgVersion) {
41
41
  const versionPath = validatePath('trinity/VERSION');
42
- await fs.writeFile(versionPath, pkgVersion || '2.0.8');
42
+ await fs.writeFile(versionPath, pkgVersion || '2.1.0');
43
43
  return 1;
44
44
  }
45
45
  /**
@@ -24,7 +24,7 @@ export async function installSDK(spinner) {
24
24
  if (!packageJson.dependencies) {
25
25
  packageJson.dependencies = {};
26
26
  }
27
- packageJson.dependencies['trinity-method-sdk'] = '^2.0.8';
27
+ packageJson.dependencies['trinity-method-sdk'] = '^2.1.0';
28
28
  await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });
29
29
  spinner.text = 'Installing Trinity Method SDK (this may take a moment)...';
30
30
  // Install dependencies
@@ -27,7 +27,7 @@ export async function deployTemplates(templatesPath, variables, spinner) {
27
27
  ];
28
28
  await fs.ensureDir('trinity/templates/work-orders');
29
29
  for (const template of woTemplates) {
30
- const templatePath = path.join(templatesPath, 'work-orders', template);
30
+ const templatePath = path.join(templatesPath, 'trinity/templates/work-orders', template);
31
31
  if (await fs.pathExists(templatePath)) {
32
32
  const content = await fs.readFile(templatePath, 'utf8');
33
33
  const processed = processTemplate(content, variables);
@@ -50,7 +50,7 @@ export async function deployTemplates(templatesPath, variables, spinner) {
50
50
  ];
51
51
  await fs.ensureDir('trinity/templates/investigations');
52
52
  for (const template of investigationTemplates) {
53
- const templatePath = path.join(templatesPath, 'investigations', template);
53
+ const templatePath = path.join(templatesPath, 'trinity/templates/investigations', template);
54
54
  if (await fs.pathExists(templatePath)) {
55
55
  const content = await fs.readFile(templatePath, 'utf8');
56
56
  const processed = processTemplate(content, variables);
@@ -62,23 +62,36 @@ export async function deployTemplates(templatesPath, variables, spinner) {
62
62
  }
63
63
  }
64
64
  spinner.succeed(`Investigation templates deployed (${investigationTemplates.length} templates)`);
65
- // Deploy documentation templates
65
+ // Deploy documentation templates (all 28 templates including subdirectories)
66
66
  spinner.start('Deploying documentation templates...');
67
- const documentationTemplates = ['ROOT-README.md.template', 'SUBDIRECTORY-README.md.template'];
68
- await fs.ensureDir('trinity/templates/documentation');
69
- for (const template of documentationTemplates) {
70
- const templatePath = path.join(templatesPath, 'documentation', template);
71
- if (await fs.pathExists(templatePath)) {
72
- const content = await fs.readFile(templatePath, 'utf8');
73
- const processed = processTemplate(content, variables);
74
- const deployedName = template.replace('.template', '');
75
- // Validate destination path for security
76
- const destPath = validatePath(`trinity/templates/documentation/${deployedName}`);
77
- await fs.writeFile(destPath, processed);
78
- templatesDeployed++;
67
+ const docSourcePath = path.join(templatesPath, 'trinity/templates/documentation');
68
+ const docDestPath = 'trinity/templates/documentation';
69
+ await fs.ensureDir(docDestPath);
70
+ // Recursively copy all documentation templates, removing .template extension
71
+ async function copyDocTemplates(sourcePath, destPath) {
72
+ const items = await fs.readdir(sourcePath);
73
+ for (const item of items) {
74
+ const sourceItemPath = path.join(sourcePath, item);
75
+ const stat = await fs.stat(sourceItemPath);
76
+ if (stat.isDirectory()) {
77
+ // Create subdirectory and recurse
78
+ const destSubDir = path.join(destPath, item);
79
+ await fs.ensureDir(destSubDir);
80
+ await copyDocTemplates(sourceItemPath, destSubDir);
81
+ }
82
+ else if (item.endsWith('.md.template')) {
83
+ // Process template file and remove .template extension
84
+ const content = await fs.readFile(sourceItemPath, 'utf8');
85
+ const processed = processTemplate(content, variables);
86
+ const deployedName = item.replace('.template', '');
87
+ const destFilePath = validatePath(path.join(destPath, deployedName));
88
+ await fs.writeFile(destFilePath, processed);
89
+ templatesDeployed++;
90
+ }
79
91
  }
80
92
  }
81
- spinner.succeed(`Documentation templates deployed (${documentationTemplates.length} templates)`);
93
+ await copyDocTemplates(docSourcePath, docDestPath);
94
+ spinner.succeed(`Documentation templates deployed (${templatesDeployed - 11} templates)`);
82
95
  return templatesDeployed;
83
96
  }
84
97
  //# sourceMappingURL=templates.js.map
@@ -16,7 +16,7 @@ const AGENT_DIRS = ['leadership', 'planning', 'aj-team', 'deployment', 'audit'];
16
16
  export async function updateAgents(spinner, stats) {
17
17
  spinner.start('Updating agents...');
18
18
  const sdkPath = await getSDKPath();
19
- const agentsTemplatePath = path.join(sdkPath, 'dist/templates/agents');
19
+ const agentsTemplatePath = path.join(sdkPath, 'dist/templates/.claude/agents');
20
20
  for (const agentDir of AGENT_DIRS) {
21
21
  const sourcePath = path.join(agentsTemplatePath, agentDir);
22
22
  const targetPath = path.join('.claude/agents', agentDir);
@@ -7,6 +7,7 @@ import { Ora } from 'ora';
7
7
  import { UpdateStats } from './types.js';
8
8
  /**
9
9
  * Update slash command files from SDK to .claude/commands/
10
+ * Commands are now organized by category in source templates
10
11
  * @param spinner - ora spinner instance for status display
11
12
  * @param stats - update statistics to track progress
12
13
  */