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.
- package/CHANGELOG.md +116 -0
- package/LICENSE +21 -0
- package/README.md +555 -0
- package/dist/cli/commands/deploy/agents.d.ts +14 -0
- package/dist/cli/commands/deploy/agents.js +59 -0
- package/dist/cli/commands/deploy/ci-cd.d.ts +13 -0
- package/dist/cli/commands/deploy/ci-cd.js +50 -0
- package/dist/cli/commands/deploy/claude-setup.d.ts +17 -0
- package/dist/cli/commands/deploy/claude-setup.js +91 -0
- package/dist/cli/commands/deploy/configuration.d.ts +13 -0
- package/dist/cli/commands/deploy/configuration.js +215 -0
- package/dist/cli/commands/deploy/directories.d.ts +12 -0
- package/dist/cli/commands/deploy/directories.js +38 -0
- package/dist/cli/commands/deploy/gitignore.d.ts +12 -0
- package/dist/cli/commands/deploy/gitignore.js +53 -0
- package/dist/cli/commands/deploy/index.d.ts +38 -0
- package/dist/cli/commands/deploy/index.js +156 -0
- package/dist/cli/commands/deploy/knowledge-base.d.ts +16 -0
- package/dist/cli/commands/deploy/knowledge-base.js +75 -0
- package/dist/cli/commands/deploy/linting.d.ts +18 -0
- package/dist/cli/commands/deploy/linting.js +51 -0
- package/dist/cli/commands/deploy/metrics.d.ts +13 -0
- package/dist/cli/commands/deploy/metrics.js +34 -0
- package/dist/cli/commands/deploy/pre-flight.d.ts +13 -0
- package/dist/cli/commands/deploy/pre-flight.js +29 -0
- package/dist/cli/commands/deploy/root-files.d.ts +16 -0
- package/dist/cli/commands/deploy/root-files.js +178 -0
- package/dist/cli/commands/deploy/sdk-install.d.ts +12 -0
- package/dist/cli/commands/deploy/sdk-install.js +57 -0
- package/dist/cli/commands/deploy/summary.d.ts +14 -0
- package/dist/cli/commands/deploy/summary.js +130 -0
- package/dist/cli/commands/deploy/templates.d.ts +14 -0
- package/dist/cli/commands/deploy/templates.js +84 -0
- package/dist/cli/commands/deploy/types.d.ts +39 -0
- package/dist/cli/commands/deploy/types.js +5 -0
- package/dist/cli/commands/update/agents.d.ts +14 -0
- package/dist/cli/commands/update/agents.js +31 -0
- package/dist/cli/commands/update/backup.d.ts +31 -0
- package/dist/cli/commands/update/backup.js +97 -0
- package/dist/cli/commands/update/commands.d.ts +14 -0
- package/dist/cli/commands/update/commands.js +75 -0
- package/dist/cli/commands/update/index.d.ts +15 -0
- package/dist/cli/commands/update/index.js +118 -0
- package/dist/cli/commands/update/knowledge-base.d.ts +14 -0
- package/dist/cli/commands/update/knowledge-base.js +38 -0
- package/dist/cli/commands/update/pre-flight.d.ts +13 -0
- package/dist/cli/commands/update/pre-flight.js +37 -0
- package/dist/cli/commands/update/summary.d.ts +20 -0
- package/dist/cli/commands/update/summary.js +47 -0
- package/dist/cli/commands/update/templates.d.ts +14 -0
- package/dist/cli/commands/update/templates.js +25 -0
- package/dist/cli/commands/update/types.d.ts +13 -0
- package/dist/cli/commands/update/types.js +7 -0
- package/dist/cli/commands/update/utils.d.ts +11 -0
- package/dist/cli/commands/update/utils.js +19 -0
- package/dist/cli/commands/update/verification.d.ts +20 -0
- package/dist/cli/commands/update/verification.js +54 -0
- package/dist/cli/commands/update/version.d.ts +18 -0
- package/dist/cli/commands/update/version.js +36 -0
- package/dist/cli/commands/update.d.ts +7 -0
- package/dist/cli/commands/update.js +7 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +36 -0
- package/dist/cli/types.d.ts +77 -0
- package/dist/cli/types.js +5 -0
- package/dist/cli/utils/deploy-ci.d.ts +22 -0
- package/dist/cli/utils/deploy-ci.js +138 -0
- package/dist/cli/utils/deploy-linting.d.ts +3 -0
- package/dist/cli/utils/deploy-linting.js +136 -0
- package/dist/cli/utils/detect-stack.d.ts +3 -0
- package/dist/cli/utils/detect-stack.js +270 -0
- package/dist/cli/utils/error-classes.d.ts +63 -0
- package/dist/cli/utils/error-classes.js +84 -0
- package/dist/cli/utils/error-handler.d.ts +59 -0
- package/dist/cli/utils/error-handler.js +127 -0
- package/dist/cli/utils/errors.d.ts +52 -0
- package/dist/cli/utils/errors.js +102 -0
- package/dist/cli/utils/get-sdk-path.d.ts +18 -0
- package/dist/cli/utils/get-sdk-path.js +31 -0
- package/dist/cli/utils/inject-dependencies.d.ts +2 -0
- package/dist/cli/utils/inject-dependencies.js +55 -0
- package/dist/cli/utils/linting-tools.d.ts +8 -0
- package/dist/cli/utils/linting-tools.js +206 -0
- package/dist/cli/utils/metrics/code-quality.d.ts +32 -0
- package/dist/cli/utils/metrics/code-quality.js +122 -0
- package/dist/cli/utils/metrics/dependency-parser.d.ts +21 -0
- package/dist/cli/utils/metrics/dependency-parser.js +153 -0
- package/dist/cli/utils/metrics/file-complexity.d.ts +26 -0
- package/dist/cli/utils/metrics/file-complexity.js +77 -0
- package/dist/cli/utils/metrics/framework-detector.d.ts +17 -0
- package/dist/cli/utils/metrics/framework-detector.js +120 -0
- package/dist/cli/utils/metrics/git-metrics.d.ts +30 -0
- package/dist/cli/utils/metrics/git-metrics.js +83 -0
- package/dist/cli/utils/metrics/index.d.ts +28 -0
- package/dist/cli/utils/metrics/index.js +100 -0
- package/dist/cli/utils/template-processor.d.ts +10 -0
- package/dist/cli/utils/template-processor.js +188 -0
- package/dist/cli/utils/validate-path.d.ts +80 -0
- package/dist/cli/utils/validate-path.js +180 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8 -0
- package/dist/templates/agents/aj-team/apo-documentation-specialist.md.template +572 -0
- package/dist/templates/agents/aj-team/bas-quality-gate.md.template +906 -0
- package/dist/templates/agents/aj-team/bon-dependency-manager.md.template +636 -0
- package/dist/templates/agents/aj-team/cap-configuration-specialist.md.template +670 -0
- package/dist/templates/agents/aj-team/dra-code-reviewer.md.template +768 -0
- package/dist/templates/agents/aj-team/kil-task-executor.md.template +764 -0
- package/dist/templates/agents/aj-team/uro-refactoring-specialist.md.template +759 -0
- package/dist/templates/agents/audit/juno-auditor.md.template +447 -0
- package/dist/templates/agents/deployment/ein-cicd.md.template +694 -0
- package/dist/templates/agents/deployment/ino-context.md.template +733 -0
- package/dist/templates/agents/deployment/tan-structure.md.template +661 -0
- package/dist/templates/agents/deployment/zen-knowledge.md.template +451 -0
- package/dist/templates/agents/leadership/aj-cc.md.template +462 -0
- package/dist/templates/agents/leadership/aj-maestro.md.template +943 -0
- package/dist/templates/agents/leadership/aly-cto.md.template +407 -0
- package/dist/templates/agents/planning/eus-decomposer.md.template +496 -0
- package/dist/templates/agents/planning/mon-requirements.md.template +323 -0
- package/dist/templates/agents/planning/ror-design.md.template +465 -0
- package/dist/templates/agents/planning/tra-planner.md.template +432 -0
- package/dist/templates/ci/cd.yml.template +175 -0
- package/dist/templates/ci/ci.yml.template +196 -0
- package/dist/templates/ci/generic-ci.yml +115 -0
- package/dist/templates/ci/github-actions.yml +86 -0
- package/dist/templates/ci/gitlab-ci.yml +103 -0
- package/dist/templates/claude/EMPLOYEE-DIRECTORY.md.template +545 -0
- package/dist/templates/documentation/ROOT-README.md.template +307 -0
- package/dist/templates/documentation/SUBDIRECTORY-README.md.template +261 -0
- package/dist/templates/investigations/bug.md.template +484 -0
- package/dist/templates/investigations/feature.md.template +564 -0
- package/dist/templates/investigations/performance.md.template +625 -0
- package/dist/templates/investigations/security.md.template +714 -0
- package/dist/templates/investigations/technical.md.template +433 -0
- package/dist/templates/knowledge-base/AI-DEVELOPMENT-GUIDE.md.template +957 -0
- package/dist/templates/knowledge-base/ARCHITECTURE.md.template +452 -0
- package/dist/templates/knowledge-base/CODING-PRINCIPLES.md.template +750 -0
- package/dist/templates/knowledge-base/DOCUMENTATION-CRITERIA.md.template +1118 -0
- package/dist/templates/knowledge-base/ISSUES.md.template +539 -0
- package/dist/templates/knowledge-base/TESTING-PRINCIPLES.md.template +894 -0
- package/dist/templates/knowledge-base/Technical-Debt.md.template +640 -0
- package/dist/templates/knowledge-base/To-do.md.template +407 -0
- package/dist/templates/knowledge-base/Trinity.md.template +464 -0
- package/dist/templates/linting/flutter/.pre-commit-config.yaml.template +27 -0
- package/dist/templates/linting/flutter/analysis_options.yaml.template +26 -0
- package/dist/templates/linting/nodejs/.eslintrc-commonjs.json.template +19 -0
- package/dist/templates/linting/nodejs/.eslintrc-esm.json.template +19 -0
- package/dist/templates/linting/nodejs/.eslintrc-typescript.json.template +22 -0
- package/dist/templates/linting/nodejs/.pre-commit-config.yaml.template +51 -0
- package/dist/templates/linting/nodejs/.prettierrc.json.template +10 -0
- package/dist/templates/linting/python/.flake8.template +16 -0
- package/dist/templates/linting/python/.pre-commit-config.yaml.template +30 -0
- package/dist/templates/linting/python/pyproject.toml.template +38 -0
- package/dist/templates/linting/rust/.pre-commit-config.yaml.template +28 -0
- package/dist/templates/linting/rust/clippy.toml.template +14 -0
- package/dist/templates/linting/rust/rustfmt.toml.template +12 -0
- package/dist/templates/root/CLAUDE.md.template +65 -0
- package/dist/templates/root/TRINITY.md.template +52 -0
- package/dist/templates/shared/claude-commands/trinity-agents.md.template +168 -0
- package/dist/templates/shared/claude-commands/trinity-audit.md.template +646 -0
- package/dist/templates/shared/claude-commands/trinity-changelog.md.template +624 -0
- package/dist/templates/shared/claude-commands/trinity-continue.md.template +549 -0
- package/dist/templates/shared/claude-commands/trinity-create-investigation.md.template +232 -0
- package/dist/templates/shared/claude-commands/trinity-decompose.md.template +181 -0
- package/dist/templates/shared/claude-commands/trinity-design.md.template +347 -0
- package/dist/templates/shared/claude-commands/trinity-docs.md.template +2093 -0
- package/dist/templates/shared/claude-commands/trinity-end.md.template +397 -0
- package/dist/templates/shared/claude-commands/trinity-init.md.template +606 -0
- package/dist/templates/shared/claude-commands/trinity-investigate-templates.md.template +725 -0
- package/dist/templates/shared/claude-commands/trinity-orchestrate.md.template +1061 -0
- package/dist/templates/shared/claude-commands/trinity-plan-investigation.md.template +135 -0
- package/dist/templates/shared/claude-commands/trinity-plan.md.template +201 -0
- package/dist/templates/shared/claude-commands/trinity-readme.md.template +1971 -0
- package/dist/templates/shared/claude-commands/trinity-requirements.md.template +148 -0
- package/dist/templates/shared/claude-commands/trinity-start.md.template +268 -0
- package/dist/templates/shared/claude-commands/trinity-verify.md.template +453 -0
- package/dist/templates/shared/claude-commands/trinity-workorder.md.template +249 -0
- package/dist/templates/source/base-CLAUDE.md.template +310 -0
- package/dist/templates/source/flutter-CLAUDE.md.template +593 -0
- package/dist/templates/source/nodejs-CLAUDE.md.template +531 -0
- package/dist/templates/source/python-CLAUDE.md.template +510 -0
- package/dist/templates/source/react-CLAUDE.md.template +513 -0
- package/dist/templates/source/rust-CLAUDE.md.template +653 -0
- package/dist/templates/source/tests-CLAUDE.md.template +432 -0
- package/dist/templates/trinity/CLAUDE.md.template +372 -0
- package/dist/templates/work-orders/ANALYSIS-TEMPLATE.md.template +276 -0
- package/dist/templates/work-orders/AUDIT-TEMPLATE.md.template +262 -0
- package/dist/templates/work-orders/IMPLEMENTATION-TEMPLATE.md.template +260 -0
- package/dist/templates/work-orders/INVESTIGATION-TEMPLATE.md.template +206 -0
- package/dist/templates/work-orders/PATTERN-TEMPLATE.md.template +320 -0
- package/dist/templates/work-orders/VERIFICATION-TEMPLATE.md.template +273 -0
- package/package.json +94 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# {{PROJECT_NAME}} - Trinity Method CI/CD Pipeline
|
|
2
|
+
# Trinity Method v{{TRINITY_VERSION}}
|
|
3
|
+
# Framework: {{FRAMEWORK}}
|
|
4
|
+
# Generated by: EIN (CI/CD Specialist)
|
|
5
|
+
|
|
6
|
+
name: Trinity CI/CD Pipeline
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- dev
|
|
13
|
+
pull_request:
|
|
14
|
+
branches:
|
|
15
|
+
- main
|
|
16
|
+
- dev
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
trinity-quality-gates:
|
|
20
|
+
name: Trinity BAS 6-Phase Quality Gates
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
|
|
23
|
+
strategy:
|
|
24
|
+
matrix:
|
|
25
|
+
node-version: [20.x]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout code
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0 # Full history for better analysis
|
|
32
|
+
|
|
33
|
+
# Setup Node.js
|
|
34
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
35
|
+
uses: actions/setup-node@v4
|
|
36
|
+
with:
|
|
37
|
+
node-version: ${{ matrix.node-version }}
|
|
38
|
+
cache: 'npm'
|
|
39
|
+
|
|
40
|
+
# Install dependencies
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: npm ci
|
|
43
|
+
|
|
44
|
+
# =============================================
|
|
45
|
+
# BAS PHASE 1: Linting (with auto-fix)
|
|
46
|
+
# =============================================
|
|
47
|
+
- name: 'BAS Phase 1: Linting'
|
|
48
|
+
id: lint
|
|
49
|
+
run: |
|
|
50
|
+
echo "🔍 Running ESLint with auto-fix..."
|
|
51
|
+
npm run lint -- --fix || npm run lint:fix || npx eslint . --fix || true
|
|
52
|
+
echo "✅ Linting phase complete"
|
|
53
|
+
|
|
54
|
+
# =============================================
|
|
55
|
+
# BAS PHASE 2: Structure Validation
|
|
56
|
+
# =============================================
|
|
57
|
+
- name: 'BAS Phase 2: Structure Validation'
|
|
58
|
+
id: structure
|
|
59
|
+
run: |
|
|
60
|
+
echo "🔍 Validating project structure..."
|
|
61
|
+
|
|
62
|
+
# Check required directories exist
|
|
63
|
+
dirs=("src" "tests" "trinity" ".claude")
|
|
64
|
+
for dir in "${dirs[@]}"; do
|
|
65
|
+
if [ ! -d "$dir" ]; then
|
|
66
|
+
echo "❌ Required directory missing: $dir"
|
|
67
|
+
exit 1
|
|
68
|
+
fi
|
|
69
|
+
done
|
|
70
|
+
|
|
71
|
+
# Check package.json has required scripts
|
|
72
|
+
if ! grep -q '"test"' package.json; then
|
|
73
|
+
echo "❌ package.json missing 'test' script"
|
|
74
|
+
exit 1
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
echo "✅ Structure validation complete"
|
|
78
|
+
|
|
79
|
+
# =============================================
|
|
80
|
+
# BAS PHASE 3: Build Validation
|
|
81
|
+
# =============================================
|
|
82
|
+
- name: 'BAS Phase 3: Build Validation'
|
|
83
|
+
id: build
|
|
84
|
+
run: |
|
|
85
|
+
echo "🔨 Building project..."
|
|
86
|
+
npm run build
|
|
87
|
+
echo "✅ Build validation complete"
|
|
88
|
+
|
|
89
|
+
# =============================================
|
|
90
|
+
# BAS PHASE 4: Testing (All Tests Pass)
|
|
91
|
+
# =============================================
|
|
92
|
+
- name: 'BAS Phase 4: Testing'
|
|
93
|
+
id: tests
|
|
94
|
+
run: |
|
|
95
|
+
echo "🧪 Running all tests..."
|
|
96
|
+
npm test
|
|
97
|
+
echo "✅ All tests passed"
|
|
98
|
+
|
|
99
|
+
# =============================================
|
|
100
|
+
# BAS PHASE 5: Coverage Check (≥80%)
|
|
101
|
+
# =============================================
|
|
102
|
+
- name: 'BAS Phase 5: Coverage Check'
|
|
103
|
+
id: coverage
|
|
104
|
+
run: |
|
|
105
|
+
echo "📊 Checking test coverage..."
|
|
106
|
+
npm test -- --coverage
|
|
107
|
+
|
|
108
|
+
# Check coverage threshold
|
|
109
|
+
echo "Validating coverage meets 80% threshold..."
|
|
110
|
+
|
|
111
|
+
# Extract coverage percentage (adjust based on your coverage tool)
|
|
112
|
+
# This example works with Jest coverage output
|
|
113
|
+
if [ -f "coverage/coverage-summary.json" ]; then
|
|
114
|
+
coverage=$(node -e "const c = require('./coverage/coverage-summary.json'); console.log(c.total.lines.pct);")
|
|
115
|
+
threshold=80
|
|
116
|
+
|
|
117
|
+
if (( $(echo "$coverage < $threshold" | bc -l) )); then
|
|
118
|
+
echo "❌ Coverage $coverage% is below threshold $threshold%"
|
|
119
|
+
exit 1
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
echo "✅ Coverage $coverage% meets threshold $threshold%"
|
|
123
|
+
else
|
|
124
|
+
echo "⚠️ coverage-summary.json not found, skipping threshold check"
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
echo "✅ Coverage validation complete"
|
|
128
|
+
|
|
129
|
+
# =============================================
|
|
130
|
+
# BAS PHASE 6: Best Practices Validation
|
|
131
|
+
# =============================================
|
|
132
|
+
- name: 'BAS Phase 6: Best Practices'
|
|
133
|
+
id: practices
|
|
134
|
+
run: |
|
|
135
|
+
echo "📋 Validating best practices..."
|
|
136
|
+
|
|
137
|
+
# Check for common issues
|
|
138
|
+
issues=0
|
|
139
|
+
|
|
140
|
+
# Check: No console.log in production code (allow in tests)
|
|
141
|
+
if grep -r "console\.log" src/ --exclude-dir=__tests__ 2>/dev/null | grep -v "//.*console\.log"; then
|
|
142
|
+
echo "⚠️ Found console.log in production code"
|
|
143
|
+
issues=$((issues+1))
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
# Check: No TODO comments without issue references
|
|
147
|
+
if grep -r "TODO" src/ 2>/dev/null | grep -v "TODO(#" | grep -v "//.*TODO:.*#"; then
|
|
148
|
+
echo "⚠️ Found TODO without issue reference"
|
|
149
|
+
issues=$((issues+1))
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
# Check: TypeScript strict mode enabled
|
|
153
|
+
if [ -f "tsconfig.json" ]; then
|
|
154
|
+
if ! grep -q '"strict": true' tsconfig.json; then
|
|
155
|
+
echo "⚠️ TypeScript strict mode not enabled"
|
|
156
|
+
issues=$((issues+1))
|
|
157
|
+
fi
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
if [ $issues -gt 0 ]; then
|
|
161
|
+
echo "⚠️ Found $issues best practice issues (warnings only)"
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
echo "✅ Best practices validation complete"
|
|
165
|
+
|
|
166
|
+
# =============================================
|
|
167
|
+
# Coverage Upload (Optional - Codecov)
|
|
168
|
+
# =============================================
|
|
169
|
+
- name: Upload coverage to Codecov
|
|
170
|
+
if: success()
|
|
171
|
+
uses: codecov/codecov-action@v4
|
|
172
|
+
with:
|
|
173
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
174
|
+
files: ./coverage/lcov.info
|
|
175
|
+
flags: unittests
|
|
176
|
+
name: codecov-umbrella
|
|
177
|
+
fail_ci_if_error: false # Don't fail CI if Codecov upload fails
|
|
178
|
+
|
|
179
|
+
# =============================================
|
|
180
|
+
# Trinity Quality Summary
|
|
181
|
+
# =============================================
|
|
182
|
+
- name: Trinity Quality Summary
|
|
183
|
+
if: always()
|
|
184
|
+
run: |
|
|
185
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
186
|
+
echo " Trinity BAS 6-Phase Quality Gates"
|
|
187
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
188
|
+
echo ""
|
|
189
|
+
echo "Phase 1: Linting - ${{ steps.lint.outcome }}"
|
|
190
|
+
echo "Phase 2: Structure - ${{ steps.structure.outcome }}"
|
|
191
|
+
echo "Phase 3: Build - ${{ steps.build.outcome }}"
|
|
192
|
+
echo "Phase 4: Tests - ${{ steps.tests.outcome }}"
|
|
193
|
+
echo "Phase 5: Coverage (≥80%) - ${{ steps.coverage.outcome }}"
|
|
194
|
+
echo "Phase 6: Best Practices - ${{ steps.practices.outcome }}"
|
|
195
|
+
echo ""
|
|
196
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Generic CI/CD Template for Trinity Method
|
|
2
|
+
#
|
|
3
|
+
# This template can be adapted for various CI/CD platforms including:
|
|
4
|
+
# - Jenkins, CircleCI, Travis CI, Bitbucket Pipelines, Azure Pipelines, etc.
|
|
5
|
+
#
|
|
6
|
+
# Adapt the syntax to your platform's requirements
|
|
7
|
+
|
|
8
|
+
# ====================
|
|
9
|
+
# Environment Setup
|
|
10
|
+
# ====================
|
|
11
|
+
environment:
|
|
12
|
+
node_version: '20.x'
|
|
13
|
+
ci: true
|
|
14
|
+
|
|
15
|
+
# ====================
|
|
16
|
+
# Dependencies
|
|
17
|
+
# ====================
|
|
18
|
+
install_dependencies:
|
|
19
|
+
command: npm ci
|
|
20
|
+
cache:
|
|
21
|
+
- node_modules/
|
|
22
|
+
|
|
23
|
+
# ====================
|
|
24
|
+
# Linting Stage
|
|
25
|
+
# ====================
|
|
26
|
+
lint:
|
|
27
|
+
stage: test
|
|
28
|
+
command: npm run lint
|
|
29
|
+
allow_failure: true
|
|
30
|
+
run_on:
|
|
31
|
+
- main
|
|
32
|
+
- dev
|
|
33
|
+
- develop
|
|
34
|
+
- pull_requests
|
|
35
|
+
|
|
36
|
+
# ====================
|
|
37
|
+
# Testing Stage
|
|
38
|
+
# ====================
|
|
39
|
+
test:
|
|
40
|
+
stage: test
|
|
41
|
+
matrix:
|
|
42
|
+
node_version: ['18.x', '20.x']
|
|
43
|
+
commands:
|
|
44
|
+
- npm test
|
|
45
|
+
artifacts:
|
|
46
|
+
- coverage/
|
|
47
|
+
run_on:
|
|
48
|
+
- main
|
|
49
|
+
- dev
|
|
50
|
+
- develop
|
|
51
|
+
- pull_requests
|
|
52
|
+
|
|
53
|
+
test_with_coverage:
|
|
54
|
+
stage: test
|
|
55
|
+
node_version: '20.x'
|
|
56
|
+
commands:
|
|
57
|
+
- npm run test:coverage
|
|
58
|
+
artifacts:
|
|
59
|
+
- coverage/
|
|
60
|
+
- coverage/lcov.info
|
|
61
|
+
coverage_report: coverage/lcov.info
|
|
62
|
+
run_on:
|
|
63
|
+
- main
|
|
64
|
+
- dev
|
|
65
|
+
- develop
|
|
66
|
+
|
|
67
|
+
# ====================
|
|
68
|
+
# Build Stage
|
|
69
|
+
# ====================
|
|
70
|
+
build:
|
|
71
|
+
stage: build
|
|
72
|
+
depends_on:
|
|
73
|
+
- test
|
|
74
|
+
commands:
|
|
75
|
+
- npm run build || echo "No build script configured"
|
|
76
|
+
artifacts:
|
|
77
|
+
- dist/
|
|
78
|
+
- build/
|
|
79
|
+
run_on:
|
|
80
|
+
- main
|
|
81
|
+
- dev
|
|
82
|
+
- develop
|
|
83
|
+
|
|
84
|
+
# ====================
|
|
85
|
+
# Trinity Method Deployment Stage
|
|
86
|
+
# ====================
|
|
87
|
+
deploy_trinity:
|
|
88
|
+
stage: deploy
|
|
89
|
+
node_version: '20.x'
|
|
90
|
+
depends_on:
|
|
91
|
+
- test_with_coverage
|
|
92
|
+
- build
|
|
93
|
+
commands:
|
|
94
|
+
- npx trinity deploy --agent claude --ci-deploy --yes
|
|
95
|
+
artifacts:
|
|
96
|
+
- trinity/
|
|
97
|
+
- CLAUDE.md
|
|
98
|
+
run_on:
|
|
99
|
+
- main
|
|
100
|
+
- dev
|
|
101
|
+
when: on_success
|
|
102
|
+
|
|
103
|
+
# ====================
|
|
104
|
+
# Configuration Notes
|
|
105
|
+
# ====================
|
|
106
|
+
#
|
|
107
|
+
# 1. Ensure your CI environment has Node.js installed
|
|
108
|
+
# 2. Set CI=true environment variable for CI detection
|
|
109
|
+
# 3. Configure artifact storage according to your platform
|
|
110
|
+
# 4. Adjust branch names to match your repository's branching strategy
|
|
111
|
+
# 5. Add platform-specific authentication if needed for deployment
|
|
112
|
+
# 6. Consider adding notification steps for failures
|
|
113
|
+
# 7. Customize caching strategy based on platform capabilities
|
|
114
|
+
#
|
|
115
|
+
# Trinity Method CLI Documentation: https://github.com/trinity-method/sdk
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: Trinity Method CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, dev, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, dev, develop]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
node-version: [18.x, 20.x]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout code
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node-version }}
|
|
26
|
+
cache: 'npm'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm ci
|
|
30
|
+
|
|
31
|
+
- name: Run linting
|
|
32
|
+
run: npm run lint
|
|
33
|
+
continue-on-error: true
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: npm test
|
|
37
|
+
|
|
38
|
+
- name: Run tests with coverage
|
|
39
|
+
run: npm run test:coverage
|
|
40
|
+
if: matrix.node-version == '20.x'
|
|
41
|
+
|
|
42
|
+
- name: Upload coverage reports
|
|
43
|
+
uses: codecov/codecov-action@v3
|
|
44
|
+
if: matrix.node-version == '20.x'
|
|
45
|
+
with:
|
|
46
|
+
files: ./coverage/lcov.info
|
|
47
|
+
flags: unittests
|
|
48
|
+
name: codecov-umbrella
|
|
49
|
+
fail_ci_if_error: false
|
|
50
|
+
|
|
51
|
+
- name: Deploy Trinity Method structure
|
|
52
|
+
if: success() && matrix.node-version == '20.x'
|
|
53
|
+
run: npx trinity deploy --agent claude --ci-deploy --yes
|
|
54
|
+
env:
|
|
55
|
+
CI: true
|
|
56
|
+
|
|
57
|
+
build:
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
needs: test
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- name: Checkout code
|
|
63
|
+
uses: actions/checkout@v4
|
|
64
|
+
|
|
65
|
+
- name: Setup Node.js
|
|
66
|
+
uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version: '20.x'
|
|
69
|
+
cache: 'npm'
|
|
70
|
+
|
|
71
|
+
- name: Install dependencies
|
|
72
|
+
run: npm ci
|
|
73
|
+
|
|
74
|
+
- name: Build project
|
|
75
|
+
run: npm run build
|
|
76
|
+
continue-on-error: true
|
|
77
|
+
|
|
78
|
+
- name: Archive build artifacts
|
|
79
|
+
uses: actions/upload-artifact@v3
|
|
80
|
+
if: success()
|
|
81
|
+
with:
|
|
82
|
+
name: build-artifacts
|
|
83
|
+
path: |
|
|
84
|
+
dist/
|
|
85
|
+
build/
|
|
86
|
+
retention-days: 7
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- test
|
|
3
|
+
- build
|
|
4
|
+
- deploy
|
|
5
|
+
|
|
6
|
+
variables:
|
|
7
|
+
NODE_VERSION: '20'
|
|
8
|
+
CI: 'true'
|
|
9
|
+
|
|
10
|
+
.node_template: &node_template
|
|
11
|
+
image: node:${NODE_VERSION}
|
|
12
|
+
cache:
|
|
13
|
+
key: ${CI_COMMIT_REF_SLUG}
|
|
14
|
+
paths:
|
|
15
|
+
- node_modules/
|
|
16
|
+
- .npm/
|
|
17
|
+
before_script:
|
|
18
|
+
- npm ci --cache .npm --prefer-offline
|
|
19
|
+
|
|
20
|
+
test:lint:
|
|
21
|
+
<<: *node_template
|
|
22
|
+
stage: test
|
|
23
|
+
script:
|
|
24
|
+
- npm run lint || true
|
|
25
|
+
allow_failure: true
|
|
26
|
+
only:
|
|
27
|
+
- main
|
|
28
|
+
- dev
|
|
29
|
+
- develop
|
|
30
|
+
- merge_requests
|
|
31
|
+
|
|
32
|
+
test:unit:
|
|
33
|
+
<<: *node_template
|
|
34
|
+
stage: test
|
|
35
|
+
parallel:
|
|
36
|
+
matrix:
|
|
37
|
+
- NODE_VERSION: ['18', '20']
|
|
38
|
+
script:
|
|
39
|
+
- npm test
|
|
40
|
+
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
|
|
41
|
+
artifacts:
|
|
42
|
+
when: always
|
|
43
|
+
reports:
|
|
44
|
+
junit: junit.xml
|
|
45
|
+
coverage_report:
|
|
46
|
+
coverage_format: cobertura
|
|
47
|
+
path: coverage/cobertura-coverage.xml
|
|
48
|
+
only:
|
|
49
|
+
- main
|
|
50
|
+
- dev
|
|
51
|
+
- develop
|
|
52
|
+
- merge_requests
|
|
53
|
+
|
|
54
|
+
test:coverage:
|
|
55
|
+
<<: *node_template
|
|
56
|
+
stage: test
|
|
57
|
+
script:
|
|
58
|
+
- npm run test:coverage
|
|
59
|
+
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
|
|
60
|
+
artifacts:
|
|
61
|
+
paths:
|
|
62
|
+
- coverage/
|
|
63
|
+
expire_in: 30 days
|
|
64
|
+
reports:
|
|
65
|
+
coverage_report:
|
|
66
|
+
coverage_format: cobertura
|
|
67
|
+
path: coverage/cobertura-coverage.xml
|
|
68
|
+
only:
|
|
69
|
+
- main
|
|
70
|
+
- dev
|
|
71
|
+
- develop
|
|
72
|
+
|
|
73
|
+
build:
|
|
74
|
+
<<: *node_template
|
|
75
|
+
stage: build
|
|
76
|
+
needs: ['test:unit']
|
|
77
|
+
script:
|
|
78
|
+
- npm run build || echo "No build script found"
|
|
79
|
+
artifacts:
|
|
80
|
+
paths:
|
|
81
|
+
- dist/
|
|
82
|
+
- build/
|
|
83
|
+
expire_in: 7 days
|
|
84
|
+
only:
|
|
85
|
+
- main
|
|
86
|
+
- dev
|
|
87
|
+
- develop
|
|
88
|
+
|
|
89
|
+
deploy:trinity:
|
|
90
|
+
<<: *node_template
|
|
91
|
+
stage: deploy
|
|
92
|
+
needs: ['test:coverage', 'build']
|
|
93
|
+
script:
|
|
94
|
+
- npx trinity deploy --agent claude --ci-deploy --yes
|
|
95
|
+
artifacts:
|
|
96
|
+
paths:
|
|
97
|
+
- trinity/
|
|
98
|
+
- CLAUDE.md
|
|
99
|
+
expire_in: 30 days
|
|
100
|
+
only:
|
|
101
|
+
- main
|
|
102
|
+
- dev
|
|
103
|
+
when: on_success
|