Agent skill

Cpg Analysis

by alinaqi in alinaqi/maggy

Deep code property graph analysis with Joern CPG (AST+CFG+PDG) and CodeQL for control flow, data flow, taint analysis, and security auditing

MITAuto-check passedSecurity

Install Cpg Analysis

skills CLI
$ npx skills add alinaqi/maggy --skill cpg-analysis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alinaqi/maggy cpg-analysis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alinaqi/maggy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/cpg-analysis .claude/skills/cpg-analysis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cpg-analysis
GitHub stars
707
Token cost
~2k tokens
SKILL.md length
546 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Deep code property graph analysis with Joern CPG (AST+CFG+PDG) and CodeQL for control flow, data flow, taint analysis, and security auditing

  • Tasks that involve Static analysis and SAST
  • SKILL.md covers Tier Selection Guide, Tier 2: Joern CPG (CodeBadger…, Tier 3: CodeQL and Combined Workflow: Deep Analysis, plus 1 more section
  • Calls brew

What it does

Cpg Analysis is an agent skill from alinaqi/maggy. Deep code property graph analysis with Joern CPG (AST+CFG+PDG) and CodeQL for control flow, data flow, taint analysis, and security auditing

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Security, covering Static analysis and SAST. It works with Model Context Protocol. The repository describes itself as: What started as an opinionated Claude Code setup kit is now an autonomous AI engineering command center. The licence is MIT.

When your agent uses it

  • Tasks that involve Static analysis and SAST

Example prompts

  • “/cpg-analysis”

Requirements

  • Python 3
  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit 72a456e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cpg Analysis loads about 2k tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 546 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~38
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from alinaqi/maggy at commit 72a456e, republished under its MIT licence (© alinaqi). 546 words, ~2,029 tokens.

Download SKILL.mdSave it as .claude/skills/cpg-analysis/SKILL.md (or your agent's skills folder).
name
cpg-analysis
description
Deep code property graph analysis with Joern CPG (AST+CFG+PDG) and CodeQL for control flow, data flow, taint analysis, and security auditing
when-to-use
When deep code analysis is needed — control flow, data flow, taint tracking, or security auditing
user-invocable
true
effort
high

CPG Analysis Skill

Purpose: Deep code analysis beyond AST. Use Joern for full Code Property Graph (control flow, data flow, program dependencies) and CodeQL for interprocedural taint analysis and vulnerability detection.

These are opt-in tools. They require Docker/JVM (Joern) or CodeQL CLI. Use codebase-memory-mcp (Tier 1, always-on) for everyday navigation. Use these for deep analysis when Tier 1 is not enough.

┌────────────────────────────────────────────────────────────────┐
│  CODE PROPERTY GRAPH = AST + CFG + CDG + DDG + PDG             │
│  ─────────────────────────────────────────────────────────────│
│  AST  = Abstract Syntax Tree (structure)                       │
│  CFG  = Control Flow Graph (execution paths)                   │
│  CDG  = Control Dependency Graph (conditional dependencies)    │
│  DDG  = Data Dependency Graph (data flow between statements)   │
│  PDG  = Program Dependency Graph (CDG + DDG combined)          │
│                                                                │
│  Tier 2 (Joern): Full CPG with 40+ query tools                │
│  Tier 3 (CodeQL): Interprocedural taint + security queries     │
└────────────────────────────────────────────────────────────────┘

Tier Selection Guide

Simple symbol lookup, dependency trace, blast radius?
  → Tier 1: codebase-memory-mcp (always on, sub-ms)

Control flow paths, data flow, dead code, complex refactoring?
  → Tier 2: Joern CPG (on-demand, seconds)

Security audit, taint analysis, vulnerability detection?
  → Tier 3: CodeQL (on-demand, seconds to minutes)

Full security review before release?
  → All three tiers in sequence

Tier 2: Joern CPG (CodeBadger MCP)

When to Use Joern
ScenarioWhy JoernTier 1 Can't Do This
Trace data flow through functionsFull DDG traversalTier 1 has no data flow
Understanding control flow pathsCFG analysis with branch conditionsTier 1 has no CFG
Finding dead/unreachable codePDG reachability analysisTier 1 only detects unused exports
Complex refactoring impactCross-function dependency chainsTier 1 limited to call graph
Auditing third-party library usageDeep call chain traversalTier 1 stops at import boundary
Understanding exception flowCFG includes throw/catch pathsTier 1 ignores exceptions
Key MCP Tools (Joern/CodeBadger)
ToolPurposeExample Query
generate_cpgBuild CPG for projectFirst-time setup or after major changes
get_cpg_statusCheck CPG build statusVerify CPG is ready before querying
run_cpgql_queryRun arbitrary CPGQL queriescpg.method("login").callOut.code.l
get_cpgql_syntax_helpQuery language referenceWhen unsure about query syntax
get_cfgControl flow graph for a methodUnderstand execution paths in a function
list_methodsList all methods in projectOverview of available functions
get_method_sourceGet source code of a methodRead specific function source
list_callsList calls from/to a methodCaller/callee analysis
get_call_graphFull call graph visualizationUnderstand call chains
get_type_definitionType/class definitionsUnderstand type hierarchy
Supported Languages (Joern)

Java, Scala, C/C++, Python, JavaScript, TypeScript, PHP, Ruby, Go, Kotlin, Swift, Lua

Not supported: Rust (use CodeQL for Rust)

MCP Configuration (Joern)
json
{
  "mcpServers": {
    "codebadger": {
      "url": "http://localhost:4242/mcp",
      "type": "http"
    }
  }
}
Prerequisites
  • Docker (for Joern backend)
  • Python 3.10+ (for MCP server)
  • Install: ~/.claude/install-graph-tools.sh --joern
Common CPGQL Queries
scala
// Find all methods that handle user input
cpg.method.where(_.parameter.name(".*input.*|.*request.*")).name.l

// Trace data flow from parameter to return
cpg.method("processPayment").parameter.reachableBy(cpg.method("processPayment").methodReturn).l

// Find methods with high cyclomatic complexity
cpg.method.where(_.controlStructure.size > 10).name.l

// Dead code: methods with no callers
cpg.method.where(_.callIn.size == 0).filter(_.name != "main").name.l

// Exception flow: methods that can throw but callers don't catch
cpg.method.where(_.ast.isThrow.size > 0).callIn.method.filter(_.ast.isTry.size == 0).name.l

Tier 3: CodeQL

Show full SKILL.md (242 more words)Show less
When to Use CodeQL
ScenarioWhy CodeQLOther Tiers Can't Do This
Security audit before releaseInterprocedural taint analysisJoern has basic taint, CodeQL is deeper
Reviewing auth/payment codeData flow from source to sinkCross-function, cross-file taint
PR security reviewTargeted vulnerability scanPre-built OWASP query packs
Compliance checkingCWE/OWASP pattern matchingCurated security query suites
Rust security analysisFull Rust supportJoern doesn't support Rust
Key MCP Tools (CodeQL)
ToolPurpose
run_queryExecute a CodeQL query against the database
find_definitionsLocate symbol definitions
find_referencesFind all references to a symbol
get_resultsParse BQRS (Binary Query Result Sets)
Supported Languages (CodeQL)

C/C++, C#, Go, Java, Kotlin, JavaScript, TypeScript, Python, Ruby, Swift, Rust

MCP Configuration (CodeQL)
json
{
  "mcpServers": {
    "codeql": {
      "command": "codeql-mcp",
      "args": ["--database", ".code-graph/codeql-db"]
    }
  }
}
Prerequisites
  • CodeQL CLI (brew install codeql on macOS)
  • Install: ~/.claude/install-graph-tools.sh --codeql
Common CodeQL Patterns
ql
// SQL injection: user input flows to SQL query
import python
from DataFlow::PathNode source, DataFlow::PathNode sink
where TaintTracking::hasFlowPath(source, sink)
  and source instanceof RemoteFlowSource
  and sink instanceof SqlExecution
select sink, source, sink, "SQL injection from $@.", source, "user input"

// Unvalidated redirect
from DataFlow::PathNode source, DataFlow::PathNode sink
where source instanceof RemoteFlowSource
  and sink instanceof RedirectSink
select sink, "Unvalidated redirect from user input"

Combined Workflow: Deep Analysis

When performing security review or complex refactoring, use all tiers:

1. SCOPE       → Tier 1: detect_changes / get_architecture
                 Identify files and modules in scope

2. STRUCTURE   → Tier 1: search_graph / trace_call_path
                 Map the call graph and dependencies

3. FLOW        → Tier 2: get_cfg / run_cpgql_query
                 Analyze control flow and data flow paths

4. SECURITY    → Tier 3: run_query with taint analysis
                 Check for vulnerabilities in data paths

5. REPORT      → Combine findings from all tiers
                 Prioritize: Critical > High > Medium > Low

Anti-Patterns

Anti-PatternDo This Instead
Using Joern/CodeQL for simple symbol lookupUse Tier 1 search_graph (sub-ms vs seconds)
Running full CPG build on every commitBuild CPG on-demand; use Tier 1 for continuous monitoring
Querying Joern without checking get_cpg_statusAlways verify CPG is built and current before querying
Running CodeQL without a specific security questionHave a hypothesis first; CodeQL queries are expensive
Ignoring Tier 1 blast radius before deep analysisAlways scope with Tier 1 first, then go deep on flagged areas
Using CodeQL for non-security structural queriesUse Joern CPGQL for structural/flow queries; CodeQL for security

© alinaqi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/cpg-analysis of alinaqi/maggy.

Open the folder on GitHubat commit 72a456e

Compare with similar skills

Cpg Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cpg Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cpg Analysis this skillalinaqi/maggy707—~2kAutomated safety check: PassMIT
Ida Reversesickn33/agentic-awesome-skills47k1 repos~3.1kAutomated safety check: PassMIT
Codeql Auditdeonmenezes/mantishack504—~325Automated safety check: PassApache-2.0
Agent Bom RegistryLeoYeAI/openclaw-master-skills2.2k—~969Automated safety check: PassApache-2.0
Secknowledge SkillPa55w0rd/secknowledge-skill424—~2.7kAutomated safety check: PassNone
Evm Audit Flowmtarcure/claude-vibe-squad164—~1.5kAutomated safety check: PassMIT

Similar skills

  • Ida Reverse

    sickn33/agentic-awesome-skills

    Reverse engineer binaries with IDA Pro: decompilation, disassembly, data-flow tracking, cross-references, and IDA MCP automation for deep static analysis of PE/ELF/Mach-O targets.

    47k GitHub starsUsed in 1 repo~3.1k tokens
    SecurityAuto-check passed
  • Codeql Audit

    deonmenezes/mantishack

    Build a CodeQL database and run dataflow-backed query-suite analysis via the mantiscodeql MCP server

    504 GitHub stars~325 tokensUpdated 6 days ago
    SecurityAuto-check passed
  • Agent Bom Registry

    LeoYeAI/openclaw-master-skills

    MCP server security registry and trust assessment — look up servers in the 427+ server security metadata registry, run pre-install marketplace checks, batch fleet risk scoring, assess skill file…

    2.2k GitHub stars~969 tokensUpdated 2 mo ago
    SecurityAuto-check passed
  • Secknowledge Skill

    Pa55w0rd/secknowledge-skill

    Web+AI 安全测试知识库。融合 WooYun 88,636 案例 + 先知 L1-L4 方法论 + GAARM 173 风险 + OWASP Top 10 (LLM/ASI/WSTG)。

    424 GitHub stars~2.7k tokensUpdated 3 mo ago
    SecurityAuto-check passed
  • Evm Audit Flow

    mtarcure/claude-vibe-squad

    A skill your agent uses when you have a Foundry or Hardhat repository of Solidity or Vyper contracts and want the end-to-end EVM review workflow on native CLIs — a slither static pass, semgrep taint…

    164 GitHub stars~1.5k tokensUpdated 18 days ago
    SecurityAuto-check passed
  • Semgrep Triage

    deonmenezes/mantishack

    Run semgrep via the mantissemgrep MCP server and triage results into the candidate/confirmed/rejected lifecycle

    504 GitHub stars~312 tokensUpdated 6 days ago
    SecurityAuto-check passed

More from alinaqi/maggy

All 71 skills in this repo
  • Aeo Optimization

    alinaqi/maggy

    AI Engine Optimization - semantic triples, page templates, content clusters for AI citations

    707 GitHub stars~3.7k tokensUpdated 15 days ago
    Auto-check passed
  • Agent Teams

    alinaqi/maggy

    Claude Code Agent Teams - default team-based development with strict TDD pipeline enforcement

    707 GitHub stars~5k tokensUpdated 15 days ago
    Auto-check: notes
  • AI Models

    alinaqi/maggy

    Latest AI models reference - Claude, OpenAI, Gemini, Eleven Labs, Replicate

    707 GitHub stars~4.1k tokensUpdated 15 days ago
    Auto-check passed
  • Android Java

    alinaqi/maggy

    Android Java development with MVVM, ViewBinding, and Espresso testing

    707 GitHub stars~3.9k tokensUpdated 15 days ago
    Auto-check: notes
  • Android Kotlin

    alinaqi/maggy

    Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing

    707 GitHub stars~3k tokensUpdated 15 days ago
    Auto-check passed
  • Autonomous Testing

    alinaqi/maggy

    AI-driven testing agent that auto-discovers, generates, executes, evaluates, and fixes tests for any project type

    707 GitHub stars~1.1k tokensUpdated 15 days ago
    Auto-check passed

Categories

Questions about Cpg Analysis

What does Cpg Analysis do?

Deep code property graph analysis with Joern CPG (AST+CFG+PDG) and CodeQL for control flow, data flow, taint analysis, and security auditing. Cpg Analysis is an agent skill from alinaqi/maggy.

When should I use Cpg Analysis?

Cpg Analysis fits situations like: tasks that involve Static analysis and SAST.

How do I install Cpg Analysis in Claude Code?

Run `npx skills add alinaqi/maggy --skill cpg-analysis -a claude-code`. Or copy the skill folder (skills/cpg-analysis in alinaqi/maggy) into .claude/skills/cpg-analysis in your project. Claude Code loads it when a task matches its description.

How do I install Cpg Analysis in Codex?

Run `npx skills add alinaqi/maggy --skill cpg-analysis -a codex`. Or copy the skill folder (skills/cpg-analysis in alinaqi/maggy) into .agents/skills/cpg-analysis in your project. Codex loads it when a task matches its description.

Can I use Cpg Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alinaqi/maggy --skill cpg-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cpg-analysis, .gemini/skills/cpg-analysis, .github/skills/cpg-analysis and .opencode/skills/cpg-analysis in your project.

What does Cpg Analysis need to run?

Going by SKILL.md and its folder, Cpg Analysis needs the command-line tools its instructions call (brew). Our summary lists: Python 3; Docker.

Does Cpg Analysis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cpg Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cpg Analysis use?

Cpg Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cpg Analysis use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cpg Analysis?

Skills that share tags, products or a category with Cpg Analysis: Ida Reverse (sickn33/agentic-awesome-skills, 47k stars), Codeql Audit (deonmenezes/mantishack, 504 stars), Agent Bom Registry (LeoYeAI/openclaw-master-skills, 2.2k stars) and Secknowledge Skill (Pa55w0rd/secknowledge-skill, 424 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cpg Analysis?

alinaqi (a GitHub user) maintains it in alinaqi/maggy, which has 707 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on September 24, 2026.

Source: alinaqi/maggy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.