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 skills add Arcadi4/nerdy --skill data-structures-for-disjoint-setsgit clone --depth 1 https://github.com/Arcadi4/nerdyWrote 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/arcadi4/nerdy/data-structures-for-disjoint-sets)<a href="https://agentmods.dev/skills/arcadi4/nerdy/data-structures-for-disjoint-sets"><img src="https://agentmods.dev/badge/skills/arcadi4/nerdy/data-structures-for-disjoint-sets.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.00054 | $0.03170 |
| Opus 5 | $0.00027 | $0.01585 |
| Sonnet 5 | $0.00011 | $0.00634 |
| Haiku 4.5 | $0.00005 | $0.00317 |
Grade A, and why
data-structures-for-disjoint-sets 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 7d 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 — 286 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Data Structures for Disjoint Sets
Overview
Use this skill to keep disjoint-set answers honest about representatives, handles, sequence bounds, and offline metadata. The key behavior change is to separate the abstract partition contract from representation choices: linked lists, forests, rank, path compression, and application-specific metadata all have different invariants.
Shared CLRS Conventions
Follow the parent clrs skill for mathematical formatting and proof tone. In this chapter skill, operation names such as MAKE-SET, UNION, and FIND-SET may appear in code spans, but all mathematical bounds and symbolic definitions must be displayed in LaTeX blocks, not placed in prose, headings, inline code, or Markdown tables.
When to Use
Use this skill for:
- Union-find or disjoint-set APIs, including
makeSet,find,union, andsameComponent. - Dynamic connectivity where edges only accumulate and components are queried.
- Explaining why a representative is arbitrary unless the API explicitly stores separate canonical metadata.
- Comparing linked-list and forest representations.
- Analyzing weighted union, union by rank, path compression, and inverse-Ackermann amortized bounds.
- Offline algorithms that use disjoint sets as a bookkeeping layer: connected components, offline minimum, depth determination with pseudodistances, and Tarjan offline lowest common ancestors.
Do not use it for fully dynamic graph connectivity with deletions, online minimum extraction, or online LCA queries unless the answer explicitly says the chapter technique is not sufficient by itself.
Quick Reference
| Topic | Use it to decide | Required contract |
|---|---|---|
| Abstract disjoint sets | Whether the problem only needs partition membership | FIND-SET returns a stable representative only while the set is unchanged |
| Connected components | Whether edges are only added before queries | Initialize every vertex, union endpoints, compare representatives |
| Linked-list sets | Whether constant-time find is worth expensive unions | Every element has a back-pointer to the set object |
| Weighted union on lists | Whether sequence cost matters more than one union | Append the shorter list to the longer list and update moved back-pointers |
| Disjoint-set forests | Whether tree roots can represent sets | Parent pointers form rooted trees; roots point to themselves |
| Union by rank | Whether tree growth is controlled without path compression | Rank is history metadata and only increases on equal-rank root links |
| Path compression | Whether repeated finds should flatten search paths | FIND-SET rewrites parents on the path to the root |
| Offline minimum | Whether the full operation sequence is known | Process keys in increasing order through insertion-block sets |
| Offline LCA | Whether all tree queries are known before DFS | Answer a pair only when the other endpoint is black |
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.
- 7d ago First seen · 286 lines · 54 tokens per session scan A e6bdef8e22db
data-structures-for-disjoint-sets is a skill published in the GitHub repository Arcadi4/nerdy (7 stars, last pushed 4mo ago), licensed MIT. It adds 54 tokens to every session and 3,170 once invoked, about $0.0003 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-31.
Other skills, from other repositories
ljg-word
Deep-dive English word mastery tool. Deconstructs a single English word into core semantics and epiphany. Use when user asks to explain/master a specific English word.
coding
A coding guide for writing and running Python programs in a sandbox. It requires scripts to be small and reproducible, with their actual output or errors reported.
golang-stay-updated
Golang ecosystem watch list — official sources (go.dev/blog, pkg.go.dev, tour.golang.org, golang-nuts), newsletters (Golang Weekly, Awesome Go Newsletter), communities (r/golang, gophers.slack.com, Go Forum, go.dev/wiki), blogs (Dave Cheney, Ardan Labs, Rob Pike), YouTube channels (Gopher Academy, GopherCon EU/UK)…
rust-learner
Learn Rust language features and crate updates. Use when user asks about Rust version changelog, what's new in Rust, crate updates, Cargo.toml dependencies, tokio/serde/axum features, or any Rust ecosystem questions.
course
A Python helper that displays tutorials, group information, source-code links, and other resources for the python-office library in a terminal.
llvm-learning
Comprehensive learning resources and tutorials for LLVM, Clang, and compiler development. Use this skill when helping users learn LLVM internals, find educational resources, or understand compiler concepts.