run-tests

run-tests is a command for coding agents from CloudAI-X/claude-workflow-v2. It costs 20 tokens per session (617 once invoked), scanned A, original, MIT.

A command workflow that detects a project’s test system, finds tests related to recent code changes, and then runs broader test suites in stages.

In plain words
What is it for?
Use it after code changes to run affected tests, unit tests, integration tests, and to interpret failures across Node.js, Python, Go, or Rust projects.
Why use it?
Running every test immediately can be slow, while running only one test can miss wider problems. This approach checks the most relevant tests first and expands coverage when they pass.

Command

Part of the claude-workflow-v2 plugin — 14 skills, 26 commands, 7 agents, 6 hooks shipped together

About the project

Project Starter is a workflow plugin that equips coding agents with specialized subagents, reusable skills, commands, hooks, and output styles for software projects. It is for developers who want structured assistance with tasks such as planning, debugging, code review, security, and automation across several coding-agent platforms. Catalogue add-ons are components of its own workflow.

CloudAI-X/claude-workflow-v2 · 1,413 stars · on GitHub

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 commands/cloudai-x/claude-workflow-v2/run-tests
Clone the repo
git clone --depth 1 https://github.com/CloudAI-X/claude-workflow-v2

Or install claude-workflow-v2, the plugin that ships this one along with the rest of its 14 skills, 26 commands, 7 agents, 6 hooks.

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 run-tests

README.md
[![agentmods](https://agentmods.dev/badge/commands/cloudai-x/claude-workflow-v2/run-tests.svg)](https://agentmods.dev/commands/cloudai-x/claude-workflow-v2/run-tests)
Your own site
<a href="https://agentmods.dev/commands/cloudai-x/claude-workflow-v2/run-tests"><img src="https://agentmods.dev/badge/commands/cloudai-x/claude-workflow-v2/run-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 617 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.00020 $0.00617
Opus 5 $0.00010 $0.00309
Sonnet 5 $0.00004 $0.00123
Haiku 4.5 $0.00002 $0.00062

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

Security

Grade A, and why

run-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 5d 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.

commands/run-tests.md · 128 lines

How it starts

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

Run Tests

Run tests efficiently with tiered approach: affected tests first, then full suite.

Phase 1: Detect Test Framework

Identify testing setup:

# Node.js
cat package.json | grep -E '"(jest|vitest|mocha|ava|tap)"'

# Python
ls pytest.ini pyproject.toml setup.cfg 2>/dev/null | head -1

# Go
ls *_test.go 2>/dev/null | head -1

# Rust
ls Cargo.toml 2>/dev/null

Phase 2: Identify Affected Tests

Based on git diff, find related tests:

# Get changed files
git diff --name-only HEAD~1

# Find corresponding test files
# Convention: foo.ts -> foo.test.ts or foo.spec.ts

Phase 3: Run Tests (Tiered Approach)

Tier 1: Affected Tests Only (Fast)

# Node.js with Jest/Vitest
npm test -- --findRelatedTests [changed files]
npx vitest run --changed

# Python with pytest
pytest [specific test files] -x --tb=short

# Go
go test -run [TestName] ./...

Tier 2: Full Unit Test Suite

If Tier 1 passes:

npm test
pytest tests/unit/
go test ./...
cargo test

Tier 3: Integration Tests

If Tier 2 passes:

npm run test:integration
pytest tests/integration/
go test -tags=integration ./...

Phase 4: Analyze Failures

For each failure:

  1. Parse error message
  2. Identify failing assertion
  3. Trace to source code
  4. Suggest fix

Output Format

## Test Results: [PASS/FAIL]

### Summary
- Total: X tests
- Passed: Y
- Failed: Z
- Skipped: W
- Duration: [time]

### Failed Tests
1. **test_name** - `file:line`
   - Expected: [value]
   - Actual: [value]
   - Likely cause: [analysis]
   - Suggested fix: [fix]

### Flaky Test Detection
- [Any tests that passed on retry]

### Coverage (if available)
- Lines: X%
- Branches: Y%
- Functions: Z%

### Recommendation
[SAFE TO COMMIT / FIX REQUIRED / INVESTIGATE FLAKY]

Continue Until Green

If tests fail:

  1. Report the failure clearly
  2. Attempt to fix the failing code (not just the test)
  3. Re-run tests
  4. Repeat until green or max 3 attempts

Usage

This command ships with the project-starter plugin. Invoke with: /project-starter:run-tests

Read the full file on GitHub · 128 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. 5d ago First seen · 128 lines · 20 tokens per session scan A 9c99714c0bad

Subscribe to this mod's changes

run-tests is a command published in the GitHub repository CloudAI-X/claude-workflow-v2 (1,413 stars, last pushed 10d ago), licensed MIT. It adds 20 tokens to every session and 617 once invoked, about $0.0001 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-30.