make-test

A command that turns a manually checked procedure into an automated pytest test. pytest is a Python testing tool that runs checks and reports whether they pass.

In plain words
What is it for?
Use it to read a manual test, create a pytest file with assertions, compare generated output with reference files, run the test, and add it to the test suite.
Why use it?
It preserves a test you have already verified by hand, so the same behavior can be checked automatically later.

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/circuit-synth/make-test
Clone the repo
git clone --depth 1 https://github.com/circuit-synth/circuit-synth

Made for: Claude Code.

Per session 10 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,497 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00010 $0.02497
Opus 5 $0.00005 $0.01248
Sonnet 5 $0.00002 $0.00499
Haiku 4.5 $0.00001 $0.00250

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

Security

Grade A, and why

make-test scanned grade A 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 2d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
.claude/commands/dev/make-test.md · 356 lines

How it starts

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

Make Test Command

Purpose: Convert validated manual tests into automated pytest tests, leveraging existing reference material.

Usage

/dev:make-test <test-description-or-path>

The Pattern

circuit-synth testing follows this workflow:

  1. Create manual test - Document steps, create reference
  2. Validate manually - Run through steps, verify correctness
  3. Wrap in pytest - Automate the validated manual test
  4. Mark as verified - Update MANUAL_TEST_CHECKLIST.md

This command helps with step 3.

What This Does

  1. Review Manual Test

    • Read manual test README.md
    • Understand test steps
    • Identify reference files
    • Check what's being validated
  2. Create pytest Structure

    • Generate test_*.py file
    • Use existing reference files
    • Follow circuit-synth test patterns
    • Include comprehensive assertions
  3. Implement Test Logic

    • Subprocess calls to run circuit generation
    • Load and compare against reference using kicad-sch-api
    • Assert expected behavior
    • Clean up generated files
  4. Verify Test Works

    • Run the new test
    • Ensure it passes
    • Check coverage
    • Add to test suite

Example: Manual Test → Automated Test

Input: Manual Test

User: /dev:make-test tests/bidirectional/component_crud_root/03_sync_component_root_update_ref/

Agent: [Reads README.md]

Manual test steps:
1. Generate circuit (R1, R2, C1)
2. Change R1 reference to R100 in code
3. Regenerate
4. Verify R1 → R100, positions preserved

Reference files found:
- tests/reference/component-ref-update/circuit.kicad_sch
- comprehensive_root.py (test circuit)

Output: Automated pytest

#!/usr/bin/env python3
"""
Test 12: Update Component Reference (Rename) - Automated

Validates that renaming a component (R1 → R100) preserves ALL other
schematic elements using kicad-sch-api verification.
"""

import pytest
import subprocess
import shutil
from pathlib import Path
from kicad_sch_api import Schematic


def test_12_update_component_ref(request):
    """Test renaming R1 → R100 while preserving R2, C1, power, and labels."""

    test_dir = Path(__file__).parent
    circuit_file = test_dir / "comprehensive_root.py"
    output_dir = test_dir / "comprehensive_root"
    schematic_file = output_dir / "comprehensive_root.kicad_sch"

    cleanup = not request.config.getoption("--keep-output", default=False)

    try:
        # STEP 1: Generate initial circuit with R1
        result = subprocess.run(
            ["uv", "run", str(circuit_file)],
            cwd=test_dir,
            capture_output=True,
            text=True,
            timeout=30
        )
        assert result.returncode == 0, f"Initial generation failed: {result.stderr}"
        assert schematic_file.exists(), "Schematic not generated"

        # Load and verify initial state
        sch = Schematic.load(str(schematic_file))

        regular_components = [c for c in sch.components if not c.reference.startswith("#PWR")]
        assert len(regular_components) == 3

        r1_before = next(c for c in regular_components if c.reference == "R1")
        r2_before = next(c for c in regular_components if c.reference == "R2")
        c1_before = next(c for c in regular_components if c.reference == "C1")

        # Store properties for preservation check
        r1_pos_before = r1_before.position
        r1_value_before = r1_before.value

        # STEP 2: Modify circuit to rename R1 → R100
        original_code = circuit_file.read_text()
        modified_code = original_code.replace('ref="R1"', 'ref="R100"')
        circuit_file.write_text(modified_code)

        # STEP 3: Regenerate circuit
        result = subprocess.run(
            ["uv", "run", str(circuit_file)],
            cwd=test_dir,
            capture_output=True,
            text=True,
            timeout=30
        )
        assert result.returncode == 0, f"Regeneration failed: {result.stderr}"

        # STEP 4: Load and verify
        sch_after = Schematic.load(str(schematic_file))

        regular_components_after = [c for c in sch_after.components if not c.reference.startswith("#PWR")]
        assert len(regular_components_after) == 3, "Component count changed"

        # Verify R1 renamed to R100
        refs = {c.reference for c in regular_components_after}
        assert "R100" in refs, "R100 not found after rename"
        assert "R1" not in refs, "R1 still exists after rename"

        r100 = next(c for c in regular_components_after if c.reference == "R100")

        # Verify R100 properties preserved
        assert r100.value == r1_value_before, "R100 value changed"
        assert r100.position.x == r1_pos_before.x, "R100 X position changed"
        assert r100.position.y == r1_pos_before.y, "R100 Y position changed"

        print("\n✅ Test 12 PASSED: Component rename preserved all properties")

    finally:
        if 'original_code' in locals():
            circuit_file.write_text(original_code)

        if cleanup and output_dir.exists():
            shutil.rmtree(output_dir)


if __name__ == "__main__":
    pytest.main([__file__, "-v", "--keep-output"])

Read the full file on GitHub · 356 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. 2d ago First seen · 356 lines · 10 tokens per session scan A bef82dd12d6a

Subscribe to this mod's changes

make-test is a command published in the GitHub repository circuit-synth/circuit-synth (268 stars, last pushed 5mo ago), licensed MIT. It adds 10 tokens to every session and 2,497 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.