mathguard
Qué hace
Esta herramienta te ayuda a elegir métodos matemáticos avanzados para resolver problemas computacionales complejos, sobre todo cuando trabajas con grandes cantidades de datos. Sugiere alternativas más eficientes que los métodos tradicionales, aunque eso signifique aceptar un pequeño margen de error.
Cuándo usarla
- ✓Cuando tienes millones de datos y necesitas encontrar elementos parecidos rápidamente.
- ✓Cuando procesas señales o imágenes y necesitas cálculos rápidos.
- ✓Cuando los algoritmos habituales ya son rápidos, pero necesitas una solución todavía mejor y puedes tolerar un pequeño error.
Link de la skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mathguard/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Necesito encontrar duplicados en un conjunto de datos de 10 millones de imágenes, pero puedo tolerar algunos falsos positivos. ¿Qué técnica matemática puedo usar?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La herramienta compara tu problema con técnicas matemáticas conocidas que son más eficientes para grandes volúmenes de datos. Comprueba si necesitas una solución exacta o si es aceptable una aproximación con un error conocido.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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).
…
Preguntas frecuentes
¿Qué significa 'aproximación con error conocido'?
Significa que la respuesta puede no ser 100% exacta, pero el error es pequeño y predecible (por ejemplo, un 1% de probabilidad de equivocarse). Así, los cálculos pueden ser mucho más rápidos.
¿Cuándo NO debería usar esta herramienta?
No la uses si la precisión exacta es crítica (como en transacciones financieras) o si trabajas con pocos datos (menos de 10.000 elementos), donde los métodos sencillos ya funcionan bien.
¿Qué ejemplos de técnicas podría sugerir?
Podría sugerir el uso de Bloom Filters, HyperLogLog, Count-Min Sketch, MinHash, Fast Fourier Transform (FFT), entre otras, según el problema.
Detalles
Descripción original del autor
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.
Popularidad
- Estrellas en GitHub
- 48 mil
- Posición en el ranking
- #5180
- Licencia
- MIT
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
00-andruia-consultant
48 milAyuda a tu agente a iniciar o mejorar proyectos de IA. Analiza código, sugiere herramientas y crea planes de acción en español.
007
48 milPermite que tu agente realice auditorías de seguridad y modelado de amenazas. Es útil para proteger proyectos contra ataques y vulnerabilidades.
10-andruia-skill-smith
48 milAyuda a tu agente a crear o mejorar herramientas de IA. Define cómo funcionan, escribe la documentación y valida la estructura.
20-andruia-niche-intelligence
48 milPermite que tu agente cree un resumen de un sector específico. Es útil para entender su contexto, normas, patrones de uso y riesgos, usando fuentes fiables.
Skills parecidas
pytorch-patterns
280 milAyuda a tu agente a usar PyTorch para modelos de machine learning. Aplica buenas prácticas para entrenar modelos de forma eficiente y obtener resultados reproducibles.
evm-token-decimals
280 milAyuda a tu agente a evitar errores con números decimales en distintas redes blockchain. Asegura que los valores de los tokens sean exactos en transacciones y cálculos.
ito-inference
280 milPermite a tu agente comprobar la disponibilidad de modelos de IA. Conecta la solicitud de cómputo con el servicio de modelo listo.