Skip to content
Back to skills

Check Audit

ASecurity

Audit tests, landing speed, Local CI reliability, check tiers, verification hooks, and tooling scripts to cut bloat, flakes, and dead gates while keeping E2E, public boundary, and invariant coverage intact.

  • 1,166 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added December 1, 2026
ai-agentsgonoderefactoringgitsecurity

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add udecode/ustack --skill check-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Check Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Check Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/udecode-check-audit/badge)](https://www.skillsdirectory.com/skills/udecode-check-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: check-audit
description: "Audit tests, landing speed, Local CI reliability, check tiers, verification hooks, and tooling scripts to cut bloat, flakes, and dead gates while keeping E2E, public boundary, and invariant coverage intact."
metadata:
  source: udecode/ustack
  source-path: skills/check-audit
---

# Check audit

Test-pruning core adapted from openclaw's `test-audit` skill (MIT, OpenClaw Foundation; see [LICENSE](LICENSE)).

Read `AGENTS.md` and `.agents/pstack/rules/tests.md` first. Stay read-only when asked only for candidates or gaps, and skip third-party skills or vendor code. `skill-audit` owns agent prose (skills, playbooks, `AGENTS.md`); `check-audit` owns everything executable that tests, gates, or slows down delivery.

## Run the scanner

```sh
node <skill>/scripts/audit.mjs <target> [--json] [--events <path>]
```

Reports `landChecks` and `always: true` generators, `check.mjs` `land` step counts, large baseline files, hook parity and missing-script references across `.agents/hooks.json`, `.claude/settings.json`, and `.codex/hooks.json`, oversized or zero-caller scripts under `tooling/scripts/` or `scripts/`, and recent Local CI `events.jsonl` red/flake counts.

## Default bar

Internal, helper, and post-hoc unit tests, slow land checks, and micro-scripts are guilty until they guard a real user defect that E2E, public boundary, type, lint, or zero-baseline invariant checks miss. Keep a test only when breaking public behavior fails it and refactoring internals keeps it passing (`principle-test-behavior-not-implementation`).

## Hard safety net

- Never cut E2E, deterministic concurrency/sync, or public golden tests without an explicit replacement.
- Never silently delete an unwired security, access, auth, PHI, consent, or customer-send guard whose only caller is a test; flag it as a finding so production wires or retires it intentionally.
- Never delete a test failing on the current tree or raise a timeout/limit to make CI green; reproduce and fix the bug or fixture first.

## Pass 1: Tests

Cut coherent package or owner batches without per-test scratch mutation courtrooms:

1. **Internal and test-only entries:** `*.internal.*` files and tests importing non-public or test-only exports. Delete dead test-only exports and helpers with them (`knip --production` or `git grep`).
2. **Low-signal shapes:** mock-verifying, constant-pinning (unless user-promised with the promise named), source-text/grep, assertion-free, self-comparing, snapshot, and exhaustive-matrix tests.
3. **Timing bounds:** wall-clock assertions outside dedicated benchmarks.
4. **Duplicate coverage:** unit tests whose user behavior is already exercised by a kept E2E, golden, or public boundary test.
5. **Flaky and slow tests:** fix deterministic flakes in one pass or cut and replace; cut slow tests that duplicate boundary coverage and shrink inputs on unique slow tests.

Reserve targeted scratch mutant or refactor checks only for genuinely uncertain edge cases, never as mandatory paperwork on clear cuts.

## Pass 2: Landing speed

Audit what blocks every `land.mjs` run (`landChecks`, `land: true` steps in `check.mjs`, and `generated` entries with `always: true`):

- Measure wall-clock time and real failure-catch rate per landing step.
- Demote slow, rarely tripped, or broad-blast steps from `land` to post-landing Local CI or on-demand `--audit`.
- Remove `always: true` regeneration on outputs that only change when specific sources change.

## Pass 3: Local CI and baselines

Audit `check.mjs`, CI workflows, and baseline files against recent failure history (`events.jsonl` or CI logs):

- Rank steps by red count, flake rate, and time-to-green; fix root causes of chronic flakes or cut checks that only produce noise.
- Demote multi-hundred-line known-bad baseline sweeps out of blocking CI into on-demand audit commands.
- Fold static invariants into types or lint rules and delete redundant micro-scripts.

## Pass 4: Scripts and gate hooks

Audit `tooling/scripts/`, `scripts/`, and runtime hook configs (`.agents/hooks.json`, `.claude/settings.json`, `.codex/hooks.json`):

- Delete zero-caller orphan scripts, retired-runtime helpers, and Stop hooks that fire after `land.mjs` has already pushed commits.
- Move land-time invariants into `landChecks` over `git diff <base>..HEAD` instead of parsing per-runtime JSONL transcripts in Stop hooks.
- Close hook parity gaps across active agent runtimes and flag oversized single-purpose scripts (`>= 600` lines) for simplification.

## Full mode and validation

In `/check-audit full`, run the scanner, write an area ledger in the run directory (files, line counts, timings, failure counts, state), and process one area per batch, highest leverage first. Ask the owner before changing hooks, `landChecks`, or blocking CI policy unless explicitly authorized.

Validate every deleted or changed batch:
1. Run remaining tests, boundary/E2E suites, typecheck, lint, and hook/contract tests.
2. When removing files, scripts, or exports, run the project's full check (`pnpm check` or equivalent) to catch stale contract lists, hook paths, or manifests.
3. Report removed categories, landing/CI speed delta, production or script deletions unlocked, kept edge cases, commands run, and separate production, test, and tooling line counts.

Files in this skill

  • LICENSE1.1 KB
  • SKILL.md5.2 KB
  • scripts/audit.mjs14.8 KB
  • scripts/audit.test.mjs4.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.