ze-fix-alloc

Remove a single allocation from a ZeRoy encoding path and validate with lint and unit tests.

50|2|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/ze-software/ze --skill ze-fix-alloc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ze-fix-alloc
Source: https://github.com/ze-software/ze/tree/main/.codex/skills/ze-fix-alloc
Command: npx skills add https://github.com/ze-software/ze --skill ze-fix-alloc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers remove a single concrete allocation in an encoding path within the Ze repository, ensuring the path and its callers are updated to the repo's buffer-writing pattern and validated with lint and unit tests.

Core Features & Use Cases

  • Identify and remove a specific allocation without altering behavior.
  • Read the containing function and all its callers to propagate changes safely.
  • Validate changes with Ze lint and unit tests to guard against regressions.

Quick Start

Identify the target and its callers, refactor to remove the allocation with the smallest safe change, and verify with lint and unit tests.

Frequently Asked Questions about ze-fix-alloc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I remove a single allocation in a Go encoding path to reduce heap usage?

To remove a single allocation in a Go encoding path, you refactor the target function to eliminate the heap allocation, read the containing function and its callers to propagate changes safely, and verify the result with lint and unit tests.

What is the best way to refactor a buffer-writing pattern in Go without altering behavior?

The best way to refactor a buffer-writing pattern in Go is to identify the specific allocation, apply the smallest safe change to remove it, and validate the encoding path with lint and unit tests to guard against regressions.

How does analyzing the call graph help when optimizing hot-path encoding code?

Analyzing the call graph helps optimize hot-path encoding code by reading all callers of the target function, ensuring that removing an allocation and updating the buffer-writing pattern propagates safely without breaking behavior.

Do I need to run unit tests after removing an allocation from a Go encoding function?

Yes, you need to run unit tests after removing an allocation from a Go encoding function to verify correctness across callers and guard against regressions caused by the buffer-writing pattern changes.

Can I use this approach to fix allocations in any Go repository?

This approach applies specifically when optimizing hot-path encoding code in the Ze repository, requiring changes to align with the repo's buffer-writing pattern and validation through Ze lint and unit tests.

Why does removing an allocation require reading all callers of the target function?

Removing an allocation requires reading all callers because the refactor must propagate changes safely across the call graph, ensuring the updated buffer-writing pattern maintains correct behavior throughout the encoding path.