A Technical Debt Triage Prompt for Engineers, Not Slide Decks
A technical debt triage prompt that scores code-level debt by risk and effort and sequences a remediation plan. Copy the engineer-facing prompt and contract.
Technical debt conversations usually end one of two ways. Either nothing gets fixed because there's no business case, or everything gets a JIRA ticket and the backlog swells to 200 items nobody will ever touch. Both failures come from the same root: no shared way to decide what's worth fixing now.
A technical debt triage prompt gives you that shared method. Feed it the debt items, score each by risk and effort and churn, and get back a sequenced plan: fix these three this sprint, defer these, delete these tickets entirely. The output is engineer-facing, anchored to files and fixes, not a slide for leadership.
This is the prompt, the scoring contract, and where it diverges from the prioritization templates already out there.
Why most tech-debt prompts are aimed at the wrong reader
The good existing template, pmtoolkit's technical debt prioritization, is genuinely structured: modified RICE scoring, Fowler's debt quadrant, cost-of-inaction projections. But it's built for product managers and technical leaders making a business case to secure capacity. Its output is a 1,400-word document with velocity-tax calculations and roadmap phases. Useful for a leadership pitch. Useless when you're an engineer with two days and a directory of debt to sequence.
The tool roundups, like 8 AI tools for technical debt, point you at detection and remediation platforms but don't hand you a triage method you can run on your own list.
The gap is an engineer-facing triage prompt: code-level items, scored by the things engineers actually weigh (blast radius, change frequency, effort), sequenced into a plan you can start on after lunch. No business case required.
What you can do with this prompt
- Take a raw list of debt items and get each scored and ranked.
- Sequence a remediation plan that fits the time you actually have.
- Identify the debt that's safe to ignore, so the backlog shrinks instead of grows.
- Tie each item to a file and a concrete fix, not a vague theme.
- Justify the order to a skeptical lead with a transparent score, not a vibe.
- Re-triage after a sprint as priorities shift.
Anatomy of the prompt
The score is the spine: risk times change frequency, divided by effort. The contract forces every item through it.
Role: You are a staff engineer triaging technical debt in {{codebase_area}}.
Context: {{debt_items}} — each with a file/location and a short description.
{{change_frequency}} — which files change often (from git history).
Task: Score each item: risk (1-5), change frequency (1-5), effort (1-5).
priority = (risk x change_frequency) / effort.
Flag any item that's safe to defer indefinitely.
Output: A table — Item | Location | Risk | Churn | Effort | Priority | Action.
Sorted by priority. End with a 3-item "do this sprint" shortlist.
The ugliest code in the repo might be the safest to leave alone, if nobody ever edits it. Debt only costs you when you pay interest, and you pay interest every time you touch the file. Feeding the prompt your git change-frequency data is what separates real triage from a beauty contest. Pull it with a one-line git log aggregation per file.
Step-by-step usage
1. Gather inputs
List the debt items, each with a file and one-line description. Pull change frequency from git: how many commits touched each file in the last few months. That number does most of the prioritization work.
2. Fill variables
Set {{codebase_area}}, {{debt_items}}, and {{change_frequency}}. The more honest the effort estimates, the more useful the ranking.
3. Run the prompt
Read the "do this sprint" shortlist first. If it lists items in code that never changes, your churn data didn't make it in. Re-run with it.
4. Post-process
Sanity-check the top three against the release you're shipping. The prompt optimizes for leverage; you optimize for what unblocks the next feature.
5. Iterate
After the sprint, re-triage with the remaining items and updated churn. Debt priorities move as the code moves.
Prompt-craft patterns
Make effort a real number, not a feeling. Ask the model to estimate effort in rough hours or t-shirt sizes and to state its assumption. An effort score pulled from nowhere makes the priority math noise.
For each item, estimate effort as S (< half a day), M (1-2 days),
L (> 2 days), and state the one assumption driving the estimate.
Force a "defer or delete" verdict. The most valuable output is permission to close tickets. Tell the prompt to flag items whose cost-of-inaction is effectively zero, and watch the backlog shrink.
Anchor every item to a location. "Improve error handling" is a wish. "Wrap the three bare except blocks in payments/refund.py" is a task. The contract should reject items that don't name a file.
A note on model behavior here: Claude holds the scoring rubric across a long item list and applies it consistently, where GPT-4o sometimes re-anchors its severity scale halfway down and starts grading on a curve. If the bottom half of the table looks softer than the top, that's the tell. Restate the rubric near the end of the prompt, or run the list in two halves and merge. Either fixes it.
The take: a technical debt backlog over about 30 items is a graveyard, not a plan, and the highest-leverage move is usually deleting two-thirds of it. Most debt tickets describe code that works, isn't changing, and will never be worth the regression risk to refactor. Triage isn't about ranking all of it. It's about admitting most of it doesn't matter and protecting your attention for the debt that's actively slowing the team down.
Variables you'll set
| Variable | Required | What it is |
|---|---|---|
{{codebase_area}} | Yes | The module or service being triaged |
{{debt_items}} | Yes | The list, each with a file/location and description |
{{change_frequency}} | Yes | Per-file churn from git history |
{{effort_scale}} | No | Your sizing convention (hours, t-shirt) |
{{time_budget}} | No | How much capacity the sprint actually has |
Getting started
- Collect the debt items with file locations.
- Run a
git logaggregation for per-file change frequency. - Fill
{{debt_items}}and{{change_frequency}}. - Read the shortlist and delete the deferred tickets for real.
- Sanity-check the top three against the next release.
- Re-triage each sprint as the code moves.
- When debt sits in code nobody understands, the Legacy Code Comprehension Harness tells you what the module does before you score it.
The Legacy Code Comprehension Harness handles the hardest triage input: it infers what a legacy module actually does by reading the code, not the often-wrong comments, so your risk scores reflect real behavior instead of guesswork. It's part of The Complete AI Prompts Bundle, a one-time lifetime license to the full catalog and every pack added later, which earns its keep across a multi-service codebase.
Triage tells you what to fix; the next steps tell you how to fix it safely. Two reads: detecting the code smells that become debt so you catch it earlier, and a repo health scorecard to track whether the debt is shrinking over time. For the diffs where new debt sneaks in, the Code Review Policy System Prompt keeps maintainability a required review dimension.
Set the review bar with the Code Review Policy pack →Common questions
What is a technical debt triage prompt?
How should engineers prioritize technical debt?
Can AI decide what technical debt to fix?
Get the prompt packs this guide is built on
Ready-to-paste prompts with documented variables and usage guides for ChatGPT, Claude, and Gemini. One-time payment, own it forever.
More prompt guides

An AI Prompt to Analyze a 10-K Into a Forensic Checklist
Reading a 10-K cover to cover is a job. The risk factors run twenty pages, half of it boilerplate that's been copied forward for years. The MD&A buries the one sentence that matters under careful hedg…

Write a Variance Analysis Prompt That Won't Invent the Drivers
The monthly close ends and the real work starts: explaining why every line came in over or under plan. Most FP&A teams write that commentary by hand, variance by variance, and it eats an afternoon. So…

How to Write a Board Deck Prompt That Locks the Narrative Structure
Most board updates get rewritten from scratch every quarter. Someone opens last quarter's deck, deletes the old numbers, pastes new ones, and hopes the story still hangs together. By the third revisio…