Agent skill

Import Graph

by aspenkit in aspenkit/aspens

Static import analysis that builds dependency graphs, domain clusters, hub files, git churn hotspots, and file priority rankings

MITAuto-check passedAgent Workflows

Install Import Graph

skills CLI
$ npx skills add aspenkit/aspens --skill import-graph -a claude-code

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

GitHub CLI
$ gh skill install aspenkit/aspens import-graph --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/aspenkit/aspens.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/import-graph .claude/skills/import-graph && 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
import-graph
GitHub stars
102
Token cost
~1.1k tokens
SKILL.md length
461 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Static import analysis that builds dependency graphs, domain clusters, hub files, git churn hotspots, and file priority rankings

  • Agent Workflows work in your project
  • SKILL.md covers Domain purpose, Key Concepts, Critical Rules and References
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Import Graph is an agent skill from aspenkit/aspens. Static import analysis that builds dependency graphs, domain clusters, hub files, git churn hotspots, and file priority rankings

Its SKILL.md is about 1.1k 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 Agent Workflows. It works with Git. The repository describes itself as: Your CLAUDE.md stopped working at 200 lines. Generate scoped skill files from your import graph, auto-sync on every commit. Claude Code, Codex and OpenCode. The licence is MIT.

When your agent uses it

  • Agent Workflows work in your project

Example prompts

  • “/import-graph”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 8dde826. 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

    No scripts in the folder and no shell commands in SKILL.md.

    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

Import Graph loads about 1.1k tokens when it runs. Until then it costs about 35 tokens; SKILL.md has 461 words of instructions outside code blocks.

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

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 aspenkit/aspens at commit 8dde826, republished under its MIT licence (© aspenkit). 461 words, ~1,132 tokens.

Download SKILL.mdSave it as .claude/skills/import-graph/SKILL.md (or your agent's skills folder).
name
import-graph
description
Static import analysis that builds dependency graphs, domain clusters, hub files, git churn hotspots, and file priority rankings
triggers.files
src/lib/graph-builder.js, src/lib/graph-persistence.js, src/lib/parsers/**, src/commands/doc-graph.js, src/templates/hooks/graph-context-prompt.mjs
triggers.keywords
graph, import-graph, hubs, clusters, hotspots, code-map, graph.json, subgraph, priority, fanIn

You are working on the import graph system — static analysis that parses JS/TS and Python source files to produce dependency graphs, plus persistence/query layers for runtime use.

Domain purpose

The graph turns raw source into a queryable map of "what depends on what" so other aspens features (doc-init, doc-sync, doc-impact, the graph context hook) can rank files by importance, surface hubs, detect domain clusters, and inject just the relevant neighborhood into prompts. It is the substrate that makes context generation deterministic and code-aware rather than guess-based.

Key Concepts

graph-builder.js — buildRepoGraph(repoPath, languages?) runs a 9-step pipeline:

  1. Walk source files → 2. Parse imports → 3. Reverse edges → 4. Git churn → 5. Per-file metrics → 6. Priority ranking → 7. Hub detection → 8. Domain clustering → 9. Hotspots

graph-persistence.js — Persistence and query layer:

  • serializeGraph() converts raw graph to indexed format (O(1) lookups, file→cluster mapping)
  • persistGraphArtifacts(repoPath, rawGraph, options?) writes .claude/graph.json + .claude/code-map.md + .claude/graph-index.json + auto-gitignores them. Target-aware: if options.target.supportsGraph === false, returns serialized data without writing files.
  • extractSubgraph(graph, filePaths) returns 1-hop neighborhood of mentioned files + relevant hubs/hotspots/clusters
  • formatNavigationContext(subgraph) renders compact markdown (~50 line budget) for prompt injection
  • extractFileReferences(prompt, graph) tiered extraction: explicit paths → bare filenames → cluster keywords
  • generateCodeMap() / writeCodeMap() standalone overview for graph hook consumption — emits a Domain clusters block (via formatDomainClusters) and framework entry points only; cross-domain coupling, hotspots, and the totals/date footer are intentionally omitted because they churn on every sync
  • formatDomainClusters(clusters, files) — exported helper that renders the canonical Domain clusters block: clusters are merged by label, single-file clusters dropped, files per cluster capped at 5 and sorted by fanIn desc then path asc for sync stability; no per-cluster (N files) counts
  • generateGraphIndex() / saveGraphIndex() tiny inverted index (export names → files, hub basenames, cluster labels)

doc-graph.js — Target-aware: reads .aspens.json config, passes target to persistGraphArtifacts(). Shows different completion message for Codex target (artifacts not written).

Show full SKILL.md (166 more words)Show less

Critical Rules

  • await init before any parseJsImports call. es-module-lexer requires WASM initialization.
  • Priority formula is load-bearing: fanIn * 3.0 + exportCount * 1.5 + (isEntry ? 10.0 : 0) + churn * 2.0 + (1/(depth+1)) * 1.0. Downstream consumers depend on this ranking.
  • All paths are repo-relative strings, never absolute. Resolution functions convert abs→relative.
  • Graph artifacts are gitignored — ensureGraphGitignore() (internal to persistence) adds .claude/graph.json, .claude/graph-index.json, .claude/code-map.md to prevent commit loops.
  • Graph artifacts are Claude-only — when target has supportsGraph: false, persistGraphArtifacts returns serialized data for embedding (e.g., condensed code-map in root AGENTS.md) but writes no files.
  • Errors are swallowed, not thrown in graph-builder — parse failures return empty/null. The graph must always complete.
  • extractSubgraph logic is mirrored in graph-context-prompt.mjs (buildNeighborhood()). Keep both in sync.
  • doc-sync rebuilds graph on every sync — calls buildRepoGraph + persistGraphArtifacts (with target) to keep it fresh.
  • Code-map output is sync-stable — no totals, no dates, no hotspot churn counts, no +N more suffixes. Anything that varies between syncs without a real code change must stay out of generated context.

References

  • Hook mirror: src/templates/hooks/graph-context-prompt.mjs

Last Updated: 2026-05-11

© aspenkit, 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 .agents/skills/import-graph of aspenkit/aspens.

Open the folder on GitHubat commit 8dde826

Compare with similar skills

Import Graph 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.

Import Graph compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Import Graph this skillaspenkit/aspens102—~1.1kAutomated safety check: PassMIT
Darwin Skill Optimizeralchaincyf/darwin-skill6.2k1 repos~4.7kAutomated safety check: PassMIT
CodeGraph Agent Evalcolbymchenry/codegraph73k—~950Automated safety check: PassMIT
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
O2 Review Loopopenobserve/openobserve22k—~3.7kAutomated safety check: PassAGPL-3.0
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Darwin Skill Optimizer

    alchaincyf/darwin-skill

    Scores SKILL.md files on a nine-dimension rubric, then improves them in a keep-or-revert loop with independent judge agents, test prompts, git history and human checkpoints.

    6.2k GitHub starsUsed in 1 repo~4.7k tokens
    Agent WorkflowsAuto-check passed
  • CodeGraph Agent Eval

    colbymchenry/codegraph

    Benchmarks how much CodeGraph helps a coding agent on a real repository, comparing runs with and without it for a chosen local or published version.

    73k GitHub stars~950 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • O2 Review Loop

    openobserve/openobserve

    Splits a change into planner, coder and independent reviewer roles: you confirm a spec, a subagent implements it, and a separate reviewer checks each round's local WIP commit.

    22k GitHub stars~3.7k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from aspenkit/aspens

All 12 skills in this repo
  • Injects a project's own skills and AGENTS.md content into generic bundled agent template files, adding a tech-stack line and real conventions without touching an agent's core logic.

    102 GitHub stars~898 tokensUpdated 24 days ago
    Auto-check passed
  • Orientation to the aspens codebase for agents working on the CLI itself: its Node.js stack, commands, module layout and debug settings.

    102 GitHub stars~1.6k tokensUpdated 24 days ago
    Auto-check passed
  • Aspens CLI Shell

    aspenkit/aspens

    Project context for the aspens CLI entry point: Commander wiring, the welcome screen, missing-hook warnings, CliError exit handling and the public programmatic exports.

    102 GitHub stars~1.1k tokensUpdated 24 days ago
    Auto-check passed
  • Explains how the aspens generator routes output to Claude Code or Codex CLI targets and transforms generated skills and instruction files between their formats.

    102 GitHub stars~1.9k tokensUpdated 24 days ago
    Auto-check passed
  • Doc Impact

    aspenkit/aspens

    Context health analysis — freshness, domain coverage, hub surfacing, drift detection, LLM-powered interpretation, and auto-repair for generated agent context

    102 GitHub stars~1.3k tokensUpdated 24 days ago
    Auto-check passed
  • Doc Sync

    aspenkit/aspens

    Incremental skill updater that maps git diffs to affected skills and optionally auto-syncs via a post-commit hook

    102 GitHub stars~1.8k tokensUpdated 24 days ago
    Auto-check passed

Works with

Categories

Questions about Import Graph

What does Import Graph do?

Static import analysis that builds dependency graphs, domain clusters, hub files, git churn hotspots, and file priority rankings. Import Graph is an agent skill from aspenkit/aspens.

When should I use Import Graph?

Import Graph fits situations like: agent Workflows work in your project.

How do I install Import Graph in Claude Code?

Run `npx skills add aspenkit/aspens --skill import-graph -a claude-code`. Or copy the skill folder (.agents/skills/import-graph in aspenkit/aspens) into .claude/skills/import-graph in your project. Claude Code loads it when a task matches its description.

How do I install Import Graph in Codex?

Run `npx skills add aspenkit/aspens --skill import-graph -a codex`. Or copy the skill folder (.agents/skills/import-graph in aspenkit/aspens) into .agents/skills/import-graph in your project. Codex loads it when a task matches its description.

Can I use Import Graph 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 aspenkit/aspens --skill import-graph -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/import-graph, .gemini/skills/import-graph, .github/skills/import-graph and .opencode/skills/import-graph in your project.

What does Import Graph need to run?

SKILL.md names no scripts, command-line tools or credentials: Import Graph is instructions for the agent only. Our summary lists: Python 3.

Does Import Graph 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 Import Graph 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 Import Graph use?

Import Graph 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 Import Graph use?

About 1.1k tokens (SKILL.md is roughly 4.5k 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 Import Graph?

Skills that share tags, products or a category with Import Graph: Darwin Skill Optimizer (alchaincyf/darwin-skill, 6.2k stars), CodeGraph Agent Eval (colbymchenry/codegraph, 73k stars), Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars) and O2 Review Loop (openobserve/openobserve, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Import Graph?

aspenkit (a GitHub organization) maintains it in aspenkit/aspens, which has 102 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on September 12, 2026.

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