---
title: "CircuitKit"
description: "Create circuit diagrams with a local CLI and agent skill. Export SVG and PNG from explicit connections."
canonical_url: "https://circuitkit.crafter.ing/editor"
last_updated: 2018-10-20
---

# Circuit playground

Use the browser page with Accept: text/html for the interactive interface. To create a circuit directly from your agent, use the local CLI workflow below.

# CircuitKit

> Create circuit diagrams with your coding agent or the local CLI. Export SVG and PNG from explicit connections.

Describe modules, ports and connections in a text file. CircuitKit arranges them into blocks, wiring or modular schematics and exports SVG or PNG. Rendering runs locally. The project is licensed under Apache-2.0.

## Copy a setup prompt

Paste this prompt into your coding agent, then describe what you want to draw. It asks the agent to install the package and skill, load the versioned guide, and show the first image using the available environment.

```text
Set up CircuitKit in this workspace and turn my circuit idea into a real image. Do the work, not just an installation tutorial.

1. Check that Node.js 20+ is available, then install circuitkit@latest locally with this project's package manager: bun add circuitkit@latest for Bun, or npm install circuitkit@latest for npm. Ask before changing an existing pinned version. Respect installation approvals and security policies, including package-age restrictions. Do not install globally or bypass a blocked install.

2. Install the evergreen CircuitKit skill for this agent, at project scope. For Codex use: npx --yes skills add crafter-lab/circuitkit --skill circuitkit --agent codex --yes. For Claude Code replace codex with claude-code; for other agents check the supported agent id first. In Bun projects use bunx skills instead of npx --yes skills. Do not install it for unrelated agents.

3. Load the installed skill, then run the project-local CircuitKit CLI with skills get core --text and read the entire guide. Use skills list --json and load specialized guides only as needed. If the agent cannot activate a newly installed skill until restart, read its SKILL.md and the CLI guide directly for this conversation; do not claim it was activated automatically.

4. Use the circuit idea I already gave you. If I have not provided one, ask only: "What would you like to draw?" Do not make me write source or run commands. Default to a wiring view unless my request calls for blocks or a schematic. Ask for missing details only when they are necessary to avoid inventing connections. Clearly label a conceptual diagram; never invent board pins, regulation, power wiring or electrical-safety claims.

5. Write an editable .ck source, validate it with the CLI, fix diagnostics, and render both SVG and a PNG preview. Use fresh output paths in the workspace and keep the source beside the images. Do not overwrite existing files without permission. Render with CircuitKit, not ASCII or a hand-drawn substitute.

6. Show the actual preview immediately. In a desktop agent or chat UI with inline image support, attach or render the PNG in this conversation, not just an agent-only inspection or a text link. In a terminal environment with a graphical desktop, open the generated PNG in a separate image-viewer window: use open on macOS, xdg-open on Linux, or Invoke-Item -LiteralPath in Windows PowerShell, with the actual output path safely quoted. A desktop UI without inline support can use the external viewer too. In headless or SSH environments without a graphical display, do not attempt GUI launchers: provide usable artifact links or absolute file paths and explain the limitation. Never claim the image was shown or opened unless that action succeeded.

Keep the final response short: preview first, then links to the PNG, SVG and editable source, any important assumptions, and ask what I would like to change. No simulation or animated-export claims.
```

## Manual skill installation

```sh
npx skills add crafter-lab/circuitkit --skill circuitkit
```

The repository skill is a small discovery stub. The actual instructions ship with each CLI release.

## Install and discover the CLI

Node.js 20 or newer is required. Use npx without a global install, or add circuitkit to the project:

```sh
npm install circuitkit
npx circuitkit skills get core --text
npx circuitkit skills list --json
```

For a Bun project use bun add circuitkit and bunx circuitkit. Do not silently upgrade a project's pinned version.

## Write, explain, ship

Save this conceptual signal-only example as sensor.ck. It is not a complete power circuit or a specific hardware design.

```text
circuit sensor v1
title "Sensor signal connections"
Controller: controller (SDA SCL)
Sensor: sensor (SDA SCL)
bus I2C {
  Controller.SDA <-> Sensor.SDA "Data"
  Controller.SCL -> Sensor.SCL "Clock"
}
```

```sh
npx circuitkit validate sensor.ck --json
npx circuitkit render sensor.ck --view wiring --out sensor.svg --json
npx circuitkit render sensor.ck --view schematic --format png --out sensor.png --json
```

Render success reports an absolute output path. Show the PNG with the host agent's image viewer or link the SVG and editable source. Existing output files are refused unless overwrite is explicitly authorized. JSON errors include source diagnostics; fix those before retrying.

Named scenes select existing modules and connections without moving parts or changing connectivity. Animated flow is illustrative and available in the web playground; exported SVG/PNG stay static. Speed is visual, not an electrical measurement. Markdown fences are supported by the CLI, not a required separate workspace.

## Scope

CircuitKit draws declared connectivity. It does not simulate voltages or currents, verify electrical safety or produce fabrication files. Do not invent board pins, regulation, hidden passives, missing power wiring or assume that speaker minus is ground. A boundary marker is not hardware. Educational author models require explicit trusted-host projection; hiding answers with CSS does not protect them.

## Reference

- [Agent quickstart](https://circuitkit.crafter.ing/docs/core): The same core guide shipped in the CLI.
- [Circuit language](https://circuitkit.crafter.ing/docs/language): Syntax, definitions, scope and budgets.
- [Presentation](https://circuitkit.crafter.ing/docs/presentation): Sections, scenes and illustrative flow.
- [CLI contract](https://circuitkit.crafter.ing/docs/cli): Structured output, refusal paths and atomic files.
- [Playground](https://circuitkit.crafter.ing/editor?mode=circuitkit): Edit source and preview locally in the browser.
- [GitHub](https://github.com/crafter-lab/circuitkit): Source, examples and issues.
- [npm](https://www.npmjs.com/package/circuitkit): CLI and library package.
