tessl install github:sickn33/antigravity-awesome-skills --skill c4-architecture-c4-architecturegithub.com/sickn33/antigravity-awesome-skills
Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.
Review Score
66%
Validation Score
13/16
Implementation Score
77%
Activation Score
33%
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.]
resources/implementation-playbook.md.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-<directory-name>.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-<name>.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-architectureThis will:
All documentation written to: C4-Documentation/