vaultys/vaultysclaw/add-ws-message
Claude Code and agent skill by vaultys/vaultysclaw
- community
Checking that the SKILL.md file is still in the repository.
Add a new WebSocket message type to the VaultysClaw protocol. Use when extending agent-control plane communication: new commands sent from control plane to agent, new status reports sent from agent to control plane, or new bidirectional message flows. Covers shared type definition, payload interface, control-plane handler, agent handler, and signed message verification.
Install
npx vskill@latest install vaultys/vaultysclaw/add-ws-messageSKILL.md
Add WebSocket Message Type
When to Use
- Adding a new command the control plane sends to agents
- Adding a new report/event agents send back to the control plane
- Extending the protocol for a new feature (sync, config, notifications, etc.)
Protocol Overview
WSMessage is a flat interface (not a discriminated union) — all messages share the same envelope:
Procedure
1. Add the Type String to the Union
File: packages/shared/src/types.ts
Add your new type literal to the WSMessageType union:
2. Add the Payload Interface
In the same file (packages/shared/src/types.ts), add a typed payload interface:
Naming convention: WS + PascalCase(type) + Payload (e.g. WSMemorySyncPayload).
3. Handle in the Control Plane (lib/ws-server.ts)
Direction: agent → control plane (agent sends, server receives):
Add a case to the switch (message.type) in handleMessage():
Then implement the handler as a private method:
Direction: control plane → agent (server sends):
Add a public method to send the message:
4. Handle in the Agent (src/agent.ts)
Add a case to the switch (message.type) in handleMessage():
Implement the handler as a private method. Use .catch() for async:
For messages that agent sends to control plane, call this.send(message).
5. For Signed Messages (critical/policy-like)
Only if the message carries trust-sensitive data (policies, capability grants):
Signing (control plane side, before sending):
Verification (agent side, before processing):
Add a status guard for post-auth messages (like intent, policy_update):
6. Checklist Before Done
- [ ] Type literal added to
WSMessageTypeunion inpackages/shared/src/types.ts - [ ] Payload interface added in
packages/shared/src/types.ts(namedWS<TypeName>Payload) - [ ]
packages/sharedrebuilt (pnpm build -F @vaultysclaw/shared) before using in other packages - [ ]
caseadded tohandleMessage()switch inlib/ws-server.ts - [ ] Handler method implemented in
ws-server.ts - [ ]
caseadded tohandleMessage()switch insrc/agent.ts - [ ] Handler method implemented in
agent.ts - [ ] Signed messages: verification call before processing (agent side)
- [ ] Post-auth messages:
_status !== "connected"guard in agent switch - [ ] Async handlers wrapped with
.catch()in agent switch
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 repositoryChecking.github/skills/add-ws-message/SKILL.md
Popularity
- Repository stars
- 81
- Repository forks
- 1
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. 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/vaultys/vaultysclaw/add-ws-message)