agentleFS
LucfaceLucface/claude-skills/skills/techdebt/SKILL.md

techdebt

Skill1 starsChanged 3 days agoMITView on GitHub

End-of-session tech debt cleanup. Scans for TODOs, dead code, unused imports, type issues, and quick wins before you log off.

14 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use docs-ci, docs-interfaces and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • jh941213Skill

    docs-ci

    문서 CI(링크·OpenAPI lint·breaking 게이트·mermaid 검증)나 문서 드리프트 감지(docs.yaml 신선도 검사)를 설치하거나 돌릴 때 사용. 문서 내용 작성은 docs-architecture·docs-interfaces·docs-manuals.

    Also in 3 projects that use this

  • jh941213Skill

    docs-interfaces

    API·이벤트 인터페이스 문서(OpenAPI·swagger·AsyncAPI 명세, 엔드포인트 레퍼런스, API 구성도·시퀀스, API CHANGELOG)를 만들거나 코드와 맞출 때 사용. 시스템 구성도는 docs-architecture, API 설계 원칙은 api-design-principles.

    Also in 3 projects that use this

  • RachaelQuiselSkill

    client-docs

    Client documentation. Use when a build needs documentation updates or missing project documents need to be identified.

    Also in 3 projects that use this

  • planailabsSkill

    docs-architecture

    Layout, build pipeline, and structural gotchas for this dual-Astro repo. Read before changing structure, routing, or adding content. Operational/dev-server questions → dev-build skill.

    Also in 3 projects that use this

  • llama-farmSkill

    commit-push-pr

    Commit changes, push to GitHub, and open a PR. Includes quality checks (security, patterns, simplification). Use --quick to skip checks.

    Also in 5 projects that use this

  • diego-tobalinaSkill

    build-fix

    Fix build and compilation errors systematically. Run when build fails.

    Also in 3 projects that use this

  • +4 more from jh941213

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before creating a PR

    line 12
  2. Distinctive:

    After a big feature merge

    line 14
  3. Very specific:

    When the user invokes /techdebt:

    line 18
  4. Very specific:

    If no changes, scan the whole project's src/ directory.

    line 31
  5. Distinctive:

    Delete commented-out code (if > 30 days old per git blame)

    line 79
  6. Distinctive:

    Remove unused local variables

    line 80
  7. Very specific:

    Check for new files in ~/.claude/artifacts/research/ that aren't in ~/.claude/artifacts/research/INDEX.md:

    line 109
  8. Distinctive:

    If any unindexed files found, append them to the appropriate section in INDEX.md with channel tag.

    line 116

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tech Debt (/techdebt)

End-of-session codebase cleanup scan.

When to Use

  • End of a coding session
  • Before creating a PR
  • Periodic hygiene check
  • After a big feature merge

Instructions

When the user invokes /techdebt:

Step 1: Identify Scope

Determine what to scan:

# Files modified this session (since last commit on main)
BASELINE=$(git merge-base HEAD main 2>/dev/null || echo "HEAD~10")
git diff --name-only $BASELINE HEAD
git diff --name-only  # Unstaged too

If no changes, scan the whole project's src/ directory.

Step 2: Run Parallel Scans

Scan 1 — TODOs and FIXMEs (grep for actionable items):

grep -rn "TODO\|FIXME\|HACK\|XXX\|WORKAROUND" src/ --include="*.ts" --include="*.tsx"

Categorize each:

  • Stale (> 30 days, check git blame)
  • Actionable now (< 5 min fix)
  • Needs ticket (complex, track separately)

Scan 2 — Dead Code (Task tool, subagent_type: "general-purpose"):

Scan these files for dead code:
[file list]

Find:
- Unused exports (exported but never imported)
- Unused functions/variables
- Unreachable code paths
- Commented-out code blocks
- Unused imports

Return file:line for each finding.

Scan 3 — Type Safety (Task tool, subagent_type: "general-purpose"):

Scan these files for type safety issues:
[file list]

Find:
- `as` type assertions that could fail at runtime
- Missing null checks
- Implicit `any` from untyped dependencies
- Type guards that don't fully narrow
- Union types that aren't exhaustively handled

Return file:line and severity for each.

Step 3: Quick Wins

Automatically fix items that are safe:

  • Remove unused imports
  • Delete commented-out code (if > 30 days old per git blame)
  • Remove unused local variables
  • Fix obvious type narrowing gaps

Step 4: Report

## Tech Debt Report

### Auto-Fixed
- Removed N unused imports
- Deleted N lines of dead code
- Fixed N type issues

### Needs Attention
| File | Issue | Effort |
|------|-------|--------|
| src/foo.ts:42 | Stale TODO from 2 months ago | 5 min |
| src/bar.ts:17 | Type assertion could fail | 15 min |

### TODOs Summary
- N stale (> 30 days)
- N actionable now
- N need tickets

### Health Score: X/10

Step 4b: Research Artifact Index Sweep

Check for new files in ~/.claude/artifacts/research/ that aren't in ~/.claude/artifacts/research/INDEX.md:

# Find files newer than INDEX.md
find ~/.claude/artifacts/research/ -name "*.md" -newer ~/.claude/artifacts/research/INDEX.md ! -name "INDEX.md" 2>/dev/null

If any unindexed files found, append them to the appropriate section in INDEX.md with channel tag. Report: "INDEX.md: added N new research artifacts."

Step 5: Offer Next Steps

Would you like me to:
A) Fix the "Needs Attention" items now
B) Create GitHub issues for the complex ones
C) Just note it and move on

Arguments

ArgEffect
--fix-allAuto-fix everything safe, no prompt
--report-onlyNo fixes, just report
--scope "dir"Scan specific directory

Source

Inspired by Boris Cherny's Claude Code tips (https://x.com/bcherny/status/2017742741636321619), the tip "Build a /techdebt slash command and run it at the end of every session".

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.