technical-debt-review
Skill1 starsChanged 58 days agoMITView on GitHub
Detect technical debt introduced or perpetuated in code diffs. Focuses on complexity, propagation of existing debt, hardcoded configuration, missing error handling, and inconsistent patterns. Designed to run against git diffs with access to the source tree. Triggered by: technical debt review, debt review.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- SWEStash/swe-workflow-skillstheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- SWEStash/swe-workflow-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- journal-coachSkill
- github-templatesSkill
- node-ciSkill
- renovateSkill
- create-readmeSkill
- markdown-styleSkill
- mermaid-syntaxSkill
- obsidian-vaultSkill
- ste100Skill
- forge-detectSkill
- forgejo-issueSkill
- forgejo-prSkill
- web-frontendSkill
- docker-pythonSkill
- pyproject-tomlSkill
- python-ciSkill
- python-cliSkill
- python-devcontainerSkill
- python-projectSkill
- architecture-briefSkill
- design-advisorSkill
- saas-anti-pattern-reviewSkill
- saas-transition-chain-reviewSkill
- saas-transition-reviewSkill
- saas-transition-strategySkill
- security-reviewerSkill
- commit-messageSkill
- discord-sendSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Check if the diff introduces functions with 40+ non-blank added lines.
- Very specific: line 46
Look for def , function , fn , or method definitions.
- Very specific: line 54
Check for 4+ levels of indentation in new code (for example, 16+ spaces) from nested if/for/while/try/match blocks.
- Distinctive: line 70
Check added lines for literal URLs, IP addresses, ports, secrets, API keys, tokens, or timeout values that should be environment variables.
- Very specific: line 87
Check added code for calls that can fail without handling: .unwrap(), .expect(), assert, empty except, catch {}, or results assigned to _.
- Distinctive: line 125
Check added lines for commented-out code blocks (3+ consecutive commented lines that look like executable code, not documentation).
- Distinctive: line 139
Check for copy-pasted code between the diff's new code and the rest of the codebase.
- Very specific: line 145
Check which directories exist (src/, app/, backend/, frontend/, etc.) and search all relevant ones — do not assume a specific project …
- Distinctive: line 160
Check added lines for numeric literals (excluding 0, 1, -1, empty string, and 100) and unexplained string literals used as comparison …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Technical Debt Review
This skill checks code diffs for technical debt. It covers debt introduced by the change and debt that the change perpetuates by touching already-problematic areas without cleanup.
It loads as a lens from a parent review skill (for example,
saas-transition-review) or runs standalone against a diff file.
Input
The skill expects these variables:
DIFF_FILE— path to a git diff file (scan only+lines for additions)WORKTREE— path to the source tree (used for propagation check)
Checks
1. TODOs/FIXMEs/HACKs introduced
Scan added lines for TODO, FIXME, HACK, XXX, BUG,
WORKAROUND, TEMP.
rg -n "^\+.*(TODO|FIXME|HACK|XXX|BUG|WORKAROUND|TEMP)" "$DIFF_FILE"- Why: Each marker defers a decision. The diff is the best time to resolve it.
- Severity: ⚪ Warning
2. Large functions
Check if the diff introduces functions with 40+ non-blank added lines.
Look for def , function , fn , or method definitions.
- Why: Large functions concentrate responsibility, resist testing, and attract more code.
- Severity: 🟡 Moderate
3. Deep nesting
Check for 4+ levels of indentation in new code (for example, 16+
spaces) from nested if/for/while/try/match blocks.
rg -n "^\+[ ]{16,}" "$DIFF_FILE"Adjust the indent width to match the project's convention (2 or 4 spaces).
- Why: Deep nesting drives cyclomatic complexity. Each level doubles the test paths.
- Severity: 🟡 Moderate
4. Hardcoded configuration
Check added lines for literal URLs, IP addresses, ports, secrets, API keys, tokens, or timeout values that should be environment variables.
Exclude test files. Scan for:
https?://with a literal domain (notlocalhost):<digit>{4,5}(port numbers)password=,secret=,api_key=,token=,apikey=- Timeout values larger than 5
- Why: Hardcoded config makes the code environment-specific. Secrets in code create security incidents.
- Severity: 🔴 Critical for secrets — 🟡 Moderate for URLs/ports
5. Error handling gaps
Check added code for calls that can fail without handling: .unwrap(),
.expect(), assert, empty except, catch {}, or results
assigned to _.
- Why: Unhandled errors crash production or corrupt data silently.
- Severity: 🔴 Critical
6. Propagation of existing debt
For each file modified in the diff, check if that file already
contains TODO, FIXME, HACK, or XXX markers. If the diff
touches a file with existing markers but does not address them,
flag it.
Extract modified files from the diff:
rg "^--- a/" "$DIFF_FILE" | sed 's|--- a/||'Then check each:
rg -n "(TODO|FIXME|HACK|XXX)" "$WORKTREE/$file"Exclude cases where:
- The change is only imports or whitespace
- The existing TODO is unrelated and in a distant part of the file
- Why: The broken-window effect — touching debt without cleanup normalizes it.
- Severity: 🟡 Moderate (🔴 if the change substantially rewrites the debt-ridden area)
7. Dead or commented-out code
Check added lines for commented-out code blocks (3+ consecutive commented lines that look like executable code, not documentation).
# Python/Ruby: rg -n "^\+.*#[ ]{0,2}(def |if |for |class |import |return |print)" "$DIFF_FILE"
# JS/TS/C: rg -n "^\+.*//( |)(function |if |for |const |let |var |import )" "$DIFF_FILE"- Why: Commented code confuses intent. Readers cannot tell if it is deprecated, temporary, or significant.
- Severity: ⚪ Warning
8. Code duplication
Check for copy-pasted code between the diff's new code and the rest of the codebase.
- Scan new
+lines in the diff for functions, helpers, or patterns that look like they might already exist elsewhere. - Grep each suspicious function name/body across the source tree.
Check which directories exist (
src/,app/,backend/,frontend/, etc.) and search all relevant ones — do not assume a specific project layout. - Focus on utility helpers, not legitimate duplication (for
example, two different API endpoints following the same SQL pattern
is fine; two views defining the same
queryParam()helper is not). - Do not be pedantic — only flag clear copy-paste, not "this could be generalized."
- Why: Duplicated code doubles maintenance surface. Each copy drifts independently over time.
- Severity: 🟡 Moderate
9. Magic numbers and strings
Check added lines for numeric literals (excluding 0, 1, -1, empty string, and 100) and unexplained string literals used as comparison targets or keys.
Exclude test assertions and fixture data.
- Why: Magic values make code hard to understand and change.
A reader cannot tell if two
86400values are the same timeout or coincidentally equal. - Severity: ⚪ Warning
Output format
Each finding:
{N}. **[severity] Title** — `file:line`
- Observation: ...
- Why it is debt: ...
- Suggestion: ...Not affected section
List checks that ran but found nothing:
### Not affected
- Code duplication — no copy-pasted code found
- Large functions — no new function exceeds 40 lines
- TODOs/FIXMEs — no new markers introduced
- ...Severity legend
| Severity | Meaning |
| 🔴 Critical | Must fix before merge. Risk of production incident. |
| 🟡 Moderate | Should fix in this PR or a follow-up soon after. |
| ⚪ Warning | Note for the record. Can be addressed later. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

