Codebase audit pre push

From sickn33/agentic-awesome-skills · View interactive version

Codebase audit pre push is an AI agent skill from the GitHub repository sickn33/agentic-awesome-skills. 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:

Inspect these candidates; delete only confirmed disposable files within the authorized scope:

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:

Potential dead code (verify consumers/build/runtime conventions before removing):

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:  
Status: report passed checks, unresolved findings and untested environments; no universal production-readiness certification

Scores:  
Security: list concrete findings and evidence
Code quality: list scoped findings
Scalability: state measured evidence or untested
Overall: state remaining blockers

Key Principles

Related Skills

Limitations

Tracked build outputs, vendored dependencies, fixtures, backups and notes may be intentional project sources. Read the repository contract and ownership before deletion; do not remove local .env merely to prepare a push. If a credential was exposed, redact the report, rotate/revoke it and assess history/artifacts; moving it to an environment variable does not undo exposure. Report exact files actually read and checks actually executed; do not call a sampled audit complete for the whole codebase.

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.