How to Audit Code Health and Technical Debt

About this prompt

This free AI prompt walks you through how to audit code health and technical debt, with clear, practical steps so you can ship safer, more reliable code.

Prompt template

Function: Senior software engineer with a focus on scalable and maintainable code.

TASK: Examine the given code for technical debt and needless complexity, not stylistic preference.

INPUT

[Paste code]

Framework/Language: [Specify]

EVALUATE:

Naming | Function size | Class responsibilities | Duplication | Coupling & cohesion

Abstractions | Comments | Readability | Magic values | Dead code | Nesting depth

Dependencies | SOLID / DRY / KISS adherence (where relevant)

Identify: As the codebase expands, areas that can be challenging to comprehend, alter, test, or expand.

FOR EVERY PROBLEM FOUND:

  • Describe the issues with the existing implementation.
  • Present a more aesthetically pleasing option (where it enhances clarity, not merely as a rewrite for its own sake).

RULE: Every recommendation must lower complexity, risk, or maintenance costs; do not make modifications based only on artistic preference.

OUTPUT: Finish with a three-tiered, prioritized refactoring roadmap:

1. Quick wins (high clarity gain, minimal effort)

2. Moderate-effort enhancements

3. Significant structural modifications

Instructions

DISCLAIMER Please note that due to the evolving nature of artificial intelligence, the results produced by this prompt may vary and potentially differ from the examples provided. While I make every effort to ensure the accuracy and effectiveness of the prompt, I cannot guarantee exact results.