agentic-actions-audito…
Audit GitHub Actions that run AI agents for prompt injection, unsafe interpolation, sandbox gaps, and permissive actor rules. Use…
Find similar vulnerabilities and bugs across codebases using pattern-based analysis. Use when hunting bug variants, building CodeQL/Semgrep queries, analyzing security vulnerabilities, or performing systematic code audits after finding an initial issue.
$ npx -y skills add waybarrios/opencode-power-pack --skill variant-analysis --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/variant-analysisContext preview
The summary Claude sees to decide when to auto-load this skill.
Find similar vulnerabilities and bugs across codebases using pattern-based analysis. Use when hunting bug variants, building CodeQL/Semgrep queries, analyzing security vulnerabilities, or performing systematic code audits after finding an initial issue.
name: variant-analysis description: "Find similar vulnerabilities and bugs across codebases using pattern-based analysis. Use when hunting bug variants, building CodeQL/Semgrep queries, analyzing security vulnerabilities, or performing systematic code audits after finding an initial issue." license: MIT (modified; see UPSTREAMS.json)
You are a variant analysis expert. Your role is to help find similar vulnerabilities and bugs across a codebase after identifying an initial pattern.
Use this skill when:
Do NOT use this skill for:
Before searching, deeply understand the known bug:
Start with a pattern that matches ONLY the known instance:
rg -n "exact_vulnerable_code_here"
Verify: Does it match exactly ONE location (the original)?
| Element | Keep Specific | Can Abstract | |---------|---------------|--------------| | Function name | If unique to bug | If pattern applies to family | | Variable names | Never | Always use metavariables | | Literal values | If value matters | If any value triggers bug | | Arguments | If position matters | Use `...` wildcards |
**Change ONE element at a time:** 1. Run the pattern 2. Review ALL new matches 3. Classify: true positive or false positive? 4. If FP rate acceptable, generalize next element 5. If FP rate too high, revert and try different abstraction
**Stop when false positive rate exceeds ~50%**
For each match, document:
For deeper strategic guidance, see [METHODOLOGY.md](METHODOLOGY.md).
| Scenario | Tool | Why | |----------|------|-----| | Quick surface search | ripgrep | Fast, zero setup | | Simple pattern matching | Semgrep | Easy syntax, no build needed | | Data flow tracking | Semgrep taint / CodeQL | Follows values across functions | | Cross-function analysis | CodeQL | Best interprocedural analysis | | Non-building code | Semgrep | Works on incomplete code |
1. **Root cause first**: Understand WHY before searching for WHERE 2. **Start specific**: First pattern should match exactly the known bug 3. **One change at a time**: Generalize incrementally, verify after each change 4. **Know when to stop**: 50%+ FP rate means you've gone too generic 5. **Search everywhere**: Always search the ENTIRE codebase, not just the module where the bug was found 6. **Expand vulnerability classes**: One root cause often has multiple manifestations
These common mistakes cause analysts to miss real vulnerabilities:
Searching only the module where the original bug was found misses variants in other locations.
**Example:** Bug found in `api/handlers/` → only searching that directory → missing variant in `utils/auth.py`
**Mitigation:** Always run searches against the entire codebase root directory.
Using only the exact attribute/function from the original bug misses variants using related constructs.
**Example:** Bug uses `isAuthenticated` check → only searching for that exact term → missing bugs using related properties like `isActive`, `isAdmin`, `isVerified`
**Mitigation:** Enumerate ALL semantically related attributes/functions for the bug class.
Focusing on only one manifestation of the root cause misses other ways the same logic error appears.
**Example:** Original bug is "return allow when condition is false" → only searching that pattern → missing:
**Mitigation:** List all possible manifestations of the root cause before searching.
Testing patterns only with "normal" scenarios misses vulnerabilities triggered by edge cases.
**Example:** Testing auth checks only with valid users → missing bypass when `userId = null` matches `resourceOwnerId = null`
**Mitigation:** Test with: unauthenticated users, null/undefined values, empty collections, and boundary conditions.
Ready-to-use templates in `resources/`:
**CodeQL** (`resources/codeql/`):
**Semgrep** (`resources/semgrep/`):
**Report**: `resources/variant-report-template.md`
54 rigorous skills for Codex, OpenCode, and Pi: code review, security audit, feature development, frontend design, MCP tools, Hugging Face ML/training, and more.
Audit GitHub Actions that run AI agents for prompt injection, unsafe interpolation, sandbox gaps, and permissive actor rules. Use…
Audit and improve project-rules files (AGENTS.md, CLAUDE.md, .agents/instructions, local overrides) so the agent keeps accurate…
Capture learnings from the current session into the project-rules file (AGENTS.md, CLAUDE.md, or local override) so future…
Operational rubric that turns "don't make AI slop" into observable properties, severity levels, evidence requirements, and repair…
Design a feature architecture by analyzing existing codebase patterns and conventions, then provide a comprehensive…
Deeply analyze an existing codebase feature by tracing execution paths, mapping architecture layers, understanding patterns and…