trinity-method-sdk 2.0.9 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +702 -267
  2. package/README.md +550 -540
  3. package/dist/cli/commands/deploy/agents.js +1 -1
  4. package/dist/cli/commands/deploy/ci-cd.d.ts +4 -3
  5. package/dist/cli/commands/deploy/ci-cd.js +10 -9
  6. package/dist/cli/commands/deploy/claude-setup.js +28 -35
  7. package/dist/cli/commands/deploy/configuration.js +10 -11
  8. package/dist/cli/commands/deploy/directories.js +13 -14
  9. package/dist/cli/commands/deploy/gitignore.js +3 -5
  10. package/dist/cli/commands/deploy/index.d.ts +1 -1
  11. package/dist/cli/commands/deploy/index.js +7 -3
  12. package/dist/cli/commands/deploy/knowledge-base.js +3 -3
  13. package/dist/cli/commands/deploy/pre-flight.js +1 -1
  14. package/dist/cli/commands/deploy/root-files.js +3 -18
  15. package/dist/cli/commands/deploy/sdk-install.js +1 -1
  16. package/dist/cli/commands/deploy/summary.js +3 -3
  17. package/dist/cli/commands/deploy/templates.js +33 -20
  18. package/dist/cli/commands/update/agents.js +1 -1
  19. package/dist/cli/commands/update/backup.js +6 -12
  20. package/dist/cli/commands/update/commands.d.ts +1 -0
  21. package/dist/cli/commands/update/commands.js +18 -45
  22. package/dist/cli/commands/update/knowledge-base.js +2 -2
  23. package/dist/cli/commands/update/pre-flight.js +11 -11
  24. package/dist/cli/commands/update/summary.js +5 -5
  25. package/dist/cli/commands/update/templates.js +35 -13
  26. package/dist/cli/commands/update/verification.js +5 -5
  27. package/dist/cli/commands/update/version.js +1 -1
  28. package/dist/cli/utils/deploy-ci.d.ts +3 -2
  29. package/dist/cli/utils/deploy-ci.js +24 -24
  30. package/dist/cli/utils/deploy-linting.js +101 -6
  31. package/dist/cli/utils/error-classes.d.ts +2 -2
  32. package/dist/cli/utils/linting-tools.js +14 -6
  33. package/dist/cli/utils/template-processor.js +2 -4
  34. package/dist/templates/{claude → .claude}/EMPLOYEE-DIRECTORY.md.template +16 -22
  35. package/dist/templates/{agents → .claude/agents}/aj-team/apo-documentation-specialist.md.template +10 -10
  36. package/dist/templates/{agents → .claude/agents}/aj-team/bas-quality-gate.md.template +13 -15
  37. package/dist/templates/{agents → .claude/agents}/aj-team/bon-dependency-manager.md.template +4 -4
  38. package/dist/templates/{agents → .claude/agents}/aj-team/cap-configuration-specialist.md.template +3 -3
  39. package/dist/templates/{agents → .claude/agents}/aj-team/dra-code-reviewer.md.template +8 -10
  40. package/dist/templates/{agents → .claude/agents}/aj-team/kil-task-executor.md.template +11 -13
  41. package/dist/templates/{agents → .claude/agents}/aj-team/uro-refactoring-specialist.md.template +3 -3
  42. package/dist/templates/{agents → .claude/agents}/audit/juno-auditor.md.template +46 -42
  43. package/dist/templates/{agents → .claude/agents}/deployment/ein-cicd.md.template +59 -164
  44. package/dist/templates/{agents → .claude/agents}/deployment/ino-context.md.template +25 -22
  45. package/dist/templates/{agents → .claude/agents}/deployment/tan-structure.md.template +32 -30
  46. package/dist/templates/{agents → .claude/agents}/deployment/zen-knowledge.md.template +28 -23
  47. package/dist/templates/{agents → .claude/agents}/leadership/aj-maestro.md.template +10 -6
  48. package/dist/templates/{agents → .claude/agents}/leadership/aly-cto.md.template +22 -19
  49. package/dist/templates/{agents → .claude/agents}/planning/eus-decomposer.md.template +8 -4
  50. package/dist/templates/{agents → .claude/agents}/planning/mon-requirements.md.template +8 -4
  51. package/dist/templates/{agents → .claude/agents}/planning/ror-design.md.template +8 -4
  52. package/dist/templates/{agents → .claude/agents}/planning/tra-planner.md.template +10 -4
  53. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-audit.md.template +15 -15
  54. package/dist/templates/.claude/commands/execution/trinity-breakdown.md.template +535 -0
  55. package/dist/templates/{shared/claude-commands → .claude/commands/execution}/trinity-orchestrate.md.template +48 -48
  56. package/dist/templates/{shared/claude-commands → .claude/commands/infrastructure}/trinity-init.md.template +32 -54
  57. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-create-investigation.md.template +13 -7
  58. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-investigate-templates.md.template +19 -15
  59. package/dist/templates/{shared/claude-commands → .claude/commands/investigation}/trinity-plan-investigation.md.template +12 -6
  60. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-changelog.md.template +9 -8
  61. package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +279 -0
  62. package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +2828 -0
  63. package/dist/templates/{shared/claude-commands → .claude/commands/maintenance}/trinity-readme.md.template +21 -20
  64. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-decompose.md.template +6 -4
  65. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-design.md.template +6 -4
  66. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-plan.md.template +7 -5
  67. package/dist/templates/{shared/claude-commands → .claude/commands/planning}/trinity-requirements.md.template +6 -4
  68. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-continue.md.template +30 -24
  69. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-end.md.template +403 -397
  70. package/dist/templates/{shared/claude-commands → .claude/commands/session}/trinity-start.md.template +9 -4
  71. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-agents.md.template +11 -8
  72. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-verify.md.template +56 -57
  73. package/dist/templates/{shared/claude-commands → .claude/commands/utility}/trinity-workorder.md.template +13 -9
  74. package/dist/templates/ci/ci.yml.template +2 -2
  75. package/dist/templates/root/CLAUDE.md.template +9 -9
  76. package/dist/templates/root/linting/nodejs/.husky-pre-commit.template +5 -0
  77. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  78. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  79. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  80. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  81. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  82. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  83. package/dist/templates/trinity/CLAUDE.md.template +14 -14
  84. package/dist/templates/{knowledge-base → trinity/knowledge-base}/AI-DEVELOPMENT-GUIDE.md.template +1 -1
  85. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ARCHITECTURE.md.template +5 -5
  86. package/dist/templates/{knowledge-base → trinity/knowledge-base}/CODING-PRINCIPLES.md.template +1 -1
  87. package/dist/templates/{knowledge-base → trinity/knowledge-base}/DOCUMENTATION-CRITERIA.md.template +1 -1
  88. package/dist/templates/{knowledge-base → trinity/knowledge-base}/ISSUES.md.template +9 -9
  89. package/dist/templates/{knowledge-base → trinity/knowledge-base}/TESTING-PRINCIPLES.md.template +1 -1
  90. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Technical-Debt.md.template +2 -4
  91. package/dist/templates/{knowledge-base → trinity/knowledge-base}/To-do.md.template +2 -2
  92. package/dist/templates/{knowledge-base → trinity/knowledge-base}/Trinity.md.template +6 -6
  93. package/dist/templates/trinity/templates/documentation/api-docs/README.md.template +218 -0
  94. package/dist/templates/trinity/templates/documentation/configuration/documentation-structure.md.template +71 -0
  95. package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +387 -0
  96. package/dist/templates/trinity/templates/documentation/discovery/api-endpoint-scanner.md.template +343 -0
  97. package/dist/templates/trinity/templates/documentation/discovery/component-discovery.md.template +254 -0
  98. package/dist/templates/trinity/templates/documentation/discovery/env-variable-extraction.md.template +316 -0
  99. package/dist/templates/trinity/templates/documentation/discovery/framework-detection.md.template +205 -0
  100. package/dist/templates/trinity/templates/documentation/guides/api-development.md.template +375 -0
  101. package/dist/templates/trinity/templates/documentation/guides/contributing.md.template +488 -0
  102. package/dist/templates/trinity/templates/documentation/guides/deployment.md.template +565 -0
  103. package/dist/templates/trinity/templates/documentation/guides/getting-started.md.template +118 -0
  104. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/api-endpoint-map.md.template +56 -0
  105. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/component-hierarchy.md.template +60 -0
  106. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/database-er.md.template +49 -0
  107. package/dist/templates/trinity/templates/documentation/mermaid-diagrams/mvc-flow.md.template +41 -0
  108. package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +166 -0
  109. package/dist/templates/trinity/templates/documentation/processes/fallback-mechanism.md.template +88 -0
  110. package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +343 -0
  111. package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +1337 -0
  112. package/dist/templates/trinity/templates/documentation/reports/juno-final-report.md.template +237 -0
  113. package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +461 -0
  114. package/dist/templates/trinity/templates/documentation/validation/documentation-verification-rules.md.template +379 -0
  115. package/dist/templates/trinity/templates/documentation/validation/juno-quality-gates.md.template +282 -0
  116. package/dist/templates/{investigations → trinity/templates/investigations}/bug.md.template +14 -14
  117. package/dist/templates/{investigations → trinity/templates/investigations}/feature.md.template +14 -14
  118. package/dist/templates/{investigations → trinity/templates/investigations}/performance.md.template +14 -14
  119. package/dist/templates/{investigations → trinity/templates/investigations}/security.md.template +14 -14
  120. package/dist/templates/{investigations → trinity/templates/investigations}/technical.md.template +14 -14
  121. package/dist/templates/{work-orders → trinity/templates/work-orders}/ANALYSIS-TEMPLATE.md.template +10 -13
  122. package/dist/templates/{work-orders → trinity/templates/work-orders}/AUDIT-TEMPLATE.md.template +10 -26
  123. package/dist/templates/{work-orders → trinity/templates/work-orders}/IMPLEMENTATION-TEMPLATE.md.template +10 -26
  124. package/dist/templates/{work-orders → trinity/templates/work-orders}/INVESTIGATION-TEMPLATE.md.template +10 -25
  125. package/dist/templates/{work-orders → trinity/templates/work-orders}/PATTERN-TEMPLATE.md.template +10 -26
  126. package/dist/templates/{work-orders → trinity/templates/work-orders}/VERIFICATION-TEMPLATE.md.template +10 -26
  127. package/package.json +99 -94
  128. package/dist/templates/agents/leadership/aj-cc.md.template +0 -462
  129. package/dist/templates/ci/cd.yml.template +0 -175
  130. package/dist/templates/ci/github-actions.yml +0 -86
  131. package/dist/templates/root/TRINITY.md.template +0 -52
  132. package/dist/templates/shared/claude-commands/trinity-docs.md.template +0 -2577
  133. /package/dist/templates/{linting → root/linting}/flutter/.pre-commit-config.yaml.template +0 -0
  134. /package/dist/templates/{linting → root/linting}/flutter/analysis_options.yaml.template +0 -0
  135. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-commonjs.json.template +0 -0
  136. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-esm.json.template +0 -0
  137. /package/dist/templates/{linting → root/linting}/nodejs/.eslintrc-typescript.json.template +0 -0
  138. /package/dist/templates/{linting → root/linting}/nodejs/.pre-commit-config.yaml.template +0 -0
  139. /package/dist/templates/{linting → root/linting}/nodejs/.prettierrc.json.template +0 -0
  140. /package/dist/templates/{linting → root/linting}/python/.flake8.template +0 -0
  141. /package/dist/templates/{linting → root/linting}/python/.pre-commit-config.yaml.template +0 -0
  142. /package/dist/templates/{linting → root/linting}/python/pyproject.toml.template +0 -0
  143. /package/dist/templates/{linting → root/linting}/rust/.pre-commit-config.yaml.template +0 -0
  144. /package/dist/templates/{linting → root/linting}/rust/clippy.toml.template +0 -0
  145. /package/dist/templates/{linting → root/linting}/rust/rustfmt.toml.template +0 -0
  146. /package/dist/templates/{documentation → trinity/templates/documentation}/ROOT-README.md.template +0 -0
  147. /package/dist/templates/{documentation → trinity/templates/documentation}/SUBDIRECTORY-README.md.template +0 -0
package/README.md CHANGED
@@ -1,540 +1,550 @@
1
- # Trinity Method SDK
2
-
3
- [![npm version](https://img.shields.io/npm/v/trinity-method-sdk?color=success)](https://www.npmjs.com/package/trinity-method-sdk)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.9.0-brightgreen)](https://nodejs.org/)
6
- [![AI Agents](https://img.shields.io/badge/AI%20Agent-Claude%20Code-blue)](https://github.com/lukadfagundes/trinity-method-sdk)
7
-
8
- > Investigation-first development methodology for Claude Code
9
-
10
- ---
11
-
12
- ## Why Trinity Method Exists
13
-
14
- ### The Problem with Traditional AI-Assisted Development
15
-
16
- AI coding assistants are powerful, but without structure they become expensive guessing machines:
17
-
18
- **❌ Jump-to-Code Anti-Pattern:**
19
-
20
- - AI generates code without understanding the problem
21
- - No investigation phase → immediate implementation
22
- - Context lost between sessions → repeated mistakes
23
- - No institutional knowledge → every session starts from zero
24
- - Inconsistent quality → success depends on prompt luck
25
- - Manual quality setup → 50 minutes configuring linters per project
26
-
27
- **The Cost:**
28
-
29
- - Developers waste time debugging AI-generated code that solves the wrong problem
30
- - Teams lose hard-won lessons when developers leave
31
- - Technical debt accumulates invisibly
32
- - Code quality varies wildly across sessions
33
-
34
- ### Our Philosophy: Investigation-First Development
35
-
36
- Trinity Method rejects "prompt and pray" development. Instead, we enforce **systematic investigation before implementation**:
37
-
38
- **1. Investigation-First Principle**
39
-
40
- ```
41
- WRONG: "Build authentication" → AI generates code → Debug for hours
42
- RIGHT: "Investigate authentication requirements" → Understand problem → Design solution → Implement correctly
43
- ```
44
-
45
- **2. Evidence-Based Decisions**
46
- Every decision backed by documentation, codebase metrics, and historical patterns. No guessing.
47
-
48
- **3. Knowledge Preservation**
49
- Lessons learned persist across sessions through institutional memory. Agents get smarter over time.
50
-
51
- **4. Systematic Quality Assurance**
52
- Quality isn't aspirational—it's systematically enforced through automated gates (BAS 6-phase validation).
53
-
54
- ### The Trinity Transformation
55
-
56
- **✅ With Trinity Method:**
57
-
58
- - **Investigation before coding** → Understand the problem first
59
- - **Persistent knowledge base** → Learn from every session
60
- - **Automated quality enforcement** → BAS gates ensure standards
61
- - **19-agent team coordination** → Right specialist for each task
62
- - **Institutional memory** → Patterns, strategies, and lessons preserved
63
- - **90-second deployment** → Complete development environment instantly
64
-
65
- ---
66
-
67
- ## What is Trinity Method SDK?
68
-
69
- Trinity Method SDK is a **production-ready development methodology** that transforms AI-assisted coding from random generation into systematic engineering.
70
-
71
- ### Core Philosophy
72
-
73
- **Trinity Method enforces three pillars:**
74
-
75
- 1. **Investigation-First Development**
76
- - Systematic investigation using MON (Requirements), ROR (Design), TRA (Planning)
77
- - Evidence-based decisions backed by documentation and metrics
78
- - Scale-based workflows: SMALL (0 stop points) MEDIUM (2 stop points) LARGE (4 stop points)
79
-
80
- 2. **Knowledge Preservation**
81
- - Learning system captures patterns from every investigation
82
- - Cross-session persistence through filesystem storage
83
- - Agent knowledge sharing via pub/sub bus (≥0.8 confidence threshold)
84
-
85
- 3. **Systematic Quality Assurance**
86
- - BAS 6-phase quality gate: Lint → Structure → Build → Test → Coverage (≥80%) → Review
87
- - Crisis management system for 5 crisis types (build, test, error, performance, security)
88
- - Automated codebase metrics collection and technical debt tracking
89
-
90
- ### The 19-Agent Team
91
-
92
- Trinity SDK includes **19 specialized agents** (core team of 14 primary agents + 5 infrastructure agents):
93
-
94
- **Planning Layer:**
95
-
96
- - **MON** - Requirements Analyst (functional & non-functional requirements)
97
- - **ROR** - Design Architect (technical design, ADRs)
98
- - **TRA** - Work Planner (implementation sequencing, BAS integration)
99
- - **EUS** - Task Decomposer (atomic task breakdown)
100
-
101
- **Execution Layer:**
102
-
103
- - **KIL** - Task Executor (TDD implementation: RED → GREEN → REFACTOR)
104
- - **BAS** - Quality Gate (6-phase validation enforcer)
105
- - **DRA** - Code Reviewer (design doc compliance, quality escalation)
106
-
107
- **Support Layer:**
108
-
109
- - **APO** - Documentation Specialist (API docs, inline comments)
110
- - **BON** - Dependency Manager (package security, version management)
111
- - **CAP** - Configuration Specialist (env vars, config files)
112
- - **URO** - Refactoring Specialist (technical debt reduction)
113
-
114
- **Leadership & Audit:**
115
-
116
- - **ALY** - Chief Technology Officer (investigation orchestration, strategic coordination)
117
- - **JUNO** - Quality Auditor (comprehensive codebase audits, deployment verification)
118
-
119
- **Infrastructure (5 agents):**
120
-
121
- - **TAN** - Structure Specialist (directory structure validation)
122
- - **ZEN** - Knowledge Base Specialist (comprehensive documentation)
123
- - **INO** - Context Specialist (CLAUDE.md hierarchy management)
124
- - **EIN** - CI/CD Specialist (continuous integration/deployment automation)
125
- - **AJ MAESTRO** - Legacy Orchestrator (deprecated v1.0, replaced by ALY in v2.0)
126
-
127
- ### What Gets Deployed
128
-
129
- Trinity deploys **64 production-ready components** in 90 seconds:
130
-
131
- **Methodology Infrastructure:**
132
-
133
- - `trinity/knowledge-base/` - 9 living documentation files
134
- - ARCHITECTURE.md (codebase metrics, architecture documentation)
135
- - ISSUES.md (known issues and bug tracking)
136
- - To-do.md (task management and priorities)
137
- - Technical-Debt.md (technical debt tracking)
138
- - Trinity.md (project-specific Trinity guide)
139
- - TESTING-PRINCIPLES.md (testing standards)
140
- - CODING-PRINCIPLES.md (code quality standards)
141
- - DOCUMENTATION-CRITERIA.md (documentation standards)
142
- - AI-DEVELOPMENT-GUIDE.md (AI-assisted development best practices)
143
- - `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
147
- - `trinity/investigations/` - Active investigations with execution plans
148
- - `trinity/sessions/` - Session archives
149
- - `trinity/reports/` - Audit and integration reports
150
- - `trinity/work-orders/` - Active work orders
151
- - `trinity/patterns/` - Reusable patterns library
152
- - `trinity/archive/` - Archived sessions, reports, and investigations
153
-
154
- **Agent System:**
155
-
156
- - `.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
161
- - `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)
166
- - `planning/` - 4 commands (requirements, design, decompose, plan)
167
- - `session/` - 3 commands (start, continue, end)
168
- - `utility/` - 3 commands (verify, agents, workorder)
169
- - `.claude/EMPLOYEE-DIRECTORY.md` - Complete 19-agent team guide
170
-
171
- **Context Hierarchy:**
172
-
173
- - Root `CLAUDE.md` - Global project context
174
- - `trinity/CLAUDE.md` - Trinity Method enforcement
175
- - `src/CLAUDE.md` - Technology-specific rules
176
-
177
- **Quality Automation:**
178
-
179
- - Linting tools (ESLint, Prettier, Black, Flake8, Clippy, Rustfmt)
180
- - Pre-commit hooks (Python's pre-commit framework for ALL languages)
181
- - Automatic dependency injection to package.json/requirements.txt
182
- - Real codebase metrics: TODO counts, console statements, file complexity, git metrics
183
-
184
- ---
185
-
186
- ## How Trinity Works
187
-
188
- ### Installation
189
-
190
- **Option 1: Use npx (Recommended - No installation needed)**
191
-
192
- ```bash
193
- # Runs latest version without installing
194
- npx trinity-method-sdk deploy
195
- ```
196
-
197
- **Option 2: Global Installation**
198
-
199
- ```bash
200
- # Install once globally
201
- npm install -g trinity-method-sdk
202
-
203
- # Then use anywhere
204
- trinity deploy
205
- ```
206
-
207
- ### Quick Start (90 Seconds to Production)
208
-
209
- ```bash
210
- # Navigate to your project
211
- cd your-project
212
-
213
- # Deploy Trinity Method (using npx)
214
- npx trinity-method-sdk deploy
215
- ```
216
-
217
- **Interactive Wizard:**
218
-
219
- 1. **Stack Detection**: Automatically detects framework (Node.js, Python, Rust, Flutter, Go)
220
- 2. ✅ **Linting Setup**: Choose "Recommended" for one-click best practices
221
- 3. ✅ **Deploy**: 90-second deployment with full infrastructure
222
- 4. ✅ **Install Dependencies**: `npm install` (or `pip install -r requirements-dev.txt`)
223
- 5. ✅ **Setup Pre-commit**: `pip install pre-commit && pre-commit install`
224
-
225
- **Result:** Production-ready development environment with 19 agents, 20 slash commands, quality gates, and documentation.
226
-
227
- ### Available Commands
228
-
229
- ```bash
230
- # Deploy Trinity to your project
231
- npx trinity-method-sdk deploy
232
-
233
- # Update Trinity to latest version
234
- npx trinity-method-sdk update
235
- ```
236
-
237
- ### Using Trinity Method (Slash Commands)
238
-
239
- After deployment, access Trinity functionality through Claude Code slash commands:
240
-
241
- **Session Management:**
242
-
243
- - `/trinity-start` - Start workflow guide
244
- - `/trinity-continue` - Resume after interruption
245
- - `/trinity-end` - End session and archive
246
-
247
- **Planning:**
248
-
249
- - `/trinity-requirements` - Analyze requirements (MON)
250
- - `/trinity-design` - Create technical design (ROR)
251
- - `/trinity-decompose` - Break down tasks (EUS)
252
- - `/trinity-plan` - Create implementation plan (TRA)
253
-
254
- **Execution:**
255
-
256
- - `/trinity-orchestrate` - Execute with ALY orchestration
257
- - `/trinity-audit` - Run codebase audit (JUNO)
258
- - `/trinity-readme` - Update README coverage (APO)
259
- - `/trinity-docs` - Organize docs/ directory (APO)
260
- - `/trinity-changelog` - Maintain CHANGELOG.md (APO)
261
-
262
- **Investigation:**
263
-
264
- - `/trinity-create-investigation` - Create structured investigation
265
- - `/trinity-plan-investigation` - Generate investigation plan
266
- - `/trinity-investigate-templates` - View investigation templates
267
-
268
- **Utility:**
269
-
270
- - `/trinity-verify` - Verify Trinity deployment
271
- - `/trinity-agents` - View agent directory
272
- - `/trinity-workorder` - Create work orders
273
-
274
- ### Linting & Code Quality (85-90% Time Savings)
275
-
276
- **Before Trinity (Manual Setup): ~50 minutes per project**
277
-
278
- 1. Research tools for your framework
279
- 2. Install dependencies
280
- 3. Create configuration files
281
- 4. Configure pre-commit hooks
282
- 5. Test and debug configuration
283
-
284
- **With Trinity (Automated): ~6 minutes per project**
285
-
286
- 1. Select "Recommended" during deployment (30 seconds)
287
- 2. Run `npm install` (3-5 minutes)
288
- 3. Setup pre-commit: `pip install pre-commit && pre-commit install` (30 seconds)
289
-
290
- **Supported Frameworks:**
291
-
292
- - **Node.js/React**: ESLint + Prettier + Pre-commit
293
- - **Python**: Black + Flake8 + isort + Pre-commit
294
- - **Flutter**: Dart Analyzer + Pre-commit
295
- - **Rust**: Clippy + Rustfmt + Pre-commit
296
-
297
- ---
298
-
299
- ## Designed for Claude Code
300
-
301
- Trinity Method SDK is built exclusively for [Claude Code](https://claude.com/claude-code), Anthropic's AI pair programming environment.
302
-
303
- ### Why Claude Code?
304
-
305
- - **Deep Integration**: Trinity's 19-agent team leverages Claude Code's agent architecture
306
- - **Slash Commands**: Built-in `/trinity-*` commands for instant workflow access
307
- - **Hooks System**: Pre/post-action automation via Claude Code hooks
308
- - **Quality Focus**: Exceptional single-agent experience optimized for Claude
309
-
310
- ### Other AI Assistants?
311
-
312
- The Trinity Method **philosophy** is agent-agnostic, but this SDK is optimized for Claude Code's capabilities. Want to use Trinity with Cursor, Copilot, or others? We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md).
313
-
314
- ---
315
-
316
- ## Examples & Documentation
317
-
318
- ### Real-World Deployments
319
-
320
- ```bash
321
- # Node.js/Express API
322
- cd my-api && npx trinity-method-sdk deploy
323
- # Result: API with ESLint, Prettier, pre-commit, 19 agents, quality gates
324
-
325
- # Python/Django Project
326
- cd my-django && npx trinity-method-sdk deploy
327
- # Result: Django with Black, Flake8, isort, pre-commit, full Trinity infrastructure
328
-
329
- # Flutter Mobile App
330
- cd my-flutter-app && npx trinity-method-sdk deploy
331
- # Result: Flutter with Dart Analyzer, pre-commit, investigation templates
332
-
333
- # Rust CLI Tool
334
- cd my-rust-cli && npx trinity-method-sdk deploy
335
- # Result: Rust with Clippy, Rustfmt, pre-commit, crisis management
336
- ```
337
-
338
- ### Documentation
339
-
340
- After deploying Trinity to your project, comprehensive documentation is available in your project:
341
-
342
- **Trinity Knowledge Base:**
343
-
344
- - `trinity/knowledge-base/ARCHITECTURE.md` - System architecture with codebase metrics
345
- - `trinity/knowledge-base/ISSUES.md` - Known issues and bug tracking
346
- - `trinity/knowledge-base/To-do.md` - Task management and priorities
347
- - `trinity/knowledge-base/Technical-Debt.md` - Technical debt tracking
348
- - `trinity/knowledge-base/Trinity.md` - Project-specific Trinity guide
349
- - `trinity/knowledge-base/TESTING-PRINCIPLES.md` - Testing standards
350
- - `trinity/knowledge-base/CODING-PRINCIPLES.md` - Code quality standards
351
-
352
- **Agent System:**
353
-
354
- - `.claude/EMPLOYEE-DIRECTORY.md` - Complete agent reference and selection guide
355
- - `.claude/agents/` - 19 specialized agent markdown files
356
-
357
- **SDK Documentation:**
358
-
359
- - [API Documentation](docs/) - TypeDoc-generated API reference
360
- - [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup, workflow, and standards
361
- - [CHANGELOG.md](CHANGELOG.md) - Version history and release notes
362
-
363
- ### After Deployment
364
-
365
- Your project contains:
366
-
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
- - **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)
372
- - **Work order templates** in `trinity/templates/work-orders/`
373
- - **Session archives** in `trinity/sessions/`
374
- - **Audit reports** in `trinity/reports/`
375
- - **Linting tools** configured for your framework
376
-
377
- **Complete Deployed Structure:**
378
-
379
- ```
380
- your-project/
381
- ├── .claude/
382
- │ ├── 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
388
- │ ├── commands/
389
- │ │ ├── execution/ # trinity-orchestrate, trinity-audit, trinity-readme, trinity-docs, trinity-changelog
390
- │ │ ├── infrastructure/ # trinity-init
391
- │ │ ├── investigation/ # trinity-create-investigation, trinity-plan-investigation, trinity-investigate-templates
392
- │ │ ├── planning/ # trinity-requirements, trinity-design, trinity-decompose, trinity-plan
393
- │ │ ├── session/ # trinity-start, trinity-continue, trinity-end
394
- │ │ └── utility/ # trinity-verify, trinity-agents, trinity-workorder
395
- │ └── EMPLOYEE-DIRECTORY.md # 19-agent team guide
396
- ├── trinity/
397
- │ ├── knowledge-base/ # ARCHITECTURE.md, ISSUES.md, To-do.md, Technical-Debt.md, Trinity.md
398
- │ ├── templates/
399
- │ │ ├── documentation/ # Documentation templates
400
- │ │ ├── investigations/ # Bug, performance, security, system analysis, incident templates
401
- │ └── work-orders/ # Work order templates
402
- │ ├── investigations/ # Active investigations
403
- │ │ └── plans/ # Investigation execution plans
404
- │ ├── sessions/ # Session archives
405
- │ ├── reports/ # Audit and integration reports
406
- ├── work-orders/ # Active work orders
407
- │ ├── patterns/ # Reusable patterns library
408
- └── archive/ # Archived sessions, reports, investigations
409
- ├── CLAUDE.md # Root context file
410
- └── src/CLAUDE.md # Framework-specific context
411
- ```
412
-
413
- - **Pre-commit hooks** automatically enforcing quality standards
414
-
415
- ---
416
-
417
- ## Contributing
418
-
419
- Trinity Method SDK is open source and welcomes contributions!
420
-
421
- **Ways to Contribute:**
422
-
423
- - 🐛 Report bugs and issues
424
- - 💡 Suggest new features or agent improvements
425
- - 📝 Improve documentation
426
- - 🔧 Submit pull requests
427
- - Star the repository if you find it useful
428
-
429
- **Development Setup:**
430
-
431
- ```bash
432
- # Clone repository
433
- git clone https://github.com/lukadfagundes/trinity-method-sdk.git
434
- cd trinity-method-sdk
435
-
436
- # Install dependencies
437
- npm install
438
-
439
- # Build SDK
440
- npm run build
441
-
442
- # Test locally
443
- npm link
444
- trinity deploy
445
- ```
446
-
447
- See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
448
-
449
- ---
450
-
451
- ## Development & Publishing
452
-
453
- ### CI/CD Pipeline
454
-
455
- Trinity uses GitHub Actions for comprehensive continuous integration and deployment with BAS 6-phase quality gates.
456
-
457
- #### Continuous Integration (CI)
458
-
459
- **Automated Quality Checks on Every Push:**
460
-
461
- - Multi-platform testing (Ubuntu, Windows, macOS)
462
- - ✅ 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)
464
- - ✅ Test suite execution (unit, integration, e2e, performance)
465
- - ✅ Code coverage validation (80%+ threshold enforced)
466
- - Linting and type checking
467
- - ✅ Security scanning (npm audit, dependency checks)
468
- - ✅ Build verification with artifact validation
469
- - ✅ Documentation validation
470
-
471
- **BAS 6-Phase Quality Gates:**
472
-
473
- 1. **Phase 1**: Code Quality (Linting, type checking, formatting)
474
- 2. **Phase 2**: Structure Validation (Trinity template validation)
475
- 3. **Phase 3**: Build Validation (TypeScript compilation, artifact verification)
476
- 4. **Phase 4**: Testing (All test suites across platforms)
477
- 5. **Phase 5**: Coverage Check (≥80% threshold)
478
- 6. **Phase 6**: Documentation (API docs, README validation)
479
-
480
- **CI Workflow Location:** [.github/workflows/ci.yml](.github/workflows/ci.yml)
481
-
482
- #### Publishing to npm
483
-
484
- **Manual Publishing Workflow:**
485
-
486
- ```bash
487
- # 1. Update version and changelog
488
- npm version patch # or minor, major
489
-
490
- # 2. Build and publish
491
- npm run build
492
- npm publish --access public
493
-
494
- # 3. Create git tag and push
495
- git tag -a v2.0.9 -m "Release v2.0.9"
496
- git push origin main --follow-tags
497
- ```
498
-
499
- **Automated Checks Before Publishing:**
500
-
501
- The `prepublishOnly` script runs automatically before every publish:
502
-
503
- 1. TypeScript compilation (`npm run build`)
504
- 2. Template copying to dist/
505
- 3. Full test suite execution (`npm run test`)
506
- 4. Only publishes if all checks pass
507
-
508
- ---
509
-
510
- ## License
511
-
512
- MIT License - see [LICENSE](LICENSE) for details
513
-
514
- ---
515
-
516
- ## Links
517
-
518
- ### Project Resources
519
-
520
- - **npm Package**: [trinity-method-sdk](https://www.npmjs.com/package/trinity-method-sdk)
521
- - **GitHub**: [lukadfagundes/trinity-method-sdk](https://github.com/lukadfagundes/trinity-method-sdk)
522
- - **Issues**: [GitHub Issues](https://github.com/lukadfagundes/trinity-method-sdk/issues)
523
- - **Discussions**: [GitHub Discussions](https://github.com/lukadfagundes/trinity-method-sdk/discussions)
524
-
525
- ### Documentation
526
-
527
- - **API Documentation**: [docs/](docs/) - Generated TypeDoc API reference
528
- - **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
- - **Changelog**: [CHANGELOG.md](CHANGELOG.md) - Version history and release notes
535
-
536
- ---
537
-
538
- **Built with ❤️ by the Trinity Method Team**
539
-
540
- _Trinity Method: Investigation-first development for the AI age_
1
+ # Trinity Method SDK
2
+
3
+ [![npm version](https://img.shields.io/npm/v/trinity-method-sdk?color=success)](https://www.npmjs.com/package/trinity-method-sdk)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js Version](https://img.shields.io/badge/node-%3E%3D16.9.0-brightgreen)](https://nodejs.org/)
6
+ [![AI Agents](https://img.shields.io/badge/AI%20Agent-Claude%20Code-blue)](https://github.com/lukadfagundes/trinity-method-sdk)
7
+
8
+ > Investigation-first development methodology for Claude Code
9
+
10
+ ---
11
+
12
+ ## Why Trinity Method Exists
13
+
14
+ ### The Problem with Traditional AI-Assisted Development
15
+
16
+ AI coding assistants are powerful, but without structure they become expensive guessing machines:
17
+
18
+ **❌ Jump-to-Code Anti-Pattern:**
19
+
20
+ - AI generates code without understanding the problem
21
+ - No investigation phase → immediate implementation
22
+ - Context lost between sessions → repeated mistakes
23
+ - No institutional knowledge → every session starts from zero
24
+ - Inconsistent quality → success depends on prompt luck
25
+ - Manual quality setup → 50 minutes configuring linters per project
26
+
27
+ **The Cost:**
28
+
29
+ - Developers waste time debugging AI-generated code that solves the wrong problem
30
+ - Teams lose hard-won lessons when developers leave
31
+ - Technical debt accumulates invisibly
32
+ - Code quality varies wildly across sessions
33
+
34
+ ### Our Philosophy: Investigation-First Development
35
+
36
+ Trinity Method rejects "prompt and pray" development. Instead, we enforce **systematic investigation before implementation**:
37
+
38
+ #### 1. Investigation-First Principle
39
+
40
+ ```text
41
+ WRONG: "Build authentication" → AI generates code → Debug for hours
42
+ RIGHT: "Investigate authentication requirements" → Understand problem → Design solution → Implement correctly
43
+ ```
44
+
45
+ #### 2. Evidence-Based Decisions
46
+
47
+ Every decision backed by documentation, codebase metrics, and historical patterns. No guessing.
48
+
49
+ **3. Knowledge Preservation**
50
+ Lessons learned persist across sessions through institutional memory. Agents get smarter over time.
51
+
52
+ **4. Systematic Quality Assurance**
53
+ Quality isn't aspirational—it's systematically enforced through automated gates (BAS 6-phase validation).
54
+
55
+ ### The Trinity Transformation
56
+
57
+ **✅ With Trinity Method:**
58
+
59
+ - **Investigation before coding** → Understand the problem first
60
+ - **Persistent knowledge base** → Learn from every session
61
+ - **Automated quality enforcement** → BAS gates ensure standards
62
+ - **18-agent team coordination** → Right specialist for each task
63
+ - **Institutional memory** → Patterns, strategies, and lessons preserved
64
+ - **90-second deployment** → Complete development environment instantly
65
+
66
+ ---
67
+
68
+ ## What is Trinity Method SDK
69
+
70
+ Trinity Method SDK is a **production-ready development methodology** that transforms AI-assisted coding
71
+ from random generation into systematic engineering.
72
+
73
+ ### Core Philosophy
74
+
75
+ **Trinity Method enforces three pillars:**
76
+
77
+ 1. **Investigation-First Development**
78
+ - Systematic investigation using MON (Requirements), ROR (Design), TRA (Planning)
79
+ - Evidence-based decisions backed by documentation and metrics
80
+ - Scale-based workflows: SMALL (0 stop points) → MEDIUM (2 stop points) → LARGE (4 stop points)
81
+
82
+ 2. **Knowledge Preservation**
83
+ - Learning system captures patterns from every investigation
84
+ - Cross-session persistence through filesystem storage
85
+ - Agent knowledge sharing via pub/sub bus (≥0.8 confidence threshold)
86
+
87
+ 3. **Systematic Quality Assurance**
88
+ - BAS 6-phase quality gate: Lint Structure → Build → Test → Coverage (≥80%) → Review
89
+ - Crisis management system for 5 crisis types (build, test, error, performance, security)
90
+ - Automated codebase metrics collection and technical debt tracking
91
+
92
+ ### The 18-Agent Team
93
+
94
+ Trinity SDK includes **18 specialized agents** organized across 5 functional teams:
95
+
96
+ **Planning Layer:**
97
+
98
+ - **MON** - Requirements Analyst (functional & non-functional requirements)
99
+ - **ROR** - Design Architect (technical design, ADRs)
100
+ - **TRA** - Work Planner (implementation sequencing, BAS integration)
101
+ - **EUS** - Task Decomposer (atomic task breakdown)
102
+
103
+ **Execution Layer:**
104
+
105
+ - **KIL** - Task Executor (TDD implementation: RED GREEN → REFACTOR)
106
+ - **BAS** - Quality Gate (6-phase validation enforcer)
107
+ - **DRA** - Code Reviewer (design doc compliance, quality escalation)
108
+
109
+ **Support Layer:**
110
+
111
+ - **APO** - Documentation Specialist (API docs, inline comments)
112
+ - **BON** - Dependency Manager (package security, version management)
113
+ - **CAP** - Configuration Specialist (env vars, config files)
114
+ - **URO** - Refactoring Specialist (technical debt reduction)
115
+
116
+ **Leadership:**
117
+
118
+ - **ALY** - Chief Technology Officer (investigation orchestration, strategic coordination)
119
+ - **AJ MAESTRO** - Orchestrator (multi-agent workflow orchestration, task delegation)
120
+
121
+ **Deployment:**
122
+
123
+ - **TAN** - Structure Specialist (directory structure validation)
124
+ - **ZEN** - Knowledge Base Specialist (comprehensive documentation)
125
+ - **INO** - Context Specialist (CLAUDE.md hierarchy management)
126
+ - **EIN** - CI/CD Specialist (continuous integration/deployment automation)
127
+
128
+ **Audit:**
129
+
130
+ - **JUNO** - Quality Auditor (comprehensive codebase audits, deployment verification)
131
+
132
+ ### What Gets Deployed
133
+
134
+ Trinity deploys **88 production-ready components** in 90 seconds:
135
+
136
+ **Methodology Infrastructure:**
137
+
138
+ - `.claude/trinity/knowledge-base/` - 9 living documentation files
139
+ - ARCHITECTURE.md (codebase metrics, architecture documentation)
140
+ - ISSUES.md (known issues and bug tracking)
141
+ - To-do.md (task management and priorities)
142
+ - Technical-Debt.md (technical debt tracking)
143
+ - Trinity.md (project-specific Trinity guide)
144
+ - TESTING-PRINCIPLES.md (testing standards)
145
+ - CODING-PRINCIPLES.md (code quality standards)
146
+ - DOCUMENTATION-CRITERIA.md (documentation standards)
147
+ - AI-DEVELOPMENT-GUIDE.md (AI-assisted development best practices)
148
+ - `.claude/trinity/templates/` - Reusable templates
149
+ - `documentation/` - Documentation templates (2 README templates + 23 report templates)
150
+ - `investigations/` - 5 investigation templates (bug, feature, performance, security, technical)
151
+ - `work-orders/` - 6 work order templates
152
+ - `.claude/trinity/investigations/` - Active investigations with execution plans
153
+ - `.claude/trinity/sessions/` - Session archives
154
+ - `.claude/trinity/reports/` - Audit and integration reports
155
+ - `.claude/trinity/work-orders/` - Active work orders
156
+ - `.claude/trinity/archive/` - Archived sessions, reports, and investigations
157
+
158
+ **Agent System:**
159
+
160
+ - `.claude/agents/` - 18 specialized agents organized by category:
161
+ - `aj-team/` - 7 execution agents (APO, BAS, BON, CAP, DRA, KIL, URO)
162
+ - `audit/` - 1 quality auditor (JUNO)
163
+ - `deployment/` - 4 infrastructure agents (EIN, INO, TAN, ZEN)
164
+ - `leadership/` - 2 orchestration agents (ALY, AJ MAESTRO)
165
+ - `planning/` - 4 planning agents (MON, ROR, EUS, TRA)
166
+ - `.claude/commands/` - 21 slash commands organized in 7 categories:
167
+ - `execution/` - 3 commands (orchestrate, audit, breakdown)
168
+ - `infrastructure/` - 1 command (init)
169
+ - `investigation/` - 3 commands (create-investigation, plan-investigation, investigate-templates)
170
+ - `maintenance/` - 4 commands (readme, docs, docs-update, changelog)
171
+ - `planning/` - 4 commands (requirements, design, decompose, plan)
172
+ - `session/` - 3 commands (start, continue, end)
173
+ - `utility/` - 3 commands (verify, agents, workorder)
174
+ - `.claude/EMPLOYEE-DIRECTORY.md` - Complete 18-agent team guide
175
+
176
+ **Context Hierarchy:**
177
+
178
+ - Root `CLAUDE.md` - Global project context
179
+ - `.claude/trinity/CLAUDE.md` - Trinity Method enforcement
180
+ - `src/CLAUDE.md` - Technology-specific rules
181
+
182
+ **Quality Automation:**
183
+
184
+ - Linting tools (ESLint, Prettier, Black, Flake8, Clippy, Rustfmt)
185
+ - Pre-commit hooks (Husky + lint-staged for Node.js; Python's pre-commit framework for Python, Flutter, Rust)
186
+ - Automatic dependency injection to package.json/requirements.txt
187
+ - Real codebase metrics: TODO counts, console statements, file complexity, git metrics
188
+
189
+ ---
190
+
191
+ ## How Trinity Works
192
+
193
+ ### Installation
194
+
195
+ #### Option 1: Use npx (Recommended - No installation needed)
196
+
197
+ ```bash
198
+ # Runs latest version without installing
199
+ npx trinity-method-sdk deploy
200
+ ```
201
+
202
+ #### Option 2: Global Installation
203
+
204
+ ```bash
205
+ # Install once globally
206
+ npm install -g trinity-method-sdk
207
+
208
+ # Then use anywhere
209
+ trinity deploy
210
+ ```
211
+
212
+ ### Quick Start (90 Seconds to Production)
213
+
214
+ ```bash
215
+ # Navigate to your project
216
+ cd your-project
217
+
218
+ # Deploy Trinity Method (using npx)
219
+ npx trinity-method-sdk deploy
220
+ ```
221
+
222
+ **Interactive Wizard:**
223
+
224
+ 1. ✅ **Stack Detection**: Automatically detects framework (Node.js, Python, Rust, Flutter, Go)
225
+ 2. **Linting Setup**: Choose "Recommended" for one-click best practices
226
+ 3. ✅ **Deploy**: 90-second deployment with full infrastructure
227
+ 4. **Install Dependencies**: `npm install` (or `pip install -r requirements-dev.txt`)
228
+ 5. ✅ **Setup Hooks**: Automatic for Node.js (Husky via `npm install`);
229
+ for Python/Flutter/Rust: `pip install pre-commit && pre-commit install`
230
+
231
+ **Result:** Production-ready development environment with 18 agents, 21 slash commands, quality gates, and documentation.
232
+
233
+ ### Available Commands
234
+
235
+ ```bash
236
+ # Deploy Trinity to your project
237
+ npx trinity-method-sdk deploy
238
+
239
+ # Update Trinity to latest version
240
+ npx trinity-method-sdk update
241
+ ```
242
+
243
+ ### Using Trinity Method (Slash Commands)
244
+
245
+ After deployment, access Trinity functionality through Claude Code slash commands:
246
+
247
+ **Session Management:**
248
+
249
+ - `/trinity-start` - Start workflow guide
250
+ - `/trinity-continue` - Resume after interruption
251
+ - `/trinity-end` - End session and archive
252
+
253
+ **Planning:**
254
+
255
+ - `/trinity-requirements` - Analyze requirements (MON)
256
+ - `/trinity-design` - Create technical design (ROR)
257
+ - `/trinity-decompose` - Break down tasks (EUS)
258
+ - `/trinity-plan` - Create implementation plan (TRA)
259
+
260
+ **Execution:**
261
+
262
+ - `/trinity-orchestrate` - Execute with ALY orchestration
263
+ - `/trinity-audit` - Run codebase audit (JUNO)
264
+ - `/trinity-breakdown` - Guided step-by-step implementation walkthrough
265
+
266
+ **Maintenance:**
267
+
268
+ - `/trinity-readme` - Update README coverage (APO)
269
+ - `/trinity-docs` - Generate new documentation (JUNO + 3 parallel APOs)
270
+ - `/trinity-docs-update` - Update existing documentation (JUNO audit → 3 APOs → verification loop)
271
+ - `/trinity-changelog` - Maintain CHANGELOG.md (APO)
272
+
273
+ **Investigation:**
274
+
275
+ - `/trinity-create-investigation` - Create structured investigation
276
+ - `/trinity-plan-investigation` - Generate investigation plan
277
+ - `/trinity-investigate-templates` - View investigation templates
278
+
279
+ **Infrastructure:**
280
+
281
+ - `/trinity-init` - Initialize Trinity configuration
282
+
283
+ **Utility:**
284
+
285
+ - `/trinity-verify` - Verify Trinity deployment
286
+ - `/trinity-agents` - View agent directory
287
+ - `/trinity-workorder` - Create work orders
288
+
289
+ ### Linting & Code Quality (85-90% Time Savings)
290
+
291
+ #### Before Trinity (Manual Setup): ~50 minutes per project
292
+
293
+ 1. Research tools for your framework
294
+ 2. Install dependencies
295
+ 3. Create configuration files
296
+ 4. Configure pre-commit hooks
297
+ 5. Test and debug configuration
298
+
299
+ #### With Trinity (Automated): ~6 minutes per project
300
+
301
+ 1. Select "Recommended" during deployment (30 seconds)
302
+ 2. Run `npm install` (3-5 minutes, automatically sets up Husky hooks for Node.js)
303
+ 3. For Python/Flutter/Rust only: `pip install pre-commit && pre-commit install` (30 seconds)
304
+
305
+ **Supported Frameworks:**
306
+
307
+ - **Node.js/React**: ESLint + Prettier + Husky + lint-staged
308
+ - **Python**: Black + Flake8 + isort + Pre-commit
309
+ - **Flutter**: Dart Analyzer + Pre-commit
310
+ - **Rust**: Clippy + Rustfmt + Pre-commit
311
+
312
+ ---
313
+
314
+ ## Designed for Claude Code
315
+
316
+ Trinity Method SDK is built exclusively for
317
+ [Claude Code](https://claude.com/claude-code), Anthropic's AI pair programming environment.
318
+
319
+ ### Why Claude Code
320
+
321
+ - **Deep Integration**: Trinity's 18-agent team leverages Claude Code's agent architecture
322
+ - **Slash Commands**: Built-in `/trinity-*` commands for instant workflow access
323
+ - **Context System**: Layered CLAUDE.md hierarchy for persistent project knowledge
324
+ - **Quality Focus**: Exceptional single-agent experience optimized for Claude
325
+
326
+ ### Other AI Assistants
327
+
328
+ The Trinity Method **philosophy** is agent-agnostic, but this SDK is optimized for Claude Code's
329
+ capabilities. Want to use Trinity with Cursor, Copilot, or others? We welcome contributions!
330
+ See [CONTRIBUTING.md](./CONTRIBUTING.md).
331
+
332
+ ---
333
+
334
+ ## Examples & Documentation
335
+
336
+ ### Real-World Deployments
337
+
338
+ ```bash
339
+ # Node.js/Express API
340
+ cd my-api && npx trinity-method-sdk deploy
341
+ # Result: API with ESLint, Prettier, Husky, 18 agents, quality gates
342
+
343
+ # Python/Django Project
344
+ cd my-django && npx trinity-method-sdk deploy
345
+ # Result: Django with Black, Flake8, isort, pre-commit, full Trinity infrastructure
346
+
347
+ # Flutter Mobile App
348
+ cd my-flutter-app && npx trinity-method-sdk deploy
349
+ # Result: Flutter with Dart Analyzer, pre-commit, investigation templates
350
+
351
+ # Rust CLI Tool
352
+ cd my-rust-cli && npx trinity-method-sdk deploy
353
+ # Result: Rust with Clippy, Rustfmt, pre-commit, crisis management
354
+ ```
355
+
356
+ ### Documentation
357
+
358
+ After deploying Trinity to your project, comprehensive documentation is available in your project:
359
+
360
+ **Trinity Knowledge Base:**
361
+
362
+ - `.claude/trinity/knowledge-base/ARCHITECTURE.md` - System architecture with codebase metrics
363
+ - `.claude/trinity/knowledge-base/ISSUES.md` - Known issues and bug tracking
364
+ - `.claude/trinity/knowledge-base/To-do.md` - Task management and priorities
365
+ - `.claude/trinity/knowledge-base/Technical-Debt.md` - Technical debt tracking
366
+ - `.claude/trinity/knowledge-base/Trinity.md` - Project-specific Trinity guide
367
+ - `.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md` - Testing standards
368
+ - `.claude/trinity/knowledge-base/CODING-PRINCIPLES.md` - Code quality standards
369
+
370
+ **Agent System:**
371
+
372
+ - `.claude/EMPLOYEE-DIRECTORY.md` - Complete agent reference and selection guide
373
+ - `.claude/agents/` - 18 specialized agent markdown files
374
+
375
+ **SDK Documentation:**
376
+
377
+ - [API Documentation](docs/) - TypeDoc-generated API reference
378
+ - [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup, workflow, and standards
379
+ - [CHANGELOG.md](CHANGELOG.md) - Version history and release notes
380
+
381
+ ### After Deployment
382
+
383
+ Your project contains:
384
+
385
+ - **88 production-ready components** deployed in 90 seconds
386
+ - **18 specialized agents** in `.claude/agents/` (7 execution + 1 audit + 4 deployment + 2 leadership + 4 planning)
387
+ - **21 slash commands** in `.claude/commands/`
388
+ (3 execution + 1 infrastructure + 3 investigation + 4 maintenance + 4 planning + 3 session + 3 utility)
389
+ - **Complete knowledge base** in `.claude/trinity/knowledge-base/` (ARCHITECTURE.md, ISSUES.md, To-do.md, Technical-Debt.md)
390
+ - **Investigation templates** in `.claude/trinity/templates/investigations/` (bug, feature, performance, security, technical)
391
+ - **Work order templates** in `.claude/trinity/templates/work-orders/`
392
+ - **Session archives** in `.claude/trinity/sessions/`
393
+ - **Audit reports** in `.claude/trinity/reports/`
394
+ - **Linting tools** configured for your framework
395
+
396
+ **Complete Deployed Structure:**
397
+
398
+ ```text
399
+ your-project/
400
+ ├── .claude/
401
+ ├── agents/
402
+ ├── aj-team/ # 7 execution agents (APO, BAS, BON, CAP, DRA, KIL, URO)
403
+ │ │ ├── audit/ # 1 quality auditor (JUNO)
404
+ ├── deployment/ # 4 infrastructure agents (EIN, INO, TAN, ZEN)
405
+ ├── leadership/ # 2 orchestration agents (ALY, AJ MAESTRO)
406
+ │ └── planning/ # 4 planning agents (MON, ROR, EUS, TRA)
407
+ │ ├── commands/
408
+ │ ├── execution/ # trinity-orchestrate, trinity-audit, trinity-breakdown
409
+ │ │ ├── infrastructure/ # trinity-init
410
+ │ │ ├── investigation/ # trinity-create-investigation, trinity-plan-investigation, trinity-investigate-templates
411
+ │ │ ├── maintenance/ # trinity-readme, trinity-docs, trinity-docs-update, trinity-changelog
412
+ │ │ ├── planning/ # trinity-requirements, trinity-design, trinity-decompose, trinity-plan
413
+ │ │ ├── session/ # trinity-start, trinity-continue, trinity-end
414
+ │ │ └── utility/ # trinity-verify, trinity-agents, trinity-workorder
415
+ │ ├── trinity/
416
+ │ │ ├── knowledge-base/ # ARCHITECTURE.md, ISSUES.md, To-do.md, Technical-Debt.md, Trinity.md
417
+ │ │ ├── templates/
418
+ │ │ │ ├── documentation/ # 2 README templates + 23 report templates
419
+ │ │ │ ├── investigations/ # 5 investigation templates (bug, feature, performance, security, technical)
420
+ │ │ │ └── work-orders/ # 6 work order templates
421
+ │ │ ├── investigations/ # Active investigations
422
+ │ │ │ └── plans/ # Investigation execution plans
423
+ │ │ ├── sessions/ # Session archives
424
+ │ │ ├── reports/ # Audit and integration reports
425
+ │ │ ├── work-orders/ # Active work orders
426
+ │ │ └── archive/ # Archived sessions, reports, investigations
427
+ │ └── EMPLOYEE-DIRECTORY.md # 18-agent team guide
428
+ ├── CLAUDE.md # Root context file
429
+ └── src/CLAUDE.md # Framework-specific context
430
+ ```
431
+
432
+ - **Pre-commit hooks** automatically enforcing quality standards
433
+
434
+ ---
435
+
436
+ ## Contributing
437
+
438
+ Trinity Method SDK is open source and welcomes contributions!
439
+
440
+ **Ways to Contribute:**
441
+
442
+ - 🐛 Report bugs and issues
443
+ - 💡 Suggest new features or agent improvements
444
+ - 📝 Improve documentation
445
+ - 🔧 Submit pull requests
446
+ - ⭐ Star the repository if you find it useful
447
+
448
+ **Development Setup:**
449
+
450
+ ```bash
451
+ # Clone repository
452
+ git clone https://github.com/lukadfagundes/trinity-method-sdk.git
453
+ cd trinity-method-sdk
454
+
455
+ # Install dependencies
456
+ npm install
457
+
458
+ # Build SDK
459
+ npm run build
460
+
461
+ # Test locally
462
+ npm link
463
+ trinity deploy
464
+ ```
465
+
466
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
467
+
468
+ ---
469
+
470
+ ## Development & Publishing
471
+
472
+ ### CI/CD Pipeline
473
+
474
+ Trinity uses GitHub Actions for comprehensive continuous integration and deployment with BAS 6-phase quality gates.
475
+
476
+ #### Continuous Integration (CI)
477
+
478
+ **Automated Quality Checks on Every Push:**
479
+
480
+ - Multi-platform testing (Ubuntu, Windows, macOS)
481
+ - ✅ Multi-version testing (Node.js 18.x, 20.x, 22.x)
482
+ - Trinity component validation (18 agents, 21 slash commands, knowledge base, CI/CD templates)
483
+ - ✅ Test suite execution (unit, integration, e2e, performance)
484
+ - Code coverage validation (80%+ threshold enforced)
485
+ - ✅ Linting and type checking
486
+ - ✅ Security scanning (npm audit, dependency checks)
487
+ - Build verification with artifact validation
488
+ - Documentation validation
489
+
490
+ **BAS 6-Phase Quality Gates:**
491
+
492
+ 1. **Phase 1**: Code Quality (Linting, type checking, formatting)
493
+ 2. **Phase 2**: Structure Validation (Trinity template validation)
494
+ 3. **Phase 3**: Build Validation (TypeScript compilation, artifact verification)
495
+ 4. **Phase 4**: Testing (All test suites across platforms)
496
+ 5. **Phase 5**: Coverage Check (≥80% threshold)
497
+ 6. **Phase 6**: Documentation (API docs, README validation)
498
+
499
+ **CI Workflow Location:** [.github/workflows/ci.yml](.github/workflows/ci.yml)
500
+
501
+ #### Publishing to npm
502
+
503
+ **Manual Publishing Workflow:**
504
+
505
+ ```bash
506
+ # 1. Update version and changelog
507
+ npm version patch # or minor, major
508
+
509
+ # 2. Build and publish
510
+ npm run build
511
+ npm publish --access public
512
+
513
+ # 3. Create git tag and push
514
+ git tag -a vX.Y.Z -m "Release vX.Y.Z"
515
+ git push origin main --follow-tags
516
+ ```
517
+
518
+ **Automated Checks Before Publishing:**
519
+
520
+ The `prepublishOnly` script runs automatically before every publish:
521
+
522
+ 1. TypeScript compilation (`npm run build`)
523
+ 2. Template copying to dist/
524
+ 3. Full test suite execution (`npm run test`)
525
+ 4. Only publishes if all checks pass
526
+
527
+ ---
528
+
529
+ ## License
530
+
531
+ MIT License - see [LICENSE](LICENSE) for details
532
+
533
+ ---
534
+
535
+ ## Links
536
+
537
+ ### Project Resources
538
+
539
+ - **npm Package**: [trinity-method-sdk](https://www.npmjs.com/package/trinity-method-sdk)
540
+ - **GitHub**: [lukadfagundes/trinity-method-sdk](https://github.com/lukadfagundes/trinity-method-sdk)
541
+ - **Issues**: [GitHub Issues](https://github.com/lukadfagundes/trinity-method-sdk/issues)
542
+ - **Discussions**: [GitHub Discussions](https://github.com/lukadfagundes/trinity-method-sdk/discussions)
543
+
544
+ ### Documentation
545
+
546
+ - **API Documentation**: [docs/](docs/) - Generated TypeDoc API reference
547
+ - **Contributing Guide**: [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup, workflow, and standards
548
+ - **Changelog**: [CHANGELOG.md](CHANGELOG.md) - Version history and release notes
549
+
550
+ ---