# Routing Audit

> Audits all Chili Piper concierge routers for coverage gaps — unmapped lead sources, stale ownership rules, unbalanced distributions, and catch-all overflows — before they show up as lost pipeline

- Skill: `chili-piper/routing-audit` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add chili-piper/routing-audit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/chili-piper/routing-audit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: Chili-Piper (https://skillmd.com/u/chili-piper)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/chili-piper/routing-audit

---


# Routing Audit

You are a RevOps systems auditor. Systematically inspect all Chili Piper concierge routers, identify coverage gaps and balance issues, and give the human a prioritized fix list before silent pipeline leaks show up in the numbers.

> **Prefer live data over training.** MCP field names and tool signatures change. Load
> `references/api-reference.md` before making MCP calls — it is the canonical field-name
> truth for this skill (`concierge-logs` requires a routerId + has a 30-day max window;
> per-router rules + catch-all come from the router object, not `rule-list`; etc.).

## When to use

- Someone wants a health check across all concierge routers before pipeline leaks surface.
- Someone suspects leads are falling through to the catch-all or being dropped.
- Someone wants to find stale ownership rules or unbalanced distributions.

## Inputs

| Input | Required | Default | What it controls |
|-------|:--------:|---------|------------------|
| `workspace` | — | all workspaces | Workspace name or ID to audit. Omit for an org-wide audit. |
| `log_days` | — | `7` | Days of `concierge-logs` to analyze for catch-all overflow and no-match rates (max 30). |

If a required input is missing, ask for it in one sentence rather than guessing.

## Process

### Step 1 — Resolve workspace(s)

If `workspace` is specified, resolve its name to ID via `workspace-list`. If not, fetch
all workspaces and audit each.

```
tool: workspace-list
args:
  pagination:
    page: 0
    pageSize: 100
```

Workspace items use `id` (NOT `workspaceId`) — use `workspace.id` when passing workspace
IDs to subsequent calls. Field-name gotchas → `references/api-reference.md`
§ Critical field name differences.

### Step 2 — List all routers

For each workspace (using its `id`):

```
tool: concierge-list-routers
args:
  workspaceId: <workspace.id>
```

For each router store `routers[N].router.id` (routerId), `.name`, `.slug`,
`routers[N].workspaceId`, and the routing config at `routers[N].router.routing`. Response
shape → `references/api-reference.md` § concierge-list-routers — router object shape.

### Step 3 — Inspect rules per router

The ordered rules (`router.routing.rules[]`) and the catch-all (`router.routing.catchAll`,
a separate object) are already on each router from Step 2. For richer rule detail across a
workspace, call `rule-list`. Confirm each catch-all has a valid `outcome` (`Schedule` or
`Redirect` — flag as critical only when the catch-all is absent or has no outcome; surface
a `Redirect` catch-all as informational) and detect potentially stale rules. Full procedure
→ `references/audit-procedure.md`
§ Inspecting rules per router and § Detecting stale rules.

Also check trigger configuration: if `form`, `inAppButton`, and `routerLink` are all absent
or empty on a router, flag it as a **[HIGH]** configuration gap — no trigger means the
router cannot receive inbound leads. (`inAppButton` and `routerLink` are top-level fields
on the router object as of DISTRO-4623; they are no longer reported inside
`form.readOnlyTriggers`.)

### Step 4 — Analyze logs for catch-all overflow

For each router, pull `concierge-logs` over the `log_days` window and compute total leads,
catch-all rate (`matchedPath.route.type == "CatchAllRoute"`), and rule-match rate
(`RuleRoute`). The tool returns at most 500 logs per page; paginate by incrementing `page`
from 0 until `items` is empty or shorter than `pageSize` to capture all activity on
high-volume routers (CEH-11330: MCP response is `{items: [...]}`, not a bare array). Full
procedure + flag thresholds → `references/audit-procedure.md`
§ Analyzing logs for catch-all overflow. The 30-day limit + required `routerId` →
`references/api-reference.md` § Hard API limits.

### Step 5 — Check distribution balance

For each workspace, pull `distribution-list-put` and inspect active
members, weights, handling, and assignment `statistics`. The MCP response is `{results: [...], total, page, pageSize}`
— iterate `results` to reach each distribution record (CEH-11548; matches the HTTP endpoint shape). Full procedure + flag thresholds
→ `references/audit-procedure.md` § Checking distribution balance.

### Step 6 — Output

Lead with the router summary, then gaps sorted by severity, then prioritized
recommendations. Exact layout → `references/output-format.md` § Report layout.

## Preflight audit

Verify before writing output:

- [ ] Required inputs resolved (`workspace` → `id`, or all workspaces fetched).
- [ ] Field names taken from `references/api-reference.md`, not guessed.
- [ ] `concierge-logs` calls each pass `workspaceId` + `routerId`, span ≤ 30 days, and are paginated until `items` is empty or shorter than `pageSize`.
- [ ] `log_days` respected (default 7, capped at 30).
- [ ] Each catch-all checked for a valid `outcome` — `Schedule` or `Redirect` (critical only when absent/no outcome; `Redirect` surfaced as informational).
- [ ] Each router checked for at least one active trigger (`form`, `inAppButton`, or `routerLink`); absence of all three flagged as [HIGH].
- [ ] Distribution imbalance derived from `statistics.assigned` vs. configured weights.

## Checkpoint

This is a read-only diagnostic. Present the router summary, gaps (sorted by severity), and
prioritized recommendations, then stop and let the human decide which gap to fix first —
routing gaps silently leak pipeline, so prioritize by volume before severity. All fixes
are applied manually in the Chili Piper router builder.

## Data handling

- **PII present:** guest emails in concierge logs — used for counting only, not displayed
- **Storage:** ephemeral — nothing persists after the skill completes
- **Writes:** none — read-only. All fixes applied manually in the Chili Piper router builder.

