run-tests

run-tests is a command for Claude Code from circuit-synth/kicad-sch-api. It costs 0 tokens per session (1,733 once invoked), scanned C, original, MIT.

A command that runs a Python project's automated tests with pytest, a tool for checking code behavior, using several levels of coverage and reporting.

In plain words
What is it for?
Run quick, standard, full, or coverage test suites; format code first; keep generated files; show detailed output; or stop at the first failure.
Why use it?
It groups test setup, formatting, execution, and reporting so developers can run a quick check or a fuller validation without assembling the commands themselves.

Command for Claude Code

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/circuit-synth/kicad-sch-api/run-tests
Clone the repo
git clone --depth 1 https://github.com/circuit-synth/kicad-sch-api

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/circuit-synth/kicad-sch-api/run-tests.svg)](https://agentmods.dev/commands/circuit-synth/kicad-sch-api/run-tests)
Your own site
<a href="https://agentmods.dev/commands/circuit-synth/kicad-sch-api/run-tests"><img src="https://agentmods.dev/badge/commands/circuit-synth/kicad-sch-api/run-tests.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,733 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00000 $0.01733
Opus 5 $0.00000 $0.00866
Sonnet 5 $0.00000 $0.00347
Haiku 4.5 $0.00000 $0.00173

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

Security

Grade C, and why

run-tests scanned grade C with 1 finding 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 4d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf test_outputs/ .pytest_cache/ .coverage htmlcov/ 2>/dev/null || true
.claude/commands/dev/run-tests.md · 267 lines

How it starts

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

Test Runner Command - kicad-sch-api

Usage

/run-tests [options]

Description

Orchestrates comprehensive testing for kicad-sch-api using uv and pytest, covering all functionality areas with professional test reporting.

Options

  • --suite=standard - Test suite: quick, standard, full, coverage (default: standard)
  • --skip-install - Skip dependency reinstallation (faster for development)
  • --keep-outputs - Don't delete generated test files
  • --verbose - Show detailed output
  • --format=true - Auto-format code before testing (default: true)
  • --fail-fast=false - Stop on first failure (default: false)

Test Suites

🚀 Quick Suite (~10 seconds)

Fast development testing:

uv run pytest tests/test_component_management.py tests/test_sexpr_parsing.py -q

📋 Standard Suite - Default (~30 seconds)

Comprehensive core functionality:

# Auto-format if requested
uv run black kicad_sch_api/ tests/ --quiet
uv run isort kicad_sch_api/ tests/ --quiet

# Run core tests
uv run pytest tests/ -v --tb=short

🔬 Full Suite (~2 minutes)

Complete validation including MCP server:

# Python library tests
uv run pytest tests/ -v --cov=kicad_sch_api --cov-report=html

# MCP server tests
cd mcp-server && npm test

# Format preservation tests
uv run pytest tests/test_format_preservation.py -v

# Reference schematic tests
uv run pytest tests/reference_kicad_projects/ -v

📊 Coverage Suite (~1 minute)

Detailed coverage analysis:

uv run pytest tests/ --cov=kicad_sch_api --cov-report=term-missing --cov-report=html --cov-fail-under=80

Implementation

#!/bin/bash

# Parse arguments
SUITE="standard"
SKIP_INSTALL=false
KEEP_OUTPUTS=false
VERBOSE=false
FORMAT=true
FAIL_FAST=false

while [[ $# -gt 0 ]]; do
    case $1 in
        --suite=*)
            SUITE="${1#*=}"
            shift
            ;;
        --skip-install)
            SKIP_INSTALL=true
            shift
            ;;
        --verbose)
            VERBOSE=true
            shift
            ;;
        --format=*)
            FORMAT="${1#*=}"
            shift
            ;;
        --fail-fast)
            FAIL_FAST=true
            shift
            ;;
        *)
            echo "Unknown option: $1"
            exit 1
            ;;
    esac
done

# Ensure we're in Python directory
cd python || { echo "❌ Must run from kicad-sch-api root"; exit 1; }

# Install dependencies if needed
if [[ "$SKIP_INSTALL" == "false" ]]; then
    echo "📦 Installing dependencies..."
    uv pip install -e .[dev] --quiet
fi

# Pre-test formatting
if [[ "$FORMAT" == "true" ]]; then
    echo "🎨 Auto-formatting code..."
    uv run black kicad_sch_api/ tests/ --quiet
    uv run isort kicad_sch_api/ tests/ --quiet
    echo "✅ Code formatted"
fi

# Build pytest arguments
PYTEST_ARGS=""
[[ "$VERBOSE" == "true" ]] && PYTEST_ARGS="$PYTEST_ARGS -v"
[[ "$FAIL_FAST" == "true" ]] && PYTEST_ARGS="$PYTEST_ARGS -x"

# Execute test suite
case $SUITE in
    quick)
        echo "🚀 Running quick test suite..."
        uv run pytest tests/test_component_management.py tests/test_sexpr_parsing.py -q $PYTEST_ARGS
        ;;
        
    standard)
        echo "📋 Running standard test suite..."
        uv run pytest tests/ --tb=short $PYTEST_ARGS
        ;;
        
    full)
        echo "🔬 Running full test suite..."
        
        # Python library tests with coverage
        uv run pytest tests/ --cov=kicad_sch_api --cov-report=term-missing $PYTEST_ARGS || exit 1
        
        # MCP server tests
        if [[ -d "../mcp-server" ]]; then
            echo "🤖 Testing MCP server..."
            cd ../mcp-server
            if [[ -f "package.json" ]]; then
                npm test || echo "⚠️ MCP server tests failed"
            fi
            cd ../python
        fi
        
        # Reference schematic tests
        if [[ -d "tests/reference_kicad_projects" ]]; then
            echo "📋 Testing reference schematics..."
            uv run pytest tests/reference_kicad_projects/ -v $PYTEST_ARGS
        fi
        ;;
        
    coverage)
        echo "📊 Running coverage analysis..."
        uv run pytest tests/ --cov=kicad_sch_api --cov-report=term-missing --cov-report=html --cov-fail-under=70 $PYTEST_ARGS
        echo "📊 Coverage report: htmlcov/index.html"
        ;;
        
    *)
        echo "❌ Unknown suite: $SUITE"
        echo "Available suites: quick, standard, full, coverage"
        exit 1
        ;;
esac

# Cleanup if requested
if [[ "$KEEP_OUTPUTS" == "false" ]]; then
    echo "🧹 Cleaning up test outputs..."
    rm -rf test_outputs/ .pytest_cache/ .coverage htmlcov/ 2>/dev/null || true
fi

echo "✅ Test suite completed"

Read the full file on GitHub · 267 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. 4d ago First seen · 267 lines · 0 tokens per session scan C c0bd7f841099

Subscribe to this mod's changes

run-tests is a command published in the GitHub repository circuit-synth/kicad-sch-api (52 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,733 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.