agentsclimarketplace

Debug connection

Skill aiskillstore/marketplace/skills/7nohe/debug-connection

Security-audited skills for Claude, Codex & Claude Code. One-click install, quality verified.

Install
npx -y skills add aiskillstore/marketplace --skill debug-connection

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Debug WebSocket connection issues between CLI and FigJam plugin. Use when diagrams aren't syncing, connection fails, plugin shows "Connecting..." indefinitely, or patches aren't being applied to canvas.

SKILL.md

2.7 KB, as published. Nobody here has run it

WebSocket Connection Debugging

Architecture

CLI serve (Bun) ←── WebSocket ──→ Plugin UI (ui.ts) ←── postMessage ──→ Plugin Main (code.ts)
     │                                  │                                    │
  File watcher                    Browser APIs                          Figma API
  YAML parsing                    WebSocket client                      Canvas rendering

Common Issues

IssueSymptomSolution
CLI not running"Connecting..." indefinitelyStart bun run packages/cli/src/index.ts serve diagram.yaml
Port in useConnection refusedCheck lsof -i :3456, use different port
Secret mismatchConnects then immediately closesMatch --secret value in CLI and plugin
YAML errorsConnected but no updatesFix validation errors in CLI output
docId mismatchNo response after helloEnsure plugin docId matches YAML docId
Patches not appliedConnected, canvas unchangedCheck Plugin Main console for render errors

Debugging Steps

  1. CLI side: Check terminal for errors, verify YAML with bun run packages/cli/src/index.ts build diagram.yaml
  2. Plugin UI: Right-click plugin → Inspect → Console for WebSocket events
  3. Plugin Main: Figma Desktop → Plugins → Development → Open console

Message Flow

Plugin                          CLI
  │                              │
  │──── hello ─────────────────►│  {type:"hello", docId, secret?}
  │◄──── full ─────────────────│  {type:"full", rev, ir}
  │                              │
  │      [YAML changes]          │
  │◄──── patch ────────────────│  {type:"patch", baseRev, nextRev, ops}
  │                              │
  │      [Reconnect]             │
  │──── requestFull ───────────►│  {type:"requestFull", docId}
  │◄──── full ─────────────────│

JSON Import Errors

  • JSON must be an object with version, docId, nodes
  • DSL format: nodes as array
  • IR format: nodes as object (Record)
  • Validation errors shown in alert with path + message

Quick Test

# Start server
bun run packages/cli/src/index.ts serve examples/diagram.yaml

# Test with wscat
wscat -c ws://localhost:3456
> {"type":"hello","docId":"test"}

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.