Aller au contenu
Skillpedia
Programmation générale48k · #4326

data-structure-protocol

Ce qu’il fait

Cet outil aide l'IA à comprendre la structure d'un projet de code, la manière dont ses parties sont reliées et la raison de leur existence. L'IA peut ainsi naviguer dans le code et le modifier plus efficacement, sans tout relire.

Quand l’utiliser

  • ✓Lorsque l'IA doit comprendre comment un projet de code est organisé.
  • ✓Avant d'apporter des modifications importantes au code, pour savoir ce qui pourrait être affecté.
  • ✓Lorsque vous souhaitez que l'IA vous aide à cartographier ou à organiser un projet.

Lien du skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/data-structure-protocol/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/data-structure-protocol/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Comment puis-je utiliser DSP pour comprendre les dépendances entre les modules de mon projet ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

DSP transforme le code en une carte (graphe) où chaque élément est un « nœud » et chaque connexion une « arête ». Il stocke des informations sur le rôle de chaque élément et sur la raison de ses connexions, le tout dans de simples fichiers texte.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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:

  1. Identify root entrypoints (package.json main, framework entry, main.py, etc.)
  2. Document the root file: create-object, create-function for each export, create-shared, add-import for all dependencies
  3. Take the first non-external import, document it fully, descend into its imports
  4. Backtrack when no unvisited local imports remain; continue until all reachable files are documented
  5. External dependencies: create-object --kind external, add to TOC, but never descend into node_modules/site-packages/etc.

…

Questions fréquentes

Qu'est-ce qu'un « graphe » dans ce contexte ?

Un graphe est comme une carte des liens. Imaginez des villes (les éléments du code) reliées par des routes (les connexions). DSP utilise ce principe pour montrer comment les parties de votre code sont liées entre elles.

Pourquoi utiliser des UID plutôt que des chemins de fichiers ?

Les UID (identifiants uniques universels) sont comme des noms permanents. Si vous renommez ou déplacez un fichier, son UID ne change pas, ce qui garantit que les connexions restent correctes. Les chemins de fichiers, eux, peuvent changer.

Que signifie « chaque connexion a un pourquoi » ?

En plus de savoir qu'un élément du code en utilise un autre, DSP enregistre la raison de cette connexion. Cela aide l'IA à déterminer s'il est sans danger de supprimer ou de modifier une connexion sans casser d'autres parties du projet.

Détails

Description originale de l’auteur

Give agents persistent structural memory of a codebase — navigate dependencies, track public APIs, and understand why connections exist without re-reading the whole repo.

repo: sickn33/agentic-awesome-skills

Popularité

Étoiles GitHub
48k
Position au classement
#4326
Licence
MIT
Mis à jour
15/10/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires