Agent skill

Fast String Allocations

by r3bl-org in r3bl-org/r3bl-open-core

Zero-allocation string building strategies. An agent skill from r3bl-org/r3bl-open-core.

Apache-2.0Auto-check passedDevelopment

Install Fast String Allocations

skills CLI
$ npx skills add r3bl-org/r3bl-open-core --skill fast-string-allocations -a claude-code

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

GitHub CLI
$ gh skill install r3bl-org/r3bl-open-core fast-string-allocations --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/r3bl-org/r3bl-open-core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/fast-string-allocations .claude/skills/fast-string-allocations && 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
fast-string-allocations
GitHub stars
485
Token cost
~602 tokens
SKILL.md length
282 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Zero-allocation string building strategies. An agent skill from r3bl-org/r3bl-open-core.

  • Works in 3 steps: The FastStringify Trait → The inline_string! Macro → The format_no_alloc! Macro
  • Formatting strings
  • SKILL.md covers When to Use, Core Strategy and Implementation Guidelines
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Fast String Allocations is an agent skill from r3bl-org/r3bl-open-core. Zero-allocation string building strategies. Use when formatting strings, generating ANSI codes, or writing hot loops to avoid heap allocations and Formatter state machine overhead.

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

It sits in Development, covering Linting and formatting. The repository describes itself as: TUI framework and developer productivity apps in Rust 🦀. The licence is Apache-2.0.

When your agent uses it

  • Formatting strings
  • Generating ANSI codes
  • Writing hot loops to avoid heap allocations and Formatter state machine overhead

Example prompts

  • “/fast-string-allocations”

Workflow steps

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

  1. The FastStringify Trait
  2. The inline_string! Macro
  3. The format_no_alloc! Macro

What it can do on your machine

Read from SKILL.md and the folder at commit 89db352. 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.

    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

Fast String Allocations loads about 602 tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 282 words of instructions outside code blocks.

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

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 r3bl-org/r3bl-open-core at commit 89db352, republished under its Apache-2.0 licence (© r3bl-org). 282 words, ~602 tokens.

Download SKILL.mdSave it as .claude/skills/fast-string-allocations/SKILL.md (or your agent's skills folder).
name
fast-string-allocations
description
Zero-allocation string building strategies. Use when formatting strings, generating ANSI codes, or writing hot loops to avoid heap allocations and Formatter state machine overhead.

Fast String Allocations & Zero-Overhead Formatting

When writing code that involves string building, formatting, or rendering (especially in the TUI engine, logging, or event loops), you MUST adhere to the codebase's strict zero-allocation architecture.

When to Use

  • When building ANSI escape sequences
  • When building strings in a 60 FPS event loop or render cycle
  • When using tracing::*! macros
  • Whenever you are tempted to use format! or write! on a Formatter

Core Strategy

Read the full Source of Truth at mod@crate::core::common::fast_strings#string-allocation-performance-strategy for detailed architectural constraints.

Performance Hierarchy (Fastest to Slowest)
  1. Direct push_str() - Zero overhead, direct memory copy.
  2. crate::format_no_alloc! - Zero heap allocations, reuses existing heap.
  3. FastStringify - Temporary heap allocation, completely bypasses Formatter state machine.
  4. inline_string! - Stack allocated (16 bytes), but dynamically spills to the heap if exceeded.
  5. format! / write! - Always heap allocates (format!) OR uses heavy formatter overhead (write!). Avoid in hot paths.

Implementation Guidelines

1. The FastStringify Trait

Use for custom types (like ANSI codes) that are serialized millions of times.

  • Bypasses the expensive Formatter state machine by pushing everything into a temporary heap String and making ONE f.write_str() call.
  • Use generate_impl_display_for_fast_stringify! to auto-generate the Display block.
2. The inline_string! Macro

Use for stack-allocated strings (16 bytes).

  • Drop-in replacement for format!.
  • The primary use case is the core Editor Component and tracing::*! macros.
  • Warning: If text exceeds 16 bytes, it spills to the heap and incurs the cost of format!.
3. The format_no_alloc! Macro

Use for hot loops where the string is guaranteed to exceed 16 bytes (meaning inline_string! would spill).

  • Hoist a String::with_capacity(N) outside the loop.
  • Pass the hoisted string into the macro inside the loop to clear and write into the existing capacity.
  • Zero allocations per tick.

© r3bl-org, Apache-2.0. 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 .agents/skills/fast-string-allocations of r3bl-org/r3bl-open-core.

Open the folder on GitHubat commit 89db352

Compare with similar skills

Fast String Allocations 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.

Fast String Allocations compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fast String Allocations this skillr3bl-org/r3bl-open-core485—~602Automated safety check: PassApache-2.0
Minimizing Ty Ecosystem Changesastral-sh/ruff50k—~4.6kAutomated safety check: PassMIT
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.3k—~2.2kAutomated safety check: PassMIT
Babysit PR To Pass CIsgl-project/sglang37k2 repos~3kAutomated safety check: PassApache-2.0
Rust Best Practicesfarm-fe/farm5.6k3 repos~1.1kAutomated safety check: PassMIT
Summarise Ecosystem Resultsastral-sh/ruff50k—~2.2kAutomated safety check: PassMIT

Similar skills

  • Official

    A skill your agent uses when a user says "minimize this ty ecosystem change", "reproduce this ecosystem result", "investigate a primer difference", "investigate a mypyprimer difference"…

    50k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.3k GitHub stars~2.2k tokensUpdated 29 days ago
    DevelopmentAuto-check passed
  • Babysit PR To Pass CI

    sgl-project/sglang

    Start and persistently pursue a goal to babysit an SGLang pull request until selected GitHub Actions workflows pass on the latest PR head.

    37k GitHub starsUsed in 2 repos~3k tokens
    DevelopmentAuto-check passed
  • Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook.

    5.6k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "summarise ecosystem results", "summarize this ty ecosystem report", "what changed in this ecosystem run?", or asks to summarise or summarize ty ecosystem…

    50k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Go Pedantry

    chromedp/chromedp

    This skill should be used when the user is writing Go code and needs guidance on Go-specific pedantry: error wrapping with fmt.Errorf and %w, interface design (accept interfaces return structs)…

    13k GitHub stars~3.7k tokensUpdated 3 days ago
    DevelopmentAuto-check passed

More from r3bl-org/r3bl-open-core

All 25 skills in this repo
  • Analyze Log Files

    r3bl-org/r3bl-open-core

    Analyze log files by stripping ANSI escape sequences first. An agent skill from r3bl-org/r3bl-open-core.

    485 GitHub stars~632 tokensUpdated today
    Auto-check: notes
  • Analyze Performance

    r3bl-org/r3bl-open-core

    Establish performance baselines and detect regressions using flamegraph analysis.

    485 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Check Bounds Safety

    r3bl-org/r3bl-open-core

    Apply type-safe bounds checking patterns using VPIndex/VPLength types instead of usize.

    485 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Release Crate

    r3bl-org/r3bl-open-core

    Publish a crate release to crates.io with changelog, standalone release notes, git tag, and GitHub release.

    485 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Organize Modules

    r3bl-org/r3bl-open-core

    Apply private modules with public re-exports (barrel export) pattern for clean API design.

    485 GitHub stars~5.8k tokensUpdated today
    Auto-check passed
  • Check Code Quality

    r3bl-org/r3bl-open-core

    Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests.

    485 GitHub stars~3.8k tokensUpdated today
    Auto-check passed

Categories

Questions about Fast String Allocations

What does Fast String Allocations do?

Zero-allocation string building strategies. An agent skill from r3bl-org/r3bl-open-core. Fast String Allocations is an agent skill from r3bl-org/r3bl-open-core. Zero-allocation string building strategies.

When should I use Fast String Allocations?

Fast String Allocations fits situations like: formatting strings; generating ANSI codes; writing hot loops to avoid heap allocations and Formatter state machine overhead.

How do I install Fast String Allocations in Claude Code?

Run `npx skills add r3bl-org/r3bl-open-core --skill fast-string-allocations -a claude-code`. Or copy the skill folder (.agents/skills/fast-string-allocations in r3bl-org/r3bl-open-core) into .claude/skills/fast-string-allocations in your project. Claude Code loads it when a task matches its description.

How do I install Fast String Allocations in Codex?

Run `npx skills add r3bl-org/r3bl-open-core --skill fast-string-allocations -a codex`. Or copy the skill folder (.agents/skills/fast-string-allocations in r3bl-org/r3bl-open-core) into .agents/skills/fast-string-allocations in your project. Codex loads it when a task matches its description.

Can I use Fast String Allocations 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 r3bl-org/r3bl-open-core --skill fast-string-allocations -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fast-string-allocations, .gemini/skills/fast-string-allocations, .github/skills/fast-string-allocations and .opencode/skills/fast-string-allocations in your project.

What does Fast String Allocations need to run?

SKILL.md names no scripts, command-line tools or credentials: Fast String Allocations is instructions for the agent only.

Does Fast String Allocations 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 Fast String Allocations 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 Fast String Allocations use?

Fast String Allocations is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fast String Allocations use?

About 602 tokens (SKILL.md is roughly 2.4k 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 Fast String Allocations?

Skills that share tags, products or a category with Fast String Allocations: Minimizing Ty Ecosystem Changes (astral-sh/ruff, 50k stars), Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.3k stars), Babysit PR To Pass CI (sgl-project/sglang, 37k stars) and Rust Best Practices (farm-fe/farm, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fast String Allocations?

r3bl-org (a GitHub organization) maintains it in r3bl-org/r3bl-open-core, which has 485 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 8, 2026.

Source: r3bl-org/r3bl-open-core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.