flamegraph
Build a function call-graph flamegraph website for a Java codebase. Parses the sources, extracts every method and the calls between them, and renders a light-theme site where the user picks any class or method and sees its call tree as a hand-drawn SVG flamegraph. Use when the user runs /flamegraph or asks for a call graph, call-graph flamegraph, or a visualization of which methods call which.
- License 许可
- Unlicense
- 最近更新
- 2026-11-07
- Stars
- ★ 21
- Forks
- 9
01 前言 Front Matter
- name
- flamegraph
- description
- Build a function call-graph flamegraph website for a Java codebase. Parses the sources, extracts every method and the calls between them, and renders a light-theme site where the user picks any class or method and sees its call tree as a hand-drawn SVG flamegraph. Use when the user runs /flamegraph or asks for a call graph, call-graph flamegraph, or a visualization of which methods call which.
02 资源文件 1
- 脚本build_flamegraph.py15.3 KB
03 SKILL.md 正文
flamegraph
Generate a static call-graph flamegraph website for the Java project the user is working on.
Steps
-
Find the Java source root. Prefer
src/main/java; if absent, use the directory the user points at or the closest directory containing.javafiles. If the user names a specific module or subproject, scope to it. -
Run the generator that ships with this skill:
python3 ~/.claude/skills/flamegraph/build_flamegraph.py <java-src-dir> <out-dir> [title]Use
flamegraph-siteinside the target project as<out-dir>unless the user asks for another location, and pass the project name as the title. -
The script writes a single self-contained
index.html. Serve it withpython3 -m http.serverfrom<out-dir>(pick a free port) or tell the user to open the file directly, then report the URL or path. -
Tell the user how to use the site: the left panel lists every class and method, the search box filters it, clicking any method roots the flamegraph at that method, clicking a frame re-roots into it, and the breadcrumb trail walks back up. Frame width is proportional to the number of distinct call paths underneath, hovering shows file, line, and fan-in/fan-out, and a
↺mark means a recursive cycle was pruned.
Notes
- The site is light themed and hand-drawn in style: wobbly SVG frames, pastel fills per class, handwriting fonts.
- The call graph is static: it is resolved from source text via field, parameter, and local-variable types, so dynamic dispatch through interfaces resolves only when the declared type itself defines the method.
- The generator needs only the Python standard library; do not install anything.
- If the script reports no methods found, confirm the path actually contains
.javafiles before retrying.
04 同仓库更多 Skills
word-count
Counts the words, lines and characters of a text or a file.
slugify
Turns a title or a sentence into a URL slug, lowercase words joined by hyphens with accents removed.
json-format
Validates a JSON file and pretty prints it with two space indentation, or reports where the JSON is invalid.
commit-message
Writes a conventional commit message for the staged git changes.
skills-gateway
Gateway and router to a catalog of skills that are not registered directly. Use it before any task a specialized skill could handle, such as text, JSON or git chores. It finds the right skill and loads its instructions.
decision-log
Record, list, show and supersede architecture decisions that persist across sessions in the shared agent infra state store. Use when the user says "record this decision", "log an ADR", "what did we decide about", "list decisions", or "supersede decision".