data-structure-protocol
Qué hace
Esta herramienta ayuda a la IA a entender la estructura de un proyecto de código, cómo se conectan sus partes y por qué existen. Así, la IA puede navegar y modificar el código de forma más eficiente sin tener que releerlo todo.
Cuándo usarla
- ✓Cuando la IA necesita entender cómo está organizado un proyecto de código.
- ✓Antes de hacer cambios grandes en el código, para saber qué podría verse afectado.
- ✓Cuando quieres que la IA te ayude a mapear u organizar un proyecto.
Link de la skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/data-structure-protocol/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Cómo puedo usar DSP para entender las dependencias entre los módulos de mi proyecto?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
DSP convierte el código en un mapa (grafo) donde cada parte es un 'nodo' y las conexiones son 'aristas'. Guarda información sobre el propósito de cada parte y el motivo de sus conexiones, todo en archivos de texto sencillos.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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.
…
Preguntas frecuentes
¿Qué es un 'grafo' en este contexto?
Un grafo es como un mapa de conexiones. Piensa en ciudades (partes del código) y carreteras (conexiones). DSP lo usa para mostrar cómo se enlazan las partes de tu código.
¿Por qué usar UIDs en lugar de rutas de archivo?
Los UIDs (identificadores únicos universales) son como nombres permanentes. Si renombras o mueves un archivo, el UID no cambia, así las conexiones siguen siendo correctas. Las rutas de archivo pueden cambiar.
¿Qué significa que 'cada conexión tiene un porqué'?
Además de saber que una parte del código usa otra, DSP registra el motivo de esa conexión. Esto ayuda a la IA a entender si es seguro eliminar o cambiar una conexión sin romper otras partes del proyecto.
Detalles
Descripción original del autor
Give agents persistent structural memory of a codebase — navigate dependencies, track public APIs, and understand why connections exist without re-reading the whole repo.
Popularidad
- Estrellas en GitHub
- 48 mil
- Posición en el ranking
- #4326
- Licencia
- MIT
- Actualizada
- 15/10/2026
Comentarios
- …
Más skills de este repositorio
00-andruia-consultant
48 milAyuda a tu agente a iniciar o mejorar proyectos de IA. Analiza código, sugiere herramientas y crea planes de acción en español.
007
48 milPermite que tu agente realice auditorías de seguridad y modelado de amenazas. Es útil para proteger proyectos contra ataques y vulnerabilidades.
10-andruia-skill-smith
48 milAyuda a tu agente a crear o mejorar herramientas de IA. Define cómo funcionan, escribe la documentación y valida la estructura.
20-andruia-niche-intelligence
48 milPermite que tu agente cree un resumen de un sector específico. Es útil para entender su contexto, normas, patrones de uso y riesgos, usando fuentes fiables.
Skills parecidas
diffs
394 milPermite que tu agente genere un diff real y compartible de los cambios, como enlace de visualización o archivo de imagen, en lugar de un resumen escrito a mano.
coding-agent
394 milAyuda a tu agente a pasar un trabajo de programación grande a Codex, Claude Code u OpenCode como trabajador en segundo plano, y después revisar su progreso.
gh-issues
394 milAyuda a tu agente a encontrar incidencias de GitHub, elegir cuáles trabajar y abrir pull requests con correcciones, incluido el seguimiento de los comentarios de revisión.