aidb-architecture
Comprehensive architectural reference for AIDB core and MCP integration. Covers 6-layer architecture (MCP, Service, Session, Adapter, DAP Client, Protocol), component organization, data flow patterns, and design decisions. Use when explaining overall system design or understanding how layers interact.
Best use case
aidb-architecture is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Comprehensive architectural reference for AIDB core and MCP integration. Covers 6-layer architecture (MCP, Service, Session, Adapter, DAP Client, Protocol), component organization, data flow patterns, and design decisions. Use when explaining overall system design or understanding how layers interact.
Teams using aidb-architecture should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/aidb-architecture/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How aidb-architecture Compares
| Feature / Agent | aidb-architecture | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Comprehensive architectural reference for AIDB core and MCP integration. Covers 6-layer architecture (MCP, Service, Session, Adapter, DAP Client, Protocol), component organization, data flow patterns, and design decisions. Use when explaining overall system design or understanding how layers interact.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# AIDB Architecture Skill ## Overview This skill provides a comprehensive architectural reference for understanding AIDB's multi-layered architecture, focusing on `aidb` core library and `aidb_mcp` MCP integration. **Purpose:** Enable developers to navigate the codebase confidently, understand component responsibilities, trace data flows, and make correct architectural decisions. **Scope:** - **PRIMARY:** `aidb/` (core debugging library), `aidb_mcp/` (MCP server integration) - **SECONDARY:** `aidb_common/`, `aidb_logging/` (supporting utilities) - **EXCLUDED:** `aidb_cli/` (covered by `dev-cli-development` skill) ______________________________________________________________________ ## When to Use This Skill **Use this skill when:** - Understanding overall system architecture - Tracing data flow across layers (e.g., MCP tool call → DAP adapter) - Identifying component responsibilities - Making architectural decisions (which layer to modify) - Understanding design patterns and rationale - Debugging cross-layer issues **Do NOT use this skill for:** - Deep adapter implementation patterns → Use `adapter-development` skill - DAP protocol details → Use `dap-protocol-guide` skill - MCP tool development → Use `mcp-tools-development` skill ______________________________________________________________________ ## 6-Layer Architecture ``` ┌─────────────────────────────────────────────────────────────┐ │ Layer 1: MCP Layer (aidb_mcp/) │ │ ├── 12 debugging tools for AI agents │ │ ├── Handler dispatch, response optimization │ │ └── Session management integration │ ├─────────────────────────────────────────────────────────────┤ │ Layer 2: Service Layer (aidb/service/) │ │ ├── DebugService - Main entry point │ │ ├── SessionManager, SessionBuilder (in aidb/session/) │ │ └── .execution / .stepping / .breakpoints / .variables │ ├─────────────────────────────────────────────────────────────┤ │ Layer 3: Session Layer (aidb/session/) │ │ ├── Session - Infrastructure hub │ │ ├── SessionState, SessionConnector │ │ ├── SessionRegistry, ResourceManager │ │ └── Parent-child session support (JavaScript) │ ├─────────────────────────────────────────────────────────────┤ │ Layer 4: Adapter Layer (aidb/adapters/) │ │ ├── DebugAdapter - Component delegation base │ │ ├── ProcessManager, PortManager, LaunchOrchestrator │ │ └── Language Adapters - Python, JavaScript, Java │ ├─────────────────────────────────────────────────────────────┤ │ Layer 5: DAP Client Layer (aidb/dap/client/) │ │ ├── DAPClient - Single request path │ │ ├── Transport, RequestHandler, EventProcessor │ │ └── MessageRouter, ConnectionManager │ ├─────────────────────────────────────────────────────────────┤ │ Layer 6: Protocol Layer (aidb/dap/protocol/) │ │ └── Fully-typed DAP specification (see dap-protocol-guide) │ └─────────────────────────────────────────────────────────────┘ ``` ______________________________________________________________________ ## Quick Navigation **"I want to understand..."** | Topic | Resource | Contents | | ------------------------ | ---------------------------------------------------------------- | ------------------------------------------------------------------------------- | | **MCP & Service Layers** | [api-mcp-layer.md](resources/api-mcp-layer.md) | 12 tools, handler pattern, response system, DebugService, execution/stepping | | **Session Layer** | [session-layer.md](resources/session-layer.md) | Infrastructure hub, SessionState, SessionConnector, parent-child sessions | | **Adapter Layer** | [adapter-architecture.md](resources/adapter-architecture.md) | DebugAdapter base, ProcessManager, PortManager, lifecycle hooks, Python/JS/Java | | **DAP Client** | [dap-client.md](resources/dap-client.md) | Single request path, Future-based async, event handling, design decisions | | **Patterns & Resources** | [patterns-and-resources.md](resources/patterns-and-resources.md) | Architectural principles, three-tier cleanup, resource management, data flows | ______________________________________________________________________ ## Key Architectural Principles 1. **Component Delegation** - Focused components vs monolithic classes 1. **Language-Agnostic Design** - Pluggable adapter architecture 1. **Human-Cadence Debugging** - Breakpoints before execution, one step at a time 1. **Resource Lifecycle Management** - Multi-tier cleanup with defense-in-depth 1. **Parent-Child Session Support** - JavaScript subprocess debugging 1. **Single Request Path** - No circular dependencies in DAP client 1. **Three-Tier Cleanup** - DAP disconnect → process termination → port release For detailed explanations, see [patterns-and-resources.md](resources/patterns-and-resources.md). ______________________________________________________________________ ## Resource Management Summary **Three-Tier Cleanup Strategy:** 1. **Tier 1:** DAP disconnect (graceful adapter shutdown) 1. **Tier 2:** Process termination (SIGTERM → SIGKILL escalation) 1. **Tier 3:** Port release (registry updates) **Why Order Matters:** Prevents port conflicts and orphaned processes. **Key Components:** - Process Registry (`aidb/resources/pids.py`) - Port Registry (`aidb/resources/ports.py`) - Orphan Cleanup (`aidb/resources/orphan_cleanup.py`) - ResourceManager (`aidb/session/resource.py`) ______________________________________________________________________ ## Related Skills | Skill | Use For | | ----------------------- | ------------------------------------------------- | | `adapter-development` | Language-specific adapter implementation patterns | | `dap-protocol-guide` | DAP protocol specification and usage | | `mcp-tools-development` | MCP tool creation and agent optimization | ______________________________________________________________________ ## Resources | Resource | Content | | ---------------------------------------------------------------- | --------------------------------------------------------------------------- | | [api-mcp-layer.md](resources/api-mcp-layer.md) | MCP server, 12 tools, handler pattern, Service layer, execution/stepping | | [session-layer.md](resources/session-layer.md) | Session architecture, infrastructure hub, state management, parent-child | | [adapter-architecture.md](resources/adapter-architecture.md) | Adapter base class, components, lifecycle hooks, language-specific patterns | | [dap-client.md](resources/dap-client.md) | DAP client design, single request path, Future-based async, events | | [patterns-and-resources.md](resources/patterns-and-resources.md) | Architectural principles, resource management, cleanup, data flows | **Documentation:** - Architecture overview → `docs/developer-guide/overview.md` - Component source → `src/aidb/`, `src/aidb_mcp/`, `src/aidb_cli/`, `src/aidb_common/`, `src/aidb_logging/` ______________________________________________________________________ ## Quick Reference **6 Layers:** MCP → Service → Session → Adapter → DAP Client → Protocol **Key Patterns:** Component delegation, language-agnostic, human-cadence debugging, resource lifecycle, parent-child sessions, single request path **5 Resource Files:** api-mcp-layer, session-layer, adapter-architecture, dap-client, patterns-and-resources
Related Skills
android-architecture
Use when implementing MVVM, clean architecture, dependency injection with Hilt, or structuring Android app layers.
analyzer-architecture-review
analyzerアプリケーションのアーキテクチャレビュー。Port&Adapterアーキテクチャ(ヘキサゴナルアーキテクチャ)のルールに従っているかをチェックします。新しいPort/Adapter/Usecase/Model追加時、PRレビュー時、またはアーキテクチャ違反の検出が必要な時に使用します。Port層の関数型定義、依存関係の方向、New*関数パターン、レイヤー分離などを検証します。
analyze-project-architecture
LLM-based architectural analysis that transforms raw project data into meaningful structure
analyze-architecture
Comprehensive brownfield architecture analysis for existing codebases. Discovers structure, identifies patterns, assesses quality, calculates production readiness, and provides actionable recommendations. Use when analyzing existing codebases to understand architecture, assess quality, or prepare for modernization.
agentic_architecture
Enforces high-level architectural thinking, separation of concerns, and scalability checks before coding.
agentic-jumpstart-architecture
Architecture guidelines for Jarvy CLI - codebase structure, tool implementation patterns, registry system, platform-specific code organization, and module conventions.
Advanced Clean Hexagonal Architecture
Apply Clean Architecture and Hexagonal (Ports & Adapters) patterns for domain isolation and testability. Use when designing system boundaries, creating ports/adapters, or structuring domain-driven applications.
ADR (Architecture Decision Record)
Create and maintain Architecture Decision Records following a consistent template
acc-architecture-doc-template
Generates ARCHITECTURE.md files for PHP projects. Creates layer documentation, component descriptions, and architectural diagrams.
1k-architecture
OneKey monorepo architecture and code organization. Use when understanding project structure, package relationships, import rules, or component organization. Triggers on architecture, structure, packages, imports, hierarchy, dependencies, monorepo, organization.
microservices-architecture
Microservices architecture patterns and best practices. Use when designing distributed systems, breaking down monoliths, or implementing service communication.
architecture-patterns
Padrões de arquitetura de software - Decisões OBJETIVAS sobre design de sistemas