Tech Debt
Resolve one tech-debt item from its canonical debt file through validation, manual requirements and delivery handoffs, and closeout
$resolve-debt-phase takes one tech-debt item from validation to closeout. The debt file is the
source of truth. The phase validates a draft item, hands an accepted item to Requirements Phase and
then to delivery through two explicit operator handoffs, and marks the item resolved after delivery.
- Use this when: you point at one debt file, want to validate, accept, delete, or resolve one debt candidate, or want to continue an accepted item into implementation.
- It gives you: cited evidence for a draft item, a requirements brief and then a delivery brief for an accepted item, and a linked, resolved debt file after delivery.
- It ends with: one stop: a draft decision request, an accepted item waiting for an explicit
$requirements-phaseor$delivery-phaseinvocation, a no-op for a resolved item, or a completed item marked resolved with links. - Wrapped skills: optional readonly
$parallel-research.$requirements-phaseand$delivery-phaseare manual handoffs, not wrapped calls.
The phase is explicit-only (disable-model-invocation: true, allow_implicit_invocation: false).
Do not use it for a broad debt register, a backlog cleanup, or a multi-item debt campaign; for feature work with no debt file; or when a backlog issue is the only artifact and no owning workflow can find or create the debt file.
The Debt File
The canonical input is one file per debt item:
apps/wiki/content/docs/project/tech-debt/<domain>/<spec>/<debt-slug>.md
The prefix is the <wiki-root> declared in the project wiki contract, apps/wiki by default. Routed
debt items appear under Tech Debts.
The phase reads the debt file first and extracts its status, domain, originating spec, linked backlog mirror, evidence, and proposed resolution. A backlog mirror is secondary. It can be stale, so the phase uses it only to discover context or to sync status.
Workflow
- Locate exactly one debt file. When the request implies several items, stop.
- Read the debt file as canonical.
- Branch on its status:
draft,accepted, orresolved. When the status is missing or ambiguous, inspect context and ask before any state change.
| Status | Action | Stop |
|---|---|---|
draft | Readonly validation, then a cited synthesis. | Ask the user to choose exactly one: accept, delete, or authorize more research. |
accepted | Build a requirements brief; with a current Requirements result, build a delivery brief. | Tell the user to invoke $requirements-phase, then $delivery-phase, with each brief. Do not load either. |
resolved | Report that the item is resolved, with spec and implementation-note links. | No-op. History is inspected only on request. |
Draft: Validate
The phase proves whether the debt is real, stale, already fixed, or underspecified before it asks for a decision.
- Inspect the debt file.
- Inspect the originating
SPEC.md,PLAN.md,IMPLEMENTATION-NOTES.md, review notes, and related docs. - Inspect current code, tests, runtime logs, docs, and external evidence.
- Use
$parallel-researchwhen checks split cleanly across code, docs, tests, runtime evidence, or external sources. Its lanes stay readonly, and it persists one consolidated report under Research. - Synthesize the evidence with citations to files, commands, logs, or sources.
- Ask for one decision: accept, delete, or more research.
The requirements handoff starts only after the user accepts a draft item.
Accepted: Two Manual Handoffs
An accepted item moves toward delivery through two explicit user handoffs.
- Without a current Requirements result for this debt, build a requirements brief tied to the original domain, spec, and debt slug. It states the initial debt, why it matters, the bounded fix, non-goals, acceptance checks, and closeout requirements.
- Tell the user to invoke
$requirements-phaseexplicitly with that brief, then stop. Requirements Phase compiles the debt-resolutionARCHITECTURE.mdandSPEC.mdpair and projects its backlog. See Brainstorming Requirements And Backlog. - With that Requirements result, build a delivery brief that names the resolution spec, the backlog identities, the bounded fix, the acceptance checks, the closeout requirements, and the implementation scope.
- Tell the user to invoke
$delivery-phaseexplicitly with that brief, then stop.
The phase never loads or runs $requirements-phase or $delivery-phase. The operator owns both
transitions. Delivery then runs its usual gates; see
Implementation.
After Delivery: Close Out
Delivery does not call back. The operator re-invokes $resolve-debt-phase on the same debt file, and
the phase then:
- sets the debt file status to
resolved; - links the resolution spec;
- links the implementation notes or final delivery evidence;
- records the validation commands and outcomes;
- syncs the backlog mirror when one exists, without treating it as the source of truth;
- reports residual follow-up as new debt only when it is distinct from the resolved item.
Output
Every run reports:
- the debt file path and its status before and after;
- the evidence inspected or the validation performed;
- the draft decision request, the manual
$requirements-phaseor$delivery-phasehandoff or the returned delivery result, or the no-op reason; - links to the resolution spec and implementation notes, when present;
- the backlog mirror sync outcome, when available.
Where Debt Comes From
Other phases create debt; this phase only resolves one item.
- Delivery review: a retained finding with
return_route: debt_follow_upmakes delivery upsert a goal/spec-linked debt artifact once per finding. See Review. - ClawPatch resolution: a
tech-debtclassification runs$docs-ingest-phaseto create or update the canonical debt file with statusdraft. See Massive Bug Hunt And Fix. - Implementation drift:
implement-specwrites one item file per debt that must survive the run, at<wiki-root>/content/docs/project/tech-debt/<domain>/<spec>/<debt-slug>.md. The spec's item files form its ledger, and each item file is one canonical input of this phase. See Implementation.
Related Pages
Known Gaps
- Delivery debt capture names only a "goal/spec-linked debt artifact". It does not name the per-item file that this phase reads.
- Older items in the Tech Debts section sit under an area folder or directly
under
<domain>/, not under a spec folder.