C4 architecture c4 architecture

From diegosouzapw/awesome-omni-skills · View interactive version

C4 architecture c4 architecture is an AI agent skill from the GitHub repository diegosouzapw/awesome-omni-skills. C4 Architecture Documentation Workflow workflow skill. Use this skill when the user needs Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach and the operator should preserve the upstream workflow, copied support files, and pro

How to use this skill

Skill file

C4 Architecture Documentation Workflow

Overview

This public intake copy packages plugins/antigravity-awesome-skills-claude/skills/c4-architecture-c4-architecture from https://github.com/sickn33/antigravity-awesome-skills into the native Omni Skills editorial shape without hiding its origin.

Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow.

This intake keeps the copied upstream files intact and uses the external_source block in metadata.json plus ORIGIN.md as the provenance anchor for review.

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, Context) to create a complete architectural documentation set that serves both technical and non-technical stakeholders.]

Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Phase 1: Code-Level Documentation (Bottom-Up Analysis), Phase 2: Component-Level Synthesis, Phase 3: Container-Level Synthesis, Phase 4: Context-Level Documentation, Configuration Options, Success Criteria.

When to Use This Skill

Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request.

Operating Table

| Situation | Start here | Why it matters |

| --- | --- | --- |

| First-time use | metadata.json | Confirms repository, branch, commit, and imported path through the external_source block before touching the copied workflow |

| Provenance review | ORIGIN.md | Gives reviewers a plain-language audit trail for the imported source |

| Workflow execution | SKILL.md | Starts with the smallest copied file that materially changes execution |

| Supporting context | SKILL.md | Adds the next most relevant copied source file without loading the entire package |

| Handoff decision | ## Related Skills | Helps the operator switch to a stronger native skill when the task drifts |

Workflow

This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow.

  1. Clarify goals, constraints, and required inputs.
  2. Apply relevant best practices and validate outcomes.
  3. Provide actionable steps and verification.
  4. If detailed examples are required, open resources/implementation-playbook.md.
  5. Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.
  6. Read the overview and provenance files before loading any copied upstream support files.
  7. Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.

Imported Workflow Notes

Imported: Instructions
Imported: Overview

This workflow creates comprehensive C4 architecture documentation following the official C4 model by:

  1. Code Level: Analyzing every subdirectory bottom-up to create code-level documentation
  2. Component Level: Synthesizing code documentation into logical components within containers
  3. Container Level: Mapping components to deployment containers with API documentation (shows high-level technology choices)
  4. Context Level: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)

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.

Imported: Phase 1: Code-Level Documentation (Bottom-Up Analysis)

1.1 Discover All Subdirectories

1.2 Process Each Directory (Bottom-Up)

For each directory, starting from the deepest:

Analyze the code in directory: [directory_path]

Create comprehensive C4 Code-level documentation following this structure:

1. Overview Section:

2. Code Elements Section:

3. Dependencies Section:

4. Relationships Section:

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:

Repeat for every subdirectory until all directories have corresponding c4-code-\*.md files.

Examples

Example 1: Ask for the upstream workflow directly

Use @c4-architecture-c4-architecture to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.

Explanation: This is the safest starting point when the operator needs the imported workflow, but not the entire repository.

Example 2: Ask for a provenance-grounded review

Review @c4-architecture-c4-architecture against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.

Explanation: Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.

Example 3: Narrow the copied support files before execution

Use @c4-architecture-c4-architecture for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.

Explanation: This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.

Example 4: Build a reviewer packet

Review @c4-architecture-c4-architecture using the copied upstream files plus provenance, then summarize any gaps before merge.

Explanation: This is useful when the PR is waiting for human review and you want a repeatable audit packet.

Imported Usage Notes

Imported: Example Usage
/c4-architecture:c4-architecture

This will:

  1. Walk through all subdirectories bottom-up
  2. Create c4-code-\*.md for each directory
  3. Synthesize into components
  4. Map to containers with API docs
  5. Create system context with personas and journeys

All documentation written to: C4-Documentation/

Best Practices

Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution.

Troubleshooting

Problem: The operator skipped the imported context and answered too generically

Symptoms: The result ignores the upstream workflow in plugins/antigravity-awesome-skills-claude/skills/c4-architecture-c4-architecture, fails to mention provenance, or does not use any copied source files at all.

Solution: Re-open metadata.json, ORIGIN.md, and the most relevant copied upstream files. Check the external_source block first, then restate the provenance before continuing.

Problem: The imported workflow feels incomplete during review

Symptoms: Reviewers can see the generated SKILL.md, but they cannot quickly tell which references, examples, or scripts matter for the current task.

Solution: Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it.

Problem: The task drifted into a different specialization

Symptoms: The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better.

Solution: Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind.

Related Skills

Additional Resources

Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding.

| Resource family | What it gives the reviewer | Example path |

| --- | --- | --- |

| references | copied reference notes, guides, or background material from upstream | references/n/a |

| examples | worked examples or reusable prompts copied from upstream | examples/n/a |

| scripts | upstream helper scripts that change execution or validation | scripts/n/a |

| agents | routing or delegation notes that are genuinely part of the imported package | agents/n/a |

| assets | supporting assets or schemas copied from the source package | assets/n/a |

Imported Reference Notes

Imported: Phase 2: Component-Level Synthesis

2.1 Analyze All Code-Level Documentation

2.2 Create Component Documentation

For each identified component:

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:

1. Overview Section:

2. Purpose Section:

3. Software Features Section:

4. Code Elements Section:

5. Interfaces Section:

6. Dependencies Section:

7. Component Diagram:

Save the output as: C4-Documentation/c4-component-[component-name].md

Use a sanitized component name for the filename.

2.3 Create Master Component Index

Create a master component index that lists all components in the system.

Based on all c4-component-\*.md files created, generate:

1. System Components Section:

2. Component Relationships Diagram:

Save the output as: C4-Documentation/c4-component.md

Imported: Phase 3: Container-Level Synthesis

3.1 Analyze Components and Deployment Definitions

3.2 Map Components to Containers

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:

1. Containers Section (for each container):

2. Purpose Section (for each container):

3. Components Section (for each container):

4. Interfaces Section (for each container):

5. API Specifications:

6. Dependencies Section (for each container):

7. Infrastructure Section (for each container):

8. Container Diagram:

Save the output as: C4-Documentation/c4-container.md

Imported: Phase 4: Context-Level Documentation

4.1 Analyze System Documentation

4.2 Create Context Documentation

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:

1. System Overview Section:

2. Personas Section:

3. System Features Section:

4. User Journeys Section:

1. [Step 1]: [Description]

2. [Step 2]: [Description]

...

5. External Systems and Dependencies Section:

6. System Context Diagram:

7. Related Documentation Section:

Save the output as: C4-Documentation/c4-context.md

Ensure the documentation is:

Imported: Configuration Options
Imported: Success Criteria
Imported: Output Structure
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
    └── ...
Imported: Coordination Notes
Imported: Limitations
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.