jettypod 4.4.0 → 4.4.2
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/docs/DECISIONS.md +4 -52
- package/jettypod.js +89 -0
- package/lib/chore-classifier.js +232 -0
- package/lib/chore-taxonomy.js +172 -0
- package/package.json +1 -1
- package/skills-templates/chore-mode/SKILL.md +396 -0
- package/skills-templates/chore-mode/verification.js +255 -0
- package/skills-templates/chore-planning/SKILL.md +229 -0
- package/skills-templates/epic-planning/SKILL.md +118 -16
- package/skills-templates/feature-planning/SKILL.md +155 -105
- package/skills-templates/production-mode/SKILL.md +4 -7
- package/skills-templates/speed-mode/SKILL.md +471 -463
- package/skills-templates/stable-mode/SKILL.md +319 -371
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chore-mode
|
|
3
|
+
description: Guide implementation of standalone chores with type-appropriate guidance, verification steps, and test handling. Receives enriched context from chore-planning and executes with iteration until verification passes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Chore Mode Skill
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
10
|
+
│ Standalone Chore Execution │
|
|
11
|
+
│ │
|
|
12
|
+
│ chore-planning → [CHORE MODE] → Done │
|
|
13
|
+
│ ▲▲▲▲▲▲▲▲▲▲▲ │
|
|
14
|
+
│ YOU ARE HERE │
|
|
15
|
+
│ │
|
|
16
|
+
│ Chores are focused tasks - no speed/stable/production progression. │
|
|
17
|
+
│ Execute once with type-appropriate verification, then done. │
|
|
18
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Guides Claude Code through chore execution with type-specific guidance, test handling, and verification criteria from the chore taxonomy.
|
|
22
|
+
|
|
23
|
+
## Instructions
|
|
24
|
+
|
|
25
|
+
When this skill is activated, you are executing a standalone chore. The chore-planning skill has already classified the type and built enriched context. Follow this structured approach:
|
|
26
|
+
|
|
27
|
+
### Overview
|
|
28
|
+
|
|
29
|
+
**Chore Mode Goal:** Execute the chore according to type-specific guidance and verify completion using taxonomy criteria.
|
|
30
|
+
|
|
31
|
+
**Key Principles:**
|
|
32
|
+
- **Type-aware execution** - Different chore types have different test handling and verification
|
|
33
|
+
- **Guided verification** - Use taxonomy verification checklist, not arbitrary checks
|
|
34
|
+
- **Iteration with limits** - Max 5 iterations to achieve verification
|
|
35
|
+
- **No mode progression** - Chores don't have speed/stable/production phases
|
|
36
|
+
|
|
37
|
+
**Chore Types Quick Reference:**
|
|
38
|
+
|
|
39
|
+
| Type | Test Handling | Key Constraint |
|
|
40
|
+
|------|---------------|----------------|
|
|
41
|
+
| refactor | Affected tests only | Do NOT modify test assertions |
|
|
42
|
+
| dependency | Full test suite | Check for deprecation warnings |
|
|
43
|
+
| cleanup | Affected tests | Verify code is actually unused |
|
|
44
|
+
| tooling | CI/manual verification | Focus on verification over unit tests |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Implementation Steps
|
|
49
|
+
|
|
50
|
+
### Step 1: Receive and Display Context
|
|
51
|
+
|
|
52
|
+
**Your task:** Acknowledge the context passed from chore-planning.
|
|
53
|
+
|
|
54
|
+
You will receive:
|
|
55
|
+
- `choreContext.chore` - Chore ID, title, description
|
|
56
|
+
- `choreContext.classification` - Type and confidence
|
|
57
|
+
- `choreContext.guidance` - Scope, verification, testHandling from taxonomy
|
|
58
|
+
- `choreContext.implementationPlan` - Files to modify, affected tests
|
|
59
|
+
|
|
60
|
+
**Display:**
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
64
|
+
🔧 Chore Mode: [Chore Title]
|
|
65
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
66
|
+
|
|
67
|
+
Type: [TYPE] (confidence: [high/medium/low])
|
|
68
|
+
Chore ID: #[id]
|
|
69
|
+
|
|
70
|
+
Implementation Plan:
|
|
71
|
+
• Files to modify: [list from context]
|
|
72
|
+
• Affected tests: [list from context]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Move to Step 2 automatically.**
|
|
76
|
+
|
|
77
|
+
### Step 2: Create Worktree
|
|
78
|
+
|
|
79
|
+
**Your task:** Create an isolated worktree for this chore.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
jettypod work start [chore-id]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This creates a worktree at `.jettypod-work/[id]-[title-slug]` and switches to a new branch.
|
|
86
|
+
|
|
87
|
+
**Display:**
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
📁 Worktree created: .jettypod-work/[id]-[title-slug]
|
|
91
|
+
Branch: chore-[id]-[title-slug]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Move to Step 3 automatically.**
|
|
95
|
+
|
|
96
|
+
### Step 3: Establish Test Baseline
|
|
97
|
+
|
|
98
|
+
**Your task:** Run tests to establish baseline before making changes.
|
|
99
|
+
|
|
100
|
+
**Test handling varies by type:**
|
|
101
|
+
|
|
102
|
+
**For REFACTOR:**
|
|
103
|
+
```bash
|
|
104
|
+
# Run only affected module tests
|
|
105
|
+
npm test -- [affected-test-patterns]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**For DEPENDENCY:**
|
|
109
|
+
```bash
|
|
110
|
+
# Run full test suite
|
|
111
|
+
npm test
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**For CLEANUP:**
|
|
115
|
+
```bash
|
|
116
|
+
# Run affected tests
|
|
117
|
+
npm test -- [affected-test-patterns]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**For TOOLING:**
|
|
121
|
+
```bash
|
|
122
|
+
# Run CI pipeline or specific verification
|
|
123
|
+
# (may not have unit tests)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Display:**
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
🧪 Establishing test baseline...
|
|
130
|
+
|
|
131
|
+
Baseline Result:
|
|
132
|
+
Tests: [X] passing / [Y] total
|
|
133
|
+
Execution time: [Z]s
|
|
134
|
+
|
|
135
|
+
✅ Baseline established - all tests passing
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**CRITICAL:** If baseline tests fail, STOP. Fix existing failures before proceeding with chore work.
|
|
139
|
+
|
|
140
|
+
**Move to Step 4 automatically.**
|
|
141
|
+
|
|
142
|
+
### Step 4: Display Type-Specific Guidance
|
|
143
|
+
|
|
144
|
+
**Your task:** Display warnings and constraints based on chore type.
|
|
145
|
+
|
|
146
|
+
**Load guidance from taxonomy:**
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
const { getGuidance } = require('./lib/chore-taxonomy');
|
|
150
|
+
const guidance = getGuidance('[chore-type]');
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Display type-specific warnings:**
|
|
154
|
+
|
|
155
|
+
**For REFACTOR:**
|
|
156
|
+
```
|
|
157
|
+
⚠️ REFACTOR CONSTRAINTS:
|
|
158
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
159
|
+
• All existing tests MUST pass WITHOUT modification
|
|
160
|
+
• If tests fail, the refactor broke behavior - FIX THE CODE, not the tests
|
|
161
|
+
• No new functionality - this is restructuring only
|
|
162
|
+
• Behavior must be preserved exactly
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**For DEPENDENCY:**
|
|
166
|
+
```
|
|
167
|
+
⚠️ DEPENDENCY CONSTRAINTS:
|
|
168
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
169
|
+
• Run FULL test suite to catch regressions
|
|
170
|
+
• Check for deprecation warnings after update
|
|
171
|
+
• Review changelog for breaking changes
|
|
172
|
+
• Update code if API changed
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**For CLEANUP:**
|
|
176
|
+
```
|
|
177
|
+
⚠️ CLEANUP CONSTRAINTS:
|
|
178
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
179
|
+
• VERIFY code is actually unused before deleting
|
|
180
|
+
• Search for all references (grep for function names)
|
|
181
|
+
• Remove tests ONLY if they test deleted code
|
|
182
|
+
• Check for dynamic references (string-based imports)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**For TOOLING:**
|
|
186
|
+
```
|
|
187
|
+
⚠️ TOOLING CONSTRAINTS:
|
|
188
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
189
|
+
• Verify via CI run or manual testing
|
|
190
|
+
• Focus on verification over unit testing
|
|
191
|
+
• Document current behavior before changes
|
|
192
|
+
• Plan rollback strategy
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Move to Step 5 automatically.**
|
|
196
|
+
|
|
197
|
+
### Step 5: Execute with Iteration
|
|
198
|
+
|
|
199
|
+
**Your task:** Make changes and iterate until tests pass. Max 5 iterations.
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
━━━ Iteration [N]/5 ━━━
|
|
203
|
+
|
|
204
|
+
✍️ Making changes...
|
|
205
|
+
[Describe what you're changing]
|
|
206
|
+
|
|
207
|
+
🧪 Running tests...
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**On each iteration:**
|
|
211
|
+
1. Make focused changes based on implementation plan
|
|
212
|
+
2. Run appropriate tests (type-dependent)
|
|
213
|
+
3. Check results
|
|
214
|
+
|
|
215
|
+
**Display progress:**
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
📊 Progress: [X]/[Y] tests passing
|
|
219
|
+
|
|
220
|
+
✅ Newly passing:
|
|
221
|
+
• [test name]
|
|
222
|
+
|
|
223
|
+
❌ Still failing:
|
|
224
|
+
• [test name]: [brief error]
|
|
225
|
+
|
|
226
|
+
🔧 Next: [what you'll fix]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Exit conditions:**
|
|
230
|
+
- ✅ All tests pass → Move to Step 6
|
|
231
|
+
- ❌ Max iterations reached → Display failure, ask user for guidance
|
|
232
|
+
|
|
233
|
+
**On max iterations:**
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
⚠️ Maximum iterations (5) reached
|
|
237
|
+
|
|
238
|
+
Final Progress: [X]/[Y] tests passing
|
|
239
|
+
|
|
240
|
+
Still failing:
|
|
241
|
+
• [test name]: [error]
|
|
242
|
+
|
|
243
|
+
Options:
|
|
244
|
+
1. Review implementation approach
|
|
245
|
+
2. Break into smaller changes
|
|
246
|
+
3. Get user guidance
|
|
247
|
+
|
|
248
|
+
What would you like to do?
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**STOP and wait for user input if max iterations reached.**
|
|
252
|
+
|
|
253
|
+
### Step 6: Run Verification Checklist
|
|
254
|
+
|
|
255
|
+
**Your task:** Run through type-specific verification criteria from taxonomy.
|
|
256
|
+
|
|
257
|
+
**Load verification from taxonomy:**
|
|
258
|
+
|
|
259
|
+
```javascript
|
|
260
|
+
const { getGuidance } = require('./lib/chore-taxonomy');
|
|
261
|
+
const guidance = getGuidance('[chore-type]');
|
|
262
|
+
// guidance.verification contains the checklist
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Display and verify each item:**
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
269
|
+
🔍 Verification Checklist
|
|
270
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
271
|
+
|
|
272
|
+
[✅/❌] All existing tests pass without modification
|
|
273
|
+
[✅/❌] No new functionality added
|
|
274
|
+
[✅/❌] Code review confirms behavior preservation
|
|
275
|
+
[✅/❌] Performance is not degraded
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Verification methods:**
|
|
279
|
+
- **Tests pass**: Run `npm test` and check exit code
|
|
280
|
+
- **No new functionality**: Review diff for new features
|
|
281
|
+
- **Behavior preservation**: Compare before/after behavior
|
|
282
|
+
- **Performance**: Run benchmarks if applicable
|
|
283
|
+
|
|
284
|
+
**If any verification fails:**
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
❌ Verification failed:
|
|
288
|
+
• [failed item]: [reason]
|
|
289
|
+
|
|
290
|
+
Returning to iteration loop...
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Go back to Step 5 to fix issues.
|
|
294
|
+
|
|
295
|
+
**If all verification passes → Move to Step 7.**
|
|
296
|
+
|
|
297
|
+
### Step 7: Complete and Merge
|
|
298
|
+
|
|
299
|
+
**Your task:** Commit changes and merge to main.
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
# Stage and commit
|
|
303
|
+
git add .
|
|
304
|
+
git commit -m "chore: [brief description]"
|
|
305
|
+
git push
|
|
306
|
+
|
|
307
|
+
# Merge to main (auto-marks chore done)
|
|
308
|
+
jettypod work merge
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Display:**
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
315
|
+
✅ Chore Complete
|
|
316
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
317
|
+
|
|
318
|
+
Type: [TYPE]
|
|
319
|
+
Iterations: [N]/5
|
|
320
|
+
Tests: [X]/[Y] passing
|
|
321
|
+
|
|
322
|
+
Verification:
|
|
323
|
+
✅ All existing tests pass without modification
|
|
324
|
+
✅ No new functionality added
|
|
325
|
+
✅ Code review confirms behavior preservation
|
|
326
|
+
✅ Performance is not degraded
|
|
327
|
+
|
|
328
|
+
Merged to main. Chore #[id] marked done.
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**End skill.**
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Error Handling
|
|
336
|
+
|
|
337
|
+
### Baseline Tests Fail
|
|
338
|
+
```
|
|
339
|
+
❌ Cannot proceed - baseline tests failing
|
|
340
|
+
|
|
341
|
+
[X] tests failing before chore work started.
|
|
342
|
+
Fix existing test failures before proceeding.
|
|
343
|
+
|
|
344
|
+
Failing tests:
|
|
345
|
+
• [test name]: [error]
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Verification Loop
|
|
349
|
+
If verification fails repeatedly (3+ times on same item):
|
|
350
|
+
```
|
|
351
|
+
⚠️ Verification stuck on: [item]
|
|
352
|
+
|
|
353
|
+
This has failed [N] times. Options:
|
|
354
|
+
1. Review the implementation approach
|
|
355
|
+
2. Check if this verification is applicable
|
|
356
|
+
3. Ask user for guidance
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Worktree Issues
|
|
360
|
+
```
|
|
361
|
+
❌ Worktree creation failed
|
|
362
|
+
|
|
363
|
+
Error: [message]
|
|
364
|
+
|
|
365
|
+
Try:
|
|
366
|
+
jettypod work cleanup
|
|
367
|
+
jettypod work start [chore-id]
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## Type Reference
|
|
373
|
+
|
|
374
|
+
### REFACTOR
|
|
375
|
+
- **Goal:** Restructure code without changing behavior
|
|
376
|
+
- **Tests:** Affected modules only
|
|
377
|
+
- **Key rule:** NEVER modify test assertions
|
|
378
|
+
- **Verification:** Tests pass, behavior unchanged
|
|
379
|
+
|
|
380
|
+
### DEPENDENCY
|
|
381
|
+
- **Goal:** Update packages safely
|
|
382
|
+
- **Tests:** Full suite
|
|
383
|
+
- **Key rule:** Check changelogs for breaking changes
|
|
384
|
+
- **Verification:** Tests pass, no deprecation warnings
|
|
385
|
+
|
|
386
|
+
### CLEANUP
|
|
387
|
+
- **Goal:** Remove unused code
|
|
388
|
+
- **Tests:** Affected modules
|
|
389
|
+
- **Key rule:** Verify code is actually unused
|
|
390
|
+
- **Verification:** No broken references, tests pass
|
|
391
|
+
|
|
392
|
+
### TOOLING
|
|
393
|
+
- **Goal:** Improve build/CI/dev tools
|
|
394
|
+
- **Tests:** CI pipeline or manual
|
|
395
|
+
- **Key rule:** Plan rollback strategy
|
|
396
|
+
- **Verification:** CI passes, workflows work
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type-specific verification runner for chore-mode skill
|
|
3
|
+
* Runs verification checklist from chore taxonomy based on chore type
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { getGuidance, CHORE_TYPES } = require('../../../lib/chore-taxonomy');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Create a verification check result
|
|
10
|
+
*
|
|
11
|
+
* @param {string} description - What is being verified
|
|
12
|
+
* @param {boolean} passed - Whether the check passed
|
|
13
|
+
* @param {string} [details] - Additional details or failure reason
|
|
14
|
+
* @returns {{description: string, passed: boolean, details?: string}}
|
|
15
|
+
*/
|
|
16
|
+
function createCheck(description, passed, details = null) {
|
|
17
|
+
const check = { description, passed };
|
|
18
|
+
if (details) check.details = details;
|
|
19
|
+
return check;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Run all verification checks for a chore type
|
|
24
|
+
*
|
|
25
|
+
* @param {string} type - Chore type (refactor, dependency, cleanup, tooling)
|
|
26
|
+
* @param {object} context - Context about the chore execution
|
|
27
|
+
* @param {object} context.testResult - Test execution result
|
|
28
|
+
* @param {boolean} context.testResult.passed - Whether tests passed
|
|
29
|
+
* @param {number} context.testResult.total - Total tests run
|
|
30
|
+
* @param {boolean} [context.testsModified] - Whether test assertions were changed
|
|
31
|
+
* @param {boolean} [context.newFunctionalityAdded] - Whether new features were added
|
|
32
|
+
* @param {string[]} [context.deprecationWarnings] - Any deprecation warnings found
|
|
33
|
+
* @param {boolean} [context.unusedCodeVerified] - Whether code was verified unused
|
|
34
|
+
* @param {boolean} [context.ciPassed] - Whether CI pipeline passed
|
|
35
|
+
* @returns {{passed: boolean, checks: Array<{description: string, passed: boolean, details?: string}>}}
|
|
36
|
+
*/
|
|
37
|
+
function runVerificationChecklist(type, context = {}) {
|
|
38
|
+
const guidance = getGuidance(type);
|
|
39
|
+
const checks = [];
|
|
40
|
+
let allPassed = true;
|
|
41
|
+
|
|
42
|
+
// Run type-specific verification based on taxonomy criteria
|
|
43
|
+
switch (type) {
|
|
44
|
+
case CHORE_TYPES.REFACTOR:
|
|
45
|
+
checks.push(...runRefactorChecks(guidance, context));
|
|
46
|
+
break;
|
|
47
|
+
|
|
48
|
+
case CHORE_TYPES.DEPENDENCY:
|
|
49
|
+
checks.push(...runDependencyChecks(guidance, context));
|
|
50
|
+
break;
|
|
51
|
+
|
|
52
|
+
case CHORE_TYPES.CLEANUP:
|
|
53
|
+
checks.push(...runCleanupChecks(guidance, context));
|
|
54
|
+
break;
|
|
55
|
+
|
|
56
|
+
case CHORE_TYPES.TOOLING:
|
|
57
|
+
checks.push(...runToolingChecks(guidance, context));
|
|
58
|
+
break;
|
|
59
|
+
|
|
60
|
+
default:
|
|
61
|
+
checks.push(createCheck(
|
|
62
|
+
'Valid chore type',
|
|
63
|
+
false,
|
|
64
|
+
`Unknown type: ${type}`
|
|
65
|
+
));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Calculate overall pass/fail
|
|
69
|
+
allPassed = checks.every(check => check.passed);
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
passed: allPassed,
|
|
73
|
+
checks
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Run refactor-specific verification checks
|
|
79
|
+
*/
|
|
80
|
+
function runRefactorChecks(guidance, context) {
|
|
81
|
+
const checks = [];
|
|
82
|
+
|
|
83
|
+
// "All existing tests pass without modification"
|
|
84
|
+
checks.push(createCheck(
|
|
85
|
+
'All existing tests pass without modification',
|
|
86
|
+
context.testResult?.passed === true,
|
|
87
|
+
context.testResult?.passed ? null : 'Tests failed - refactor may have broken behavior'
|
|
88
|
+
));
|
|
89
|
+
|
|
90
|
+
// Check if tests were modified (should NOT be)
|
|
91
|
+
checks.push(createCheck(
|
|
92
|
+
'No test assertions modified',
|
|
93
|
+
context.testsModified !== true,
|
|
94
|
+
context.testsModified ? 'Test assertions were changed - this violates refactor rules' : null
|
|
95
|
+
));
|
|
96
|
+
|
|
97
|
+
// "No new functionality added"
|
|
98
|
+
checks.push(createCheck(
|
|
99
|
+
'No new functionality added',
|
|
100
|
+
context.newFunctionalityAdded !== true,
|
|
101
|
+
context.newFunctionalityAdded ? 'New functionality detected - this should be a feature, not a refactor' : null
|
|
102
|
+
));
|
|
103
|
+
|
|
104
|
+
// "Performance is not degraded" - assumed pass unless context indicates otherwise
|
|
105
|
+
checks.push(createCheck(
|
|
106
|
+
'Performance not degraded',
|
|
107
|
+
context.performanceDegraded !== true,
|
|
108
|
+
context.performanceDegraded ? 'Performance regression detected' : null
|
|
109
|
+
));
|
|
110
|
+
|
|
111
|
+
return checks;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Run dependency-specific verification checks
|
|
116
|
+
*/
|
|
117
|
+
function runDependencyChecks(guidance, context) {
|
|
118
|
+
const checks = [];
|
|
119
|
+
|
|
120
|
+
// "All tests pass after update"
|
|
121
|
+
checks.push(createCheck(
|
|
122
|
+
'All tests pass after update',
|
|
123
|
+
context.testResult?.passed === true,
|
|
124
|
+
context.testResult?.passed ? null : 'Tests failed after dependency update'
|
|
125
|
+
));
|
|
126
|
+
|
|
127
|
+
// "Application builds successfully" - assumed from test pass
|
|
128
|
+
checks.push(createCheck(
|
|
129
|
+
'Application builds successfully',
|
|
130
|
+
context.buildPassed !== false,
|
|
131
|
+
context.buildPassed === false ? 'Build failed' : null
|
|
132
|
+
));
|
|
133
|
+
|
|
134
|
+
// "No new deprecation warnings"
|
|
135
|
+
const hasDeprecations = context.deprecationWarnings && context.deprecationWarnings.length > 0;
|
|
136
|
+
checks.push(createCheck(
|
|
137
|
+
'No new deprecation warnings (or documented)',
|
|
138
|
+
!hasDeprecations || context.deprecationsDocumented === true,
|
|
139
|
+
hasDeprecations && !context.deprecationsDocumented
|
|
140
|
+
? `Found ${context.deprecationWarnings.length} deprecation warnings`
|
|
141
|
+
: null
|
|
142
|
+
));
|
|
143
|
+
|
|
144
|
+
return checks;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Run cleanup-specific verification checks
|
|
149
|
+
*/
|
|
150
|
+
function runCleanupChecks(guidance, context) {
|
|
151
|
+
const checks = [];
|
|
152
|
+
|
|
153
|
+
// "All tests still pass"
|
|
154
|
+
checks.push(createCheck(
|
|
155
|
+
'All tests still pass',
|
|
156
|
+
context.testResult?.passed === true,
|
|
157
|
+
context.testResult?.passed ? null : 'Tests failed after cleanup'
|
|
158
|
+
));
|
|
159
|
+
|
|
160
|
+
// "No broken imports or references"
|
|
161
|
+
checks.push(createCheck(
|
|
162
|
+
'No broken imports or references',
|
|
163
|
+
context.brokenReferences !== true,
|
|
164
|
+
context.brokenReferences ? 'Broken references found' : null
|
|
165
|
+
));
|
|
166
|
+
|
|
167
|
+
// "Removed code was actually unused"
|
|
168
|
+
checks.push(createCheck(
|
|
169
|
+
'Removed code was verified unused',
|
|
170
|
+
context.unusedCodeVerified === true,
|
|
171
|
+
context.unusedCodeVerified ? null : 'Code usage was not verified before removal'
|
|
172
|
+
));
|
|
173
|
+
|
|
174
|
+
return checks;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Run tooling-specific verification checks
|
|
179
|
+
*/
|
|
180
|
+
function runToolingChecks(guidance, context) {
|
|
181
|
+
const checks = [];
|
|
182
|
+
|
|
183
|
+
// "CI pipeline passes"
|
|
184
|
+
checks.push(createCheck(
|
|
185
|
+
'CI pipeline passes',
|
|
186
|
+
context.ciPassed === true,
|
|
187
|
+
context.ciPassed ? null : 'CI not verified or failed'
|
|
188
|
+
));
|
|
189
|
+
|
|
190
|
+
// "Build completes successfully"
|
|
191
|
+
checks.push(createCheck(
|
|
192
|
+
'Build completes successfully',
|
|
193
|
+
context.buildPassed !== false,
|
|
194
|
+
context.buildPassed === false ? 'Build failed' : null
|
|
195
|
+
));
|
|
196
|
+
|
|
197
|
+
// "No regression in build times or developer experience"
|
|
198
|
+
checks.push(createCheck(
|
|
199
|
+
'No regression in build times/DX',
|
|
200
|
+
context.dxRegression !== true,
|
|
201
|
+
context.dxRegression ? 'Developer experience regression detected' : null
|
|
202
|
+
));
|
|
203
|
+
|
|
204
|
+
return checks;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Format verification results for display
|
|
209
|
+
*
|
|
210
|
+
* @param {{passed: boolean, checks: Array}} result - Verification result
|
|
211
|
+
* @returns {string} Formatted string for display
|
|
212
|
+
*/
|
|
213
|
+
function formatVerificationResult(result) {
|
|
214
|
+
const lines = [];
|
|
215
|
+
lines.push('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
216
|
+
lines.push('🔍 Verification Checklist');
|
|
217
|
+
lines.push('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
218
|
+
lines.push('');
|
|
219
|
+
|
|
220
|
+
for (const check of result.checks) {
|
|
221
|
+
const icon = check.passed ? '✅' : '❌';
|
|
222
|
+
lines.push(`${icon} ${check.description}`);
|
|
223
|
+
if (check.details) {
|
|
224
|
+
lines.push(` └─ ${check.details}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
lines.push('');
|
|
229
|
+
if (result.passed) {
|
|
230
|
+
lines.push('✅ All verification checks passed');
|
|
231
|
+
} else {
|
|
232
|
+
const failedCount = result.checks.filter(c => !c.passed).length;
|
|
233
|
+
lines.push(`❌ ${failedCount} verification check(s) failed`);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return lines.join('\n');
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Get verification criteria from taxonomy for display
|
|
241
|
+
*
|
|
242
|
+
* @param {string} type - Chore type
|
|
243
|
+
* @returns {string[]} Array of verification criteria strings
|
|
244
|
+
*/
|
|
245
|
+
function getVerificationCriteria(type) {
|
|
246
|
+
const guidance = getGuidance(type);
|
|
247
|
+
return guidance.verification || [];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
module.exports = {
|
|
251
|
+
runVerificationChecklist,
|
|
252
|
+
formatVerificationResult,
|
|
253
|
+
getVerificationCriteria,
|
|
254
|
+
createCheck
|
|
255
|
+
};
|