Will's Birthday Sale — 86% off all products. Ends October 19 at 11:59 AM.
KodeBaseKODEBASE
Back to Prompt Library
Optimization Featured

Find Dead Code, Broken Functions & Half-Built Features

Clean up your codebase by auditing unused components, broken references, and incomplete features with this comprehensive AI diagnostic prompt.

Find Dead Code, Broken Functions & Half-Built Features

How to use this prompt

Audit Your Application for Technical Debt

AI-powered development moves at a blistering pace, but rapid iteration often leaves a trail of technical debt. Over time, projects accumulate stale code, orphaned functions, and incomplete UI elements that complicate maintenance and increase the risk of bugs. Use this audit prompt to systematically analyze your Base44 project and regain clarity.

When to Run This Audit

  • Before a major refactor: Identify potential conflicts before you begin restructuring your architecture.
  • During mid-project cleanup: Use this periodically to prevent dead code from bloating your build size and cognitive load.
  • Before deployment: Ensure that no broken references or unfinished mock data are accidentally exposed to your users.
  • Onboarding help: Use the generated report to quickly get a high-level overview of the application's current health and potential landmines.

How to Use the Prompt

  1. Copy and Paste: Simply provide the full audit prompt to your AI developer agent within KodeBase.
  2. Review the Report: The AI will generate a detailed, structured report categorizing everything from dead code to broken user flows.
  3. Follow the Recommended Order: The audit includes a prioritized remediation sequence. Always address production-breaking issues and data integrity risks before tackling minor dead code cleanup.

Critical Tips for Success

  • Manual Verification: The AI is a powerful assistant, but it is not a compiler. Always treat the 'Dead Code' section as a list of candidates, not an instruction to delete. Perform your own manual check of dependencies before removing any file.
  • Focus on Logic: Use this prompt to uncover 'hidden' breaks, such as forms that look complete but lack backend persistence logic.
  • Context Matters: If your app is large, you may want to run this prompt on specific folders or modules to keep the output focused and actionable. Treat this as a diagnostic tool that gives you the 'map' to fix your technical debt manually.
The prompt
Perform a full Dead Code, Broken Functionality & Incomplete Feature Audit of this application.

Do not modify any code yet.

Your job is to inspect the existing application and produce a detailed report identifying code, features, components, functions, and UI elements that appear unused, broken, incomplete, duplicated, abandoned, or incorrectly connected.

1. Dead Code

Identify:

Unused components
Unused functions
Unused hooks
Unused variables
Unused imports
Unused API calls
Unused database queries
Unused routes
Unused pages
Unused styles
Unused utilities
Files that are no longer referenced anywhere
Legacy code left behind after previous changes

Do not assume something is dead simply because you cannot immediately find a reference.

Trace dependencies before marking anything for removal.

2. Broken References

Find references to:

Missing components
Missing functions
Missing files
Missing routes
Missing database entities
Renamed fields
Deleted properties
Invalid imports
Invalid exports
Undefined variables
Outdated API endpoints
Functions calling resources that no longer exist

Explain exactly where each broken reference occurs and what it appears to expect.

3. Half-Built Features

Look for features where the UI exists but the functionality underneath appears incomplete.

Examples:

Buttons with no meaningful action
Forms that do not save data
Settings that are displayed but not persisted
Search/filter controls that do not affect results
Empty event handlers
Placeholder functions
Hard-coded temporary data
Mock data still being used
Features that only partially update the database
UI elements referencing functionality that was never implemented
4. TODO / FIXME / Temporary Code

Search the entire codebase for:

TODO
FIXME
TEMP
HACK
placeholder
coming soon
mock
test data
temporary workarounds

Determine whether each one represents unfinished production work.

5. Duplicate or Conflicting Logic

Identify places where multiple pieces of code appear to perform the same responsibility.

Examples:

Duplicate utility functions
Multiple versions of the same component
Repeated API wrappers
Different validation rules for the same data
Duplicate database operations
Old and new implementations running simultaneously

Explain which version appears to be actively used.

Do not recommend deleting anything until dependencies are confirmed.

6. User Flow Audit

Trace the application's major user flows from beginning to end.

For each major flow, verify:

UI → Event → Business Logic → API/Backend → Database → Response → UI Update

Identify anywhere that chain appears incomplete or broken.

7. Error Handling

Identify important operations that:

Have no error handling
Fail silently
Swallow exceptions
Display no feedback to the user
Leave loading states active
Allow duplicate submissions
Do not handle failed network requests
8. Produce a Report

Do not make changes.

Return a report using this format:

Executive Summary

Overall condition of the application.

Critical Issues

Problems likely to break functionality or cause incorrect application behavior.

Broken Features

Features that appear partially or completely nonfunctional.

Half-Built Features

Features that appear unfinished.

Broken References

Missing files, functions, fields, routes, APIs, or dependencies.

Dead Code Candidates

Code that appears unused.

For every item include:

File/path
Component/function
Why it appears unused
What references were checked
Risk of removal: Low / Medium / High
Duplicate Logic

Potential duplicate or conflicting implementations.

TODO / Temporary Code

Remaining development artifacts.

Missing Error Handling

Operations that could fail without proper handling.

Recommended Cleanup Order

Provide a numbered remediation sequence based on:

Production-breaking problems
Data integrity risks
Broken user flows
Incomplete features
Duplicate logic
Dead code cleanup
IMPORTANT RULES
Do not delete anything.
Do not refactor anything.
Do not change application behavior.
Do not assume unused means safe to remove.
Trace dependencies before classifying code as dead.
Clearly separate confirmed problems from suspected problems.
If you cannot verify something, mark it as Needs Manual Verification.

The goal of this audit is to determine:

What is broken, what was never finished, what is no longer being used, and what needs attention before we keep adding more code.
Optimization