Debug Connection logo

Debug Connection

Community
jiaxiaojunQAQ
debug-connection

Debug WebSocket connection issues between CLI and FigJam plugin. Use when diagrams aren't syncing or connection fails.

Overview

PublisherjiaxiaojunQAQ
RepositorySkillJect
Skill namedebug-connection
Stars
79
Forks
8
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jiaxiaojunQAQ on GitHub. Read the source before you install it.

Installation

Install the Debug Connection AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jiaxiaojunQAQ/SkillJect.git /tmp/SkillJect
mkdir -p .claude/skills
cp -r /tmp/SkillJect/data/skills_sample/debug-connection .claude/skills/debug-connection
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Debug Connection in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Debug Connection on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Debug Connection is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

WebSocket Connection Debugging

Architecture

┌─────────────┐     WebSocket      ┌─────────────────┐    postMessage    ┌─────────────────┐
│  CLI serve  │ ◄───────────────► │  Plugin UI      │ ◄───────────────► │  Plugin Main    │
│  (Bun)      │   ws://...:3456   │  (ui.ts)        │                   │  (code.ts)      │
└─────────────┘                   └─────────────────┘                   └─────────────────┘
     │                                   │                                     │
     │ File watcher                      │ Browser APIs                        │ Figma API
     │ YAML parsing                      │ WebSocket client                    │ Canvas rendering
     └───────────────────────────────────┴─────────────────────────────────────┘

Common Issues & Solutions

1. Connection Refused

Symptoms: Plugin shows "Connecting..." indefinitely

Check:

bash
# Is CLI serve running?
ps aux | grep "figram serve"

# Check port availability (default: 3456)
lsof -i :3456

Solution: Start CLI with bun run packages/cli/src/index.ts serve diagram.yaml

2. Connection Drops

Symptoms: Works initially, then stops syncing

Check:

  • Plugin UI console for WebSocket close events
  • CLI terminal for error messages

Solution: Check for YAML parse errors blocking updates

3. Patches Not Applied

Symptoms: Connected but canvas doesn't update

Debug steps:

  1. Check CLI output for patch generation
  2. Check Plugin UI console for received messages
  3. Check Plugin Main console for rendering errors

4. YAML Parse Errors

Symptoms: CLI shows validation errors

Solution: Validate YAML syntax and schema compliance

5. Secret Mismatch

Symptoms: Connection established but immediately closed

Check: Ensure --secret flag value matches between CLI and plugin

6. JSON Import Errors

Symptoms: Import dialog shows an error alert

Check:

  • JSON must be an object
  • DSL JSON requires version, docId, and nodes array
  • IR JSON requires version, docId, and nodes object

Solution: Fix validation errors shown in the alert (path + message)

Debugging Tools

CLI Side

bash
# Run with verbose output
DEBUG=* bun run packages/cli/src/index.ts serve diagram.yaml

# Specify custom port
bun run packages/cli/src/index.ts serve diagram.yaml --port 8080

# With authentication
bun run packages/cli/src/index.ts serve diagram.yaml --secret mysecret

Plugin UI Side

  1. Right-click plugin UI → Inspect
  2. Check Console for WebSocket events
  3. Check Network tab for WS frames

Plugin Main Side

  1. Figma Desktop → Plugins → Development → Open console
  2. Check for rendering errors

WebSocket Protocol

Plugin → CLI Messages

typescript
// Connection initiation
interface HelloMessage {
  type: "hello";
  docId: string;
  secret?: string;  // If server requires authentication
}

// Request full sync (e.g., after reconnection)
interface RequestFullMessage {
  type: "requestFull";
  docId: string;
}

CLI → Plugin Messages

typescript
// Full document sync
interface FullMessage {
  type: "full";
  rev: number;        // Current revision number
  ir: IRDocument;     // Complete normalized document
}

// Incremental update
interface PatchMessage {
  type: "patch";
  baseRev: number;    // Expected current revision
  nextRev: number;    // New revision after applying
  ops: PatchOp[];     // Operations to apply
}

// Error notification
interface ErrorMessage {
  type: "error";
  message: string;
}

Patch Operations

typescript
type PatchOp =
  | { op: "upsertNode"; node: IRNode }
  | { op: "removeNode"; id: string }
  | { op: "upsertEdge"; edge: IREdge }
  | { op: "removeEdge"; id: string };

Quick Diagnostic

bash
# 1. Start CLI serve (default port: 3456)
bun run packages/cli/src/index.ts serve examples/diagram.yaml

# 2. Test WebSocket with wscat (if installed)
wscat -c ws://localhost:3456

# 3. Send hello message
{"type":"hello","docId":"test"}

# 4. Check YAML is valid
bun run packages/cli/src/index.ts build examples/diagram.yaml

Message Flow

Plugin                          CLI
  │                              │
  │──── HelloMessage ───────────►│  (docId, secret?)
  │                              │
  │◄──── FullMessage ───────────│  (rev, ir)
  │                              │
  │      [YAML file changes]     │
  │                              │
  │◄──── PatchMessage ──────────│  (baseRev, nextRev, ops)
  │                              │
  │      [Plugin reconnects]     │
  │                              │
  │──── RequestFullMessage ─────►│  (docId)
  │                              │
  │◄──── FullMessage ───────────│  (rev, ir)
  │                              │

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Debug Connection AI skill do?

Debug WebSocket connection issues between CLI and FigJam plugin. Use when diagrams aren't syncing or connection fails.

Why use Debug Connection on TypingMind?

Because you install it once and use it with any model. Debug Connection is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Debug Connection in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jiaxiaojunQAQ/SkillJect/tree/main/data/skills_sample/debug-connection. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Debug Connection?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Debug Connection?

As many as you like. As long as a model supports skills, you can use Debug Connection with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Debug Connection AI skill free?

It is published on GitHub by jiaxiaojunQAQ. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇