Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when generating tests for backend code (Express routes, MongoDB models, Node services) - analyzes file type, detects test framework from package.json, generates comprehensive tests with setup/teardown and edge case coverage
.claude/skills/aiskillstore-backend-test-writer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-13 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-14 | ✓→✗ | ▼ Worse | 51% | 0% |
| case-17 | ✓→✗ | ▼ Worse | -19% | 0% |
Generate comprehensive backend tests for MERN stack code. Analyzes file type, detects project conventions, produces tests that actually run.
Philosophy: Smart defaults, zero config. Detect everything from project.
<workflow>
Copy and track progress:
Before generating tests, verify setup:
package.json for test framework (Jest/Vitest/Mocha)mongodb-memory-server (needed for integration tests)__tests__/ vs tests/)Stop if: No test framework and user declines setup.
| Pattern | Type | Test Approach | |---------|------|---------------| | routes/, *.routes.js | Route | Integration (Supertest + real DB) | | controllers/ | Controller | Integration | | services/ | Service | Unit (mocked deps) | | models/, *.model.js | Model | Unit (validation tests) | | middleware/ | Middleware | Unit (mock req/res/next) | | utils/, helpers/ | Utility | Unit (pure functions) |
Override: User can specify --unit or --integration.
Process files sequentially with progress. User can stop anytime.
Each test includes:
Reference: See test-patterns.md for complete code examples.
Generated: X test files
Coverage: Y test cases total
Next: Run `npm test` to verify</workflow>
<quick-reference>
| File Type | Imports | DB Setup | |-----------|---------|----------| | Route | supertest, mongodb-memory-server | Real (in-memory) | | Service | jest | Mocked | | Model | mongoose | Mocked | | Middleware | jest | None |
javascriptdescribe('[Resource] [Method]', () => { describe('success cases', () => { it('should [expected behavior]', async () => {}); }); describe('validation errors', () => { it('should return 400 for [invalid case]', async () => {}); }); describe('edge cases', () => { it('should handle [edge case]', async () => {}); }); });
</quick-reference>
<checklists>
package.json"test": "jest")</checklists>
<common-mistakes>
| Mistake | Fix | |---------|-----| | Starting server in tests | Import app, let Supertest handle it | | No DB cleanup | Add afterEach with deleteMany({}) | | Testing implementation | Test behavior through HTTP interface | | Missing async/await | Await async operations | | Mocking in integration tests | Use real DB for integration |
</common-mistakes>
<guidelines>
</guidelines>
<references>
Load when implementing specific patterns:
| When | Reference | |------|-----------| | Writing any test | test-patterns.md | | Setting up test infrastructure | test-setup.md |
</references>
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-13 | fail→pass | 17,754 | 18,783 | +6% | 1 | 1 | 0% | 3,554 | 4,993 | +40% | 0 | 0 | — |
case-14 | pass→fail | 15,816 | 15,770 | -0% | 1 | 1 | 0% | 2,851 | 4,318 | +51% | 0 | 0 | — |
case-01 | pass→pass | 25,805 | 19,458 | -25% | 1 | 1 | 0% | 5,602 | 5,362 | -4% | 0 | 0 | — |
case-02 | pass→pass | 26,872 | 18,734 | -30% | 1 | 1 | 0% | 5,857 | 4,761 | -19% | 0 | 0 | — |
case-03 | fail→fail | 17,604 | 18,221 | +4% | 1 | 1 | 0% | 3,544 | 4,951 | +40% | 0 | 0 | — |
case-15 | fail→fail | 5,347 | 4,905 | -8% | 1 | 1 | 0% | 940 | 1,964 | +109% | 0 | 0 | — |
case-04 | pass→pass | 18,721 | 17,017 | -9% | 1 | 1 | 0% | 3,809 | 4,736 | +24% | 0 | 0 | — |
case-05 | pass→pass | 15,782 | 12,866 | -18% | 1 | 1 | 0% | 2,988 | 3,785 | +27% | 0 | 0 | — |
case-06 | fail→pass | 14,277 | 14,012 | -2% | 1 | 1 | 0% | 2,876 | 3,764 | +31% | 0 | 0 | — |
case-07 | pass→pass | 13,092 | 9,840 | -25% | 1 | 1 | 0% | 2,526 | 2,999 | +19% | 0 | 0 | — |
case-08 | fail→pass | 7,277 | 3,294 | -55% | 1 | 1 | 0% | 1,283 | 1,683 | +31% | 0 | 0 | — |
case-09 | pass→pass | 9,655 | 7,599 | -21% | 1 | 1 | 0% | 1,820 | 2,617 | +44% | 0 | 0 | — |
case-10 | pass→pass | 13,960 | 15,818 | +13% | 1 | 1 | 0% | 2,850 | 4,334 | +52% | 0 | 0 | — |
case-11 | pass→pass | 12,094 | 9,559 | -21% | 1 | 1 | 0% | 2,419 | 2,977 | +23% | 0 | 0 | — |
case-12 | pass→pass | 17,182 | 12,475 | -27% | 1 | 1 | 0% | 3,579 | 3,781 | +6% | 0 | 0 | — |
case-16 | pass→pass | 13,802 | 5,157 | -63% | 1 | 1 | 0% | 2,273 | 2,033 | -11% | 0 | 0 | — |
case-17 | pass→fail | 13,615 | 5,727 | -58% | 1 | 1 | 0% | 2,560 | 2,072 | -19% | 0 | 0 | — |
case-18 | fail→fail | 13,761 | 13,687 | -1% | 1 | 1 | 0% | 2,809 | 3,881 | +38% | 0 | 0 | — |
case-19 | pass→pass | 15,533 | 12,458 | -20% | 1 | 1 | 0% | 3,048 | 3,578 | +17% | 0 | 0 | — |
case-20 | pass→fail | 12,583 | 14,508 | +15% | 1 | 1 | 0% | 2,540 | 4,251 | +67% | 0 | 0 | — |
case-21 | pass→pass | 10,227 | 7,460 | -27% | 1 | 1 | 0% | 2,070 | 2,563 | +24% | 0 | 0 | — |
case-22 | pass→pass | 5,664 | 6,001 | +6% | 1 | 1 | 0% | 1,094 | 2,337 | +114% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 22 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.