check-tests

A test-checking tool that runs the project's configured test command and records pass/fail results and code-coverage changes over time. Code coverage is the share of the code exercised by tests.

In plain words
What is it for?
Use it to run commands such as npm test, pytest, or go test ./..., keep a history of results, and detect new failures or falling coverage. It skips cleanly when no test command is configured.
Why use it?
It shows whether tests are failing and helps spot regressions, such as coverage dropping after a change. It does not modify source code or test files.

Skill for Claude CodeCodex

Part of the ooda-loop plugin — 11 skills, 2 hooks shipped together

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.

agentmods
npx agentmods add skills/mataeil/ooda-loop/check-tests
Any agent
npx skills add mataeil/OODA-loop --skill check-tests
Clone the repo
git clone --depth 1 https://github.com/mataeil/OODA-loop

Made for: Claude Code, Codex.

Or install ooda-loop, the plugin that ships this one along with the rest of its 11 skills, 2 hooks.

Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,616 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00031 $0.02616
Opus 5 $0.00015 $0.01308
Sonnet 5 $0.00006 $0.00523
Haiku 4.5 $0.00003 $0.00262

Measured 3d ago against content hash dd7a35577ee5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

check-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 3d 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/check-tests/SKILL.md · 171 lines

How it starts

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

check-tests: Test Suite Runner & Coverage Tracker

Runs the configured test command, tracks pass/fail counts and coverage percentage over time, and alerts when regressions appear or coverage drops. READ-ONLY in terms of PRs — writes only to agent/state/test_coverage.json.


Safety Rules

  1. HALT File — Check config.safety.halt_file first. If it exists, print reason and stop.
  2. Read-only — Writes only to agent/state/test_coverage.json. Never touches test files or source.
  3. No test_command — If config.test_command is empty or unset, skip gracefully.

Step 0: Safety

0-A: HALT Check

if file exists at config.safety.halt_file:
  Print "[HALT] check-tests stopped. Reason: {file_content}"
  EXIT immediately.

0-B: Config Validation

if config.test_command is missing or empty:
  Print "No test command configured. Skipping check-tests."
  Print "Set config.test_command (e.g. \"npm test\", \"pytest\", \"go test ./...\") to enable."
  EXIT cleanly (not an error).

Step 1: Load Previous State

Read agent/state/test_coverage.json. If missing, initialize with: { "schema_version": "1.0.0", "last_run": null, "run_count": 0, "status": "unknown", "results": { "total": 0, "passed": 0, "failed": 0, "skipped": 0, "coverage_pct": null }, "previous_results": null, "alerts": [], "history": [] }

Note previous passed, failed, and coverage_pct values for Step 3.


Step 2: Run Tests

Execute with a configurable timeout (read config.test_timeout_seconds; default 300):

{config.test_command} 2>&1

Capture exit code, stdout, stderr. Parse:

  • Counts: try framework-specific patterns in order:
    • Jest: Parse each token independently from the Tests: summary line — (\d+) failed, (\d+) passed, (\d+) skipped, (\d+) total as separate optional matches (default 0 when absent). IMPORTANT: the Tests: line omits "failed" when all tests pass (e.g., Tests: 26 passed, 26 total), so a combined pattern requiring all tokens will fail.
    • pytest: (\d+) passed, (\d+) failed, (\d+) skipped, (\d+) error
    • Go: count lines matching ^ok\s+\t as passed packages, lines matching ^FAIL\t as failed packages (IMPORTANT: Go emits multiple lines containing FAIL per failed package — --- FAIL: TestName, standalone FAIL, FAIL\tpkg/path, and a trailing FAIL summary. ONLY ^FAIL\t followed by a package path represents a failed package. Similarly, --- PASS: lines are per-test, not per-package.) In verbose mode (-v), also count --- PASS: lines for individual test counts and --- FAIL: for individual test failures, reporting both: Tests: {test_passed}/{test_total} passed (packages: {pkg_passed}/{pkg_total})
    • Mocha: (\d+) passing, (\d+) failing, (\d+) pending
    • RSpec: (\d+) examples?,\s*(\d+) failures?(?:,\s*(\d+) pending)?
    • Rust/Cargo: test result: (?:ok|FAILED)\.\s*(\d+) passed;\s*(\d+) failed;\s*(\d+) ignored — Cargo emits a single summary line. ignored maps to skipped. Coverage is not emitted by default; requires cargo-tarpaulin or cargo llvm-cov.
    • Python unittest (stdlib python -m unittest): Ran\s+(\d+)\s+tests? gives total. If a line matches ^OK\bfailed=0, passed=total (OK \(skipped=(\d+)\) sets skipped). If a line matches ^FAILED\s*\((.+)\) → inside the parens read failures=(\d+) and errors=(\d+) (sum → failed) and skipped=(\d+) if present; then passed = total - failed - skipped. unittest emits NO coverage — use python3 -m coverage run -m unittest && coverage report for the pytest-cov TOTAL ... % line. (Listed — and therefore tried — BEFORE Bun, since Bun also matches Ran (\d+) tests.)
    • Bun: (\d+)\s+pass(?:\b) for passed, (\d+)\s+fail(?:\b) for failed — Bun uses present tense (pass/fail) NOT past tense (passed/failed). Also Ran\s+(\d+)\s+tests for total. (\d+)\s+skip for skipped. Coverage requires --coverage flag.
    • Vitest: Uses the same Istanbul/v8 table format as Jest for coverage. Test counts use Tests\s+(\d+)\s+passed\s+\((\d+)\) format — note: no colon after Tests, no comma separators. Parse each token independently as with Jest.
    • Fallback: generic (\d+)\s+(?:tests?\s+)?passed, (\d+)\s+(?:tests?\s+)?failed
    • Go skipped: count --- SKIP: lines for skipped tests (only visible in verbose -v mode; if not verbose, skipped count defaults to 0)
    • Compute total = passed + failed + skipped when the framework does not emit a total
  • Coverage: try patterns in order:
    1. All files\s*\|\s*([\d.]+) (Istanbul/nyc table format — NOTE: data rows use bare numbers, no % sign. The first column after All files | is statement coverage.)
    2. TOTAL\s+.*?([\d.]+)% (pytest-cov)
    3. coverage:\s*([\d.]+)% (Go)
    4. Statements\s*:\s*([\d.]+)% (Jest text-summary reporter, NOT the default table)
    5. ([\d.]+)%\s*coverage (generic fallback) Use first match; if none match record null. Go multi-package note: Go emits one coverage: line per package. When multiple matches exist, compute the average across all matched values (this approximates aggregate coverage since Go does not produce a single aggregate figure). Ignore coverage: 0.0% from packages with [no test files].
  • Status: exit 0 → "passing", exit 127 (command not found) or 126 (permission denied) → "error" with detail "test command not found or not executable", timeout → "error" with detail "timeout after Ns", other non-zero → "failing"

Read the full file on GitHub · 171 lines

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. 3d ago First seen · 171 lines · 31 tokens per session scan A dd7a35577ee5

Subscribe to this mod's changes

check-tests is a skill published in the GitHub repository mataeil/OODA-loop (5 stars, last pushed 2mo ago), licensed MIT. It adds 31 tokens to every session and 2,616 once invoked, about $0.0002 per session on Opus 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

security-ownership-map

Analyze git repositories to build a security ownership topology (people-to-file), compute bus factor and sensitive-code ownership, and export CSV/JSON for graph databases and visualization. Trigger only when the user explicitly wants a security-oriented ownership or bus-factor analysis grounded in git history (for…

HKUDS/DeepCode · 99 tokens

integrity-forensics

Run the Anti-Autoresearch integrity-forensics sweep (span-anchored evidence ledger → GPT auditors propose findings → a rules-only reporter that lists every proposal with what the auditor said about it) against a paper via a SHA-pinned thin launcher — then convert the verdict into a typed policy gate…

wanshuiyin/Auto-claude-code-research-in-sleep · 162 tokens

patent-novelty-check

Assess patent novelty and non-obviousness against prior art. Use when user says "专利查新", "patent novelty", "可专利性评估", "patentability check", or wants to evaluate if an invention is patentable.

wanshuiyin/Auto-claude-code-research-in-sleep · 59 tokens

flow-next-tracker-sync

Project a flow-next spec to a tracker issue (Linear, GitHub, GitLab, Jira) and reconcile two-way. Use when asked to sync to a tracker. NOT plan-sync.

gmickel/flow-next · 44 tokens

flow-next-export-context

Export RepoPrompt context to a markdown file for review with an external LLM (ChatGPT, Claude web, etc.). Use when you want Carmack-level review but prefer an external model. Triggers on "export context", "export for external review", "export plan for ChatGPT", "export impl review context", "review with an external…

gmickel/flow-next · 81 tokens

moai-ref-ui-polish

UI polish and interface-completion reference: the small visual details — concentric border radius, optical alignment, shadow-vs-border, motion easing, typography smoothing, tabular numbers, icon stroke weight, hit areas — that separate polished interfaces from generic ones. Agent-extending skill that amplifies…

modu-ai/moai-adk · 98 tokens