ki-stack-file-surgery

ki-stack-file-surgery is a skill for Claude Code from Milind220/Ki-Stack. It costs 54 tokens per session (1,183 once invoked), scanned A, original, MIT.

A workflow for making offline, structural edits to KiCad files, which are files used by a circuit-board design tool. It uses a parser to preserve KiCad syntax, formatting, and unfamiliar parts of the file.

In plain words
What is it for?
Use it for deterministic changes to KiCad projects, library tables, design rules, board metadata, and other file-structured data when no live KiCad session is needed.
Why use it?
It reduces the risk of damaging complex design files during repeatable edits and keeps details that a hand-written text change might lose.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions OpenCode.

Good fit Use it for deterministic changes to KiCad projects, library tables, design rules, board metadata, and other file-structured data when no live KiCad session is needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/milind220/ki-stack/ki-stack-file-surgery
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.

Any agent
npx skills add Milind220/Ki-Stack --skill ki-stack-file-surgery
Clone the repo
git clone --depth 1 https://github.com/Milind220/Ki-Stack

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 ki-stack-file-surgery

README.md
[![agentmods](https://agentmods.dev/badge/skills/milind220/ki-stack/ki-stack-file-surgery/github.svg)](https://agentmods.dev/skills/milind220/ki-stack/ki-stack-file-surgery)
Your own site
<a href="https://agentmods.dev/skills/milind220/ki-stack/ki-stack-file-surgery"><img src="https://agentmods.dev/badge/skills/milind220/ki-stack/ki-stack-file-surgery/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 ki-stack-file-surgery

Your own site · 80×15
<a href="https://agentmods.dev/skills/milind220/ki-stack/ki-stack-file-surgery"><img src="https://agentmods.dev/badge/skills/milind220/ki-stack/ki-stack-file-surgery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,183 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00054 $0.01183
Opus 5.5 $0.00022 $0.00473
Sonnet 5.5 $0.00011 $0.00237
Haiku 4.5 $0.00005 $0.00118

Measured 3mo ago against content hash 228df97ee516, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ki-stack-file-surgery 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 3mo 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.

skills/ki-stack/ki-stack-file-surgery/SKILL.md · 193 lines

How it starts

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

ki-stack-file-surgery

Purpose

This skill teaches the agent how to use kiutils-rs for structural KiCad file edits.

It is the canonical ki-stack skill for:

  • offline KiCad file mutation
  • lossless read/modify/write flows
  • project, library table, design rule, and board metadata edits
  • structural transforms where preserving unknown syntax matters

When to use it

Use this skill when:

  • no live KiCad session is needed
  • the edit is inherently file-structural
  • preserving formatting and unknown tokens matters
  • the task is deterministic enough to justify a small Rust transform

Do not use this skill when:

  • the task is naturally a live board automation workflow
  • the task is just rendering or verification
  • the agent only needs a tiny text patch that is not semantically structural

Shared assumptions

  • Prefer kiutils-rs for offline structural changes.
  • Default to lossless output.
  • Inspect before writing custom Rust when possible.
  • Use typed setter/upsert/remove APIs for writeable edits.

Phase 1: Orient

  1. Find the relevant KiCad files:

    skills/ki-stack/bin/kicad-project-find <root>
    
  2. Identify the file type before writing code:

  • .kicad_pcb
  • .kicad_mod
  • .kicad_dru
  • .kicad_pro
  • fp-lib-table
  • sym-lib-table
  1. If the file type is supported by the stable public kiutils-rs API, continue.

  2. If the task actually wants live state or selection-aware behavior, route to ki-stack-live instead.

Phase 2: Inspect

Before writing custom Rust, inspect the file shape.

Preferred command:

skills/ki-stack/bin/kiutils-inspect path/to/file.kicad_pcb --show-unknown --show-diagnostics --show-canonical

Useful flags:

  • --json
  • --show-cst
  • --show-canonical
  • --show-unknown
  • --show-diagnostics

Inspection should tell you whether:

  • the file parses cleanly
  • unknown tokens exist and should be preserved
  • the change should target typed APIs rather than low-level internals

Phase 3: Execute

Read the full file on GitHub · 193 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. 3mo ago First seen · 193 lines · 54 tokens per session scan A 228df97ee516

Subscribe to this mod's changes

ki-stack-file-surgery is a skill published in the GitHub repository Milind220/Ki-Stack (23 stars, last pushed 6mo ago), licensed MIT. It adds 54 tokens to every session and 1,183 once invoked, about $0.0002 per session on Opus 5.5. 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-31.

Related

ki-stack-file-surgery compared with skills from other repositories

ki-stack-file-surgery next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ki-stack-file-surgeryMilind220/Ki-StackSkill236mo agoMITA54Claude Code
kicad-copilotbiosshot/kicad-copilotSkill376d agoMITA42Claude Code, Codex
pcb-analysisbiosshot/kicad-copilotSkill376d agoMITA29Claude Code, Codex
altium-designeralivirgo/Major-AI-SkillsSkill6yesterdayMITA30Claude Code
boardrepoflintt-dev/boardrepo-pluginSkill107d agoMITA156Claude Code
universal-netlistIntelligentElectron/universal-netlistSkill715d agoApache-2.0C101Claude Code
pcb-designAvinash1286/KiCAD-MCP-Server-THEAVISkill21mo agoMITA65Claude Code