agentleFS
ruvnetruvnet/sublinear-time-solver/.claude/skills/sublinear-solver/SKILL.md

sublinear-solver

Skill94 starsChanged 10 days agoMITView on GitHub

Solve sparse diagonally dominant linear systems, rank graph nodes with PageRank / personalized PageRank, or get local top-k scores with forward/backward push, using @ruvnet/sublinear-core (zero dependencies) or the sublinear-time-solver MCP server. Use when a task needs A x = b on a sparse matrix, node importance in a graph, "related items" from a seed node, or a single entry of a large solution.

  • Installs packages

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check converged and residual before relying on x.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sublinear solver

Pick the entry point

  • Library code: npm i @ruvnet/sublinear-core. It has 0 dependencies and provides ESM, CJS and types.
  • Agent tools: the MCP server npx -y sublinear-time-solver serve. The tools to use are solve, pageRank, estimateEntry and analyzeMatrix.
  • Rust: cargo add sublinear.

Recipes

import { solve, graphFromEdges, pageRank, personalizedPageRank, forwardPush, backwardPush, estimateEntry, topK } from '@ruvnet/sublinear-core';

// A x = b. A is COO {rows, cols, rowIndices, colIndices, values}, dense rows, or a CsrMatrix.
const { x, residual, converged, method } = solve(A, b, { tolerance: 1e-10 });

// Graph ranking with string ids; edges are [source, target, weight?].
const g = graphFromEdges(edges);
topK(pageRank(g).scores, 10, g);
topK(personalizedPageRank(g, seedId, { damping: 0.85 }).scores, 10, g);

// Large graph, local answer: the cost depends on epsilon, not on n.
topK(forwardPush(g, seedId, { epsilon: 1e-6 }).scores, 10, g);
backwardPush(g, targetId);              // ppr_s(target) for every source s

// One entry of x without solving for all of x (requires strict row diagonal dominance).
estimateEntry(A, b, i, { walks: 20000 }); // { estimate, standardError }

Rules

  • damping is the probability of following an edge. A restart probability α means damping = 1 - α.
  • Check converged and residual before relying on x. The residual is recomputed from the returned vector.
  • Jacobi, Neumann and Gauss-Seidel need diagonal dominance. Conjugate gradient needs a symmetric positive definite matrix. method: 'auto' picks between them.
  • A full solution vector costs time linear in nnz per iteration. Only forwardPush, backwardPush and estimateEntry have a cost independent of n.
  • The MCP solveTrueSublinear tool is approximate. Check its verified_relative_residual, or use solve when you need accuracy.
  • The consciousness, psycho-symbolic, emergence and temporal-lead MCP tools are experimental simulations, not solvers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.