data-structure-protocol
SKILL.md
Data Structure Protocol (DSP)
DSP builds a dependency graph of project entities in a .dsp/ directory. Each entity (module, function, external dependency) gets a UID, description, import list, and export index. The graph answers: what exists, why it exists, what depends on what, and who uses what.
DSP is NOT documentation for humans or AST dump. It captures meaning (purpose), boundaries (imports/exports), and reasons for connections (why).
Agent Prompt
Embed this context when working on a DSP-tracked project:
This project uses DSP (Data Structure Protocol). The
.dsp/directory is the entity graph of this project: modules, functions, dependencies, public API. It is your long-term memory of the code structure.Core rules:
- Before changing code — find affected entities via
dsp-cli search,find-by-source, orread-toc. Read theirdescriptionandimportsto understand context.- When creating a file/module — call
dsp-cli create-object. For each exported function —create-function(with--owner). Register exports viacreate-shared.- When adding an import — call
dsp-cli add-importwith a briefwhy. For external dependencies — firstcreate-object --kind externalif the entity doesn't exist yet.- When removing import / export / file — call
remove-import,remove-shared,remove-entityrespectively. Cascade cleanup is automatic.