CO

code-understanding

Maps codebases from an attacker's perspective to trace flows and find vulnerabilities.

Install

mkdir -p .claude/skills/code-understanding && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12193" && unzip -o skill.zip -d .claude/skills/code-understanding && rm skill.zip

Installs to .claude/skills/code-understanding

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Provides adversarial code comprehension for security research, mapping architecture, tracing data flows, and hunting vulnerability variants to build ground-truth understanding before or alongside static analysis.
212 charsno explicit “when” trigger
Advanced

Key capabilities

  • Map high-level context of unfamiliar codebases
  • Trace data flows from untrusted input to dangerous sinks
  • Hunt for variants of identified vulnerable patterns
  • Explain unfamiliar code, frameworks, or patterns in depth

How it works

The skill provides adversarial code comprehension by mapping architecture, tracing data flows, and hunting vulnerability variants to build ground-truth understanding of how code works.

Inputs & outputs

You give it
Codebase files or a specific entry point/pattern
You get back
Structured output like context maps, flow traces, or variant lists

When to use code-understanding

  • Trace data flow
  • Hunt for vulnerability variants
  • Map architectural trust models
  • Analyze unfamiliar codebases

About this skill

Code Understanding Skill

This skill provides adversarial code comprehension for security research. It maps architecture, traces data flows, and hunts for vulnerability variants before or alongside static analysis.

Purpose

Complements scanning by building ground-truth knowledge of how code actually works:

  • Understand unfamiliar codebases quickly from an attacker's perspective
  • Trace exact data flows from untrusted input to dangerous sinks
  • Find all instances of a vulnerable pattern once one is identified
  • Build application context that improves scan signal and validation accuracy

When to Use

  • Before scanning: Build context so scanner results make sense immediately
  • During validation: Trace a finding's real path through the code
  • After a finding: Hunt for variants of the same pattern elsewhere
  • On unfamiliar code: Map architecture before launching any analysis

Modes

ModeCommand flagPurpose
Map--mapBuild high-level context: entry points, trust model, data paths
Trace--trace <entry>Follow one flow source → sink with full call chain
Hunt--hunt <pattern>Find all variants of a pattern across the codebase
Teach--teachExplain unfamiliar code, frameworks, or patterns in depth

Modes can be combined. Map → Trace → Hunt is the natural attack progression.


[CONFIG] Configuration

output_dir: resolved by raptor-run-lifecycle start understand
confidence_levels:
  high: "Direct code evidence — quote the line"
  medium: "Inferred from context — state the assumption"
  low: "Speculative — flag explicitly, verify before acting on"
flow_format: source → transform(s) → sink

[EXEC] Execution Rules

  1. Read actual code before making any claim. Do not rely on naming conventions or assumptions.
  2. Quote the exact line (file path + line number) as proof for every assertion.
  3. When tracing a flow, follow it until it terminates — don't stop at the first interesting function.
  4. When hunting variants, search the full codebase. Do not stop at the first match.
  5. When teaching, explain the mechanism, not just the name. Show the code that implements it.
  6. Produce structured output (context-map.json, flow-trace.json, variants.json) for integration with validation pipeline.
  7. libexec scripts: Run libexec/ scripts exactly as shown in the prompts — do not prepend bash, export commands, absolute paths, or additional shell logic. The permission system auto-approves libexec/raptor-* commands only when run in this exact form.

[GATES] MUST-GATEs

GATE-U1 [READ-FIRST]: Never describe how code works without reading it. If you haven't read a file, say so and read it before continuing.

GATE-U2 [ATTACKER-LENS]: When reading any code path, ask: where does trust transfer? Where are checks missing? Where does user input influence execution? These questions drive analysis, not just "does this code do what the comment says."

GATE-U3 [FULL-FLOW]: When tracing a data flow, follow every branch: happy path, error paths, middleware, async handlers. A missing check in an error path is still a missing check.

GATE-U4 [VARIANT-COMPLETE]: A variant hunt is not complete until the full codebase has been searched. If a pattern appears in one place, assume it appears in others until proven otherwise.

GATE-U5 [EVIDENCE-ONLY]: Confidence levels must match evidence. High confidence requires a quoted line. Medium requires a stated assumption. Low must be flagged and not acted on until verified.


[STYLE] Output Formatting

  • File references: path/to/file.py:42 format throughout
  • Flow format: source (file:line) → transform (file:line) → sink (file:line)
  • Confidence inline: (confidence: high — file:line) or (confidence: medium — assumed from X)
  • No red/green status indicators (perspective-dependent)
  • JSON outputs go to $WORKDIR/ for pipeline integration

Integration with Validation Pipeline

Shared inventory: MAP-0 runs build_checklist() to produce checklist.json with SHA-256 checksums per file. This is the same inventory used by /validate Stage 0. Coverage tracking (checked_by per function) is cumulative across both skills.

Checklist item schema (checklist.jsonfiles[].items[]):

FieldTypeValues / Notes
namestringFunction/global/macro/class name
kindstring"function", "global", "macro", "class"
line_startintFirst line of the item
line_endint|nullLast line (null if unknown)
signaturestringFull signature (functions only)
checked_bylist[str]Run IDs that have reviewed this item
metadataobjectLanguage-specific: visibility, params, return_type, attributes

The field is kind, not type. Source: core/inventory/extractors.CodeItem.

Output schemas are aligned with the validation pipeline's formats (attack-surface.json, attack-paths.json, findings.json).


Stages

StageModeGate(s)Output
Map--mapU1, U2context-map.json
Trace--traceU1, U2, U3, U5flow-trace-<id>.json
Hunt--huntU1, U4, U5variants.json
Teach--teachU1, U5none --- inline output

See stage-specific files for detailed instructions.

Optional: runtime probe (Map only)

If the target has a runnable binary, MAP-7 in map.md describes how to corroborate the static map with a sandbox(observe=True) probe. The runtime observation lands under a runtime_observation key in context-map.json with correlations against entry points and sinks — an entry point whose file the binary actually reads is "runtime-confirmed" rather than only structurally identified.

Skip when the target is library/source-only or when the operator has no consent to execute the binary.


Notice

This analysis is performed for defensive purposes, security research, and authorized security testing only.

When not to use it

  • When making claims without reading the actual code
  • When stopping a trace at the first interesting function
  • When stopping a variant hunt at the first match

Limitations

  • Requires reading actual code before making any claim
  • Must follow every branch when tracing a data flow
  • A variant hunt is not complete until the full codebase has been searched

How it compares

This skill focuses on building ground-truth knowledge from an attacker's perspective, complementing automated scanning with deep manual analysis.

Compared to similar skills

code-understanding side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
code-understanding (this skill)01moNo flagsAdvanced
red-team-tools-and-methodology76moReviewAdvanced
hunt-focus-definition17moNo flagsIntermediate
hunt-research-system-and-tradecraft17moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

red-team-tools-and-methodology

davila7

This skill should be used when the user asks to "follow red team methodology", "perform bug bounty hunting", "automate reconnaissance", "hunt for XSS vulnerabilities", "enumerate subdomains", or needs security researcher techniques and tool configurations from top bug bounty hunters.

759

hunt-focus-definition

OTRF

Define a focused hunt hypothesis by synthesizing completed system internals and adversary tradecraft research. Use this skill after research has been completed to narrow a high-level hunt topic into a single, concrete attack pattern with clear investigative intent. This skill produces a structured, testable hypothesis and should be used before selecting data sources, defining environment scope, or developing analytics.

13

hunt-research-system-and-tradecraft

OTRF

Research system internals and adversary tradecraft to ground a threat hunt in real system behavior and realistic abuse patterns. Use this skill at the start of hunt planning, when you are given a high-level hunt topic but lack a clear understanding of how the system normally operates or how adversaries are known to abuse it. This skill informs early hunt direction by producing candidate abuse patterns, key assumptions, and cited sources, and should be used before defining a concrete hunt hypothesis or selecting data sources.

13

security-research

protoLabsAI

Run a multi-step security intelligence workflow: scan CVE feeds, check Exploit-DB, aggregate security RSS, correlate with target intel, generate threat brief.

00

anti-reversing-techniques

T-Sunm

Understand anti-reversing, obfuscation, and protection techniques encountered during software analysis. Use when analyzing protected binaries, bypassing anti-debugging for authorized analysis, or u...

00

forensics

novice1248

CTFのForensics(フォレンジクス)ジャンル。パケット解析、ファイルカービング、ステガノグラフィ、メモリフォレンジクスについて説明。Forensics問題に取り組む際に参照。

00

Search skills

Search the agent skills registry