| name | ontological-documentation |
| description | This skill should be used when creating comprehensive ontological documentation for software systems, including extracting domain concepts, modeling semantic relationships, and generating visual representations of system architectures and business domains. |
Ontological Documentation
Overview
This skill enables the creation of comprehensive ontological documentation that captures the fundamental concepts, relationships, and classification systems within code and systems. It goes beyond typical API documentation to include semantic structure, conceptual models, and domain taxonomies that provide deep understanding of system architecture and business logic.
When to Use This Skill
Use this skill when you need to:
- Document the conceptual structure and domain model of a software system
- Extract and organize business concepts from existing codebases
- Create visual representations of system architectures and relationships
- Build semantic maps of entities, services, and their interactions
- Design or document domain models for new systems
- Analyze and communicate complex system architectures to stakeholders
- Create knowledge graphs or concept maps for development teams
Quick Start
For New Systems
- Design Phase: Start with domain modeling templates in
assets/ontology-templates/ - Concept Identification: Use patterns from
references/ontology_patterns.md - Documentation Creation: Apply templates from
references/documentation_templates.md - Visualization: Generate diagrams using
scripts/generate_ontology_diagram.py
For Existing Systems
- Concept Extraction: Run
scripts/extract_concepts.pyon your codebase - Analysis: Review extracted concepts using guidelines in
references/concept_extraction_guide.md - Documentation: Create comprehensive concept documentation
- Visualization: Generate ontology diagrams for various formats
Core Capabilities
1. Concept Extraction and Analysis
Use automated tools to identify and categorize domain concepts from source code:
# Extract concepts from Python codebase
python scripts/extract_concepts.py ./src
# Extract concepts from JavaScript/TypeScript
python scripts/extract_concepts.py ./frontend
# Generate ontology JSON structure
python scripts/extract_concepts.py ./src > ontology.json
Identifies:
- Class and interface hierarchies (is-a relationships)
- Composition patterns (part-of relationships)
- Service dependencies (depends-on relationships)
- Domain entities vs technical concepts
2. Ontology Visualization
Generate multiple diagram formats for different audiences:
# Generate all diagram formats
python scripts/generate_ontology_diagram.py ontology.json --format all
# Generate specific formats
python scripts/generate_ontology_diagram.py ontology.json --format mermaid
python scripts/generate_ontology_diagram.py ontology.json --format plantuml
Supported formats:
- Mermaid: For README files and documentation
- PlantUML: For technical architecture diagrams
- GraphViz DOT: For publication-quality graphics
- JSON-LD: For semantic web applications
3. Documentation Templates
Standardized templates for consistent documentation:
- Concept Definition: Comprehensive entity documentation
- Relationship Documentation: Detailed relationship analysis
- Domain Model Overview: High-level domain architecture
- Change Log: Ontology evolution tracking
4. Pattern Recognition
Identify common ontological patterns in software:
- Layered Architecture Patterns: Presentation, Business, Data layers
- Domain-Driven Design Patterns: Entities, Value Objects, Aggregates
- Microservice Patterns: Service boundaries and relationships
- MVC/MVVM Patterns: Component relationships and data flow
Workflow
Step 1: Discovery and Extraction
- Analyze Codebase: Run concept extraction tools
- Review Patterns: Identify common architectural patterns
- Map Terminology: Align technical terms with business vocabulary
- Consult Stakeholders: Validate concepts with domain experts
Step 2: Ontology Construction
- Categorize Concepts: Group entities, services, and relationships
- Define Relationships: Document semantic connections
- Create Hierarchies: Build taxonomic structures
- Validate Logic: Ensure consistency and completeness
Step 3: Documentation Creation
- Use Templates: Apply standardized documentation formats
- Add Examples: Include concrete usage examples
- Document Rules: Capture business logic and constraints
- Cross-Reference: Link related concepts and documentation
Step 4: Visualization and Communication
- Generate Diagrams: Create visual representations
- Choose Formats: Select appropriate diagrams for audiences
- Create Navigation: Build browsable concept maps
- Present to Stakeholders: Communicate domain understanding
Common Use Cases
Use Case 1: System Onboarding
"I need to understand the domain model of this complex e-commerce system to onboard new developers."
Approach:
- Run concept extraction on the entire codebase
- Generate domain overview diagrams
- Create concept documentation for core entities
- Build interactive navigation for the ontology
Use Case 2: Architecture Documentation
"Document the microservice architecture and service relationships for our CTO presentation."
Approach:
- Identify service boundaries and responsibilities
- Map service dependencies and communication patterns
- Generate architecture diagrams in multiple formats
- Create service-level documentation
Use Case 3: Domain Model Design
"We're building a new healthcare platform and need to design the domain model."
Approach:
- Use domain modeling templates
- Apply healthcare-specific patterns
- Create comprehensive entity documentation
- Validate model with domain experts
Use Case 4: Legacy System Analysis
"Analyze this 10-year-old codebase to understand the business domain before refactoring."
Approach:
- Extract concepts from legacy code
- Identify business rules and logic
- Map domain terminology
- Create migration documentation
Resources
Scripts (Executable Tools)
extract_concepts.py: Automated concept extraction from source codegenerate_ontology_diagram.py: Multi-format diagram generation from ontology JSON
References (Guidance Documentation)
ontology_patterns.md: Common ontological patterns in software architectureconcept_extraction_guide.md: Methodologies for identifying domain conceptsdocumentation_templates.md: Standardized templates for documentation
Assets (Templates and Examples)
ontology-templates/: Reusable templates for different ontology typesexamples/: Sample ontological documentation from various domains
Quality Assurance
Validation Checklist
- All concepts have clear, unambiguous definitions
- Relationships are properly categorized and documented
- Business rules and constraints are captured
- Technical and business terminology are aligned
- Visualizations accurately represent the ontology
- Documentation follows established templates
- Examples are relevant and illustrative
Review Process
- Technical Review: Validate code analysis and relationships
- Domain Review: Confirm business concept accuracy with experts
- Documentation Review: Ensure clarity and completeness
- Visual Review: Validate diagram accuracy and readability