@darrenjcoxon/vibeoptimise
v1.0.5
Published
π VibeOptimise β The ultimate codebase optimisation scanner. Find dead code, duplication, circular deps, bundle bloat & more. Get OPTIMISE.md for AI agents to fix everything.
Maintainers
Readme
π VibeOptimise
The ultimate codebase optimisation scanner for AI-assisted development.
Scan your codebase for dead code, duplication, circular dependencies, bundle bloat, inefficient queries, and more β then get an AI-actionable OPTIMISE.md for Claude Code, Cursor, or any AI agent to fix everything.
By the creator of Vibeguard β the security scanner for vibe coders.
Quick Start
npx @darrenjcoxon/vibeoptimiseThat's it. Run it from the root of any JS/TS project.
What It Scans
VibeOptimise runs 10 parallel scanners that cover every dimension of codebase efficiency:
| # | Scanner | What It Finds | Tool | |---|---------|---------------|------| | 1 | Knip | Unused files, exports, dependencies, types | knip | | 2 | JSCPD | Copy/pasted code blocks across the codebase | jscpd | | 3 | Madge | Circular dependencies & orphaned modules | madge | | 4 | Depcheck | Unused & missing npm packages | depcheck | | 5 | BundlePhobia | Heavy deps with lighter alternatives | bundlephobia | | 6 | ESLint Perf | Import cycles, barrel file bloat, unused imports | eslint | | 7 | Source Map Explorer | Bundle composition analysis | source-map-explorer | | 8 | Regex Safety | ReDoS-vulnerable patterns & catastrophic backtracking | Built-in | | 9 | CSS Efficiency | Unused CSS, duplicate selectors, !important overuse | Built-in | | 10 | Query Efficiency | N+1 patterns, unbounded queries, overfetching | Built-in |
Output: OPTIMISE.md
The report is structured for AI agents to work through systematically:
# OPTIMISE.md β Codebase Optimisation Report
## π΄ Critical β Immediate Performance Impact
- Circular dependencies causing bundle bloat
- ReDoS-vulnerable regex patterns
- N+1 query patterns
## π High β Significant Optimisation Opportunities
- Unused dependencies (12 packages, ~45MB savings)
- Unbounded database queries
## π‘ Medium β Recommended Improvements
- Duplicated code blocks (with file pairs + line ranges)
- Heavy deps with lighter alternatives
## π΅ Low β Nice to Have
- Unused exports, console.log statements
- CSS shorthand opportunitiesUsage
# Scan current directory
npx @darrenjcoxon/vibeoptimise
# Scan a specific project
npx @darrenjcoxon/vibeoptimise /path/to/project
# Quiet mode β just generate the report
npx @darrenjcoxon/vibeoptimise --quiet
# JSON output (for CI/CD integration)
npx @darrenjcoxon/vibeoptimise --json
# Include test files in analysis
npx @darrenjcoxon/vibeoptimise --include-tests
# Exclude specific patterns
npx @darrenjcoxon/vibeoptimise --exclude "legacy/**" "vendor/**"AI Agent Workflow
- Run
npx @darrenjcoxon/vibeoptimise - Feed
OPTIMISE.mdto your AI agent - Tell it: "Read OPTIMISE.md and implement all fixes, starting from Critical"
- Re-run VibeOptimise to verify improvements
Works with Claude Code, Cursor, GitHub Copilot, Windsurf, and any AI coding assistant.
CI/CD Integration
VibeOptimise exits with code 1 when critical or high findings exist β perfect for CI quality gates:
# GitHub Actions
- name: Check codebase optimisation
run: npx @darrenjcoxon/vibeoptimise --quietORM Support
The Query Efficiency scanner understands:
- Supabase β
.from()without.select()or.limit() - Prisma β Unbounded
findMany(), deeply nested includes - Drizzle β Queries without
.limit() - Mongoose β
find({})without limit, missing.lean() - Raw SQL β
SELECT *, missingLIMIT
Companion Tool: Vibeguard
Use VibeOptimise alongside Vibeguard for complete coverage:
npx @darrenjcoxon/vibeguard # Security scanning β FIXES.md
npx @darrenjcoxon/vibeoptimise # Optimisation scanning β OPTIMISE.mdLicense
MIT β Free for everyone. Built for the vibe coding community. π€
Made by Darren Coxon
