trinity-method-sdk 2.0.7 → 2.0.9

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 (53) hide show
  1. package/CHANGELOG.md +267 -218
  2. package/README.md +540 -540
  3. package/dist/cli/commands/deploy/index.js +1 -1
  4. package/dist/cli/commands/deploy/root-files.js +1 -1
  5. package/dist/cli/commands/deploy/sdk-install.js +1 -1
  6. package/dist/cli/commands/update/index.js +4 -1
  7. package/dist/cli/index.js +1 -0
  8. package/dist/cli/types.d.ts +1 -0
  9. package/dist/cli/utils/detect-stack.js +6 -0
  10. package/dist/cli/utils/template-processor.js +1 -1
  11. package/dist/templates/agents/aj-team/apo-documentation-specialist.md.template +2 -2
  12. package/dist/templates/agents/aj-team/bas-quality-gate.md.template +3 -3
  13. package/dist/templates/agents/aj-team/bon-dependency-manager.md.template +636 -636
  14. package/dist/templates/agents/aj-team/cap-configuration-specialist.md.template +2 -2
  15. package/dist/templates/agents/aj-team/dra-code-reviewer.md.template +2 -2
  16. package/dist/templates/agents/aj-team/kil-task-executor.md.template +2 -2
  17. package/dist/templates/agents/aj-team/uro-refactoring-specialist.md.template +2 -2
  18. package/dist/templates/agents/audit/juno-auditor.md.template +1 -1
  19. package/dist/templates/agents/deployment/ein-cicd.md.template +3 -2
  20. package/dist/templates/agents/deployment/ino-context.md.template +3 -3
  21. package/dist/templates/agents/deployment/tan-structure.md.template +1 -1
  22. package/dist/templates/agents/deployment/zen-knowledge.md.template +5 -5
  23. package/dist/templates/agents/leadership/aj-cc.md.template +2 -2
  24. package/dist/templates/claude/EMPLOYEE-DIRECTORY.md.template +1 -1
  25. package/dist/templates/documentation/SUBDIRECTORY-README.md.template +1 -1
  26. package/dist/templates/investigations/bug.md.template +2 -2
  27. package/dist/templates/investigations/feature.md.template +2 -2
  28. package/dist/templates/investigations/performance.md.template +2 -2
  29. package/dist/templates/investigations/security.md.template +2 -2
  30. package/dist/templates/investigations/technical.md.template +2 -2
  31. package/dist/templates/knowledge-base/AI-DEVELOPMENT-GUIDE.md.template +1 -1
  32. package/dist/templates/knowledge-base/ARCHITECTURE.md.template +2 -2
  33. package/dist/templates/knowledge-base/CODING-PRINCIPLES.md.template +1 -1
  34. package/dist/templates/knowledge-base/DOCUMENTATION-CRITERIA.md.template +1 -1
  35. package/dist/templates/knowledge-base/ISSUES.md.template +2 -2
  36. package/dist/templates/knowledge-base/TESTING-PRINCIPLES.md.template +1 -1
  37. package/dist/templates/knowledge-base/Technical-Debt.md.template +2 -2
  38. package/dist/templates/knowledge-base/To-do.md.template +2 -2
  39. package/dist/templates/knowledge-base/Trinity.md.template +4 -3
  40. package/dist/templates/root/TRINITY.md.template +1 -1
  41. package/dist/templates/shared/claude-commands/trinity-changelog.md.template +2 -2
  42. package/dist/templates/shared/claude-commands/trinity-continue.md.template +1 -1
  43. package/dist/templates/shared/claude-commands/trinity-docs.md.template +376 -7
  44. package/dist/templates/shared/claude-commands/trinity-end.md.template +397 -397
  45. package/dist/templates/shared/claude-commands/trinity-readme.md.template +141 -33
  46. package/dist/templates/shared/claude-commands/trinity-verify.md.template +1 -1
  47. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  48. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  49. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  50. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  51. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  52. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  53. package/package.json +94 -94
package/README.md CHANGED
@@ -1,540 +1,540 @@
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.7 -m "Release v2.0.7"
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
+ ```
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_