Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

dap-protocol-guide

БесплатноБез исполняемых скриптовНе проверен

Comprehensive guide for working with Debug Adapter Protocol in AIDB

ai-debugger-incот ai-debugger-inc★ 22 звезды на GitHub12 установок в других каталогах

Об этом скилле

DAP Protocol Guide for AIDB

This skill provides comprehensive guidance for working with the Debug Adapter Protocol (DAP) in AIDB. Use this when implementing features that interact with debug adapters, analyzing DAP message flows, or troubleshooting protocol-level issues.

Overview

The Debug Adapter Protocol (DAP) is a standardized protocol for communication between development tools and debug adapters. AIDB provides a fully-typed, authoritative implementation in src/aidb/dap/protocol/.

For system-wide DAP architecture, see docs/developer-guide/overview.md which includes:

  • Complete data flow diagrams
  • DAP client layer details
  • Integration with adapters and session management

Key Principles

  1. Always use existing protocol types - Don't create dictionaries manually
  2. Follow established patterns - Check adapter implementations before creating new request sequences
  3. Handle errors properly - DAP has specific error response patterns
  4. Respect initialization sequence - Initialize → Launch/Attach → ConfigurationDone
  5. Consider language differences - Python, JavaScript, and Java adapters have different behaviors

Authoritative Source

src/aidb/dap/protocol/ is THE authoritative reference for all DAP types and messages.

This package contains:

  • types.py - DAP data types (Breakpoint, StackFrame, Variable, etc.)
  • requests.py - All request message classes
  • responses.py - All response message classes
  • events.py - All event message classes
  • bodies.py - Request arguments and response bodies
  • base.py - Base classes (Request, Response, Event, ProtocolMessage)

Quick Reference

Common DAP Operations

# Import protocol types
from aidb.dap.protocol import (
    InitializeRequest,
    LaunchRequest,
    SetBreakpointsRequest,
    StackTraceRequest,
    ScopesRequest,
    VariablesRequest,
    ContinueRequest,
)
from aidb.dap.protocol.types import Source, SourceBreakpoint
from aidb.dap.protocol.bodies import (
    InitializeRequestArguments,
    LaunchRequestArguments,
    SetBreakpointsArguments,
    StackTraceArguments,
)

# Get next sequence number
seq = await client.get_next_seq()

# Build a request
request = SetBreakpointsRequest(
    seq=seq,
    arguments=SetBreakpointsArguments(
        source=Source(path="/path/to/file.py"),
        breakpoints=[
            SourceBreakpoint(line=10, condition="x > 5")
        ]
    )
)

# Send request and await response
response = await client.send_request(request)

Client Constants

Always use constants from src/aidb/dap/client/constants.py:

from aidb.dap.client.constants import (
    CommandType,
    EventType,
    StopReason,
)

# Check event type
if event.event == EventType.STOPPED.value:
    # Handle stopped event
    pass

# Check stop reason
if stopped_body.reason == StopReason.BREAKPOINT.value:
    # Handle breakpoint
    pass

Protocol Flow Overview

Standard Initialization Sequence

Client → Initialize Request
       ← Initialize Response (capabilities)
       ← Initialized Event
Client → SetBreakpoints (optional, multiple)
Client → SetExceptionBreakpoints (optional)
Client → ConfigurationDone Request
       ← ConfigurationDone Response
Client → Launch/Attach Request
       ← Launch/Attach Response
       [Debug session active]

Introspection Flow

       ← Stopped Event
Client → Threads Request
       ← Threads Response
Client → StackTrace Request (threadId)
       ← StackTrace Response (stackFrames)
Client → Scopes Request (frameId)
       ← Scopes Response (scopes)
Client → Variables Request (variablesReference)
       ← Variables Response (variables)

Execution Control

Client → Continue/Next/StepIn/StepOut Request
       ← Response (acknowledgement)
       ← Stopped Event (when execution stops again)

Resource Files

This skill is organized into focused resource files, each under 500 lines:

Core Protocol Operations

  • initialization-sequence.md

    • Initialize request/response
    • Attach vs Launch differences
    • Configuration done sequence
    • Language-specific initialization parameters
  • breakpoint-operations.md

    • Setting source breakpoints
    • Conditional breakpoints
    • Hit conditions and log points
    • Breakpoint verification
    • Language-specific breakpoint quirks
  • stack-inspection.md

    • Stack trace requests
    • Frame ID handling
    • Scope requests
    • Source references
    • Language-specific stack frame differences
  • variable-evaluation.md

    • Variables request
    • Variables reference tracking
    • Evaluate request
    • Expression contexts
    • Language-specific variable representations

Patterns & Best Practices

Language-Specific Differences

Python (debugpy)

  • Uses launch or attach request types
  • justMyCode contro
Полный SKILL.md на GitHub

Установить dap-protocol-guide в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

resources/advanced-breakpoint-types.mdresources/breakpoint-management.mdresources/breakpoint-operations.mdresources/initialization-sequence.mdresources/stack-inspection.mdresources/variable-evaluation.md

FAQ

Что делает скилл dap-protocol-guide?

Comprehensive guide for working with Debug Adapter Protocol in AIDB

Как установить скилл dap-protocol-guide?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл dap-protocol-guide запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить dap-protocol-guide с