Horse Framework

July 11, 2026 · View on GitHub

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).


Available Skills

Skill NamePathLoad When
horse-app-structurehorse-app-structure/SKILL.mdSetting up a new project, setting up the .dpr bootstrap, initial middleware pipeline configuration, or port listening.
horse-routinghorse-routing/SKILL.mdConfiguring HTTP methods, route parameters, wildcards, or grouping routes within Controllers.
horse-middlewareshorse-middlewares/SKILL.mdConfiguring official middlewares (Johnson, CORS, basic-auth, compression, logger) and ensuring correct execution order.
horse-request-responsehorse-request-response/SKILL.mdReading request payload, query parameters, route parameters, headers, or sending HTTP responses and setting statuses.
horse-files-streamshorse-files-streams/SKILL.mdHandling file uploads (multipart formData), file downloads, or custom data streams.
horse-providershorse-providers/SKILL.mdChoosing or configuring server adapters (Indy, CGI, ISAPI, Apache, Daemon, HTTP.sys).
horse-writing-middlewarehorse-writing-middleware/SKILL.mdImplementing custom middlewares for Horse following the correct signature and execution sequence.
horse-database-poolinghorse-database-pooling/SKILL.mdEnforcing thread-safety during database connection setup, configuring connection pooling (FireDAC / UniDAC).
horse-security-authhorse-security-auth/SKILL.mdSecuring endpoints using JWT or Basic-Auth middlewares and configuring protected route groups.
horse-ssl-tlshorse-ssl-tls/SKILL.mdEnabling SSL/TLS (HTTPS) configuration across different providers (HTTP.sys, ICS).
horse-integration-testshorse-integration-tests/SKILL.mdWriting automated HTTP tests for endpoints using DUnit/DUnitX and mock server configurations.
horse-lazarus-compatibilityhorse-lazarus-compatibility/SKILL.mdEnsuring Lazarus and FPC cross-compiler compatibility, handling anonymous methods differences and FPC JSON libs.
horse-performance-tuninghorse-performance-tuning/SKILL.mdWriting high-performance handlers, optimizing heap allocations, and selecting optimal transport providers.
horse-zero-allocationhorse-zero-allocation/SKILL.mdCoding for Zero-Allocation, using stack buffers, string slices, object pooling, and avoiding thread lock contention.
horse-mvc-architecturehorse-mvc-architecture/SKILL.mdStructuring corporate APIs using Clean MVC principles, separating transport from business logic.
horse-minimal-apihorse-minimal-api/SKILL.mdBuilding rapid, low-boilerplate microservices and mock APIs inside single-file bootstrap models.
horse-dependency-injectionhorse-dependency-injection/SKILL.mdManaging request-scoped contextual services and IoC (dependency injection) in Delphi and Lazarus.
horse-multi-instancehorse-multi-instance/SKILL.mdRunning or configuring multiple independent server instances (THorseInstance) concurrently inside the same application process.
horse-telemetry-observabilityhorse-telemetry-observability/SKILL.mdRegistering, configuring, and optimizing native telemetry callbacks (AddOnTelemetry) for APM tools and logging.

Critical Rules for AIs (Apply to All Skills)

  1. Middlewares Order: The registration order is critical. Middlewares like CORS and Jhonson must be registered before defining any routes.
  2. Johnson Memory Management: The Johnson middleware takes ownership of any TJSONObject or TJSONArray sent via Res.Send<T>. NEVER call .Free on a JSON object after sending it through Res.Send<T> when Johnson is active.
  3. Route Parameters: Parameters are defined using the colon syntax (e.g., /products/:id), not curly braces (e.g., /products/{id}).
  4. Thread-Safety & IoC: Horse is inherently multithreaded. NEVER share physical database connections (TFDConnection) or variables globally across requests. Use the request-scoped Services property (IoC) to register and resolve connection factories and scoped services to automate their lifecycle and avoid race conditions or RAM leaks.
  5. Console Output: Call SetConsoleCharSet in console mode endpoints if necessary to prevent character encoding issues.
  6. Stream Management: The THorseResponse object takes ownership of any stream passed to SendFile, Download, or Render. NEVER call .Free or FreeAndNil on a stream after sending it via these response methods.