Skip to content

Agent skill for the viewer MCP tools (#14) - #105

Merged
Gherkin merged 2 commits into
agent-mcpfrom
agent-skill
Oct 11, 2026
Merged

Gherkin merged 2 commits into
agent-mcpfrom
agent-skill

Conversation

@Gherkin

@Gherkin Gherkin commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Closes #14. Part of #73.

Adds skills/pcb-viewer/SKILL.md, a Claude Code skill that tells an agent how to use the viewer MCP tools, and a README section on how to install it.

The skill says to:

  • take net and pin names from the netlist MCP and use them as written (+3.3V on netdaq); match pads to REFDES:PIN with pin where the board has it;
  • use nearest first; read testpoint, type, own, covered_by, side and distance as the tools define them; prefer a test point or through-hole pad when it is about as close;
  • use nearest_vias only when no usable pad is near, and say a via is a last resort and likely under soldermask;
  • give only links made by link, with a marker on a single pad or via; ask for the board list address when link warns that none is set;
  • check a link with snapshot when it matters.

Format checked against https://code.claude.com/docs/en/skills: folder with SKILL.md, YAML frontmatter with name and description, description says when to use it, body well under 500 lines.

End-to-end test: static site built from tests/fixtures/netdaq-small.json, server in stdio mode, an MCP client script, and the netlist MCP. Question: "Is there a point where I can patch +3.3V close to U24?" Netlist: U24:4 (V+) is on +3.3V. nearest gave U24 pad 4 (own, SMD, TSSOP lead, F) at 0; the next pads on the trimmed board are 43 mm away. nearest_vias has a through via 0.85 mm away. link with a marker on U24:4 and focus on U24; snapshot showed the marker on pin 4. Testing showed that zoom: "selected" with +3.3V selected zooms out to most of the board, so the skill now says to focus the part instead.

Tests: mcp npm test passes (HTTP and stdio). Playwright: 105 passed, 1 failed (interaction.spec.js "an inner layer checkbox changes both sides", the known flake); that file alone then passed 46/46.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FzHC7LspikUyimHw5ptN8x

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzHC7LspikUyimHw5ptN8x
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-11 17:20 UTC

@Gherkin

Gherkin commented Oct 11, 2026

Copy link
Copy Markdown
Owner Author

Review round 1 (/code-review and a line-by-line check of the skill against mcp/src/tools/*.js).

Findings:

  1. skills/pcb-viewer/SKILL.md:100: the snapshot fallback covers only "not set up" and "busy". snapshot also fails with no browser, no sandbox, timeouts and "cannot open the viewer" (mcp/src/browser.js:150-173). Fix: on any snapshot error, give the link and say it was not checked.
  2. skills/pcb-viewer/SKILL.md:83: "focus the part (comp:U24)" reads as the near part. selectFootprint zooms to that footprint only (web/app.js:915-921), so a marker on another part's pad can end up out of view. Fix: focus the pad's own part (its ref).
  3. skills/pcb-viewer/SKILL.md:79-81,92: the skill says to select the net with a via marker, but link fails on a net with no pads (mcp/src/tools/link.js:155). Fix: on that error, leave out nets and keep the marker.
  4. skills/pcb-viewer/SKILL.md:54-55: "Through-hole pads can be reached from both sides" is too broad. When one side is covered, reach() gives only the free side (mcp/src/near.js:82-88). Fix: trust side.
  5. README.md:270-272: running ln -s after the cp step makes a nested pcb-viewer/pcb-viewer link, and the old copy still loads. Fix: present the link as an alternative to the copy.
  6. skills/pcb-viewer/SKILL.md:33-34: a generic skill names one board ("On netdaq ..."). Fix: give it as an example.
  7. skills/pcb-viewer/SKILL.md:14: "no pcb-viewer tools" assumes the server name. The user picks that name in claude mcp add. Fix: check for the tool names.
  8. skills/pcb-viewer/SKILL.md:68-72: a Markdown glitch. "Vias under the near part..." joins the last bullet. "likely covered" is also stronger than the tool's "often covered" (nearest_vias.js:10-13). Fix: add a blank line and say "often".

Not fixing:

  • skills/pcb-viewer/SKILL.md:57-58: "Own pads under a BGA or QFN body ... do not offer those". code-review says QFN edge pads often have a toe you can solder to. The line is about pads under the body, and it matches the tool's own warning. Whether QFN edge pads count is a hardware call, so I leave it.

Checked, no issue: frontmatter (name, a 366-char description, well under the 1,536-char listing cap); the cp and ln install commands, run into a mktemp HOME; every tool, input and output field named in the skill exists with that meaning.

- Any snapshot error: give the link and say it was not checked.
- Focus the pad's own part, not the near part; frame a via with a view.
- A net with no pads: leave it out of nets and keep the via marker.
- Through-hole side: trust the side field.
- Look for the tools by name, not by server name.
- A generic rail-name example instead of one board.
- Vias are "often" covered, as the tool says; fix the list formatting.
- README: the link is an alternative to the copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FzHC7LspikUyimHw5ptN8x
@Gherkin
Gherkin merged commit 50898a0 into agent-mcp Oct 11, 2026
10 checks passed
@Gherkin
Gherkin deleted the agent-skill branch October 11, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant