Agent Skillsmtarcure/claude-vibe-squad › variant-analysis

variant-analysis

GitHub

在确认缺陷后,通过语义或AST查询全面扫描代码库、历史及衍生代码中的同类变体,验证可达性并提出统一修复方案。

.claude/skills/variant-analysis/SKILL.md mtarcure/claude-vibe-squad

Trigger Scenarios

已确认安全漏洞需排查类似风险 需要系统性查找代码中的重复缺陷模式

Install

npx skills add mtarcure/claude-vibe-squad --skill variant-analysis -g -y
More Options

Non-standard path

npx skills add https://github.com/mtarcure/claude-vibe-squad/tree/main/.claude/skills/variant-analysis -g -y

Use without installing

npx skills use mtarcure/claude-vibe-squad@variant-analysis

指定 Agent (Claude Code)

npx skills add mtarcure/claude-vibe-squad --skill variant-analysis -a claude-code -g -y

安装 repo 全部 skill

npx skills add mtarcure/claude-vibe-squad --all -g -y

预览 repo 内 skill

npx skills add mtarcure/claude-vibe-squad --list

SKILL.md

Frontmatter
{
    "name": "variant-analysis",
    "audience": "specialist",
    "description": "Use immediately after one defect is confirmed to sweep for structurally related siblings across current code, history, copies, vendored forks, services, or languages; encode a repeatable Semgrep or AST query, gate each hit independently, and propose one root-cause fix."
}

Variant Analysis

After one defect is confirmed, find every sibling of it in the codebase before closing the issue — the first instance is rarely the only one.

Steps

  1. Characterize the root cause precisely: the unsafe primitive, the missing check, and the condition that makes it exploitable. A vague characterization finds nothing.
  2. Decide the variant axes to sweep: same primitive elsewhere, same call site with a different input source, same missing check in sibling handlers, and the same idiom in other languages or services in the repo.
  3. Search structurally, not textually. Encode the pattern as a Semgrep rule via semgrep-rule-author or an AST query; grep misses reformatted and refactored instances, which are the ones that survive.
  4. Sweep history as well as the working tree: the same defect frequently exists in a copied file, a vendored fork, or a branch that was never merged back.
  5. For each candidate hit, run the reachability and impact gates from findings-filter — a variant is only a finding if it is independently reachable.
  6. Group confirmed variants under the single root cause and propose one structural fix, such as a safe wrapper or a type that makes the unsafe state unrepresentable, rather than N local patches.
  7. Where a local patch is unavoidable, add the rule to the repo's static-analysis config so future instances are caught at review time.
  8. Record the sweep's coverage explicitly: which axes were swept, which paths were excluded, and what would still be missed. An unbounded "we looked" claim is not coverage.

Acceptance

  • The root cause is stated as primitive + missing check + exploitability condition.
  • The sweep is structural (rule or AST query), with the query recorded and re-runnable.
  • Vendored, copied, and historical instances were searched, not just the working tree.
  • Each variant passed reachability and impact gates independently.
  • A single structural fix is proposed where possible, and a detection rule is added to prevent regression.
  • Sweep coverage and known gaps are stated explicitly.

Version History

  • d5262e2 Current 2026-09-11 11:49

Same Skill Collection

.agents/skills/accessible-media-authoring/SKILL.md
.agents/skills/agent-prompt-engineering/SKILL.md
.agents/skills/agentic-safety-audit/SKILL.md
.agents/skills/audio-event-map-authoring/SKILL.md
.agents/skills/auto-scaffold/SKILL.md
.agents/skills/claim-verification/SKILL.md
.agents/skills/code-reachability-audit/SKILL.md
.agents/skills/code-review-loop/SKILL.md
.agents/skills/color-theory/SKILL.md
.agents/skills/conversation-design/SKILL.md
.agents/skills/copy-refinement/SKILL.md
.agents/skills/cross-file-relationship-synthesis/SKILL.md
.agents/skills/dependency-cycle-audit/SKILL.md
.agents/skills/dependency-health-triage/SKILL.md
.agents/skills/detection-as-code/SKILL.md
.agents/skills/diff-aware-semgrep-scan/SKILL.md
.agents/skills/differential-review/SKILL.md
.agents/skills/dimensional-analysis-check/SKILL.md
.agents/skills/dual-level-retrieval/SKILL.md
.agents/skills/figma-implement-design/SKILL.md
.agents/skills/forensic-timeline-authoring/SKILL.md
.agents/skills/game-design-fundamentals/SKILL.md
.agents/skills/game-mechanics-balancing/SKILL.md
.agents/skills/head-tail/SKILL.md
.agents/skills/incident-response-runbook/SKILL.md
.agents/skills/interactive-audio-design/SKILL.md
.agents/skills/interface-ambiguity-check/SKILL.md
.agents/skills/keyword-clustering/SKILL.md
.agents/skills/knowledge-base-integration/SKILL.md
.agents/skills/layered-analysis-loop/SKILL.md
.agents/skills/level-design-patterns/SKILL.md
.agents/skills/locale-adaptation/SKILL.md
.agents/skills/narrative-structure/SKILL.md
.agents/skills/platform-compliance/SKILL.md
.agents/skills/player-engagement-psychology/SKILL.md
.agents/skills/requirements-elicitation/SKILL.md
.agents/skills/rule6-rights-gate/SKILL.md
.agents/skills/rule8-truth-gate/SKILL.md
.agents/skills/sandbox-provision-discipline/SKILL.md
.agents/skills/scope-decomposition/SKILL.md
.agents/skills/scope-estimation/SKILL.md
.agents/skills/security-ownership-map/SKILL.md
.agents/skills/security-threat-model/SKILL.md
.agents/skills/semgrep-rule-author/SKILL.md
.agents/skills/skill-description-trigger-authoring/SKILL.md
.agents/skills/sound-design-principles/SKILL.md
.agents/skills/structured-data-authoring/SKILL.md
.agents/skills/supply-chain-audit/SKILL.md
.agents/skills/take-over-resume/SKILL.md
.agents/skills/technical-seo-audit/SKILL.md

Metadata

Files
0
Version
d5262e2
Hash
33a1f37a
Indexed
2026-09-11 11:49

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-16 01:00
浙ICP备14020137号-1 $bản đồ khách truy cập$