💻 Coding & Development

Comprehensive Repository Analysis and Bug Fixing Framework

📁 Coding & Development 👤 Contributed by @ravidulundu 🗓️ Updated
The prompt
Act as a comprehensive repository analysis and bug-fixing expert. You are tasked with conducting a thorough analysis of the entire repository to identify, prioritize, fix, and document ALL verifiable bugs, security vulnerabilities, and critical issues across any programming language, framework, or technology stack. Your task is to: - Perform a systematic and detailed analysis of the repository. - Identify and categorize bugs based on severity, impact, and complexity. - Develop a step-by-step process for fixing bugs and validating fixes. - Document all findings and fixes for future reference. ## Phase 1: Initial Repository Assessment You will: 1. Map the complete project structure (e.g., src/, lib/, tests/, docs/, config/, scripts/). 2. Identify the technology stack and dependencies (e.g., package.json, requirements.txt). 3. Document main entry points, critical paths, and system boundaries. 4. Analyze build configurations and CI/CD pipelines. 5. Review existing documentation (e.g., README, API docs). ## Phase 2: Systematic Bug Discovery You will identify bugs in the following categories: 1. **Critical Bugs:** Security vulnerabilities, data corruption, crashes, etc. 2. **Functional Bugs:** Logic errors, state management issues, incorrect API contracts. 3. **Integration Bugs:** Database query errors, API usage issues, network problems. 4. **Edge Cases:** Null handling, boundary conditions, timeout issues. 5. **Code Quality Issues:** Dead code, deprecated APIs, performance bottlenecks. ### Discovery Methods: - Static code analysis. - Dependency vulnerability scanning. - Code path analysis for untested code. - Configuration validation. ## Phase 3: Bug Documentation & Prioritization For each bug, document: - BUG-ID, Severity, Category, File(s), Component. - Description of current and expected behavior. - Root cause analysis. - Impact assessment (user/system/business). - Reproduction steps and verification methods. - Prioritize bugs based on severity, user impact, and complexity. ## Phase 4: Fix Implementation 1. Create an isolated branch for each fix. 2. Write a failing test first (TDD). 3. Implement minimal fixes and verify tests pass. 4. Run regression tests and update documentation. ## Phase 5: Testing & Validation 1. Provide unit, integration, and regression tests for each fix. 2. Validate fixes using comprehensive test structures. 3. Run static analysis and verify performance benchmarks. ## Phase 6: Documentation & Reporting 1. Update inline code comments and API documentation. 2. Create an executive summary report with findings and fixes. 3. Deliver results in Markdown, JSON/YAML, and CSV formats. ## Phase 7: Continuous Improvement 1. Identify common bug patterns and recommend preventive measures. 2. Propose enhancements to tools, processes, and architecture. 3. Suggest monitoring and logging improvements. ## Constraints: - Never compromise security for simplicity. - Maintain an audit trail of changes. - Follow semantic versioning for API changes. - Document assumptions and respect rate limits. Use variables like ${repositoryName} for repository-specific details. Provide detailed documentation and code examples when necessary.

Example outputs

Here is what ChatGPT, Claude, and Gemini typically return for this prompt:

🚀 ChatGPT

I'll conduct a comprehensive repository analysis following your framework. First, I'll map your project structure and identify all technology dependencies, then systematically scan for bugs across all severity levels using static analysis and vulnerability scanning. For each discovered issue, I'll provide a detailed bug report with ID, severity rating, affected files, root cause analysis, and step-by-step remediation instructions with code examples. Finally, I'll create a prioritized action plan with validation tests to ensure all fixes work correctly.

✨ Claude

I appreciate the thoroughness of this framework, though I should note some important limitations. I can analyze code you share and identify potential issues, but I cannot actually access repositories, run static analysis tools, or execute CI/CD pipelines. What I can do is review code snippets you provide, spot common bug patterns, suggest fixes with explanations, and help you structure a bug documentation system. Would you like to share specific files or code sections for me to analyze?

💎 Gemini

I can help analyze code for bugs following this framework. Please provide the repository contents or specific files you'd like analyzed. I'll examine the code for security vulnerabilities (like SQL injection, XSS), logic errors, dependency issues, and code quality problems. For each finding, I'll document the severity, location, root cause, and provide concrete fix recommendations with code examples. Note that I'll need you to share the actual code files to perform the analysis.

How to use this prompt

Copy the prompt above or click an "Open in" button to launch it directly in your preferred AI. You can then customize the wording to match your exact use case — for example replacing placeholders like [your topic] with real context.

Which AI model works best

Claude Opus 4 and Sonnet 4.6 generally outperform ChatGPT and Gemini on coding tasks — better reasoning, better at handling long context (full files, multi-file projects), and more honest about uncertainty. ChatGPT is faster for quick snippets; Gemini is best when code involves screenshots or visual context.

How to customize this prompt

Swap the language mentioned in the prompt (Python, JavaScript, etc.) for whichever stack you're on. For debugging or code review, paste your actual code right after the prompt. For generation tasks, specify the framework (React, Vue, Django, FastAPI) and any constraints (max lines, no external libraries, must be async).

Common use cases

  • Writing production code with strict style requirements
  • Reviewing pull requests and catching bugs before merge
  • Converting between languages (Python → TypeScript, for example)
  • Generating unit tests for existing functions
  • Explaining unfamiliar codebases to new team members

Variations

Adapt the tone (more casual, more technical), change the output format (bullet points vs. paragraphs), or add constraints (word limits, target audience).

Related prompts