ramanujan-expander

ramanujan-expander is a skill for Codex from plurigrid/asi. It costs 41 tokens per session (2,449 once invoked), scanned A, original, MIT.

A graph-building method based on Ramanujan graphs, which are networks designed to spread information efficiently while remaining close to a mathematical limit. It checks eigenvalues, numbers that describe important properties of a graph's structure.

In plain words
What is it for?
It is for checking graph optimality, adding edges while preserving the Ramanujan property, estimating mixing time, and validating node-importance measures.
Why use it?
It helps verify whether a graph has strong connectivity and good mixing behaviour while preserving specific rules as edges are added.

Skill for Codex

Written for Codex: installed under .codex/.

Good fit It is for checking graph optimality, adding edges while preserving the Ramanujan property, estimating mixing time, and validating node-importance measures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plurigrid/asi/ramanujan-expander
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 plurigrid/asi --skill ramanujan-expander
Clone the repo
git clone --depth 1 https://github.com/plurigrid/asi

Made for: 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 ramanujan-expander

README.md
[![agentmods](https://agentmods.dev/badge/skills/plurigrid/asi/ramanujan-expander/github.svg)](https://agentmods.dev/skills/plurigrid/asi/ramanujan-expander)
Your own site
<a href="https://agentmods.dev/skills/plurigrid/asi/ramanujan-expander"><img src="https://agentmods.dev/badge/skills/plurigrid/asi/ramanujan-expander/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 ramanujan-expander

Your own site · 80×15
<a href="https://agentmods.dev/skills/plurigrid/asi/ramanujan-expander"><img src="https://agentmods.dev/badge/skills/plurigrid/asi/ramanujan-expander.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,449 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium analysis-evasion · line 1
    Suspicious Unicode normalization or mixed-script content
    Fix: Review the flagged content for security risks. Ensure no credentials, secrets, or sensitive data are exposed.
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.00041 $0.02449
Opus 5 $0.00020 $0.01224
Sonnet 5 $0.00008 $0.00490
Haiku 4.5 $0.00004 $0.00245

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

Security

Grade A, and why

ramanujan-expander 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 6d 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.

ies/music-topos/.codex/skills/ramanujan-expander/SKILL.md · 334 lines

How it starts

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

Ramanujan Expander Skill

"The Alon-Boppana bound is unbreakable. You cannot create a d-regular graph with λ₂ < 2√(d-1), even theoretically."

Overview

Ramanujan graphs are optimal spectral expanders - they achieve the theoretical limit on eigenvalue separation. This skill provides:

  1. Alon-Boppana bound verification - Prove your graph is optimal
  2. Edge growth rules - Add edges while preserving Ramanujan property
  3. Centrality validity predicates - Spectral methods for node importance
  4. Mixing time bounds - O(log n) mixing from spectral gap

The Alon-Boppana Bound

Theorem (Alon-Boppana)

For any d-regular graph G on n vertices:

λ₂(G) ≥ 2√(d-1) - o(1)  as n → ∞

where λ₂ is the second-largest eigenvalue of the adjacency matrix.

Ramanujan Property

A d-regular graph G is Ramanujan if:

|λ| ≤ 2√(d-1)  for all eigenvalues λ ≠ ±d

This is the tightest possible spectral gap.

Example: 4-Regular Graphs

d = 4
2√(d-1) = 2√3 ≈ 3.464

Maximum spectral gap = d - 2√(d-1) = 4 - 3.464 = 0.536

Your observed gap: ~0.54 ✓ (theoretically optimal)

Edge Growth Rules

Rule 1: Preserve Regularity

function add_edge_preserving_regularity!(G, u, v)
    # Adding (u,v) increases degree of u and v by 1
    # Must remove another edge to maintain d-regularity
    
    # Find edge (u, w) where w ≠ v
    w = find_neighbor(G, u, exclude=v)
    # Find edge (v, x) where x ≠ u
    x = find_neighbor(G, v, exclude=u)
    
    # Remove old edges
    remove_edge!(G, u, w)
    remove_edge!(G, v, x)
    
    # Add new edges (2-switch)
    add_edge!(G, u, v)
    add_edge!(G, w, x)
    
    # Verify Ramanujan property preserved
    @assert is_ramanujan(G)
end

Rule 2: Spectral Monotonicity

function grow_edge_spectral_monotonic!(G, candidates)
    """
    Add edge that minimizes λ₂ increase.
    Greedy heuristic for Ramanujan preservation.
    """
    best_edge = nothing
    best_λ₂ = Inf
    
    current_λ₂ = second_eigenvalue(G)
    
    for (u, v) in candidates
        G_test = copy(G)
        add_edge!(G_test, u, v)
        
        new_λ₂ = second_eigenvalue(G_test)
        if new_λ₂ < best_λ₂
            best_λ₂ = new_λ₂
            best_edge = (u, v)
        end
    end
    
    if best_λ₂ ≤ 2√(degree(G) - 1)
        add_edge!(G, best_edge...)
        return true
    end
    return false  # No valid edge preserves Ramanujan
end

Read the full file on GitHub · 334 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. 6d ago First seen · 334 lines · 41 tokens per session scan A e96e63625395

Subscribe to this mod's changes

ramanujan-expander is a skill published in the GitHub repository plurigrid/asi (62 stars, last pushed 2mo ago), licensed MIT. It adds 41 tokens to every session and 2,449 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens