Codebase audit pre push

From dangindev/antigravity-awesome-workspace-skill · View interactive version

Codebase audit pre push is an AI agent skill from the GitHub repository dangindev/antigravity-awesome-workspace-skill. Deep audit before GitHub push: removes junk files, dead code, security holes, and optimization issues. Checks every file line-by-line for production readiness.

How to use this skill

Skill file

Pre-Push Codebase Audit

As a senior engineer, you're doing the final review before pushing this code to GitHub. Check everything carefully and fix problems as you find them.

When to Use This Skill

Your Job

Review the entire codebase file by file. Read the code carefully. Fix issues right away. Don't just note problems—make the necessary changes.

Audit Process

1. Clean Up Junk Files

Start by looking for files that shouldn't be on GitHub:

Delete these immediately:

Critical - Check for secrets:

If you find secrets in the code, mark it as a CRITICAL BLOCKER.

2. Fix .gitignore

Check if the .gitignore file exists and is thorough. If it’s missing or not complete, update it to include all junk file patterns above. Ensure that .env.example exists with keys but no values.

3. Audit Every Source File

Look through each code file and check:

Dead Code (remove immediately):

Code Quality (fix issues as you go):

Logic Issues (critical):

4. Security Check (Zero Tolerance)

Secrets: Search for hardcoded passwords, API keys, and tokens. They must be in environment variables.

Injection vulnerabilities:

Auth/Authorization:

Data exposure:

Dependencies:

5. Scalability Check

Database:

API Design:

Code:

6. Architecture Check

Organization:

Separation of concerns:

Reusability:

7. Performance

Backend:

Frontend (if applicable):

8. Documentation

README.md must include:

Code comments:

9. Testing

10. Final Verification

After making all changes, run the app. Ensure nothing is broken. Check that:

Output Format

After auditing, provide a report:

CODEBASE AUDIT COMPLETE  

FILES REMOVED:  
- node_modules/ (build artifact)  
- .env (contained secrets)  
- old_backup.js (unused duplicate)  

CODE CHANGES:  
[src/api/users.js]  
  ✂ Removed unused import: lodash  
  ✂ Removed dead function: formatOldWay()  
  🔧 Renamed 'data' → 'userData' for clarity  
  🛡 Added try/catch around API call (line 47)  

[src/db/queries.js]  
  ⚡ Fixed N+1 query: now uses JOIN instead of loop  

SECURITY ISSUES:  
🚨 CRITICAL: Hardcoded API key in config.js (line 12) → moved to .env  
⚠️ HIGH: SQL injection risk in search.js (line 34) → fixed with parameterized query  

SCALABILITY:  
⚡ Added pagination to /api/users endpoint  
⚡ Added index on users.email column  

FINAL STATUS:  
✅ CLEAN - Ready to push to GitHub  

Scores:  
Security: 9/10 (one minor header missing)  
Code Quality: 10/10  
Scalability: 9/10  
Overall: 9/10  

Key Principles

Related Skills

Limitations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.