component-diagram-builder
Skill3 starsChanged 4 months agoMITView on GitHub
Produce a C4 Level 3 (Component) diagram for a selected container, showing internal components, responsibilities, and dependencies. Use when working on solution architecture, C4 diagrams, APIs, ADRs, or system design.
In this repository59 other files it gives its agents.
- agent-memory-designerSkill
- ai-cost-optimizerSkill
- ai-evaluation-builderSkill
- ai-latency-optimizerSkill
- ai-solution-architectSkill
- ai-workflow-builderSkill
- context-engineeringSkill
- human-in-the-loop-designerSkill
- multi-agent-plannerSkill
- prompt-engineerSkill
- prompt-optimizerSkill
- prompt-reviewerSkill
- adr-generatorSkill
- api-designerSkill
- architecture-reviewSkill
- container-diagram-builderSkill
- data-flow-analyzerSkill
- integration-plannerSkill
- observability-plannerSkill
- scalability-advisorSkill
- solution-architectureSkill
- system-context-builderSkill
- experiment-designerSkill
- go-to-market-plannerSkill
- pricing-strategy-advisorSkill
- mcp-best-practicesSkill
- mcp-client-generatorSkill
- mcp-security-reviewSkill
- mcp-server-generatorSkill
- mcp-tool-generatorSkill
- acceptance-criteria-generatorSkill
- analytics-instrumentation-plannerSkill
- competitive-analysisSkill
- epic-generatorSkill
- feature-prioritizationSkill
- idea-validatorSkill
- north-star-metric-advisorSkill
- okr-builderSkill
- persona-generatorSkill
- prd-generatorSkill
- problem-statement-builderSkill
- product-discovery-assistantSkill
- product-vision-builderSkill
- sprint-plannerSkill
- story-mappingSkill
- user-story-generatorSkill
- value-proposition-designerSkill
- chunking-strategy-advisorSkill
- embedding-strategy-advisorSkill
- hybrid-search-advisorSkill
- knowledge-ingestion-plannerSkill
- rag-architecture-designerSkill
- retriever-optimizerSkill
- ai-governance-advisorSkill
- ai-threat-modelingSkill
- guardrails-builderSkill
- owasp-llm-reviewerSkill
- prompt-injection-detectorSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Must exist in container diagram
- Distinctive: line 63
Keep inside one container boundary.
- Distinctive: line 114
Follow C4 Level 3 scope strictly.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Component Diagram Builder
Purpose
Produce a C4 Level 3 (Component) diagram for a selected container, showing internal components, responsibilities, and dependencies.
Input: Container diagram, target container name, component responsibilities (optional)
Output: Component diagram document with Mermaid diagram and component inventory
Examples: See examples.md for worked input/output.
Workflow
Step 1: Select target container
Confirm which container to decompose:
- One container per Skill execution
- Must exist in container diagram
- Identify primary technology/framework
Step 2: Identify components
Decompose container into logical components:
| Component | Type | Responsibility |
Types: controller, service, repository, adapter, domain module, UI module.
Components are code-level groupings, not individual classes.
Step 3: Map component interactions
| From | To | Interface | Purpose |
Show dependency direction. Avoid circular dependencies.
Step 4: Draw component diagram
flowchart TB
subgraph container [Container Name]
comp1[Component A]
comp2[Component B]
comp3[Component C]
end
comp1 --> comp2
comp2 --> comp3Keep inside one container boundary.
Step 5: Map to patterns
Identify applied patterns:
- Layered architecture, hexagonal, CQRS, repository, etc.
- Note pattern violations or technical debt
Step 6: Validate
Run Validation checklist.
Decision Rules
| Condition | Action |
| No container diagram | Stop; run container-diagram-builder |
| Container not found | Ask user to select valid container |
| More than 15 components | Group into sub-modules; simplify diagram |
| Circular dependencies | Refactor component boundaries; flag as debt |
| Component = single class | Merge into logical module |
Validation
- Target container identified from container diagram
- 3–12 components with clear responsibilities
- All interactions documented with direction
- Mermaid diagram within container boundary
- No other containers' internals shown
- Applied patterns noted
- Circular dependencies flagged if present
Anti-patterns
- Class diagram as component diagram — every class as a node.
- God component — single component doing everything.
- Leaking containers — showing other containers' internals.
- Unlabeled dependencies — arrows without interface description.
- Missing adapters — external calls directly from domain logic.
Best Practices
- Follow C4 Level 3 scope strictly.
- Align with DDD bounded context if applicable.
- Separate adapters from domain components.
- One diagram per complex container; simple containers may need fewer components.
- Link components to FR/NFR responsibilities.
Output Structure
# Component Diagram: [Container Name]
## Container Context
- **Technology:** [stack]
- **Responsibility:** [from container diagram]
## Components
| Component | Type | Responsibility |
|-----------|------|----------------|
## Interactions
| From | To | Interface | Purpose |
|------|----|-----------|---------|
## Diagram
```mermaid
[diagram]Patterns Applied
Technical Debt
| Issue | Impact | Recommendation |
---
# Next Skills
| Outcome | Recommended Skill |
|---------|-------------------|
| Design container API | `architecture/api-designer` |
| Review component design | `architecture/architecture-review` |
| Analyze data through components | `architecture/data-flow-analyzer` |
| Other containers | `architecture/component-diagram-builder` |Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

