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.5 $0.00030 $0.00970
Sonnet 5.5 $0.00015 $0.00485
Haiku 4.5 $0.00007 $0.00243

Measured 3mo ago against content hash 1daa5d301854, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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)
  • ConsList — prepend 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. 3mo 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 (61 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 2,426 once invoked, about $0.0003 per session on Opus 5.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

metautil-data-structures compared with skills from other repositories

metautil-data-structures next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
metautil-data-structuresmetarhia/metaskillsSkill611mo agoMITA75Claude Code, Codex
jakarta-data-persistenceAdamBien/airailsSkill762d agoMITA199Claude Code
zcfgAdamBien/airailsSkill762d agoMITA75Claude Code
zclAdamBien/airailsSkill762d agoMITA85Claude Code
memory-persistenceAdamBien/airailsSkill762d agoMITA161Claude Code
java-cli-appAdamBien/airailsSkill762d agoMITA106Claude Code
zargsAdamBien/airailsSkill762d agoMITA90Claude Code