Import Graph logo

Import Graph

Organization
aspenkit
import-graph

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

Overview

Publisheraspenkit
Repositoryaspens
Skill nameimport-graph
Stars
102
Forks
7
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by aspenkit on GitHub. Read the source before you install it.

Installation

Install the Import Graph AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/aspenkit/aspens/tree/main/.agents/skills/import-graph
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/aspenkit/aspens.git /tmp/aspens
mkdir -p .claude/skills
cp -r /tmp/aspens/.agents/skills/import-graph .claude/skills/import-graph
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Import Graph in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Import Graph on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Import Graph is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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).

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

Frequently asked questions

What does the Import Graph AI skill do?

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

Why use Import Graph on TypingMind?

Because you install it once and use it with any model. Import Graph is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Import Graph in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/aspenkit/aspens/tree/main/.agents/skills/import-graph. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Import Graph?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Import Graph?

As many as you like. As long as a model supports skills, you can use Import Graph with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Import Graph AI skill free?

Yes. It is published on GitHub by aspenkit under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇