6.2 KiB
Skill Test Spec: /tech-debt
Skill Summary
/tech-debt tracks, categorizes, and prioritizes technical debt across the
codebase. It reads docs/tech-debt-register.md for the existing debt register
and scans source files in src/ for inline TODO and FIXME comments. It
merges and sorts items by severity. No director gates are invoked. The skill
asks "May I write to docs/tech-debt-register.md?" before updating. Verdicts:
REGISTER UPDATED or NO NEW DEBT FOUND.
Static Assertions (Structural)
Verified automatically by /skill-test static — no fixture needed.
- Has required frontmatter fields:
name,description,argument-hint,user-invocable,allowed-tools - Has ≥2 phase headings
- Contains verdict keywords: REGISTER UPDATED, NO NEW DEBT FOUND
- Contains "May I write" language (skill writes to debt register)
- Has a next-step handoff (what to do after register is updated)
Director Gate Checks
None. Tech debt tracking is an internal codebase analysis skill; no gates are invoked.
Test Cases
Case 1: Happy Path — Inline TODOs plus existing register items merged
Fixture:
docs/tech-debt-register.mdexists with 2 items (LOW and MEDIUM severity)src/gameplay/combat.gdhas 2# TODOcomments and 1# FIXMEcommentsrc/ui/hud.gdhas 0 inline debt comments
Input: /tech-debt
Expected behavior:
- Skill reads
docs/tech-debt-register.md— finds 2 existing items - Skill scans
src/— finds 3 inline comments (2 TODOs, 1 FIXME) - Skill checks whether inline comments already exist in the register (deduplication)
- Skill presents combined list sorted by severity (FIXME before TODO by default)
- Skill asks "May I write to
docs/tech-debt-register.md?" - User approves; register updated; verdict REGISTER UPDATED
Assertions:
- Inline comments are found by scanning
src/recursively - Existing register items are not duplicated
- Combined list is sorted by severity
- "May I write" prompt appears before any write
- Verdict is REGISTER UPDATED
Case 2: Register Doesn't Exist — Offered to create it
Fixture:
docs/tech-debt-register.mddoes NOT existsrc/contains 4 inline TODO/FIXME comments
Input: /tech-debt
Expected behavior:
- Skill attempts to read
docs/tech-debt-register.md— not found - Skill informs user: "No tech-debt-register.md found"
- Skill offers to create the register with the inline items it found
- Skill asks "May I write to
docs/tech-debt-register.md?" (create) - User approves; register created with 4 items; verdict REGISTER UPDATED
Assertions:
- Skill does not crash when register file is absent
- User is offered register creation (not silently skipping)
- "May I write" prompt reflects file creation (not update)
- Verdict is REGISTER UPDATED after creation
Case 3: Resolved Item Detected — Marked resolved in register
Fixture:
docs/tech-debt-register.mdhas 3 items; one referencessrc/gameplay/legacy_input.gdsrc/gameplay/legacy_input.gdhas been deleted (refactored away)- The referenced TODO comment no longer exists in source
Input: /tech-debt
Expected behavior:
- Skill reads register — finds 3 items
- Skill scans
src/— does not find the source location referenced by item 2 - Skill flags item 2 as RESOLVED (source is gone)
- Skill presents the resolved item to user for confirmation
- On approval, register is updated with item 2 marked
Status: Resolved
Assertions:
- Skill checks whether each register item's source reference still exists
- Missing source locations result in items being flagged as RESOLVED
- User confirms before resolved items are written
- RESOLVED items are kept in the register (not deleted) for audit history
Case 4: Edge Case — CRITICAL debt item surfaces prominently
Fixture:
src/core/network_sync.gdhas a comment:# FIXME(CRITICAL): race condition in sync buffer — can corrupt save datadocs/tech-debt-register.mdexists with 5 lower-severity items
Input: /tech-debt
Expected behavior:
- Skill scans source and finds the CRITICAL-tagged FIXME
- Skill presents the CRITICAL item at the top of the output — before the full table
- Skill asks user to acknowledge the critical item before proceeding
- After acknowledgment, skill presents full debt table and asks to write
- Register is updated with CRITICAL item at top; verdict REGISTER UPDATED
Assertions:
- CRITICAL items appear at the top of the output, not buried in the table
- Skill surfaces CRITICAL items before asking to write
- User acknowledgment of the CRITICAL item is requested
- CRITICAL severity is preserved in the written register entry
Case 5: Gate Compliance — No gate; register updated only with approval
Fixture:
- Inline scan finds 2 new TODOs; register has 3 existing items
review-mode.txtcontainsfull
Input: /tech-debt
Expected behavior:
- Skill scans source and reads register; compiles combined debt list
- No director gate is invoked regardless of review mode
- Skill presents sorted debt table to user
- Skill asks "May I write to
docs/tech-debt-register.md?" - User approves; register updated; verdict REGISTER UPDATED
Assertions:
- No director gate is invoked in any review mode
- Debt table is presented before any write prompt
- "May I write" prompt appears before file update
- Write only occurs with explicit user approval
Protocol Compliance
- Reads
docs/tech-debt-register.mdand scanssrc/before compiling - Deduplicates inline comments against existing register items
- Sorts combined list by severity
- Always asks "May I write" before updating register
- No director gates are invoked
- Verdict is REGISTER UPDATED or NO NEW DEBT FOUND
Coverage Notes
- The case where
src/is empty or absent is not tested; behavior follows the NO NEW DEBT FOUND path for the inline scan, but register items would still be read and presented. - TODO comments without severity tags are treated as LOW severity by default; this classification detail is an implementation concern, not tested here.