sp2-verify-1770320675/.claude/commands/audit-debt.md
jordan 19ee59576c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/manual/woodpecker Pipeline was successful
Initialize project from skeleton template
2026-02-05 19:44:36 +00:00

1.4 KiB

description argument-hint allowed-tools
Audit codebase for systemic tech debt - inconsistent patterns that should be unified <category, e.g., "error-handling", "logging", "api-calls", "auth", or "all"> Task, Read, Write, Edit, Glob, Grep, Bash

Audit for systemic tech debt: $ARGUMENTS

Instructions

Load the systemic-debt-auditor skill, then:

If "all" or no category:

High-level scan:

| Category | Variations | Worst Issue | Priority |
|----------|------------|-------------|----------|
| Error Handling | 4 patterns | unwrap in prod | HIGH |
| Logging | 3 patterns | println debug | MEDIUM |

Then ask which to deep dive.

If specific category:

  1. Survey - Find all variations with grep
  2. Categorize - Document each pattern
  3. Identify canonical - Best existing pattern
  4. Risk assess - CRITICAL > HIGH > MEDIUM > LOW
  5. Propose plan - Incremental unification

Quick Reference

Error Handling (Go)

grep -rn "panic(" --include="*.go" | wc -l
grep -rn "log.Fatal" --include="*.go" | wc -l
grep -rn "if err != nil" --include="*.go" | wc -l

Logging

grep -rn "fmt.Print" --include="*.go" | wc -l
grep -rn "slog\.\|log\." --include="*.go" | wc -l

Output Requirements

  1. Patterns found with counts
  2. Canonical pattern recommendation
  3. Risk assessment table
  4. Unification plan (stop bleeding → fix critical → gradual cleanup)
  5. Enforcement mechanism