metautil-data-structures

metautil-data-structures is a skill for Claude Code, Codex from metarhia/metaskills. It costs 75 tokens per session (2,426 once invoked), scanned A, original, MIT.

A JavaScript package guide for choosing and using common data structures such as queues, stacks, lists, tries, and circular buffers. These structures organize values according to rules like first-in-first-out or last-in-first-out.

In plain words
What is it for?
Use it when importing metautil structures or implementing queues, stacks, double-ended queues, immutable lists, prefix lookup, indexed ring buffers, or high-volume linked lists.
Why use it?
It helps avoid choosing an unsuitable built-in array or object when the program needs a specific access pattern, such as undo history, autocomplete, or a capped sliding window.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when importing metautil structures or implementing queues, stacks, double-ended queues, immutable lists, prefix lookup, indexed ring buffers, or high-volume linked lists.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/metarhia/metaskills/metautil-data-structures
Install

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.

Any agent
npx skills add metarhia/metaskills --skill metautil-data-structures
Clone the repo
git clone --depth 1 https://github.com/metarhia/metaskills

Made for: Claude Code, Codex.

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

agentmods badge for metautil-data-structures

README.md
[![agentmods](https://agentmods.dev/badge/skills/metarhia/metaskills/metautil-data-structures/github.svg)](https://agentmods.dev/skills/metarhia/metaskills/metautil-data-structures)
Your own site
<a href="https://agentmods.dev/skills/metarhia/metaskills/metautil-data-structures"><img src="https://agentmods.dev/badge/skills/metarhia/metaskills/metautil-data-structures/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for metautil-data-structures

Your own site · 80×15
<a href="https://agentmods.dev/skills/metarhia/metaskills/metautil-data-structures"><img src="https://agentmods.dev/badge/skills/metarhia/metaskills/metautil-data-structures.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,426 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00075 $0.02426
Opus 5 $0.00037 $0.01213
Sonnet 5 $0.00015 $0.00485
Haiku 4.5 $0.00007 $0.00243

Measured 9d ago against content hash 1daa5d301854, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

metautil-data-structures 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 9d 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.

skills/metautil-data-structures/SKILL.md · 210 lines

How it starts

The opening of the file, as written. The whole thing — 210 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Metautil Data Structures

Import from the package root. Prefer these ADTs over ad-hoc Array/Object when the discipline (FIFO, LIFO, persistence, schema) matters.

const metautil = require('metautil');
const { ConsList, cons, uncons, Struct, Deque, Queue, Stack } = metautil;
const { List, ListNode, CircularBuffer, UnrolledList, Trie } = metautil;

Choose the right structure

  • FIFO jobs / BFS / sliding failure window: Queue
  • LIFO undo / nested layers / brackets: Stack
  • Both ends O(1), capped window: Deque or CircularBuffer
  • Index + mid-sequence edit/move/group: List
  • Immutable history / branching / sharing: ConsList
  • Typed sealed/frozen records: Struct
  • Prefix autocomplete / string keys: Trie
  • Extreme enqueue/dequeue volume only: UnrolledList (no peek / interop)
  • Random access on a ring: CircularBuffer.at (not Deque)

Complexity and surface

  • CircularBuffer — ends O(1), index O(1) via at
  • Deque / Queue / Stack — ends O(1); no index (at only on buffer)
  • UnrolledList — ends O(1); no peek / interop
  • List — ends O(1), index O(n)
  • ConsListprepend O(1), walk O(n)
  • Trie — string-key prefix map

Who has what (beyond size / isEmpty where present):

  • fromArray / toArray / iterator: all except UnrolledList (and Trie)
  • peek: Queue, Stack
  • at: CircularBuffer only
  • every / reduce: CircularBuffer, Deque, Stack (not Queue)
  • clear / includes: ring family + List + Trie.clear; not ConsList / UnrolledList

Interoperability

Convert through Array:

const list = List.fromArray([1, 2, 3, 4, 5]);
const queue = Queue.fromArray(list.filter((n) => n % 2 === 0).toArray());
const consList = ConsList.fromArray(queue.toArray());

Deque, Queue, and Stack are thin facades over CircularBuffer (same ring storage).

Struct

Schema is inferred from default literals. Immutable uses Object.freeze; mutable uses Object.seal. Class name becomes constructor.name. Statics: fields, schema, mutable.

Read the full file on GitHub · 210 lines

Changes

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.

  1. 9d ago First seen · 210 lines · 75 tokens per session scan A 1daa5d301854

Subscribe to this mod's changes

metautil-data-structures is a skill published in the GitHub repository metarhia/metaskills (49 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 2,426 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

zcfg

Integrate zcfg (Zero Dependency Configuration Utility) into Java applications. Use when adding configuration loading, reading properties files, setting up application configuration, or integrating zcfg into a Java project. Triggers on "zcfg", "add configuration", "load properties", "application configuration with…

AdamBien/airails · 75 tokens

zcl

Add colored terminal output to Java applications using zcl (Zero-dependency Colour Logger). Use when adding colored console output, terminal logging with colors, ANSI color support, or integrating zcl into a Java project. Triggers on "zcl", "colored output", "colored logging", "terminal colors", "ANSI colors"…

AdamBien/airails · 85 tokens

zjson

Use JSON in zero-dependency Java by copying the org.json source (JSONObject, JSONArray, JSONTokener) directly into the project instead of adding a Maven/Gradle dependency. Use when adding JSON parsing or generation to a Java CLI script, zb project, or any project that must stay dependency-free. Triggers on "JSON in…

AdamBien/airails · 109 tokens

java-cli-app

Create and maintain multi-file Java 25 CLI applications packaged as executable JARs with zb (Zero Dependencies Builder). Use when asked to create a Java CLI application, a CLI project with multiple source files, or an executable JAR. Triggers on "Java CLI app", "CLI application", "multi-file Java", "executable JAR"…

AdamBien/airails · 106 tokens

zargs

Add zero-dependency argument parsing to Java CLI applications using the zargs pattern — an enum-based argument parser. Use when adding CLI argument parsing, command-line option handling, or adding options to a Java project. Triggers on "zargs", "argument parsing", "CLI arguments", "command-line options", "parse…

AdamBien/airails · 90 tokens

zunit

Generate and run zunit tests for java-cli-app projects. Use when asked to create tests, write tests, add tests, or generate test files for a java-cli-app project. Triggers on "zunit", "write tests", "create tests", "add tests", "test this", "generate tests", or requests to test a java-cli-app application. Also trigger…

AdamBien/airails · 111 tokens