Agent skill · research science · sickn33
mathguard
Math-heavy escalation for n >= 10^6 — Bloom, HyperLogLog, Count-Min, MinHash/LSH, FFT, JL projection, sweep line. Use when classical O(n log n) is the floor and approximate or math wins.
Why this skill is useful
Adds advanced mathematical techniques and probabilistic data structures that significantly enhance the AI's capability in handling large-scale data efficiently.
What it needs
About 12k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.
What this skill does
mathguard — Math-Heavy Optimization for AI Code lemmaly makes you pick the right classical algorithm. mathguard kicks in when the classical algorithm is already optimal but mathematics gives a better bound — usually by accepting bounded approximation, exploiting structure, or moving to a smarter algebraic space. The model knows these techniques. It almost never proposes them spontaneously. mathguard fixes that. Violating the letter of these rules is violating the spirit of the skill. A Bloom filter where the caller assumed exact answers is a production incident, not an optimization. When to Use This Skill Use mathguard when: Working with large-scale data (n ≥ 10⁶): similarity search, deduplication, top-K / heavy-hitters, streaming analytics, cardinality estimation, embeddings, recommender systems. Doing signal/image processing, polynomial or big-integer arithmetic, convolution, graph distance, computational geometry, randomized algorithms. The classical O(n log n) is already the floor and you need an asymptotic win (Bloom filter, HyperLogLog, Count-Min Sketch, MinHash/LSH, FFT/NTT, Johnson-Lindenstrauss projection, sweep line, kd-tree/BVH, fast exponentiation, monoid parallel reduction, amortized potential method). Loaded after lemmaly has confirmed the classical answer is not enough. Do not use mathguard when: The caller needs exact answers (auth, billing, dedup-for-correctness, primary keys). n is small (n < 10⁴) and the path is not hot. The bottleneck is I/O, not CPU/memory. The Iron Law Probabilistic data structures (Bloom, HyperLogLog, Count-Min, MinHash/LSH, t-digest), randomized projections (JL), and lossy transforms (floating FFT) all change the answer's meaning. Before proposing one: 1. Write the error parameter the caller will see (false-positive rate, relative error, distortion bound). 2. Identify the caller and state, in one sentence, that they tolerate this kind of wrong answer. 3. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills sickn33/mathguard