Production Code Audit
Overview
Autonomously analyze the entire codebase to understand its architecture, patterns, and purpose, then systematically transform it into production-grade, corporate-level professional code. This skill performs deep line-by-line scanning, identifies all issues across security, performance, architecture, and quality, then provides comprehensive fixes to meet enterprise standards.
When to Use This Skill
- Use when user says "make this production-ready"
- Use when user says "audit my codebase"
- Use when user says "make this professional/corporate-level"
- Use when user says "optimize everything"
- Use when user wants enterprise-grade quality
- Use when preparing for production deployment
- Use when code needs to meet corporate standards
How It Works
Step 1: Autonomous Codebase Discovery
Automatically scan and understand the entire codebase:
- Read all files - Scan every file in the project recursively
- Identify tech stack - Detect languages, frameworks, databases, tools
- Understand architecture - Map out structure, patterns, dependencies
- Identify purpose - Understand what the application does
- Find entry points - Locate main files, routes, controllers
- Map data flow - Understand how data moves through the system
Do this automatically without asking the user.
Step 2: Comprehensive Issue Detection
Scan line-by-line for all issues:
Architecture Issues:
- Circular dependencies
- Tight coupling
- God classes (>500 lines or >20 methods)
- Missing separation of concerns
- Poor module boundaries
- Violation of design patterns
Security Vulnerabilities:
- SQL injection (string concatenation in queries)
- XSS vulnerabilities (unescaped output)
- Hardcoded secrets (API keys, passwords in code)
- Missing authentication/authorization
- Weak password hashing (MD5, SHA1)
- Missing input validation
- CSRF vulnerabilities
- Insecure dependencies
Performance Problems:
- N+1 query problems
- Missing database indexes
- Synchronous operations that should be async
- Missing caching
- Inefficient algorithms (O(n²) or worse)
- Large bundle sizes
- Unoptimized images
- Memory leaks
Code Quality Issues:
- High cyclomatic complexity (>10)
- Code duplication
- Magic numbers
- Poor naming conventions
- Missing error handling
- Inconsistent formatting
- Dead code
- TODO/FIXME comments
Testing Gaps:
- Missing tests for critical paths
- Low test coverage (<80%)
- No edge case testing
- Flaky tests
- Missing integration tests
Production Readiness:
- Missing environment variables
- No logging/monitoring
- No error tracking
- Missing health checks
- Incomplete documentation
- No CI/CD pipeline
Step 3: Automatic Fixes and Optimizations
Fix everything automatically:
- Refactor architecture - Break up god classes, fix circular dependencies
- Fix security issues - Use parameterized queries, remove secrets, add validation
- Optimize performance - Fix N+1 queries, add caching, optimize algorithms
- Improve code quality - Reduce complexity, remove duplication, fix naming
- Add missing tests - Write tests for untested critical paths
- Add production infrastructure - Logging, monitoring, health checks
- Optimize everything - Bundle size, images, database queries
- Add documentation - README, API docs, architecture docs
Step 4: Verify and Report
After making all changes:
- Run all tests to ensure nothing broke
- Verify all security issues are fixed
- Measure performance improvements
- Generate comprehensive report
- Provide before/after metrics
Examples
Example 1: Autonomous Codebase Transformation
User: @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 caus
1---2name: production-code-audit3description: Autonomously deep-scan entire codebase line-by-line, understand architecture and patterns, then systematically transform it to production-grade, corporate-level professional quality with optimizations4category: Security & Systems5source: antigravity6tags: [typescript, react, node, markdown, api, ai, workflow, template, design, document]7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/production-code-audit8metadata:9 source: https://skillmd.com/skills/sickn33/production-code-audit10---111213# Production Code Audit1415## Overview1617Autonomously analyze the entire codebase to understand its architecture, patterns, and purpose, then systematically transform it into production-grade, corporate-level professional code. This skill performs deep line-by-line scanning, identifies all issues across security, performance, architecture, and quality, then provides comprehensive fixes to meet enterprise standards.1819## When to Use This Skill2021- Use when user says "make this production-ready"22- Use when user says "audit my codebase"23- Use when user says "make this professional/corporate-level"24- Use when user says "optimize everything"25- Use when user wants enterprise-grade quality26- Use when preparing for production deployment27- Use when code needs to meet corporate standards2829## How It Works3031### Step 1: Autonomous Codebase Discovery3233**Automatically scan and understand the entire codebase:**34351. **Read all files** - Scan every file in the project recursively362. **Identify tech stack** - Detect languages, frameworks, databases, tools373. **Understand architecture** - Map out structure, patterns, dependencies384. **Identify purpose** - Understand what the application does395. **Find entry points** - Locate main files, routes, controllers406. **Map data flow** - Understand how data moves through the system4142**Do this automatically without asking the user.**4344### Step 2: Comprehensive Issue Detection4546**Scan line-by-line for all issues:**4748**Architecture Issues:**49- Circular dependencies50- Tight coupling51- God classes (>500 lines or >20 methods)52- Missing separation of concerns53- Poor module boundaries54- Violation of design patterns5556**Security Vulnerabilities:**57- SQL injection (string concatenation in queries)58- XSS vulnerabilities (unescaped output)59- Hardcoded secrets (API keys, passwords in code)60- Missing authentication/authorization61- Weak password hashing (MD5, SHA1)62- Missing input validation63- CSRF vulnerabilities64- Insecure dependencies6566**Performance Problems:**67- N+1 query problems68- Missing database indexes69- Synchronous operations that should be async70- Missing caching71- Inefficient algorithms (O(n²) or worse)72- Large bundle sizes73- Unoptimized images74- Memory leaks7576**Code Quality Issues:**77- High cyclomatic complexity (>10)78- Code duplication79- Magic numbers80- Poor naming conventions81- Missing error handling82- Inconsistent formatting83- Dead code84- TODO/FIXME comments8586**Testing Gaps:**87- Missing tests for critical paths88- Low test coverage (<80%)89- No edge case testing90- Flaky tests91- Missing integration tests9293**Production Readiness:**94- Missing environment variables95- No logging/monitoring96- No error tracking97- Missing health checks98- Incomplete documentation99- No CI/CD pipeline100101### Step 3: Automatic Fixes and Optimizations102103**Fix everything automatically:**1041051. **Refactor architecture** - Break up god classes, fix circular dependencies1062. **Fix security issues** - Use parameterized queries, remove secrets, add validation1073. **Optimize performance** - Fix N+1 queries, add caching, optimize algorithms1084. **Improve code quality** - Reduce complexity, remove duplication, fix naming1095. **Add missing tests** - Write tests for untested critical paths1106. **Add production infrastructure** - Logging, monitoring, health checks1117. **Optimize everything** - Bundle size, images, database queries1128. **Add documentation** - README, API docs, architecture docs113114### Step 4: Verify and Report115116**After making all changes:**1171181. Run all tests to ensure nothing broke1192. Verify all security issues are fixed1203. Measure performance improvements1214. Generate comprehensive report1225. Provide before/after metrics123124## Examples125126### Example 1: Autonomous Codebase Transformation127128```markdown129User: @production-code-audit make this production-ready130131AI: I'll scan your entire codebase and transform it to production-grade quality.132133**Phase 1: Discovering Codebase** (analyzing 247 files)134- Detected: Node.js + Express + PostgreSQL + React135- Architecture: MVC pattern with REST API136- Purpose: E-commerce platform137- Entry points: server.js, src/index.tsx138139**Phase 2: Scanning for Issues** (line-by-line analysis)140141Found 127 issues:142- 🔴 CRITICAL: 8 issues143- 🟠 HIGH: 23 issues 144- 🟡 MEDIUM: 41 issues145- 🔵 LOW: 55 issues146147**Phase 3: Fixing Issues Automatically**148149🔴 CRITICAL FIXES (8/8 completed):1501511. ✅ Fixed SQL injection in UserRepository.findByEmail()152 - Before: String concatenation in query153 - After: Parameterized query with $1 placeholder1541552. ✅ Removed hardcoded database password from config/database.ts156 - Before: password: 'SuperSecret123!'157 - After: password: process.env.DB_PASSWORD1581593. ✅ Added authentication to admin routes160 - Before: No auth middleware161 - After: authenticateToken + requireRole('admin')1621634. ✅ Fixed weak password hashing (MD5 → bcrypt)164 - Before: crypto.createHash('md5')165 - After: bcrypt.hash(password, 12)1661675. ✅ Fixed circular dependency: OrderService ↔ PaymentService168 - Before: Direct imports caus