c4-level4-code
C4 Level 4: Code Diagram
The Code diagram is the lowest level of detail, showing how a single component is implemented. It's often used for complex components or database schemas.
Core Principles (MANDATORY)
- Optionality: Level 4 is usually optional. Only use it when the internal implementation is too complex to understand without a visual map.
- Specific Implementation: Use standard UML class diagram notation or ER diagrams (Entity Relationship Diagrams) for data models.
- Keep it Focused: Don't diagram the entire codebase. Focus on the core classes or tables that provide the component's value.
Elements Used
- Class: Classes, interfaces, types.
- Table: Database tables, columns, relationships (Primary/Foreign keys).
- Relationship: Inheritance, composition, aggregation, or data associations.
Mermaid Templates
UML Class Diagram Template
More from kinhluan/skills
ddd-tactical
Tactical Domain-Driven Design (DDD) with Scoring Rubric. Use this skill when designing internal domain models or performing architectural reviews to ensure domain logic is isolated and rich.
7scheduling-algorithms
Job scheduling algorithms for parallel and distributed systems
7ddd-core
Professional Strategic Domain-Driven Design (DDD) Hub. Use this skill for Event Storming, identifying Subdomains, defining Bounded Contexts, and mapping Domain Models to the heart of your architecture.
6c4-level3-component
Specialized in Component diagrams (Level 3) with folder structure mapping. Use this skill when the user needs to zoom into a single container to identify internal components, their responsibilities, and how they map to actual code folders (src/services, internal/).
6security-analysis
Security vulnerability analysis and auditing procedures
6docker-containerization
Docker containerization best practices and patterns
6