From forge
Provides C4 architecture documentation workflow guidance — generating comprehensive C4 docs from an existing codebase using bottom-up analysis. Use when documenting existing codebases for new team members, creating architecture overviews for stakeholders, generating API documentation, or building complete C4 documentation sets.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge:c4The summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides knowledge and workflow guidance for generating comprehensive C4 architecture documentation from an existing codebase using bottom-up analysis — from code level through components, containers, to system context.
This skill provides knowledge and workflow guidance for generating comprehensive C4 architecture documentation from an existing codebase using bottom-up analysis — from code level through components, containers, to system context.
This skill should be used when:
Phase 1: Code Level → Analyze directories bottom-up
Phase 2: Component Level → Synthesize into logical components
Phase 3: Container Level → Map to deployment units + APIs
Phase 4: Context Level → Create stakeholder-friendly overview
Note: Per the C4 model, most teams only need Context and Container diagrams. Generate all levels for completeness, but stop at any phase if sufficient.
Document every code directory from deepest to shallowest. For each directory, identify functions/methods, classes/modules, internal and external dependencies, and design patterns. Output: c4-code-[directory-name].md per directory.
Group code documentation into logical components by domain, technical, or organizational boundaries. Document responsibilities, interfaces, and dependencies. Create component index with master Mermaid diagram.
Map components to deployment units by analyzing Dockerfiles, K8s manifests, Terraform configs, etc. Document container APIs with OpenAPI specifications. Create container diagram.
Create stakeholder-friendly system overview. Identify all personas (human and programmatic), document system features and user journeys, map external dependencies. Create context diagram.
C4-Documentation/
├── c4-context.md # Level 1: System context (start here)
├── c4-container.md # Level 2: Deployment architecture
├── c4-component.md # Level 3: Component index
├── c4-component-[name].md # Level 3: Individual components
├── c4-code-[name].md # Level 4: Code-level docs
└── apis/
└── [container]-api.yaml # OpenAPI specs
c4-code-*.md file| Option | Default | Description |
|---|---|---|
target_directory | repo root | Root directory to analyze |
output_directory | C4-Documentation/ | Where to write docs |
exclude_patterns | node_modules, .git, build, dist | Directories to skip |
include_tests | true | Analyze test files for context |
api_format | openapi | Format for API specs |
levels | all | Which C4 levels to generate |
c4-context.md first for the big picturec4-code-*.md for complex modules| File | Content |
|---|---|
references/workflow-phases.md | Detailed tasks and actions for each phase |
references/documentation-patterns.md | C4 documentation templates, Mermaid syntax, and validation checklists |
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub caiokf/forge --plugin forge