Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Express API conventions and storage patterns. Use when building REST APIs, defining routes, or implementing storage interfaces. Triggers on: Express, router, API route, status code, storage interface.
.claude/skills/aiskillstore-pitfalls-express-api/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -41% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -25% | 0% |
Common pitfalls and correct patterns for Express APIs.
Check that routes follow REST conventions.
Ensure correct status codes for each operation.
Confirm input validation middleware is in place.
typescript// Public routes GET /api/resource // List GET /api/resource/:id // Get one // Admin routes (with auth middleware) POST /api/admin/resource // Create (201) PATCH /api/admin/resource/:id // Update (200) DELETE /api/admin/resource/:id // Delete (204) // ✅ Always validate before storage router.post('/', validateBody(schema), async (req, res) => { const validated = req.body; // Already validated by middleware });
| Operation | Success | Not Found | Invalid | |-----------|---------|-----------|---------| | GET | 200 | 404 | 400 | | POST | 201 | - | 400 | | PATCH | 200 | 404 | 400 | | DELETE | 204 | 404 | - |
typescript// ✅ Define interface for all storage operations interface IStorage { // Strategies getStrategies(): Promise<Strategy[]>; getStrategy(id: string): Promise<Strategy | undefined>; createStrategy(data: NewStrategy): Promise<Strategy>; updateStrategy(id: string, data: Partial<Strategy>): Promise<Strategy | undefined>; deleteStrategy(id: string): Promise<boolean>; } // ✅ Implement for different backends class DbStorage implements IStorage { ... } // PostgreSQL class MemStorage implements IStorage { ... } // Testing
typescript// ✅ Cleanup on process exit const intervals: NodeJS.Timeout[] = []; function startJob(fn: () => void, ms: number) { const id = setInterval(fn, ms); intervals.push(id); return id; } process.on('SIGTERM', () => { intervals.forEach(clearInterval); process.exit(0); }); // ✅ Handle overlapping executions let isRunning = false; async function scanForOpportunities() { if (isRunning) return; isRunning = true; try { await scan(); } finally { isRunning = false; } }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,307 | 15,610 | +2% | 1 | 1 | 0% | 3,084 | 2,764 | -10% | 0 | 0 | — |
case-02 | fail→pass | 19,202 | 17,772 | -7% | 1 | 1 | 0% | 3,446 | 3,582 | +4% | 0 | 0 | — |
case-03 | fail→pass | 14,635 | 14,752 | +1% | 1 | 1 | 0% | 3,169 | 3,475 | +10% | 0 | 0 | — |
case-13 | fail→pass | 14,952 | 7,308 | -51% | 1 | 1 | 0% | 1,757 | 1,028 | -41% | 0 | 0 | — |
case-04 | fail→pass | 17,037 | 7,366 | -57% | 1 | 1 | 0% | 2,594 | 1,933 | -25% | 0 | 0 | — |
case-05 | pass→pass | 14,197 | 8,445 | -41% | 1 | 1 | 0% | 2,532 | 2,261 | -11% | 0 | 0 | — |
case-06 | pass→pass | 14,647 | 3,229 | -78% | 1 | 1 | 0% | 1,635 | 1,247 | -24% | 0 | 0 | — |
case-07 | pass→pass | 19,371 | 14,503 | -25% | 1 | 1 | 0% | 2,728 | 2,521 | -8% | 0 | 0 | — |
case-18 | pass→pass | 21,197 | 7,551 | -64% | 1 | 1 | 0% | 2,657 | 1,140 | -57% | 0 | 0 | — |
case-08 | fail→pass | 24,637 | 12,938 | -47% | 1 | 1 | 0% | 2,454 | 2,264 | -8% | 0 | 0 | — |
case-09 | pass→pass | 15,665 | 19,073 | +22% | 1 | 1 | 0% | 2,976 | 3,335 | +12% | 0 | 0 | — |
case-10 | pass→pass | 20,105 | 11,642 | -42% | 1 | 1 | 0% | 1,904 | 1,834 | -4% | 0 | 0 | — |
case-11 | fail→pass | 12,884 | 9,247 | -28% | 1 | 1 | 0% | 2,010 | 1,399 | -30% | 0 | 0 | — |
case-12 | fail→pass | 12,172 | 3,526 | -71% | 1 | 1 | 0% | 2,021 | 1,345 | -33% | 0 | 0 | — |
case-14 | pass→pass | 16,095 | 12,825 | -20% | 1 | 1 | 0% | 2,072 | 2,183 | +5% | 0 | 0 | — |
case-15 | pass→pass | 12,881 | 2,532 | -80% | 1 | 1 | 0% | 1,463 | 1,092 | -25% | 0 | 0 | — |
case-16 | pass→pass | 15,307 | 9,061 | -41% | 1 | 1 | 0% | 1,732 | 1,387 | -20% | 0 | 0 | — |
case-17 | pass→pass | 11,507 | 5,350 | -54% | 1 | 1 | 0% | 2,176 | 1,646 | -24% | 0 | 0 | — |
case-19 | fail→pass | 10,904 | 11,690 | +7% | 1 | 1 | 0% | 2,190 | 1,927 | -12% | 0 | 0 | — |
case-20 | pass→pass | 14,029 | 13,100 | -7% | 1 | 1 | 0% | 1,801 | 2,068 | +15% | 0 | 0 | — |
case-21 | pass→pass | 20,272 | 20,422 | +1% | 1 | 1 | 0% | 3,103 | 4,049 | +30% | 0 | 0 | — |
case-22 | pass→pass | 13,697 | 12,489 | -9% | 1 | 1 | 0% | 2,315 | 2,112 | -9% | 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 +41 percentage points is the difference between those two pass rates over the 22 comparable cases.
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.