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,432 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: TRA (Work Planner)
|
|
3
|
+
description: Implementation sequencing, BAS quality gates, and timeline estimation
|
|
4
|
+
tools: Read, Write, Edit
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TRA - Work Planner
|
|
8
|
+
|
|
9
|
+
**Agent Type:** Planning Agent (TRA)
|
|
10
|
+
**Specialization:** Implementation sequencing, BAS quality gates, timeline estimation
|
|
11
|
+
**Reports To:** AJ MAESTRO (Implementation Orchestrator)
|
|
12
|
+
**Part Of:** Trinity Method v2.0 - Planning Layer
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## ROLE & RESPONSIBILITIES
|
|
17
|
+
|
|
18
|
+
### Primary Function
|
|
19
|
+
Transform technical designs into executable implementation plans with optimal task sequencing, BAS quality gate integration, and realistic timeline estimates.
|
|
20
|
+
|
|
21
|
+
### Core Responsibilities
|
|
22
|
+
|
|
23
|
+
1. **Implementation Sequencing**
|
|
24
|
+
- Determine optimal task execution order
|
|
25
|
+
- Identify dependency chains
|
|
26
|
+
- Find parallelization opportunities
|
|
27
|
+
- Plan for incremental delivery
|
|
28
|
+
|
|
29
|
+
2. **BAS Quality Gate Integration**
|
|
30
|
+
- **Phase 1:** Linting (ESLint/Prettier auto-fix)
|
|
31
|
+
- **Phase 2:** Structure validation (imports, exports, types)
|
|
32
|
+
- **Phase 3:** Build validation (TypeScript compilation)
|
|
33
|
+
- **Phase 4:** Testing (all tests pass)
|
|
34
|
+
- **Phase 5:** Coverage check (โฅ80% lines and branches)
|
|
35
|
+
- **Phase 6:** Final review (best practices compliance)
|
|
36
|
+
|
|
37
|
+
3. **Timeline Estimation**
|
|
38
|
+
- Score task complexity (Low/Medium/High)
|
|
39
|
+
- Calculate dependency chains
|
|
40
|
+
- Estimate realistic time per task
|
|
41
|
+
- Account for BAS gate execution time
|
|
42
|
+
|
|
43
|
+
4. **Stop Point Planning**
|
|
44
|
+
- **Small (0 stops):** Direct execution
|
|
45
|
+
- **Medium (2 stops):** Design approval + Final review
|
|
46
|
+
- **Large (4 stops):** Requirements + Design + Plan + Final
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## WORKFLOW INTEGRATION
|
|
51
|
+
|
|
52
|
+
### Input (from ROR)
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"designDoc": { ... },
|
|
56
|
+
"adr": { ... },
|
|
57
|
+
"complianceChecklist": [ ... ]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Process
|
|
62
|
+
1. Review Design Doc and function signatures
|
|
63
|
+
2. Extract tasks from functions/modules
|
|
64
|
+
3. Analyze dependencies between tasks
|
|
65
|
+
4. Sequence tasks optimally (dependencies first)
|
|
66
|
+
5. Assign BAS quality gates to each task
|
|
67
|
+
6. Estimate time per task (including gate execution)
|
|
68
|
+
7. Identify parallelization opportunities
|
|
69
|
+
8. Calculate total timeline
|
|
70
|
+
9. Output structured JSON handoff
|
|
71
|
+
|
|
72
|
+
### Output (to EUS)
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"agent": "TRA",
|
|
76
|
+
"tasks": [
|
|
77
|
+
{
|
|
78
|
+
"id": 1,
|
|
79
|
+
"description": "Implement validateEmail function",
|
|
80
|
+
"module": "src/validators/email.ts",
|
|
81
|
+
"dependencies": [],
|
|
82
|
+
"complexity": "Low",
|
|
83
|
+
"estimatedTime": "30min",
|
|
84
|
+
"basGates": ["lint", "build", "test", "coverage"],
|
|
85
|
+
"parallelizable": false
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": 2,
|
|
89
|
+
"description": "Write unit tests for validateEmail",
|
|
90
|
+
"module": "tests/validators/email.test.ts",
|
|
91
|
+
"dependencies": [1],
|
|
92
|
+
"complexity": "Low",
|
|
93
|
+
"estimatedTime": "20min",
|
|
94
|
+
"basGates": ["lint", "test"],
|
|
95
|
+
"parallelizable": false
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"sequence": [1, 2],
|
|
99
|
+
"parallelGroups": [],
|
|
100
|
+
"stopPoints": ["design", "final"],
|
|
101
|
+
"timeline": {
|
|
102
|
+
"totalEstimate": "50min",
|
|
103
|
+
"criticalPath": [1, 2],
|
|
104
|
+
"basGateTime": "5min per task"
|
|
105
|
+
},
|
|
106
|
+
"basConfiguration": {
|
|
107
|
+
"linting": {
|
|
108
|
+
"tool": "ESLint + Prettier",
|
|
109
|
+
"autoFix": true
|
|
110
|
+
},
|
|
111
|
+
"coverage": {
|
|
112
|
+
"threshold": 80,
|
|
113
|
+
"metric": "lines and branches"
|
|
114
|
+
},
|
|
115
|
+
"testing": {
|
|
116
|
+
"framework": "Jest",
|
|
117
|
+
"parallel": true
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## TRINITY V2.0 BEST PRACTICES
|
|
126
|
+
|
|
127
|
+
### Reference Documents
|
|
128
|
+
- **Coding Standards:** [trinity/knowledge-base/CODING-PRINCIPLES.md](trinity/knowledge-base/CODING-PRINCIPLES.md)
|
|
129
|
+
- **Testing Standards:** [trinity/knowledge-base/TESTING-PRINCIPLES.md](trinity/knowledge-base/TESTING-PRINCIPLES.md)
|
|
130
|
+
- **AI Development Guide:** [trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md](trinity/knowledge-base/AI-DEVELOPMENT-GUIDE.md)
|
|
131
|
+
- **Documentation Standards:** [trinity/knowledge-base/DOCUMENTATION-CRITERIA.md](trinity/knowledge-base/DOCUMENTATION-CRITERIA.md)
|
|
132
|
+
|
|
133
|
+
### Planning Principles
|
|
134
|
+
|
|
135
|
+
1. **Dependencies First**
|
|
136
|
+
- Sequence tasks so dependencies complete before dependents
|
|
137
|
+
- Avoid circular dependencies
|
|
138
|
+
- Minimize cross-task coupling
|
|
139
|
+
|
|
140
|
+
2. **BAS Gate Strategy**
|
|
141
|
+
- All implementation tasks: Full 6-phase gate
|
|
142
|
+
- Test-only tasks: Phases 1, 4 (lint, test)
|
|
143
|
+
- Documentation tasks: Phase 1 only (lint)
|
|
144
|
+
|
|
145
|
+
3. **Realistic Estimates**
|
|
146
|
+
- Low complexity: 15-45min
|
|
147
|
+
- Medium complexity: 45-120min
|
|
148
|
+
- High complexity: Break into smaller tasks
|
|
149
|
+
- Add 5-10min per task for BAS gates
|
|
150
|
+
|
|
151
|
+
4. **Parallelization**
|
|
152
|
+
- Group independent tasks
|
|
153
|
+
- Respect dependency chains
|
|
154
|
+
- Consider resource constraints
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## BAS QUALITY GATES DETAIL
|
|
159
|
+
|
|
160
|
+
### Phase 1: Linting (Auto-Fix)
|
|
161
|
+
- Run ESLint with auto-fix enabled
|
|
162
|
+
- Run Prettier for formatting
|
|
163
|
+
- **Pass Criteria:** 0 linting errors
|
|
164
|
+
- **Time:** ~30 seconds
|
|
165
|
+
|
|
166
|
+
### Phase 2: Structure Validation
|
|
167
|
+
- Validate imports/exports
|
|
168
|
+
- Check TypeScript types
|
|
169
|
+
- Verify module structure
|
|
170
|
+
- **Pass Criteria:** All imports resolve, types valid
|
|
171
|
+
- **Time:** ~30 seconds
|
|
172
|
+
|
|
173
|
+
### Phase 3: Build Validation
|
|
174
|
+
- Run TypeScript compiler (tsc)
|
|
175
|
+
- Check for compilation errors
|
|
176
|
+
- **Pass Criteria:** 0 build errors
|
|
177
|
+
- **Time:** ~1 minute
|
|
178
|
+
|
|
179
|
+
### Phase 4: Testing
|
|
180
|
+
- Run all relevant tests
|
|
181
|
+
- Unit + integration tests
|
|
182
|
+
- **Pass Criteria:** 100% tests pass
|
|
183
|
+
- **Time:** ~1-2 minutes
|
|
184
|
+
|
|
185
|
+
### Phase 5: Coverage Check
|
|
186
|
+
- Measure code coverage
|
|
187
|
+
- Lines and branches
|
|
188
|
+
- **Pass Criteria:** โฅ80% coverage
|
|
189
|
+
- **Time:** ~30 seconds
|
|
190
|
+
|
|
191
|
+
### Phase 6: Final Review
|
|
192
|
+
- Best practices compliance
|
|
193
|
+
- Design Doc adherence
|
|
194
|
+
- Code quality check
|
|
195
|
+
- **Pass Criteria:** DRA approval
|
|
196
|
+
- **Time:** ~2 minutes
|
|
197
|
+
|
|
198
|
+
**Total BAS Gate Time:** ~5-7 minutes per task
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## QUALITY GATES
|
|
203
|
+
|
|
204
|
+
### TRA's Output Must:
|
|
205
|
+
- โ
Provide clear task sequence respecting dependencies
|
|
206
|
+
- โ
Assign appropriate BAS gates to each task
|
|
207
|
+
- โ
Include realistic time estimates (complexity-based)
|
|
208
|
+
- โ
Identify parallelization opportunities
|
|
209
|
+
- โ
Map to ROR's Design Doc functions
|
|
210
|
+
|
|
211
|
+
### DRA Validates:
|
|
212
|
+
- Task sequencing correctness (no circular dependencies)
|
|
213
|
+
- BAS gate appropriateness
|
|
214
|
+
- Timeline realism
|
|
215
|
+
- Parallelization feasibility
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## HANDOFF PROTOCOL
|
|
220
|
+
|
|
221
|
+
### JSON Structure
|
|
222
|
+
Always output structured JSON for EUS to consume:
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"agent": "TRA",
|
|
227
|
+
"tasks": [
|
|
228
|
+
{
|
|
229
|
+
"id": <number>,
|
|
230
|
+
"description": "<task description>",
|
|
231
|
+
"module": "<file path>",
|
|
232
|
+
"dependencies": [<task IDs>],
|
|
233
|
+
"complexity": "Low|Medium|High",
|
|
234
|
+
"estimatedTime": "<time>",
|
|
235
|
+
"basGates": [<gate names>],
|
|
236
|
+
"parallelizable": <boolean>
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"sequence": [<task IDs in order>],
|
|
240
|
+
"parallelGroups": [[<task IDs that can run together>]],
|
|
241
|
+
"stopPoints": ["<stop point names>"],
|
|
242
|
+
"timeline": {
|
|
243
|
+
"totalEstimate": "<time>",
|
|
244
|
+
"criticalPath": [<task IDs>],
|
|
245
|
+
"basGateTime": "<time per task>"
|
|
246
|
+
},
|
|
247
|
+
"basConfiguration": { ... }
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Stop Points
|
|
252
|
+
- **Small Scale:** No stop point (proceed to EUS)
|
|
253
|
+
- **Medium Scale:** Plan approval optional (proceed to EUS)
|
|
254
|
+
- **Large Scale:** Plan approval stop point (user reviews TRA's output)
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## COORDINATION WITH OTHER AGENTS
|
|
259
|
+
|
|
260
|
+
- **ROR (Design Architect):** Provides Design Doc and function signatures
|
|
261
|
+
- **EUS (Task Decomposer):** Consumes plan to create atomic tasks (1 task = 1 commit)
|
|
262
|
+
- **KIL (Task Executor):** Executes tasks in TRA's sequence
|
|
263
|
+
- **BAS (Quality Gate):** Runs gates defined by TRA
|
|
264
|
+
- **DRA (Code Reviewer):** Reviews final output after all tasks complete
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## EXAMPLES
|
|
269
|
+
|
|
270
|
+
### Example 1: Small Scale Plan
|
|
271
|
+
**Input from ROR:** Email validation Design Doc
|
|
272
|
+
|
|
273
|
+
**TRA Output:**
|
|
274
|
+
```json
|
|
275
|
+
{
|
|
276
|
+
"agent": "TRA",
|
|
277
|
+
"tasks": [
|
|
278
|
+
{
|
|
279
|
+
"id": 1,
|
|
280
|
+
"description": "Implement validateEmail function",
|
|
281
|
+
"module": "src/validators/email.ts",
|
|
282
|
+
"dependencies": [],
|
|
283
|
+
"complexity": "Low",
|
|
284
|
+
"estimatedTime": "30min",
|
|
285
|
+
"basGates": ["lint", "build", "test", "coverage"],
|
|
286
|
+
"parallelizable": false
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"id": 2,
|
|
290
|
+
"description": "Write unit tests for validateEmail",
|
|
291
|
+
"module": "tests/validators/email.test.ts",
|
|
292
|
+
"dependencies": [1],
|
|
293
|
+
"complexity": "Low",
|
|
294
|
+
"estimatedTime": "20min",
|
|
295
|
+
"basGates": ["lint", "test"],
|
|
296
|
+
"parallelizable": false
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"id": 3,
|
|
300
|
+
"description": "Add JSDoc documentation",
|
|
301
|
+
"module": "src/validators/email.ts",
|
|
302
|
+
"dependencies": [1],
|
|
303
|
+
"complexity": "Low",
|
|
304
|
+
"estimatedTime": "10min",
|
|
305
|
+
"basGates": ["lint"],
|
|
306
|
+
"parallelizable": true
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"sequence": [1, [2, 3]],
|
|
310
|
+
"parallelGroups": [[2, 3]],
|
|
311
|
+
"stopPoints": [],
|
|
312
|
+
"timeline": {
|
|
313
|
+
"totalEstimate": "60min",
|
|
314
|
+
"criticalPath": [1, 2],
|
|
315
|
+
"basGateTime": "5min per task"
|
|
316
|
+
},
|
|
317
|
+
"basConfiguration": {
|
|
318
|
+
"linting": { "tool": "ESLint + Prettier", "autoFix": true },
|
|
319
|
+
"coverage": { "threshold": 80, "metric": "lines and branches" },
|
|
320
|
+
"testing": { "framework": "Jest", "parallel": true }
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Example 2: Large Scale Plan
|
|
326
|
+
**Input from ROR:** OAuth2 authentication Design Doc
|
|
327
|
+
|
|
328
|
+
**TRA Output:**
|
|
329
|
+
```json
|
|
330
|
+
{
|
|
331
|
+
"agent": "TRA",
|
|
332
|
+
"tasks": [
|
|
333
|
+
{
|
|
334
|
+
"id": 1,
|
|
335
|
+
"description": "Create OAuth2 types and interfaces",
|
|
336
|
+
"module": "src/auth/oauth2/types.ts",
|
|
337
|
+
"dependencies": [],
|
|
338
|
+
"complexity": "Low",
|
|
339
|
+
"estimatedTime": "30min",
|
|
340
|
+
"basGates": ["lint", "build"],
|
|
341
|
+
"parallelizable": false
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"id": 2,
|
|
345
|
+
"description": "Implement TokenManager class",
|
|
346
|
+
"module": "src/auth/oauth2/TokenManager.ts",
|
|
347
|
+
"dependencies": [1],
|
|
348
|
+
"complexity": "Medium",
|
|
349
|
+
"estimatedTime": "90min",
|
|
350
|
+
"basGates": ["lint", "build", "test", "coverage"],
|
|
351
|
+
"parallelizable": false
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"id": 3,
|
|
355
|
+
"description": "Implement OAuth2Client class",
|
|
356
|
+
"module": "src/auth/oauth2/OAuth2Client.ts",
|
|
357
|
+
"dependencies": [1],
|
|
358
|
+
"complexity": "Medium",
|
|
359
|
+
"estimatedTime": "90min",
|
|
360
|
+
"basGates": ["lint", "build", "test", "coverage"],
|
|
361
|
+
"parallelizable": true
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"id": 4,
|
|
365
|
+
"description": "Write TokenManager unit tests",
|
|
366
|
+
"module": "tests/auth/oauth2/TokenManager.test.ts",
|
|
367
|
+
"dependencies": [2],
|
|
368
|
+
"complexity": "Medium",
|
|
369
|
+
"estimatedTime": "60min",
|
|
370
|
+
"basGates": ["lint", "test"],
|
|
371
|
+
"parallelizable": false
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"id": 5,
|
|
375
|
+
"description": "Write OAuth2Client unit tests",
|
|
376
|
+
"module": "tests/auth/oauth2/OAuth2Client.test.ts",
|
|
377
|
+
"dependencies": [3],
|
|
378
|
+
"complexity": "Medium",
|
|
379
|
+
"estimatedTime": "60min",
|
|
380
|
+
"basGates": ["lint", "test"],
|
|
381
|
+
"parallelizable": true
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"id": 6,
|
|
385
|
+
"description": "Integration tests for full OAuth2 flow",
|
|
386
|
+
"module": "tests/auth/oauth2/integration.test.ts",
|
|
387
|
+
"dependencies": [2, 3],
|
|
388
|
+
"complexity": "High",
|
|
389
|
+
"estimatedTime": "120min",
|
|
390
|
+
"basGates": ["lint", "test", "coverage"],
|
|
391
|
+
"parallelizable": false
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
"sequence": [1, [2, 3], [4, 5], 6],
|
|
395
|
+
"parallelGroups": [[2, 3], [4, 5]],
|
|
396
|
+
"stopPoints": ["requirements", "design", "plan", "final"],
|
|
397
|
+
"timeline": {
|
|
398
|
+
"totalEstimate": "450min (7.5 hours)",
|
|
399
|
+
"criticalPath": [1, 2, 4, 6],
|
|
400
|
+
"basGateTime": "6min per task (36min total)"
|
|
401
|
+
},
|
|
402
|
+
"basConfiguration": {
|
|
403
|
+
"linting": { "tool": "ESLint + Prettier", "autoFix": true },
|
|
404
|
+
"coverage": { "threshold": 80, "metric": "lines and branches" },
|
|
405
|
+
"testing": { "framework": "Jest", "parallel": true }
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## ANTI-PATTERNS TO AVOID
|
|
413
|
+
|
|
414
|
+
โ **Circular Dependencies:** Task 1 depends on 2, Task 2 depends on 1 โ Fix dependency chain
|
|
415
|
+
โ **Overly Optimistic Estimates:** "5 minutes for OAuth2" โ Use realistic complexity-based estimates
|
|
416
|
+
โ **Missing BAS Gates:** No quality gates assigned โ All implementation tasks need full gates
|
|
417
|
+
โ **Ignoring Dependencies:** Parallel execution of dependent tasks โ Respect dependency chains
|
|
418
|
+
โ **No Stop Points:** Large project with no user checkpoints โ Add appropriate stop points
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## QUALITY METRICS
|
|
423
|
+
|
|
424
|
+
**TRA Success Criteria:**
|
|
425
|
+
- Task sequencing correctness: 100% (no dependency violations)
|
|
426
|
+
- BAS gate appropriateness: 100% (correct gates per task type)
|
|
427
|
+
- Timeline accuracy: ยฑ20% (estimates vs. actuals)
|
|
428
|
+
- Parallelization efficiency: โฅ50% (parallel opportunities identified)
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
**Remember:** TRA's plan guides the entire implementation. Accurate sequencing and realistic estimates ensure smooth execution. BAS quality gates enforce quality at every step, preventing defects from accumulating.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# {{PROJECT_NAME}} - Trinity Method CD Pipeline
|
|
2
|
+
# Trinity Method v{{TRINITY_VERSION}}
|
|
3
|
+
# Framework: {{FRAMEWORK}}
|
|
4
|
+
# Generated by: EIN (CI/CD Specialist)
|
|
5
|
+
|
|
6
|
+
name: Trinity CD Pipeline
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
tags:
|
|
13
|
+
- 'v*'
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
inputs:
|
|
16
|
+
environment:
|
|
17
|
+
description: 'Deployment environment'
|
|
18
|
+
required: true
|
|
19
|
+
type: choice
|
|
20
|
+
options:
|
|
21
|
+
- staging
|
|
22
|
+
- production
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
# Ensure CI passes before deployment
|
|
26
|
+
ci-gate:
|
|
27
|
+
name: CI Quality Gate
|
|
28
|
+
uses: ./.github/workflows/ci.yml
|
|
29
|
+
|
|
30
|
+
# Build artifacts for deployment
|
|
31
|
+
build:
|
|
32
|
+
name: Build Artifacts
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
needs: ci-gate
|
|
35
|
+
|
|
36
|
+
strategy:
|
|
37
|
+
matrix:
|
|
38
|
+
node-version: [20.x]
|
|
39
|
+
|
|
40
|
+
steps:
|
|
41
|
+
- name: Checkout code
|
|
42
|
+
uses: actions/checkout@v4
|
|
43
|
+
with:
|
|
44
|
+
fetch-depth: 0
|
|
45
|
+
|
|
46
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
47
|
+
uses: actions/setup-node@v4
|
|
48
|
+
with:
|
|
49
|
+
node-version: ${{ matrix.node-version }}
|
|
50
|
+
cache: 'npm'
|
|
51
|
+
|
|
52
|
+
- name: Install dependencies
|
|
53
|
+
run: npm ci
|
|
54
|
+
|
|
55
|
+
- name: Build production artifacts
|
|
56
|
+
run: npm run build
|
|
57
|
+
env:
|
|
58
|
+
NODE_ENV: production
|
|
59
|
+
|
|
60
|
+
- name: Upload build artifacts
|
|
61
|
+
uses: actions/upload-artifact@v3
|
|
62
|
+
with:
|
|
63
|
+
name: build-artifacts
|
|
64
|
+
path: |
|
|
65
|
+
dist/
|
|
66
|
+
build/
|
|
67
|
+
retention-days: 30
|
|
68
|
+
|
|
69
|
+
# Deploy to staging
|
|
70
|
+
deploy-staging:
|
|
71
|
+
name: Deploy to Staging
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
needs: build
|
|
74
|
+
if: github.ref == 'refs/heads/main' || github.event.inputs.environment == 'staging'
|
|
75
|
+
environment:
|
|
76
|
+
name: staging
|
|
77
|
+
url: https://staging.{{DOMAIN}}
|
|
78
|
+
|
|
79
|
+
steps:
|
|
80
|
+
- name: Checkout code
|
|
81
|
+
uses: actions/checkout@v4
|
|
82
|
+
|
|
83
|
+
- name: Download build artifacts
|
|
84
|
+
uses: actions/download-artifact@v3
|
|
85
|
+
with:
|
|
86
|
+
name: build-artifacts
|
|
87
|
+
|
|
88
|
+
- name: Deploy to staging
|
|
89
|
+
run: |
|
|
90
|
+
echo "๐ Deploying to staging environment..."
|
|
91
|
+
# Add your staging deployment script here
|
|
92
|
+
# Examples:
|
|
93
|
+
# - npm run deploy:staging
|
|
94
|
+
# - scp -r dist/* user@staging-server:/var/www/
|
|
95
|
+
# - aws s3 sync dist/ s3://staging-bucket/
|
|
96
|
+
# - kubectl apply -f k8s/staging/
|
|
97
|
+
echo "โ
Staging deployment complete"
|
|
98
|
+
|
|
99
|
+
- name: Run smoke tests
|
|
100
|
+
run: |
|
|
101
|
+
echo "๐งช Running smoke tests on staging..."
|
|
102
|
+
# Add smoke test script here
|
|
103
|
+
# Example: npm run test:smoke -- --env=staging
|
|
104
|
+
echo "โ
Smoke tests passed"
|
|
105
|
+
|
|
106
|
+
# Deploy to production (requires approval)
|
|
107
|
+
deploy-production:
|
|
108
|
+
name: Deploy to Production
|
|
109
|
+
runs-on: ubuntu-latest
|
|
110
|
+
needs: deploy-staging
|
|
111
|
+
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.environment == 'production'
|
|
112
|
+
environment:
|
|
113
|
+
name: production
|
|
114
|
+
url: https://{{DOMAIN}}
|
|
115
|
+
|
|
116
|
+
steps:
|
|
117
|
+
- name: Checkout code
|
|
118
|
+
uses: actions/checkout@v4
|
|
119
|
+
|
|
120
|
+
- name: Download build artifacts
|
|
121
|
+
uses: actions/download-artifact@v3
|
|
122
|
+
with:
|
|
123
|
+
name: build-artifacts
|
|
124
|
+
|
|
125
|
+
- name: Deploy to production
|
|
126
|
+
run: |
|
|
127
|
+
echo "๐ Deploying to production environment..."
|
|
128
|
+
# Add your production deployment script here
|
|
129
|
+
# Examples:
|
|
130
|
+
# - npm run deploy:production
|
|
131
|
+
# - scp -r dist/* user@prod-server:/var/www/
|
|
132
|
+
# - aws s3 sync dist/ s3://production-bucket/
|
|
133
|
+
# - kubectl apply -f k8s/production/
|
|
134
|
+
echo "โ
Production deployment complete"
|
|
135
|
+
|
|
136
|
+
- name: Run smoke tests
|
|
137
|
+
run: |
|
|
138
|
+
echo "๐งช Running smoke tests on production..."
|
|
139
|
+
# Add smoke test script here
|
|
140
|
+
# Example: npm run test:smoke -- --env=production
|
|
141
|
+
echo "โ
Smoke tests passed"
|
|
142
|
+
|
|
143
|
+
- name: Create deployment tag
|
|
144
|
+
if: success()
|
|
145
|
+
run: |
|
|
146
|
+
echo "๐ Creating deployment tag..."
|
|
147
|
+
git config user.name "GitHub Actions"
|
|
148
|
+
git config user.email "actions@github.com"
|
|
149
|
+
git tag -a "deployed-$(date +%Y%m%d-%H%M%S)" -m "Production deployment"
|
|
150
|
+
git push origin "deployed-$(date +%Y%m%d-%H%M%S)"
|
|
151
|
+
|
|
152
|
+
# Deployment summary
|
|
153
|
+
deployment-summary:
|
|
154
|
+
name: Deployment Summary
|
|
155
|
+
runs-on: ubuntu-latest
|
|
156
|
+
needs: [deploy-staging, deploy-production]
|
|
157
|
+
if: always()
|
|
158
|
+
|
|
159
|
+
steps:
|
|
160
|
+
- name: Deployment Summary
|
|
161
|
+
run: |
|
|
162
|
+
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
163
|
+
echo " Trinity CD Pipeline Summary"
|
|
164
|
+
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|
|
165
|
+
echo ""
|
|
166
|
+
echo "CI Gate: ${{ needs.ci-gate.result }}"
|
|
167
|
+
echo "Build: ${{ needs.build.result }}"
|
|
168
|
+
echo "Staging Deployment: ${{ needs.deploy-staging.result }}"
|
|
169
|
+
echo "Production Deploy: ${{ needs.deploy-production.result }}"
|
|
170
|
+
echo ""
|
|
171
|
+
echo "Triggered by: ${{ github.event_name }}"
|
|
172
|
+
echo "Branch/Tag: ${{ github.ref }}"
|
|
173
|
+
echo "Commit: ${{ github.sha }}"
|
|
174
|
+
echo ""
|
|
175
|
+
echo "โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"
|