@geohar/opencode-svg-mcp 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/instructions.txt +36 -14
  2. package/package.json +1 -1
package/instructions.txt CHANGED
@@ -1,16 +1,38 @@
1
1
  # Diagrams & SVGs (svg-mcp)
2
2
 
3
- - **Author diagrams and SVGs with the svg-mcp MCP tools, not by hand-writing XML.**
4
- When you need a diagram, chart, icon, logo, or any SVG, build it through the tools —
5
- `create_document`, the `add_*` primitives (`add_rect`, `add_path`, `add_text`, …),
6
- `boolean` for path union/difference/intersection, gradients/filters/transforms — and
7
- **render and look**: `export_render` (or `render_document`) to see the result, then
8
- iterate. This construct → render → see → iterate loop is the point of svg-mcp.
9
- - **Share the live preview URL early, unprompted.** For anything beyond a couple of tool calls,
10
- call `start_preview` at the start and put the exact URL it returns in your reply ("Live
11
- preview: <url> — it refreshes on every change"). The user watching the drawing take shape can
12
- redirect you mid-build instead of waiting for a finished result they may not want.
13
- - **Edit existing SVGs through the tools too** — `import_svg` to load, `find` /
14
- `describe_node` to locate nodes, then `edit_*` / `apply_*` / `delete_node` to change
15
- them. Prefer this over textually patching raw `<svg>` markup, which is error-prone and
16
- skips the visual feedback loop.
3
+ <!-- Canonical reach-for-svg-mcp directive. Copy into your global
4
+ $CLAUDE_CONFIG_DIR/CLAUDE.md, or let an svg-mcp plugin inject it each session
5
+ (the plugins symlink this file). It directs *approach*; the MCP tool
6
+ descriptions carry the mechanics. -->
7
+
8
+ Two rules. Each fires on a **cue you can catch yourself in the middle of**, not on a
9
+ topic you have to remember to think about. That's deliberate: you will not remember to
10
+ "use the tools" — but you can notice yourself about to type a `<` .
11
+
12
+ ### 1. About to write `<svg`, or hand-edit XML inside one? That's the cue.
13
+
14
+ Writing markup by hand is the wrong move **even when the shape looks trivial** — that's
15
+ exactly when it feels justified, and it skips the only part that matters: seeing the
16
+ result. At that exact moment:
17
+
18
+ | your next move was | do this instead |
19
+ |---|---|
20
+ | write `<svg>`/`<path>`/`<rect>` markup for something new | `create_document`, then the `add_*` primitives — `boolean` for union/difference/intersection, plus gradients / filters / transforms |
21
+ | hand-patch the markup of an SVG you have | `import_svg` → `find` / `describe_node` to locate → `edit_*` / `apply_*` / `delete_node` |
22
+ | hand a result back after building it | `export_render` (or `render_document`) and **actually look at the image** first |
23
+
24
+ Construct → render → see → iterate. **The loop is the product, not the XML.** One pass
25
+ without rendering isn't a faster version of this — it's a different, worse thing.
26
+
27
+ **Catch yourself:** if you're about to show or save SVG source you have never rendered,
28
+ you are guessing at your own output. Render it, look, *then* hand it over.
29
+
30
+ ### 2. More than a couple of tool calls? Start the preview and say so.
31
+
32
+ Cue: you can tell the build will take more than two or three calls. Call `start_preview`
33
+ **at the start**, not when you're done, and put the exact URL in your reply unprompted:
34
+ "Live preview: <url> — it refreshes on every change."
35
+
36
+ The reason is timing, not courtesy. Someone watching the drawing take shape can redirect
37
+ you mid-build; the same person handed a finished image can only accept it or ask for the
38
+ whole thing again. A preview URL shared at the end has none of that value.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geohar/opencode-svg-mcp",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "OpenCode plugin: run the svg-mcp MCP server via sharedserver and register its endpoint with OpenCode. Stands down when a combiner already serves svg-mcp.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",