hashload/horse/horse-websocket
Claude Code and agent skill by hashload/horse
- community
Checking that the SKILL.md file is still in the repository.
Guidelines and workflows for developing and maintaining WebSocket endpoints and protocol upgrades within the Horse framework.
Install
npx vskill@latest install hashload/horse/horse-websocketSKILL.md
The same SKILL.md was published earlier as hashload/horse/horse-websocket.
Horse WebSocket Coding Skill
This skill provides guidelines and patterns for developers and AI agents implementing, debugging, or maintaining WebSocket endpoints in the Horse framework.
🟢 Request Upgrade Pattern
To upgrade an HTTP request to a WebSocket connection, always call Res.UpgradeToWebSocket(AOnConnectCallback) inside the route handler.
Delphi Syntax (Anonymous Procedure / Closure)
Lazarus/FPC Syntax (Object Methods)
Always use regular object methods or class procedures for callbacks in Lazarus/FPC to ensure compatibility:
🟢 Broadcasts and Session Management
Use THorseWebSocketManager for thread-safe operations across multiple connections.
- Broadcast to all:
THorseWebSocketManager.Broadcast('/ws', 'Hello all!'); - Broadcast excluding sender:
THorseWebSocketManager.Broadcast('/ws', 'Hello others!', AConnection);
🟢 Error and Exception Handling
- Silencing normal interruptions: Normal connection validation errors or manual status sends followed by pipeline interruption should raise
EHorseCallbackInterrupted(from unitHorse.Exception.Interrupted) to gracefully exit the middleware pipeline. - Callback Safety: Always place try-except blocks inside custom event handlers (like
OnMessage) to prevent crashes inside the worker socket threads. - Fail-Fast Detection: If a client requests a WebSocket upgrade on an unsupported provider (e.g.
HttpSysor hosted ISAPI/CGI),Res.UpgradeToWebSocketwill automatically reply with501 Not Implementedand raiseEHorseCallbackInterrupted.
🟢 Thread-Safety Rules
IHorseWebSocketConnection.SendTextandSendBinaryare thread-safe and protected by an internalTCriticalSection. Do not add manual synchronization wrappers around them.- The HTTP request/response objects (
THorseRequest,THorseResponse) are recycled/destroyed once the upgrade is completed. Do not store or reference them inside any of the WebSocket callbacks (OnMessage,OnDisconnect, etc.). Use theIHorseWebSocketConnectioncontext instead.
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 repositoryCheckingdoc/skills/horse-websocket/SKILL.md
Popularity
- Repository stars
- 1,368
- Repository forks
- 244
- 7-day trend score
- 36
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/hashload/horse/horse-websocket)