Skip to main content
command

create-architecture-documentation — Claude Code command: architecture

A Claude slash command that turns your repo into architecture documentation: diagrams, ADRs and component descriptions.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command documentation/create-architecture-documentation
Open on GitHub

What create-architecture-documentation does

The command reads the repository before writing anything. It looks for config files (*.json, *.yaml, *.toml), files named like *architecture* or *design*, docker-compose.yml, k8s/ manifests and API specs (*openapi*, *swagger*). That context feeds the rest of the run.

Pick a format with an argument: --c4-model, --arc42, --adr, --plantuml or --full-suite. A framework name can go in as the first argument. The command is limited to Read, Write, Edit and Bash, so diagrams come out as code rather than exported images.

The scope is broad: service boundaries, data flows, database schemas, security, observability, decisions with their rationale. If the repo has no docker-compose.yml, no k8s/ and no API definitions, the generated context stays thin and several sections fall back to generic wording. Worth checking what the command can actually read before you run it.

What it helps with

  • map an existing system across C4 layers
  • record architecture decisions with their rationale
  • keep diagrams as code instead of hand-drawn images
  • chart services and what depends on what
  • hand architecture docs to a team or a client

Example prompts for the agent

  • /create-architecture-documentation --c4-model
  • /create-architecture-documentation --adr
  • /create-architecture-documentation --full-suite

How to install create-architecture-documentation

1claude-code-templates

npx claude-code-templates@latest --command documentation/create-architecture-documentation

2Manually: put the files in place

.claude/commands/create-architecture-documentation.md

Call it with /create-architecture-documentation. For all projects use ~/.claude/commands/

Questions about create-architecture-documentation

How do I install create-architecture-documentation in Claude?

Use the templates CLI: npx claude-code-templates@latest --command documentation/create-architecture-documentation. The command file then lives at .claude/commands/create-architecture-documentation.md.

What does create-architecture-documentation do?

It analyses the project structure and generates architecture documentation: diagrams, component descriptions and decision records. The format comes from an argument such as --c4-model or --arc42.

Which documentation formats are supported?

C4 Model, Arc42, ADR, PlantUML, plus a --full-suite mode that produces all of them. You pass the choice as an argument when invoking the command.

Source text

create-architecture-documentation.md · MIT
---
allowed-tools: Read, Write, Edit, Bash
argument-hint: "[framework] | --c4-model | --arc42 | --adr | --plantuml | --full-suite"
description: Generate comprehensive architecture documentation with diagrams, ADRs, and interactive visualization
---

# Architecture Documentation Generator

Generate comprehensive architecture documentation: $ARGUMENTS

## Current Architecture Context

- Project structure: !`find . -type f -name "*.json" -o -name "*.yaml" -o -name "*.toml" | head -5`
- Documentation exists: @docs/ or @README.md (if exists)
- Architecture files: !`find . -name "*architecture*" -o -name "*design*" -o -name "*.puml" | head -3`
- Services/containers: @docker-compose.yml or @k8s/ (if exists)
- API definitions: !`find . -name "*api*" -o -name "*openapi*" -o -name "*swagger*" | head -3`

## Task

Generate comprehensive architecture documentation with modern tooling and best practices:

1. **Architecture Analysis and Discovery**
   - Analyze current system architecture and component relationships
   - Identify key architectural patterns and design decisions
   - Document system boundaries, interfaces, and dependencies
   - Assess data flow and communication patterns
   - Identify architectural debt and improvement opportunities

2. **Architecture Documentation Framework**
   - Choose appropriate documentation framework and tools:
     - **C4 Model**: Context, Containers, Components, Code diagrams
     - **Arc42**: Comprehensive architecture documentation template
     - **Architecture Decision Records (ADRs)**: Decision documentation
     - **PlantUML/Mermaid**: Diagram-as-code documentation
     - **Structurizr**: C4 model tooling and visualization
     - **Draw.io/Lucidchart**: Visual diagramming tools

3. **System Context Documentation**
   - Create high-level system context diagrams
   - Document external systems and integrations
   - Define system boundaries and responsibilities
   - Document user personas and stakeholders
   - Create system landscape and ecosystem overview

4. **Container and Service Architecture**
   - Document container/service architecture and deployment view
   - Create service dependency maps and communication patterns
   - Document deployment architecture and infrastructure
   - Define service boundaries and API contracts
   - Document data persistence and storage architecture

5. **Component and Module Documentation**
   - Create detailed component architecture diagrams
   - Document internal module structure and relationships
   - Define component responsibilities and interfaces
   - Document design patterns and architectural styles
   - Create code organization and package structure documentation

6. **Data Architecture Documentation**
   - Document data models and database schemas
   - Create data flow diagrams and processing pipelines
   - Document data storage strategies and technologies
   - Define data governance and lifecycle management
   - Create data integration and synchronization documentation

7. **Security and Compliance Architecture**
   - Document security architecture and threat model
   - Create authentication and authorization flow diagrams
   - Document compliance requirements and controls
   - Define security boundaries and trust zones
   - Create incident response and security monitoring documentation

8. **Quality Attributes and Cross-Cutting Concerns**
   - Document performance characteristics and scalability patterns
   - Create reliability and availability architecture documentation
   - Document monitoring and observability architecture
   - Define maintainability and evolution strategies
   - Create disaster recovery and business continuity documentation

9. **Architecture Decision Records (ADRs)**
   - Create comprehensive ADR template and process
   - Document historical architectural decisions and rationale
   - Create decision tracking and review process
   - Document trade-offs and alternatives considered
   - Set up ADR maintenance and evolution procedures

10. **Documentation Automation and Maintenance**
    - Set up automated diagram generation from code annotations
    - Configure documentation pipeline and publishing automation
    - Set up documentation validation and consistency checking
    - Create documentation review and approval process
    - Train team on architecture documentation practices and tools
    - Set up documentation versioning and change management

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Writing and docs →

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor