tech-debt

A workflow that looks through implemented code for structural technical debt and records each finding with evidence and a suggested direction for fixing it. Technical debt is a design or code problem that can make future changes harder.

In plain words
What is it for?
Use it to inspect affected code, compare it with the architecture and acceptance criteria, and create a technical-debt report for a development ticket.
Why use it?
It makes hidden maintenance problems concrete by tying them to specific files and evidence instead of leaving them as vague concerns.

Command

Part of the mdt plugin — 1 skill, 16 commands, 5 agents, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/andkirby/markdown-ticket/tech-debt
Clone the repo
git clone --depth 1 https://github.com/andkirby/markdown-ticket

Or install mdt, the plugin that ships this one along with the rest of its 1 skill, 16 commands, 5 agents, 1 hook.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,737 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01737
Opus 5 $0.00000 $0.00869
Sonnet 5 $0.00000 $0.00347
Haiku 4.5 $0.00000 $0.00174

Measured 3d ago against content hash 03d9829cf00f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tech-debt scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

prompts/mdt/commands/tech-debt.md · 238 lines

How it starts

The opening of the file, as written. The whole thing — 238 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MDT Technical Debt Detection Workflow (v2)

On-demand detection of technical debt patterns in implemented code.

Core Principle: Identify structural problems introduced during implementation. Every debt item must have concrete file locations, evidence, and fix direction.

User Input

$ARGUMENTS

Session Context

Use {TICKETS_PATH} in all file path templates below (if it's not defined read ticketsPath key from .mdt-config.toml).

Output Location

{TICKETS_PATH}/{CR-KEY}/debt.md

Execution Steps

Step 1: Extract Project Context

Detect or extract from CLAUDE.md / project config:

project:
  source_dir: {src/, lib/, app/, ...}
  test_command: {npm test, pytest, cargo test, go test, make test, ...}
  build_command: {npm run build, cargo build, go build, make, ...}
  file_extension: {.ts, .py, .rs, .go, .java, ...}

If CLAUDE.md exists, read it. Otherwise detect from project files.

Step 2: Load CR Context

  1. Call MCP tool mdt-all:get_cr with mode="full" — abort if CR doesn't exist
  2. Extract:
    • Affected/new artifacts — files to analyze
    • Architecture Design — check for violations
    • Acceptance Criteria — extract scope/boundary constraints to verify
  3. Load requirements if exists: Check {TICKETS_PATH}/{CR-KEY}/requirements.md
    • If found: check for unsatisfied requirements (debt indicator)
  4. Load tasks if exists: Check {TICKETS_PATH}/{CR-KEY}/tasks.md
    • If found: check Requirement Coverage table for gaps
  5. If codebase available, scan actual files

Step 3: Detect Debt Patterns

Analyze against these patterns:

Pattern Signal Severity
Duplication Same logic in 2+ locations High
Shotgun Surgery Adding X requires editing N files High
Missing Abstraction Concept in code without type/interface Medium
Hidden Coupling Module imports internals of another Medium
Responsibility Diffusion Single concern across 3+ files High
Unsatisfied Requirements Requirements with no implementing code High

Read the full file on GitHub · 238 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 238 lines · 0 tokens per session scan A 03d9829cf00f

Subscribe to this mod's changes

tech-debt is a command published in the GitHub repository andkirby/markdown-ticket (5 stars, last pushed 17d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,737 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.