dsp-core

A set of project rules for DSP, a graph-based record of a codebase's structure stored in a .dsp directory.

In plain words
What is it for?
Use it to inspect project structure, find tracked files, check dependencies and consumers, register new code, record imports, expose shared APIs, and update the DSP record after changes.
Why use it?
It helps the agent understand what code depends on what before changing files and keeps the structural record updated afterward.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/k-kolomeitsev/data-structure-protocol/dsp-core
Clone the repo
git clone --depth 1 https://github.com/k-kolomeitsev/data-structure-protocol

Made for: Cursor.

Per session 504 This file is loaded in full into every session.
When invoked 504 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00504 $0.00504
Opus 5 $0.00252 $0.00252
Sonnet 5 $0.00101 $0.00101
Haiku 4.5 $0.00050 $0.00050

Measured 2d ago against content hash 32f8d6466bbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dsp-core scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

integrations/cursor/.cursor/rules/dsp-core.mdc · 41 lines

What it actually says

Data Structure Protocol — Core Rules

This project uses DSP (Data Structure Protocol) — a graph-based structural memory stored in .dsp/.

dsp-cli is shorthand for python <skill-path>/scripts/dsp-cli.py --root .. Arguments are positional — quote multi-word values.

Before Modifying Code

  1. Run dsp-cli read-toc to see the project structure overview
  2. Run dsp-cli find-by-source <file-path> to check if the file you're about to change is tracked
  3. If tracked, run dsp-cli get-entity <uid> to understand its purpose, imports, and shared exports
  4. Run dsp-cli get-parents <uid> to see what depends on this entity — avoid breaking consumers

After Creating New Files

  1. Register modules/classes: dsp-cli create-object <path> "<description>"
  2. Register functions: dsp-cli create-function "<path>#<symbol>" "<description>" --owner <parent-uid>
  3. Record dependencies: dsp-cli add-import <uid> <target-uid> "<reason>"
  4. Expose public APIs: dsp-cli create-shared <uid> <shared-entity-uid> — the shared argument is the UID of an existing entity (create it first), not an export name

After Deleting or Moving Files

  1. For deleted files: dsp-cli remove-entity <uid>
  2. For moved files: dsp-cli move-entity <uid> <new-path>
  3. For modules migrated between subprojects/roots: dsp-cli move-to-toc <uid> --from <TOC> --to <TOC> (<TOC> = root UID or default)
  4. Verify nothing is left dangling: dsp-cli get-orphans

Quick Lookup Commands

  • dsp-cli search "<query>" — find entities by keyword
  • dsp-cli get-children <uid> — dependency tree downward
  • dsp-cli get-recipients <uid> — find consumers of this entity
  • dsp-cli get-stats — project-wide graph statistics
  • dsp-cli detect-cycles — find circular dependencies
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 41 lines · 504 tokens per session scan A 32f8d6466bbe

Subscribe to this mod's changes

dsp-core is a cursor rule published in the GitHub repository k-kolomeitsev/data-structure-protocol (65 stars, last pushed 23d ago), licensed Apache-2.0. It adds 504 tokens to every session, about $0.0025 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.