---
name: edge-audit
description: "In-repo dead-edge audit over the prototype, module by module. Dispatches one edge-auditor per module (parallel, capped), presents the two-axis findings for approval, then as single writer applies the additive micro-fixes (unbuilt sources, provenance refreshed), routes built-screen deltas to design-sync and new-screen needs to the design backlog, maintains the § Accepted toasts exceptions ledger in the interaction registry, and re-runs the tells to prove closure. Usage: /edge-audit <ModuleCode…|all> [--buckets 1-5]"
argument-hint: "<ModuleCode…|all> [--buckets 1-5 (default all; exclusions become registered debt)]"
---
> **Specialization:** Read `CLAUDE.md` first and bind every `<…>` placeholder and every "per `CLAUDE.md`" reference from it (prototype location + entry point + file pattern, the dead-handler tells, shared utility components, context-carry pattern, interaction registry path, design-backlog + design-prompts boards, screen registry, concurrency cap). This file hard-codes no project value. If a needed value is missing from `CLAUDE.md`, STOP-and-ask. See `SPECIALIZE.md`.

You are the **orchestrator** for module-scoped dead-edge audits and the **single writer** (Law 3) of everything they change: prototype micro-fixes, the interaction registry's **§ Accepted toasts** ledger, design-backlog rows, registry provenance refreshes, and the memory trio. `edge-auditor` agents are advisory. Read the **`dead-edge-audit`** skill first; its routing table governs step 5.

## 1. Resolve scope
Parse `$ARGUMENTS`: module codes → those modules; `all` → every module with prototype screens in the registry. `--buckets` narrows the taxonomy **only with cause** — any excluded bucket is registered as debt in the run's PROGRESS line and MUST be included by the next run (the skill's taxonomy law; never let an exclusion be silent). Assemble per module: its screen files, its § Accepted toasts rows, the design-backlog board, the registry's built/graduated flags.

## 2. Dispatch (parallel, capped per `CLAUDE.md`)
One `edge-auditor` per module (cap per `CLAUDE.md`; default 8) with the dispatch packet + declared scope/exclusions. Retry ≤2 (Law 11), then approval inbox.

## 3. Merge
Collect findings. Cross-module duplicates are rare (module-scoped by design) but cross-files are not: batch the journey-level notes for a single `/journey-audit` follow-up rather than firing it per module.

## 4. Checkpoint — present, then STOP
Findings severity-ordered per module, with each row's disposition, bucket, proposed fix, and `touches` routing. Propose a default batch (all High — buckets 1–2 — of one module). Present the "accept as fire-and-forget" candidates separately: accepting a toast is a **product decision**, so it gets explicit human sign-off, not a default.

## 5. Apply + route (single writer — the skill's routing table)
- **Micro-fixes on UNBUILT sources** → apply exactly as proposed (Step-3 grammar: status-override maps, session-list creation, context-carry nav, shared utilities), grep-checking every new top-level `const` first; refresh each touched source's provenance hash on its registry row (`resync: edge-audit GAP-nn`); update the screen's sidecar for any new CTA/state.
- **BUILT `✅` screens' sources** → never edit; hand the named deltas to `design-sync`.
- **Graduated** → forward-only item for the built side (`interaction-auditor` remediation path).
- **Needs a new designed screen** → design-backlog row + `design-prompt-authoring` brief (splice fields from the finding's screen context), lane per the routing rule.
- **Accepted fire-and-forget** → append to § Accepted toasts (`screen · element · justification · date`) AND ensure the sidecar declares `notify-sim` — an accepted toast without its sidecar declaration is half-done.
- **Closure proof:** re-run the tells grep over every fixed screen — zero toast-only/no-handler/placeholder on lifecycle + creation CTAs — and re-render the module entry once per batch. `GAP-nn closed by <…>` lines; boards/registry notes flip only on green.

## 6. Integrate the paper trail
`PROGRESS.md` line (modules audited, findings by bucket, fixed/filed/accepted/deferred, registered exclusions); Insights/Lessons graduated; the agents' reports stay in the approval inbox as provenance.

## 7. Report
Per module: elements inventoried, tell counts, findings by bucket/severity, fixes applied vs routed vs accepted, ledger delta, cross-files handed to `/journey-audit`, debt registered.
