Horse is a lightweight web framework for Delphi and Lazarus programs, providing tools for building HTTP servers and APIs. It is for developers who need routing, request handling, middleware, streaming, WebSockets, and related server features in those languages. Its catalogue skills support working with the framework.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add HashLoad/horse --skill horse-dependency-injectiongit clone --depth 1 https://github.com/HashLoad/horseWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/hashload/horse/horse-dependency-injection)<a href="https://agentmods.dev/skills/hashload/horse/horse-dependency-injection"><img src="https://agentmods.dev/badge/skills/hashload/horse/horse-dependency-injection.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.00900 |
| Opus 5 | $0.00014 | $0.00450 |
| Sonnet 5 | $0.00005 | $0.00180 |
| Haiku 4.5 | $0.00003 | $0.00090 |
Grade A, and why
horse-dependency-injection scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Horse Contextual Dependency Injection (Request Scope)
1. Request Scope Architecture
The Services property in THorseRequest provides a thread-safe, request-scoped Inversion of Control (IoC) container. This container manages the lifecycle of classes and objects that need to exist only during the execution of a single HTTP request (e.g., database connections, repository patterns, user context).
- Ownership: The container takes ownership (
doOwnsValues := True) of registered instances. - Automatic Disposal: All registered service instances are automatically destroyed when the request finishes, eliminating memory leaks and removing the need for manual
try/finallyblocks inside route handlers.
2. Direct Instance Injection (Add)
Use Add to register an already instantiated object. The container takes ownership and will destroy the instance when the request ends.
procedure SetContextMiddleware(Req: THorseRequest; Res: THorseResponse; Next: TProc);
var
LUserContext: TUserContext;
begin
LUserContext := TUserContext.Create;
LUserContext.UserId := Req.Headers['X-User-ID'];
// Register the instance
Req.Services.Add(TUserContext, LUserContext);
Next();
end;
procedure GetProfileHandler(Req: THorseRequest; Res: THorseResponse; Next: TProc);
var
LUserContext: TUserContext;
begin
// Resolve and use the registered service
LUserContext := TUserContext(Req.Services.Resolve(TUserContext));
Res.Send('Profile data for user: ' + LUserContext.UserId);
end;
3. Lazy Factory Injection (AddFactory)
Use AddFactory to register a factory delegate. The object will only be instantiated at the exact moment Resolve is called (Lazy Loading). Once instantiated, it is cached for subsequent resolves in the same request and destroyed at the end.
This is highly recommended for heavy resources (like database connections) that might not be needed in every execution path of a route.
procedure RegisterDatabaseMiddleware(Req: THorseRequest; Res: THorseResponse; Next: TProc);
begin
// Register the factory method
Req.Services.AddFactory(TFDConnection,
function: TObject
begin
Result := TFDConnection.Create(nil);
TFDConnection(Result).ConnectionDefName := 'PooledPGDef';
TFDConnection(Result).Connected := True;
end);
Next();
end;
procedure QueryUsersHandler(Req: THorseRequest; Res: THorseResponse; Next: TProc);
var
LConnection: TFDConnection;
LQuery: TFDQuery;
begin
// The connection is physically created and opened only on the next line!
LConnection := TFDConnection(Req.Services.Resolve(TFDConnection));
LQuery := TFDQuery.Create(nil);
try
LQuery.Connection := LConnection;
LQuery.SQL.Text := 'SELECT id, name FROM users';
LQuery.Open;
Res.Send(LQuery.ToJSONArray);
finally
LQuery.Free;
end; // LConnection is automatically freed by the container when the request ends!
end;
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 90 lines · 27 tokens per session scan A 8bd3ebc1d43e
horse-dependency-injection is a skill published in the GitHub repository HashLoad/horse (1,374 stars, last pushed 2d ago), licensed MIT. It adds 27 tokens to every session and 900 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
api-design-patterns
Comprehensive API design patterns covering REST, GraphQL, gRPC, versioning, authentication, and modern API best practices.
api-design-patterns
Comprehensive API design patterns covering REST, GraphQL, gRPC, versioning, authentication, and modern API best practices.
api-design-patterns
Comprehensive API design patterns covering REST, GraphQL, gRPC, versioning, authentication, and modern API best practices.
hunt-wordpress
Use when an authorized target exposes WordPress core, plugin, theme, REST, or XML-RPC behavior.
mars-development
Develop REST APIs with MARS-Curiosity (Delphi REST library) - writing resources, REST attributes, parameter binding, JWT authentication and roles, FireDAC dataset publishing, server-sent events (SSE), WebStencils HTML templating, client components, configuration, serialization. Use this skill whenever the user is…
a0-development
Development guide for extending Agent Zero from current source and DOX. Use for framework architecture, tools, extensions, API/WebUI handlers, agent profiles, prompts, skills, projects, runtime boundaries, and contribution workflow. Load the focused reference files before giving implementation guidance.