sketchi-code-mode
Use Sketchi Code Mode when creating, editing, styling, or retrieving Sketchi flowchart, mindmap, or sequence diagrams through the Sketchi MCP server.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use Sketchi Code Mode when creating, editing, styling, or retrieving Sketchi flowchart, mindmap, or sequence diagrams through the Sketchi MCP server.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | sketchi-code-mode |
| description | Use Sketchi Code Mode when creating, editing, styling, or retrieving Sketchi flowchart, mindmap, or sequence diagrams through the Sketchi MCP server. |
| allowed-tools | ["mcp__plugin_sketchi-code-mode-claude_sketchi-code-mode__docs","mcp__plugin_sketchi-code-mode-claude_sketchi-code-mode__search","mcp__plugin_sketchi-code-mode-claude_sketchi-code-mode__execute"] |
Use the bundled sketchi-code-mode MCP server for Sketchi diagrams instead of raw Excalidraw or ad hoc JSON edits. This follows the Code Mode pattern: call one execute tool with generated JavaScript, and use typed host tools exposed inside the sandbox as sketchi.*.
docs or search first when you need the current contract for graph input, patch input, artifact retrieval, or supported style fields.execute with an async JavaScript arrow function expression.sketchi.buildFlowchart(input) for process graphs, sketchi.buildMindmap(input) for nested topic hierarchies, or sketchi.buildSequenceDiagram(input) for chronological participant interactions.sketchi.applyDiagramPatch(input).sketchi.getArtifact(input) when you need raw Excalidraw/PNG metadata; do not fetch scene just to summarize the diagram.Sketchi artifact ready., paste that first text block as the final chat response and stop.artifactDelivery.finalResponseText, paste that text as the final chat response and stop.async () => {
const built = await sketchi.buildFlowchart({
spec: {
title: "Approval flow",
nodes: [
{ id: "request", label: "Request", kind: "start" },
{ id: "approved", label: "Approved?", kind: "decision" },
{ id: "done", label: "Done", kind: "end" },
{ id: "revise", label: "Revise", kind: "end" },
],
edges: [
{ source: "request", target: "approved" },
{ source: "approved", target: "done", label: "yes" },
{ source: "approved", target: "revise", label: "no" },
],
layout: { direction: "TB" },
},
options: {
artifactFormats: ["scene", "excalidraw", "png"],
inlineArtifacts: ["excalidraw"],
},
});
if (!built.ok) return built;
const patched = await sketchi.applyDiagramPatch({
source: { artifactId: built.artifact.artifactId },
intent: "Make the decision node a purple diamond.",
operations: [
{
op: "setStyle",
selector: { nodeIds: ["approved"] },
style: { strokeColor: "#7c3aed", fillColor: "#ede9fe" },
},
{
op: "setShape",
selector: { nodeIds: ["approved"] },
shape: "diamond",
},
],
options: {
artifactFormats: ["scene", "excalidraw", "png"],
inlineArtifacts: ["scene", "excalidraw"],
},
});
if (!patched.ok) return patched;
const excalidraw = await sketchi.getArtifact({
artifactId: patched.artifact.artifactId,
format: "excalidraw",
inline: false,
});
const png = await sketchi.getArtifact({
artifactId: patched.artifact.artifactId,
format: "png",
inline: false,
});
return {
ok: true,
artifactId: patched.artifact.artifactId,
diagramId: patched.artifact.diagramId,
formats: patched.artifact.formats,
excalidraw,
png,
};
}
To view the artifact bytes after execute returns metadata, fetch:
https://playground.sketchi.app/api/v1/artifacts/<artifactId>?format=excalidraw&raw=true
https://playground.sketchi.app/api/v1/artifacts/<artifactId>?format=png&raw=true
arrow_overlap, keep the semantic graph intact unless the structure is actually wrong. Retry with rerouteEdges or report the artifact evidence rather than contorting the workflow solely for layout.async () => { ... } is canonical; outer markdown fences and a trailing semicolon are tolerated by the server, but omit them in generated code.sketchi.getArtifact({ format: "scene" }) just to create a local summary or wrapper. scene is only for patching/debugging, and the accepted artifact bundle is already the deliverable.artifactDelivery.finalResponseText, paste that string as the final response instead of digging through nested inline scene or Excalidraw JSON.artifactFormats: ["scene", "excalidraw", "png"] when visual proof matters. Excalidraw is importable JSON; PNG is hosted binary evidence. sketchi.getArtifact({ format: "excalidraw" | "png", inline: false }) returns metadata with raw Studio API URLs.execute.Use Sketchi Code Mode when creating, editing, styling, or retrieving Sketchi flowchart, mindmap, or sequence diagrams through the Sketchi MCP server.
Use when the user asks for sketchi-code-mode, Sketchi MCP, Sketchi Code Mode, or a Sketchi/Excalidraw diagram through MCP tools.
Analyze Sketchi playground Cloudflare AI Gateway logs for prompt tuning, Gemini flowchart IR reliability, retained request/response payloads, and scenario regression evidence. Use when inspecting google-ai-studio Gateway logs, validating generated Sketchi IR, or turning model failures into scenario or prompt changes.