← 返回 Skills 市场
sg345662365-oss

CodeGraph

作者 sg345662365-oss · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
41
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install codegraph
功能描述
Build and query AST summaries + call graphs for codebases. Use when exploring a project's structure, finding function definitions, tracing call chains, under...
使用说明 (SKILL.md)

Code Graph

Analyze project structure via AST parsing instead of reading every file.

Quick Start

Build cache (first time or after changes)

python3 skills/code-graph/scripts/analyze.py \x3Cproject_dir>

Creates .code-graph.json in the project root. Takes seconds for most projects.

Query the cache

python3 skills/code-graph/scripts/analyze.py \x3Cproject_dir> --query \x3Ccommand> [args]

Available Queries

Query Description
stats Project overview: file counts, lines, functions, classes
functions List all functions with file + line number
classes List all classes with bases, methods, file + line
calls \x3Cfunc> What does func call? (outgoing edges)
callers \x3Cfunc> Who calls func? (incoming edges)
file \x3Cpath> Full summary of one file (functions, classes, imports, calls)
imports Import graph: file → modules imported
search \x3Cpattern> Find functions/classes matching pattern

Workflow

  1. First encounter with a project: run the build to create cache
  2. Before reading files: query stats then search to find what you need
  3. Before modifying code: query callers to check impact
  4. After modifying code: rebuild cache with a fresh run (no --query)

Cache Location

  • Default: \x3Cproject_dir>/.code-graph.json
  • Override: --output \x3Cpath>

Rebuild

Re-run without --query to rebuild. The cache includes a fingerprint for staleness detection.

Exclude Directories

python3 skills/code-graph/scripts/analyze.py \x3Cproject_dir> --exclude vendor --exclude tmp

Default excludes: node_modules, .git, pycache, .venv, dist, build, .next, coverage

安全使用建议
Install only if you are comfortable with the skill creating a local .code-graph.json cache that summarizes file names, function/class names, imports, calls, line numbers, and the project path. Use --exclude or --output when scanning sensitive repositories.
能力评估
Purpose & Capability
The stated purpose is to build AST summaries, import lists, and call graphs for codebases; the script implements that behavior for Python, JavaScript/TypeScript, and Ruby without unrelated capabilities.
Instruction Scope
Runtime instructions are explicit and user-directed: run the analyzer on a chosen project directory, optionally query the cache, choose an output path, or exclude directories.
Install Mechanism
The artifact consists of SKILL.md and a single Python script, with no package installs, dependency declarations, background setup, or hidden install-time behavior.
Credentials
The script recursively reads source files under the provided project directory and writes .code-graph.json by default; this is proportionate for a code indexing skill but can capture private project structure.
Persistence & Privilege
Persistence is limited to a disclosed local JSON cache in the target project or a user-specified output path; there is no privilege escalation, network access, credential handling, or background process.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install codegraph
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /codegraph 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of code-graph. - Analyze Python and JavaScript/TypeScript projects by parsing ASTs and generating structural caches. - Quickly query functions, classes, imports, and call graphs without re-parsing files. - Provides project stats, function/class listings, call/caller lookups, import graphs, file summaries, and flexible search. - Supports fast cache rebuild and directory exclusion for efficient analysis. - Cache is stored in the project root and staleness is auto-detected.
元数据
Slug codegraph
版本 1.0.0
许可证 MIT-0
累计安装 2
当前安装数 2
历史版本数 1
常见问题

CodeGraph 是什么?

Build and query AST summaries + call graphs for codebases. Use when exploring a project's structure, finding function definitions, tracing call chains, under... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 41 次。

如何安装 CodeGraph?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install codegraph」即可一键安装,无需额外配置。

CodeGraph 是免费的吗?

是的,CodeGraph 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

CodeGraph 支持哪些平台?

CodeGraph 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 CodeGraph?

由 sg345662365-oss(@sg345662365-oss)开发并维护,当前版本 v1.0.0。

💬 留言讨论