run-reference-tests

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

A command for testing KiCad schematic projects. KiCad is software for drawing electronic circuit diagrams, and these tests check whether the library can read, edit, and preserve different schematic elements.

In plain words
What is it for?
Run tests for a selected reference project, create missing test files, validate saved-file formatting, and include performance checks.
Why use it?
It helps find parsing, editing, formatting, and performance problems across many example projects instead of checking only one schematic.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/circuit-synth/kicad-sch-api/run-reference-tests.svg)](https://agentmods.dev/commands/circuit-synth/kicad-sch-api/run-reference-tests)
Your own site
<a href="https://agentmods.dev/commands/circuit-synth/kicad-sch-api/run-reference-tests"><img src="https://agentmods.dev/badge/commands/circuit-synth/kicad-sch-api/run-reference-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 2,194 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.00000 $0.02194
Opus 5 $0.00000 $0.01097
Sonnet 5 $0.00000 $0.00439
Haiku 4.5 $0.00000 $0.00219

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

Security

Grade A, and why

run-reference-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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/commands/test/run-reference-tests.md · 303 lines

How it starts

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

Reference Schematic Tests Command - kicad-sch-api

Usage

/run-reference-tests [project-name]

Description

Runs comprehensive tests against reference KiCAD schematic projects to validate parsing, manipulation, and format preservation across all schematic element types.

Parameters

  • project-name (optional): Specific reference project to test (e.g., "02_multiple_passive_components")
  • --create-missing: Create test files for reference projects that don't have tests yet
  • --format-validation: Focus on format preservation testing
  • --performance: Include performance benchmarking

Reference Project Structure

tests/reference_kicad_projects/
├── README.md                           # Project checklist and status
├── 01_simple_resistor/                 # ✅ Basic component
│   ├── simple_resistor.kicad_sch
│   └── test_simple_resistor.py
├── 02_multiple_passive_components/     # 🔲 Component variety  
│   ├── multiple_passives.kicad_sch
│   └── test_multiple_passives.py
├── 04_label_types/                     # 🔲 All label types
│   ├── label_types.kicad_sch
│   └── test_label_types.py
└── [... 25 more reference projects]

Implementation

#!/bin/bash

# Parse arguments
PROJECT_NAME=""
CREATE_MISSING=false
FORMAT_VALIDATION=false
PERFORMANCE=false

while [[ $# -gt 0 ]]; do
    case $1 in
        --create-missing)
            CREATE_MISSING=true
            shift
            ;;
        --format-validation)
            FORMAT_VALIDATION=true
            shift
            ;;
        --performance)
            PERFORMANCE=true
            shift
            ;;
        -*)
            echo "Unknown option: $1"
            exit 1
            ;;
        *)
            PROJECT_NAME="$1"
            shift
            ;;
    esac
done

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

if [[ -n "$PROJECT_NAME" ]]; then
    # Test specific project
    if [[ ! -d "$PROJECT_NAME" ]]; then
        echo "❌ Reference project not found: $PROJECT_NAME"
        echo "Available projects:"
        ls -1 | grep -E '^[0-9]+_' | head -10
        exit 1
    fi
    
    echo "🧪 Testing reference project: $PROJECT_NAME"
    
    # Run project-specific tests
    if [[ -f "$PROJECT_NAME/test_${PROJECT_NAME}.py" ]]; then
        cd ../../..  # Back to python directory
        uv run pytest "tests/reference_kicad_projects/$PROJECT_NAME/" -v
    else
        echo "⚠️ No test file found for $PROJECT_NAME"
        if [[ "$CREATE_MISSING" == "true" ]]; then
            echo "🔧 Creating test template..."
            # Create test template (implementation below)
        fi
    fi
else
    # Test all reference projects
    echo "🧪 Testing all reference schematic projects..."
    
    cd ../../..  # Back to python directory
    
    # Run all reference tests
    if [[ "$FORMAT_VALIDATION" == "true" ]]; then
        uv run pytest tests/reference_kicad_projects/ -v -k "format_preservation"
    elif [[ "$PERFORMANCE" == "true" ]]; then
        uv run pytest tests/reference_kicad_projects/ -v -k "performance"
    else
        uv run pytest tests/reference_kicad_projects/ -v
    fi
fi

Read the full file on GitHub · 303 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 · 303 lines · 0 tokens per session scan A 3d76154799af

Subscribe to this mod's changes

run-reference-tests is a command published in the GitHub repository circuit-synth/kicad-sch-api (51 stars, last pushed 9mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,194 tokens. 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.