Is your codebase a mess?

The more features you add, the harder it gets for your AI tool to make safe changes. Large files, tangled logic, and inconsistent structure slow everything down.

What this prompt checks

  • Files too large for AI tools to process reliably
  • Components doing too many things at once
  • Duplicated logic across multiple files
  • Inconsistent naming and project structure
  • Missing separation between UI, data, and business logic
  • Dead code: commented-out blocks, unused imports, unreachable branches
  • Complex functions with too many branches or deep nesting
  • Hardcoded values scattered through the code

Report only. This prompt audits your project and reports findings. It will not modify any code without your explicit consent.

Audit this project for code quality issues that will slow me down or break my AI tool's ability to help. Check the following, in order of severity. For each one, tell me if it's a problem, why it matters, and what to do about it.

1. FILE SIZE
List every file over 300 lines. For each one:
- What is it doing? Is it doing too many things?
- Could it be split into smaller, focused files?
- Files over 500 lines exceed most AI tool context windows

2. GOD COMPONENTS
Find components that handle UI rendering AND data fetching AND business logic in the same file:
- Does the component manage its own API calls, state, validation, and rendering?
- Could the data fetching be separated from the display?
- Components doing 3+ jobs are the #1 source of bugs when AI tools make changes

3. DUPLICATED LOGIC
Search for logic that appears in multiple places:
- Similar API calls in different components
- Repeated validation rules
- Copy-pasted utility functions
- Duplicated logic means every fix needs to happen in multiple places (and your AI tool will miss some)

4. NAMING AND STRUCTURE
Check the project organization:
- Are file and folder names consistent? (camelCase vs kebab-case vs PascalCase)
- Is there a clear structure (pages/components/hooks/utils/types)?
- Can you tell what a file does from its name and location?
- Are related files grouped together or scattered?

5. SEPARATION OF CONCERNS
Check if the codebase separates:
- UI components (what users see)
- Data access (API calls, database queries)
- Business logic (rules, validation, transformations)

6. DEAD CODE
Search for:
- Commented-out code blocks (abandoned attempts, old implementations left behind)
- Unused imports
- Functions or components that are defined but never called
- Unreachable branches (conditions that can never be true)

7. FUNCTION COMPLEXITY
Find functions with high cyclomatic complexity:
- Functions with more than 5 branches (if/else, switch cases, ternaries)
- Deeply nested logic (4+ levels of nesting: if inside if inside callback inside loop)
- Nested ternary operators or dense one-liner expressions that pack multiple conditions

8. HARDCODED VALUES
Search for magic numbers, hardcoded URLs, repeated string literals, and configuration values scattered through the code instead of defined as constants or environment variables.

For each finding, report:
- Number (1, 2, 3...)
- Severity: CRITICAL, HIGH, or OK
- File and line number
- What's wrong (one sentence)
- What could happen if you don't fix it (one sentence)
- How to fix it and what could break (one sentence each)

Sort by severity, then by how fast it could hurt you.

IMPORTANT: This is an audit only. Do NOT modify any code. Report what you find and suggest fixes, but do not apply any changes until I explicitly ask you to.

Paste this into your AI builder tool (Lovable, Bolt, v0, Replit) and let it audit your project.

We handle this and much more.

BWORLDS is your AI production team. We continuously monitor and fix your app so you can focus on building.

Get Started for Free