# Architecture Overview This documentation covers the internal architecture of `gsd-skill-creator` for contributors working on the codebase and library consumers building integrations. ## Layered Design Philosophy The codebase follows a strict layered architecture where dependencies flow downward only. Lower layers (types, storage) have no dependencies on higher layers (CLI, workflows). This enables: - **Testability**: Each layer can be tested in isolation - **Reusability**: Core modules work independently of CLI - **Maintainability**: Changes in one layer don't ripple upward ## Combined Data Flow Diagram ```mermaid flowchart TB subgraph Entry["Entry Points"] CLI["CLI Commands
src/cli/"] Hooks["Session Hooks
src/hooks/"] API["Library API
src/index.ts"] end subgraph Workflows["Orchestration Layer"] WF["Workflows
src/workflows/"] end subgraph Core["Core Processing"] App["Application
src/application/"] Sim["Simulation
src/simulation/"] Learn["Learning
src/learning/"] Cal["Calibration
src/calibration/"] end subgraph Analysis["Analysis Layer"] Obs["Observation
src/observation/"] Det["Detection
src/detection/"] Act["Activation
src/activation/"] Conf["Conflicts
src/conflicts/"] Comp["Composition
src/composition/"] Agents["Agents
src/agents/"] TeamsMod["Teams
src/teams/"] end subgraph Infrastructure["Infrastructure Layer"] Emb["Embeddings
src/embeddings/"] Test["Testing
src/testing/"] Val["Validation
src/validation/"] Store["Storage
src/storage/"] end subgraph Foundation["Foundation"] Types["Types
src/types/"] end CLI --> WF CLI --> Core CLI --> Analysis Hooks --> Obs API --> Core API --> Analysis API --> Infrastructure WF --> Core WF --> Infrastructure App --> Store App --> Val App --> Emb Sim --> Emb Sim --> Store Learn --> Store Cal --> Store Obs --> Store Det --> Store Act --> Emb Conf --> Emb Comp --> Store Agents --> Det Agents --> Store CLI --> TeamsMod TeamsMod --> Val TeamsMod --> Emb TeamsMod --> Conf Emb --> Types Test --> Types Val --> Types Store --> Types ``` ## Quick Navigation | Document | Purpose | |----------|---------| | [layers.md](layers.md) | Comprehensive 12+ layer module documentation with dependency matrix | | [data-flows.md](data-flows.md) | Per-operation data flow diagrams | | [storage.md](storage.md) | Storage locations and file formats | | [extending.md](extending.md) | Extension points and customization | ## Related Documentation For learning-oriented documentation, see: - [Getting Started](../GETTING-STARTED.md) - Installation and quickstart - [Workflows](../WORKFLOWS.md) - Common usage patterns - [Tutorials](../tutorials/) - Step-by-step guides: - [Skill Creation](../tutorials/skill-creation.md) - [Conflict Detection](../tutorials/conflict-detection.md) - [Calibration](../tutorials/calibration.md) - [CI Integration](../tutorials/ci-integration.md) - [Examples](../../examples/README.md) - Ready-to-use skill templates For reference documentation: - [API.md](../API.md) - Complete programmatic API reference - [CLI.md](../CLI.md) - Command-line interface reference - [GSD-TEAMS.md](../GSD-TEAMS.md) - GSD teams vs subagents decision guide - [RELEASE-HISTORY.md](../RELEASE-HISTORY.md) - Version history and changes