trinity-method-sdk 2.1.0 → 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 (96) hide show
  1. package/CHANGELOG.md +702 -467
  2. package/README.md +550 -539
  3. package/dist/cli/commands/deploy/ci-cd.d.ts +4 -3
  4. package/dist/cli/commands/deploy/ci-cd.js +10 -9
  5. package/dist/cli/commands/deploy/configuration.js +10 -11
  6. package/dist/cli/commands/deploy/directories.js +13 -14
  7. package/dist/cli/commands/deploy/gitignore.js +3 -5
  8. package/dist/cli/commands/deploy/index.d.ts +1 -1
  9. package/dist/cli/commands/deploy/index.js +6 -2
  10. package/dist/cli/commands/deploy/knowledge-base.js +2 -2
  11. package/dist/cli/commands/deploy/pre-flight.js +1 -1
  12. package/dist/cli/commands/deploy/root-files.js +2 -17
  13. package/dist/cli/commands/deploy/summary.js +3 -3
  14. package/dist/cli/commands/deploy/templates.js +5 -5
  15. package/dist/cli/commands/update/backup.js +6 -12
  16. package/dist/cli/commands/update/knowledge-base.js +1 -1
  17. package/dist/cli/commands/update/pre-flight.js +11 -11
  18. package/dist/cli/commands/update/summary.js +5 -5
  19. package/dist/cli/commands/update/templates.js +1 -1
  20. package/dist/cli/commands/update/verification.js +5 -5
  21. package/dist/cli/commands/update/version.js +1 -1
  22. package/dist/cli/utils/deploy-ci.d.ts +3 -2
  23. package/dist/cli/utils/deploy-ci.js +24 -24
  24. package/dist/cli/utils/deploy-linting.js +100 -5
  25. package/dist/cli/utils/error-classes.d.ts +2 -2
  26. package/dist/cli/utils/linting-tools.js +14 -6
  27. package/dist/cli/utils/template-processor.js +1 -3
  28. package/dist/templates/.claude/EMPLOYEE-DIRECTORY.md.template +16 -22
  29. package/dist/templates/.claude/agents/aj-team/apo-documentation-specialist.md.template +7 -7
  30. package/dist/templates/.claude/agents/aj-team/bas-quality-gate.md.template +8 -8
  31. package/dist/templates/.claude/agents/aj-team/dra-code-reviewer.md.template +3 -3
  32. package/dist/templates/.claude/agents/aj-team/kil-task-executor.md.template +6 -6
  33. package/dist/templates/.claude/agents/audit/juno-auditor.md.template +39 -40
  34. package/dist/templates/.claude/agents/deployment/ein-cicd.md.template +56 -159
  35. package/dist/templates/.claude/agents/deployment/ino-context.md.template +21 -21
  36. package/dist/templates/.claude/agents/deployment/tan-structure.md.template +28 -29
  37. package/dist/templates/.claude/agents/deployment/zen-knowledge.md.template +22 -23
  38. package/dist/templates/.claude/agents/leadership/aj-maestro.md.template +6 -6
  39. package/dist/templates/.claude/agents/leadership/aly-cto.md.template +17 -18
  40. package/dist/templates/.claude/agents/planning/eus-decomposer.md.template +4 -4
  41. package/dist/templates/.claude/agents/planning/mon-requirements.md.template +4 -4
  42. package/dist/templates/.claude/agents/planning/ror-design.md.template +4 -4
  43. package/dist/templates/.claude/agents/planning/tra-planner.md.template +4 -4
  44. package/dist/templates/.claude/commands/execution/trinity-audit.md.template +9 -9
  45. package/dist/templates/.claude/commands/execution/trinity-breakdown.md.template +535 -0
  46. package/dist/templates/.claude/commands/execution/trinity-orchestrate.md.template +43 -43
  47. package/dist/templates/.claude/commands/infrastructure/trinity-init.md.template +20 -43
  48. package/dist/templates/.claude/commands/investigation/trinity-create-investigation.md.template +5 -5
  49. package/dist/templates/.claude/commands/investigation/trinity-investigate-templates.md.template +10 -10
  50. package/dist/templates/.claude/commands/investigation/trinity-plan-investigation.md.template +1 -1
  51. package/dist/templates/.claude/commands/maintenance/trinity-changelog.md.template +4 -4
  52. package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +10 -10
  53. package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +62 -62
  54. package/dist/templates/.claude/commands/maintenance/trinity-readme.md.template +16 -16
  55. package/dist/templates/.claude/commands/session/trinity-continue.md.template +22 -22
  56. package/dist/templates/.claude/commands/session/trinity-end.md.template +22 -22
  57. package/dist/templates/.claude/commands/session/trinity-start.md.template +1 -2
  58. package/dist/templates/.claude/commands/utility/trinity-agents.md.template +3 -6
  59. package/dist/templates/.claude/commands/utility/trinity-verify.md.template +48 -54
  60. package/dist/templates/.claude/commands/utility/trinity-workorder.md.template +5 -5
  61. package/dist/templates/ci/ci.yml.template +2 -2
  62. package/dist/templates/root/CLAUDE.md.template +9 -9
  63. package/dist/templates/root/linting/nodejs/.husky-pre-commit.template +5 -0
  64. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  65. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  66. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  67. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  68. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  69. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  70. package/dist/templates/trinity/CLAUDE.md.template +14 -14
  71. package/dist/templates/trinity/knowledge-base/ARCHITECTURE.md.template +4 -4
  72. package/dist/templates/trinity/knowledge-base/ISSUES.md.template +8 -8
  73. package/dist/templates/trinity/knowledge-base/Technical-Debt.md.template +1 -3
  74. package/dist/templates/trinity/knowledge-base/To-do.md.template +1 -1
  75. package/dist/templates/trinity/knowledge-base/Trinity.md.template +5 -5
  76. package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +1 -1
  77. package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +2 -2
  78. package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +7 -7
  79. package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +4 -4
  80. package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +10 -10
  81. package/dist/templates/trinity/templates/investigations/bug.md.template +14 -14
  82. package/dist/templates/trinity/templates/investigations/feature.md.template +14 -14
  83. package/dist/templates/trinity/templates/investigations/performance.md.template +14 -14
  84. package/dist/templates/trinity/templates/investigations/security.md.template +14 -14
  85. package/dist/templates/trinity/templates/investigations/technical.md.template +14 -14
  86. package/dist/templates/trinity/templates/work-orders/ANALYSIS-TEMPLATE.md.template +10 -10
  87. package/dist/templates/trinity/templates/work-orders/AUDIT-TEMPLATE.md.template +10 -10
  88. package/dist/templates/trinity/templates/work-orders/IMPLEMENTATION-TEMPLATE.md.template +10 -10
  89. package/dist/templates/trinity/templates/work-orders/INVESTIGATION-TEMPLATE.md.template +10 -10
  90. package/dist/templates/trinity/templates/work-orders/PATTERN-TEMPLATE.md.template +10 -10
  91. package/dist/templates/trinity/templates/work-orders/VERIFICATION-TEMPLATE.md.template +10 -10
  92. package/package.json +99 -94
  93. package/dist/templates/.claude/agents/leadership/aj-cc.md.template +0 -467
  94. package/dist/templates/ci/cd.yml.template +0 -175
  95. package/dist/templates/ci/github-actions.yml +0 -86
  96. package/dist/templates/root/TRINITY.md.template +0 -52
package/CHANGELOG.md CHANGED
@@ -1,467 +1,702 @@
1
- # Changelog
2
-
3
- All notable changes to Trinity Method SDK will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [2.1.0] - 2026-01-21
11
-
12
- ### Added
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
-
177
- ### Changed
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
-
203
- ### Deprecated
204
-
205
- ### Removed
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
-
218
- ### Fixed
219
-
220
- ### Security
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
-
257
- ## [2.0.8] - 2026-01-08
258
-
259
- ### Added
260
-
261
- - **Bot directory support** - Added `bot/` as a recognized source directory
262
- - `bot/` directory now detected during deployment
263
- - Framework-specific CLAUDE.md automatically deployed to `bot/` directory
264
- - Supports nested patterns: `bot/src`, `bot/lib`, `bot/app`, `src/bot`
265
-
266
- - **Force update flag** - Added `--force` flag to `trinity update` command
267
- - Allows forcing re-update even when already at latest version
268
- - Useful for repairing corrupted deployments or applying template fixes
269
- - Usage: `trinity update --force`
270
-
271
- ## [2.0.7] - 2026-01-06
272
-
273
- ### Fixed
274
-
275
- - **CRITICAL: Agent file extension handling** - Fixed agent updates to strip `.template` extension
276
- - Agents were being copied with `.md.template` extension, creating duplicates alongside old `.md` files
277
- - Now correctly strips `.template` extension during deployment to `.claude/agents/` subdirectories
278
- - Each agent file copied individually with proper extension handling
279
-
280
- - **CRITICAL: Template directory structure** - Fixed template updates to use correct directory structure
281
- - Work order templates were being deployed to wrong directory (`trinity/templates/` instead of `trinity/templates/work-orders/`)
282
- - Documentation templates (`trinity/templates/documentation/`) were not being updated at all
283
- - Investigation templates (`trinity/templates/investigations/`) were not being updated at all
284
- - Now correctly deploys all 3 template types to their proper subdirectories with `.template` extension stripped
285
- - Total templates updated: 13 files (6 work-orders + 2 documentation + 5 investigations)
286
-
287
- ## [2.0.6] - 2026-01-06
288
-
289
- ### Fixed
290
-
291
- - **CRITICAL: Command categorization logic** - Fixed `trinity update` to correctly categorize slash commands
292
- - Execution commands (`audit`, `changelog`, `docs`, `readme`) were falling through to utility category
293
- - Investigation commands containing `investigate` were not being matched properly
294
- - Commands now deploy to correct category directories (session, planning, execution, investigation, infrastructure, infrastructure, utility)
295
- - Prevents duplicate commands in wrong directories during updates
296
-
297
- ## [2.0.5] - 2026-01-06
298
-
299
- ### Fixed
300
-
301
- - **CRITICAL: Slash command file updates** - Fixed `trinity update` command file extension handling
302
- - Update commands module was looking for `.md` files but templates use `.md.template` extension
303
- - Now correctly processes `.md.template` files and strips extension for deployed files
304
- - Slash commands now update properly (20 command files) when running `trinity update`
305
- - Matches the pattern used by knowledge-base update module
306
-
307
- ## [2.0.4] - 2026-01-06
308
-
309
- ### Fixed
310
-
311
- - **CRITICAL: Update command path resolution** - Fixed `trinity update` to use centralized SDK path resolution
312
- - Update command was using hardcoded `@trinity-method/sdk` path instead of `trinity-method-sdk`
313
- - Commands, agents, templates, and knowledge base files now update correctly with global installations
314
- - Fixed "Commands template path not found, skipping" warning
315
-
316
- ## [2.0.3] - 2026-01-06
317
-
318
- ### Fixed
319
-
320
- - **CRITICAL: Global install support** - Fixed SDK path resolution to work with global installations
321
- - Changed package name from incorrect `@trinity-method/sdk` to `trinity-method-sdk` in path resolution
322
- - Added `import.meta.url` support for resolving SDK location in global installs
323
- - `trinity update` command now works correctly when SDK is installed globally
324
- - Fixed "ENOENT: no such file or directory" error when running update command
325
-
326
- ## [2.0.2] - 2026-01-02
327
-
328
- ### Added
329
-
330
- - **DOCUMENTATION RULES** section to all APO documentation commands (`/trinity-docs`, `/trinity-readme`, `/trinity-changelog`)
331
- - Rule 1: No Self-Serving Trinity Documentation - Prevents APO from including Trinity Method information in user project documentation
332
- - Provides clear ✅/❌ examples and rationale for focusing exclusively on user's codebase
333
- - Explicit **Write tool execution commands** throughout `/trinity-docs` Phase 2
334
- - Added 🚨 CRITICAL EXECUTION REQUIREMENT section at Phase 2 start
335
- - Added **EXECUTION REQUIRED** code blocks for each seeding step
336
- - Added **Phase 2 Execution Summary** with mandatory file creation checklist
337
- - Ensures APO creates actual documentation files instead of just showing templates
338
-
339
- ### Changed
340
-
341
- - **`/trinity-docs` command:** Enhanced Phase 2 with explicit Write tool requirements
342
- - Step 2 (Guides): Added execution requirements for getting-started.md and framework-specific guides
343
- - Step 3 (API): Added execution requirements for api/README.md
344
- - Step 4 (Architecture): Added execution requirements for architecture/overview.md
345
- - Step 5 (Reference): Added execution requirements for reference/README.md
346
- - Phase now requires minimum 4 files to be created: getting-started.md, api/README.md, architecture/overview.md, reference/README.md
347
-
348
- ### Fixed
349
-
350
- - **APO file creation issue:** `/trinity-docs` now explicitly commands APO to use Write tool, preventing scenario where directory structure is created but documentation files are not written
351
-
352
- ## [2.0.1] - 2025-12-29
353
-
354
- ### Added
355
-
356
- - Installation instructions in README.md with npx and global install options
357
- - Automatic npm deployment on every push to main branch via GitHub Actions CD workflow
358
-
359
- ### Changed
360
-
361
- - **CD Workflow:** Modified to deploy to npm on all main branch pushes (not just version tags)
362
- - **CD Workflow:** GitHub releases now only created for version tags, not regular commits
363
- - Updated all package references from `@trinity-method/cli` to `trinity-method-sdk`
364
-
365
- ### Fixed
366
-
367
- - Removed redundant `node_modules/` from Trinity's .gitignore additions
368
-
369
- ## [2.0.0] - 2025-12-21
370
-
371
- ### Added
372
-
373
- - **Agent System Expansion:** Grew from 7 to 19 specialized agents
374
- - **Planning Layer (4 agents):** MON (Requirements Analyst), ROR (Design Architect), TRA (Work Planner), EUS (Task Decomposer)
375
- - **Execution Layer (3 agents):** KIL (Task Executor), BAS (Quality Gate), DRA (Code Reviewer)
376
- - **Support Layer (4 agents):** APO (Documentation Specialist), BON (Dependency Manager), CAP (Configuration Specialist), URO (Refactoring Specialist)
377
- - **Leadership & Audit (2 agents):** ALY (Chief Technology Officer), JUNO (Quality Auditor)
378
- - **Infrastructure (5 agents):** TAN, ZEN, INO, EIN, AJ MAESTRO (legacy)
379
- - Increased deployment from 49 to 64 production-ready components
380
- - Expanded slash commands from 8 to 20 commands across 6 categories
381
- - Session Management: `/trinity-start`, `/trinity-continue`, `/trinity-end`
382
- - Planning: `/trinity-requirements`, `/trinity-design`, `/trinity-decompose`, `/trinity-plan`
383
- - Execution: `/trinity-orchestrate`, `/trinity-audit`, `/trinity-readme`, `/trinity-docs`, `/trinity-changelog`
384
- - Investigation: `/trinity-create-investigation`, `/trinity-plan-investigation`, `/trinity-investigate-templates`
385
- - Infrastructure: `/trinity-init`
386
- - Utility: `/trinity-verify`, `/trinity-agents`, `/trinity-workorder`
387
- - Enhanced `/trinity-readme` command template to v2.0.0 with comprehensive validation phases
388
- - Phase 2h: Command/Script/CLI Validation - Verifies all documented commands exist in codebase
389
- - Phase 2i: Code Example Validation - Checks code examples match current API signatures
390
- - Phase 2j: API/Function Reference Validation - Verifies documented functions/classes exist
391
- - Phase 2k: Dependency Claims Validation - Cross-references README with package manifests
392
- - Phase 2l: Stale Content Detection - Finds TODO markers, outdated dates, placeholder text
393
-
394
- ### Changed
395
-
396
- - **BREAKING:** Updated Trinity Method to v2.0.0 architecture
397
- - **Agent System:** Complete agent architecture redesign with specialized layers
398
- - **Documentation System:** Enhanced APO capabilities with comprehensive audit phases
399
- - Refactored 7 functions to reduce cyclomatic complexity (all ≤15)
400
- - Improved code maintainability and readability across codebase
401
- - Enhanced test coverage and reliability (405 tests, 100% passing)
402
-
403
- ### Deprecated
404
-
405
- - AJ MAESTRO orchestrator (v1.0) replaced by ALY in v2.0
406
-
407
- ### Fixed
408
-
409
- - Template path resolution in integration tests
410
- - Linting deployment tests now correctly locate template files
411
- - **Documentation Accuracy:** Fixed 6 critical inaccuracies in README.md
412
- - Removed 24+ non-existent CLI commands (`npx trinity investigate`, `crisis`, `analytics`, etc.)
413
- - Fixed 13 broken documentation links (docs/methodology/, docs/adr/, docs/workflows/)
414
- - Corrected agent count inconsistencies throughout documentation (unified to 19 agents)
415
- - Updated deployment examples to reflect actual CLI (`npx @trinity-method/cli deploy/update`)
416
- - Fixed broken ADR links in src/README.md (replaced with design principles summary)
417
- - Fixed broken ADR links in docs/README.md (removed non-existent file references)
418
-
419
- ---
420
-
421
- ## [1.0.1] - 2025-10-02 (Legacy - @trinity-method/cli)
422
-
423
- ### Fixed
424
-
425
- - **Critical:** Missing template files in npm package (only 9 of 36 were included)
426
- - Fixed file paths to use bundled templates instead of workspace structure
427
- - All `.md.template` files now properly included in published package
428
- - Updated `deploy.js` and `update.js` to reference correct template locations
429
- - Bundled agents and hooks directly into CLI package for standalone operation
430
-
431
- ### Changed
432
-
433
- - Reorganized package structure to be self-contained when published to npm
434
- - Templates, agents, and hooks now bundled in `packages/cli/templates/`
435
-
436
- **Note:** This version was published as `@trinity-method/cli`. Starting with v2.0.0, the package was renamed to `trinity-method-sdk`.
437
-
438
- ---
439
-
440
- ## [1.0.0] - 2025-10-01 (Legacy - @trinity-method/cli)
441
-
442
- ### Added
443
-
444
- - Initial release of Trinity Method SDK for Claude Code
445
- - 7 specialized Trinity agents (Aly, AJ, TAN, ZEN, INO, Ein, JUNO)
446
- - Claude Code-exclusive deployment
447
- - Interactive deployment with linting and CI/CD configuration
448
- - Linting configuration (ESLint, Prettier, etc.)
449
- - CI/CD automation (GitHub Actions, GitLab CI)
450
- - Matrix testing support
451
- - Coverage integration (Codecov, Coveralls)
452
- - Employee Directory with agent documentation
453
- - Trinity structure (knowledge-base, templates)
454
- - CLAUDE.md context file deployment
455
- - README injection for Trinity Method section
456
- - 8 slash commands (/trinity-init, /trinity-verify, /trinity-docs, /trinity-start, /trinity-continue, /trinity-end, /trinity-workorder, /trinity-agents)
457
- - Session management with archival system
458
- - Comprehensive CLI documentation
459
-
460
- ### Strategic Decision
461
-
462
- - Focused exclusively on Claude Code for exceptional user experience
463
- - Community contributions welcome for other coding agents
464
-
465
- **Note:** This version was published as `@trinity-method/cli`. Starting with v2.0.0, the package was renamed to `trinity-method-sdk`.
466
-
467
- [1.0.0]: https://github.com/lukadfagundes/trinity-method-sdk/releases/tag/v1.0.0
1
+ # Changelog
2
+
3
+ All notable changes to Trinity Method SDK will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [2.2.0] - 2026-02-24
11
+
12
+ ### Added
13
+
14
+ - **Markdown linting in CI pipeline and pre-commit hook** - Added blocking `markdownlint-cli2`
15
+ validation for `*.md`, `docs/**/*.md`, and `src/**/*.md` in both CI and pre-commit
16
+ - CI: Added lint step to `docs` job in `.github/workflows/ci.yml`
17
+ - Pre-commit: Added Stage 4 to `.husky/pre-commit` running markdownlint on all tracked
18
+ markdown directories
19
+ - Enforces markdown syntax standards across all 78 markdown files using
20
+ `.markdownlint.json` config
21
+ - **New `/trinity-breakdown` slash command** - Guided, user-driven implementations where CC
22
+ acts as an instructor walking users through changes step-by-step instead of executing them
23
+ directly (Issue #11)
24
+ - **GitHub Releases workflow** - Automated draft release creation on version tags (`v*.*.*`)
25
+ via `.github/workflows/release.yml` (Issue #5)
26
+ - 5-job pipeline: version extraction, CHANGELOG release notes extraction,
27
+ tag-vs-package.json version validation, full CI quality gates, and draft GitHub release
28
+ - Uses `softprops/action-gh-release@v2` with `draft: true` releases require manual
29
+ publishing
30
+ - CHANGELOG extraction uses Node.js script (not sed) matching `## [X.Y.Z]` Keep a
31
+ Changelog format
32
+ - Fails fast on version mismatch or missing/empty CHANGELOG section
33
+ - Coverage thresholds mirror CI pipeline: lines >= 75%, branches >= 65%,
34
+ functions >= 80%, statements >= 75%
35
+ - No `npm publish` automation publishing remains manual via `npm publish`
36
+
37
+ ### Changed
38
+
39
+ - **Enabled all TypeScript strict mode flags** - Turned on `strictNullChecks`,
40
+ `strictPropertyInitialization`, `noUnusedLocals`, and `noUnusedParameters` in
41
+ tsconfig.json (Issue #6)
42
+ - All four flags were previously disabled, weakening compile-time type safety
43
+ - Codebase required zero changes for `strictNullChecks` and
44
+ `strictPropertyInitialization` (already null-safe)
45
+ - Prefixed 6 unused parameters with `_` to satisfy `noUnusedParameters`
46
+ (5 in `deploy-linting.ts`, 1 in `summary.ts`)
47
+ - All 417 tests pass, 0 type errors, lint clean
48
+ - **Added metrics module test coverage** - Created comprehensive test suites for
49
+ `dependency-parser.ts` and `framework-detector.ts` (Issue #6)
50
+ - `dependency-parser.ts` coverage: 9.37% 100% (23 tests covering Node.js, Python,
51
+ Rust, Flutter, Go, and error paths)
52
+ - `framework-detector.ts` coverage: 36.36% 95.23% (24 tests covering all version
53
+ detectors and package manager detection)
54
+ - Overall project coverage improved from 83%89% (464 tests total)
55
+ - **Fixed all 32 devDependency vulnerabilities** - Resolved minimatch ReDoS, ajv ReDoS,
56
+ and markdown-it ReDoS via `npm audit fix` and `overrides` in package.json (Issue #6)
57
+ - `npm audit fix` resolved ajv (<6.14.0), markdown-it (13.0.0-14.1.0), and
58
+ @isaacs/brace-expansion (5.0.0) 9 vulnerabilities
59
+ - Added `overrides` for `minimatch@^10.2.1` to force resolution of 23 remaining
60
+ transitive dependency vulnerabilities through eslint, jest, and typedoc
61
+ - `npm audit` now reports 0 vulnerabilities (was 32: 30 high, 2 moderate)
62
+ - **Restructured `trinity/` into `.claude/trinity/`** - Consolidated deployment footprint
63
+ from two top-level directories to one (Issue #3)
64
+ - `trinity deploy` now creates `.claude/trinity/` instead of a separate `trinity/`
65
+ directory
66
+ - `trinity update` manages `.claude/trinity/` with consolidated backup (single `.claude/`
67
+ backup covers everything)
68
+ - All 50+ template files updated with new deployment target paths
69
+ - All relative paths recalculated for new directory depth
70
+ - 417 tests pass with restructured paths
71
+ - **Updated `.gitignore` entries** - Trinity deployment now only ignores
72
+ `.claude/trinity/archive/` and `.claude/trinity/templates/` instead of all `.claude/`,
73
+ `*CLAUDE.md`, `TRINITY.md`, and `trinity/` allowing agents, commands, and context files
74
+ to be tracked in version control
75
+ - **Removed `.claude/trinity/patterns/` directory** - No longer deployed as an empty
76
+ placeholder; directory structure reduced from 17 to 16 directories
77
+
78
+ ### Fixed
79
+
80
+ - **Resolved ~600 markdownlint violations across 78 markdown files** - Fixed all markdown
81
+ syntax errors in `docs/`, root (`*.md`), and `src/` directories (Issue #6)
82
+ - `docs/` (72 files): ~580 violations fixed (MD013 line length, MD022 blanks around
83
+ headings, MD031/MD032 blanks around fences/lists, MD040 code fence languages, MD009
84
+ trailing spaces, MD036 emphasis as heading, MD026 trailing punctuation)
85
+ - `README.md`: 16 violations fixed (MD013, MD022, MD026, MD036, MD040)
86
+ - `CONTRIBUTING.md`: 6 violations fixed (MD013, MD009, MD031, MD032, MD040)
87
+ - `CLAUDE.md`: 4 violations fixed (MD022 blanks around headings)
88
+ - `src/CLAUDE.md`: 42 violations fixed (MD022, MD031, MD032, MD040, MD013)
89
+ - `src/README.md`: 3 violations fixed (MD013, MD040)
90
+ - Updated `.markdownlint.json` config: added `siblings_only: true` to MD024 for Keep a
91
+ Changelog duplicate heading compatibility
92
+
93
+ - **CRITICAL: Pre-commit hooks non-functional for Node.js** - Switched from Python's
94
+ pre-commit framework to husky + lint-staged for Node.js/React projects (Issue #4)
95
+ - Node.js/React projects now deploy `.husky/pre-commit` with `npx lint-staged` instead
96
+ of `.pre-commit-config.yaml`
97
+ - Added `husky@^9.1.7` and `lint-staged@^16.2.0` as devDependencies with
98
+ `prepare: 'husky'` script
99
+ - Hooks activate automatically on `npm install` — no manual setup required
100
+ - `lint-staged` configuration injected into `package.json` (eslint + prettier for TS/JS,
101
+ prettier for JSON/MD/YAML)
102
+ - Python/Flutter/Rust projects continue to use `.pre-commit-config.yaml` (unchanged)
103
+ - Existing pre-commit configurations detected and preserved (`.husky/`,
104
+ `.pre-commit-config.yaml`, or husky/lint-staged in package.json)
105
+
106
+ - **CRITICAL: CI/CD workflow templates never deployed** - Fixed `enableCICD` from
107
+ interactive config never bridging to `ciDeploy` deployment flag
108
+ - Added bridge in deploy orchestrator:
109
+ `if (config.enableCICD) { options.ciDeploy = true; }`
110
+ - CI templates now correctly deploy when user selects CI/CD during `trinity deploy`
111
+
112
+ - **CI template variables not processed** - Added `processTemplate()` call to CI workflow
113
+ deployment
114
+ - `{{PROJECT_NAME}}`, `{{FRAMEWORK}}`, and other template variables now resolve in
115
+ deployed `ci.yml`
116
+ - Passes variables from deploy orchestrator through `deployCICD()` to
117
+ `deployCITemplates()`
118
+
119
+ - **No --force protection for GitHub Actions templates** - Added existence check matching
120
+ GitLab's pattern
121
+ - `.github/workflows/ci.yml` now skipped if it already exists (unless `--force` is used)
122
+ - Both GitHub and GitLab platforms now have consistent `--force` flag protection
123
+
124
+ - **Configuration display showed wrong filename** - Changed `trinity-ci.yml` to `ci.yml`
125
+ in interactive prompt output
126
+ - Both detected-platform and unknown-platform display now show correct filename
127
+
128
+ - **CI workflow template header** - Changed `CI/CD Pipeline` to `CI Pipeline` in
129
+ `ci.yml.template`
130
+
131
+ ### Removed
132
+
133
+ - **`TRINITY.md` root file** - No longer deployed; Trinity context is now at
134
+ `.claude/trinity/CLAUDE.md`
135
+ - Deleted `src/templates/root/TRINITY.md.template`
136
+ - Removed `deployTrinityMarkdown()` function from deploy pipeline
137
+ - **Dead template files** - Deleted `cd.yml.template` (used undefined `{{DOMAIN}}`
138
+ variable) and `github-actions.yml` (orphaned, never referenced)
139
+ - **CD workflow references** - Removed all Continuous Deployment workflow references from
140
+ source code, templates (EIN, TAN, init, verify), CI workflow, tests, and documentation
141
+
142
+ ## [2.1.0] - 2026-01-21
143
+
144
+ ### Added
145
+
146
+ - **NEW: Trinity-docs-update command** - Comprehensive documentation update system for
147
+ maintaining existing docs
148
+ - **Command:** `/maintenance:trinity-docs-update` - Updates existing documentation to
149
+ reflect codebase changes
150
+ - **Architecture:** JUNO audit 3 parallel APO instances → JUNO verification loop →
151
+ Final quality audit
152
+ - **Autonomous Execution:** Runs from start to finish without user intervention unless
153
+ errors occur
154
+ - **Version:** 2.0.9
155
+ - **Last Updated:** 2026-01-19
156
+
157
+ - **Trinity-docs-update - JUNO audit system** - Phase 1 comprehensive codebase analysis
158
+ with mandatory verification protocols
159
+ - **Database Verification Protocol (Mandatory):**
160
+ - Step 1: Detect database presence via bash detection script
161
+ - Step 2: **MANDATORY** production database connection attempt if database detected
162
+ - Documents connection info search (.env, docker-compose.yml, config files)
163
+ - Documents connection attempt method and result (success/failure with reason)
164
+ - Falls back to schema files ONLY after documented connection failure
165
+ - Prevents documentation based on outdated schema files
166
+ - **Environment Configuration Verification Protocol (All Projects):**
167
+ - Priority 1: Check actual environment files (.env, .env.local) FIRST
168
+ - Priority 2: Check template files (.env.example)
169
+ - Priority 3: Check code defaults (|| fallback values)
170
+ - Documents all findings and discrepancies
171
+ - Source of truth order: Actual config > Template > Code defaults
172
+ - **Prevents false positives:** Won't flag correct docs as wrong by verifying against
173
+ actual config
174
+ - **Business Logic Discovery:** Scans controllers, services, models, utilities at
175
+ function-level granularity
176
+ - **Output:** `trinity/reports/DOCS-UPDATE-AUDIT-{{DATE}}.md` with APO work assignments
177
+
178
+ - **Trinity-docs-update - Configuration false positive prevention** - Resolution rules
179
+ prevent incorrect audit findings
180
+ - **Resolution Rule 1:** If .env sets value X, then X is correct (docs showing X are
181
+ correct)
182
+ - **Resolution Rule 2:** Code defaults contradicting .env should be fixed (not docs)
183
+ - **Resolution Rule 3:** Documentation showing actual config value is NEVER wrong
184
+ - **Example:** Port 3001 in docs + .env, but code shows `|| 4000` → docs are correct,
185
+ code default needs fixing
186
+ - **Impact:** Eliminates false positives where JUNO would flag correct documentation as
187
+ wrong
188
+
189
+ - **Trinity-docs-update - Scope boundary with consistency exceptions** - Defines strict
190
+ boundaries with limited exceptions
191
+ - **ALLOWED:** Read any file, write/edit files in docs/ directory only
192
+ - **FORBIDDEN:** Modify source code, database schemas, config files, build files, tests
193
+ - **EXCEPTIONS (APO-1 only):**
194
+ - Fix hardcoded default values contradicting documented standards
195
+ (e.g., `|| 4000` `|| 3001`)
196
+ - Update .env.example template values to match actual standards
197
+ - ONLY simple constant/default changes (no logic modifications)
198
+ - MUST verify against actual .env first
199
+ - **Scenario C Example:** Docs show port 3001, .env has 3001, code default is 4000 →
200
+ Fix code default to 3001
201
+
202
+ - **Trinity-docs-update - APO parallel execution system** - Phase 2 launches three
203
+ documentation specialists concurrently
204
+ - **APO-1:** Base documentation updates (architecture, setup, guides)
205
+ - **NEW:** Configuration consistency fixes (simple defaults that contradict standards)
206
+ - Update .env.example to match actual standards
207
+ - Align configuration values across codebase and docs
208
+ - Restriction: Only simple constants (no logic changes)
209
+ - **APO-2:** Update existing business logic documentation OR new docs (first half)
210
+ - **APO-3:** New business logic documentation (second half)
211
+ - Each APO creates personal checklist from JUNO's audit report
212
+ - All APOs verify changes against actual codebase (not assumptions)
213
+ - Output: Updated/new documentation files in docs/
214
+
215
+ - **Trinity-docs-update - APO verification requirements** - Mandatory codebase
216
+ verification for all documentation changes
217
+ - **For EVERY change, APO must:**
218
+ 1. Identify what needs to change (from JUNO's assignment)
219
+ 2. Verify correct value in codebase (read .env, source files, config)
220
+ 3. Document verification in task (which files read, what found)
221
+ 4. Use Read tool BEFORE making changes
222
+ 5. Use Edit tool with verified information only
223
+ 6. DO NOT make assumptions or guesses
224
+ - **Verification examples:**
225
+ - API ports → Read .env, server.js, app.js
226
+ - Table names Read init.sql or check production database
227
+ - Endpoint URLs Read route files
228
+ - Method signatures Read actual source file
229
+ - Configuration values Read config files
230
+ - **Documentation format:**
231
+
232
+ ```markdown
233
+ - [x] docs/api/README.md
234
+ - Verification: Read backend/.env - confirmed port is 3001
235
+ - Changes made: Updated 49 instances of port number to 3001
236
+ ```
237
+
238
+ - **Trinity-docs-update - JUNO verification loop** - Phase 3 ensures 100% completion
239
+ before final audit
240
+ - **Step 3.1:** JUNO checks all three APO checklists for completion status
241
+ - Counts total tasks vs completed tasks per APO
242
+ - Calculates completion percentage
243
+ - Determines next action (PROCEED or RESTART)
244
+ - **Step 3.1A:** Re-launch incomplete APOs automatically
245
+ - Identifies incomplete APOs from JUNO's report
246
+ - Restarts only incomplete APOs with resume instructions
247
+ - Loops until all APOs reach 100%
248
+ - **Step 3.2:** JUNO final quality audit (only when all APOs 100% complete)
249
+ - Verifies files created/updated
250
+ - Checks content accuracy against codebase
251
+ - Validates no hallucinated components
252
+ - Generates verification report with pass/fail status
253
+ - **Output:** `trinity/reports/DOCS-UPDATE-VERIFICATION-{{DATE}}.md`
254
+
255
+ - **Trinity-docs-update - Three template files** - Command template and two checklist
256
+ templates deployed via CLI
257
+ - **Command Template:**
258
+ `src/templates/.claude/commands/maintenance/trinity-docs-update.md.template`
259
+ - Deployed to: `.claude/commands/maintenance/trinity-docs-update.md`
260
+ - Updated by: `trinity update` command via `updateCommands()` function
261
+ - **JUNO Checklist:**
262
+ `src/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template`
263
+ - Deployed to:
264
+ `trinity/templates/documentation/reports/juno-docs-update-checklist.md`
265
+ - Updated by: `trinity update` command via `updateTemplates()` function (recursively
266
+ copies all documentation templates)
267
+ - **APO Checklist:**
268
+ `src/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template`
269
+ - Deployed to:
270
+ `trinity/templates/documentation/reports/apo-docs-update-checklist.md`
271
+ - Updated by: `trinity update` command via `updateTemplates()` function (recursively
272
+ copies all documentation templates)
273
+ - All templates automatically deployed during `trinity deploy` and updated during
274
+ `trinity update`
275
+
276
+ - **Trinity-docs command - Complete architectural overhaul** - Transformed from
277
+ single-agent to multi-agent orchestration
278
+ - **New Architecture:** JUNO audit 3 parallel APO instances → Verification
279
+ - **JUNO Agent Integration:** Read-only codebase audit creates documentation checklist
280
+ before generation
281
+ - **Parallel APO Execution:** APO-1 (diagrams), APO-2 (guides/API), APO-3 (config) run
282
+ concurrently
283
+ - **Performance:** 3x faster execution via parallel agent orchestration
284
+ - **Context Efficiency:** Each agent receives focused instructions (<100 lines) vs
285
+ single 2,577-line spec
286
+
287
+ - **Trinity-docs command - External template system** - Created 28 reusable documentation
288
+ templates
289
+ - **Template Directory:** `trinity/templates/documentation/` with 8 categories
290
+ - **Mermaid Diagrams (4 templates):** MVC flow, database ER, API endpoint map,
291
+ component hierarchy
292
+ - **Guides (4 templates):** Getting started, API development, deployment, contributing
293
+ - **API Documentation (1 template):** API README with endpoint structure
294
+ - **Configuration (2 templates):** Documentation structure, env-example generator
295
+ - **Discovery (4 templates):** Framework detection, component discovery, API endpoint
296
+ scanner, env variable extraction
297
+ - **Validation (3 templates):** APO self-validation checklists for all 3 agents
298
+ - **Processes (6 templates):** APO workflows (common, diagram-specific,
299
+ guide-specific, config-specific), error handling, fallback mechanisms
300
+ - **Reports (2 templates):** JUNO internal report, ROOT-README for template organization
301
+ - **Template Variables:** All templates use `{{UPPERCASE_UNDERSCORE}}` syntax for
302
+ dynamic content replacement
303
+
304
+ - **Trinity-docs command - Template validation phase** - Optional Phase 0.2 validates
305
+ template syntax
306
+ - Validates `{{VARIABLE}}` syntax (must be UPPERCASE_UNDERSCORE)
307
+ - Detects nested variables (not supported)
308
+ - Checks balanced braces
309
+ - Non-blocking warnings for template issues
310
+
311
+ - **Trinity-docs command - Retry mechanism** - Phase 0.25 handles transient failures
312
+ - Retries operations up to 3 times with 500ms delay
313
+ - Handles filesystem delays and race conditions
314
+ - Graceful degradation for non-critical operations
315
+
316
+ - **Trinity-docs command - JUNO documentation audit** - Phase 1 performs comprehensive
317
+ codebase analysis
318
+ - **Framework Detection:** Analyzes package.json for Express, NestJS, React, Next.js,
319
+ Django, Flask, FastAPI
320
+ - **Component Discovery:** Scans for React/Vue/Angular/Svelte components with
321
+ zero-tolerance for fake components
322
+ - **API Endpoint Scanning:** Detects Express/Fastify/NestJS/Koa routes with enhanced
323
+ patterns
324
+ - **Database Detection:** PostgreSQL, MySQL, MongoDB, SQLite, Redis via dependency
325
+ analysis
326
+ - **Environment Variables:** Extracts from .env and process.env usage patterns
327
+ - **Checklist Report:** Generates
328
+ `trinity/templates/documentation/reports/juno-internal-report.md` with all discovered
329
+ metadata
330
+
331
+ - **Trinity-docs command - Fallback mechanism** - Handles missing JUNO data gracefully
332
+ - Uses discovery templates when JUNO variables missing
333
+ - Framework detection fallback via package.json analysis
334
+ - Component discovery fallback for frontend frameworks
335
+ - API endpoint scanner fallback for backend frameworks
336
+ - Environment variable extraction fallback
337
+ - Default template paths when discovery fails
338
+
339
+ - **Trinity-docs command - APO self-validation** - Each APO validates its own work before
340
+ completion
341
+ - APO-1 validates: 4 diagram files created, correct paths, no placeholders, proper
342
+ Mermaid syntax
343
+ - APO-2 validates: Guide completeness, API documentation accuracy, no fake examples
344
+ - APO-3 validates: Config files exist, no hardcoded secrets, proper .env.example format
345
+ - Security checks for APO-3: No API keys, passwords, tokens, or sensitive data in
346
+ generated files
347
+
348
+ - **Trinity-docs command - Enhanced verification phase** - Phase 4 performs comprehensive
349
+ quality checks
350
+ - Verifies all JUNO checklist items completed
351
+ - Validates file existence and content quality
352
+ - Checks for placeholders and fake data
353
+ - Ensures proper Mermaid syntax in diagrams
354
+ - Validates security (no secrets in config files)
355
+ - Generates final completion report with pass/fail status
356
+
357
+ ### Changed
358
+
359
+ - **Trinity-docs command - File relocation** - Moved from
360
+ `src/templates/shared/claude-commands/` to
361
+ `src/templates/.claude/commands/execution/`
362
+ - Aligns with new command categorization structure
363
+ - Distinguishes execution commands from utility/session/planning commands
364
+
365
+ - **Trinity-docs command - Diagram output path** - Changed from
366
+ `docs/architecture/diagrams/` to `docs/architecture/`
367
+ - Simplified directory structure
368
+ - All architecture files (diagrams, overview, ADRs) now in single directory
369
+ - Updated all references throughout command specification (lines 1079, 1205-1208)
370
+
371
+ - **Trinity-docs command - API endpoint scanner enhancement** - Added 3 missing route
372
+ detection patterns
373
+ - Added `router.route('...').get|post|put|patch|delete()` pattern
374
+ - Added `app.route('...').get|post|put|patch|delete()` pattern
375
+ - Added `router.all('...')` wildcard route pattern
376
+ - Fixes endpoint count variance (33 vs 34 detected endpoints)
377
+
378
+ - **Trinity-docs command - Configuration directory consolidation** - Merged `config/` into
379
+ `configuration/`
380
+ - Moved `env-example-generator.md.template` from `config/` to `configuration/`
381
+ - Removed duplicate directory structure
382
+ - Now single `configuration/` directory with 2 templates
383
+
384
+ - **Trinity-docs command - Version update** - Updated to v2.0.9
385
+ - Reflects architectural overhaul and template externalization
386
+ - Command now references 28 external templates vs inline logic
387
+
388
+ ### Deprecated
389
+
390
+ ### Removed
391
+
392
+ - **Trinity-docs command - Inline documentation logic** - Removed 808+ lines of inline
393
+ instructions (WO-004)
394
+ - Phase 1 codebase analysis logic → `trinity/templates/documentation/discovery/`
395
+ templates
396
+ - Phase 2 content seeding `trinity/templates/documentation/guides/` templates
397
+ - Diagram generation `trinity/templates/documentation/mermaid-diagrams/` templates
398
+ - Validation logic `trinity/templates/documentation/validation/` templates
399
+
400
+ - **Trinity-docs command - Single-agent architecture** - Replaced with multi-agent
401
+ orchestration
402
+ - Old: Single APO reads 2,577-line spec and performs all work
403
+ - New: JUNO audit + 3 parallel APO instances with focused instructions
404
+ - Reduces context fatigue and improves reliability
405
+
406
+ ### Fixed
407
+
408
+ ### Security
409
+
410
+ ## [2.0.9] - 2026-01-12
411
+
412
+ ### Changed
413
+
414
+ - **Trinity-docs command specification** - Added evidence-based documentation verification
415
+ - Added Rule 2: Evidence-Based Documentation Only - prevents documenting uninstalled
416
+ tools
417
+ - Added Phase 1 Step 6: Tool & Feature Verification for all project types
418
+ - Added tool verification report to Phase 5 output
419
+ - Prevents aspirational/best-practice content that doesn't exist in codebase
420
+ - Addresses incident where Lighthouse was documented without being installed
421
+
422
+ - **Trinity-readme command specification** - Removed Trinity self-documentation conflicts
423
+ - Deleted Type C Template that documented Trinity infrastructure (violated Rule 1)
424
+ - Added Rule 1 Enforcement Checklist with verification commands
425
+ - Added Phase 1 Step 4.5: Filter Gitignored and Trinity Directories
426
+ - Added Trinity Detection Warning to explicitly skip trinity/ and .claude/
427
+ - Removed trinity/ from glob patterns and project structure examples
428
+ - Addresses incident where trinity/ was included in README file tree despite being
429
+ gitignored
430
+
431
+ - **Trinity-readme command specification** - Added LICENSE file verification for badges
432
+ - Added Phase 1 Step 7: License Verification - reads actual LICENSE file
433
+ - LICENSE file is now source of truth (priority over package.json)
434
+ - Detects license type from file header (MIT, ISC, Apache, GPL, BSD, etc.)
435
+ - Warns when package.json license field doesn't match LICENSE file
436
+ - Falls back to package.json only if LICENSE file doesn't exist
437
+ - Addresses incident where ISC badge was generated despite MIT LICENSE file
438
+
439
+ - **Trinity-docs command specification** - Added Trinity reference sanitization enforcement
440
+ - Added Rule 1 Forbidden Patterns - explicit list of patterns that must not appear in
441
+ docs/
442
+ - Added Phase 4.5: Trinity Reference Sanitization - scans and removes Trinity references
443
+ - Added Rule 1 Compliance verification to Phase 5 report with pass/fail status
444
+ - Removed Trinity report link from docs/README.md template footer
445
+ - Prevents Trinity Method, agent names, commands, and infrastructure references in user
446
+ docs
447
+ - Addresses incident where 7 documentation files contained Trinity Method references
448
+
449
+ ## [2.0.8] - 2026-01-08
450
+
451
+ ### Added
452
+
453
+ - **Bot directory support** - Added `bot/` as a recognized source directory
454
+ - `bot/` directory now detected during deployment
455
+ - Framework-specific CLAUDE.md automatically deployed to `bot/` directory
456
+ - Supports nested patterns: `bot/src`, `bot/lib`, `bot/app`, `src/bot`
457
+
458
+ - **Force update flag** - Added `--force` flag to `trinity update` command
459
+ - Allows forcing re-update even when already at latest version
460
+ - Useful for repairing corrupted deployments or applying template fixes
461
+ - Usage: `trinity update --force`
462
+
463
+ ## [2.0.7] - 2026-01-06
464
+
465
+ ### Fixed
466
+
467
+ - **CRITICAL: Agent file extension handling** - Fixed agent updates to strip `.template`
468
+ extension
469
+ - Agents were being copied with `.md.template` extension, creating duplicates alongside
470
+ old `.md` files
471
+ - Now correctly strips `.template` extension during deployment to `.claude/agents/`
472
+ subdirectories
473
+ - Each agent file copied individually with proper extension handling
474
+
475
+ - **CRITICAL: Template directory structure** - Fixed template updates to use correct
476
+ directory structure
477
+ - Work order templates were being deployed to wrong directory (`trinity/templates/`
478
+ instead of `trinity/templates/work-orders/`)
479
+ - Documentation templates (`trinity/templates/documentation/`) were not being updated at
480
+ all
481
+ - Investigation templates (`trinity/templates/investigations/`) were not being updated
482
+ at all
483
+ - Now correctly deploys all 3 template types to their proper subdirectories with
484
+ `.template` extension stripped
485
+ - Total templates updated: 13 files (6 work-orders + 2 documentation + 5 investigations)
486
+
487
+ ## [2.0.6] - 2026-01-06
488
+
489
+ ### Fixed
490
+
491
+ - **CRITICAL: Command categorization logic** - Fixed `trinity update` to correctly
492
+ categorize slash commands
493
+ - Execution commands (`audit`, `changelog`, `docs`, `readme`) were falling through to
494
+ utility category
495
+ - Investigation commands containing `investigate` were not being matched properly
496
+ - Commands now deploy to correct category directories (session, planning, execution,
497
+ investigation, infrastructure, infrastructure, utility)
498
+ - Prevents duplicate commands in wrong directories during updates
499
+
500
+ ## [2.0.5] - 2026-01-06
501
+
502
+ ### Fixed
503
+
504
+ - **CRITICAL: Slash command file updates** - Fixed `trinity update` command file extension
505
+ handling
506
+ - Update commands module was looking for `.md` files but templates use `.md.template`
507
+ extension
508
+ - Now correctly processes `.md.template` files and strips extension for deployed files
509
+ - Slash commands now update properly (20 command files) when running `trinity update`
510
+ - Matches the pattern used by knowledge-base update module
511
+
512
+ ## [2.0.4] - 2026-01-06
513
+
514
+ ### Fixed
515
+
516
+ - **CRITICAL: Update command path resolution** - Fixed `trinity update` to use centralized
517
+ SDK path resolution
518
+ - Update command was using hardcoded `@trinity-method/sdk` path instead of
519
+ `trinity-method-sdk`
520
+ - Commands, agents, templates, and knowledge base files now update correctly with global
521
+ installations
522
+ - Fixed "Commands template path not found, skipping" warning
523
+
524
+ ## [2.0.3] - 2026-01-06
525
+
526
+ ### Fixed
527
+
528
+ - **CRITICAL: Global install support** - Fixed SDK path resolution to work with global
529
+ installations
530
+ - Changed package name from incorrect `@trinity-method/sdk` to `trinity-method-sdk` in
531
+ path resolution
532
+ - Added `import.meta.url` support for resolving SDK location in global installs
533
+ - `trinity update` command now works correctly when SDK is installed globally
534
+ - Fixed "ENOENT: no such file or directory" error when running update command
535
+
536
+ ## [2.0.2] - 2026-01-02
537
+
538
+ ### Added
539
+
540
+ - **DOCUMENTATION RULES** section to all APO documentation commands (`/trinity-docs`,
541
+ `/trinity-readme`, `/trinity-changelog`)
542
+ - Rule 1: No Self-Serving Trinity Documentation - Prevents APO from including Trinity
543
+ Method information in user project documentation
544
+ - Provides clear examples and rationale for focusing exclusively on user's codebase
545
+ - Explicit **Write tool execution commands** throughout `/trinity-docs` Phase 2
546
+ - Added CRITICAL EXECUTION REQUIREMENT section at Phase 2 start
547
+ - Added **EXECUTION REQUIRED** code blocks for each seeding step
548
+ - Added **Phase 2 Execution Summary** with mandatory file creation checklist
549
+ - Ensures APO creates actual documentation files instead of just showing templates
550
+
551
+ ### Changed
552
+
553
+ - **`/trinity-docs` command:** Enhanced Phase 2 with explicit Write tool requirements
554
+ - Step 2 (Guides): Added execution requirements for getting-started.md and
555
+ framework-specific guides
556
+ - Step 3 (API): Added execution requirements for api/README.md
557
+ - Step 4 (Architecture): Added execution requirements for architecture/overview.md
558
+ - Step 5 (Reference): Added execution requirements for reference/README.md
559
+ - Phase now requires minimum 4 files to be created: getting-started.md, api/README.md,
560
+ architecture/overview.md, reference/README.md
561
+
562
+ ### Fixed
563
+
564
+ - **APO file creation issue:** `/trinity-docs` now explicitly commands APO to use Write
565
+ tool, preventing scenario where directory structure is created but documentation files
566
+ are not written
567
+
568
+ ## [2.0.1] - 2025-12-29
569
+
570
+ ### Added
571
+
572
+ - Installation instructions in README.md with npx and global install options
573
+ - Automatic npm deployment on every push to main branch via GitHub Actions CD workflow
574
+
575
+ ### Changed
576
+
577
+ - **CD Workflow:** Modified to deploy to npm on all main branch pushes (not just version
578
+ tags)
579
+ - **CD Workflow:** GitHub releases now only created for version tags, not regular commits
580
+ - Updated all package references from `@trinity-method/cli` to `trinity-method-sdk`
581
+
582
+ ### Fixed
583
+
584
+ - Removed redundant `node_modules/` from Trinity's .gitignore additions
585
+
586
+ ## [2.0.0] - 2025-12-21
587
+
588
+ ### Added
589
+
590
+ - **Agent System Expansion:** Grew from 7 to 19 specialized agents
591
+ - **Planning Layer (4 agents):** MON (Requirements Analyst), ROR (Design Architect),
592
+ TRA (Work Planner), EUS (Task Decomposer)
593
+ - **Execution Layer (3 agents):** KIL (Task Executor), BAS (Quality Gate),
594
+ DRA (Code Reviewer)
595
+ - **Support Layer (4 agents):** APO (Documentation Specialist),
596
+ BON (Dependency Manager), CAP (Configuration Specialist),
597
+ URO (Refactoring Specialist)
598
+ - **Leadership & Audit (2 agents):** ALY (Chief Technology Officer),
599
+ JUNO (Quality Auditor)
600
+ - **Infrastructure (5 agents):** TAN, ZEN, INO, EIN, AJ MAESTRO (legacy)
601
+ - Increased deployment from 49 to 64 production-ready components
602
+ - Expanded slash commands from 8 to 20 commands across 6 categories
603
+ - Session Management: `/trinity-start`, `/trinity-continue`, `/trinity-end`
604
+ - Planning: `/trinity-requirements`, `/trinity-design`, `/trinity-decompose`,
605
+ `/trinity-plan`
606
+ - Execution: `/trinity-orchestrate`, `/trinity-audit`, `/trinity-readme`,
607
+ `/trinity-docs`, `/trinity-changelog`
608
+ - Investigation: `/trinity-create-investigation`, `/trinity-plan-investigation`,
609
+ `/trinity-investigate-templates`
610
+ - Infrastructure: `/trinity-init`
611
+ - Utility: `/trinity-verify`, `/trinity-agents`, `/trinity-workorder`
612
+ - Enhanced `/trinity-readme` command template to v2.0.0 with comprehensive validation
613
+ phases
614
+ - Phase 2h: Command/Script/CLI Validation - Verifies all documented commands exist in
615
+ codebase
616
+ - Phase 2i: Code Example Validation - Checks code examples match current API signatures
617
+ - Phase 2j: API/Function Reference Validation - Verifies documented functions/classes
618
+ exist
619
+ - Phase 2k: Dependency Claims Validation - Cross-references README with package
620
+ manifests
621
+ - Phase 2l: Stale Content Detection - Finds TODO markers, outdated dates, placeholder
622
+ text
623
+
624
+ ### Changed
625
+
626
+ - **BREAKING:** Updated Trinity Method to v2.0.0 architecture
627
+ - **Agent System:** Complete agent architecture redesign with specialized layers
628
+ - **Documentation System:** Enhanced APO capabilities with comprehensive audit phases
629
+ - Refactored 7 functions to reduce cyclomatic complexity (all ≤15)
630
+ - Improved code maintainability and readability across codebase
631
+ - Enhanced test coverage and reliability (405 tests, 100% passing)
632
+
633
+ ### Deprecated
634
+
635
+ - AJ MAESTRO orchestrator (v1.0) replaced by ALY in v2.0
636
+
637
+ ### Fixed
638
+
639
+ - Template path resolution in integration tests
640
+ - Linting deployment tests now correctly locate template files
641
+ - **Documentation Accuracy:** Fixed 6 critical inaccuracies in README.md
642
+ - Removed 24+ non-existent CLI commands (`npx trinity investigate`, `crisis`,
643
+ `analytics`, etc.)
644
+ - Fixed 13 broken documentation links (docs/methodology/, docs/adr/, docs/workflows/)
645
+ - Corrected agent count inconsistencies throughout documentation (unified to 18 agents)
646
+ - Updated deployment examples to reflect actual CLI
647
+ (`npx @trinity-method/cli deploy/update`)
648
+ - Fixed broken ADR links in src/README.md (replaced with design principles summary)
649
+ - Fixed broken ADR links in docs/README.md (removed non-existent file references)
650
+
651
+ ---
652
+
653
+ ## [1.0.1] - 2025-10-02 (Legacy - @trinity-method/cli)
654
+
655
+ ### Fixed
656
+
657
+ - **Critical:** Missing template files in npm package (only 9 of 36 were included)
658
+ - Fixed file paths to use bundled templates instead of workspace structure
659
+ - All `.md.template` files now properly included in published package
660
+ - Updated `deploy.js` and `update.js` to reference correct template locations
661
+ - Bundled agents and hooks directly into CLI package for standalone operation
662
+
663
+ ### Changed
664
+
665
+ - Reorganized package structure to be self-contained when published to npm
666
+ - Templates, agents, and hooks now bundled in `packages/cli/templates/`
667
+
668
+ **Note:** This version was published as `@trinity-method/cli`. Starting with v2.0.0,
669
+ the package was renamed to `trinity-method-sdk`.
670
+
671
+ ---
672
+
673
+ ## [1.0.0] - 2025-10-01 (Legacy - @trinity-method/cli)
674
+
675
+ ### Added
676
+
677
+ - Initial release of Trinity Method SDK for Claude Code
678
+ - 7 specialized Trinity agents (Aly, AJ, TAN, ZEN, INO, Ein, JUNO)
679
+ - Claude Code-exclusive deployment
680
+ - Interactive deployment with linting and CI/CD configuration
681
+ - Linting configuration (ESLint, Prettier, etc.)
682
+ - CI/CD automation (GitHub Actions, GitLab CI)
683
+ - Matrix testing support
684
+ - Coverage integration (Codecov, Coveralls)
685
+ - Employee Directory with agent documentation
686
+ - Trinity structure (knowledge-base, templates)
687
+ - CLAUDE.md context file deployment
688
+ - README injection for Trinity Method section
689
+ - 8 slash commands (/trinity-init, /trinity-verify, /trinity-docs, /trinity-start,
690
+ /trinity-continue, /trinity-end, /trinity-workorder, /trinity-agents)
691
+ - Session management with archival system
692
+ - Comprehensive CLI documentation
693
+
694
+ ### Strategic Decision
695
+
696
+ - Focused exclusively on Claude Code for exceptional user experience
697
+ - Community contributions welcome for other coding agents
698
+
699
+ **Note:** This version was published as `@trinity-method/cli`. Starting with v2.0.0,
700
+ the package was renamed to `trinity-method-sdk`.
701
+
702
+ [1.0.0]: https://github.com/lukadfagundes/trinity-method-sdk/releases/tag/v1.0.0