variant-analysis
Qué hace
Esta skill toma un error que ya encontraste y busca otras instancias de la misma causa raíz en una base de código. Es para auditores de seguridad y desarrolladores que acaban de encontrar un problema.
Cuándo usarla
- ✓Cuando se encuentra un error en un archivo y quieres saber dónde más ocurre.
- ✓Cuando te preguntan si un problema nuevo es el mismo error que uno anterior.
- ✓Cuando quieres convertir un error conocido en una regla de búsqueda para CodeQL o Semgrep.
Link de la skill
https://github.com/trailofbits/skills/blob/main/plugins/variant-analysis/skills/variant-analysis/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
“Acabamos de encontrar una comprobación de permisos que falta en este archivo. ¿Hay otros lugares del código donde pase el mismo error?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Funciona en cinco pasos: encuentra la causa raíz, escribe un patrón que solo coincida con el error conocido, generaliza ese patrón y luego busca coincidencias en el código.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Variant Analysis
Find the other instances of a bug you have already found. One root cause usually has several manifestations, and they are rarely in the module where you found the first one.
When to Use
- A vulnerability has been found and you need to search for similar instances
- Building or refining CodeQL/Semgrep queries for security patterns
- Performing systematic code audits after an initial issue discovery
- Analyzing how a single root cause manifests in different code paths
When NOT to Use
- Initial vulnerability discovery — use audit-context-building or a domain-specific audit
- General code review with no known pattern to search for
- Writing fix recommendations — use issue-writer
- Understanding unfamiliar code — use audit-context-building first
The Five Steps
Read the reference for a step when you reach it.
1. Understand the original issue. Extract the root cause — why the code is wrong, not what it does — and enumerate the directions a variant could hide in: related identifiers, other manifestations of the same mistake, data-type edge cases. → references/root-cause.md
2. Create an exact match. Write a pattern matching ONLY the known instance and confirm it hits. A pattern that matches nothing means you have misunderstood the bug, and every search built on it is calibrated against the wrong code.
3–4. Generalize one element at a time. Climb from the exact match toward the pattern family, running and reading all matches after each single change. Stop when more than half the matches are noise. → references/searching.md — abstraction ladder, tool selection, false-positive filters
5. Triage. Decide which candidates are real, and say so with a severity attached. → references/triage.md
Then write it up, including the patterns that failed and a CI rule to prevent regression. → references/reporting.md
Running it as a Workflow
This plugin ships /variant-analysis:variants, which runs the five steps across parallel
subagents — one per expansion axis, looping until the sweep stops finding anything new.
Each stage reads the reference above that matches its job.
Use the workflow when the codebase is large or the root cause has many manifestations. Work the steps directly when the search is narrow or you want a say in each generalization.
What Makes Hunts Fail
- Narrow scope — searching only the module the original bug was in
- Pattern too specific — searching one attribute and missing the family around it
- One vulnerability class — chasing a single manifestation of the root cause
- Happy-path testing — never trying the null, empty, and boundary cases
- Generalizing too fast — abstracting several elements at once, so noise cannot be attributed to any one of them
The first three are covered in root-cause.md and searching.md, the fourth in triage.md.
Resources
CodeQL (resources/codeql/): python.ql, javascript.ql, java.ql, go.ql, cpp.ql
Semgrep (resources/semgrep/): python.yaml, javascript.yaml, java.yaml, go.yaml, cpp.yaml
Report: resources/variant-report-template.md
Preguntas frecuentes
¿Sirve para encontrar errores nuevos desde cero?
No. Sirve para encontrar más instancias de un error que ya conoces.
¿Escribe la corrección?
No. La skill se centra en encontrar variantes y no escribe recomendaciones de corrección.
¿Puede ayudar a escribir reglas de búsqueda?
Sí. Puede ayudar a construir consultas de CodeQL o Semgrep a partir de una instancia conocida.
Detalles
Descripción original del autor
Hunts for the other instances of a bug already found — the variants of one root cause across a codebase. Use immediately after a vulnerability, logic bug, or bad pattern turns up in a specific file and the question becomes where else it occurs, including the bare conversational form ("are there others like this?", "is this the same bug?"). Also for generalizing one known instance into a CodeQL or Semgrep query for its whole pattern family, and for triaging a set of look-alike candidates against a known root cause. Not for initial discovery with no bug in hand.
repo: trailofbits/skills
Popularidad
- Estrellas en GitHub
- 8,0 mil
- Posición en el ranking
- #12739
- Licencia
- CC-BY-SA-4.0
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
audit-context-building
8,0 milAyuda a tu agente a conocer un código desconocido antes de una revisión de seguridad, mapeando qué supone, garantiza y necesita cada función.
algorand-vulnerability-scanner
8,0 milAyuda a tu agente a revisar contratos de Algorand en TEAL o PyTeal en busca de 11 problemas de seguridad comunes, como el rekeying o las tarifas sin control.
audit-prep-assistant
8,0 milAyuda a tu agente a preparar tu código para una auditoría de seguridad externa, con análisis estático, pruebas, limpieza de código muerto y buena documentación.
cairo-vulnerability-scanner
8,0 milAyuda a tu agente a revisar contratos de Cairo en StarkNet en busca de 6 problemas graves, como desbordamientos, mensajes arriesgados entre capas y firmas repetidas.
Skills parecidas
reverse-engineer-anything
422 milAyuda a tu agente a revisar apps y paquetes ya publicados para explicar sus funciones, comparar versiones o guiar una reconstrucción, usando la herramienta REA.
1password
394 milAyuda a tu agente a instalar la CLI de 1Password, iniciar sesión y leer o inyectar secretos sin imprimir sus valores en el chat.
healthcheck
394 milAyuda a tu agente a auditar el ordenador o servidor que ejecuta OpenClaw en busca de riesgos de seguridad, como SSH, cortafuegos, actualizaciones y copias de seguridad, y después sugerir arreglos seguros.