trinity-method-sdk 2.1.0 → 2.2.1

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 (101) hide show
  1. package/CHANGELOG.md +728 -467
  2. package/README.md +550 -539
  3. package/dist/cli/commands/deploy/ci-cd.d.ts +4 -3
  4. package/dist/cli/commands/deploy/ci-cd.js +10 -9
  5. package/dist/cli/commands/deploy/configuration.js +10 -11
  6. package/dist/cli/commands/deploy/directories.js +13 -14
  7. package/dist/cli/commands/deploy/gitignore.js +3 -4
  8. package/dist/cli/commands/deploy/index.d.ts +1 -1
  9. package/dist/cli/commands/deploy/index.js +6 -2
  10. package/dist/cli/commands/deploy/knowledge-base.js +2 -2
  11. package/dist/cli/commands/deploy/pre-flight.js +1 -1
  12. package/dist/cli/commands/deploy/root-files.js +2 -17
  13. package/dist/cli/commands/deploy/summary.js +3 -3
  14. package/dist/cli/commands/deploy/templates.js +5 -5
  15. package/dist/cli/commands/update/backup.js +6 -12
  16. package/dist/cli/commands/update/index.js +15 -1
  17. package/dist/cli/commands/update/knowledge-base.js +1 -1
  18. package/dist/cli/commands/update/migration.d.ts +31 -0
  19. package/dist/cli/commands/update/migration.js +130 -0
  20. package/dist/cli/commands/update/pre-flight.d.ts +7 -2
  21. package/dist/cli/commands/update/pre-flight.js +21 -20
  22. package/dist/cli/commands/update/summary.js +11 -5
  23. package/dist/cli/commands/update/templates.js +1 -1
  24. package/dist/cli/commands/update/types.d.ts +2 -0
  25. package/dist/cli/commands/update/verification.js +5 -5
  26. package/dist/cli/commands/update/version.js +6 -4
  27. package/dist/cli/utils/deploy-ci.d.ts +3 -2
  28. package/dist/cli/utils/deploy-ci.js +24 -24
  29. package/dist/cli/utils/deploy-linting.js +100 -5
  30. package/dist/cli/utils/error-classes.d.ts +2 -2
  31. package/dist/cli/utils/linting-tools.js +14 -6
  32. package/dist/cli/utils/template-processor.js +1 -3
  33. package/dist/templates/.claude/EMPLOYEE-DIRECTORY.md.template +16 -22
  34. package/dist/templates/.claude/agents/aj-team/apo-documentation-specialist.md.template +7 -7
  35. package/dist/templates/.claude/agents/aj-team/bas-quality-gate.md.template +8 -8
  36. package/dist/templates/.claude/agents/aj-team/dra-code-reviewer.md.template +3 -3
  37. package/dist/templates/.claude/agents/aj-team/kil-task-executor.md.template +6 -6
  38. package/dist/templates/.claude/agents/audit/juno-auditor.md.template +39 -40
  39. package/dist/templates/.claude/agents/deployment/ein-cicd.md.template +56 -159
  40. package/dist/templates/.claude/agents/deployment/ino-context.md.template +21 -21
  41. package/dist/templates/.claude/agents/deployment/tan-structure.md.template +28 -29
  42. package/dist/templates/.claude/agents/deployment/zen-knowledge.md.template +22 -23
  43. package/dist/templates/.claude/agents/leadership/aj-maestro.md.template +6 -6
  44. package/dist/templates/.claude/agents/leadership/aly-cto.md.template +17 -18
  45. package/dist/templates/.claude/agents/planning/eus-decomposer.md.template +4 -4
  46. package/dist/templates/.claude/agents/planning/mon-requirements.md.template +4 -4
  47. package/dist/templates/.claude/agents/planning/ror-design.md.template +4 -4
  48. package/dist/templates/.claude/agents/planning/tra-planner.md.template +4 -4
  49. package/dist/templates/.claude/commands/execution/trinity-audit.md.template +9 -9
  50. package/dist/templates/.claude/commands/execution/trinity-breakdown.md.template +535 -0
  51. package/dist/templates/.claude/commands/execution/trinity-orchestrate.md.template +43 -43
  52. package/dist/templates/.claude/commands/infrastructure/trinity-init.md.template +20 -43
  53. package/dist/templates/.claude/commands/investigation/trinity-create-investigation.md.template +5 -5
  54. package/dist/templates/.claude/commands/investigation/trinity-investigate-templates.md.template +10 -10
  55. package/dist/templates/.claude/commands/investigation/trinity-plan-investigation.md.template +1 -1
  56. package/dist/templates/.claude/commands/maintenance/trinity-changelog.md.template +4 -4
  57. package/dist/templates/.claude/commands/maintenance/trinity-docs-update.md.template +10 -10
  58. package/dist/templates/.claude/commands/maintenance/trinity-docs.md.template +62 -62
  59. package/dist/templates/.claude/commands/maintenance/trinity-readme.md.template +16 -16
  60. package/dist/templates/.claude/commands/session/trinity-continue.md.template +22 -22
  61. package/dist/templates/.claude/commands/session/trinity-end.md.template +22 -22
  62. package/dist/templates/.claude/commands/session/trinity-start.md.template +1 -2
  63. package/dist/templates/.claude/commands/utility/trinity-agents.md.template +3 -6
  64. package/dist/templates/.claude/commands/utility/trinity-verify.md.template +48 -54
  65. package/dist/templates/.claude/commands/utility/trinity-workorder.md.template +5 -5
  66. package/dist/templates/ci/ci.yml.template +2 -2
  67. package/dist/templates/root/CLAUDE.md.template +9 -9
  68. package/dist/templates/root/linting/nodejs/.husky-pre-commit.template +5 -0
  69. package/dist/templates/source/base-CLAUDE.md.template +310 -310
  70. package/dist/templates/source/flutter-CLAUDE.md.template +593 -593
  71. package/dist/templates/source/nodejs-CLAUDE.md.template +531 -531
  72. package/dist/templates/source/python-CLAUDE.md.template +510 -510
  73. package/dist/templates/source/react-CLAUDE.md.template +513 -513
  74. package/dist/templates/source/rust-CLAUDE.md.template +653 -653
  75. package/dist/templates/trinity/CLAUDE.md.template +14 -14
  76. package/dist/templates/trinity/knowledge-base/ARCHITECTURE.md.template +4 -4
  77. package/dist/templates/trinity/knowledge-base/ISSUES.md.template +8 -8
  78. package/dist/templates/trinity/knowledge-base/Technical-Debt.md.template +1 -3
  79. package/dist/templates/trinity/knowledge-base/To-do.md.template +1 -1
  80. package/dist/templates/trinity/knowledge-base/Trinity.md.template +5 -5
  81. package/dist/templates/trinity/templates/documentation/configuration/env-example-generator.md.template +1 -1
  82. package/dist/templates/trinity/templates/documentation/processes/error-handling-protocol.md.template +2 -2
  83. package/dist/templates/trinity/templates/documentation/reports/apo-docs-update-checklist.md.template +7 -7
  84. package/dist/templates/trinity/templates/documentation/reports/juno-docs-update-checklist.md.template +4 -4
  85. package/dist/templates/trinity/templates/documentation/reports/juno-internal-report.md.template +10 -10
  86. package/dist/templates/trinity/templates/investigations/bug.md.template +14 -14
  87. package/dist/templates/trinity/templates/investigations/feature.md.template +14 -14
  88. package/dist/templates/trinity/templates/investigations/performance.md.template +14 -14
  89. package/dist/templates/trinity/templates/investigations/security.md.template +14 -14
  90. package/dist/templates/trinity/templates/investigations/technical.md.template +14 -14
  91. package/dist/templates/trinity/templates/work-orders/ANALYSIS-TEMPLATE.md.template +10 -10
  92. package/dist/templates/trinity/templates/work-orders/AUDIT-TEMPLATE.md.template +10 -10
  93. package/dist/templates/trinity/templates/work-orders/IMPLEMENTATION-TEMPLATE.md.template +10 -10
  94. package/dist/templates/trinity/templates/work-orders/INVESTIGATION-TEMPLATE.md.template +10 -10
  95. package/dist/templates/trinity/templates/work-orders/PATTERN-TEMPLATE.md.template +10 -10
  96. package/dist/templates/trinity/templates/work-orders/VERIFICATION-TEMPLATE.md.template +10 -10
  97. package/package.json +99 -94
  98. package/dist/templates/.claude/agents/leadership/aj-cc.md.template +0 -467
  99. package/dist/templates/ci/cd.yml.template +0 -175
  100. package/dist/templates/ci/github-actions.yml +0 -86
  101. package/dist/templates/root/TRINITY.md.template +0 -52
@@ -26,9 +26,9 @@ You are **BAS**, the Quality Gate for Trinity Method SDK v2.0. You execute a rig
26
26
 
27
27
  Read these Trinity documents:
28
28
 
29
- 1. **trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
- 2. **trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
- 3. **trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Quality gate workflow
29
+ 1. **.claude/trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
+ 2. **.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
+ 3. **.claude/trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Quality gate workflow
32
32
 
33
33
  ---
34
34
 
@@ -55,7 +55,7 @@ Phase 6: Final Review (best practices)
55
55
  ```
56
56
 
57
57
  **Coverage Threshold Configuration:**
58
- - Check `trinity/knowledge-base/TESTING-PRINCIPLES.md` for `COVERAGE_THRESHOLD`
58
+ - Check `.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md` for `COVERAGE_THRESHOLD`
59
59
  - Check environment variable `TRINITY_COVERAGE_THRESHOLD`
60
60
  - Default: 80% (if not configured)
61
61
 
@@ -239,7 +239,7 @@ npm test
239
239
 
240
240
  **Purpose**: Validate code coverage ≥threshold% (configured or default 80%)
241
241
 
242
- **Configuration**: Read from `trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
242
+ **Configuration**: Read from `.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
243
243
 
244
244
  **Commands**:
245
245
  ```bash
@@ -725,7 +725,7 @@ Before approving task:
725
725
 
726
726
  ### Coverage Threshold
727
727
 
728
- **Configuration**: Read from `trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
728
+ **Configuration**: Read from `.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md` (`COVERAGE_THRESHOLD`) or env var `TRINITY_COVERAGE_THRESHOLD`
729
729
 
730
730
  **Threshold% minimum** (default 80%) for:
731
731
  - Line coverage
@@ -782,10 +782,10 @@ Trinity supports configuration at multiple levels. Priority (highest to lowest):
782
782
 
783
783
  2. **Knowledge Base Configuration** (Project Standard)
784
784
  ```markdown
785
- # trinity/knowledge-base/TESTING-PRINCIPLES.md
785
+ # .claude/trinity/knowledge-base/TESTING-PRINCIPLES.md
786
786
  COVERAGE_THRESHOLD=85
787
787
 
788
- # trinity/knowledge-base/CODING-PRINCIPLES.md
788
+ # .claude/trinity/knowledge-base/CODING-PRINCIPLES.md
789
789
  MAX_FUNCTION_LENGTH=50
790
790
  ```
791
791
 
@@ -26,9 +26,9 @@ You are **DRA**, the Code Reviewer for Trinity Method SDK v2.0. You handle quali
26
26
 
27
27
  Read these Trinity documents:
28
28
 
29
- 1. **trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
- 2. **trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
- 3. **trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Development workflows
29
+ 1. **.claude/trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
30
+ 2. **.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md** - Test quality standards
31
+ 3. **.claude/trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Development workflows
32
32
  4. **docs/plans/design/DESIGN-{feature}.md** - Design specifications
33
33
  5. **docs/plans/tasks/TASKS-{feature}.md** - Task breakdown
34
34
 
@@ -26,9 +26,9 @@ You are **KIL**, the Task Executor for Trinity Method SDK v2.0. You implement at
26
26
 
27
27
  Read these Trinity documents:
28
28
 
29
- 1. **trinity/knowledge-base/TESTING-PRINCIPLES.md** - TDD cycle (RED-GREEN-REFACTOR)
30
- 2. **trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
31
- 3. **trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Task execution standards
29
+ 1. **.claude/trinity/knowledge-base/TESTING-PRINCIPLES.md** - TDD cycle (RED-GREEN-REFACTOR)
30
+ 2. **.claude/trinity/knowledge-base/CODING-PRINCIPLES.md** - Code quality standards
31
+ 3. **.claude/trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md** - Task execution standards
32
32
  4. **docs/plans/design/DESIGN-{feature}.md** - Design specifications for current feature
33
33
  5. **docs/plans/tasks/TASKS-{feature}.md** - Task breakdown from EUS
34
34
 
@@ -80,7 +80,7 @@ Each task you execute:
80
80
  4. Escalate if high similarity found (threshold: {{DUPLICATION_THRESHOLD}} matches or default 3+ matches)
81
81
 
82
82
  **Duplication Threshold Configuration:**
83
- - Check `trinity/knowledge-base/CODING-PRINCIPLES.md` for `DUPLICATION_THRESHOLD`
83
+ - Check `.claude/trinity/knowledge-base/CODING-PRINCIPLES.md` for `DUPLICATION_THRESHOLD`
84
84
  - Check environment variable `TRINITY_DUPLICATION_THRESHOLD`
85
85
  - Default: 3 matches (if not configured)
86
86
 
@@ -139,7 +139,7 @@ Update todos in real-time:
139
139
 
140
140
  #### Similar Function Duplication Check
141
141
 
142
- **Configuration**: Read threshold from `trinity/knowledge-base/CODING-PRINCIPLES.md` (`DUPLICATION_THRESHOLD`) or env var `TRINITY_DUPLICATION_THRESHOLD` (default: 3)
142
+ **Configuration**: Read threshold from `.claude/trinity/knowledge-base/CODING-PRINCIPLES.md` (`DUPLICATION_THRESHOLD`) or env var `TRINITY_DUPLICATION_THRESHOLD` (default: 3)
143
143
 
144
144
  **High Duplication (Escalate)** - Threshold or more matches (default: 3+):
145
145
  - [ ] Same domain/responsibility
@@ -705,7 +705,7 @@ Trinity supports configuration at multiple levels. Priority (highest to lowest):
705
705
 
706
706
  2. **Knowledge Base Configuration** (Project Standard)
707
707
  ```markdown
708
- # trinity/knowledge-base/CODING-PRINCIPLES.md
708
+ # .claude/trinity/knowledge-base/CODING-PRINCIPLES.md
709
709
  DUPLICATION_THRESHOLD=3
710
710
  COMPLEXITY_THRESHOLD=10
711
711
  ```
@@ -23,7 +23,7 @@ You are primarily invoked via the `/trinity-audit` slash command for comprehensi
23
23
  /trinity-audit --quick # Quick overview
24
24
  ```
25
25
 
26
- **Deliverable:** `trinity/reports/CODEBASE-AUDIT-{date}.md`
26
+ **Deliverable:** `.claude/trinity/reports/CODEBASE-AUDIT-{date}.md`
27
27
 
28
28
  **8-Phase Codebase Audit Process:**
29
29
  1. Project Discovery (type, stack, environment)
@@ -57,11 +57,11 @@ You are JUNO, the Quality Auditor for Trinity Method v2.0. Your responsibilities
57
57
  1. **Codebase Audits** - Comprehensive 8-phase analysis when invoked via `/trinity-audit`
58
58
  2. **Deployment Audit** - Verify complete Trinity v2.0 deployment with all agents and knowledge base
59
59
  3. **Structure Compliance** - Validate directory structure matches v2.0 requirements
60
- 4. **Agent Validation** - Confirm all 19 agents deployed correctly with proper content
60
+ 4. **Agent Validation** - Confirm all 18 agents deployed correctly with proper content
61
61
  5. **Knowledge Base Audit** - Verify knowledge base files populated with real content (not empty)
62
62
  6. **CLAUDE.md Hierarchy** - Validate CLAUDE.md files establish proper behavioral hierarchy
63
63
  7. **Compliance Scoring** - Generate overall compliance score with detailed breakdown
64
- 8. **Audit Reporting** - Create comprehensive audit reports in trinity/reports/
64
+ 8. **Audit Reporting** - Create comprehensive audit reports in .claude/trinity/reports/
65
65
  9. **Documentation Coordination** - Provide findings to APO for documentation updates
66
66
 
67
67
  ---
@@ -110,10 +110,10 @@ Verify these directories exist and are writable:
110
110
 
111
111
  ```
112
112
  ✅ Core Trinity directories:
113
- - trinity/
114
- - trinity/knowledge-base/
115
- - trinity/reports/
116
- - trinity/sessions/
113
+ - .claude/trinity/
114
+ - .claude/trinity/knowledge-base/
115
+ - .claude/trinity/reports/
116
+ - .claude/trinity/sessions/
117
117
 
118
118
  ✅ Agent directories:
119
119
  - .claude/agents/leadership/
@@ -139,8 +139,8 @@ Verify these directories exist and are writable:
139
139
  - [ ] All agent subdirectories exist (5 total)
140
140
  - [ ] All planning subdirectories exist (4 total)
141
141
  - [ ] All directories writable (permission check)
142
- - [ ] trinity/VERSION file exists and readable
143
- - [ ] Trinity.md file exists in trinity/
142
+ - [ ] .claude/trinity/VERSION file exists and readable
143
+ - [ ] Trinity.md file exists in .claude/trinity/
144
144
 
145
145
  ### Phase 1 Scoring
146
146
 
@@ -151,38 +151,37 @@ Verify these directories exist and are writable:
151
151
 
152
152
  ## Phase 2: Agent Deployment Audit
153
153
 
154
- ### Required Agents (19 Total)
154
+ ### Required Agents (18 Total)
155
155
 
156
156
  Verify each agent file exists and has content:
157
157
 
158
- **Leadership Tier (3 agents):**
158
+ **Leadership Tier (2 agents):**
159
159
  1. .claude/agents/leadership/aly-cto.md
160
160
  2. .claude/agents/leadership/aj-maestro.md
161
- 3. .claude/agents/leadership/aj-cc.md
162
161
 
163
162
  **Deployment Team (4 agents):**
164
- 4. .claude/agents/deployment/tan-structure.md
165
- 5. .claude/agents/deployment/zen-knowledge.md
166
- 6. .claude/agents/deployment/ino-context.md
167
- 7. .claude/agents/deployment/ein-cicd.md
163
+ 3. .claude/agents/deployment/tan-structure.md
164
+ 4. .claude/agents/deployment/zen-knowledge.md
165
+ 5. .claude/agents/deployment/ino-context.md
166
+ 6. .claude/agents/deployment/ein-cicd.md
168
167
 
169
168
  **Planning Team (4 agents):**
170
- 8. .claude/agents/planning/mon-requirements.md
171
- 9. .claude/agents/planning/ror-design.md
172
- 10. .claude/agents/planning/tra-planner.md
173
- 11. .claude/agents/planning/eus-decomposer.md
169
+ 7. .claude/agents/planning/mon-requirements.md
170
+ 8. .claude/agents/planning/ror-design.md
171
+ 9. .claude/agents/planning/tra-planner.md
172
+ 10. .claude/agents/planning/eus-decomposer.md
174
173
 
175
174
  **AJ's Implementation Team (7 agents):**
176
- 12. .claude/agents/aj-team/kil-task-executor.md
177
- 13. .claude/agents/aj-team/bas-quality-gate.md
178
- 14. .claude/agents/aj-team/dra-code-reviewer.md
179
- 15. .claude/agents/aj-team/apo-documentation-specialist.md
180
- 16. .claude/agents/aj-team/bon-dependency-manager.md
181
- 17. .claude/agents/aj-team/cap-configuration-specialist.md
182
- 18. .claude/agents/aj-team/uro-refactoring-specialist.md
175
+ 11. .claude/agents/aj-team/kil-task-executor.md
176
+ 12. .claude/agents/aj-team/bas-quality-gate.md
177
+ 13. .claude/agents/aj-team/dra-code-reviewer.md
178
+ 14. .claude/agents/aj-team/apo-documentation-specialist.md
179
+ 15. .claude/agents/aj-team/bon-dependency-manager.md
180
+ 16. .claude/agents/aj-team/cap-configuration-specialist.md
181
+ 17. .claude/agents/aj-team/uro-refactoring-specialist.md
183
182
 
184
183
  **Audit Team (1 agent):**
185
- 19. .claude/agents/audit/juno-auditor.md
184
+ 18. .claude/agents/audit/juno-auditor.md
186
185
 
187
186
  ### Agent Content Validation
188
187
 
@@ -199,7 +198,7 @@ For each agent file, verify:
199
198
 
200
199
  ### Agent Audit Checklist
201
200
 
202
- - [ ] All 19 agent files exist (.claude/agents/)
201
+ - [ ] All 18 agent files exist (.claude/agents/)
203
202
  - [ ] All agent files have content (>0 bytes)
204
203
  - [ ] All agent files have required sections
205
204
  - [ ] Agent files readable (permissions)
@@ -207,7 +206,7 @@ For each agent file, verify:
207
206
 
208
207
  ### Phase 2 Scoring
209
208
 
210
- **Total possible points:** 19 (one point per agent file)
209
+ **Total possible points:** 18 (one point per agent file)
211
210
  **Pass threshold:** 17/19 (89%)
212
211
  ---
213
212
 
@@ -218,22 +217,22 @@ For each agent file, verify:
218
217
  Verify these files exist with real content (not empty templates):
219
218
 
220
219
  **Core Documentation (should be populated by ZEN):**
221
- 1. trinity/knowledge-base/ARCHITECTURE.md
222
- 2. trinity/knowledge-base/ISSUES.md
223
- 3. trinity/knowledge-base/To-do.md
224
- 4. trinity/knowledge-base/Technical-Debt.md
220
+ 1. .claude/trinity/knowledge-base/ARCHITECTURE.md
221
+ 2. .claude/trinity/knowledge-base/ISSUES.md
222
+ 3. .claude/trinity/knowledge-base/To-do.md
223
+ 4. .claude/trinity/knowledge-base/Technical-Debt.md
225
224
 
226
225
  **Best Practices (should have full content from templates):**
227
- 5. trinity/knowledge-base/CODING-PRINCIPLES.md
228
- 6. trinity/knowledge-base/TESTING-PRINCIPLES.md
229
- 7. trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md
230
- 8. trinity/knowledge-base/DOCUMENTATION-CRITERIA.md
226
+ 5. .claude/trinity/knowledge-base/CODING-PRINCIPLES.md
227
+ 6. .claude/trinity/knowledge-base/TESTING-PRINCIPLES.md
228
+ 7. .claude/trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md
229
+ 8. .claude/trinity/knowledge-base/DOCUMENTATION-CRITERIA.md
231
230
 
232
231
  ### Content Quality Validation
233
232
 
234
233
  For each knowledge base file, check:
235
234
 
236
- 1. **File exists** at trinity/knowledge-base/
235
+ 1. **File exists** at .claude/trinity/knowledge-base/
237
236
  2. **File size** (empty files fail audit)
238
237
  - ARCHITECTURE.md: Should have >500 characters (real analysis)
239
238
  - ISSUES.md: Should have >300 characters (structured template)
@@ -375,7 +374,7 @@ Compliance Score = (Points Achieved / Total Points) × 100%
375
374
 
376
375
  JUNO generates comprehensive audit report in:
377
376
  ```
378
- trinity/reports/audit-YYYYMMDD-HHMMSS.md
377
+ .claude/trinity/reports/audit-YYYYMMDD-HHMMSS.md
379
378
  ```
380
379
 
381
380
  ### Audit Report Template
@@ -30,7 +30,7 @@ You are Ein, the CI/CD specialist for Trinity Method v2.0. Your primary responsi
30
30
  ### Context 1: Via `/trinity-init` (Review & Customize)
31
31
  **When:** Workflows already deployed by `trinity deploy`, need project-specific customization
32
32
  **EIN's Task:**
33
- - Review deployed `.github/workflows/ci.yml` and `cd.yml` templates
33
+ - Review deployed `.github/workflows/ci.yml` template
34
34
  - Review deployed `.pre-commit-config.yaml` template (if exists)
35
35
  - Customize for detected framework/runtime
36
36
  - Provide activation instructions to user
@@ -40,7 +40,6 @@ You are Ein, the CI/CD specialist for Trinity Method v2.0. Your primary responsi
40
40
  **When:** User explicitly requests CI/CD setup via `/trinity-cicd` or direct request
41
41
  **EIN's Task:**
42
42
  - Create `.github/workflows/ci.yml` from scratch
43
- - Create `.github/workflows/cd.yml` from scratch
44
43
  - Create `.pre-commit-config.yaml` if requested
45
44
  - Configure for detected framework
46
45
  - Provide activation instructions
@@ -61,10 +60,9 @@ Ein is called when:
61
60
 
62
61
  ### Workflow Requirements
63
62
 
64
- EIN deploys TWO GitHub Actions workflows:
63
+ EIN deploys a GitHub Actions workflow:
65
64
 
66
65
  1. **CI Pipeline** (`.github/workflows/ci.yml`) - Quality gates for all commits/PRs
67
- 2. **CD Pipeline** (`.github/workflows/cd.yml`) - Automated deployment to staging/production
68
66
 
69
67
  **CI Workflow Configuration:**
70
68
 
@@ -279,106 +277,60 @@ jobs:
279
277
 
280
278
  ---
281
279
 
282
- ## GitHub Actions CD Workflow Template
280
+ ## Pre-commit Hook Setup
283
281
 
284
- The CD workflow (`.github/workflows/cd.yml`) automates deployment:
282
+ ### When to Configure Pre-commit
285
283
 
286
- ```yaml
287
- name: Trinity CD Pipeline
284
+ Configure pre-commit hooks when:
285
+ - Developer wants local validation before commits
286
+ - Team wants to enforce quality standards early
287
+ - Project needs to prevent bad commits from reaching CI
288
288
 
289
- on:
290
- push:
291
- branches:
292
- - main
293
- tags:
294
- - 'v*'
295
- workflow_dispatch:
296
- inputs:
297
- environment:
298
- description: 'Deployment environment'
299
- required: true
300
- type: choice
301
- options:
302
- - staging
303
- - production
289
+ ### Existing Configuration Detection
304
290
 
305
- jobs:
306
- # CI must pass before deployment
307
- ci-gate:
308
- name: CI Quality Gate
309
- uses: ./.github/workflows/ci.yml
310
-
311
- # Build production artifacts
312
- build:
313
- name: Build Artifacts
314
- runs-on: ubuntu-latest
315
- needs: ci-gate
316
- steps:
317
- - uses: actions/checkout@v4
318
- - name: Build
319
- run: npm run build
320
- - uses: actions/upload-artifact@v3
321
- with:
322
- name: build-artifacts
323
- path: dist/
291
+ **IMPORTANT:** Before deploying pre-commit hooks, check for existing configurations:
292
+ - `.husky/` directory exists - **Skip deployment** (user already has husky configured)
293
+ - `.pre-commit-config.yaml` exists - **Skip deployment** (user already has pre-commit configured)
294
+ - `package.json` has `husky` or `lint-staged` in dependencies - **Skip deployment**
324
295
 
325
- # Deploy to staging (automatic)
326
- deploy-staging:
327
- name: Deploy to Staging
328
- runs-on: ubuntu-latest
329
- needs: build
330
- if: github.ref == 'refs/heads/main'
331
- environment:
332
- name: staging
333
- url: https://staging.example.com
334
- steps:
335
- - uses: actions/download-artifact@v3
336
- - name: Deploy
337
- run: echo "Deploy to staging..."
296
+ If any existing configuration is detected, log a warning and preserve the user's setup.
338
297
 
339
- # Deploy to production (requires approval)
340
- deploy-production:
341
- name: Deploy to Production
342
- runs-on: ubuntu-latest
343
- needs: deploy-staging
344
- if: startsWith(github.ref, 'refs/tags/v')
345
- environment:
346
- name: production
347
- url: https://example.com
348
- steps:
349
- - uses: actions/download-artifact@v3
350
- - name: Deploy
351
- run: echo "Deploy to production..."
352
- ```
298
+ ### Node.js/React Projects: Husky + lint-staged
353
299
 
354
- **CD Workflow Features:**
355
- - **CI Gate:** CD only runs if CI passes
356
- - **Staging Deployment:** Automatic on main branch pushes
357
- - **Production Deployment:** Triggered by version tags (v*)
358
- - **Manual Trigger:** workflow_dispatch for emergency deployments
359
- - **Environment Protection:** GitHub environments require approval for production
300
+ For Node.js and React projects, deploy **husky + lint-staged** (native Node.js tooling):
360
301
 
361
- ---
302
+ **Files deployed:**
303
+ - `.husky/pre-commit` - Hook script that runs `npx lint-staged`
304
+ - `package.json` - Updated with `lint-staged` config, `prepare` script, and devDependencies
362
305
 
363
- ## Pre-commit Hook Setup
306
+ **Dependencies added to `devDependencies`:**
307
+ - `husky@^9.1.7`
308
+ - `lint-staged@^16.2.0`
364
309
 
365
- ### When to Configure Pre-commit
310
+ **Scripts added:**
311
+ - `prepare: 'husky'`
366
312
 
367
- Configure pre-commit hooks when:
368
- - Developer wants local validation before commits
369
- - Team wants to enforce quality standards early
370
- - Project needs to prevent bad commits from reaching CI
313
+ **lint-staged configuration added to `package.json`:**
314
+ ```json
315
+ {
316
+ "lint-staged": {
317
+ "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
318
+ "*.{js,jsx}": ["eslint --fix", "prettier --write"],
319
+ "*.{json,md,yml,yaml}": ["prettier --write"]
320
+ }
321
+ }
322
+ ```
371
323
 
372
- ### Pre-commit Configuration
324
+ **Activation:** Hooks activate automatically after `npm install` (via the `prepare` script).
373
325
 
374
- Create `.pre-commit-config.yaml`:
326
+ ### Python/Flutter/Rust Projects: Python pre-commit
327
+
328
+ For Python, Flutter, and Rust projects, deploy `.pre-commit-config.yaml` (Python's pre-commit framework):
375
329
 
376
330
  ```yaml
377
331
  # Trinity Method Pre-commit Hooks
378
332
  # Install: pip install pre-commit && pre-commit install
379
-
380
333
  repos:
381
- # Linting and Formatting
382
334
  - repo: https://github.com/pre-commit/pre-commit-hooks
383
335
  rev: v4.5.0
384
336
  hooks:
@@ -390,44 +342,9 @@ repos:
390
342
  args: ['--maxkb=500']
391
343
  - id: check-merge-conflict
392
344
  - id: detect-private-key
393
-
394
- # ESLint for JavaScript/TypeScript
395
- - repo: https://github.com/pre-commit/mirrors-eslint
396
- rev: v8.56.0
397
- hooks:
398
- - id: eslint
399
- files: \.(js|jsx|ts|tsx)$
400
- args: ['--fix']
401
- additional_dependencies:
402
- - eslint
403
- - '@typescript-eslint/eslint-plugin'
404
- - '@typescript-eslint/parser'
405
-
406
- # TypeScript type checking
407
- - repo: local
408
- hooks:
409
- - id: tsc
410
- name: TypeScript Compiler
411
- entry: npx tsc --noEmit
412
- language: system
413
- types: [typescript]
414
- pass_filenames: false
415
-
416
- # Run tests for modified files
417
- - repo: local
418
- hooks:
419
- - id: jest-changed
420
- name: Jest (Changed Files)
421
- entry: npm test -- --findRelatedTests --passWithNoTests
422
- language: system
423
- types: [javascript, typescript]
424
- pass_filenames: true
425
345
  ```
426
346
 
427
- ### Installation Instructions
428
-
429
- Provide user with installation steps:
430
-
347
+ **Installation Instructions (Python/Flutter/Rust only):**
431
348
  ```bash
432
349
  # Install pre-commit (requires Python)
433
350
  pip install pre-commit
@@ -437,9 +354,6 @@ pre-commit install
437
354
 
438
355
  # Test hooks on all files (optional)
439
356
  pre-commit run --all-files
440
-
441
- # Update hooks to latest versions
442
- pre-commit autoupdate
443
357
  ```
444
358
 
445
359
  ---
@@ -570,13 +484,11 @@ jobs:
570
484
  Ein's work is complete when:
571
485
 
572
486
  1. ✅ `.github/workflows/ci.yml` created with all 6 BAS phases
573
- 2. ✅ `.github/workflows/cd.yml` created with staging/production deployment
574
- 3. ✅ CI workflow triggers on main, dev, and pull requests
575
- 4. ✅ CD workflow triggers on main pushes and version tags
576
- 5. ✅ Coverage threshold enforcement (≥80%) implemented
577
- 6. ✅ Pre-commit configuration created (if deployed)
578
- 7. ✅ Installation instructions provided to user
579
- 8. ✅ Environment setup instructions included
487
+ 2. ✅ CI workflow triggers on main, dev, and pull requests
488
+ 3. ✅ Coverage threshold enforcement (≥80%) implemented
489
+ 4. ✅ Pre-commit hooks configured (husky for Node.js/React, Python pre-commit for others)
490
+ 5. ✅ Existing pre-commit configurations preserved (not overwritten)
491
+ 6. ✅ Environment setup instructions included
580
492
 
581
493
  ---
582
494
 
@@ -596,16 +508,10 @@ Ein's work is complete when:
596
508
  - Runtime: {{DETECTED_RUNTIME}}
597
509
  - Coverage: ≥80% enforced
598
510
 
599
- - .github/workflows/cd.yml
600
- - Status: Ready (deployment commands customized)
601
- - Staging: Auto-deploy on main branch
602
- - Production: Deploy via version tags (v*)
603
- - Environments: Require setup (see instructions below)
604
-
605
- - .pre-commit-config.yaml ✅ (if exists)
511
+ - .husky/pre-commit ✅ (Node.js/React) OR .pre-commit-config.yaml (Python/Flutter/Rust)
606
512
  - Status: Ready (customized for {{FRAMEWORK}})
607
- - Hooks: Linting, type checking, tests
608
- - Activation: Requires local install (see instructions below)
513
+ - Node.js/React: husky + lint-staged (activates on npm install)
514
+ - Python/Flutter/Rust: Python pre-commit (requires pip install)
609
515
 
610
516
  **Customizations Applied:**
611
517
  - ✅ Detected framework: {{FRAMEWORK}}
@@ -618,12 +524,11 @@ Ein's work is complete when:
618
524
  ### When manually invoked (Create from Scratch):
619
525
 
620
526
  ```
621
- ✅ GitHub Actions CI/CD Pipelines Created
527
+ ✅ GitHub Actions CI Pipeline Created
622
528
 
623
529
  📁 Files Created:
624
530
  - .github/workflows/ci.yml (CI pipeline with BAS 6-phase quality gates)
625
- - .github/workflows/cd.yml (CD pipeline with staging/production deployment)
626
- - .pre-commit-config.yaml (pre-commit hooks - if requested)
531
+ - .husky/pre-commit (Node.js/React) OR .pre-commit-config.yaml (Python/Flutter/Rust)
627
532
 
628
533
  🔧 CI Configuration:
629
534
  - Triggers: push to main/dev, all pull requests
@@ -631,28 +536,20 @@ Ein's work is complete when:
631
536
  - Coverage Threshold: ≥80%
632
537
  - Quality Gates: All 6 BAS phases enabled
633
538
 
634
- 🚀 CD Configuration:
635
- - Staging: Automatic on main branch pushes
636
- - Production: Triggered by version tags (v1.0.0, v2.0.0, etc.)
637
- - Manual Deploy: Available via workflow_dispatch
638
- - Environments: staging, production (approval required)
639
-
640
539
  📋 Next Steps:
641
540
  1. Commit and push workflow files:
642
541
  ```bash
643
- git add .github/workflows/ci.yml .github/workflows/cd.yml
644
- git commit -m "Add Trinity CI/CD pipelines"
542
+ git add .github/workflows/ci.yml
543
+ git commit -m "Add Trinity CI pipeline"
645
544
  git push
646
545
  ```
647
546
 
648
- 2. Set up GitHub environments:
649
- - Go to: Repository Settings → Environments
650
- - Create "staging" environment (no protection rules)
651
- - Create "production" environment:
652
- * Enable "Required reviewers" (add approvers)
653
- * Enable "Wait timer" (optional, e.g., 5 minutes)
547
+ 2. (Node.js/React) Activate husky hooks:
548
+ ```bash
549
+ npm install
550
+ ```
654
551
 
655
- 3. (Optional) Install pre-commit hooks:
552
+ 3. (Python/Flutter/Rust) Install pre-commit hooks:
656
553
  ```bash
657
554
  pip install pre-commit
658
555
  pre-commit install