amazingteam 3.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/.ai-team/agents/architect.md +144 -0
- package/.ai-team/agents/ci-analyst.md +188 -0
- package/.ai-team/agents/developer.md +176 -0
- package/.ai-team/agents/planner.md +355 -0
- package/.ai-team/agents/qa.md +189 -0
- package/.ai-team/agents/reviewer.md +211 -0
- package/.ai-team/agents/triage.md +146 -0
- package/.ai-team/commands/ci-analyze.md +116 -0
- package/.ai-team/commands/design.md +100 -0
- package/.ai-team/commands/implement.md +108 -0
- package/.ai-team/commands/release-check.md +142 -0
- package/.ai-team/commands/review.md +142 -0
- package/.ai-team/commands/test.md +115 -0
- package/.ai-team/commands/triage.md +138 -0
- package/.ai-team/memory/architect/architecture_notes.md +67 -0
- package/.ai-team/memory/architect/design_rationale.md +113 -0
- package/.ai-team/memory/architect/module_map.md +84 -0
- package/.ai-team/memory/ci-analyst/failure_patterns.md +102 -0
- package/.ai-team/memory/ci-analyst/runbook_references.md +87 -0
- package/.ai-team/memory/developer/bug_investigation.md +102 -0
- package/.ai-team/memory/developer/build_issues.md +115 -0
- package/.ai-team/memory/developer/implementation_notes.md +83 -0
- package/.ai-team/memory/failures/failure_library.md +103 -0
- package/.ai-team/memory/planner/decomposition_notes.md +82 -0
- package/.ai-team/memory/planner/flow_rules.md +86 -0
- package/.ai-team/memory/planner/github_issue_patterns.md +229 -0
- package/.ai-team/memory/qa/regression_cases.md +101 -0
- package/.ai-team/memory/qa/test_strategy.md +138 -0
- package/.ai-team/memory/qa/validation_notes.md +110 -0
- package/.ai-team/memory/reviewer/quality_rules.md +105 -0
- package/.ai-team/memory/reviewer/recurring_risks.md +109 -0
- package/.ai-team/memory/reviewer/review_notes.md +124 -0
- package/.ai-team/memory/triage/classification_heuristics.md +82 -0
- package/.ai-team/memory/triage/debug_notes.md +87 -0
- package/.ai-team/opencode.template.jsonc +216 -0
- package/.ai-team/skills/bugfix-playbook/skill.md +174 -0
- package/.ai-team/skills/ci-failure-analysis/skill.md +176 -0
- package/.ai-team/skills/issue-triage/skill.md +163 -0
- package/.ai-team/skills/regression-checklist/skill.md +176 -0
- package/.ai-team/skills/release-readiness-check/skill.md +216 -0
- package/.ai-team/skills/repo-architecture-reader/skill.md +139 -0
- package/.ai-team/skills/safe-refactor-checklist/skill.md +215 -0
- package/.ai-team/skills/task-breakdown-and-dispatch/skill.md +151 -0
- package/.ai-team/skills/test-first-feature-dev/skill.md +205 -0
- package/.ai-team/workflows/ci.yml +81 -0
- package/.ai-team/workflows/nightly-ai-maintenance.yml +129 -0
- package/.ai-team/workflows/opencode.yml +33 -0
- package/.ai-team/workflows/pr-check.yml +41 -0
- package/.foundation/foundation.lock +38 -0
- package/.foundation/local-overrides.md +97 -0
- package/.foundation/upgrade-history.md +38 -0
- package/.opencode/agents/architect.md +38 -0
- package/.opencode/agents/ci-analyst.md +38 -0
- package/.opencode/agents/developer.md +43 -0
- package/.opencode/agents/planner.md +47 -0
- package/.opencode/agents/qa.md +34 -0
- package/.opencode/agents/reviewer.md +38 -0
- package/.opencode/agents/triage.md +37 -0
- package/.opencode/commands/auto.md +264 -0
- package/.opencode/commands/breakdown-issue.md +94 -0
- package/.opencode/commands/ci-analyze.md +15 -0
- package/.opencode/commands/close-parent-task.md +122 -0
- package/.opencode/commands/design.md +15 -0
- package/.opencode/commands/dispatch-next.md +102 -0
- package/.opencode/commands/implement.md +16 -0
- package/.opencode/commands/release-check.md +16 -0
- package/.opencode/commands/resume.md +88 -0
- package/.opencode/commands/review.md +15 -0
- package/.opencode/commands/show-blockers.md +97 -0
- package/.opencode/commands/summarize-parent.md +121 -0
- package/.opencode/commands/test.md +15 -0
- package/.opencode/commands/triage.md +109 -0
- package/.opencode/skills/bugfix-playbook/SKILL.md +81 -0
- package/.opencode/skills/ci-failure-analysis/SKILL.md +94 -0
- package/.opencode/skills/issue-triage/SKILL.md +80 -0
- package/.opencode/skills/regression-checklist/SKILL.md +81 -0
- package/.opencode/skills/release-readiness-check/SKILL.md +81 -0
- package/.opencode/skills/repo-architecture-reader/SKILL.md +65 -0
- package/.opencode/skills/safe-refactor-checklist/SKILL.md +76 -0
- package/.opencode/skills/task-breakdown-and-dispatch/SKILL.md +255 -0
- package/.opencode/skills/test-first-feature-dev/SKILL.md +78 -0
- package/AGENTS.md +879 -0
- package/CHANGELOG.md +261 -0
- package/LICENSE +21 -0
- package/README.md +1215 -0
- package/VERSION +1 -0
- package/action/__tests__/downloader.test.js +251 -0
- package/action/__tests__/merger.test.js +156 -0
- package/action/__tests__/path-resolver.test.js +199 -0
- package/action/__tests__/validator.test.js +310 -0
- package/action/action.yml +61 -0
- package/action/index.js +223 -0
- package/action/lib/downloader.js +344 -0
- package/action/lib/merger.js +170 -0
- package/action/lib/path-resolver.js +176 -0
- package/action/lib/setup.js +286 -0
- package/action/lib/validator.js +324 -0
- package/cli/__tests__/cli.test.js +270 -0
- package/cli/amazingteam.cjs +225 -0
- package/cli/commands/check-update.cjs +159 -0
- package/cli/commands/init.cjs +412 -0
- package/cli/commands/local.cjs +264 -0
- package/cli/commands/migrate.cjs +316 -0
- package/cli/commands/status.cjs +241 -0
- package/cli/commands/upgrade.cjs +213 -0
- package/cli/commands/validate.cjs +259 -0
- package/cli/commands/version.cjs +59 -0
- package/cli/sync.cjs +237 -0
- package/dist/index.js +35 -0
- package/docs/architecture/overview.md +138 -0
- package/docs/blocker_resolution_design.md +372 -0
- package/docs/bootstrap-model.md +356 -0
- package/docs/config-reference.md +458 -0
- package/docs/how-to-use.md +178 -0
- package/docs/migration-to-v3.md +355 -0
- package/docs/overlay-guide.md +156 -0
- package/docs/patterns/README.md +67 -0
- package/docs/quick-start-v3.md +330 -0
- package/docs/releases/README.md +64 -0
- package/docs/runbooks/ci/README.md +62 -0
- package/docs/runbooks/ci/build-debug.md +120 -0
- package/docs/runbooks/ci/flaky-tests.md +127 -0
- package/docs/runbooks/getting-started.md +81 -0
- package/docs/upgrade-policy.md +188 -0
- package/docs/versioning.md +199 -0
- package/overlays/README.md +30 -0
- package/overlays/ai-agent-product/.ai-team/skills/llm-integration/skill.md +99 -0
- package/overlays/ai-agent-product/docs/ai-agent-architecture.md +68 -0
- package/overlays/ai-agent-product/overlay.yaml +26 -0
- package/overlays/cpp-qt-desktop/.ai-team/skills/qt-signals-slots/skill.md +60 -0
- package/overlays/cpp-qt-desktop/docs/qt-conventions.md +64 -0
- package/overlays/cpp-qt-desktop/overlay.yaml +22 -0
- package/overlays/python-backend/.ai-team/skills/python-testing/skill.md +90 -0
- package/overlays/python-backend/docs/python-style.md +78 -0
- package/overlays/python-backend/overlay.yaml +22 -0
- package/overlays/web-fullstack/.ai-team/skills/frontend-testing/skill.md +70 -0
- package/overlays/web-fullstack/docs/frontend-conventions.md +68 -0
- package/overlays/web-fullstack/overlay.yaml +26 -0
- package/package.json +84 -0
- package/presets/default.yaml +161 -0
- package/presets/go.yaml +43 -0
- package/presets/python.yaml +43 -0
- package/presets/typescript.yaml +40 -0
- package/schemas/config.schema.json +239 -0
- package/scripts/diff_foundation_vs_project.sh +134 -0
- package/scripts/generate_docs.sh +200 -0
- package/scripts/init_project.sh +455 -0
- package/scripts/plan_upgrade.sh +268 -0
- package/scripts/upgrade_foundation.sh +365 -0
- package/scripts/validate-foundation.cjs +278 -0
- package/scripts/validate_foundation.sh +192 -0
- package/scripts/validate_project_setup.sh +171 -0
- package/tasks/README.md +94 -0
- package/tasks/_template/analysis.md +76 -0
- package/tasks/_template/design.md +121 -0
- package/tasks/_template/implementation.md +121 -0
- package/tasks/_template/release.md +119 -0
- package/tasks/_template/review.md +131 -0
- package/tasks/_template/subtasks/task.yaml +24 -0
- package/tasks/_template/task.yaml +75 -0
- package/tasks/_template/validation.md +128 -0
- package/templates/amazingteam.yml +81 -0
- package/templates/gitignore +14 -0
- package/templates/opencode.jsonc +216 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Safe Refactor Checklist
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This skill provides a systematic checklist for safely refactoring code without introducing bugs.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- Improving code structure
|
|
10
|
+
- Reducing technical debt
|
|
11
|
+
- Optimizing performance
|
|
12
|
+
- Preparing for new features
|
|
13
|
+
- Cleaning up legacy code
|
|
14
|
+
|
|
15
|
+
## Pre-Refactor Checklist
|
|
16
|
+
|
|
17
|
+
### 1. Verify Test Coverage
|
|
18
|
+
- [ ] Adequate test coverage exists
|
|
19
|
+
- [ ] Tests are reliable and passing
|
|
20
|
+
- [ ] Edge cases are covered
|
|
21
|
+
- [ ] Can add more tests if needed
|
|
22
|
+
|
|
23
|
+
### 2. Understand Current Code
|
|
24
|
+
- [ ] Read and understand the code
|
|
25
|
+
- [ ] Identify dependencies
|
|
26
|
+
- [ ] Note any side effects
|
|
27
|
+
- [ ] Document current behavior
|
|
28
|
+
|
|
29
|
+
### 3. Identify Refactor Scope
|
|
30
|
+
- [ ] Define clear boundaries
|
|
31
|
+
- [ ] Identify affected modules
|
|
32
|
+
- [ ] Check for code that uses this code
|
|
33
|
+
- [ ] Document entry points
|
|
34
|
+
|
|
35
|
+
### 4. Create Safety Net
|
|
36
|
+
- [ ] Ensure all tests pass before starting
|
|
37
|
+
- [ ] Create a feature branch
|
|
38
|
+
- [ ] Consider creating characterization tests
|
|
39
|
+
- [ ] Document current behavior if unclear
|
|
40
|
+
|
|
41
|
+
## Refactor Principles
|
|
42
|
+
|
|
43
|
+
### 1. Small Steps
|
|
44
|
+
- Make one small change at a time
|
|
45
|
+
- Run tests after each change
|
|
46
|
+
- Commit frequently
|
|
47
|
+
- Keep changes reversible
|
|
48
|
+
|
|
49
|
+
### 2. Preserve Behavior
|
|
50
|
+
- Don't change what the code does
|
|
51
|
+
- Only change how it does it
|
|
52
|
+
- Keep the same public interface
|
|
53
|
+
- Maintain backward compatibility
|
|
54
|
+
|
|
55
|
+
### 3. Tests Are Your Friend
|
|
56
|
+
- Run tests constantly
|
|
57
|
+
- Add tests before refactoring
|
|
58
|
+
- Trust failing tests
|
|
59
|
+
- Fix issues immediately
|
|
60
|
+
|
|
61
|
+
## Refactor Patterns
|
|
62
|
+
|
|
63
|
+
### Extract Method
|
|
64
|
+
```
|
|
65
|
+
Before:
|
|
66
|
+
function complexFunction() {
|
|
67
|
+
// lots of code
|
|
68
|
+
// section A
|
|
69
|
+
// section B
|
|
70
|
+
// section C
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
After:
|
|
74
|
+
function complexFunction() {
|
|
75
|
+
doSectionA();
|
|
76
|
+
doSectionB();
|
|
77
|
+
doSectionC();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function doSectionA() { /* ... */ }
|
|
81
|
+
function doSectionB() { /* ... */ }
|
|
82
|
+
function doSectionC() { /* ... */ }
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Extract Variable
|
|
86
|
+
```
|
|
87
|
+
Before:
|
|
88
|
+
if (item.price * (1 + taxRate) > threshold) { ... }
|
|
89
|
+
|
|
90
|
+
After:
|
|
91
|
+
const totalWithTax = item.price * (1 + taxRate);
|
|
92
|
+
if (totalWithTax > threshold) { ... }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Rename Variable/Method
|
|
96
|
+
```
|
|
97
|
+
Before:
|
|
98
|
+
function calc(x, y) { return x * y; }
|
|
99
|
+
|
|
100
|
+
After:
|
|
101
|
+
function calculateTotal(price, quantity) {
|
|
102
|
+
return price * quantity;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Move Method/Field
|
|
107
|
+
- Move to the class that uses it most
|
|
108
|
+
- Update all references
|
|
109
|
+
- Consider creating a delegate
|
|
110
|
+
|
|
111
|
+
### Inline Method
|
|
112
|
+
- When the method body is clearer than the name
|
|
113
|
+
- Replace calls with the body
|
|
114
|
+
- Remove the method
|
|
115
|
+
|
|
116
|
+
## During Refactor Checklist
|
|
117
|
+
|
|
118
|
+
### After Each Change
|
|
119
|
+
- [ ] Run tests (all must pass)
|
|
120
|
+
- [ ] Check for compile errors
|
|
121
|
+
- [ ] Verify behavior unchanged
|
|
122
|
+
- [ ] Commit if tests pass
|
|
123
|
+
|
|
124
|
+
### Periodic Checks
|
|
125
|
+
- [ ] Run full test suite
|
|
126
|
+
- [ ] Check for performance impact
|
|
127
|
+
- [ ] Review for unintended changes
|
|
128
|
+
- [ ] Update documentation
|
|
129
|
+
|
|
130
|
+
## Post-Refactor Checklist
|
|
131
|
+
|
|
132
|
+
### Verification
|
|
133
|
+
- [ ] All tests pass
|
|
134
|
+
- [ ] No new lint warnings
|
|
135
|
+
- [ ] No type errors
|
|
136
|
+
- [ ] Performance is acceptable
|
|
137
|
+
|
|
138
|
+
### Quality
|
|
139
|
+
- [ ] Code is more readable
|
|
140
|
+
- [ ] Duplication is reduced
|
|
141
|
+
- [ ] Complexity is reduced
|
|
142
|
+
- [ ] Tests are improved
|
|
143
|
+
|
|
144
|
+
### Documentation
|
|
145
|
+
- [ ] Comments updated
|
|
146
|
+
- [ ] API docs updated
|
|
147
|
+
- [ ] README updated if needed
|
|
148
|
+
- [ ] Migration guide if breaking
|
|
149
|
+
|
|
150
|
+
### Final Checks
|
|
151
|
+
- [ ] Peer review done
|
|
152
|
+
- [ ] Merge conflicts resolved
|
|
153
|
+
- [ ] CI/CD passes
|
|
154
|
+
- [ ] Ready for merge
|
|
155
|
+
|
|
156
|
+
## Red Flags - Stop Refactoring
|
|
157
|
+
|
|
158
|
+
- Tests start failing unexpectedly
|
|
159
|
+
- Behavior changes unexpectedly
|
|
160
|
+
- Scope keeps expanding
|
|
161
|
+
- Can't verify behavior
|
|
162
|
+
- No test coverage for critical code
|
|
163
|
+
- Changes are too risky
|
|
164
|
+
|
|
165
|
+
## Refactor Log Template
|
|
166
|
+
|
|
167
|
+
```markdown
|
|
168
|
+
## Refactor: [Description]
|
|
169
|
+
|
|
170
|
+
### Date
|
|
171
|
+
[Date]
|
|
172
|
+
|
|
173
|
+
### Scope
|
|
174
|
+
[What was refactored]
|
|
175
|
+
|
|
176
|
+
### Changes
|
|
177
|
+
1. [Change 1]
|
|
178
|
+
2. [Change 2]
|
|
179
|
+
|
|
180
|
+
### Files Modified
|
|
181
|
+
- `file1.ts`: [Description]
|
|
182
|
+
- `file2.ts`: [Description]
|
|
183
|
+
|
|
184
|
+
### Tests Added
|
|
185
|
+
- [Test 1]
|
|
186
|
+
- [Test 2]
|
|
187
|
+
|
|
188
|
+
### Risks Mitigated
|
|
189
|
+
- [Risk 1]: [How it was addressed]
|
|
190
|
+
|
|
191
|
+
### Review Notes
|
|
192
|
+
[Any notes for reviewers]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Best Practices
|
|
196
|
+
|
|
197
|
+
1. **Never refactor without tests**
|
|
198
|
+
- If no tests, write them first
|
|
199
|
+
- Characterization tests for legacy code
|
|
200
|
+
|
|
201
|
+
2. **One thing at a time**
|
|
202
|
+
- Don't mix refactoring with feature changes
|
|
203
|
+
- Keep refactor commits separate
|
|
204
|
+
|
|
205
|
+
3. **Test frequently**
|
|
206
|
+
- After every small change
|
|
207
|
+
- Don't wait until the end
|
|
208
|
+
|
|
209
|
+
4. **Revert if stuck**
|
|
210
|
+
- It's okay to abandon a refactor
|
|
211
|
+
- Learn from what didn't work
|
|
212
|
+
|
|
213
|
+
5. **Document why, not what**
|
|
214
|
+
- Explain the reason for refactoring
|
|
215
|
+
- Let code show what changed
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Task Breakdown and Dispatch
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This skill enables systematic decomposition of tasks into actionable subtasks and intelligent dispatching to appropriate roles.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- Starting a new feature or large task
|
|
10
|
+
- Planning sprint work
|
|
11
|
+
- Breaking down complex issues
|
|
12
|
+
- Coordinating multi-role workflows
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
### 1. Analyze Task Scope
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. Read the task description and acceptance criteria
|
|
20
|
+
2. Identify the task type: feature, bug, refactor, docs, infra
|
|
21
|
+
3. Assess complexity: simple, moderate, complex
|
|
22
|
+
4. Estimate risk level: low, medium, high
|
|
23
|
+
5. Identify affected modules/domains
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Identify Required Roles
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
1. Architect: Needed for design decisions
|
|
30
|
+
2. Developer: Needed for implementation
|
|
31
|
+
3. QA: Needed for validation
|
|
32
|
+
4. Reviewer: Needed for code review
|
|
33
|
+
5. Triage: Needed for initial investigation
|
|
34
|
+
6. CI Analyst: Needed for CI-related tasks
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. Decompose into Subtasks
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
1. Break task into logical phases
|
|
41
|
+
2. Identify dependencies between phases
|
|
42
|
+
3. Define clear deliverables for each phase
|
|
43
|
+
4. Estimate effort for each subtask
|
|
44
|
+
5. Assign appropriate role to each subtask
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 4. Define Dependencies
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
1. Map task dependencies
|
|
51
|
+
2. Identify blocking relationships
|
|
52
|
+
3. Find parallelizable work
|
|
53
|
+
4. Define critical path
|
|
54
|
+
5. Document external dependencies
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 5. Create Task Manifest
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
1. Generate task.yaml with metadata
|
|
61
|
+
2. List all subtasks
|
|
62
|
+
3. Define state transitions
|
|
63
|
+
4. Set acceptance criteria
|
|
64
|
+
5. Assign owner_role
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 6. Dispatch Tasks
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
1. Start with unblocked tasks
|
|
71
|
+
2. Notify appropriate role
|
|
72
|
+
3. Track task progress
|
|
73
|
+
4. Handle blocking issues
|
|
74
|
+
5. Coordinate handoffs between roles
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Task Manifest Template
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
id: issue-123
|
|
81
|
+
title: Implement user authentication
|
|
82
|
+
type: feature
|
|
83
|
+
status: ready
|
|
84
|
+
priority: high
|
|
85
|
+
owner_role: planner
|
|
86
|
+
depends_on: []
|
|
87
|
+
blocked_by: []
|
|
88
|
+
acceptance_criteria:
|
|
89
|
+
- Users can log in with email/password
|
|
90
|
+
- Sessions persist across page reloads
|
|
91
|
+
- Failed login attempts are rate-limited
|
|
92
|
+
risk_level: medium
|
|
93
|
+
module_scope:
|
|
94
|
+
- auth
|
|
95
|
+
- api
|
|
96
|
+
- database
|
|
97
|
+
subtasks:
|
|
98
|
+
- id: design-auth-flow
|
|
99
|
+
title: Design authentication flow
|
|
100
|
+
owner_role: architect
|
|
101
|
+
status: ready
|
|
102
|
+
depends_on: []
|
|
103
|
+
- id: implement-auth-api
|
|
104
|
+
title: Implement authentication API
|
|
105
|
+
owner_role: developer
|
|
106
|
+
status: blocked
|
|
107
|
+
depends_on: [design-auth-flow]
|
|
108
|
+
- id: add-auth-tests
|
|
109
|
+
title: Add authentication tests
|
|
110
|
+
owner_role: qa
|
|
111
|
+
status: pending
|
|
112
|
+
depends_on: [implement-auth-api]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## State Machine
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
backlog → ready → in_analysis → in_design → in_implementation → in_validation → in_review → release_candidate → done
|
|
119
|
+
↓ ↓
|
|
120
|
+
blocked ←───────────────────────────────────────── ←
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Dispatch Matrix
|
|
124
|
+
|
|
125
|
+
| Task Type | First Role | Handoff Sequence |
|
|
126
|
+
|-----------|------------|------------------|
|
|
127
|
+
| Feature | Architect | Architect → Developer → QA → Reviewer |
|
|
128
|
+
| Bug | Triage | Triage → Developer → QA → Reviewer |
|
|
129
|
+
| Refactor | Architect | Architect → Developer → QA |
|
|
130
|
+
| Docs | Developer | Developer → Reviewer |
|
|
131
|
+
| CI Failure | CI Analyst | CI Analyst → Developer → QA |
|
|
132
|
+
|
|
133
|
+
## Checklist
|
|
134
|
+
|
|
135
|
+
- [ ] Task scope analyzed
|
|
136
|
+
- [ ] Required roles identified
|
|
137
|
+
- [ ] Task decomposed into subtasks
|
|
138
|
+
- [ ] Dependencies mapped
|
|
139
|
+
- [ ] Task manifest created
|
|
140
|
+
- [ ] Initial tasks dispatched
|
|
141
|
+
- [ ] Progress tracking in place
|
|
142
|
+
- [ ] Blocking issues addressed
|
|
143
|
+
|
|
144
|
+
## Best Practices
|
|
145
|
+
|
|
146
|
+
- Start with clear acceptance criteria
|
|
147
|
+
- Keep subtasks atomic and focused
|
|
148
|
+
- Minimize dependencies where possible
|
|
149
|
+
- Document assumptions
|
|
150
|
+
- Update task status regularly
|
|
151
|
+
- Escalate blocked tasks promptly
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Test-First Feature Development
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This skill guides developers through implementing features using a test-driven development approach.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- Implementing new features
|
|
10
|
+
- Adding significant functionality
|
|
11
|
+
- When high confidence is needed
|
|
12
|
+
- For complex business logic
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
### 1. Understand Requirements
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. Read and analyze the feature requirements
|
|
20
|
+
2. Identify acceptance criteria
|
|
21
|
+
3. Clarify edge cases and error scenarios
|
|
22
|
+
4. Break down into testable units
|
|
23
|
+
5. Document assumptions
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. Write Test Cases
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
1. Start with happy path tests
|
|
30
|
+
2. Add edge case tests
|
|
31
|
+
3. Add error scenario tests
|
|
32
|
+
4. Consider boundary conditions
|
|
33
|
+
5. Document test intentions
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 3. Write Failing Tests
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
1. Write the test code first
|
|
40
|
+
2. Run tests to confirm they fail
|
|
41
|
+
3. Verify failure reason is correct
|
|
42
|
+
4. Keep tests simple and focused
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 4. Implement Minimum Code
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
1. Write just enough code to pass
|
|
49
|
+
2. Don't over-engineer
|
|
50
|
+
3. Focus on the current test
|
|
51
|
+
4. Ignore optimization for now
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 5. Make Tests Pass
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
1. Run tests to verify pass
|
|
58
|
+
2. If failing, debug and fix
|
|
59
|
+
3. Ensure test is testing the right thing
|
|
60
|
+
4. Confirm implementation is minimal
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 6. Refactor
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
1. Review the implementation
|
|
67
|
+
2. Identify code smells
|
|
68
|
+
3. Refactor while keeping tests green
|
|
69
|
+
4. Improve code organization
|
|
70
|
+
5. Remove duplication
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 7. Repeat
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
1. Write next failing test
|
|
77
|
+
2. Implement minimum code
|
|
78
|
+
3. Make test pass
|
|
79
|
+
4. Refactor
|
|
80
|
+
5. Continue until feature complete
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Test Structure Template
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
describe('FeatureName', () => {
|
|
87
|
+
describe('methodName or scenario', () => {
|
|
88
|
+
it('should do something specific', () => {
|
|
89
|
+
// Arrange
|
|
90
|
+
const input = 'test data';
|
|
91
|
+
const expected = 'expected result';
|
|
92
|
+
|
|
93
|
+
// Act
|
|
94
|
+
const result = functionUnderTest(input);
|
|
95
|
+
|
|
96
|
+
// Assert
|
|
97
|
+
expect(result).toBe(expected);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should handle edge case', () => {
|
|
101
|
+
// Test edge case
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('should throw error for invalid input', () => {
|
|
105
|
+
// Test error handling
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Test Categories
|
|
112
|
+
|
|
113
|
+
### Unit Tests
|
|
114
|
+
- Test individual functions/methods
|
|
115
|
+
- Mock external dependencies
|
|
116
|
+
- Fast execution
|
|
117
|
+
- Isolated scope
|
|
118
|
+
|
|
119
|
+
### Integration Tests
|
|
120
|
+
- Test component interactions
|
|
121
|
+
- Use real dependencies where appropriate
|
|
122
|
+
- Focus on boundaries
|
|
123
|
+
- Verify data flow
|
|
124
|
+
|
|
125
|
+
### Acceptance Tests
|
|
126
|
+
- Test complete user scenarios
|
|
127
|
+
- Verify acceptance criteria
|
|
128
|
+
- End-to-end flow
|
|
129
|
+
- User perspective
|
|
130
|
+
|
|
131
|
+
## Test Naming Convention
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
test_[method]_[scenario]_[expectedResult]
|
|
135
|
+
|
|
136
|
+
Examples:
|
|
137
|
+
- test_calculateTotal_withEmptyCart_returnsZero
|
|
138
|
+
- test_login_withInvalidPassword_throwsException
|
|
139
|
+
- test_processOrder_withValidInput_completesSuccessfully
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Checklist
|
|
143
|
+
|
|
144
|
+
- [ ] Requirements understood
|
|
145
|
+
- [ ] Test cases designed
|
|
146
|
+
- [ ] Happy path tests written
|
|
147
|
+
- [ ] Edge case tests written
|
|
148
|
+
- [ ] Error handling tests written
|
|
149
|
+
- [ ] All tests passing
|
|
150
|
+
- [ ] Code refactored
|
|
151
|
+
- [ ] Test coverage adequate
|
|
152
|
+
- [ ] Code reviewed
|
|
153
|
+
|
|
154
|
+
## Common Patterns
|
|
155
|
+
|
|
156
|
+
### Parameterized Tests
|
|
157
|
+
```typescript
|
|
158
|
+
describe.each([
|
|
159
|
+
['input1', 'expected1'],
|
|
160
|
+
['input2', 'expected2'],
|
|
161
|
+
['input3', 'expected3'],
|
|
162
|
+
])('with input %s', (input, expected) => {
|
|
163
|
+
it(`returns ${expected}`, () => {
|
|
164
|
+
expect(fn(input)).toBe(expected);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Mocking
|
|
170
|
+
```typescript
|
|
171
|
+
// Mock a module
|
|
172
|
+
jest.mock('../dependency', () => ({
|
|
173
|
+
method: jest.fn(),
|
|
174
|
+
}));
|
|
175
|
+
|
|
176
|
+
// Mock implementation
|
|
177
|
+
mock.method.mockImplementation(() => 'mocked value');
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Async Testing
|
|
181
|
+
```typescript
|
|
182
|
+
// Promise
|
|
183
|
+
it('should handle async', async () => {
|
|
184
|
+
const result = await asyncFunction();
|
|
185
|
+
expect(result).toBe('expected');
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Callback
|
|
189
|
+
it('should call callback', (done) => {
|
|
190
|
+
functionWithCallback((result) => {
|
|
191
|
+
expect(result).toBe('expected');
|
|
192
|
+
done();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Best Practices
|
|
198
|
+
|
|
199
|
+
- One assertion per test (when practical)
|
|
200
|
+
- Test behavior, not implementation
|
|
201
|
+
- Keep tests independent
|
|
202
|
+
- Use descriptive test names
|
|
203
|
+
- Don't test implementation details
|
|
204
|
+
- Test edge cases thoroughly
|
|
205
|
+
- Make tests deterministic
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Setup Node.js
|
|
16
|
+
uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: '20'
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: npm install
|
|
22
|
+
|
|
23
|
+
- name: Run Lint
|
|
24
|
+
run: npm run lint
|
|
25
|
+
|
|
26
|
+
typecheck:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- name: Setup Node.js
|
|
32
|
+
uses: actions/setup-node@v4
|
|
33
|
+
with:
|
|
34
|
+
node-version: '20'
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
run: npm install
|
|
38
|
+
|
|
39
|
+
- name: Run TypeCheck
|
|
40
|
+
run: npm run typecheck
|
|
41
|
+
|
|
42
|
+
test:
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
needs: [lint, typecheck]
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
|
|
48
|
+
- name: Setup Node.js
|
|
49
|
+
uses: actions/setup-node@v4
|
|
50
|
+
with:
|
|
51
|
+
node-version: '20'
|
|
52
|
+
|
|
53
|
+
- name: Install dependencies
|
|
54
|
+
run: npm install
|
|
55
|
+
|
|
56
|
+
- name: Run Tests
|
|
57
|
+
run: npm test
|
|
58
|
+
|
|
59
|
+
build:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
needs: [lint, typecheck]
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
|
|
65
|
+
- name: Setup Node.js
|
|
66
|
+
uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version: '20'
|
|
69
|
+
|
|
70
|
+
- name: Install dependencies
|
|
71
|
+
run: npm install
|
|
72
|
+
|
|
73
|
+
- name: Build
|
|
74
|
+
run: npm run build
|
|
75
|
+
|
|
76
|
+
- name: Upload Build Artifacts
|
|
77
|
+
uses: actions/upload-artifact@v4
|
|
78
|
+
with:
|
|
79
|
+
name: build-output
|
|
80
|
+
path: dist/
|
|
81
|
+
retention-days: 7
|