mathguard
Was er macht
Dieses Tool hilft dir, fortgeschrittene mathematische Methoden auszuwählen, um komplexe Rechenprobleme zu lösen, besonders wenn große Datenmengen anfallen. Es schlägt effizientere Alternativen zu klassischen Methoden vor, auch wenn dafür eine kleine Fehlerquote in Kauf genommen wird.
Wann du ihn nutzt
- ✓Wenn du Millionen von Datenpunkten hast und ähnliche Elemente schnell finden musst.
- ✓Wenn du Signale oder Bilder verarbeitest und schnelle Berechnungen brauchst.
- ✓Wenn gängige Algorithmen bereits schnell sind, du aber eine noch bessere Lösung brauchst und einen kleinen Fehler verkraften kannst.
Link zum Skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mathguard/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Ich muss Duplikate in einem Datensatz mit 10 Millionen Bildern finden, kann aber einige False Positives tolerieren. Welche mathematische Technik kann ich verwenden?”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Das Tool vergleicht dein Problem mit bekannten mathematischen Techniken, die bei großen Datenmengen effizienter sind. Es prüft, ob eine exakte Lösung nötig ist oder ob eine Näherung mit bekanntem Fehler akzeptabel ist.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
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
lemmalyhas confirmed the classical answer is not enough.
Do not use mathguard when:
- The caller needs exact answers (auth, billing, dedup-for-correctness, primary keys).
nis small (n < 10⁴) and the path is not hot.- The bottleneck is I/O, not CPU/memory.
The Iron Law
NO APPROXIMATE STRUCTURE WITHOUT WRITTEN ε/δ AND EXPLICIT CALLER ACCEPTANCE
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:
- Write the error parameter the caller will see (false-positive rate, relative error, distortion bound).
- Identify the caller and state, in one sentence, that they tolerate this kind of wrong answer.
- If you cannot identify the caller, or they need exact (auth checks, billing, dedup keys, deduplication for correctness, anything that flows into a primary key), DO NOT propose the approximate structure. Keep classical, or escalate to a sharded/streaming exact design.
This rule has saved more incidents than any other in this skill. Do not soften it.
Non-negotiable rules
Declare exact vs approximate up front. Before suggesting a math-level technique, state:
mode: exactormode: approximate- If approximate: the error parameter (ε, δ, false-positive rate) and a sentence on whether the caller can tolerate it.
- If the caller needs exact and there is no exact win, say so and stop — do not silently degrade to approximate.
Cite the technique by name. Never describe a probabilistic or numerical trick in vague terms. Name it:
Bloom filter,HyperLogLog,Count-Min Sketch,MinHash + LSH,Johnson–Lindenstrauss projection,FFT,NTT,fast exponentiation,Karatsuba,Strassen,sweep line,kd-tree,BVH,union-find with path compression,Floyd's cycle detection,Boyer-Moore majority,reservoir sampling,Knuth shuffle,Aho-Corasick,suffix automaton,segment tree with lazy propagation,Fenwick tree,monoid scan / parallel prefix. A named technique is auditable; "a smart approximation" is not.State the trade you are making. Every math-level optimization buys something at a cost. In one line:
- Buys:
space,time,wall-clock,parallelism. - Costs:
accuracy ε=?,code complexity,dependency,non-determinism,numerical stability. - If the cost is invisible to the caller, write "callers see no change".
- Buys:
Justify the asymptotic win. Do not propose a math technique without a one-line bound argument:
- "HyperLogLog: count uniques in O(log log n) bits at standard error 1.04/√m."
- "FFT: polynomial multiplication O(n log n) vs schoolbook O(n²)."
- "JL projection: preserves pairwise distances within (1±ε) using O(log n / ε²) dimensions."
- "Sweep line: rectangle overlap from O(n²) pair checks to O(n log n) events." No bound, no proposal.
Forbid math cargo-culting. Do not introduce these techniques when:
- n is small enough that a linear scan finishes in microseconds (n < ~10⁴ unless it is a hot path).
…
Häufige Fragen
Was bedeutet 'Näherung mit bekanntem Fehler'?
Das Ergebnis ist vielleicht nicht zu 100 % exakt, aber der Fehler ist klein und vorhersagbar (z. B. eine Chance von 1 %, dass das Ergebnis falsch ist). So können Berechnungen deutlich schneller werden.
Wann sollte ich dieses Tool NICHT verwenden?
Verwende es nicht, wenn absolute Genauigkeit entscheidend ist (etwa bei Finanztransaktionen) oder wenn du mit kleinen Datenmengen arbeitest (weniger als 10.000 Elemente), bei denen einfache Methoden schon gut funktionieren.
Welche Techniken könnte es vorschlagen?
Je nach Problem könnte es Bloom Filters, HyperLogLog, Count-Min Sketch, MinHash, die Fast Fourier Transform (FFT) und weitere Techniken vorschlagen.
Details
Originalbeschreibung des Autors
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.
Beliebtheit
- GitHub-Sterne
- 48k
- Platz im Ranking
- #5180
- Lizenz
- MIT
- Aktualisiert
- 15.10.2026
Kommentare
- …
Weitere Skills aus diesem Repository
00-andruia-consultant
48kHilft deinem Agenten, KI-Projekte zu starten oder zu verbessern. Er analysiert Code, schlägt Tools vor und erstellt Aktionspläne auf Spanisch.
007
48kLässt deinen Agenten Sicherheitsaudits und Bedrohungsmodellierung durchführen. Nützlich, um Projekte vor Angriffen und Schwachstellen zu schützen.
10-andruia-skill-smith
48kHilft deinem Agenten, KI-Tools zu erstellen oder zu verbessern. Er legt fest, wie Tools funktionieren, schreibt die Dokumentation und prüft die Struktur.
20-andruia-niche-intelligence
48kLässt deinen Agenten eine Branchenzusammenfassung erstellen. Nützlich, um Kontext, Regeln, Nutzungsmuster und Risiken anhand verlässlicher Quellen zu verstehen.
Ähnliche Skills
pytorch-patterns
280kHilft deinem Agenten, PyTorch für Machine-Learning-Modelle einzusetzen. Er wendet Best Practices für effizientes Training und reproduzierbare Ergebnisse an.
evm-token-decimals
280kHilft deinem Agenten, Fehler bei Dezimalzahlen in verschiedenen Blockchain-Netzwerken zu vermeiden. Sorgt dafür, dass Token-Werte stimmen.
ito-inference
280kHilft deinem Agenten, die Verfügbarkeit von KI-Modellen zu prüfen. Er verbindet Rechenanfragen mit einem bereiten Modellservice.