PR Audit Prompt
Historical PR Audit Prompt
A comprehensive audit prompt for reviewing all historical Pull Requests within designated repositories to ensure alignment with current project requirements, architectural standards, and coding guidelines. Systematically identifies legacy, orphaned, unused, untracked, unimplemented, or redundant artifacts.
Prompt
Conduct a comprehensive audit of all historical Pull Requests (PRs) within the designated repositories to ensure full alignment with current project requirements, architectural standards, and coding guidelines. The review process must systematically identify and document any legacy, orphaned, unused, untracked, unimplemented, or otherwise redundant files, code segments, or project plans introduced or modified by these PRs.
1. Define Scope and Timeframe
- Specify the exact repositories to be included in this audit.
- Establish a clear start date for the "past PRs" to be reviewed (e.g., all PRs merged since
${start_date}, or the last${number_of_months}months).
2. Sequential Review Process
- Review PRs in chronological order of their merge date, starting from the oldest within the defined scope.
- For each PR, examine the changes introduced (added, modified, deleted files and code).
3. Compliance Check against Recent Requirements
- Current Requirements Baseline: Obtain and reference the latest project requirements, architectural specifications, coding standards, security policies, and performance benchmarks.
- Feature Alignment: Verify that features or modifications introduced by the PRs are still relevant and correctly implemented according to current functional requirements.
- Architectural Adherence: Assess if the code changes conform to the current architectural patterns, design principles, and technology stack.
- Coding Standards: Check for adherence to current coding conventions, style guides, and best practices (e.g., naming conventions, error handling, logging).
- Security Compliance: Ensure that no vulnerabilities or insecure practices were introduced or remain unaddressed based on current security guidelines.
4. Identification of Redundant/Problematic Elements
- Legacy Files/Code: Files, functions, or modules that are outdated, use deprecated technologies, or implement features no longer required.
- Orphaned Files/Code: Files or code blocks no longer referenced or called by any active part of the application, including configuration files, utility scripts, or test files that have lost their context.
- Unused Assets: Images, stylesheets, or other static assets that were added but are no longer utilized.
- Untracked Elements: Investigate if any PRs inadvertently led to creation of untracked files in deployment or development environments.
- Unimplemented Plans/Features: Review PR descriptions, comments, and associated tickets to identify proposed features, refactorings, or improvements that were partially implemented or never fully completed.
- Redundant Logic: Duplicate code segments or redundant implementations of functionality that could be consolidated or removed.
- Dead Code: Code that is unreachable or serves no purpose in the current application state.
5. Documentation and Reporting
For each identified issue, create a detailed entry including:
- The specific PR number and merge date.
- The exact file path(s) and line numbers of the problematic code/file.
- A clear description of the issue (e.g., "Legacy API endpoint," "Unused utility function," "Orphaned configuration file").
- The rationale for why it is considered problematic.
- A proposed action (e.g., "Delete file," "Refactor module," "Create new task for implementation," "Update documentation").
6. Deliverables
- A comprehensive audit report detailing all findings, categorized by type of issue (legacy, orphan, unused, etc.).
- A prioritized list of actionable tasks for addressing each identified problem, including estimated effort where possible.
- A summary of the overall compliance status of the codebase based on the PR review.
Tools and Resources
- Version control system (Git, GitHub/GitLab/Bitbucket PR interface) for reviewing PR history and code changes.
- Code analysis tools (linters, static analyzers) to assist in identifying dead or unused code.
- Project management system for creating and tracking remediation tasks.
- Access to current requirement documents, architectural diagrams, and coding standards.
Provenance: Extracted from npp-backups/new 24@2026-03-12_133543 — Historical PR audit prompt authored 2026-03-12. Six-step audit process covering scope definition, sequential review, compliance checking, redundancy identification, structured documentation, and deliverable specification.