KiCAD-Schematic-Manipulation: Command for Claude Code

.claude/commands/dev/run-tests.md

run-tests is a command for Claude Code from richard-luc/KiCAD-Schematic-Manipulation. It costs 0 tokens per session (1,263 once invoked), scanned C, a copy of run-tests, MIT.

A command for running tests on an MCP server that connects to KiCad, a program for designing electronic circuits. It supports quick, standard, integration, and coverage test suites.

In plain words
What is it for?
Use it to run fast development checks, the full test set, tests with real KiCad files, detailed output, coverage reports, or tests that stop after the first failure.
Why use it?
It gathers the relevant test commands and options in one place, so you do not need to remember which checks validate the server or its KiCad integration.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

This is richard-luc/KiCAD-Schematic-Manipulation's own configuration. It tells Claude Code how to work on KiCAD-Schematic-Manipulation itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything KiCAD-Schematic-Manipulation configures →

Reuse

Borrowing it

Nothing to install: this file belongs to richard-luc/KiCAD-Schematic-Manipulation. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/richard-luc/KiCAD-Schematic-Manipulation/main/.claude/commands/dev/run-tests.md
Clone the repo
git clone --depth 1 https://github.com/richard-luc/KiCAD-Schematic-Manipulation

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/richard-luc/kicad-schematic-manipulation/run-tests/github.svg)](https://agentmods.dev/commands/richard-luc/kicad-schematic-manipulation/run-tests)
Your own site
<a href="https://agentmods.dev/commands/richard-luc/kicad-schematic-manipulation/run-tests"><img src="https://agentmods.dev/badge/commands/richard-luc/kicad-schematic-manipulation/run-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 run-tests

Your own site · 80×15
<a href="https://agentmods.dev/commands/richard-luc/kicad-schematic-manipulation/run-tests"><img src="https://agentmods.dev/badge/commands/richard-luc/kicad-schematic-manipulation/run-tests.svg" alt="Reviewed on agentmods" width="80" 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,263 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod 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.00000 $0.01263
Opus 5 $0.00000 $0.00632
Sonnet 5 $0.00000 $0.00253
Haiku 4.5 $0.00000 $0.00126

Measured 8d ago against content hash 6a54b0b35199, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 8d 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 .pytest_cache/ .coverage htmlcov/ test_*.kicad_sch 2>/dev/null || true
Origin

This is a copy

100% identical to run-tests — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/dev/run-tests.md · 214 lines

How it starts

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

Test Runner Command - MCP KiCAD Schematic API

Usage

/run-tests [options]

Description

Orchestrates comprehensive testing for the MCP KiCAD Schematic API server, covering all MCP tools and KiCAD integration with professional test reporting.

Options

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

Test Suites

🚀 Quick Suite (~5 seconds)

Fast development testing:

pytest tests/test_server.py -q

📋 Standard Suite - Default (~15 seconds)

Comprehensive MCP server functionality:

# Run all tests
pytest tests/ -v --tb=short

🔬 Integration Suite (~30 seconds)

Complete validation with real KiCAD files:

# Integration tests with kicad-sch-api
pytest tests/test_mcp_server_integration.py -v

# Test MCP tool workflows
pytest tests/ -v -k "integration"

📊 Coverage Suite (~20 seconds)

Detailed coverage analysis:

pytest tests/ --cov=mcp_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
FAIL_FAST=false

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

# Ensure we're in project root
if [[ ! -f "pyproject.toml" ]]; then
    echo "❌ Must run from KiCAD-Schematic-Manipulation root"
    exit 1
fi

# Install dependencies if needed
if [[ "$SKIP_INSTALL" == "false" ]]; then
    echo "📦 Installing dependencies..."
    pip install -e . --quiet
    pip install -e submodules/kicad-sch-api --quiet
    pip install pytest pytest-cov --quiet
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..."
        pytest tests/test_server.py -q $PYTEST_ARGS
        ;;
        
    standard)
        echo "📋 Running standard test suite..."
        pytest tests/ --tb=short $PYTEST_ARGS
        ;;
        
    integration)
        echo "🔬 Running integration test suite..."
        
        # MCP server integration tests
        pytest tests/test_mcp_server_integration.py -v $PYTEST_ARGS || exit 1
        
        # All integration workflows
        pytest tests/ -v -k "integration" $PYTEST_ARGS
        ;;
        
    coverage)
        echo "📊 Running coverage analysis..."
        pytest tests/ --cov=mcp_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, integration, coverage"
        exit 1
        ;;
esac

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

echo "✅ Test suite completed"

Read the full file on GitHub · 214 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. 8d ago First seen · 214 lines · 0 tokens per session scan C 6a54b0b35199

Subscribe to this mod's changes

run-tests is a command published in the GitHub repository richard-luc/KiCAD-Schematic-Manipulation (0 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,263 tokens. A static security scan graded it C with 1 finding (recursive force delete). It is 100% identical to run-tests, differing in 2 lines, and is treated as a copy.