Note
Purpose: This directory contains instruction packages optimized for AI agents (such as Antigravity, Claude, and GitHub Copilot). While the standard documentation is designed for human developers, these skills are optimized to help AIs quickly understand and apply correct, memory-safe, and idiomatic patterns when working with the Horse Web Framework.
Read this in English or Português (BR).
| Skill Name | Path | Load When |
|---|---|---|
| horse-app-structure | horse-app-structure/SKILL.md |
Setting up a new project, setting up the .dpr bootstrap, initial middleware pipeline configuration, or port listening. |
| horse-routing | horse-routing/SKILL.md |
Configuring HTTP methods, route parameters, wildcards, or grouping routes within Controllers. |
| horse-middlewares | horse-middlewares/SKILL.md |
Configuring official middlewares (Johnson, CORS, basic-auth, compression, logger) and ensuring correct execution order. |
| horse-request-response | horse-request-response/SKILL.md |
Reading request payload, query parameters, route parameters, headers, or sending HTTP responses and setting statuses. |
| horse-files-streams | horse-files-streams/SKILL.md |
Handling file uploads (multipart formData), file downloads, or custom data streams. |
| horse-providers | horse-providers/SKILL.md |
Choosing or configuring server adapters (Indy, CGI, ISAPI, Apache, Daemon, HTTP.sys). |
| horse-writing-middleware | horse-writing-middleware/SKILL.md |
Implementing custom middlewares for Horse following the correct signature and execution sequence. |
| horse-database-pooling | horse-database-pooling/SKILL.md |
Enforcing thread-safety during database connection setup, configuring connection pooling (FireDAC / UniDAC). |
| horse-security-auth | horse-security-auth/SKILL.md |
Securing endpoints using JWT or Basic-Auth middlewares and configuring protected route groups. |
| horse-ssl-tls | horse-ssl-tls/SKILL.md |
Enabling SSL/TLS (HTTPS) configuration across different providers (HTTP.sys, ICS). |
| horse-integration-tests | horse-integration-tests/SKILL.md |
Writing automated HTTP tests for endpoints using DUnit/DUnitX and mock server configurations. |
| horse-lazarus-compatibility | horse-lazarus-compatibility/SKILL.md |
Ensuring Lazarus and FPC cross-compiler compatibility, handling anonymous methods differences and FPC JSON libs. |
| horse-performance-tuning | horse-performance-tuning/SKILL.md |
Writing high-performance handlers, optimizing heap allocations, and selecting optimal transport providers. |
| horse-zero-allocation | horse-zero-allocation/SKILL.md |
Coding for Zero-Allocation, using stack buffers, string slices, object pooling, and avoiding thread lock contention. |
| horse-mvc-architecture | horse-mvc-architecture/SKILL.md |
Structuring corporate APIs using Clean MVC principles, separating transport from business logic. |
| horse-minimal-api | horse-minimal-api/SKILL.md |
Building rapid, low-boilerplate microservices and mock APIs inside single-file bootstrap models. |
| horse-dependency-injection | horse-dependency-injection/SKILL.md |
Managing request-scoped contextual services and IoC (dependency injection) in Delphi and Lazarus. |
| horse-multi-instance | horse-multi-instance/SKILL.md |
Running or configuring multiple independent server instances (THorseInstance) concurrently inside the same application process. |
| horse-telemetry-observability | horse-telemetry-observability/SKILL.md |
Registering, configuring, and optimizing native telemetry callbacks (AddOnTelemetry) for APM tools and logging. |
- Middlewares Order: The registration order is critical. Middlewares like
CORSandJhonsonmust be registered before defining any routes. - Johnson Memory Management: The Johnson middleware takes ownership of any
TJSONObjectorTJSONArraysent viaRes.Send<T>. NEVER call.Freeon a JSON object after sending it throughRes.Send<T>when Johnson is active. - Route Parameters: Parameters are defined using the colon syntax (e.g.,
/products/:id), not curly braces (e.g.,/products/{id}). - Thread-Safety & IoC: Horse is inherently multithreaded. NEVER share physical database connections (
TFDConnection) or variables globally across requests. Use the request-scopedServicesproperty (IoC) to register and resolve connection factories and scoped services to automate their lifecycle and avoid race conditions or RAM leaks. - Console Output: Call
SetConsoleCharSetin console mode endpoints if necessary to prevent character encoding issues. - Stream Management: The
THorseResponseobject takes ownership of any stream passed toSendFile,Download, orRender. NEVER call.FreeorFreeAndNilon a stream after sending it via these response methods.