@jmylchreest/aide-plugin 0.0.24 → 0.0.26

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.
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: test
3
+ description: Write and run tests for code
4
+ triggers:
5
+ - "write tests"
6
+ - "add tests"
7
+ - "test this"
8
+ - "run tests"
9
+ ---
10
+
11
+ # Test Mode
12
+
13
+ **Recommended model tier:** balanced (sonnet) - this skill performs straightforward operations
14
+
15
+ Write comprehensive tests and run test suites.
16
+
17
+ ## Prerequisites
18
+
19
+ Before starting:
20
+ - Identify the code to be tested (function, module, feature)
21
+ - Understand the testing framework used in the project
22
+
23
+ ## Workflow
24
+
25
+ ### Step 1: Check Project Testing Decisions
26
+
27
+ Use the `mcp__plugin_aide_aide__decision_get` tool with topic `testing` to check for testing framework decisions.
28
+
29
+ Common frameworks by language:
30
+ - **TypeScript/JavaScript:** Vitest, Jest, Mocha
31
+ - **Go:** built-in `go test`
32
+ - **Python:** pytest, unittest
33
+
34
+ ### Step 2: Discover Existing Test Patterns
35
+
36
+ Use `Glob` to find test files:
37
+ - Pattern: `**/*.test.ts`, `**/*.spec.ts` (TypeScript)
38
+ - Pattern: `**/*_test.go` (Go)
39
+ - Pattern: `**/test_*.py`, `**/*_test.py` (Python)
40
+
41
+ Use `mcp__plugin_aide_aide__code_search` with query `describe` and `it` to find test patterns.
42
+
43
+ Read an existing test file to understand:
44
+ - Import patterns
45
+ - Setup/teardown patterns
46
+ - Mocking approach
47
+ - Assertion style
48
+
49
+ ### Step 3: Analyze Target Code
50
+
51
+ Use `mcp__plugin_aide_aide__code_symbols` with the target file path to get function signatures.
52
+ Use `mcp__plugin_aide_aide__code_search` to find related types.
53
+
54
+ Identify:
55
+ - Input parameters and types
56
+ - Return type
57
+ - Side effects
58
+ - Dependencies to mock
59
+ - Edge cases
60
+
61
+ ### Step 4: Write Tests
62
+
63
+ Follow the project's testing conventions. Cover these scenarios:
64
+
65
+ **Test Categories:**
66
+ 1. **Happy path** - Normal, expected inputs
67
+ 2. **Edge cases** - Empty, null, boundary values
68
+ 3. **Error cases** - Invalid inputs, expected failures
69
+ 4. **Async behavior** - If applicable
70
+
71
+ **Naming convention:**
72
+ - Descriptive names that explain what is being tested
73
+ - Format: "should [expected behavior] when [condition]"
74
+
75
+ ### Step 5: Run Tests
76
+
77
+ ```bash
78
+ # TypeScript/JavaScript
79
+ npm test # Run all tests
80
+ npm test -- --grep "name" # Run specific test
81
+ npm run test:coverage # Run with coverage
82
+
83
+ # Go
84
+ go test ./... # Run all tests
85
+ go test -v ./pkg/... # Verbose output
86
+ go test -cover ./... # With coverage
87
+
88
+ # Python
89
+ pytest # Run all tests
90
+ pytest -v # Verbose
91
+ pytest --cov # With coverage
92
+ ```
93
+
94
+ ### Step 6: Verify Coverage
95
+
96
+ ```bash
97
+ # Check coverage report
98
+ npm run test:coverage
99
+
100
+ # Go
101
+ go test -coverprofile=coverage.out ./...
102
+ go tool cover -html=coverage.out
103
+ ```
104
+
105
+ **Coverage targets:**
106
+ - New code: aim for >80%
107
+ - Critical paths: aim for >90%
108
+ - Focus on meaningful tests, not just coverage numbers
109
+
110
+ ## Failure Handling
111
+
112
+ | Failure | Action |
113
+ |---------|--------|
114
+ | Test imports fail | Check path aliases, ensure test config matches main |
115
+ | Mock not working | Verify mock setup, check dependency injection |
116
+ | Async test timeout | Add proper await, increase timeout if needed |
117
+ | Flaky test | Check for shared state, timing issues, or external deps |
118
+ | Coverage too low | Add edge case tests, error path tests |
119
+
120
+ ## Test Structure Templates
121
+
122
+ ### TypeScript/JavaScript (Vitest/Jest)
123
+
124
+ ```typescript
125
+ import { describe, it, expect, beforeEach, vi } from 'vitest';
126
+ import { functionToTest } from './module';
127
+
128
+ describe('functionToTest', () => {
129
+ beforeEach(() => {
130
+ // Reset state before each test
131
+ vi.clearAllMocks();
132
+ });
133
+
134
+ it('should return expected result for valid input', () => {
135
+ const result = functionToTest('valid input');
136
+ expect(result).toBe('expected output');
137
+ });
138
+
139
+ it('should handle empty input', () => {
140
+ const result = functionToTest('');
141
+ expect(result).toBe('');
142
+ });
143
+
144
+ it('should throw error for null input', () => {
145
+ expect(() => functionToTest(null)).toThrow('Input required');
146
+ });
147
+
148
+ it('should handle async operation', async () => {
149
+ const result = await functionToTest('async input');
150
+ expect(result).resolves.toBe('async output');
151
+ });
152
+ });
153
+ ```
154
+
155
+ ### Go
156
+
157
+ ```go
158
+ func TestFunctionName(t *testing.T) {
159
+ tests := []struct {
160
+ name string
161
+ input string
162
+ want string
163
+ wantErr bool
164
+ }{
165
+ {"valid input", "input", "expected", false},
166
+ {"empty input", "", "", false},
167
+ {"invalid input", "bad", "", true},
168
+ }
169
+
170
+ for _, tt := range tests {
171
+ t.Run(tt.name, func(t *testing.T) {
172
+ got, err := FunctionName(tt.input)
173
+ if (err != nil) != tt.wantErr {
174
+ t.Errorf("error = %v, wantErr %v", err, tt.wantErr)
175
+ return
176
+ }
177
+ if got != tt.want {
178
+ t.Errorf("got = %v, want %v", got, tt.want)
179
+ }
180
+ })
181
+ }
182
+ }
183
+ ```
184
+
185
+ ### Python
186
+
187
+ ```python
188
+ import pytest
189
+ from module import function_to_test
190
+
191
+ class TestFunctionToTest:
192
+ def test_valid_input(self):
193
+ assert function_to_test("input") == "expected"
194
+
195
+ def test_empty_input(self):
196
+ assert function_to_test("") == ""
197
+
198
+ def test_invalid_input_raises(self):
199
+ with pytest.raises(ValueError):
200
+ function_to_test(None)
201
+
202
+ @pytest.fixture
203
+ def mock_dependency(self, mocker):
204
+ return mocker.patch("module.dependency")
205
+ ```
206
+
207
+ ## MCP Tools
208
+
209
+ - `mcp__plugin_aide_aide__code_search` - Find existing tests, patterns, types
210
+ - `mcp__plugin_aide_aide__code_symbols` - Understand function signatures to test
211
+ - `mcp__plugin_aide_aide__decision_get` - Check testing framework decisions
212
+
213
+ ## Verification Criteria
214
+
215
+ Before completing:
216
+ - [ ] All new tests pass
217
+ - [ ] Existing tests still pass
218
+ - [ ] Coverage meets project standards
219
+ - [ ] Tests are deterministic (not flaky)
220
+ - [ ] Tests follow project conventions
221
+
222
+ ## Output Format
223
+
224
+ ```markdown
225
+ ## Tests Added
226
+
227
+ ### Files
228
+ - `path/to/file.test.ts` - 5 tests for UserService
229
+
230
+ ### Test Cases
231
+ 1. should create user with valid data
232
+ 2. should reject duplicate email
233
+ 3. should hash password before saving
234
+ 4. should handle empty name
235
+ 5. should validate email format
236
+
237
+ ### Coverage
238
+ - New code: 92%
239
+ - Total project: 84%
240
+
241
+ ### Verification
242
+ - All tests: PASS
243
+ - No flaky tests observed
244
+ ```
@@ -0,0 +1,299 @@
1
+ ---
2
+ name: verify
3
+ description: Active QA verification - full validation before completion
4
+ triggers:
5
+ - verify this
6
+ - verify the
7
+ - qa check
8
+ - validate
9
+ - verification
10
+ - verify stage
11
+ ---
12
+
13
+ # Verify Mode
14
+
15
+ **Recommended model tier:** smart (opus) - this skill requires complex reasoning
16
+
17
+ Active QA verification: run all quality checks and report pass/fail status.
18
+
19
+ ## Purpose
20
+
21
+ This is the VERIFY stage of the SDLC pipeline. Implementation is complete. Your job is to run comprehensive validation and report results.
22
+
23
+ **This is different from `review`**: Review is read-only analysis. Verify is active execution of quality checks.
24
+
25
+ ## Verification Checklist
26
+
27
+ Run ALL of the following. Each must pass.
28
+
29
+ ### 1. Full Test Suite
30
+
31
+ ```bash
32
+ # TypeScript/JavaScript
33
+ npm test
34
+
35
+ # Go
36
+ go test ./...
37
+
38
+ # Python
39
+ pytest
40
+ ```
41
+
42
+ **Expected**: All tests pass, no failures, no skipped tests.
43
+
44
+ ### 2. Type Checking
45
+
46
+ ```bash
47
+ # TypeScript
48
+ npx tsc --noEmit
49
+
50
+ # Go (implicit in build)
51
+ go build ./...
52
+
53
+ # Python (if using mypy)
54
+ mypy .
55
+ ```
56
+
57
+ **Expected**: No type errors.
58
+
59
+ ### 3. Linting
60
+
61
+ ```bash
62
+ # TypeScript/JavaScript
63
+ npm run lint
64
+
65
+ # Go
66
+ go vet ./...
67
+ golangci-lint run
68
+
69
+ # Python
70
+ ruff check .
71
+ ```
72
+
73
+ **Expected**: No lint errors. Warnings acceptable if pre-existing.
74
+
75
+ ### 4. Build
76
+
77
+ ```bash
78
+ # TypeScript/JavaScript
79
+ npm run build
80
+
81
+ # Go
82
+ go build ./...
83
+
84
+ # Python
85
+ python -m py_compile *.py
86
+ ```
87
+
88
+ **Expected**: Build succeeds without errors.
89
+
90
+ ### 5. Debug Artifact Check
91
+
92
+ Search for common debug artifacts that shouldn't be committed:
93
+
94
+ ```bash
95
+ # Console logs (JS/TS)
96
+ Grep for "console.log" in changed files
97
+
98
+ # Debug prints (Go)
99
+ Grep for "fmt.Println" or "log.Print" that look like debug
100
+
101
+ # Python debug
102
+ Grep for "print(" or "pdb" or "breakpoint()"
103
+
104
+ # TODO/FIXME comments
105
+ Grep for "TODO" or "FIXME" in changed files
106
+
107
+ # Debugger statements
108
+ Grep for "debugger" in JS/TS files
109
+ ```
110
+
111
+ **Expected**: No debug artifacts in new code. Pre-existing ones noted but not blocking.
112
+
113
+ ### 6. Uncommitted Changes Check
114
+
115
+ ```bash
116
+ git status
117
+ ```
118
+
119
+ **Expected**: Working directory clean, or only expected files modified.
120
+
121
+ ## Workflow
122
+
123
+ ### Step 1: Run All Checks
124
+
125
+ Execute each check in sequence, capturing output:
126
+
127
+ ```bash
128
+ # Run all checks, capture results
129
+ npm test 2>&1 | head -50
130
+ npm run lint 2>&1 | head -50
131
+ npx tsc --noEmit 2>&1 | head -50
132
+ npm run build 2>&1 | head -50
133
+ ```
134
+
135
+ ### Step 2: Check for Debug Artifacts
136
+
137
+ ```bash
138
+ # Search for debug code in recently changed files
139
+ git diff --name-only HEAD~1 | xargs grep -l "console.log\|debugger" 2>/dev/null || true
140
+ ```
141
+
142
+ ### Step 3: Compile Results
143
+
144
+ Create a verification report.
145
+
146
+ ## Output Format
147
+
148
+ ### All Checks Pass
149
+
150
+ ```markdown
151
+ ## Verification Report: PASS
152
+
153
+ ### Tests
154
+ - Status: PASS
155
+ - Total: 42
156
+ - Passed: 42
157
+ - Failed: 0
158
+
159
+ ### Type Check
160
+ - Status: PASS
161
+ - Errors: 0
162
+
163
+ ### Lint
164
+ - Status: PASS
165
+ - Errors: 0
166
+ - Warnings: 3 (pre-existing)
167
+
168
+ ### Build
169
+ - Status: PASS
170
+
171
+ ### Debug Artifacts
172
+ - Status: CLEAN
173
+ - No debug code found in new files
174
+
175
+ ### Verdict: READY FOR DOCS STAGE
176
+ ```
177
+
178
+ ### Some Checks Fail
179
+
180
+ ```markdown
181
+ ## Verification Report: FAIL
182
+
183
+ ### Tests
184
+ - Status: FAIL
185
+ - Total: 42
186
+ - Passed: 40
187
+ - Failed: 2
188
+ - Failures:
189
+ - `UserService.test.ts:45` - expected 200, got 401
190
+ - `AuthMiddleware.test.ts:23` - timeout after 5000ms
191
+
192
+ ### Type Check
193
+ - Status: PASS
194
+
195
+ ### Lint
196
+ - Status: FAIL
197
+ - Errors:
198
+ - `src/user.ts:12` - 'unused' is defined but never used
199
+
200
+ ### Build
201
+ - Status: PASS
202
+
203
+ ### Debug Artifacts
204
+ - Status: WARNING
205
+ - Found:
206
+ - `src/user.ts:34` - console.log("debug user:", user)
207
+
208
+ ### Verdict: NEEDS BUILD-FIX
209
+
210
+ Issues to resolve:
211
+ 1. Fix 2 failing tests
212
+ 2. Remove console.log on line 34
213
+ 3. Fix lint error (remove unused variable)
214
+ ```
215
+
216
+ ## Failure Handling
217
+
218
+ ### Tests Fail
219
+
220
+ 1. Document which tests fail and why
221
+ 2. Do NOT fix them yourself (that's BUILD-FIX stage (via `/aide:build-fix`))
222
+ 3. Report failures clearly
223
+ 4. Verdict: FAIL, needs BUILD-FIX stage (via `/aide:build-fix`)
224
+
225
+ ### Lint Errors
226
+
227
+ 1. Document all lint errors
228
+ 2. Distinguish new errors from pre-existing
229
+ 3. New errors = FAIL
230
+ 4. Pre-existing warnings = PASS with notes
231
+
232
+ ### Type Errors
233
+
234
+ 1. Document all type errors with file:line
235
+ 2. Always FAIL on type errors
236
+ 3. Type errors must be fixed before proceeding
237
+
238
+ ### Build Fails
239
+
240
+ 1. Document build error
241
+ 2. Always FAIL on build errors
242
+ 3. Critical blocker for release
243
+
244
+ ## Decision Tree
245
+
246
+ ```
247
+ All tests pass?
248
+ ├── No → FAIL (needs BUILD-FIX)
249
+ └── Yes → Type check pass?
250
+ ├── No → FAIL (needs BUILD-FIX)
251
+ └── Yes → Lint pass?
252
+ ├── No (new errors) → FAIL (needs BUILD-FIX)
253
+ └── Yes/Warnings only → Build pass?
254
+ ├── No → FAIL (needs BUILD-FIX)
255
+ └── Yes → Debug artifacts?
256
+ ├── Found → FAIL (needs cleanup)
257
+ └── Clean → PASS
258
+ ```
259
+
260
+ ## Completion
261
+
262
+ ### On PASS
263
+
264
+ ```
265
+ Verification complete: ALL CHECKS PASS
266
+ Ready for DOCS stage.
267
+ ```
268
+
269
+ ### On FAIL
270
+
271
+ ```
272
+ Verification complete: CHECKS FAILED
273
+ Returning to BUILD-FIX stage (via `/aide:build-fix`).
274
+
275
+ Issues:
276
+ 1. [list of issues]
277
+ ```
278
+
279
+ When FAIL, the BUILD-FIX stage (via `/aide:build-fix`) addresses issues, then VERIFY runs again.
280
+
281
+ ## Integration with SDLC Pipeline
282
+
283
+ ```
284
+ [DESIGN] → [TEST] → [DEV] → [VERIFY] → [DOCS]
285
+
286
+ YOU ARE HERE
287
+
288
+ ┌──────────┴──────────┐
289
+ │ │
290
+ PASS FAIL
291
+ │ │
292
+ ▼ ▼
293
+ [DOCS] [BUILD-FIX] → [VERIFY]
294
+ ```
295
+
296
+ - **Input**: Completed implementation from DEV stage
297
+ - **Output**: Pass/Fail report with specifics
298
+ - **On Pass**: Proceed to DOCS stage
299
+ - **On Fail**: Return to BUILD-FIX stage (via `/aide:build-fix`), then re-verify