Saas tech debt

From Basinfy/Basinfy-SaaS-Studio · View interactive version

Saas tech debt is an AI agent skill from the GitHub repository Basinfy/Basinfy-SaaS-Studio. Scan, classify, and prioritize codebase technical debt in a tracked register.

How to use this skill

Skill file

<!-- Generated from .claude/skills by scripts/sync-agent-skills.py. -->

Running this workflow on this client

Run commands from the project root (use Git Bash on Windows if bash points to an unavailable WSL distro). Shared studio files live in .claude/; follow .agents/PORTABLE-RUNTIME.md and .claude/docs/config-resolution.md for client tools, delegation, and approval rules.

Run bash .claude/hooks/yaml-helper.sh resolve_config --keys locale,automation,workflow and use its output below.

Tech Debt

Locale & User Profile: Match locale (pt-BR → natural Brazilian Portuguese questions/options, overriding English examples; en → English) and user_profile (founder → plain business language with (Recomendado) first, zero tech jargon; developer → technical). Keep code/tests in English.

Every AskUserQuestion call follows .claude/docs/automation-modes.md

(collaborative asks always · guided major-only · autonomous logs and proceeds;

automation_always_ask categories always prompt).

Phase 1: Parse Subcommand

Determine the mode from the argument:

If no subcommand is provided, output usage and stop. Verdict: FAIL — missing required subcommand.


Phase 2A: Scan Mode

Search the code root (resolve per .claude/docs/code-root-resolution.md:

src/, Assets/ or Source/ by engine) for debt indicators:

Categorize each finding:

Before presenting anything, establish that there was something to scan.

Count the source files the scan actually covered. If the code root is

unresolved, report NOT ASSESSED — code root unresolved and stop as below. If

that count is zero — the code root is absent, or holds no source files — report:

NOT ASSESSED — no source files to scan. The code root contains no code, so

"no debt indicators found" would be a statement about an empty search, not

about the codebase. Run this once implementation is under way.

and stop. Do not write to the register and do not emit a COMPLETE verdict.

The distinction is the whole point of the scan: **zero findings over 400 files

is a clean codebase; zero findings over zero files is no information at all.**

Rendering both as "COMPLETE — scan findings written to register" reads as the

first. State the denominator whenever findings are reported,

including when it is large and the count is genuinely zero.

Present the findings to the user.

Ask: "May I write these findings to docs/saas-tech-debt-register.md?"

If yes, update the register, never overwriting it. Match before appending: a

finding with the same file and the same kind of debt as an existing Open entry

updates that entry instead of adding a duplicate. An existing Open entry whose

pattern is no longer in its file is proposed as Resolved [date] — list those and

include them in the same approval. Verdict: COMPLETE — scan findings written to register.

If no, stop here. Verdict: BLOCKED — user declined write.


Phase 2B: Add Mode

Ask the user for the description and affected files (plain text prompts).

Run as a subagent? lead-engineer preloads this skill, and a subagent has

no AskUserQuestion. Return the three questions below (category, effort,

impact) in one reply, each as a short list of its options, and stop: whoever

called you asks the user. Nothing goes into the register until the answers

come back.

Then use AskUserQuestion to collect the category:

Then use AskUserQuestion to collect the estimated fix effort:

Then use AskUserQuestion to collect the impact if left unfixed — the

register's Impact column, which /saas-tech-debt prioritize scores:

Present the complete new entry to the user.

Match before appending: if an existing Open entry already has the same

file and the same category, show it to the user and ask whether to update that

entry instead of adding a duplicate.

Ask: "May I append this entry to docs/saas-tech-debt-register.md?" (or, on a match,

"May I update the existing entry instead?")

If yes, append the entry (or update the matched one). Verdict: COMPLETE — entry added to register.

If no, stop here. Verdict: BLOCKED — user declined write.


Phase 2C: Prioritize Mode

Read the debt register at docs/saas-tech-debt-register.md. If it does not exist:

Verdict: NOT ASSESSED — no register at docs/saas-tech-debt-register.md; run

/saas-tech-debt scan first. Stop.

Score each item from its own columns: impact ÷ effort, with Impact Low 1,

Med 2, High 3, Critical 4 and Effort S 1, M 2, L 3, XL 4, rounded to

one decimal and written to Priority. Higher scores first; ties go to the older

Added date. An item whose Impact or Effort is — gets no score: list it after

the scored items as "not scored — [column] not judged" rather than guessing one.

Re-sort the register by priority score and recommend which items to include in the next sprint (at workflow: minimal, which has no sprints, which to build next).

Present the re-prioritized register to the user.

Ask: "May I write the re-prioritized register back to docs/saas-tech-debt-register.md?"

If yes, write the updated file. Verdict: COMPLETE — register re-prioritized and saved.

If no, stop here. Verdict: BLOCKED — user declined write.


Phase 2D: Report Mode

Read the debt register. If it does not exist: Verdict: NOT ASSESSED — no

register to report on; run /saas-tech-debt scan first. Stop.

Generate summary statistics:

Added date and its Resolved [date] status

Flag any items that have been in the register for more than 3 sprints.

Output the report to the user. This mode is read-only — no files are written. Verdict: COMPLETE — debt report generated.


Phase 3: Next Steps

Debt Register Format

## Technical Debt Register
Last updated: [Date]
Total items: [N] | Estimated total effort: [T-shirt sizes summed]

| ID | Category | Description | Files | Effort | Impact | Priority | Status | Added | Sprint |
|----|----------|-------------|-------|--------|--------|----------|--------|-------|--------|
| TD-001 | [Cat] | [Description] | [files] | [S/M/L/XL] | [Low/Med/High/Critical] | [Score] | [Open / Resolved YYYY-MM-DD / Accepted — reason] | [YYYY-MM-DD] | [Sprint to fix or "Backlog"] |

Every skill that adds a row — this one, and /saas-story-done when it logs

deviations as debt — writes all ten columns in this order, and a skill that

creates the file writes the header and table head above first:

register (TD-001 in a new one). IDs are never reused.

"Debt": Architecture, Code Quality, Test, Documentation, Dependency,

Performance — the spelling /saas-story-done writes, so Report Mode groups them once.

if not yet judged.

was fixed; Accepted — reason records a conscious decision to keep it.

added and resolved from this date and the Resolved date.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.