Agent skill

Horse Zero Allocation

by HashLoad in HashLoad/horse

Guide for programming with Zero-Allocation principles in Horse, focusing on stack allocations, string slicing, object pooling, and avoiding lock contention.

MITAuto-check passed

Install Horse Zero Allocation

skills CLI
$ npx skills add HashLoad/horse --skill horse-zero-allocation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install HashLoad/horse horse-zero-allocation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/HashLoad/horse.git skills-src && mkdir -p .claude/skills && cp -r skills-src/doc/skills/horse-zero-allocation .claude/skills/horse-zero-allocation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
horse-zero-allocation
GitHub stars
1.4k
Token cost
~912 tokens
SKILL.md length
338 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

Guide for programming with Zero-Allocation principles in Horse, focusing on stack allocations, string slicing, object pooling, and avoiding lock contention.

  • Works in 4 steps: Zero-Allocation String Slicing (Avoid… → Using the Stack (Records and Static… → Object and Request Recycling (Pooling) → …
  • SKILL.md covers 1. Zero-Allocation String…, 2. Using the Stack (Records…, 3. Object and Request… and 4. Zero-Copy and Direct…
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Horse Zero Allocation is an agent skill from HashLoad/horse. Guide for programming with Zero-Allocation principles in Horse, focusing on stack allocations, string slicing, object pooling, and avoiding lock contention.

Its SKILL.md is about 910 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Fast, opinionated, minimalist web framework for Delphi. The licence is MIT.

Example prompts

  • “/horse-zero-allocation”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Zero-Allocation String Slicing (Avoid String Copying)
  2. Using the Stack (Records and Static Arrays)
  3. Object and Request Recycling (Pooling)
  4. Zero-Copy and Direct Encoding Handling

What it can do on your machine

Read from SKILL.md and the folder at commit d4351a5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are pascal).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Horse Zero Allocation loads about 912 tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 338 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~912

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from HashLoad/horse at commit d4351a5, republished under its MIT licence (© HashLoad). 338 words, ~912 tokens.

Download SKILL.mdSave it as .claude/skills/horse-zero-allocation/SKILL.md (or your agent's skills folder).
name
horse-zero-allocation
description
Guide for programming with Zero-Allocation principles in Horse, focusing on stack allocations, string slicing, object pooling, and avoiding lock contention.

Horse Zero-Allocation Programming

To write custom routers, high-performance middlewares, or request handlers that scale under extreme concurrency, you must minimize or eliminate memory allocations on the dynamic heap. Heap allocations require global memory manager locks, which cause lock contention and page faults across multi-threaded applications.


1. Zero-Allocation String Slicing (Avoid String Copying)

Using functions like Copy(MyString, Start, Length) or string concatenation (+) allocates new string segments on the heap. Under heavy concurrency, this degrades performance.

  • Rule: Use index/pointer boundaries (such as PChar) or specialized slice types to perform string matches and parsing.
  • Idiomatic Example: Create or use a slice structure (like THorseBufferSlice in the Horse RouterTree) to match paths without generating new sub-strings.
pascal
type
  TZeroAllocSlice = record
    Buffer: PChar;
    Start: Integer;
    Length: Integer;
    function Compare(const AString: string): Boolean;
  end;

function TZeroAllocSlice.Compare(const AString: string): Boolean;
var
  I: Integer;
begin
  if Length <> System.Length(AString) then
    Exit(False);
    
  for I := 0 to Length - 1 do
    if (Buffer + Start + I)^ <> AString[I + 1] then
      Exit(False);
      
  Result := True;
end;

2. Using the Stack (Records and Static Arrays)

Avoid creating temporary class instances or dynamic arrays (array of Byte) inside loop structures or high-frequency handler routines. These require heap overhead and reference-counting locks.

  • Stack Allocation (Records): Declare local data carriers as record rather than class. Records are allocated automatically on the fast thread stack and cleaned up instantly upon exit.
  • Static Arrays: For local buffers (such as socket buffers or event arrays), declare static arrays with fixed sizes:
pascal
// Correct (Stack allocation - fast, zero page faults)
procedure ProcessEvents;
var
  LEvents: array[0..255] of epoll_event; // Allocated on the stack
begin
  // Process up to 256 events directly
end;

// Incorrect (Heap allocation - slow thread lock contention)
procedure ProcessEventsBad;
var
  LEvents: array of epoll_event;
begin
  SetLength(LEvents, 256); // Hits the memory manager heap
end;

3. Object and Request Recycling (Pooling)

Instead of instantiating helper objects (like database queries, parser buffers, or connection context blocks) for every HTTP request, utilize a thread-safe Object Pool (e.g. THorseContextPool).

  • Padrão:
    1. Acquire a pre-allocated object from the pool at the start of the handler.
    2. Use the object.
    3. Reset the object's internal fields (clean/nullify references).
    4. Return the object to the pool in a finally block.

4. Zero-Copy and Direct Encoding Handling

Avoid redundant string transcoding (e.g. converting UTF-8 response buffers back and forth to standard UnicodeString).

  • Pass-through Buffer: Pass raw bytes and stream pointers directly to the socket API (like Windows HTTP.sys kernel API or FPC Epoll socket handles).
  • Reference Clearing: Ensure references to pooled objects or structures (such as connection context structures) are explicitly nilled out/cleared immediately after request termination. This prevents the compiler's runtime from executing locking cleanup logic on worker threads.

© HashLoad, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in doc/skills/horse-zero-allocation of HashLoad/horse.

Open the folder on GitHubat commit d4351a5

Compare with similar skills

Horse Zero Allocation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Horse Zero Allocation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Horse Zero Allocation this skillHashLoad/horse1.4k—~912Automated safety check: PassMIT
Principle Redesign From First Principlescursor/plugins10k8 repos~211Automated safety check: PassNone
Daily Focus Boardgithub/awesome-copilot40k—~3kAutomated safety check: PassMIT
Agent Resource Allocatorruvnet/ruflo74k2 repos~4.9kAutomated safety check: PassMIT
Focus Stylesthedaviddias/Front-End-Checklist74k—~639Automated safety check: PassMIT
Focus Orderthedaviddias/Front-End-Checklist74k—~519Automated safety check: PassMIT

Similar skills

  • Daily Focus Board

    github/awesome-copilot

    Official

    Builds a warm, browser-based daily focus board the user updates by talking to their agent, with Eisenhower priorities, a brain-dump box and kind not-today carryover.

    40k GitHub stars~3k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Agent skill for resource-allocator - invoke with $agent-resource-allocator

    74k GitHub starsUsed in 2 repos~4.9k tokens
    Auto-check passed
  • Focus Styles

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing stylesheets, component styles, and responsive behavior related to Provide visible custom focus indicators.

    74k GitHub stars~639 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Focus Order

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Ensure logical focus order.

    74k GitHub stars~519 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Focus Management

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Manage focus during dynamic interactions.

    74k GitHub stars~465 tokensUpdated yesterday
    Frontend & DesignAuto-check passed

More from HashLoad/horse

All 23 skills in this repo
  • Horse App Structure

    HashLoad/horse

    Guide for setting up Horse applications, bootstrap program (.dpr), basic console initialization, and registering modules.

    1.4k GitHub stars~716 tokensUpdated yesterday
    Auto-check passed
  • Guide for setting up thread-safe database connection pooling (FireDAC / UniDAC) in multithreaded Horse applications.

    1.4k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Guide for managing request-scoped contextual services and IoC (dependency injection) in Delphi and Lazarus.

    1.4k GitHub stars~985 tokensUpdated yesterday
    Auto-check passed
  • Horse Files Streams

    HashLoad/horse

    Guide to handling file uploads (multipart), downloads, and stream lifetime management in the Horse framework.

    1.4k GitHub stars~601 tokensUpdated yesterday
    Auto-check passed
  • Horse Grpc

    HashLoad/horse

    Guidelines and workflows for developing and maintaining gRPC services, HTTP/2 h2c transport, and Protobuf serialization within the Horse framework.

    1.4k GitHub stars~776 tokensUpdated yesterday
    Auto-check passed
  • Guide for writing automated integration tests for Horse endpoints using DUnit/DUnitX and THTTPClient.

    1.4k GitHub stars~964 tokensUpdated yesterday
    Auto-check passed

Questions about Horse Zero Allocation

What does Horse Zero Allocation do?

Guide for programming with Zero-Allocation principles in Horse, focusing on stack allocations, string slicing, object pooling, and avoiding lock contention. Horse Zero Allocation is an agent skill from HashLoad/horse. Guide for programming with Zero-Allocation principles in Horse, focusing on stack allocations, string slicing, object pooling, and avoiding lock contention.

How do I install Horse Zero Allocation in Claude Code?

Run `npx skills add HashLoad/horse --skill horse-zero-allocation -a claude-code`. Or copy the skill folder (doc/skills/horse-zero-allocation in HashLoad/horse) into .claude/skills/horse-zero-allocation in your project. Claude Code loads it when a task matches its description.

How do I install Horse Zero Allocation in Codex?

Run `npx skills add HashLoad/horse --skill horse-zero-allocation -a codex`. Or copy the skill folder (doc/skills/horse-zero-allocation in HashLoad/horse) into .agents/skills/horse-zero-allocation in your project. Codex loads it when a task matches its description.

Can I use Horse Zero Allocation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HashLoad/horse --skill horse-zero-allocation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/horse-zero-allocation, .gemini/skills/horse-zero-allocation, .github/skills/horse-zero-allocation and .opencode/skills/horse-zero-allocation in your project.

What does Horse Zero Allocation need to run?

SKILL.md names no scripts, command-line tools or credentials: Horse Zero Allocation is instructions for the agent only.

Does Horse Zero Allocation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Horse Zero Allocation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Horse Zero Allocation use?

Horse Zero Allocation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Horse Zero Allocation use?

About 912 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Horse Zero Allocation?

Skills that share tags, products or a category with Horse Zero Allocation: Principle Redesign From First Principles (cursor/plugins, 10k stars), Daily Focus Board (github/awesome-copilot, 40k stars), Agent Resource Allocator (ruvnet/ruflo, 74k stars) and Focus Styles (thedaviddias/Front-End-Checklist, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Horse Zero Allocation?

HashLoad (a GitHub organization) maintains it in HashLoad/horse, which has 1,377 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 7, 2026.

Source: HashLoad/horse on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.