| name | sketchi-code-mode |
| description | Use when the user asks for sketchi-code-mode, Sketchi MCP, Sketchi Code Mode, or a Sketchi/Excalidraw diagram through MCP tools. |
Sketchi Code Mode
When the user asks to use sketchi-code-mode, use the configured MCP server tools. Do not replace the MCP flow with local repo scripts, in-process test harnesses, raw Mermaid, hand-written Excalidraw JSON, or Markdown reports.
Required Flow
- If syntax is unclear, call
sketchi-code-mode/docs or sketchi-code-mode/search.
- Call
sketchi-code-mode/execute with an async JavaScript arrow function.
- Inside the function, use
sketchi.buildFlowchart for process graphs, sketchi.buildMindmap for nested topic hierarchies, or sketchi.buildSequenceDiagram for chronological participant interactions, then sketchi.applyDiagramPatch only for styling or supported visual edits.
- Request user-facing artifacts:
options: {
artifactFormats: ["scene", "excalidraw", "png"],
inlineArtifacts: ["excalidraw"],
}
- If the MCP text content begins with
Sketchi artifact ready., paste that first text block as the final chat response and stop.
- If the execute result contains
artifactDelivery.finalResponseText, paste that text as the final chat response and stop.
- Otherwise return the accepted Sketchi artifact id, diagram id, artifact format refs, and the Excalidraw/PNG raw URLs directly in the chat response.
Guardrails
- Do not create or edit repo files unless the user explicitly asks for files.
- Do not create local wrapper files, inspect nested inline Excalidraw JSON, or create an alternate Markdown/Mermaid artifact after Sketchi accepts an artifact. The final chat response with the Sketchi artifact IDs and URLs is the deliverable.
- Do not write a Markdown/Mermaid summary as the deliverable after Sketchi accepts an artifact.
- Do not call
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.
scene is for patching and debugging only. excalidraw and png are the user-facing outputs.
- If local repo context is needed, inspect files only to understand the graph, then send the final graph to the MCP execute tool.
- For vague repo/system architecture prompts, summarize into a readable 8-14 node flowchart. Prefer a mostly monotonic spine with short side branches; group related packages/systems into layers instead of drawing every transitive dependency edge.
- Choose by the relationship being communicated: flowcharts for process paths and decisions, mind maps for topic hierarchy, and sequence diagrams for ordered messages between participants.
- Do not prompt the user to authenticate to Sketchi or add credentials. The deployed MCP endpoint is public.
- Do not install or require a local browser. The deployed Studio Worker renders PNG artifacts through Cloudflare Browser Run.
- If PNG export fails with a hosted renderer error, retry the hosted MCP request once. If it still fails, return the Excalidraw URL and clearly say PNG export is unavailable. Do not fall back to local rendering or remove PNG silently.