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.
npx agentmods add skills/metarhia/metaskills/js-data-structuresnpx skills add metarhia/metaskills --skill js-data-structuresgit clone --depth 1 https://github.com/metarhia/metaskillsWrote 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.
[](https://agentmods.dev/skills/metarhia/metaskills/js-data-structures)<a href="https://agentmods.dev/skills/metarhia/metaskills/js-data-structures"><img src="https://agentmods.dev/badge/skills/metarhia/metaskills/js-data-structures.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00077 | $0.02224 |
| Opus 5 | $0.00039 | $0.01112 |
| Sonnet 5 | $0.00015 | $0.00445 |
| Haiku 4.5 | $0.00008 | $0.00222 |
Grade A, and why
js-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 5d 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.
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.
Native Data Structures (JavaScript)
Choosing a native collection
- Fixed schema / DTO / JSON: use
Object(avoidMap, noJSON.stringify) - Dynamic string-to-value dict: use
MaporObject.create(null)(avoid plain{}if keys are user input) - Non-string keys, insertion order,
.size: useMap(avoidObject) - Ordered list, index access, transform: use
Array(avoidSet, no indexes) - Unique values, fast membership: use
Set(avoidArray.includeson large/dynamic sets) - Attach data to objects without retaining them: use
WeakMap(avoidMap, leaks) - Track object presence without retaining: use
WeakSet(avoidSet, leaks) - Numeric / binary data, I/O, crypto: use TypedArray /
ArrayBuffer(avoidnumber[]for hot binary work) - Hot queue / deque / stack ends: do not rely on
Array.shift/unshift— use a custom ring or linked structure
Complexity and code characteristics
Choose a structure for the property you need to control — not only for speed.
Big-O (typical average case; n = collection size):
Objectfield access: O(1) for fixed shapes; dynamic/delete-heavy objects degrade toward dictionary modeArrayindex get/set,push/pop: O(1);includes/indexOf/splice/shift/unshift: O(n)Mapget/set/has/delete,Setadd/has/delete: amortized O(1); iteration: O(n)WeakMap/WeakSetget/set/has/delete: amortized O(1); no iteration- TypedArray index get/set: O(1); grow/copy: O(n)
- Prefer the structure whose hot operation is O(1); measure before optimizing rare paths
Readability and semantics:
- Let the type state the intent:
Set= unique membership;Map= keyed registry;Array= ordered sequence; plainObject= record/DTO - Prefer a named collection over encoding the same idea in ad-hoc flags, parallel arrays, or stringly keys
- Use array methods (
.map,.filter,.reduce) when they match the transform; use explicit loops when control flow or performance matters - Avoid over-abstracting: a small static
Arrayallowlist is clearer than aSetused once
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.
- 5d ago First seen · 210 lines · 77 tokens per session scan A aec3cd8159d1
js-data-structures is a skill published in the GitHub repository metarhia/metaskills (48 stars, last pushed 1mo ago), licensed MIT. It adds 77 tokens to every session and 2,224 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.
Other skills, from other repositories
help
OrchestKit help directory with categorized skill listings. Use when discovering skills for a task, finding the right workflow, or browsing capabilities.
sbce
Spec-driven BCE workflow where one capability spec equals one business component (same name) and the spec is the boundary contract. Invoked as /sbce new|apply (or by intent), it drives declare → converge; the stack's own test loop is the oracle for "done". new accepts a BC name or a natural-language feature…
web-components
Architecture and coding rules for single-page applications using web components, BCE layering, lit-html templating, unidirectional Redux-style state management (reduction.js, standards-based), and standards-based client-side routing (Navigation API + URLPattern). Web standards and web platform first, minimal external…
javascript-conventions
Generic, composable JavaScript (ECMAScript) code conventions — modules, declarations, functions, collections, asynchrony, errors, JSDoc types, naming, and the Baseline lookup that decides which language and standard-library features may be used. Technology-neutral within the JavaScript world; meant to be composed with…
enterprisifier
Deliberately overengineer code by adding as many patterns, indirections, modules, anti-corruption layers, abstractions, and encapsulations as possible. Zero dependency on implementation. Use when asked to overengineer, enterprisify, enterprise-ify, abstract, add layers, add patterns, or make code "production-ready" in…
web-static
Build modern static websites using semantic HTML and CSS without external dependencies or build systems. Also owns the verification loop for such sites — drives the rendered pages through Chrome DevTools MCP (console, accessibility snapshot, viewport resize, dark/reduced-motion emulation, Lighthouse), executes the…