C4 Architecture Documentation Workflow
Overview
This public intake copy packages plugins/antigravity-awesome-skills/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.
- Working on c4 architecture documentation workflow tasks or workflows
- Needing guidance, best practices, or checklists for c4 architecture documentation workflow
- The task is unrelated to c4 architecture documentation workflow
- You need a different domain or tool outside this scope
- Use when the request clearly matches the imported source intent: Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.
- Use when the operator should preserve upstream workflow detail instead of rewriting the process from scratch.
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.
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open resources/implementation-playbook.md.
- Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.
- Read the overview and provenance files before loading any copied upstream support files.
- Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.
Imported Workflow Notes
Imported: Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open
resources/implementation-playbook.md.
Imported: Overview
This workflow creates comprehensive C4 architecture documentation following the official C4 model by:
- Code Level: Analyzing every subdirectory bottom-up to create code-level documentation
- Component Level: Synthesizing code documentation into logical components within containers
- Container Level: Mapping components to deployment containers with API documentation (shows high-level technology choices)
- 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
- Use codebase search to identify all subdirectories in the repository
- Sort directories by depth (deepest first) for bottom-up processing
- Filter out common non-code directories (node_modules, .git, build, dist, etc.)
- Create list of directories to process
1.2 Process Each Directory (Bottom-Up)
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:
- Overview Section:
- Name: [Descriptive name for this code directory]
- Description: [Short description of what this code does]
- Location: [Link to actual directory path relative to repo root]
- Language: [Primary programming language(s) used]
- Purpose: [What this code accomplishes]
- Code Elements Section:
- Document all functions/methods with complete signatures:
- Function name, parameters (with types), return type
- Description of what each function does
- Location (file path and line numbers)
- Dependencies (what this function depends on)
- Document all classes/modules:
- Class name, description, location
- Methods and their signatures
- Dependencies
- Dependencies Section:
- Internal dependencies (other code in this repo)
- External dependencies (libraries, frameworks, services)
- Relationships Section:
- Optional Mermaid diagram if relationships are complex
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:
- Complete function signatures with all parameters and types
- Links to actual source code locations
- All dependencies (internal and external)
- Clear, descriptive names and descriptions
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.
Examples
Example 1: Ask for the upstream workflow directly
Use @c4-architecture-c4-architecture-v2 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-v2 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-v2 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-v2 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:
- Walk through all subdirectories bottom-up
- Create c4-code-*.md for each directory
- Synthesize into components
- Map to containers with API docs
- 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.
- Keep the imported skill grounded in the upstream repository; do not invent steps that the source material cannot support.
- Prefer the smallest useful set of support files so the workflow stays auditable and fast to review.
- Keep provenance, source commit, and imported file paths visible in notes and PR descriptions.
- Point directly at the copied upstream files that justify the workflow instead of relying on generic review boilerplate.
- Treat generated examples as scaffolding; adapt them to the concrete task before execution.
- Route to a stronger native skill when architecture, debugging, design, or security concerns become dominant.
Troubleshooting
Problem: The operator skipped the imported context and answered too generically
Symptoms: The result ignores the upstream workflow in plugins/antigravity-awesome-skills/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
@00-andruia-consultant - Use when the work is better handled by that native specialization after this imported skill establishes context.
@00-andruia-consultant-v2 - Use when the work is better handled by that native specialization after this imported skill establishes context.
@10-andruia-skill-smith - Use when the work is better handled by that native specialization after this imported skill establishes context.
@10-andruia-skill-smith-v2 - Use when the work is better handled by that native specialization after this imported skill establishes context.
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
- Collect all c4-code-*.md files created in Phase 1
- Analyze code structure, dependencies, and relationships
- Identify logical component boundaries based on:
- Domain boundaries (related business functionality)
- Technical boundaries (shared frameworks, libraries)
- Organizational boundaries (team ownership, if evident)
2.2 Create Component Documentation
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:
- Overview Section:
- Name: [Component name - descriptive and meaningful]
- Description: [Short description of component purpose]
- Type: [Application, Service, Library, etc.]
- Technology: [Primary technologies used]
- Purpose Section:
- Detailed description of what this component does
- What problems it solves
- Its role in the system
- Software Features Section:
- List all software features provided by this component
- Each feature with a brief description
- Code Elements Section:
- List all c4-code-*.md files contained in this component
- Link to each file with a brief description
- Interfaces Section:
- Document all component interfaces:
- Interface name
- Protocol (REST, GraphQL, gRPC, Events, etc.)
- Description
- Operations (function signatures, endpoints, etc.)
- Dependencies Section:
- Components used (other components this depends on)
- External systems (databases, APIs, services)
- Component Diagram:
- Mermaid diagram showing this component and its relationships
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
2.3 Create Master Component Index
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:
- System Components Section:
- List all components with:
- Component name
- Short description
- Link to component documentation
- Component Relationships Diagram:
- Mermaid diagram showing all components and their relationships
- Show dependencies between components
- Show external system dependencies
Save the output as: C4-Documentation/c4-component.md
Expected output: Master c4-component.md file
Context: All c4-component-*.md files
Imported: Phase 3: Container-Level Synthesis
3.1 Analyze Components and Deployment Definitions
- Review all c4-component-*.md files
- Search for deployment/infrastructure definitions:
- Dockerfiles
- Kubernetes manifests (deployments, services, etc.)
- Docker Compose files
- Terraform/CloudFormation configs
- Cloud service definitions (AWS Lambda, Azure Functions, etc.)
- CI/CD pipeline definitions
3.2 Map Components to Containers
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:
- Containers Section (for each container):
- Name: [Container name]
- Description: [Short description of container purpose and deployment]
- Type: [Web Application, API, Database, Message Queue, etc.]
- Technology: [Primary technologies: Node.js, Python, PostgreSQL, etc.]
- Deployment: [Docker, Kubernetes, Cloud Service, etc.]
- Purpose Section (for each container):
- Detailed description of what this container does
- How it's deployed
- Its role in the system
- Components Section (for each container):
- List all components deployed in this container
- Link to component documentation
- Interfaces Section (for each container):
- Document all container APIs and interfaces:
- API/Interface name
- Protocol (REST, GraphQL, gRPC, Events, etc.)
- Description
- Link to OpenAPI/Swagger/API Spec file
- List of endpoints/operations
- API Specifications:
- For each container API, create an OpenAPI 3.1+ specification
- Save as: C4-Documentation/apis/[container-name]-api.yaml
- Include:
- All endpoints with methods (GET, POST, etc.)
- Request/response schemas
- Authentication requirements
- Error responses
- Dependencies Section (for each container):
- Containers used (other containers this depends on)
- External systems (databases, third-party APIs, etc.)
- Communication protocols
- Infrastructure Section (for each container):
- Link to deployment config (Dockerfile, K8s manifest, etc.)
- Scaling strategy
- Resource requirements (CPU, memory, storage)
- Container Diagram:
- Mermaid diagram showing all containers and their relationships
- Show communication protocols
- Show external system dependencies
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
Imported: Phase 4: Context-Level Documentation
4.1 Analyze System Documentation
- Review container and component documentation
- Search for system documentation:
- README files
- Architecture documentation
- Requirements documents
- Design documents
- Test files (to understand system behavior)
- API documentation
- User documentation
4.2 Create Context Documentation
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:
- System Overview Section:
- Short Description: [One-sentence description of what the system does]
- Long Description: [Detailed description of system purpose, capabilities, problems solved]
- Personas Section:
- For each persona (human users and programmatic "users"):
- Persona name
- Type (Human User / Programmatic User / External System)
- Description (who they are, what they need)
- Goals (what they want to achieve)
- Key features used
- System Features Section:
- For each high-level feature:
- Feature name
- Description (what this feature does)
- Users (which personas use this feature)
- Link to user journey map
- User Journeys Section:
- For each key feature and persona:
- Journey name: [Feature Name] - [Persona Name] Journey
- Step-by-step journey:
- ...
- Include all system touchpoints
- For programmatic users (external systems, APIs):
- Integration journey with step-by-step process
- External Systems and Dependencies Section:
- For each external system:
- System name
- Type (Database, API, Service, Message Queue, etc.)
- Description (what it provides)
- Integration type (API, Events, File Transfer, etc.)
- Purpose (why the system depends on this)
- System Context Diagram:
- Mermaid C4Context diagram showing:
- The system (as a box in the center)
- All personas (users) around it
- All external systems around it
- Relationships and data flows
- Use C4Context notation for proper C4 diagram
- Related Documentation Section:
- Links to container documentation
- Links to component documentation
Save the output as: C4-Documentation/c4-context.md
Ensure the documentation is:
- Understandable by non-technical stakeholders
- Focuses on system purpose, users, and external relationships
- Includes comprehensive user journey maps
- Identifies all external systems and dependencies
Expected output: c4-context.md with complete system context
Context: All container, component, and system documentation
Imported: Configuration Options
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)
Imported: Success Criteria
- ✅ Every subdirectory has a corresponding c4-code-*.md file
- ✅ All code-level documentation includes complete function signatures
- ✅ Components are logically grouped with clear boundaries
- ✅ All components have interface documentation
- ✅ Master component index created with relationship diagram
- ✅ Containers map to actual deployment units
- ✅ All container APIs documented with OpenAPI/Swagger specs
- ✅ Container diagram shows deployment architecture
- ✅ System context includes all personas (human and programmatic)
- ✅ User journeys documented for all key features
- ✅ All external systems and dependencies identified
- ✅ Context diagram shows system, users, and external systems
- ✅ Documentation is organized in C4-Documentation/ directory
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
- Bottom-up processing: Process directories from deepest to shallowest
- Incremental synthesis: Each level builds on the previous level's documentation
- Complete coverage: Every directory must have code-level documentation before synthesis
- Link consistency: All documentation files link to each other appropriately
- API documentation: Container APIs must have OpenAPI/Swagger specifications
- Stakeholder-friendly: Context documentation should be understandable by non-technical stakeholders
- Mermaid diagrams: Use proper C4 Mermaid notation for all diagrams
Imported: Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: c4-architecture-c4-architecture-v23description: 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 provenance before merging or handing off.4---56# C4 Architecture Documentation Workflow78## Overview910This public intake copy packages `plugins/antigravity-awesome-skills/skills/c4-architecture-c4-architecture` from `https://github.com/sickn33/antigravity-awesome-skills` into the native Omni Skills editorial shape without hiding its origin.1112Use 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.1314This 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.1516# 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.]1718Imported 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.1920## When to Use This Skill2122Use 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.2324- Working on c4 architecture documentation workflow tasks or workflows25- Needing guidance, best practices, or checklists for c4 architecture documentation workflow26- The task is unrelated to c4 architecture documentation workflow27- You need a different domain or tool outside this scope28- Use when the request clearly matches the imported source intent: Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.29- Use when the operator should preserve upstream workflow detail instead of rewriting the process from scratch.3031## Operating Table3233| Situation | Start here | Why it matters |34| --- | --- | --- |35| First-time use | `metadata.json` | Confirms repository, branch, commit, and imported path through the `external_source` block before touching the copied workflow |36| Provenance review | `ORIGIN.md` | Gives reviewers a plain-language audit trail for the imported source |37| Workflow execution | `SKILL.md` | Starts with the smallest copied file that materially changes execution |38| Supporting context | `SKILL.md` | Adds the next most relevant copied source file without loading the entire package |39| Handoff decision | `## Related Skills` | Helps the operator switch to a stronger native skill when the task drifts |4041## Workflow4243This 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.44451. Clarify goals, constraints, and required inputs.462. Apply relevant best practices and validate outcomes.473. Provide actionable steps and verification.484. If detailed examples are required, open resources/implementation-playbook.md.495. Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task.506. Read the overview and provenance files before loading any copied upstream support files.517. Load only the references, examples, prompts, or scripts that materially change the outcome for the current request.5253### Imported Workflow Notes5455#### Imported: Instructions5657- Clarify goals, constraints, and required inputs.58- Apply relevant best practices and validate outcomes.59- Provide actionable steps and verification.60- If detailed examples are required, open `resources/implementation-playbook.md`.6162#### Imported: Overview6364This workflow creates comprehensive C4 architecture documentation following the [official C4 model](https://c4model.com/diagrams) by:65661. **Code Level**: Analyzing every subdirectory bottom-up to create code-level documentation672. **Component Level**: Synthesizing code documentation into logical components within containers683. **Container Level**: Mapping components to deployment containers with API documentation (shows high-level technology choices)694. **Context Level**: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)7071**Note**: According to the [C4 model](https://c4model.com/diagrams), 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.7273All documentation is written to a new `C4-Documentation/` directory in the repository root.7475#### Imported: Phase 1: Code-Level Documentation (Bottom-Up Analysis)7677### 1.1 Discover All Subdirectories7879- Use codebase search to identify all subdirectories in the repository80- Sort directories by depth (deepest first) for bottom-up processing81- Filter out common non-code directories (node_modules, .git, build, dist, etc.)82- Create list of directories to process8384### 1.2 Process Each Directory (Bottom-Up)8586For each directory, starting from the deepest:8788- Use Task tool with subagent_type="c4-architecture::c4-code"89- Prompt: |90 Analyze the code in directory: [directory_path]9192 Create comprehensive C4 Code-level documentation following this structure:93 1. **Overview Section**:94 - Name: [Descriptive name for this code directory]95 - Description: [Short description of what this code does]96 - Location: [Link to actual directory path relative to repo root]97 - Language: [Primary programming language(s) used]98 - Purpose: [What this code accomplishes]99 2. **Code Elements Section**:100 - Document all functions/methods with complete signatures:101 - Function name, parameters (with types), return type102 - Description of what each function does103 - Location (file path and line numbers)104 - Dependencies (what this function depends on)105 - Document all classes/modules:106 - Class name, description, location107 - Methods and their signatures108 - Dependencies109 3. **Dependencies Section**:110 - Internal dependencies (other code in this repo)111 - External dependencies (libraries, frameworks, services)112 4. **Relationships Section**:113 - Optional Mermaid diagram if relationships are complex114115 Save the output as: C4-Documentation/c4-code-[directory-name].md116 Use a sanitized directory name (replace / with -, remove special chars) for the filename.117118 Ensure the documentation includes:119 - Complete function signatures with all parameters and types120 - Links to actual source code locations121 - All dependencies (internal and external)122 - Clear, descriptive names and descriptions123124- Expected output: c4-code-<directory-name>.md file in C4-Documentation/125- Context: All files in the directory and its subdirectories126127**Repeat for every subdirectory** until all directories have corresponding c4-code-\*.md files.128129## Examples130131### Example 1: Ask for the upstream workflow directly132133```text134Use @c4-architecture-c4-architecture-v2 to handle <task>. Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer.135```136137**Explanation:** This is the safest starting point when the operator needs the imported workflow, but not the entire repository.138139### Example 2: Ask for a provenance-grounded review140141```text142Review @c4-architecture-c4-architecture-v2 against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why.143```144145**Explanation:** Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection.146147### Example 3: Narrow the copied support files before execution148149```text150Use @c4-architecture-c4-architecture-v2 for <task>. Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding.151```152153**Explanation:** This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default.154155### Example 4: Build a reviewer packet156157```text158Review @c4-architecture-c4-architecture-v2 using the copied upstream files plus provenance, then summarize any gaps before merge.159```160161**Explanation:** This is useful when the PR is waiting for human review and you want a repeatable audit packet.162163### Imported Usage Notes164165#### Imported: Example Usage166167```bash168/c4-architecture:c4-architecture169```170171This will:1721731. Walk through all subdirectories bottom-up1742. Create c4-code-\*.md for each directory1753. Synthesize into components1764. Map to containers with API docs1775. Create system context with personas and journeys178179All documentation written to: C4-Documentation/180181## Best Practices182183Treat 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.184185- Keep the imported skill grounded in the upstream repository; do not invent steps that the source material cannot support.186- Prefer the smallest useful set of support files so the workflow stays auditable and fast to review.187- Keep provenance, source commit, and imported file paths visible in notes and PR descriptions.188- Point directly at the copied upstream files that justify the workflow instead of relying on generic review boilerplate.189- Treat generated examples as scaffolding; adapt them to the concrete task before execution.190- Route to a stronger native skill when architecture, debugging, design, or security concerns become dominant.191192193194## Troubleshooting195196### Problem: The operator skipped the imported context and answered too generically197198**Symptoms:** The result ignores the upstream workflow in `plugins/antigravity-awesome-skills/skills/c4-architecture-c4-architecture`, fails to mention provenance, or does not use any copied source files at all.199**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.200201### Problem: The imported workflow feels incomplete during review202203**Symptoms:** Reviewers can see the generated `SKILL.md`, but they cannot quickly tell which references, examples, or scripts matter for the current task.204**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.205206### Problem: The task drifted into a different specialization207208**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.209**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.210211212213## Related Skills214215- `@00-andruia-consultant` - Use when the work is better handled by that native specialization after this imported skill establishes context.216- `@00-andruia-consultant-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context.217- `@10-andruia-skill-smith` - Use when the work is better handled by that native specialization after this imported skill establishes context.218- `@10-andruia-skill-smith-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context.219220## Additional Resources221222Use 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.223224| Resource family | What it gives the reviewer | Example path |225| --- | --- | --- |226| `references` | copied reference notes, guides, or background material from upstream | `references/n/a` |227| `examples` | worked examples or reusable prompts copied from upstream | `examples/n/a` |228| `scripts` | upstream helper scripts that change execution or validation | `scripts/n/a` |229| `agents` | routing or delegation notes that are genuinely part of the imported package | `agents/n/a` |230| `assets` | supporting assets or schemas copied from the source package | `assets/n/a` |231232233234### Imported Reference Notes235236#### Imported: Phase 2: Component-Level Synthesis237238### 2.1 Analyze All Code-Level Documentation239240- Collect all c4-code-\*.md files created in Phase 1241- Analyze code structure, dependencies, and relationships242- Identify logical component boundaries based on:243 - Domain boundaries (related business functionality)244 - Technical boundaries (shared frameworks, libraries)245 - Organizational boundaries (team ownership, if evident)246247### 2.2 Create Component Documentation248249For each identified component:250251- Use Task tool with subagent_type="c4-architecture::c4-component"252- Prompt: |253 Synthesize the following C4 Code-level documentation files into a logical component:254255 Code files to analyze:256 [List of c4-code-*.md file paths]257258 Create comprehensive C4 Component-level documentation following this structure:259 1. **Overview Section**:260 - Name: [Component name - descriptive and meaningful]261 - Description: [Short description of component purpose]262 - Type: [Application, Service, Library, etc.]263 - Technology: [Primary technologies used]264 2. **Purpose Section**:265 - Detailed description of what this component does266 - What problems it solves267 - Its role in the system268 3. **Software Features Section**:269 - List all software features provided by this component270 - Each feature with a brief description271 4. **Code Elements Section**:272 - List all c4-code-\*.md files contained in this component273 - Link to each file with a brief description274 5. **Interfaces Section**:275 - Document all component interfaces:276 - Interface name277 - Protocol (REST, GraphQL, gRPC, Events, etc.)278 - Description279 - Operations (function signatures, endpoints, etc.)280 6. **Dependencies Section**:281 - Components used (other components this depends on)282 - External systems (databases, APIs, services)283 7. **Component Diagram**:284 - Mermaid diagram showing this component and its relationships285286 Save the output as: C4-Documentation/c4-component-[component-name].md287 Use a sanitized component name for the filename.288289- Expected output: c4-component-<name>.md file for each component290- Context: All relevant c4-code-\*.md files for this component291292### 2.3 Create Master Component Index293294- Use Task tool with subagent_type="c4-architecture::c4-component"295- Prompt: |296 Create a master component index that lists all components in the system.297298 Based on all c4-component-\*.md files created, generate:299 1. **System Components Section**:300 - List all components with:301 - Component name302 - Short description303 - Link to component documentation304 2. **Component Relationships Diagram**:305 - Mermaid diagram showing all components and their relationships306 - Show dependencies between components307 - Show external system dependencies308309 Save the output as: C4-Documentation/c4-component.md310311- Expected output: Master c4-component.md file312- Context: All c4-component-\*.md files313314#### Imported: Phase 3: Container-Level Synthesis315316### 3.1 Analyze Components and Deployment Definitions317318- Review all c4-component-\*.md files319- Search for deployment/infrastructure definitions:320 - Dockerfiles321 - Kubernetes manifests (deployments, services, etc.)322 - Docker Compose files323 - Terraform/CloudFormation configs324 - Cloud service definitions (AWS Lambda, Azure Functions, etc.)325 - CI/CD pipeline definitions326327### 3.2 Map Components to Containers328329- Use Task tool with subagent_type="c4-architecture::c4-container"330- Prompt: |331 Synthesize components into containers based on deployment definitions.332333 Component documentation:334 [List of all c4-component-*.md file paths]335336 Deployment definitions found:337 [List of deployment config files: Dockerfiles, K8s manifests, etc.]338339 Create comprehensive C4 Container-level documentation following this structure:340 1. **Containers Section** (for each container):341 - Name: [Container name]342 - Description: [Short description of container purpose and deployment]343 - Type: [Web Application, API, Database, Message Queue, etc.]344 - Technology: [Primary technologies: Node.js, Python, PostgreSQL, etc.]345 - Deployment: [Docker, Kubernetes, Cloud Service, etc.]346 2. **Purpose Section** (for each container):347 - Detailed description of what this container does348 - How it's deployed349 - Its role in the system350 3. **Components Section** (for each container):351 - List all components deployed in this container352 - Link to component documentation353 4. **Interfaces Section** (for each container):354 - Document all container APIs and interfaces:355 - API/Interface name356 - Protocol (REST, GraphQL, gRPC, Events, etc.)357 - Description358 - Link to OpenAPI/Swagger/API Spec file359 - List of endpoints/operations360 5. **API Specifications**:361 - For each container API, create an OpenAPI 3.1+ specification362 - Save as: C4-Documentation/apis/[container-name]-api.yaml363 - Include:364 - All endpoints with methods (GET, POST, etc.)365 - Request/response schemas366 - Authentication requirements367 - Error responses368 6. **Dependencies Section** (for each container):369 - Containers used (other containers this depends on)370 - External systems (databases, third-party APIs, etc.)371 - Communication protocols372 7. **Infrastructure Section** (for each container):373 - Link to deployment config (Dockerfile, K8s manifest, etc.)374 - Scaling strategy375 - Resource requirements (CPU, memory, storage)376 8. **Container Diagram**:377 - Mermaid diagram showing all containers and their relationships378 - Show communication protocols379 - Show external system dependencies380381 Save the output as: C4-Documentation/c4-container.md382383- Expected output: c4-container.md with all containers and API specifications384- Context: All component documentation and deployment definitions385386#### Imported: Phase 4: Context-Level Documentation387388### 4.1 Analyze System Documentation389390- Review container and component documentation391- Search for system documentation:392 - README files393 - Architecture documentation394 - Requirements documents395 - Design documents396 - Test files (to understand system behavior)397 - API documentation398 - User documentation399400### 4.2 Create Context Documentation401402- Use Task tool with subagent_type="c4-architecture::c4-context"403- Prompt: |404 Create comprehensive C4 Context-level documentation for the system.405406 Container documentation: C4-Documentation/c4-container.md407 Component documentation: C4-Documentation/c4-component.md408 System documentation: [List of README, architecture docs, requirements, etc.]409 Test files: [List of test files that show system behavior]410411 Create comprehensive C4 Context-level documentation following this structure:412 1. **System Overview Section**:413 - Short Description: [One-sentence description of what the system does]414 - Long Description: [Detailed description of system purpose, capabilities, problems solved]415 2. **Personas Section**:416 - For each persona (human users and programmatic "users"):417 - Persona name418 - Type (Human User / Programmatic User / External System)419 - Description (who they are, what they need)420 - Goals (what they want to achieve)421 - Key features used422 3. **System Features Section**:423 - For each high-level feature:424 - Feature name425 - Description (what this feature does)426 - Users (which personas use this feature)427 - Link to user journey map428 4. **User Journeys Section**:429 - For each key feature and persona:430 - Journey name: [Feature Name] - [Persona Name] Journey431 - Step-by-step journey:432 1. [Step 1]: [Description]433 2. [Step 2]: [Description]434 ...435 - Include all system touchpoints436 - For programmatic users (external systems, APIs):437 - Integration journey with step-by-step process438 5. **External Systems and Dependencies Section**:439 - For each external system:440 - System name441 - Type (Database, API, Service, Message Queue, etc.)442 - Description (what it provides)443 - Integration type (API, Events, File Transfer, etc.)444 - Purpose (why the system depends on this)445 6. **System Context Diagram**:446 - Mermaid C4Context diagram showing:447 - The system (as a box in the center)448 - All personas (users) around it449 - All external systems around it450 - Relationships and data flows451 - Use C4Context notation for proper C4 diagram452 7. **Related Documentation Section**:453 - Links to container documentation454 - Links to component documentation455456 Save the output as: C4-Documentation/c4-context.md457458 Ensure the documentation is:459 - Understandable by non-technical stakeholders460 - Focuses on system purpose, users, and external relationships461 - Includes comprehensive user journey maps462 - Identifies all external systems and dependencies463464- Expected output: c4-context.md with complete system context465- Context: All container, component, and system documentation466467#### Imported: Configuration Options468469- `target_directory`: Root directory to analyze (default: current repository root)470- `exclude_patterns`: Patterns to exclude (default: node_modules, .git, build, dist, etc.)471- `output_directory`: Where to write C4 documentation (default: C4-Documentation/)472- `include_tests`: Whether to analyze test files for context (default: true)473- `api_format`: Format for API specs (default: openapi)474475#### Imported: Success Criteria476477- ✅ Every subdirectory has a corresponding c4-code-\*.md file478- ✅ All code-level documentation includes complete function signatures479- ✅ Components are logically grouped with clear boundaries480- ✅ All components have interface documentation481- ✅ Master component index created with relationship diagram482- ✅ Containers map to actual deployment units483- ✅ All container APIs documented with OpenAPI/Swagger specs484- ✅ Container diagram shows deployment architecture485- ✅ System context includes all personas (human and programmatic)486- ✅ User journeys documented for all key features487- ✅ All external systems and dependencies identified488- ✅ Context diagram shows system, users, and external systems489- ✅ Documentation is organized in C4-Documentation/ directory490491#### Imported: Output Structure492493```494C4-Documentation/495├── c4-code-*.md # Code-level docs (one per directory)496├── c4-component-*.md # Component-level docs (one per component)497├── c4-component.md # Master component index498├── c4-container.md # Container-level docs499├── c4-context.md # Context-level docs500└── apis/ # API specifications501 ├── [container]-api.yaml # OpenAPI specs for each container502 └── ...503```504505#### Imported: Coordination Notes506507- **Bottom-up processing**: Process directories from deepest to shallowest508- **Incremental synthesis**: Each level builds on the previous level's documentation509- **Complete coverage**: Every directory must have code-level documentation before synthesis510- **Link consistency**: All documentation files link to each other appropriately511- **API documentation**: Container APIs must have OpenAPI/Swagger specifications512- **Stakeholder-friendly**: Context documentation should be understandable by non-technical stakeholders513- **Mermaid diagrams**: Use proper C4 Mermaid notation for all diagrams514515#### Imported: Limitations516517- Use this skill only when the task clearly matches the scope described above.518- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.519- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.