sweep-tests

sweep-tests is a skill for Claude Code from nirecom/agents. It costs 23 tokens per session (1,039 once invoked), scanned A, original, MIT.

A tool for finding test files that refer to tests or code that no longer exist.

In plain words
What is it for?
It helps audit stale tests, inspect duplicate test groups, repair test headers, and delete eligible files while reporting files held back because their status or references are unclear.
Why use it?
Old or orphaned tests add clutter and can mislead developers about what the project still checks. It can preview candidates before deleting them.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter; mentions subagents.

Good fit It helps audit stale tests, inspect duplicate test groups, repair test headers, and delete eligible files while reporting files held back because their status or references are unclear.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nirecom/agents/sweep-tests
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nirecom/agents --skill sweep-tests
Clone the repo
git clone --depth 1 https://github.com/nirecom/agents

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sweep-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirecom/agents/sweep-tests/github.svg)](https://agentmods.dev/skills/nirecom/agents/sweep-tests)
Your own site
<a href="https://agentmods.dev/skills/nirecom/agents/sweep-tests"><img src="https://agentmods.dev/badge/skills/nirecom/agents/sweep-tests/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sweep-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/nirecom/agents/sweep-tests"><img src="https://agentmods.dev/badge/skills/nirecom/agents/sweep-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,039 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01039
Opus 5.5 $0.00009 $0.00416
Sonnet 5.5 $0.00005 $0.00208
Haiku 4.5 $0.00002 $0.00104

Measured 9d ago against content hash d6cad54d8287, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sweep-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sweep-tests/SKILL.md · 44 lines

How it starts

The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Retires test files whose # Tests: targets are gone. A flagless run deletes; --dry-run reports only.

Procedure

STE-1. Run bash "$AGENTS_MAIN_ROOT/bin/audit-tests.sh" [--dry-run] [--apply] [--stale-months N] [--offline] [--format text|json] [--fix-headers] — issue-specific scope. STE-2. Run bash "$AGENTS_MAIN_ROOT/bin/audit-tests-common.sh" [--dry-run] [--apply] [--stale-months N] [--offline] [--format text|json] [--fix-headers] — scope:common. STE-3. Run bash "$AGENTS_MAIN_ROOT/bin/audit-tests.sh" --dup-groups — corpus-wide # Tests: duplicate-group inventory. Pass no other flag.

Case-marker embedding (on request only)

STE-4. Only when case-marker embedding is requested: run bash "$AGENTS_MAIN_ROOT/bin/audit-tests.sh" --embed-cases [--band-size N] [--order frequency|priority] [--dry-run], dispatch one subagent per ITEM row of the <<<EMBED-GATE-STE4 block, then run bash "$AGENTS_MAIN_ROOT/bin/audit-tests.sh" --embed-apply <EMBED_WORKDIR>. Each embed prompt carries the canonical line of the rules/shell-commands.md Subagent Dispatch Prompts section.

Rules

  • Every STE-1..STE-4 output is printed verbatim; never summarize or filter one.
  • --embed-cases covers the whole corpus and behaves the same from either entrypoint, so call one.
  • An embed subagent reads its rules_doc (and failure.txt on a retry) and writes only its output directory and report.txt.
  • On a <<<EMBED-RETRY-STE4 block, dispatch once more for those rows only, then rerun --embed-apply on the same workdir; no second retry block follows.
  • Copy CAPPED, TOOL_FAILED, CODEX_UNAVAILABLE, MERGED_TARGET and EXEMPT lines into the PR body's verification report; a TOOL_FAILED file is picked again by the next run.
  • The embed protocol (worklist, gate rows, states, retry record) is owned by docs/architecture/claude-code/sweep-tests-embed-cases.md.
  • For marker-bearing files (case_begin/case_end), candidacy is per case: a case qualifies when its target is gone (partial-orphan); all cases gone → whole-file orphan. For files without markers, a file qualifies once every # Tests: path is gone.
  • Issue state never selects a candidate — it gates deletion only.
  • Held deletions are reported as SKIP_DELETE_ISSUE_ACTIVE, SKIP_DELETE_METADATA_UNAVAILABLE, or SKIP_DELETE_AMBIGUOUS_REF; the file stays listed and on disk.
  • 0 CANDIDATE:/ORPHAN: lines while MALFORMED_HEADER:/NO_TESTS_HEADER: lines are present means the survival axis is clear and repair still remains on the header axis.
  • A dispatcher and its sibling tests/<stem>/ folder are retired as one unit.
  • --dry-run suppresses every write: no deletion, no header rewrite.
  • --apply is an explicit synonym of the flagless default; both scripts accept it.
  • --fix-headers reports format-invalid tokens (FIX_A:/FIX_B:) without rewriting; add --apply to rewrite # Tests: headers in-place (atomic, exec-bit preserved). Multi-paren tokens are excluded from auto-rewrite (SKIP_APPLY_MULTI_PAREN).
  • --fix-headers --dry-run is report-only as well; no file is ever touched.
  • --offline skips GitHub API calls; candidates are still reported and deletion of issue-referencing files is held.
  • --stale-months N (default 3) moves the delete-time staleness boundary only.
  • --dup-groups is read-only; combining it with explicit --apply, --fix-headers, or --format json exits 2.
  • --dup-groups covers the whole corpus and emits the same TSV from either entrypoint, so call one.
  • Missing, duplicated, late, and format-invalid headers become skip rows by reason; they never join a group.
  • key and files are escaped; the decoding rule is in the bin/lib/test-dup-group.sh header.

Read the full file on GitHub · 44 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago Changed · +1 lines d6cad54d8287
  2. 11d ago Changed ea6ca6eb6ef1
  3. 14d ago Changed · +9 lines 7793dfee7bbb
  4. 28d ago Changed f4523e5bfb06
  5. 1mo ago First seen · 34 lines · 23 tokens per session scan A 8b389e597a96

Subscribe to this mod's changes

sweep-tests is a skill published in the GitHub repository nirecom/agents (3 stars, last pushed today), licensed MIT. It adds 23 tokens to every session and 1,039 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

eval-dataset-design

A guide to creating reliable test sets for AI agents. Each evaluation task includes the request, the simulated user's behaviour, a reset starting state, and a success check that can be independently verified.

bojieli/ai-agent-book · 138 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens

cua-driver

Use Cua Driver for desktop or browser tasks that are awkward or unavailable through Bash/APIs, or when the user explicitly wants GUI interaction: app testing, visual bug reproduction, form filling, calendar entry, screenshots, and demo recording. Also covers Cua setup; not OpenAI Codex Computer Use or web research.

davidondrej/skills · 68 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

atmos-validation

Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.

cloudposse/atmos · 31 tokens