Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Autonomously deep-scan entire codebase line-by-line, understand architecture and patterns, then systematically transform it to production-grade, corporate-level professional quality with optimizations
.claude/skills/sickn33-production-code-audit/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-19 | ✗→✓ | ▲ Improved | 137% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 189% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 156% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 173% | 0% |
| case-06 | ✓→✓ | = Same ✓ | 120% | 0% |
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
markdownUser: @production-code-audit make this production-ready AI: I'll scan your entire codebase and transform it to production-grade quality. **Phase 1: Discovering Codebase** (analyzing 247 files) - Detected: Node.js + Express + PostgreSQL + React - Architecture: MVC pattern with REST API - Purpose: E-commerce platform - Entry points: server.js, src/index.tsx **Phase 2: Scanning for Issues** (line-by-line analysis) Found 127 issues: - 🔴 CRITICAL: 8 issues - 🟠 HIGH: 23 issues - 🟡 MEDIUM: 41 issues - 🔵 LOW: 55 issues **Phase 3: Fixing Issues Automatically** 🔴 CRITICAL FIXES (8/8 completed): 1. ✅ Fixed SQL injection in UserRepository.findByEmail() - Before: String concatenation in query - After: Parameterized query with $1 placeholder 2. ✅ Removed hardcoded database password from config/database.ts - Before: password: 'SuperSecret123!' - After: password: process.env.DB_PASSWORD 3. ✅ Added authentication to admin routes - Before: No auth middleware - After: authenticateToken + requireRole('admin') 4. ✅ Fixed weak password hashing (MD5 → bcrypt) - Before: crypto.createHash('md5') - After: bcrypt.hash(password, 12) 5. ✅ Fixed circular dependency: OrderService ↔ PaymentService - Before: Direct imports causing cycle - After: Event-based decoupling with EventBus 6. ✅ Added input validation to all API endpoints - Before: No validation - After: Zod schemas validating all inputs 7. ✅ Fixed authentication bypass in auth middleware - Before: next() called on missing token - After: Returns 401 error 8. ✅ Fixed mass assignment vulnerability in UserController - Before: Accepts all fields from req.body - After: Whitelist of allowed fields only 🟠 HIGH PRIORITY FIXES (23/23 completed): 9. ✅ Fixed N+1 query in OrderService.getOrdersWithItems() - Before: Loop with individual queries (2.8s) - After: Single query with joins (45ms) - Performance: 98% improvement 10. ✅ Refactored UserService god class (850 lines → 4 focused services) - UserAuthenticationService (login, logout, password) - UserProfileService (CRUD operations) - UserNotificationService (email, SMS) - UserPermissionService (roles, permissions) 11. ✅ Added Redis caching for product queries - Before: Database query every request - After: Cache with 1-hour TTL - Performance: 95% faster 12. ✅ Optimized bundle size - Before: 850KB (gzipped: 280KB) - After: 380KB (gzipped: 120KB) - Improvement: 55% reduction 13. ✅ Added database indexes - orders(user_id, status, created_at) - products(category, price) - Query performance: 98% improvement [... 11 more high-priority fixes ...] 🟡 MEDIUM PRIORITY FIXES (41/41 completed): [... all medium fixes ...] 🔵 LOW PRIORITY IMPROVEMENTS (55/55 completed): [... all low improvements ...] **Phase 4: Adding Production Infrastructure** ✅ Added structured logging (Winston) ✅ Added error tracking (Sentry) ✅ Added health check endpoints (/health, /ready) ✅ Added monitoring (Prometheus metrics) ✅ Added rate limiting (Redis-based) ✅ Added API documentation (Swagger/OpenAPI) ✅ Added comprehensive README ✅ Added deployment guide ✅ Added CI/CD pipeline (.github/workflows) **Phase 5: Verification** ✅ All tests passing (1,247 tests) ✅ Test coverage: 42% → 87% ✅ Security scan: 0 vulnerabilities ✅ Performance: API response time 3.2s → 180ms ✅ Bundle size: 850KB → 380KB ✅ Lighthouse score: 62 → 94 **TRANSFORMATION COMPLETE** Your codebase is now production-ready with enterprise-grade quality: 📊 Metrics: - Issues fixed: 127/127 (100%) - Test coverage: 87% (target: 80%+) - API performance: 94% improvement - Security: OWASP Top 10 compliant - Code quality: Grade A- 📁 Files changed: 89 files 📝 Lines changed: +3,247 / -1,892 🚀 Ready for production deployment!
markdownUser: @production-code-audit secure this codebase AI: Scanning for security vulnerabilities... **Security Scan Complete** Found 15 security issues: - 🔴 CRITICAL: 5 - 🟠 HIGH: 7 - 🟡 MEDIUM: 3 **Fixing all security issues automatically...** 🔴 CRITICAL (5/5 fixed): 1. ✅ SQL Injection in UserRepository \`\`\`typescript // Before (VULNERABLE) const query = \`SELECT * FROM users WHERE email = '\${email}'\`; // After (SECURE) const query = 'SELECT * FROM users WHERE email = $1'; await db.query(query, [email]); \`\`\` 2. ✅ Hardcoded Secrets Removed \`\`\`typescript // Before (INSECURE) const tokenSigningKey = '[redacted weak value]'; // After (SECURE) const JWT_SECRET = process.env.JWT_SECRET; if (!JWT_SECRET) throw new Error('JWT_SECRET required'); \`\`\` 3. ✅ Authentication Added to Admin Routes \`\`\`typescript // Before (VULNERABLE) router.delete('/api/admin/users/:id', deleteUser); // After (SECURE) router.delete('/api/admin/users/:id', authenticateToken, requireRole('admin'), deleteUser ); \`\`\` 4. ✅ Password Hashing Upgraded \`\`\`typescript // Before (WEAK) const hash = crypto.createHash('md5').update(password).digest('hex'); // After (STRONG) const hash = await bcrypt.hash(password, 12); \`\`\` 5. ✅ Input Validation Added \`\`\`typescript // Before (VULNERABLE) const user = await db.user.create({ data: req.body }); // After (SECURE) const schema = z.object({ email: z.string().email(), password: z.string().min(12), name: z.string().min(2).max(100) }); const validated = schema.parse(req.body); const user = await db.user.create({ data: validated }); \`\`\` **Security Status:** - ✅ OWASP Top 10: Compliant - ✅ SQL Injection: Protected - ✅ XSS: Protected - ✅ CSRF: Protected - ✅ Authentication: Secure - ✅ Secrets: Environment variables - ✅ Dependencies: No vulnerabilities 🔒 Codebase is now secure and production-ready!
markdownUser: @production-code-audit optimize performance AI: Analyzing performance bottlenecks... **Performance Analysis Complete** Current metrics: - API response time: 3.2s (target: <200ms) - Page load time: 8.5s (target: <2s) - Bundle size: 850KB (target: <200KB) **Optimizing automatically...** ✅ Fixed N+1 queries (3.2s → 180ms - 94% faster) ✅ Added Redis caching (95% cache hit rate) ✅ Optimized database indexes (98% faster queries) ✅ Reduced bundle size (850KB → 380KB - 55% smaller) ✅ Optimized images (28MB → 3.2MB - 89% smaller) ✅ Implemented code splitting ✅ Added lazy loading ✅ Parallelized async operations **Performance Results:** | Metric | Before | After | Improvement | |--------|--------|-------|-------------| | API Response | 3.2s | 180ms | 94% | | Page Load | 8.5s | 1.8s | 79% | | Bundle Size | 850KB | 380KB | 55% | | Image Size | 28MB | 3.2MB | 89% | | Lighthouse | 42 | 94 | +52 points | 🚀 Performance optimized to production standards!
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 11,492 | 10,398 | -10% | 1 | 1 | 0% | 1,317 | 5,779 | +339% | 0 | 0 | — |
case-02 | fail→fail | 3,372 | 4,100 | +22% | 1 | 1 | 0% | 621 | 4,400 | +609% | 0 | 0 | — |
case-03 | pass→pass | 14,772 | 16,230 | +10% | 1 | 1 | 0% | 2,388 | 6,890 | +189% | 0 | 0 | — |
case-04 | pass→pass | 11,950 | 10,589 | -11% | 1 | 1 | 0% | 2,438 | 6,249 | +156% | 0 | 0 | — |
case-05 | pass→pass | 16,607 | 25,594 | +54% | 1 | 1 | 0% | 3,794 | 10,368 | +173% | 0 | 0 | — |
case-06 | pass→pass | 18,612 | 14,524 | -22% | 1 | 1 | 0% | 3,189 | 7,028 | +120% | 0 | 0 | — |
case-07 | pass→pass | 11,279 | 11,126 | -1% | 1 | 1 | 0% | 2,246 | 6,405 | +185% | 0 | 0 | — |
case-08 | pass→pass | 18,589 | 27,637 | +49% | 1 | 1 | 0% | 3,348 | 9,568 | +186% | 0 | 0 | — |
case-09 | pass→pass | 14,264 | 10,623 | -26% | 1 | 1 | 0% | 2,534 | 6,131 | +142% | 0 | 0 | — |
case-10 | pass→pass | 28,085 | 24,922 | -11% | 1 | 1 | 0% | 3,080 | 9,290 | +202% | 0 | 0 | — |
case-11 | pass→pass | 14,916 | 16,293 | +9% | 1 | 1 | 0% | 2,890 | 7,545 | +161% | 0 | 0 | — |
case-12 | pass→pass | 20,033 | 26,480 | +32% | 1 | 1 | 0% | 3,721 | 10,366 | +179% | 0 | 0 | — |
case-13 | pass→pass | 18,173 | 17,157 | -6% | 1 | 1 | 0% | 3,320 | 7,722 | +133% | 0 | 0 | — |
case-14 | pass→pass | 23,735 | 25,247 | +6% | 1 | 1 | 0% | 3,881 | 9,568 | +147% | 0 | 0 | — |
case-15 | pass→pass | 24,405 | 19,813 | -19% | 1 | 1 | 0% | 4,190 | 8,018 | +91% | 0 | 0 | — |
case-16 | pass→pass | 17,106 | 19,646 | +15% | 1 | 1 | 0% | 2,823 | 7,711 | +173% | 0 | 0 | — |
case-17 | pass→pass | 21,595 | 19,505 | -10% | 1 | 1 | 0% | 3,289 | 7,717 | +135% | 0 | 0 | — |
case-18 | pass→pass | 15,704 | 19,389 | +23% | 1 | 1 | 0% | 2,788 | 8,266 | +196% | 0 | 0 | — |
case-19 | fail→pass | 15,204 | 17,595 | +16% | 1 | 1 | 0% | 3,040 | 7,207 | +137% | 0 | 0 | — |
case-20 | pass→pass | 14,378 | 18,147 | +26% | 1 | 1 | 0% | 2,745 | 7,896 | +188% | 0 | 0 | — |
case-21 | pass→pass | 17,731 | 16,402 | -7% | 1 | 1 | 0% | 3,212 | 7,708 | +140% | 0 | 0 | — |
case-22 | pass→pass | 16,855 | 20,779 | +23% | 1 | 1 | 0% | 2,948 | 8,424 | +186% | 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, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +5 percentage points is the difference between those two pass rates over the 21 comparable cases.
The publisher has shipped newer versions since this run, so these numbers describe v1, not the version currently listed.
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.