omgkit 2.24.1 → 2.24.3
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/README.md +68 -10
- package/package.json +2 -2
- package/plugin/agents/sprint-master.md +211 -16
- package/plugin/commands/dev/feature-tested.md +208 -0
- package/plugin/commands/quality/coverage-check.md +165 -0
- package/plugin/commands/quality/test-plan.md +181 -0
- package/plugin/commands/quality/verify-done.md +144 -0
- package/plugin/registry.yaml +2 -2
- package/plugin/skills/devops/workflow-config/SKILL.md +58 -1
- package/plugin/skills/methodology/test-enforcement/SKILL.md +441 -0
- package/plugin/skills/methodology/test-task-generation/SKILL.md +369 -0
- package/plugin/workflows/testing/automated-testing.md +377 -0
- package/templates/omgkit/workflow-gitflow.yaml +27 -0
- package/templates/omgkit/workflow-github.yaml +22 -0
- package/templates/omgkit/workflow-trunk.yaml +22 -0
- package/templates/omgkit/workflow.yaml +33 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Automated Testing Workflow
|
|
3
|
+
description: End-to-end testing automation workflow that generates test plans, creates test tasks, executes tests, and enforces coverage gates before completion.
|
|
4
|
+
category: testing
|
|
5
|
+
complexity: medium
|
|
6
|
+
estimated-time: 1-3 hours
|
|
7
|
+
agents:
|
|
8
|
+
- planner
|
|
9
|
+
- tester
|
|
10
|
+
- code-reviewer
|
|
11
|
+
- fullstack-developer
|
|
12
|
+
skills:
|
|
13
|
+
- methodology/test-task-generation
|
|
14
|
+
- methodology/test-enforcement
|
|
15
|
+
- testing/comprehensive-testing
|
|
16
|
+
- testing/vitest
|
|
17
|
+
- testing/playwright
|
|
18
|
+
commands:
|
|
19
|
+
- /quality:test-plan
|
|
20
|
+
- /quality:verify-done
|
|
21
|
+
- /quality:coverage-check
|
|
22
|
+
- /dev:feature-tested
|
|
23
|
+
- /dev:test
|
|
24
|
+
prerequisites:
|
|
25
|
+
- Testing framework configured (Vitest, Jest, Pytest, etc.)
|
|
26
|
+
- Coverage tool configured
|
|
27
|
+
- Workflow config with testing section
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# Automated Testing Workflow
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
This workflow automates the entire testing lifecycle from test planning through execution and verification. It ensures comprehensive test coverage by automatically generating test tasks, enforcing coverage gates, and blocking completion until all requirements are met.
|
|
35
|
+
|
|
36
|
+
## Workflow Diagram
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
40
|
+
│ AUTOMATED TESTING WORKFLOW │
|
|
41
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
42
|
+
|
|
43
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
44
|
+
│ ANALYZE │───▶│ PLAN │───▶│ EXECUTE │───▶│ VERIFY │
|
|
45
|
+
└──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
46
|
+
│ │ │ │
|
|
47
|
+
▼ ▼ ▼ ▼
|
|
48
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
49
|
+
│ Feature │ │ Test │ │ Run │ │ Check │
|
|
50
|
+
│ Analysis │ │ Tasks │ │ Tests │ │ Coverage │
|
|
51
|
+
└──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
52
|
+
│ │ │ │
|
|
53
|
+
▼ ▼ ▼ ▼
|
|
54
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
55
|
+
│ Test │ │ Write │ │ Fix │ │ Mark │
|
|
56
|
+
│ Strategy │ │ Tests │ │ Failures │ │ Done │
|
|
57
|
+
└──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Steps
|
|
61
|
+
|
|
62
|
+
### Step 1: Analyze Feature
|
|
63
|
+
|
|
64
|
+
**Agent:** planner
|
|
65
|
+
**Purpose:** Understand the feature and determine testing strategy.
|
|
66
|
+
|
|
67
|
+
**Actions:**
|
|
68
|
+
1. Read feature requirements
|
|
69
|
+
2. Identify code changes
|
|
70
|
+
3. Classify feature type (API, UI, logic, etc.)
|
|
71
|
+
4. Determine required test types
|
|
72
|
+
5. Set coverage targets
|
|
73
|
+
|
|
74
|
+
**Output:**
|
|
75
|
+
```yaml
|
|
76
|
+
feature_analysis:
|
|
77
|
+
type: api_endpoint
|
|
78
|
+
files_changed:
|
|
79
|
+
- src/handlers/user.ts
|
|
80
|
+
- src/services/userService.ts
|
|
81
|
+
required_tests:
|
|
82
|
+
- unit
|
|
83
|
+
- integration
|
|
84
|
+
- contract
|
|
85
|
+
optional_tests:
|
|
86
|
+
- security
|
|
87
|
+
- performance
|
|
88
|
+
coverage_target: 90%
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### Step 2: Generate Test Plan
|
|
94
|
+
|
|
95
|
+
**Agent:** planner
|
|
96
|
+
**Purpose:** Create comprehensive test plan with all test cases.
|
|
97
|
+
|
|
98
|
+
**Actions:**
|
|
99
|
+
1. Generate test cases for each test type
|
|
100
|
+
2. Define acceptance criteria
|
|
101
|
+
3. Identify test file locations
|
|
102
|
+
4. Estimate effort
|
|
103
|
+
5. Create test task backlog
|
|
104
|
+
|
|
105
|
+
**Output:**
|
|
106
|
+
```markdown
|
|
107
|
+
## Test Plan
|
|
108
|
+
|
|
109
|
+
### Unit Tests (12 cases)
|
|
110
|
+
- Handler validation tests
|
|
111
|
+
- Service logic tests
|
|
112
|
+
- Error handling tests
|
|
113
|
+
|
|
114
|
+
### Integration Tests (6 cases)
|
|
115
|
+
- Full API request/response
|
|
116
|
+
- Database operations
|
|
117
|
+
- External service calls
|
|
118
|
+
|
|
119
|
+
### Contract Tests (4 cases)
|
|
120
|
+
- Request schema validation
|
|
121
|
+
- Response schema validation
|
|
122
|
+
- Error response format
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### Step 3: Create Test Tasks
|
|
128
|
+
|
|
129
|
+
**Agent:** planner
|
|
130
|
+
**Purpose:** Generate actionable test tasks in todo list.
|
|
131
|
+
|
|
132
|
+
**Actions:**
|
|
133
|
+
1. Create test tasks from plan
|
|
134
|
+
2. Link to implementation tasks
|
|
135
|
+
3. Set priorities
|
|
136
|
+
4. Define acceptance criteria per task
|
|
137
|
+
5. Add to sprint backlog
|
|
138
|
+
|
|
139
|
+
**Output:**
|
|
140
|
+
```
|
|
141
|
+
Todo List Updated:
|
|
142
|
+
☐ TEST-001: Unit tests for user handler (P1)
|
|
143
|
+
☐ TEST-002: Unit tests for user service (P1)
|
|
144
|
+
☐ TEST-003: Integration tests for user API (P1)
|
|
145
|
+
☐ TEST-004: Contract tests for user schema (P2)
|
|
146
|
+
☐ TEST-005: Security tests for user endpoints (P2)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
### Step 4: Write Tests
|
|
152
|
+
|
|
153
|
+
**Agent:** tester
|
|
154
|
+
**Purpose:** Implement all test cases.
|
|
155
|
+
|
|
156
|
+
**Actions:**
|
|
157
|
+
1. Create test files
|
|
158
|
+
2. Write test cases
|
|
159
|
+
3. Add assertions
|
|
160
|
+
4. Configure mocks
|
|
161
|
+
5. Verify tests run
|
|
162
|
+
|
|
163
|
+
**Quality Checks:**
|
|
164
|
+
- Tests follow naming conventions
|
|
165
|
+
- Assertions are meaningful
|
|
166
|
+
- Mocks are properly isolated
|
|
167
|
+
- Edge cases covered
|
|
168
|
+
- Error cases tested
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### Step 5: Execute Tests
|
|
173
|
+
|
|
174
|
+
**Agent:** tester
|
|
175
|
+
**Purpose:** Run all tests and collect results.
|
|
176
|
+
|
|
177
|
+
**Actions:**
|
|
178
|
+
1. Run unit tests
|
|
179
|
+
2. Run integration tests
|
|
180
|
+
3. Run contract tests
|
|
181
|
+
4. Run security tests (if applicable)
|
|
182
|
+
5. Collect coverage data
|
|
183
|
+
|
|
184
|
+
**Commands:**
|
|
185
|
+
```bash
|
|
186
|
+
npm test # All tests
|
|
187
|
+
npm run test:coverage # With coverage
|
|
188
|
+
npm run test:integration # Integration only
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
### Step 6: Analyze Results
|
|
194
|
+
|
|
195
|
+
**Agent:** tester
|
|
196
|
+
**Purpose:** Review test results and identify issues.
|
|
197
|
+
|
|
198
|
+
**Actions:**
|
|
199
|
+
1. Check for failures
|
|
200
|
+
2. Identify flaky tests
|
|
201
|
+
3. Review coverage gaps
|
|
202
|
+
4. Prioritize fixes
|
|
203
|
+
5. Update test tasks
|
|
204
|
+
|
|
205
|
+
**Output:**
|
|
206
|
+
```
|
|
207
|
+
Test Results:
|
|
208
|
+
✅ Unit: 45/45 passed
|
|
209
|
+
❌ Integration: 8/10 passed (2 failed)
|
|
210
|
+
✅ Contract: 6/6 passed
|
|
211
|
+
|
|
212
|
+
Coverage:
|
|
213
|
+
- Lines: 82%
|
|
214
|
+
- Branches: 75%
|
|
215
|
+
- Functions: 90%
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
### Step 7: Fix Failures
|
|
221
|
+
|
|
222
|
+
**Agent:** fullstack-developer / tester
|
|
223
|
+
**Purpose:** Address test failures and coverage gaps.
|
|
224
|
+
|
|
225
|
+
**Actions:**
|
|
226
|
+
1. Debug failing tests
|
|
227
|
+
2. Fix implementation bugs
|
|
228
|
+
3. Add missing tests
|
|
229
|
+
4. Improve coverage
|
|
230
|
+
5. Re-run tests
|
|
231
|
+
|
|
232
|
+
**Loop:** Repeat Steps 5-7 until all pass
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
### Step 8: Verify Completion
|
|
237
|
+
|
|
238
|
+
**Agent:** code-reviewer
|
|
239
|
+
**Purpose:** Final verification before marking done.
|
|
240
|
+
|
|
241
|
+
**Actions:**
|
|
242
|
+
1. Run `/quality:verify-done`
|
|
243
|
+
2. Check all gates passed
|
|
244
|
+
3. Review test quality
|
|
245
|
+
4. Approve completion
|
|
246
|
+
5. Mark feature as done
|
|
247
|
+
|
|
248
|
+
**Final Check:**
|
|
249
|
+
```
|
|
250
|
+
/quality:verify-done FEAT-042
|
|
251
|
+
|
|
252
|
+
✅ All tests passing (65/65)
|
|
253
|
+
✅ Coverage 92% ≥ 90% target
|
|
254
|
+
✅ No security vulnerabilities
|
|
255
|
+
✅ All test tasks complete
|
|
256
|
+
✅ Code review approved
|
|
257
|
+
|
|
258
|
+
→ Feature FEAT-042 marked as DONE
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Quality Gates
|
|
264
|
+
|
|
265
|
+
| Gate | Minimum | Target | Blocking |
|
|
266
|
+
|------|---------|--------|----------|
|
|
267
|
+
| Unit Coverage | 80% | 90% | Yes |
|
|
268
|
+
| Integration Coverage | 60% | 75% | Yes |
|
|
269
|
+
| All Tests Pass | 100% | 100% | Yes |
|
|
270
|
+
| No Skipped Critical | 100% | 100% | Yes |
|
|
271
|
+
| Security Scan | Pass | Pass | Yes |
|
|
272
|
+
| Mutation Score | 50% | 75% | No |
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Configuration
|
|
277
|
+
|
|
278
|
+
Add to `.omgkit/workflow.yaml`:
|
|
279
|
+
|
|
280
|
+
```yaml
|
|
281
|
+
testing:
|
|
282
|
+
enforcement:
|
|
283
|
+
level: standard
|
|
284
|
+
|
|
285
|
+
auto_generate_tasks: true
|
|
286
|
+
|
|
287
|
+
coverage_gates:
|
|
288
|
+
unit:
|
|
289
|
+
minimum: 80
|
|
290
|
+
target: 90
|
|
291
|
+
integration:
|
|
292
|
+
minimum: 60
|
|
293
|
+
target: 75
|
|
294
|
+
overall:
|
|
295
|
+
minimum: 75
|
|
296
|
+
target: 85
|
|
297
|
+
|
|
298
|
+
required_test_types:
|
|
299
|
+
- unit
|
|
300
|
+
- integration
|
|
301
|
+
|
|
302
|
+
optional_test_types:
|
|
303
|
+
- e2e
|
|
304
|
+
- security
|
|
305
|
+
- performance
|
|
306
|
+
|
|
307
|
+
blocking:
|
|
308
|
+
on_test_failure: true
|
|
309
|
+
on_coverage_below_minimum: true
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Agent Handoff Protocol
|
|
315
|
+
|
|
316
|
+
### planner → tester
|
|
317
|
+
```yaml
|
|
318
|
+
handoff:
|
|
319
|
+
test_plan: "Full test plan with cases"
|
|
320
|
+
test_tasks: "Created in todo list"
|
|
321
|
+
priorities: "P1 tests first"
|
|
322
|
+
coverage_targets: "90% for this feature"
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### tester → code-reviewer
|
|
326
|
+
```yaml
|
|
327
|
+
handoff:
|
|
328
|
+
test_results: "All 65 tests passing"
|
|
329
|
+
coverage_report: "92% coverage achieved"
|
|
330
|
+
test_files: "List of created test files"
|
|
331
|
+
notes: "Edge cases for retry logic added"
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Troubleshooting
|
|
337
|
+
|
|
338
|
+
### Tests Won't Pass
|
|
339
|
+
|
|
340
|
+
1. Check test isolation (no shared state)
|
|
341
|
+
2. Verify mocks are correct
|
|
342
|
+
3. Check async/await handling
|
|
343
|
+
4. Review test environment setup
|
|
344
|
+
|
|
345
|
+
### Coverage Too Low
|
|
346
|
+
|
|
347
|
+
1. Identify uncovered lines
|
|
348
|
+
2. Add edge case tests
|
|
349
|
+
3. Add error path tests
|
|
350
|
+
4. Check branch coverage
|
|
351
|
+
|
|
352
|
+
### Flaky Tests
|
|
353
|
+
|
|
354
|
+
1. Remove timing dependencies
|
|
355
|
+
2. Use proper async patterns
|
|
356
|
+
3. Isolate external services
|
|
357
|
+
4. Add retry logic for CI
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Quick Commands
|
|
362
|
+
|
|
363
|
+
| Phase | Command |
|
|
364
|
+
|-------|---------|
|
|
365
|
+
| Plan | `/quality:test-plan` |
|
|
366
|
+
| Create | `/dev:feature-tested` |
|
|
367
|
+
| Execute | `/dev:test` |
|
|
368
|
+
| Coverage | `/quality:coverage-check` |
|
|
369
|
+
| Verify | `/quality:verify-done` |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Related Workflows
|
|
374
|
+
|
|
375
|
+
- [Comprehensive Testing](./comprehensive-testing.md) - 4D testing approach
|
|
376
|
+
- [Test-Driven Development](./test-driven-development.md) - TDD workflow
|
|
377
|
+
- [Security Hardening](./security-hardening.md) - Security testing focus
|
|
@@ -115,6 +115,32 @@ hooks:
|
|
|
115
115
|
actions:
|
|
116
116
|
- install
|
|
117
117
|
|
|
118
|
+
testing:
|
|
119
|
+
enforcement:
|
|
120
|
+
level: strict # Stricter for gitflow
|
|
121
|
+
auto_generate_tasks: true
|
|
122
|
+
coverage_gates:
|
|
123
|
+
unit:
|
|
124
|
+
minimum: 85
|
|
125
|
+
target: 95
|
|
126
|
+
integration:
|
|
127
|
+
minimum: 70
|
|
128
|
+
target: 80
|
|
129
|
+
overall:
|
|
130
|
+
minimum: 80
|
|
131
|
+
target: 90
|
|
132
|
+
required_test_types:
|
|
133
|
+
- unit
|
|
134
|
+
- integration
|
|
135
|
+
- e2e
|
|
136
|
+
optional_test_types:
|
|
137
|
+
- security
|
|
138
|
+
- performance
|
|
139
|
+
blocking:
|
|
140
|
+
on_test_failure: true
|
|
141
|
+
on_coverage_below_minimum: true
|
|
142
|
+
on_missing_test_types: true
|
|
143
|
+
|
|
118
144
|
feature_flags:
|
|
119
145
|
provider: none
|
|
120
146
|
default_state: false
|
|
@@ -126,3 +152,4 @@ ci:
|
|
|
126
152
|
- test
|
|
127
153
|
- lint
|
|
128
154
|
- type-check
|
|
155
|
+
- coverage
|
|
@@ -90,6 +90,27 @@ hooks:
|
|
|
90
90
|
actions:
|
|
91
91
|
- test
|
|
92
92
|
|
|
93
|
+
testing:
|
|
94
|
+
enforcement:
|
|
95
|
+
level: standard
|
|
96
|
+
auto_generate_tasks: true
|
|
97
|
+
coverage_gates:
|
|
98
|
+
unit:
|
|
99
|
+
minimum: 80
|
|
100
|
+
target: 90
|
|
101
|
+
integration:
|
|
102
|
+
minimum: 60
|
|
103
|
+
target: 75
|
|
104
|
+
overall:
|
|
105
|
+
minimum: 75
|
|
106
|
+
target: 85
|
|
107
|
+
required_test_types:
|
|
108
|
+
- unit
|
|
109
|
+
- integration
|
|
110
|
+
blocking:
|
|
111
|
+
on_test_failure: true
|
|
112
|
+
on_coverage_below_minimum: true
|
|
113
|
+
|
|
93
114
|
feature_flags:
|
|
94
115
|
provider: none
|
|
95
116
|
|
|
@@ -98,3 +119,4 @@ ci:
|
|
|
98
119
|
required_checks:
|
|
99
120
|
- build
|
|
100
121
|
- test
|
|
122
|
+
- coverage
|
|
@@ -92,6 +92,27 @@ hooks:
|
|
|
92
92
|
- security-scan
|
|
93
93
|
skip_on_ci: true
|
|
94
94
|
|
|
95
|
+
testing:
|
|
96
|
+
enforcement:
|
|
97
|
+
level: standard
|
|
98
|
+
auto_generate_tasks: true
|
|
99
|
+
coverage_gates:
|
|
100
|
+
unit:
|
|
101
|
+
minimum: 80
|
|
102
|
+
target: 90
|
|
103
|
+
integration:
|
|
104
|
+
minimum: 60
|
|
105
|
+
target: 75
|
|
106
|
+
overall:
|
|
107
|
+
minimum: 75
|
|
108
|
+
target: 85
|
|
109
|
+
required_test_types:
|
|
110
|
+
- unit
|
|
111
|
+
- integration
|
|
112
|
+
blocking:
|
|
113
|
+
on_test_failure: true
|
|
114
|
+
on_coverage_below_minimum: true
|
|
115
|
+
|
|
95
116
|
feature_flags:
|
|
96
117
|
provider: vercel-edge
|
|
97
118
|
default_state: false
|
|
@@ -103,3 +124,4 @@ ci:
|
|
|
103
124
|
- build
|
|
104
125
|
- test
|
|
105
126
|
- lint
|
|
127
|
+
- coverage
|
|
@@ -134,6 +134,39 @@ hooks:
|
|
|
134
134
|
actions:
|
|
135
135
|
- test
|
|
136
136
|
|
|
137
|
+
# =============================================================================
|
|
138
|
+
# TESTING AUTOMATION
|
|
139
|
+
# =============================================================================
|
|
140
|
+
testing:
|
|
141
|
+
# Enforcement level: soft | standard | strict
|
|
142
|
+
enforcement:
|
|
143
|
+
level: standard
|
|
144
|
+
|
|
145
|
+
# Auto-generate test tasks when creating features
|
|
146
|
+
auto_generate_tasks: true
|
|
147
|
+
|
|
148
|
+
# Coverage gates
|
|
149
|
+
coverage_gates:
|
|
150
|
+
unit:
|
|
151
|
+
minimum: 80
|
|
152
|
+
target: 90
|
|
153
|
+
integration:
|
|
154
|
+
minimum: 60
|
|
155
|
+
target: 75
|
|
156
|
+
overall:
|
|
157
|
+
minimum: 75
|
|
158
|
+
target: 85
|
|
159
|
+
|
|
160
|
+
# Required test types
|
|
161
|
+
required_test_types:
|
|
162
|
+
- unit
|
|
163
|
+
- integration
|
|
164
|
+
|
|
165
|
+
# Block completion on test failure
|
|
166
|
+
blocking:
|
|
167
|
+
on_test_failure: true
|
|
168
|
+
on_coverage_below_minimum: true
|
|
169
|
+
|
|
137
170
|
# =============================================================================
|
|
138
171
|
# FEATURE FLAGS
|
|
139
172
|
# =============================================================================
|