trinity-method-sdk 2.0.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 (191) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/LICENSE +21 -0
  3. package/README.md +555 -0
  4. package/dist/cli/commands/deploy/agents.d.ts +14 -0
  5. package/dist/cli/commands/deploy/agents.js +59 -0
  6. package/dist/cli/commands/deploy/ci-cd.d.ts +13 -0
  7. package/dist/cli/commands/deploy/ci-cd.js +50 -0
  8. package/dist/cli/commands/deploy/claude-setup.d.ts +17 -0
  9. package/dist/cli/commands/deploy/claude-setup.js +91 -0
  10. package/dist/cli/commands/deploy/configuration.d.ts +13 -0
  11. package/dist/cli/commands/deploy/configuration.js +215 -0
  12. package/dist/cli/commands/deploy/directories.d.ts +12 -0
  13. package/dist/cli/commands/deploy/directories.js +38 -0
  14. package/dist/cli/commands/deploy/gitignore.d.ts +12 -0
  15. package/dist/cli/commands/deploy/gitignore.js +53 -0
  16. package/dist/cli/commands/deploy/index.d.ts +38 -0
  17. package/dist/cli/commands/deploy/index.js +156 -0
  18. package/dist/cli/commands/deploy/knowledge-base.d.ts +16 -0
  19. package/dist/cli/commands/deploy/knowledge-base.js +75 -0
  20. package/dist/cli/commands/deploy/linting.d.ts +18 -0
  21. package/dist/cli/commands/deploy/linting.js +51 -0
  22. package/dist/cli/commands/deploy/metrics.d.ts +13 -0
  23. package/dist/cli/commands/deploy/metrics.js +34 -0
  24. package/dist/cli/commands/deploy/pre-flight.d.ts +13 -0
  25. package/dist/cli/commands/deploy/pre-flight.js +29 -0
  26. package/dist/cli/commands/deploy/root-files.d.ts +16 -0
  27. package/dist/cli/commands/deploy/root-files.js +178 -0
  28. package/dist/cli/commands/deploy/sdk-install.d.ts +12 -0
  29. package/dist/cli/commands/deploy/sdk-install.js +57 -0
  30. package/dist/cli/commands/deploy/summary.d.ts +14 -0
  31. package/dist/cli/commands/deploy/summary.js +130 -0
  32. package/dist/cli/commands/deploy/templates.d.ts +14 -0
  33. package/dist/cli/commands/deploy/templates.js +84 -0
  34. package/dist/cli/commands/deploy/types.d.ts +39 -0
  35. package/dist/cli/commands/deploy/types.js +5 -0
  36. package/dist/cli/commands/update/agents.d.ts +14 -0
  37. package/dist/cli/commands/update/agents.js +31 -0
  38. package/dist/cli/commands/update/backup.d.ts +31 -0
  39. package/dist/cli/commands/update/backup.js +97 -0
  40. package/dist/cli/commands/update/commands.d.ts +14 -0
  41. package/dist/cli/commands/update/commands.js +75 -0
  42. package/dist/cli/commands/update/index.d.ts +15 -0
  43. package/dist/cli/commands/update/index.js +118 -0
  44. package/dist/cli/commands/update/knowledge-base.d.ts +14 -0
  45. package/dist/cli/commands/update/knowledge-base.js +38 -0
  46. package/dist/cli/commands/update/pre-flight.d.ts +13 -0
  47. package/dist/cli/commands/update/pre-flight.js +37 -0
  48. package/dist/cli/commands/update/summary.d.ts +20 -0
  49. package/dist/cli/commands/update/summary.js +47 -0
  50. package/dist/cli/commands/update/templates.d.ts +14 -0
  51. package/dist/cli/commands/update/templates.js +25 -0
  52. package/dist/cli/commands/update/types.d.ts +13 -0
  53. package/dist/cli/commands/update/types.js +7 -0
  54. package/dist/cli/commands/update/utils.d.ts +11 -0
  55. package/dist/cli/commands/update/utils.js +19 -0
  56. package/dist/cli/commands/update/verification.d.ts +20 -0
  57. package/dist/cli/commands/update/verification.js +54 -0
  58. package/dist/cli/commands/update/version.d.ts +18 -0
  59. package/dist/cli/commands/update/version.js +36 -0
  60. package/dist/cli/commands/update.d.ts +7 -0
  61. package/dist/cli/commands/update.js +7 -0
  62. package/dist/cli/index.d.ts +3 -0
  63. package/dist/cli/index.js +36 -0
  64. package/dist/cli/types.d.ts +77 -0
  65. package/dist/cli/types.js +5 -0
  66. package/dist/cli/utils/deploy-ci.d.ts +22 -0
  67. package/dist/cli/utils/deploy-ci.js +138 -0
  68. package/dist/cli/utils/deploy-linting.d.ts +3 -0
  69. package/dist/cli/utils/deploy-linting.js +136 -0
  70. package/dist/cli/utils/detect-stack.d.ts +3 -0
  71. package/dist/cli/utils/detect-stack.js +270 -0
  72. package/dist/cli/utils/error-classes.d.ts +63 -0
  73. package/dist/cli/utils/error-classes.js +84 -0
  74. package/dist/cli/utils/error-handler.d.ts +59 -0
  75. package/dist/cli/utils/error-handler.js +127 -0
  76. package/dist/cli/utils/errors.d.ts +52 -0
  77. package/dist/cli/utils/errors.js +102 -0
  78. package/dist/cli/utils/get-sdk-path.d.ts +18 -0
  79. package/dist/cli/utils/get-sdk-path.js +31 -0
  80. package/dist/cli/utils/inject-dependencies.d.ts +2 -0
  81. package/dist/cli/utils/inject-dependencies.js +55 -0
  82. package/dist/cli/utils/linting-tools.d.ts +8 -0
  83. package/dist/cli/utils/linting-tools.js +206 -0
  84. package/dist/cli/utils/metrics/code-quality.d.ts +32 -0
  85. package/dist/cli/utils/metrics/code-quality.js +122 -0
  86. package/dist/cli/utils/metrics/dependency-parser.d.ts +21 -0
  87. package/dist/cli/utils/metrics/dependency-parser.js +153 -0
  88. package/dist/cli/utils/metrics/file-complexity.d.ts +26 -0
  89. package/dist/cli/utils/metrics/file-complexity.js +77 -0
  90. package/dist/cli/utils/metrics/framework-detector.d.ts +17 -0
  91. package/dist/cli/utils/metrics/framework-detector.js +120 -0
  92. package/dist/cli/utils/metrics/git-metrics.d.ts +30 -0
  93. package/dist/cli/utils/metrics/git-metrics.js +83 -0
  94. package/dist/cli/utils/metrics/index.d.ts +28 -0
  95. package/dist/cli/utils/metrics/index.js +100 -0
  96. package/dist/cli/utils/template-processor.d.ts +10 -0
  97. package/dist/cli/utils/template-processor.js +188 -0
  98. package/dist/cli/utils/validate-path.d.ts +80 -0
  99. package/dist/cli/utils/validate-path.js +180 -0
  100. package/dist/index.d.ts +6 -0
  101. package/dist/index.js +8 -0
  102. package/dist/templates/agents/aj-team/apo-documentation-specialist.md.template +572 -0
  103. package/dist/templates/agents/aj-team/bas-quality-gate.md.template +906 -0
  104. package/dist/templates/agents/aj-team/bon-dependency-manager.md.template +636 -0
  105. package/dist/templates/agents/aj-team/cap-configuration-specialist.md.template +670 -0
  106. package/dist/templates/agents/aj-team/dra-code-reviewer.md.template +768 -0
  107. package/dist/templates/agents/aj-team/kil-task-executor.md.template +764 -0
  108. package/dist/templates/agents/aj-team/uro-refactoring-specialist.md.template +759 -0
  109. package/dist/templates/agents/audit/juno-auditor.md.template +447 -0
  110. package/dist/templates/agents/deployment/ein-cicd.md.template +694 -0
  111. package/dist/templates/agents/deployment/ino-context.md.template +733 -0
  112. package/dist/templates/agents/deployment/tan-structure.md.template +661 -0
  113. package/dist/templates/agents/deployment/zen-knowledge.md.template +451 -0
  114. package/dist/templates/agents/leadership/aj-cc.md.template +462 -0
  115. package/dist/templates/agents/leadership/aj-maestro.md.template +943 -0
  116. package/dist/templates/agents/leadership/aly-cto.md.template +407 -0
  117. package/dist/templates/agents/planning/eus-decomposer.md.template +496 -0
  118. package/dist/templates/agents/planning/mon-requirements.md.template +323 -0
  119. package/dist/templates/agents/planning/ror-design.md.template +465 -0
  120. package/dist/templates/agents/planning/tra-planner.md.template +432 -0
  121. package/dist/templates/ci/cd.yml.template +175 -0
  122. package/dist/templates/ci/ci.yml.template +196 -0
  123. package/dist/templates/ci/generic-ci.yml +115 -0
  124. package/dist/templates/ci/github-actions.yml +86 -0
  125. package/dist/templates/ci/gitlab-ci.yml +103 -0
  126. package/dist/templates/claude/EMPLOYEE-DIRECTORY.md.template +545 -0
  127. package/dist/templates/documentation/ROOT-README.md.template +307 -0
  128. package/dist/templates/documentation/SUBDIRECTORY-README.md.template +261 -0
  129. package/dist/templates/investigations/bug.md.template +484 -0
  130. package/dist/templates/investigations/feature.md.template +564 -0
  131. package/dist/templates/investigations/performance.md.template +625 -0
  132. package/dist/templates/investigations/security.md.template +714 -0
  133. package/dist/templates/investigations/technical.md.template +433 -0
  134. package/dist/templates/knowledge-base/AI-DEVELOPMENT-GUIDE.md.template +957 -0
  135. package/dist/templates/knowledge-base/ARCHITECTURE.md.template +452 -0
  136. package/dist/templates/knowledge-base/CODING-PRINCIPLES.md.template +750 -0
  137. package/dist/templates/knowledge-base/DOCUMENTATION-CRITERIA.md.template +1118 -0
  138. package/dist/templates/knowledge-base/ISSUES.md.template +539 -0
  139. package/dist/templates/knowledge-base/TESTING-PRINCIPLES.md.template +894 -0
  140. package/dist/templates/knowledge-base/Technical-Debt.md.template +640 -0
  141. package/dist/templates/knowledge-base/To-do.md.template +407 -0
  142. package/dist/templates/knowledge-base/Trinity.md.template +464 -0
  143. package/dist/templates/linting/flutter/.pre-commit-config.yaml.template +27 -0
  144. package/dist/templates/linting/flutter/analysis_options.yaml.template +26 -0
  145. package/dist/templates/linting/nodejs/.eslintrc-commonjs.json.template +19 -0
  146. package/dist/templates/linting/nodejs/.eslintrc-esm.json.template +19 -0
  147. package/dist/templates/linting/nodejs/.eslintrc-typescript.json.template +22 -0
  148. package/dist/templates/linting/nodejs/.pre-commit-config.yaml.template +51 -0
  149. package/dist/templates/linting/nodejs/.prettierrc.json.template +10 -0
  150. package/dist/templates/linting/python/.flake8.template +16 -0
  151. package/dist/templates/linting/python/.pre-commit-config.yaml.template +30 -0
  152. package/dist/templates/linting/python/pyproject.toml.template +38 -0
  153. package/dist/templates/linting/rust/.pre-commit-config.yaml.template +28 -0
  154. package/dist/templates/linting/rust/clippy.toml.template +14 -0
  155. package/dist/templates/linting/rust/rustfmt.toml.template +12 -0
  156. package/dist/templates/root/CLAUDE.md.template +65 -0
  157. package/dist/templates/root/TRINITY.md.template +52 -0
  158. package/dist/templates/shared/claude-commands/trinity-agents.md.template +168 -0
  159. package/dist/templates/shared/claude-commands/trinity-audit.md.template +646 -0
  160. package/dist/templates/shared/claude-commands/trinity-changelog.md.template +624 -0
  161. package/dist/templates/shared/claude-commands/trinity-continue.md.template +549 -0
  162. package/dist/templates/shared/claude-commands/trinity-create-investigation.md.template +232 -0
  163. package/dist/templates/shared/claude-commands/trinity-decompose.md.template +181 -0
  164. package/dist/templates/shared/claude-commands/trinity-design.md.template +347 -0
  165. package/dist/templates/shared/claude-commands/trinity-docs.md.template +2093 -0
  166. package/dist/templates/shared/claude-commands/trinity-end.md.template +397 -0
  167. package/dist/templates/shared/claude-commands/trinity-init.md.template +606 -0
  168. package/dist/templates/shared/claude-commands/trinity-investigate-templates.md.template +725 -0
  169. package/dist/templates/shared/claude-commands/trinity-orchestrate.md.template +1061 -0
  170. package/dist/templates/shared/claude-commands/trinity-plan-investigation.md.template +135 -0
  171. package/dist/templates/shared/claude-commands/trinity-plan.md.template +201 -0
  172. package/dist/templates/shared/claude-commands/trinity-readme.md.template +1971 -0
  173. package/dist/templates/shared/claude-commands/trinity-requirements.md.template +148 -0
  174. package/dist/templates/shared/claude-commands/trinity-start.md.template +268 -0
  175. package/dist/templates/shared/claude-commands/trinity-verify.md.template +453 -0
  176. package/dist/templates/shared/claude-commands/trinity-workorder.md.template +249 -0
  177. package/dist/templates/source/base-CLAUDE.md.template +310 -0
  178. package/dist/templates/source/flutter-CLAUDE.md.template +593 -0
  179. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -0
  180. package/dist/templates/source/python-CLAUDE.md.template +510 -0
  181. package/dist/templates/source/react-CLAUDE.md.template +513 -0
  182. package/dist/templates/source/rust-CLAUDE.md.template +653 -0
  183. package/dist/templates/source/tests-CLAUDE.md.template +432 -0
  184. package/dist/templates/trinity/CLAUDE.md.template +372 -0
  185. package/dist/templates/work-orders/ANALYSIS-TEMPLATE.md.template +276 -0
  186. package/dist/templates/work-orders/AUDIT-TEMPLATE.md.template +262 -0
  187. package/dist/templates/work-orders/IMPLEMENTATION-TEMPLATE.md.template +260 -0
  188. package/dist/templates/work-orders/INVESTIGATION-TEMPLATE.md.template +206 -0
  189. package/dist/templates/work-orders/PATTERN-TEMPLATE.md.template +320 -0
  190. package/dist/templates/work-orders/VERIFICATION-TEMPLATE.md.template +273 -0
  191. package/package.json +94 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,116 @@
1
+ # Changelog
2
+
3
+ All notable changes to Trinity Method SDK will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ ### Changed
13
+
14
+ ### Deprecated
15
+
16
+ ### Removed
17
+
18
+ ### Fixed
19
+
20
+ ### Security
21
+
22
+ ## [2.0.0] - 2025-12-21
23
+
24
+ ### Added
25
+
26
+ - **Agent System Expansion:** Grew from 7 to 19 specialized agents
27
+ - **Planning Layer (4 agents):** MON (Requirements Analyst), ROR (Design Architect), TRA (Work Planner), EUS (Task Decomposer)
28
+ - **Execution Layer (3 agents):** KIL (Task Executor), BAS (Quality Gate), DRA (Code Reviewer)
29
+ - **Support Layer (4 agents):** APO (Documentation Specialist), BON (Dependency Manager), CAP (Configuration Specialist), URO (Refactoring Specialist)
30
+ - **Leadership & Audit (2 agents):** ALY (Chief Technology Officer), JUNO (Quality Auditor)
31
+ - **Infrastructure (5 agents):** TAN, ZEN, INO, EIN, AJ MAESTRO (legacy)
32
+ - Increased deployment from 49 to 64 production-ready components
33
+ - Expanded slash commands from 8 to 20 commands across 6 categories
34
+ - Session Management: `/trinity-start`, `/trinity-continue`, `/trinity-end`
35
+ - Planning: `/trinity-requirements`, `/trinity-design`, `/trinity-decompose`, `/trinity-plan`
36
+ - Execution: `/trinity-orchestrate`, `/trinity-audit`, `/trinity-readme`, `/trinity-docs`, `/trinity-changelog`
37
+ - Investigation: `/trinity-create-investigation`, `/trinity-plan-investigation`, `/trinity-investigate-templates`
38
+ - Infrastructure: `/trinity-init`
39
+ - Utility: `/trinity-verify`, `/trinity-agents`, `/trinity-workorder`
40
+ - Enhanced `/trinity-readme` command template to v2.0.0 with comprehensive validation phases
41
+ - Phase 2h: Command/Script/CLI Validation - Verifies all documented commands exist in codebase
42
+ - Phase 2i: Code Example Validation - Checks code examples match current API signatures
43
+ - Phase 2j: API/Function Reference Validation - Verifies documented functions/classes exist
44
+ - Phase 2k: Dependency Claims Validation - Cross-references README with package manifests
45
+ - Phase 2l: Stale Content Detection - Finds TODO markers, outdated dates, placeholder text
46
+
47
+ ### Changed
48
+
49
+ - **BREAKING:** Updated Trinity Method to v2.0.0 architecture
50
+ - **Agent System:** Complete agent architecture redesign with specialized layers
51
+ - **Documentation System:** Enhanced APO capabilities with comprehensive audit phases
52
+ - Refactored 7 functions to reduce cyclomatic complexity (all ≤15)
53
+ - Improved code maintainability and readability across codebase
54
+ - Enhanced test coverage and reliability (405 tests, 100% passing)
55
+
56
+ ### Deprecated
57
+
58
+ - AJ MAESTRO orchestrator (v1.0) replaced by ALY in v2.0
59
+
60
+ ### Fixed
61
+
62
+ - Template path resolution in integration tests
63
+ - Linting deployment tests now correctly locate template files
64
+ - **Documentation Accuracy:** Fixed 6 critical inaccuracies in README.md
65
+ - Removed 24+ non-existent CLI commands (`npx trinity investigate`, `crisis`, `analytics`, etc.)
66
+ - Fixed 13 broken documentation links (docs/methodology/, docs/adr/, docs/workflows/)
67
+ - Corrected agent count inconsistencies throughout documentation (unified to 19 agents)
68
+ - Updated deployment examples to reflect actual CLI (`npx @trinity-method/cli deploy/update`)
69
+ - Fixed broken ADR links in src/README.md (replaced with design principles summary)
70
+ - Fixed broken ADR links in docs/README.md (removed non-existent file references)
71
+
72
+ ---
73
+
74
+ ## [1.0.1] - 2025-10-02
75
+
76
+ ### Fixed
77
+
78
+ - **Critical:** Missing template files in npm package (only 9 of 36 were included)
79
+ - Fixed file paths to use bundled templates instead of workspace structure
80
+ - All `.md.template` files now properly included in published package
81
+ - Updated `deploy.js` and `update.js` to reference correct template locations
82
+ - Bundled agents and hooks directly into CLI package for standalone operation
83
+
84
+ ### Changed
85
+
86
+ - Reorganized package structure to be self-contained when published to npm
87
+ - Templates, agents, and hooks now bundled in `packages/cli/templates/`
88
+
89
+ ---
90
+
91
+ ## [1.0.0] - 2025-10-01
92
+
93
+ ### Added
94
+
95
+ - Initial release of Trinity Method SDK for Claude Code
96
+ - 7 specialized Trinity agents (Aly, AJ, TAN, ZEN, INO, Ein, JUNO)
97
+ - Claude Code-exclusive deployment
98
+ - Interactive deployment with linting and CI/CD configuration
99
+ - Linting configuration (ESLint, Prettier, etc.)
100
+ - CI/CD automation (GitHub Actions, GitLab CI)
101
+ - Matrix testing support
102
+ - Coverage integration (Codecov, Coveralls)
103
+ - Employee Directory with agent documentation
104
+ - Trinity structure (knowledge-base, templates)
105
+ - CLAUDE.md context file deployment
106
+ - README injection for Trinity Method section
107
+ - 8 slash commands (/trinity-init, /trinity-verify, /trinity-docs, /trinity-start, /trinity-continue, /trinity-end, /trinity-workorder, /trinity-agents)
108
+ - Session management with archival system
109
+ - Comprehensive CLI documentation
110
+
111
+ ### Strategic Decision
112
+
113
+ - Focused exclusively on Claude Code for exceptional user experience
114
+ - Community contributions welcome for other coding agents
115
+
116
+ [1.0.0]: https://github.com/lukadfagundes/trinity-method-sdk/releases/tag/v1.0.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Luka Fagundes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,555 @@
1
+ # Trinity Method SDK
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@trinity-method/cli?color=success)](https://www.npmjs.com/package/@trinity-method/cli)
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
+ ### Quick Start (90 Seconds to Production)
189
+
190
+ ```bash
191
+ # Navigate to your project
192
+ cd your-project
193
+
194
+ # Deploy Trinity Method
195
+ npx @trinity-method/cli deploy
196
+ ```
197
+
198
+ **Interactive Wizard:**
199
+
200
+ 1. ✅ **Stack Detection**: Automatically detects framework (Node.js, Python, Rust, Flutter, Go)
201
+ 2. ✅ **Linting Setup**: Choose "Recommended" for one-click best practices
202
+ 3. ✅ **Deploy**: 90-second deployment with full infrastructure
203
+ 4. ✅ **Install Dependencies**: `npm install` (or `pip install -r requirements-dev.txt`)
204
+ 5. ✅ **Setup Pre-commit**: `pip install pre-commit && pre-commit install`
205
+
206
+ **Result:** Production-ready development environment with 19 agents, 20 slash commands, quality gates, and documentation.
207
+
208
+ ### Available Commands
209
+
210
+ ```bash
211
+ # Deploy Trinity to your project
212
+ npx @trinity-method/cli deploy
213
+
214
+ # Update Trinity to latest version
215
+ npx @trinity-method/cli update
216
+ ```
217
+
218
+ ### Using Trinity Method (Slash Commands)
219
+
220
+ After deployment, access Trinity functionality through Claude Code slash commands:
221
+
222
+ **Session Management:**
223
+
224
+ - `/trinity-start` - Start workflow guide
225
+ - `/trinity-continue` - Resume after interruption
226
+ - `/trinity-end` - End session and archive
227
+
228
+ **Planning:**
229
+
230
+ - `/trinity-requirements` - Analyze requirements (MON)
231
+ - `/trinity-design` - Create technical design (ROR)
232
+ - `/trinity-decompose` - Break down tasks (EUS)
233
+ - `/trinity-plan` - Create implementation plan (TRA)
234
+
235
+ **Execution:**
236
+
237
+ - `/trinity-orchestrate` - Execute with ALY orchestration
238
+ - `/trinity-audit` - Run codebase audit (JUNO)
239
+ - `/trinity-readme` - Update README coverage (APO)
240
+ - `/trinity-docs` - Organize docs/ directory (APO)
241
+ - `/trinity-changelog` - Maintain CHANGELOG.md (APO)
242
+
243
+ **Investigation:**
244
+
245
+ - `/trinity-create-investigation` - Create structured investigation
246
+ - `/trinity-plan-investigation` - Generate investigation plan
247
+ - `/trinity-investigate-templates` - View investigation templates
248
+
249
+ **Utility:**
250
+
251
+ - `/trinity-verify` - Verify Trinity deployment
252
+ - `/trinity-agents` - View agent directory
253
+ - `/trinity-workorder` - Create work orders
254
+
255
+ ### Linting & Code Quality (85-90% Time Savings)
256
+
257
+ **Before Trinity (Manual Setup): ~50 minutes per project**
258
+
259
+ 1. Research tools for your framework
260
+ 2. Install dependencies
261
+ 3. Create configuration files
262
+ 4. Configure pre-commit hooks
263
+ 5. Test and debug configuration
264
+
265
+ **With Trinity (Automated): ~6 minutes per project**
266
+
267
+ 1. Select "Recommended" during deployment (30 seconds)
268
+ 2. Run `npm install` (3-5 minutes)
269
+ 3. Setup pre-commit: `pip install pre-commit && pre-commit install` (30 seconds)
270
+
271
+ **Supported Frameworks:**
272
+
273
+ - **Node.js/React**: ESLint + Prettier + Pre-commit
274
+ - **Python**: Black + Flake8 + isort + Pre-commit
275
+ - **Flutter**: Dart Analyzer + Pre-commit
276
+ - **Rust**: Clippy + Rustfmt + Pre-commit
277
+
278
+ ---
279
+
280
+ ## Designed for Claude Code
281
+
282
+ Trinity Method SDK is built exclusively for [Claude Code](https://claude.com/claude-code), Anthropic's AI pair programming environment.
283
+
284
+ ### Why Claude Code?
285
+
286
+ - **Deep Integration**: Trinity's 19-agent team leverages Claude Code's agent architecture
287
+ - **Slash Commands**: Built-in `/trinity-*` commands for instant workflow access
288
+ - **Hooks System**: Pre/post-action automation via Claude Code hooks
289
+ - **Quality Focus**: Exceptional single-agent experience optimized for Claude
290
+
291
+ ### Other AI Assistants?
292
+
293
+ 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).
294
+
295
+ ---
296
+
297
+ ## Examples & Documentation
298
+
299
+ ### Real-World Deployments
300
+
301
+ ```bash
302
+ # Node.js/Express API
303
+ cd my-api && npx @trinity-method/cli deploy
304
+ # Result: API with ESLint, Prettier, pre-commit, 19 agents, quality gates
305
+
306
+ # Python/Django Project
307
+ cd my-django && npx @trinity-method/cli deploy
308
+ # Result: Django with Black, Flake8, isort, pre-commit, full Trinity infrastructure
309
+
310
+ # Flutter Mobile App
311
+ cd my-flutter-app && npx @trinity-method/cli deploy
312
+ # Result: Flutter with Dart Analyzer, pre-commit, investigation templates
313
+
314
+ # Rust CLI Tool
315
+ cd my-rust-cli && npx @trinity-method/cli deploy
316
+ # Result: Rust with Clippy, Rustfmt, pre-commit, crisis management
317
+ ```
318
+
319
+ ### Documentation
320
+
321
+ After deploying Trinity to your project, comprehensive documentation is available in your project:
322
+
323
+ **Trinity Knowledge Base:**
324
+
325
+ - `trinity/knowledge-base/ARCHITECTURE.md` - System architecture with codebase metrics
326
+ - `trinity/knowledge-base/ISSUES.md` - Known issues and bug tracking
327
+ - `trinity/knowledge-base/To-do.md` - Task management and priorities
328
+ - `trinity/knowledge-base/Technical-Debt.md` - Technical debt tracking
329
+ - `trinity/knowledge-base/Trinity.md` - Project-specific Trinity guide
330
+ - `trinity/knowledge-base/TESTING-PRINCIPLES.md` - Testing standards
331
+ - `trinity/knowledge-base/CODING-PRINCIPLES.md` - Code quality standards
332
+
333
+ **Agent System:**
334
+
335
+ - `.claude/EMPLOYEE-DIRECTORY.md` - Complete agent reference and selection guide
336
+ - `.claude/agents/` - 19 specialized agent markdown files
337
+
338
+ **SDK Documentation:**
339
+
340
+ - [API Documentation](docs/) - TypeDoc-generated API reference
341
+ - [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup, workflow, and standards
342
+ - [CHANGELOG.md](CHANGELOG.md) - Version history and release notes
343
+
344
+ ### After Deployment
345
+
346
+ Your project contains:
347
+
348
+ - **64 production-ready components** deployed in 90 seconds
349
+ - **19 specialized agents** in `.claude/agents/` (organized by category: aj-team, audit, deployment, leadership, planning)
350
+ - **20 slash commands** in `.claude/commands/` (organized by category: execution, infrastructure, investigation, planning, session, utility)
351
+ - **Complete knowledge base** in `trinity/knowledge-base/` (ARCHITECTURE.md, ISSUES.md, To-do.md, Technical-Debt.md)
352
+ - **Investigation templates** in `trinity/templates/investigations/` (bug, performance, security, system analysis, incident)
353
+ - **Work order templates** in `trinity/templates/work-orders/`
354
+ - **Session archives** in `trinity/sessions/`
355
+ - **Audit reports** in `trinity/reports/`
356
+ - **Linting tools** configured for your framework
357
+
358
+ **Complete Deployed Structure:**
359
+
360
+ ```
361
+ your-project/
362
+ ├── .claude/
363
+ │ ├── agents/
364
+ │ │ ├── aj-team/ # AJ MAESTRO orchestration agents
365
+ │ │ ├── audit/ # JUNO quality auditor
366
+ │ │ ├── deployment/ # Deployment specialists (BON, CAP, EIN, INO, TAN, ZEN)
367
+ │ │ ├── leadership/ # ALY strategic leadership
368
+ │ │ └── planning/ # MON, ROR, EUS, TRA agents
369
+ │ ├── commands/
370
+ │ │ ├── execution/ # trinity-orchestrate, trinity-audit, trinity-readme, trinity-docs, trinity-changelog
371
+ │ │ ├── infrastructure/ # trinity-init
372
+ │ │ ├── investigation/ # trinity-create-investigation, trinity-plan-investigation, trinity-investigate-templates
373
+ │ │ ├── planning/ # trinity-requirements, trinity-design, trinity-decompose, trinity-plan
374
+ │ │ ├── session/ # trinity-start, trinity-continue, trinity-end
375
+ │ │ └── utility/ # trinity-verify, trinity-agents, trinity-workorder
376
+ │ └── EMPLOYEE-DIRECTORY.md # 19-agent team guide
377
+ ├── trinity/
378
+ │ ├── knowledge-base/ # ARCHITECTURE.md, ISSUES.md, To-do.md, Technical-Debt.md, Trinity.md
379
+ │ ├── templates/
380
+ │ │ ├── documentation/ # Documentation templates
381
+ │ │ ├── investigations/ # Bug, performance, security, system analysis, incident templates
382
+ │ │ └── work-orders/ # Work order templates
383
+ │ ├── investigations/ # Active investigations
384
+ │ │ └── plans/ # Investigation execution plans
385
+ │ ├── sessions/ # Session archives
386
+ │ ├── reports/ # Audit and integration reports
387
+ │ ├── work-orders/ # Active work orders
388
+ │ ├── patterns/ # Reusable patterns library
389
+ │ └── archive/ # Archived sessions, reports, investigations
390
+ ├── CLAUDE.md # Root context file
391
+ └── src/CLAUDE.md # Framework-specific context
392
+ ```
393
+
394
+ - **Pre-commit hooks** automatically enforcing quality standards
395
+
396
+ ---
397
+
398
+ ## Contributing
399
+
400
+ Trinity Method SDK is open source and welcomes contributions!
401
+
402
+ **Ways to Contribute:**
403
+
404
+ - 🐛 Report bugs and issues
405
+ - 💡 Suggest new features or agent improvements
406
+ - 📝 Improve documentation
407
+ - 🔧 Submit pull requests
408
+ - ⭐ Star the repository if you find it useful
409
+
410
+ **Development Setup:**
411
+
412
+ ```bash
413
+ # Clone repository
414
+ git clone https://github.com/lukadfagundes/trinity-method-sdk.git
415
+ cd trinity-method-sdk
416
+
417
+ # Install dependencies
418
+ npm install
419
+
420
+ # Build SDK
421
+ npm run build
422
+
423
+ # Test locally
424
+ npm link
425
+ trinity deploy
426
+ ```
427
+
428
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
429
+
430
+ ---
431
+
432
+ ## Development & Publishing
433
+
434
+ ### CI/CD Pipeline
435
+
436
+ Trinity uses GitHub Actions for comprehensive continuous integration and deployment with BAS 6-phase quality gates.
437
+
438
+ #### Continuous Integration (CI)
439
+
440
+ **Automated Quality Checks on Every Push:**
441
+
442
+ - ✅ Multi-platform testing (Ubuntu, Windows, macOS)
443
+ - ✅ Multi-version testing (Node.js 18.x, 20.x, 22.x)
444
+ - ✅ Trinity component validation (19 agents, 19+ slash commands, knowledge base, CI/CD templates)
445
+ - ✅ Test suite execution (unit, integration, e2e, performance)
446
+ - ✅ Code coverage validation (80%+ threshold enforced)
447
+ - ✅ Linting and type checking
448
+ - ✅ Security scanning (npm audit, dependency checks)
449
+ - ✅ Build verification with artifact validation
450
+ - ✅ Documentation validation
451
+
452
+ **BAS 6-Phase Quality Gates:**
453
+
454
+ 1. **Phase 1**: Code Quality (Linting, type checking, formatting)
455
+ 2. **Phase 2**: Structure Validation (Trinity template validation)
456
+ 3. **Phase 3**: Build Validation (TypeScript compilation, artifact verification)
457
+ 4. **Phase 4**: Testing (All test suites across platforms)
458
+ 5. **Phase 5**: Coverage Check (≥80% threshold)
459
+ 6. **Phase 6**: Documentation (API docs, README validation)
460
+
461
+ **CI Workflow Location:** [.github/workflows/ci.yml](.github/workflows/ci.yml)
462
+
463
+ #### Continuous Deployment (CD)
464
+
465
+ **Automated Publishing to npm:**
466
+
467
+ The CD pipeline automatically publishes to npm when you push version tags to the main branch:
468
+
469
+ ```bash
470
+ # Create release commit and tag (triggers CD pipeline on main branch only)
471
+ git commit --allow-empty -m "chore: release v2.0.0"
472
+ git tag -a v2.0.0 -m "Trinity Method SDK v2.0.0"
473
+ git push origin main --follow-tags
474
+ ```
475
+
476
+ **CD Pipeline Workflow:**
477
+
478
+ 1. **Pre-deployment Validation**: Verify CI passed, tag format correct (v\*), on main branch
479
+ 2. **Build & Trinity Validation**: Build artifacts, validate Trinity components
480
+ 3. **npm Publish**: Automated publishing using `NPM_TOKEN` secret
481
+ 4. **GitHub Release**: Create GitHub release with CHANGELOG
482
+ 5. **Deployment Summary**: Post-deployment notifications and metrics
483
+
484
+ **CD Workflow Location:** [.github/workflows/cd.yml](.github/workflows/cd.yml)
485
+
486
+ **Important:** The CD pipeline only triggers on the `main` branch. Tags pushed to `dev` or `testing` branches will not trigger automated deployment.
487
+
488
+ **Required Setup:**
489
+
490
+ Before automated deployment works, you must configure the `NPM_TOKEN` secret:
491
+
492
+ 1. Create npm granular access token (see [.env.example](.env.example) for detailed instructions)
493
+ 2. Add to GitHub Secrets:
494
+ - Go to: **Settings → Secrets and variables → Actions → New repository secret**
495
+ - Name: `NPM_TOKEN`
496
+ - Value: [your npm token]
497
+
498
+ **Documentation:**
499
+
500
+ - **Complete CI/CD Guide**: [docs/guides/CI-CD-GUIDE.md](docs/guides/CI-CD-GUIDE.md)
501
+ - **Quick Reference**: [docs/reference/CI-CD-REFERENCE.md](docs/reference/CI-CD-REFERENCE.md)
502
+
503
+ ### Manual Publishing (Optional)
504
+
505
+ You can still publish manually if needed:
506
+
507
+ ```bash
508
+ # After pushing to main and CI passes
509
+ npm login # Authenticate with npm
510
+ npm publish # Publishes with prepublishOnly checks
511
+ ```
512
+
513
+ **Automated Checks Before Publishing:**
514
+
515
+ 1. `prepublishOnly` script runs automatically
516
+ 2. TypeScript compilation (`npm run build`)
517
+ 3. Template copying to dist/
518
+ 4. Full test suite execution (`npm run test`)
519
+ 5. Only publishes if all checks pass
520
+
521
+ **Note:** Manual publishing is now optional. The CD pipeline handles automated publishing when you create version tags (recommended workflow).
522
+
523
+ ---
524
+
525
+ ## License
526
+
527
+ MIT License - see [LICENSE](LICENSE) for details
528
+
529
+ ---
530
+
531
+ ## Links
532
+
533
+ ### Project Resources
534
+
535
+ - **npm Package**: [@trinity-method/cli](https://www.npmjs.com/package/@trinity-method/cli)
536
+ - **GitHub**: [lukadfagundes/trinity-method-sdk](https://github.com/lukadfagundes/trinity-method-sdk)
537
+ - **Issues**: [GitHub Issues](https://github.com/lukadfagundes/trinity-method-sdk/issues)
538
+ - **Discussions**: [GitHub Discussions](https://github.com/lukadfagundes/trinity-method-sdk/discussions)
539
+
540
+ ### Documentation
541
+
542
+ - **API Documentation**: [docs/](docs/) - Generated TypeDoc API reference
543
+ - **Contributing Guide**: [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup, workflow, and standards
544
+ - **Architectural Decisions**: [docs/adr/](docs/adr/) - ADRs documenting major technical decisions
545
+ - [ADR-001: CLI Architecture](docs/adr/ADR-001-cli-architecture.md)
546
+ - [ADR-002: Template System Design](docs/adr/ADR-002-template-system-design.md)
547
+ - [ADR-003: ESLint Flat Config](docs/adr/ADR-003-eslint-flat-config.md)
548
+ - [ADR-004: Test Strategy](docs/adr/ADR-004-test-strategy.md)
549
+ - **Changelog**: [CHANGELOG.md](CHANGELOG.md) - Version history and release notes
550
+
551
+ ---
552
+
553
+ **Built with ❤️ by the Trinity Method Team**
554
+
555
+ _Trinity Method: Investigation-first development for the AI age_