본문으로 건너뛰기
Skillpedia
일반 코딩48k · #4326

data-structure-protocol

하는 일

이 도구는 AI가 코드 프로젝트의 구조, 부분들의 연결 방식, 그리고 각 부분이 존재하는 이유를 이해하도록 돕습니다. 이를 통해 AI가 모든 코드를 다시 읽지 않고도 더 효율적으로 탐색하고 수정할 수 있습니다.

사용하는 경우

  • ✓AI가 코드 프로젝트가 어떻게 구성되어 있는지 이해해야 할 때.
  • ✓큰 코드 변경을 하기 전에 무엇이 영향을 받을지 알고 싶을 때.
  • ✓AI가 프로젝트를 지도화하거나 정리하도록 하고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/data-structure-protocol/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“DSP를 사용해 제 프로젝트 모듈 사이의 의존 관계를 어떻게 파악할 수 있을까요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

DSP는 코드를 지도(그래프)로 바꿉니다. 각 부분은 '노드', 연결은 '엣지'로 표현됩니다. 각 부분의 목적과 연결의 이유를 모두 단순한 텍스트 파일에 저장합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

…

자주 묻는 질문

이 맥락에서 '그래프'란 무엇인가요?

연결 지도와 같습니다. 도시(코드 부분)와 도로(연결)를 떠올려 보세요. DSP는 이것으로 코드 부분들이 어떻게 이어지는지 보여 줍니다.

파일 경로 대신 UID를 쓰는 이유는 무엇인가요?

UID(고유 식별자)는 영구적인 이름과 같습니다. 파일 이름을 바꾸거나 옮겨도 UID는 바뀌지 않아 연결이 정확하게 유지됩니다. 파일 경로는 바뀔 수 있습니다.

'모든 연결에는 이유가 있다'는 것은 무엇을 뜻하나요?

한 코드 부분이 다른 부분을 사용한다는 사실뿐 아니라 DSP는 그 연결의 이유도 기록합니다. 이를 통해 AI는 다른 부분을 망가뜨리지 않고 연결을 제거하거나 바꿔도 안전한지 판단할 수 있습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
48k
순위
#4326
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬