structurizr-architecture-sync
БесплатноБез исполняемых скриптовНе проверенMaintain Structurizr C4 architecture diagrams in sync with code changes. Use when adding components, modifying relationships, changing architectural…
от VilnaCRM-Org★ 16 звёзд на GitHubОб этом скилле
Structurizr Architecture Synchronization
Context (Input)
Use this skill when:
- Adding new components (controllers, handlers, services, repositories)
- Creating new entities or aggregates
- Modifying component relationships or dependencies
- Implementing new architectural patterns (CQRS, events, subscribers)
- Adding infrastructure components (databases, caches, message brokers)
- Refactoring that changes component structure
- After fixing Deptrac violations (may indicate architecture drift)
- Creating new bounded contexts or modules
- Implementing new API endpoints with significant handlers
Task (Function)
Keep the Structurizr workspace (workspace.dsl) synchronized with codebase changes, ensuring C4 model diagrams accurately represent the current system architecture.
Success Criteria:
workspace.dslcontains all significant components- Component relationships match actual code dependencies
- Layer groupings (Application/Domain/Infrastructure) are accurate
- Component descriptions reflect current purpose
- All infrastructure dependencies are documented
- C4 diagrams render without errors (check at
http://localhost:${STRUCTURIZR_PORT:-8080})
Quick Start: Update Architecture in 5 Steps
Complete Template: See reference/workspace-template.md for full workspace.dsl structure.
Step 1: Identify Architectural Changes
Determine if your code changes are architecturally significant:
✅ DO update workspace.dsl when adding:
- Processors (HTTP/GraphQL handlers)
- Command Handlers (CQRS pattern)
- Event Subscribers (event-driven patterns)
- Entities (core domain objects)
- Domain Events (significant business events)
- Repositories (data access)
- Event Bus or infrastructure services
- External dependencies (DB, Cache, Message Broker)
❌ DON'T update for:
- Factory classes
- Transformer classes (unless critical)
- Value objects (unless architecturally significant)
- Interface definitions (except hexagonal ports)
- Base classes
- DTOs and input/output objects
- Utility classes and helpers
Target: 15-25 components per diagram for clarity.
Step 2: Add Component to Appropriate Group
Edit workspace.dsl and add component in the correct layer group:
group "Application" {
newProcessor = component "NewProcessor" "Handles new requests" "RequestProcessor" {
tags "Item"
}
}
Layers:
group "Application"- Controllers, Processors, Handlers, Subscribersgroup "Domain"- Entities, Domain Eventsgroup "Infrastructure"- Repositories, Event Bus, Infrastructure services
External dependencies (database, cache, messageBroker) go OUTSIDE groups at container level.
See: reference/dsl-syntax.md for complete syntax.
Step 3: Define Relationships
Add relationships showing how your component interacts:
// After all component definitions
newProcessor -> commandHandler "dispatches NewCommand"
commandHandler -> repository "uses"
repository -> database "accesses data"
Common patterns: See reference/relationship-patterns.md
Step 4: Verify Diagram Renders
View the updated diagram:
# Refresh browser (Structurizr Lite auto-reloads)
# Port is configurable via STRUCTURIZR_PORT in .env (default: 8080)
open http://localhost:${STRUCTURIZR_PORT:-8080}
# Navigate to "Diagrams" → "Components_All"
Check for:
- No syntax errors displayed
- New component appears
- Relationships are visible
- Component is in correct layer group
Step 5: Position and Commit
- Drag components in the UI to improve layout
- Click "Save workspace" button (saves to
workspace.json) - Commit both files:
git add workspace.dsl workspace.json
git commit -m "feat: update architecture with new processor"
Diagram as Code Workflow
Setup (Already Configured)
Docker: Structurizr Lite runs in docker-compose.override.yml:
structurizr:
image: structurizr/lite:2024.07.02
ports:
- '${STRUCTURIZR_PORT}:8080'
volumes:
- ./:/usr/local/structurizr
Access: http://localhost:${STRUCTURIZR_PORT:-8080} (port configurable via .env)
Standard Development Flow
- Implement code changes → Add handler, entity, repository
- Update workspace.dsl → Add component + relationships
- View locally → Refresh browser at configured port
- Position components → Drag in UI, click "Save workspace"
- Commit together → Code + workspace.dsl + workspace.json in same PR
Manual Positioning in UI
Automatic layout doesn't work well - use manual positioning:
- Open Structurizr UI in browser
- Navigate to "Diagrams" → "Components_All"
- Drag components to arrange (left-to-right flow recommended)
- Click "Save workspace" button in top-right
- Positions saved to
workspace.jsonin project root - Commit
workspace.jsonwithworkspace.dsl
Установить structurizr-architecture-sync в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл structurizr-architecture-sync?
Maintain Structurizr C4 architecture diagrams in sync with code changes. Use when adding components, modifying relationships, changing architectural boundaries, or implementing new patterns. Ensures workspace.dsl accurately reflects the current system architecture.
Как установить скилл structurizr-architecture-sync?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл structurizr-architecture-sync запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic