skills/project-graph/SKILL.md
Generates an interactive HTML map of any coding project showing all files, their connections, and entry-point flows, enriched by a living AI knowledge file that grows as the project is explored. Use when asked to generate a project graph, visualize project structure, map file connections or flows, get a high-level overview of a codebase, or answer questions about a project that already has a generated graph (technologies, services, how a flow works).
npx skillsauth add hashlips/agent-skills project-graphInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
scripts/generate-graph.py with python3; it has no third-party dependencies. The CLI is a thin wrapper over the scripts/project_graph/ package (discovery, parsing, flows, knowledge, build, render)..env*, .git/, .github/, .vscode/, and so on); the only dotfile it reads is .gitignore, and only to learn which paths to ignore. Never weaken this rule..gitignore automatically (via git ls-files, with a manual fallback), so node_modules, build output, and machine-local files never enter the graph.project-graph.html, written to the project root by default. It does not embed absolute machine paths; Go to file resolves the project root from where each user opens the HTML (with an optional per-browser override in the Config tab).project-graph.flows.json manifest so users can click a flow and see every file it touches.project-graph.knowledge.json at the project root holds AI-authored understanding (overview, technologies, services, flow insights and diagrams, file notes) and is merged into every regeneration. Writing the JSON alone does not update the dashboard — you must always regenerate project-graph.html afterward and verify the merge (see Knowledge update loop below).project-graph.knowledge.json contains flow diagrams, re-verify each against its entry point (and only files referenced in the diagram) before finishing; update any stale insight or diagram, leave accurate ones unchanged. See references/knowledge.md diagram refresh rules.PROJECT_GRAPH_RESULT line; never read the generated HTML wholesale to check it.generate-graph.py per references/portability.md; never hardcode one developer's paths.project-graph.html unless the user asks for it.project-graph.flows.json at the project root per references/flows.md.python3 "<path-to-skill>/scripts/generate-graph.py" [project_root]
Use generator_script from a previous PROJECT_GRAPH_RESULT when available; otherwise the skill path from this session, .cursor/skills/project-graph/ in the workspace, or ~/.cursor/skills/project-graph/. Pass an explicit [project_root] when cwd is not the codebase root.
0 and "ok": true in the final PROJECT_GRAPH_RESULT JSON line. Sanity-check the reported file/connection/flow counts against expectations.flow_diagrams > 0 in the result), spot-check each diagram against its entry point and referenced step files; merge updates for any that are stale, then re-run once more if you changed the knowledge file.project-graph.html in a browser and summarize what the graph shows, using references/dashboard-guide.md for tab semantics. On a first generation, offer to populate the project's overview, technologies, and services into the knowledge file.Use this whenever you add or change anything in project-graph.knowledge.json (including "Copy & explain" / "Copy & update" prompts from the dashboard). Do not mark the task complete until every step passes.
project-graph.knowledge.json (create on first use), update only the keys you learned about, set "updated" to today. Never wipe other keys.python3 "<path-to-skill>/scripts/generate-graph.py" [project_root]
0 and parse PROJECT_GRAPH_RESULT:
"ok": trueknowledge.present is true when the knowledge file existsknowledge.total_entries increased (or matches expectations if you only updated an existing entry)file_notes, flow_insights, technologies, etc.)problems mentioning the knowledge fileproject-graph.html in their browser (the open tab does not auto-refresh).If verification fails: fix the knowledge file (invalid JSON, wrong flow key, wrong file path) per references/knowledge.md and references/self-healing.md, then regenerate again. Never assume the dashboard updated without a successful generator run.
scripts/project_graph/ — stdlib-only modules the skill and agents can import individually:
| Module | Role |
|--------|------|
| constants.py | File-type sets, ignore rules, output filenames |
| discovery.py | Git-aware file listing (privacy-safe) |
| categorize.py | Node category classification |
| refs.py | Import/link extraction per language |
| resolver.py | Specifier → project path resolution |
| parsing.py | Docstring/summary extraction |
| flows.py | Auto/manifest flow detection and reachability |
| knowledge.py | project-graph.knowledge.json load and flow matching |
| build.py | Assemble nodes, edges, flows, knowledge payload |
| render.py + template.html | Self-contained HTML dashboard |
| verify.py | Output verification and PROJECT_GRAPH_RESULT |
| cli.py | Argument parsing and orchestration |
Import example (e.g. to inspect a payload without writing HTML): from project_graph.build import build_payload.
development
Static security audit of an Agent Skill package (untrusted text only)—safe to run, data-exfil and hidden-action risks, est_tokens, and a verdict. Use only when the user explicitly asks to scan, security-scan, or sanity-check a skill.
development
Gives a consistent rough token-size estimate for a file or folder of text using fixed integer rules. Use when you need repeatable ballpark token counts for Markdown or plain text without calling a provider API.
testing
Compresses Markdown to minimal token form while preserving facts and agent-executable intent; duplicates sources first and compresses skill packages (SKILL.md plus reference MD). Use when reducing context cost in docs, skills, or prompts at light, medium, heavy, or extreme compression.
data-ai
Naturalizes AI-assisted copy by removing statistical fingerprints while preserving the author's tone, meaning, and intent. Use when drafts sound polished but machine-smooth, when glued hyphen words need plain phrasing, or when any body of text needs a light pass to read more naturally.