Code Health Degradation and Static Analysis Triage Reporting Framework
Structure code quality reporting to quantify technical debt, prioritize static analysis violations, and enforce quality gates.
Use this template when technical debt and static analysis violations accumulate in a repository and engineering leads need an objective reporting framework to enforce quality gates and prioritize refactoring sprints.
Role: Principal Software Quality Architect and Technical Debt Strategist.
Context
- Target codebase repository: {{codebase_repository}}
- Automated static analysis toolchain: {{static_analysis_tooling}}
- Unit and integration coverage baseline: {{test_coverage_baseline}}
- Flaky test rate in CI/CD pipelines: {{flaky_test_ratio}}
- Open static security issues: {{critical_vulnerability_count}}
- Target remediation cycle: {{target_refactoring_sprint}}
Task
Create a comprehensive code health degradation and static analysis triage reporting framework that enables engineering managers to quantify architectural debt, prioritize high-risk code modules, and enforce quality gates across {{codebase_repository}}.
Method
- Aggregate linting, static analysis, and security scanning findings from {{static_analysis_tooling}}.
- Map {{critical_vulnerability_count}} security defects against module complexity and cyclomatic thresholds.
- Evaluate regression vulnerability surface where test coverage drops below {{test_coverage_baseline}}.
- Measure continuous integration test pipeline friction caused by {{flaky_test_ratio}}.
- Formulate a risk weighting matrix combining change failure rate, code churn, and test flakiness.
- Define objective criteria for gating pull requests versus deferring fixes to {{target_refactoring_sprint}}.
- Design a standardized scorecard format for tracking multi-sprint code health trends across development teams.
Constraints
- MUST require evidence-based risk scoring for every identified code module rather than subjective developer sentiment.
- MUST NOT allow critical security findings from {{critical_vulnerability_count}} to be classified as low-priority technical debt.
- Remediation roadmaps MUST fit within the operational capacity of {{target_refactoring_sprint}}.
- The scorecard framework must be modular and applicable across both monolithic and service-oriented repositories.
Output format
- Code Health Executive Scorecard (structured metrics block with coverage, flakiness, and security metrics).
- Architectural Debt Risk Matrix (markdown table: Module Path, Risk Tier, Cyclomatic Burden, Target Action).
- Quality Gate Decision Tree (conditional evaluation steps for pull request merges).
- Sprint Remediation Backlog Template (standardized schema for {{target_refactoring_sprint}} issues).
Self-review
- Verify test coverage thresholds from {{test_coverage_baseline}} and {{flaky_test_ratio}} are directly linked to pipeline gating rules.
- Ensure all 4 designated output sections are explicitly defined.
- Confirm the evaluation logic enforces strict differentiation between security debt and style linting.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.