hashload/horse/horse-lazarus-compatibility
Claude Code and agent skill by hashload/horse
- community
Checking that the SKILL.md file is still in the repository.
Guide for ensuring Lazarus and Free Pascal (FPC) compatibility, addressing anonymous methods differences, JSON units, and compiler directives.
Install
npx vskill@latest install hashload/horse/horse-lazarus-compatibilitySKILL.md
The same SKILL.md was published earlier as hashload/horse/horse-lazarus-compatibility.
Horse Lazarus & FPC Compatibility
To write cross-platform Horse applications that compile flawlessly in both Delphi and Lazarus/FPC, you must adhere to Free Pascal's compiler rules and syntax limitations.
1. No Anonymous Methods in FPC (The Core Rule)
While Delphi supports registering routes using inline anonymous procedures (methods) directly, Free Pascal (FPC) does not support anonymous methods with variable capturing in the same syntax.
Delphi Syntax (Will Fail to Compile on Lazarus)
Lazarus/FPC Correct Syntax
Always declare handlers as standard standalone procedures or method pointers, and pass them as callback parameters:
2. Standard Compiler Directives for Lazarus
Always include these two compiler directives at the absolute top of your Lazarus .pas or .dpr (program) files:
-
{$MODE DELPHI}: Instructs FPC to emulate Delphi's object-oriented syntax and generic type resolutions. -
{$H+}: Enforces the use of Long Strings (AnsiString) by default instead of short strings (which are limited to 255 characters).
3. JSON Framework Differences
Delphi and Lazarus use entirely different built-in JSON serialization libraries.
- Delphi: Uses
System.JSON(TJSONObject,TJSONArray). - Lazarus/FPC: Uses
fpjsonandjsonparser(TJSONObject,TJSONArray).
Writing Cross-Compiler JSON Code
If your middleware or controllers need to compile on both platforms, use conditional compilation defines ($IFDEF):
4. Best Practices for Cross-Compiler Apps
- Prefer standalone controller procedures: Keep all route handlers in a separate unit as standard procedures, avoiding inline code in the bootstrap project file.
- Avoid Delphi-specific RTL: Do not use units like
System.NetEncodingorSystem.Hashwithout providing an alternative likeLclIntfor FPC's built-in cryptographic units when compiling under FPC.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdoc/skills/horse-lazarus-compatibility/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-lazarus-compatibility)