@geohar/opencode-svg-mcp 0.4.4 → 0.5.0
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.
- package/instructions.txt +20 -2
- package/package.json +1 -1
package/instructions.txt
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
(the plugins symlink this file). It directs *approach*; the MCP tool
|
|
6
6
|
descriptions carry the mechanics. -->
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Three rules. Each fires on a **cue you can catch yourself in the middle of**, not on a
|
|
9
9
|
topic you have to remember to think about. That's deliberate: you will not remember to
|
|
10
10
|
"use the tools" — but you can notice yourself about to type a `<` .
|
|
11
11
|
|
|
@@ -27,7 +27,25 @@ without rendering isn't a faster version of this — it's a different, worse thi
|
|
|
27
27
|
**Catch yourself:** if you're about to show or save SVG source you have never rendered,
|
|
28
28
|
you are guessing at your own output. Render it, look, *then* hand it over.
|
|
29
29
|
|
|
30
|
-
### 2.
|
|
30
|
+
### 2. About to place boxes, arrows, bars, or rows by coordinate? Declare, don't draw.
|
|
31
|
+
|
|
32
|
+
Hand-computing positions for structured content is the diagram version of hand-writing
|
|
33
|
+
markup — it feels precise and produces drift, overlaps, and arrows through boxes. The
|
|
34
|
+
cue is reaching for `add_rect` + `add_line` to represent *things and relationships*:
|
|
35
|
+
|
|
36
|
+
| you're about to | do this instead |
|
|
37
|
+
|---|---|
|
|
38
|
+
| draw an architecture / flowchart / pipeline from rects and lines | `add_diagram_node(kind, label)` + `add_diagram_edge(source, target, kind)` + `add_diagram_container(members)`, then `layout_diagram` — zero coordinates |
|
|
39
|
+
| hand-place bars, axes, tick labels (or shell out to matplotlib for a small figure) | `add_chart(kind, data)` — bar/line/donut/scatter/sparkline, scales and margins derived from the data |
|
|
40
|
+
| lay out rows of text as a grid | `add_table(rows, header)` — column widths measured, numerics right-aligned |
|
|
41
|
+
| pick colors and fonts shape by shape | `load_theme` first and say what things ARE (`role=`, `kind=`); the theme paints them. Read the guidance the load returns — it's the house style speaking |
|
|
42
|
+
| annotate or key the result | `add_callout(target, text)` (points at ids, survives reflow), `add_legend()` (generated from what the document uses) |
|
|
43
|
+
|
|
44
|
+
After moving, resizing, or deleting diagram nodes: **`reflow()`** — one call re-routes
|
|
45
|
+
edges, re-anchors callouts, and re-fits containers. Layout is opt-in; it never reruns
|
|
46
|
+
behind your back.
|
|
47
|
+
|
|
48
|
+
### 3. More than a couple of tool calls? Start the preview and say so.
|
|
31
49
|
|
|
32
50
|
Cue: you can tell the build will take more than two or three calls. Call `start_preview`
|
|
33
51
|
**at the start**, not when you're done, and put the exact URL in your reply unprompted:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geohar/opencode-svg-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
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",
|