Loading...
Loading...
Build verification, error recovery, and application of review fixes. Use this when the user mentions build verification, error recovery, applying review fixes, test failures, lint errors, or CI breaks. Do NOT load this for: implementation work, reviews, setup, or new feature development.
npx skill4agent add chachamaru127/claude-code-harness verifyThis section takes precedence over other instructions. Be sure to follow it when tests fail or errors occur.
| Prohibited | Example | Correct Response |
|---|---|---|
| Skipping tests | | Fix the implementation |
| Deleting assertions | Removing | Check the expected value and fix the implementation |
| Carelessly rewriting expected values | Changing to match the error | Understand why it failed |
| Relaxing lint rules | Adding | Fix the code |
| Bypassing CI checks | | Fix the root cause |
Test failed
↓
1. Understand why it failed (read the logs)
↓
2. Determine if the implementation is wrong or the test is wrong
↓
├── Implementation is wrong → Fix the implementation ✅
│
└── Test may be wrong → Ask the user for confirmation## 🚨 Approval Request for Test/Settings Changes
### Reason
[Why this change is necessary]
### Change Details
```diff
[Diff]
### Protected Files
Relaxation changes to the following files are prohibited:
- `.eslintrc.*`, `.prettierrc*`, `tsconfig.json`, `biome.json`
- `.husky/**`, `.github/workflows/**`
- `*.test.*`, `*.spec.*`, `jest.config.*`, `vitest.config.*`
## Feature Details
| Feature | Details |
|------|------|
| **Related File Verification** | See [references/verify-related-files.md](references/verify-related-files.md) |
| **Build Verification** | See [references/build-verification.md](references/build-verification.md) |
| **Error Recovery** | See [references/error-recovery.md](references/error-recovery.md) |
| **Review Aggregation** | See [references/review-aggregation.md](references/review-aggregation.md) |
| **Applying Fixes** | See [references/applying-fixes.md](references/applying-fixes.md) |
## Execution Steps
1. **Quality Judgment Gate** (Step 0)
2. Classify the user's request
3. **(After implementation completion) Related File Verification** (Step 1.5)
4. **(When Claude-mem is enabled) Search past error patterns**
5. Read the appropriate reference file from the above "Feature Details"
6. Perform verification/recovery according to the content
### Step 0: Quality Judgment Gate (Reproduction Test Proposal)
When receiving error/bug reports, propose a TDD approach:
#### Proposal for Bug Reports
```markdown
🐛 Bug report received
**Recommended Approach**: Reproduction test first
1. First write a test to reproduce the bug
2. Confirm the test fails (Red)
3. Fix the implementation to pass the test (Green)
4. Refactor
Shall we proceed with this method?
1. Start with reproduction test (recommended)
2. Proceed directly to fix🔴 Tests are failing
**Judgment required**:
Analyze the cause of test failure:
- [ ] Implementation is wrong → Fix the implementation
- [ ] Test expected value is outdated → Confirm with user
⚠️ Tampering with tests (skipping, deleting assertions) is prohibited
Which applies?
1. Fix the implementation
2. Want to confirm the test's expected value🐛 Issue reported
**Recommendation**: First clarify the "conditions under which the issue occurs"
1. What actions trigger the issue?
2. What is the expected behavior?
3. What actually happens?
If you organize these before proceeding with the fix, you can resolve it reliably.Get edited files
↓
┌─────────────────────────────────────────┐
│ Related File Verification │
├─────────────────────────────────────────┤
│ Analyze change patterns: │
│ ├── Function signature change → Check callers │
│ ├── Type/interface change → Check implementation locations │
│ ├── Export deletion → Check import statements │
│ └── Settings change → Check related config files │
└─────────────────────────────────────────┘
↓
Warn about potential missed fixes📋 Related File Verification
✅ Edited: src/auth.ts
└─ Detected signature change of function `validateToken`
⚠️ Need confirmation: The following files may be affected
├─ src/api/middleware.ts:45 (validateToken call)
├─ src/routes/protected.ts:12 (validateToken call)
└─ tests/auth.test.ts:28 (test case)
Have you confirmed?
1. Confirmed, continue
2. Check each file
3. Show details with LSP find-references| Priority | Condition | Action |
|---|---|---|
| Will definitely cause an error (export deletion, required argument addition) | Must fix |
| Possible error (optional argument, type change) | Recommended to confirm |
| Minor impact (comments, documentation) | Reference information |
# Search past errors and solutions with mem-search
mem-search: type:bugfix "{error message keywords}"
mem-search: concepts:problem-solution "{error type}"
mem-search: concepts:gotcha "{related files/libraries}"📚 Past Error Resolution History
| Date | Error | Solution |
|------|--------|-------|
| 2024-01-15 | CORS error | Added Access-Control-Allow-Origin header |
| 2024-01-20 | Type error: undefined | Used optional chaining (?.) |
💡 Attempt recovery by referencing past solutions⚠️ Past Guardrail Triggers in This Project
- Test tampering prevention: 2 times
- Lint relaxation prevention: 1 time
💡 "Solutions" through tampering with tests/settings are prohibitedNote: If Claude-mem is not configured, this step will be skipped.
Pre-build check:
1. Run LSP Diagnostics
2. Confirm 0 errors → Execute build
3. If there are errors → Fix errors first| Recovery Scenario | LSP Utilization Method |
|---|---|
| Type error | Identify exact location with Diagnostics |
| Reference error | Trace cause with Go-to-definition |
| Import error | Identify correct path with Find-references |
📊 LSP Verification Results
Step 1: Diagnostics
├── Errors: 0 ✅
└── Warnings: 2 ⚠️
Step 2: Build
└── Success ✅
Step 3: Tests
└── 15/15 Passed ✅
→ Verification Complete