Technical Debt Detector

VerifiedSafe

Detects and reports technical debt including TODO comments, duplicate code, unused imports, long functions, deep nesting, magic numbers, and outdated dependencies. Generates a prioritized report to help developers improve code quality and maintainability.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#techdebt#code-quality#static-analysis#refactoring

Recommended for

Automated summary

Scans and reports technical debt in source code, including TODOs, dead code, overly long functions, and outdated dependencies.

Strengths

  • Systematic detection of multiple types of technical debt
  • Prioritized report that facilitates corrective actions
  • Uses native tools (grep, bash) with no external dependencies
  • Multi-language support (JS, Python, Go, Ruby)

Limitations

  • Heuristic detection may produce false positives
  • No automatic fixes, only reports
  • Can be slow on very large codebases
When to use it

When you want to assess codebase quality, prepare for refactoring, or track technical debt over time.

When not to use it

If you need automatic problem correction, or if you require a deeper analysis with specific metrics.

Security analysis

Safe
Quality score88/100

The skill uses only read-only shell commands (grep) to scan source files for patterns; no destructive commands, no exfiltration, no disabling of safety features. The allowed Bash tool is used for benign code analysis.

No concerns found

How this analysis is made

Examples

Full scan of current project
/techdebt
Scan a specific directory
/techdebt src/
Show only high-priority items
/techdebt --high-only

name: techdebt description: "技術的負債の検出と修正提案。重複コード、TODOコメント、未使用import、複雑度の高い関数を検出。トリガー: /techdebt, 技術的負債, コード品質チェック" user-invocable: true allowed-tools: Read, Grep, Glob, Bash model: sonnet

技術的負債レポーター

コードベースの技術的負債を検出し、優先度付きのレポートを生成します。

検出項目

1. TODOコメント

# 検出パターン
grep -rn "TODO\|FIXME\|HACK\|XXX\|TEMP" --include="*.ts" --include="*.js" --include="*.py" --include="*.go" --include="*.rb"

2. 重複コード

  • 類似パターンの検出(5行以上の重複)
  • コピペの痕跡

3. 未使用コード

  • 未使用の import/require
  • 未使用の変数・関数・クラス
  • デッドコード(到達不能なコード)

4. 長すぎる関数

  • 100行以上の関数を検出
  • パラメータが6個以上の関数

5. 深いネスト

  • 4階層以上のネストを検出
  • 複雑な条件分岐

6. マジックナンバー

  • 意味不明な数値リテラル
  • ハードコードされた文字列

7. 古い依存関係

  • package.json / go.mod / requirements.txt の outdated チェック
  • セキュリティ脆弱性のある依存

実行フロー

  1. 対象ディレクトリを特定(引数がなければ src/ または現在ディレクトリ)
  2. 各検出項目を並列で実行
  3. 結果を集計・優先度付け
  4. レポートを生成

優先度の基準

| 優先度 | 条件 | |--------|------| | 高 | セキュリティリスク、本番障害の可能性 | | 中 | 保守性低下、バグの温床になりやすい | | 低 | コード品質向上、リファクタリング推奨 |

出力形式

## 技術的負債レポート

**スキャン日時**: YYYY-MM-DD HH:MM
**対象**: <directory>
**ファイル数**: N files

---

### サマリー

| カテゴリ | 件数 | 優先度高 | 優先度中 | 優先度低 |
|---------|------|---------|---------|---------|
| TODO | 5 | 1 | 2 | 2 |
| 重複コード | 3 | 0 | 3 | 0 |
| 未使用コード | 8 | 0 | 2 | 6 |
| 長い関数 | 2 | 0 | 2 | 0 |
| 深いネスト | 4 | 1 | 3 | 0 |
| マジックナンバー | 6 | 0 | 0 | 6 |

**合計**: 28件 (高:2, 中:12, 低:14)

---

### 詳細

#### TODO (5件)

| ファイル | 行 | 内容 | 優先度 |
|---------|-----|------|-------|
| src/api.ts | 45 | TODO: エラーハンドリング追加 | 高 |
| src/util.ts | 12 | FIXME: レースコンディション | 中 |

#### 重複コード (3件)

| 場所1 | 場所2 | 行数 | 優先度 |
|-------|-------|------|-------|
| src/a.ts:10-30 | src/b.ts:45-65 | 20行 | 中 |

#### 長い関数 (2件)

| ファイル | 関数名 | 行数 | 優先度 |
|---------|--------|------|-------|
| src/handler.ts | processRequest | 150行 | 中 |

---

### 改善推奨度

⭐⭐⭐⭐ (対応を強く推奨)

### 次のアクション

1. [高] src/api.ts:45 のエラーハンドリングを追加
2. [高] src/handler.ts:78 の深いネストをリファクタリング
3. [中] 重複コード3箇所を共通関数に抽出

使用方法

/techdebt              # 現在のプロジェクト全体をスキャン
/techdebt src/         # src/ ディレクトリのみ
/techdebt --high-only  # 優先度高のみ表示

注意事項

  • 大規模プロジェクトでは時間がかかる場合がある
  • 検出結果はヒューリスティクスに基づくため、誤検出の可能性がある
  • 自動修正は行わない(レポートのみ)

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/technical-debt-detector-mm78nng6/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/technical-debt-detector-mm78nng6' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/technical-debt-detector-mm78nng6/download' --output '.skill-downloads/technical-debt-detector-mm78nng6/SKILL.md.part' && mv '.skill-downloads/technical-debt-detector-mm78nng6/SKILL.md.part' '.skill-downloads/technical-debt-detector-mm78nng6/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Grep, Glob, Bash

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/technical-debt-detector-mm78nng6/SKILL.md' && test -s '.skill-downloads/technical-debt-detector-mm78nng6/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/techdebt' && cp -R '.skill-downloads/technical-debt-detector-mm78nng6' '.claude/skills/techdebt'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/technical-debt-detector-mm78nng6'

openskills read 'technical-debt-detector-mm78nng6'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/technical-debt-detector-mm78nng6/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills