Flask Redundancy Audit
Goal
Produce a repo wide redundancy report for a Flask backend. Do not change code. Write a file named redundancy-audit.md in the repo root.
Workflow
Map entry points and structure
- Locate the app factory, create_app, or main Flask app file.
- Identify blueprints, route modules, service layers, and data access helpers.
- Note any shared utilities or middleware that appear in multiple modules.
Scan for redundancy clusters
- Look for duplicated route handlers, request validation, DB queries, or business rules.
- Group similar patterns into clusters with clear evidence.
- Each cluster must include file path, symbol, and line range evidence.
Classify severity
- P0 is correctness risk, inconsistent behavior, or security risk.
- P1 is high maintenance cost or common bug surface.
- P2 is low risk duplication or style level repetition.
Write redundancy-audit.md with the required sections
Required output format
Create redundancy-audit.md with the following sections and headings.
Progress Describe what was scanned and any blockers.
Coverage List all directories, key files, and patterns reviewed. Include commands used if helpful.
Clusters For each cluster, include
- Cluster ID
- Summary
- Evidence list with file path, symbol, and 1 based line range
- Severity
- Notes
Plan List P0, P1, and P2 items with a short fix approach for each.
Evidence format example
Cluster R1 Summary: duplicate input validation for user profile updates Evidence:
- app/routes/profile.py update_profile lines 44 to 98
- app/services/user_service.py validate_profile lines 12 to 63 Severity: P1 Notes: use shared validator to avoid drift