From c4-architecture
Generates C4 architecture documentation (Context, Container, Component, Code levels) for a codebase via bottom-up analysis coordinated by four specialized agents.
How this command is triggered — by the user, by Claude, or both
Slash command
/c4-architecture:c4-architectureThe summary Claude sees in its command listing — used to decide when to auto-load this command
# C4 Architecture Documentation Workflow Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach. [Extended thinking: This workflow implements a complete C4 architecture documentation process following the C4 model (Context, Container, Component, Code). It uses a bottom-up approach, starting from the deepest code directories and working upward, ensuring every code element is documented before synthesizing into higher-level abstractions. The workflow coordinates four specialized C4 agents (Code, Component, Container, Cont...
Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.
[Extended thinking: This workflow implements a complete C4 architecture documentation process following the C4 model (Context, Container, Component, Code). It uses a bottom-up approach, starting from the deepest code directories and working upward, ensuring every code element is documented before synthesizing into higher-level abstractions. The workflow coordinates four specialized C4 agents (Code, Component, Container, Context) to create a complete architectural documentation set that serves both technical and non-technical stakeholders.]
This workflow creates comprehensive C4 architecture documentation following the official C4 model by:
Note: According to the C4 model, you don't need to use all 4 levels of diagram - the system context and container diagrams are sufficient for most software development teams. This workflow generates all levels for completeness, but teams can choose which levels to use.
All documentation is written to a new C4-Documentation/ directory in the repository root.
For each directory, starting from the deepest:
Use Task tool with subagent_type="c4-architecture::c4-code"
Prompt: | Analyze the code in directory: [directory_path]
Create comprehensive C4 Code-level documentation following this structure:
Save the output as: C4-Documentation/c4-code-[directory-name].md Use a sanitized directory name (replace / with -, remove special chars) for the filename.
Ensure the documentation includes:
Expected output: c4-code-.md file in C4-Documentation/
Context: All files in the directory and its subdirectories
Repeat for every subdirectory until all directories have corresponding c4-code-*.md files.
For each identified component:
Use Task tool with subagent_type="c4-architecture::c4-component"
Prompt: | Synthesize the following C4 Code-level documentation files into a logical component:
Code files to analyze: [List of c4-code-*.md file paths]
Create comprehensive C4 Component-level documentation following this structure:
Save the output as: C4-Documentation/c4-component-[component-name].md Use a sanitized component name for the filename.
Expected output: c4-component-.md file for each component
Context: All relevant c4-code-*.md files for this component
Use Task tool with subagent_type="c4-architecture::c4-component"
Prompt: | Create a master component index that lists all components in the system.
Based on all c4-component-*.md files created, generate:
Save the output as: C4-Documentation/c4-component.md
Expected output: Master c4-component.md file
Context: All c4-component-*.md files
Use Task tool with subagent_type="c4-architecture::c4-container"
Prompt: | Synthesize components into containers based on deployment definitions.
Component documentation: [List of all c4-component-*.md file paths]
Deployment definitions found: [List of deployment config files: Dockerfiles, K8s manifests, etc.]
Create comprehensive C4 Container-level documentation following this structure:
Save the output as: C4-Documentation/c4-container.md
Expected output: c4-container.md with all containers and API specifications
Context: All component documentation and deployment definitions
Use Task tool with subagent_type="c4-architecture::c4-context"
Prompt: | Create comprehensive C4 Context-level documentation for the system.
Container documentation: C4-Documentation/c4-container.md Component documentation: C4-Documentation/c4-component.md System documentation: [List of README, architecture docs, requirements, etc.] Test files: [List of test files that show system behavior]
Create comprehensive C4 Context-level documentation following this structure:
Save the output as: C4-Documentation/c4-context.md
Ensure the documentation is:
Expected output: c4-context.md with complete system context
Context: All container, component, and system documentation
target_directory: Root directory to analyze (default: current repository root)exclude_patterns: Patterns to exclude (default: node_modules, .git, build, dist, etc.)output_directory: Where to write C4 documentation (default: C4-Documentation/)include_tests: Whether to analyze test files for context (default: true)api_format: Format for API specs (default: openapi)C4-Documentation/
├── c4-code-*.md # Code-level docs (one per directory)
├── c4-component-*.md # Component-level docs (one per component)
├── c4-component.md # Master component index
├── c4-container.md # Container-level docs
├── c4-context.md # Context-level docs
└── apis/ # API specifications
├── [container]-api.yaml # OpenAPI specs for each container
└── ...
/c4-architecture:c4-architecture
This will:
All documentation written to: C4-Documentation/
npx claudepluginhub drtonylove1963/agents --plugin c4-architecture31plugins reuse this command
First indexed Mar 17, 2026
Showing the 6 earliest of 31 plugins
/c4-architectureGenerates C4 architecture documentation (Context, Container, Component, Code levels) for a codebase via bottom-up analysis coordinated by four specialized agents.
/c4Analyzes the current project and generates C4 architecture diagrams (all 4 levels) as GitHub-renderable Mermaid flowcharts and class diagrams.
/architecture-docGenerates a structured architecture document for a codebase or module, including component tables, data-flow diagrams, cross-cutting concerns, and gap analysis.
/create-architecture-documentationAnalyzes system architecture and generates comprehensive documentation across context, containers, components, data, security, and quality. Supports C4, Arc42, ADRs, and diagram-as-code via PlantUML or Mermaid.
/doc-generateGenerates comprehensive documentation from code — API docs, architecture diagrams, user guides, and technical references. Supports automation via CI/CD pipelines.
/diagramGenerates C4 architecture diagrams (context, container, component) in Mermaid or PlantUML from design documents.