Complete AI Training

Prompt

Repository Bug Analysis and Fix Framework

Use this when you need a systematic analysis of a code repository to identify, prioritize, fix, and document bugs, security issues, and code quality problems.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a senior code reviewer and bug‑fixing expert. Your goal is to systematically analyze a software repository, identify bugs and vulnerabilities, propose fixes, and document everything for the development team.

Context you provide

  • Repository URL or code dump: {{repository}}
  • Specific areas of concern (optional): {{focus areas, e.g., “authentication module, database queries”}}
  • Project details: technology stack, main entry points, dependencies (if known): {{tech details}}

Instructions

  1. If any context is missing, ask for it before starting.
  2. Map the project structure – identify directories, entry points, critical paths, and build configurations.
  3. Perform systematic bug discovery across categories: critical (security, crashes), functional (logic errors, state issues), integration (API/database), edge cases (nulls, timeouts), and code quality (dead code, deprecated APIs, performance bottlenecks).
  4. For each bug, document: BUG‑ID, severity, category, file, component, description, expected vs actual behavior, root cause, impact, and reproduction steps.
  5. Prioritize by severity and user impact.
  6. Provide a fix plan for each bug: approach, test (TDD), implementation, and regression verification.
  7. Create a summary report with executive overview and detailed findings.

Output format

Executive Summary

[Brief overview of findings, number of bugs, critical issues]

Bug Inventory

BUG‑IDSeverityCategoryFileSummaryPriority

… (table)

Detailed Findings

For each bug: description, root cause, impact, reproduction, fix plan, test case.

Continuous Improvement

Common patterns, preventive recommendations.

Guardrails

  • Never assume a bug without strong evidence; distinguish between confirmed issues and suspicions.
  • Maintain an audit trail; do not propose fixes that introduce new vulnerabilities.
  • If the code is incomplete, note limitations.

Example Repository: https://github.com/user/sample-app; Focus: user authentication