Skip to main content
prompt GP ChatGPT

Act as a Senior Codebase Auditor & Tech Debt Refactorer — prompt

Turns an AI assistant into a senior codebase auditor. It pinpoints dead code, redundant logic, and tech debt, delivering a phased refactoring plan.

Open on GitHub

What Act as a Senior Codebase Auditor & Tech Debt Refactorer does

The prompt instructs an AI assistant to act as a senior software engineer auditing code quality and maintainability. It directs the model to inspect eight specific areas: dead code, duplicate logic, orphaned UI components, over-complicated implementations, deprecated patterns, redundant queries, abandoned files, and architectural technical debt. The audit stays strictly analytical.

For every finding, the prompt requires a precise file path, code snippet, rationale, impact level, and regression risk analysis. It organizes the final output into a three-phase cleanup sequence. Phase 1 targets safe zero-risk deletions, Phase 2 handles logic consolidation, and Phase 3 tackles architectural migrations. Because the instructions demand exact file locations, providing the directory tree or code snippets in the chat is required.

What it helps with

  • spot dead code, unused imports, and abandoned files
  • isolate duplicate logic and unnecessarily complex implementations
  • identify redundant database queries and N+1 query risks
  • construct a three-phase cleanup plan with regression risk ratings

Example prompts for the agent

  • Please analyze the following codebase details and perform the code quality review: [insert repository structure]
  • Inspect this file for dead code and duplicate logic: [insert code snippet]
  • Generate a phased cleanup plan for this component: [insert code]

How to install Act as a Senior Codebase Auditor & Tech Debt Refactorer

How to use

Paste the text at the start of a chat or into project instructions

Questions about Act as a Senior Codebase Auditor & Tech Debt Refactorer

How to install Act as a Senior Codebase Auditor & Tech Debt Refactorer in ChatGPT?

No installation command is needed. Copy the prompt text directly into ChatGPT or Claude.ai as your first message, then supply your directory tree or source code.

What does this prompt review in a repository?

It audits eight categories: dead code, duplicate logic, unused UI files, over-complicated code, deprecated patterns, redundant queries, abandoned files, and code smells. Each issue includes risk and impact assessments.

How does the prompt structure the cleanup recommendations?

It organizes fixes into three distinct phases. Phase 1 executes zero-risk deletions, Phase 2 consolidates duplicate logic, and Phase 3 tackles architectural technical debt that requires testing and migration.

Source text

prompts.csv · CC0-1.0
I want you to act as a Senior Software Engineer performing a rigorous code quality, maintainability, and technical debt audit on a codebase.

Your objective is to aggressively yet safely simplify the codebase, improve maintainability, and highlight anything that provides zero value to the application.

Analyze the provided codebase, directory tree, or code snippets and systematically evaluate:

1. Dead Code: Unused functions, files, components, routes, APIs, variables, imports, and dependencies.
2. Duplicate Logic: Redundant blocks or patterns that should be consolidated into reusable utilities or abstraction layers.
3. Unused UI Components: Orphaned views, unused design components, or obsolete style files.
4. Overly Complex Implementations: Code that can be simplified or refactored without altering expected behavior.
5. Legacy & Deprecated Code: Outdated patterns or unneeded legacy fallback logic.
6. Redundant Queries & API Calls: Unnecessary database operations, duplicate fetch requests, or N+1 query risks.
7. Abandoned Files: Disconnected, unreachable, or unreferenced files in the repository.
8. Technical Debt: Code smells, poor abstractions, or high-risk areas lacking maintainability.

For every issue identified, structure your analysis with:
- Issue & Location: File path and code block.
- Reason for Action: Why this code is unnecessary, redundant, or overly complex.
- Impact Estimation: High/Medium/Low impact on performance, bundle size, or developer velocity.
- Risk Assessment: Potential regression risks, hidden side effects, or runtime dependencies to verify before deletion.
- Recommended Refactor: Specific code/step-by-step guidance for safe removal or consolidation.

Conclude with a prioritized, phased Cleanup Plan divided into:
- Phase 1: High-Confidence / Safe Deletions (Zero-risk removals)
- Phase 2: Logic Consolidation & Simplification (Moderate risk)
- Phase 3: Architectural Technical Debt Reduction (Requires testing/migration)

My first request is: "Please analyze the following codebase details and perform the code quality review: [Insert repository link, codebase structure, or code snippets here]"

© Prakritsigdel · CC0-1.0 · f/prompts.chat

Similar prompts

All prompts for Code review and refactoring →

From the same set133

The whole set →
Open Source Release Checklist Builder (YAML) This prompt turns an upcoming open-source release into a YAML checklist for versions, tests, artifacts, security notes, rollback, and announcements. GP ChatGPT ★ 174,676repo stars Dockerfile and CI taste A prompt that lists rules for Dockerfiles and CI: multi-stage builds, non-root user, image scanning. Useful when you ask an AI to write or review a build config. GP ChatGPT ★ 174,676repo stars Senior Code Reviewer (severity-ranked) A code review prompt that ranks findings from blockers down to nits and closes with a verdict. Useful when you need to know what in a patch actually breaks. GP ChatGPT ★ 174,676repo stars TypeScript Library taste A prompt that pins down conventions for a TypeScript library: pnpm, strict tsconfig, tsup, vitest, Changesets. Useful when a project needs one style from the first commit. GP ChatGPT ★ 174,676repo stars Claude Web Page Redesign Planning Prompt A prompt that makes the model audit the current markup and code first, then hand back a redesign plan in markdown. No edits get made. GP ChatGPT ★ 174,676repo stars Code Review Assistant for Bug Detection A Claude prompt that turns the model into a reviewer: it hunts for bugs in your code, suggests optimizations and flags security holes. GP ChatGPT ★ 174,676repo stars Senior AI & Data Engineering Meta-Prompt Generator Directs your AI model to act as a prompt engineer and produce structured instructions tailored to a target LLM and task. GP ChatGPT ★ 174,676repo stars Automated Text Typing Every 5 Minutes with Python This prompt turns the chat into a Python automation engineer that writes a script typing your text on a timer. Handy when the same line has to go into another window without you touching the keyboard. GP ChatGPT ★ 174,676repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor