data-structure-protocol
What it does
This tool helps AI understand a code project's structure, how parts connect, and why they exist. This allows the AI to navigate and modify code more efficiently without rereading everything.
When to use it
- βWhen the AI needs to understand how a code project is organized.
- βBefore making major code changes to know what might be affected.
- βWhen you want the AI to help map or organize a project.
Skill link
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/data-structure-protocol/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βHow can I use DSP to understand the dependencies between my project's modules?β
5 new skills a week. 1 minute to read.
How it works
DSP turns code into a map (graph) where each part is a 'node' and connections are 'edges'. It stores information about each part's purpose and the reason for its connections, all in simple text files.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Data Structure Protocol (DSP)
LLM coding agents lose context between tasks. On large codebases they spend most of their tokens on "orientation" β figuring out where things live, what depends on what, and what is safe to change. DSP solves this by externalizing the project's structural map into a persistent, queryable graph stored in a .dsp/ directory next to the code.
DSP is NOT documentation for humans and NOT an AST dump. It captures three things: meaning (why an entity exists), boundaries (what it imports and exposes), and reasons (why each connection exists). This is enough for an agent to navigate, refactor, and generate code without loading the entire source tree into the context window.
When to Use
Use this skill when:
- The project has a
.dsp/directory (DSP is already set up) - The user asks to set up DSP, bootstrap, or map a project's structure
- Creating, modifying, or deleting code files in a DSP-tracked project (to keep the graph updated)
- Navigating project structure, understanding dependencies, or finding specific modules
- The user mentions DSP, dsp-cli,
.dsp, or structure mapping - Performing impact analysis before a refactor or dependency replacement
Core Concepts
Code = graph
DSP models the codebase as a directed graph. Nodes are entities, edges are imports and shared/exports.
Two entity kinds exist:
- Object: any "thing" that isn't a function (module/file/class/config/resource/external dependency)
- Function: an exported function/method/handler/pipeline
Identity by UID, not by file path
Every entity gets a stable UID: obj-<8hex> for objects, func-<8hex> for functions. File paths are attributes that can change; UIDs survive renames, moves, and reformatting.
For entities inside a file, the UID is anchored with a comment marker in source code:
// @dsp func-7f3a9c12
export function calculateTotal(items) { ... }
# @dsp obj-e5f6g7h8
class UserService:
Every connection has a "why"
When an import is recorded, DSP stores a short reason explaining why that dependency exists. This lives in the exports/ reverse index of the imported entity. A dependency graph without reasons tells you what imports what; reasons tell you what is safe to change and who will break.
Storage format
Each entity gets a small directory under .dsp/:
.dsp/
βββ TOC # ordered list of all entity UIDs from root
βββ obj-a1b2c3d4/
β βββ description # source path, kind, purpose (1-3 sentences)
β βββ imports # UIDs this entity depends on (one per line)
β βββ shared # UIDs of public API / exported entities
β βββ exports/ # reverse index: who imports this and why
β βββ <importer_uid> # file content = "why" text
β βββ <shared_uid>/
β βββ description # what is exported
β βββ <importer_uid> # why this specific export is imported
βββ func-7f3a9c12/
βββ description
βββ imports
βββ exports/
Everything is plain text. Diffable. Reviewable. No database needed.
Full import coverage
Every file or artifact that is imported anywhere must be represented in .dsp as an Object β code, images, styles, configs, JSON, wasm, everything. External dependencies (npm packages, stdlib, etc.) are recorded as kind: external but their internals are never analyzed.
How It Works
Initial Setup
The skill relies on a standalone Python CLI script dsp-cli.py. If it is missing from the project, download it:
curl -O https://raw.githubusercontent.com/k-kolomeitsev/data-structure-protocol/main/skills/data-structure-protocol/scripts/dsp-cli.py
Requires Python 3.10+. All commands use python dsp-cli.py --root <project-root> <command>.
Bootstrap (initial mapping)
If .dsp/ is empty, traverse the project from root entrypoint(s) via DFS on imports:
- Identify root entrypoints (
package.jsonmain, framework entry,main.py, etc.) - Document the root file:
create-object,create-functionfor each export,create-shared,add-importfor all dependencies - Take the first non-external import, document it fully, descend into its imports
- Backtrack when no unvisited local imports remain; continue until all reachable files are documented
- External dependencies:
create-object --kind external, add to TOC, but never descend intonode_modules/site-packages/etc.
β¦
FAQ
What is a 'graph' in this context?
A graph is like a connection map. Think of cities (code parts) and roads (connections). DSP uses this to show how your code parts link together.
Why use UIDs instead of file paths?
UIDs (Unique Universal Identifiers) are like permanent names. If you rename or move a file, the UID doesn't change, ensuring connections stay correct. File paths can change.
What does 'every connection has a why' mean?
Besides knowing one code part uses another, DSP records the reason for that connection. This helps the AI understand if it's safe to remove or change a connection without breaking other parts of the project.
Details
Original description by the author
Give agents persistent structural memory of a codebase β navigate dependencies, track public APIs, and understand why connections exist without re-reading the whole repo.
Popularity
- GitHub stars
- 48k
- Ranking position
- #4326
- License
- MIT
- Updated
- 10/15/2026
Comments
- β¦
More skills from this repository
00-andruia-consultant
48kHelps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
007
48kLets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
10-andruia-skill-smith
48kHelps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
20-andruia-niche-intelligence
48kLets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.