---
name: ponytail-audit
trigger: /ponytail-audit
description: >
  Repo-wide over-engineering audit. Scans the entire codebase and ranks findings
  by waste: dead code, hand-rolled stdlib, speculative flexibility, and shrinkable code.
user_invocable: true
---

> **External skill** — [ponytail](https://github.com/DietrichGebert/ponytail)
> by DietrichGebert, MIT license. Included here because I use it daily.

# ponytail-audit — repo-wide over-engineering scan

Run with `/ponytail-audit [path]`. Defaults to the current project root.

## What it scans for

| Category | Label | Description |
|----------|-------|-------------|
| Dead code | `DELETE` | Unreachable, untested, or unused code that can be removed outright |
| Hand-rolled stdlib | `STDLIB` | Code that reimplements something the standard library already provides |
| Replaceable dependency | `NATIVE` | A third-party package doing what the platform/runtime provides natively |
| Speculative flexibility | `YAGNI` | Abstractions, interfaces, or params that have no current use |
| Shrinkable | `SHRINK` | Code that can be shortened without losing clarity or behavior |

## Output format

Results are ranked by estimated lines of waste (highest first).

```
CATEGORY  FILE                    LINES  FINDING
DELETE    src/utils/logger.ts       84   Entire module unused — console.log already in place
STDLIB    src/helpers/deepClone.js  31   Hand-rolled deep clone — use structuredClone()
NATIVE    src/auth/uuid.ts          12   uuid package for crypto.randomUUID() (built-in)
YAGNI     src/api/client.ts         28   pluginRegistry param added for future use, never passed
SHRINK    src/models/user.ts        19   5-line getter reducible to a destructure
```

One verdict per finding. No multi-paragraph explanations.

## Severity tiers

- **High** — DELETE and STDLIB findings: dead weight with no upside.
- **Medium** — NATIVE and YAGNI: removes a dependency or eliminates speculative code.
- **Low** — SHRINK: style improvement, no behavioral change.

## After the audit

Findings are suggestions. Accept, reject, or defer each one. Use `/ponytail-debt` to
track any shortcuts you choose to keep intentionally rather than fix immediately.
