myscript/iinkts/add-client
Claude Code and agent skill by myscript/iinkts
- community
Checking that the SKILL.md file is still in the repository.
Checklist for adding a new client to iinkTS. Use when implementing a new communication protocol variant (HTTP batch, WebSocket, custom backend). Covers interface contract, package setup, and integration with canvas variants.
Install
npx vskill@latest install myscript/iinkts/add-clientSKILL.md
Add Client
Client Role
Clients handle the transport layer between iinkTS and a MyScript-compatible backend. They translate model mutations (add strokes, erase, transform) into protocol messages and dispatch recognition results back to the canvas. Lives in src/client/.
Current Clients
| Class | Protocol | Used by | |
|---|---|---|---|
WebSocketClient | WebSocket | InteractiveInkCanvas | |
WebSocketSSRClient | WebSocket (separate class, own protocol additions) | InteractiveInkSSRCanvas | |
HTTPClientV2 | HTTP REST, stateless batch | InkCanvas | |
HTTPClientV1 | HTTP REST (deprecated) | InkCanvasDeprecated |
WebSocketSSRClient is not a subclass of WebSocketClient — independent implementation, own config type. See recognizer-system skill for full protocol detail on WebSocketClient/HTTPClientV2.
Steps
1. Define the interface contract
Reference src/client/WebSocketClient.ts for the full real surface (see recognizer-system skill for the verified method list — addStrokes, eraseStrokes, replaceStrokes, transformTranslate/Rotate/Scale/Matrix, export, clear, undo/redo, close, destroy). Minimum required for a stateful (WebSocket-style) client:
A stateless (HTTP-batch-style) client needs far less: see HTTPClientV2 — a single send(strokes, requestedMimeTypes?): Promise<TExportV2> entry point is enough, no init/close/destroy/event surface required.
2. Create the client file
src/client/YourClient.ts:
Authentication: Use computeHmac(message, applicationKey, hmacKey) from @/utils/crypto — note the argument order, message comes first.
Error handling: Emit via this.event.emitError(error) — never throw uncaught. ClientEvent also exposes CONNECTION_STATUS_CHANGED for connectivity-state consumers.
3. Export from client index
src/client/index.ts:
4. Create a canvas variant (if needed)
If the client requires a dedicated canvas variant:
src/canvas/variants/YourCanvas.ts — extend AbstractCanvas (src/canvas/AbstractCanvas.ts) or copy the pattern from InkCanvas.ts.
Register in src/canvas/CanvasFactory.ts (CanvasFactory.createCanvas()):
Add "YOURTYPE" to TCanvasType in src/canvas/AbstractCanvas.ts, and to TCanvasVariantMap/TCanvasOptionsMap in src/canvas/CanvasFactory.ts.
5. Future: monorepo package split
When client packages are split (planned), the structure will be:
Each package will have its own package.json with peer dep on iink-ts core.
At that point, add a package.json and barrel index.ts to the package directory, and reference it from the root package.json workspaces field.
6. Write tests
test/unit/client/YourClient.test.ts (see existing WebSocketClient.test.ts, HTTPClientV2.test.ts for the real patterns in test/unit/client/):
- Mock WebSocket or fetch (see
test/unit/__config__/) - Test: init/handshake success and failure
- Test:
addStrokes()sends correct message format - Test: response parsing
- Test: error emission on transport failure
- Test:
destroy()cleans up properly
Checklist
- [ ] Client class created in
src/client/ - [ ]
initialized: DeferredPromise<void>exposed (stateful clients) - [ ]
event: ClientEventexposed (stateful clients) - [ ] HMAC auth wired if needed (
computeHmac) - [ ] All errors emitted via
event.emitError(), none thrown uncaught - [ ] Exported from
src/client/index.ts - [ ] Canvas variant created if needed
- [ ] Registered in
CanvasFactory - [ ] Tests written (≥80% coverage)
- [ ]
yarn typecheckclean
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/add-client/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/myscript/iinkts/add-client)