Generate Standard OO Component Documentation
Create comprehensive documentation for the object-oriented component(s) at: ${input:ComponentPath}.
Analyze the component by examining code in the provided path. If folder, analyze all source files. If single file, treat as main component and analyze related files in same directory.
Documentation Standards
- DOC-001: Follow C4 Model documentation levels (Context, Containers, Components, Code)
- DOC-002: Align with Arc42 software architecture documentation template
- DOC-003: Comply with IEEE 1016 Software Design Description standard
- DOC-004: Use Agile Documentation principles (just enough documentation that adds value)
- DOC-005: Target developers and maintainers as primary audience
Analysis Instructions
- ANA-001: Determine path type (folder vs single file) and identify primary component
- ANA-002: Examine source code files for class structures and inheritance
- ANA-003: Identify design patterns and architectural decisions
- ANA-004: Document public APIs, interfaces, and dependencies
- ANA-005: Recognize creational/structural/behavioral patterns
- ANA-006: Document method parameters, return values, exceptions
- ANA-007: Assess performance, security, reliability, maintainability
- ANA-008: Infer integration patterns and data flow
Language-Specific Optimizations
- LNG-001: C#/.NET - async/await, dependency injection, configuration, disposal
- LNG-002: Java - Spring framework, annotations, exception handling, packaging
- LNG-003: TypeScript/JavaScript - modules, async patterns, types, npm
- LNG-004: Python - packages, virtual environments, type hints, testing
Error Handling
- ERR-001: Path doesn't exist - provide correct format guidance
- ERR-002: No source files found - suggest alternative locations
- ERR-003: Unclear structure - document findings and request clarification
- ERR-004: Non-standard patterns - document custom approaches
- ERR-005: Insufficient code - focus on available information, highlight gaps
Output Format
Generate well-structured Markdown with clear heading hierarchy, code blocks, tables, bullet points, and proper formatting for readability and maintainability.
File Location
The documentation should be saved in the /docs/components/ directory and named according to the convention: [component-name]-documentation.md.
Required Documentation Structure
The documentation file must follow the template below, ensuring that all sections are filled out appropriately. The front matter for the markdown should be structured correctly as per the example following:
---
title: [Component Name] - Technical Documentation
component_path: `${input:ComponentPath}`
version: [Optional: e.g., 1.0, Date]
date_created: [YYYY-MM-DD]
last_updated: [Optional: YYYY-MM-DD]
owner: [Optional: Team/Individual responsible for this component]
tags: [Optional: List of relevant tags or categories, e.g., `component`,`service`,`tool`,`infrastructure`,`documentation`,`architecture` etc]
---
# [Component Name] Documentation
[A short concise introduction to the component and its purpose within the system.]
## 1. Component Overview
### Purpose/Responsibility
- OVR-001: State component's primary responsibility
- OVR-002: Define scope (included/excluded functionality)
- OVR-003: Describe system context and relationships
## 2. Architecture Section
- ARC-001: Document design patterns used (Repository, Factory, Observer, etc.)
- ARC-002: List internal and external dependencies with purposes
- ARC-003: Document component interactions and relationships
- ARC-004: Include visual diagrams (UML class, sequence, component)
- ARC-005: Create mermaid diagram showing component structure, relationships, and dependencies
### Component Structure and Dependencies Diagram
Include a comprehensive mermaid diagram that shows:
- **Component structure** - Main classes, interfaces, and their relationships
- **Internal dependencies** - How components interact within the system
- **External dependencies** - External libraries, services, databases, APIs
- **Data flow** - Direction of dependencies and interactions
- **Inheritance/composition** - Class hierarchies and composition relationships
```mermaid
graph TD
subgraph "Component System"
A[Main Component] --> B[Internal Service]
A --> C[Internal Repository]
B --> D[Business Logic]
C --> E[Data Access Layer]
end
subgraph "External Dependencies"
F[External API]
G[Database]
H[Third-party Library]
I[Configuration Service]
end
A --> F
E --> G
B --> H
A --> I
classDiagram
class MainComponent {
+property: Type
+method(): ReturnType
+asyncMethod(): Promise~Type~
}
class InternalService {
+businessOperation(): Result
}
class ExternalAPI {
<<external>>
+apiCall(): Data
}
MainComponent --> InternalService
MainComponent --> ExternalAPI
3. Interface Documentation
- INT-001: Document all public interfaces and usage patterns
- INT-002: Create method/property reference table
- INT-003: Document events/callbacks/notification mechanisms
| Method/Property |
Purpose |
Parameters |
Return Type |
Usage Notes |
| [Name] |
[Purpose] |
[Parameters] |
[Type] |
[Notes] |
4. Implementation Details
- IMP-001: Document main implementation classes and responsibilities
- IMP-002: Describe configuration requirements and initialization
- IMP-003: Document key algorithms and business logic
- IMP-004: Note performance characteristics and bottlenecks
5. Usage Examples
Basic Usage
// Basic usage example
var component = new ComponentName();
component.DoSomething();
Advanced Usage
// Advanced configuration patterns
var options = new ComponentOptions();
var component = ComponentFactory.Create(options);
await component.ProcessAsync(data);
- USE-001: Provide basic usage examples
- USE-002: Show advanced configuration patterns
- USE-003: Document best practices and recommended patterns
6. Quality Attributes
- QUA-001: Security (authentication, authorization, data protection)
- QUA-002: Performance (characteristics, scalability, resource usage)
- QUA-003: Reliability (error handling, fault tolerance, recovery)
- QUA-004: Maintainability (standards, testing, documentation)
- QUA-005: Extensibility (extension points, customization options)
7. Reference Information
- REF-001: List dependencies with versions and purposes
- REF-002: Complete configuration options reference
- REF-003: Testing guidelines and mock setup
- REF-004: Troubleshooting (common issues, error messages)
- REF-005: Related documentation links
- REF-006: Change history and migration notes
1---2name: create-oo-component-documentation3description: Create comprehensive, standardized documentation for object-oriented components following industry best practices and architectural documentation standards.4---56# Generate Standard OO Component Documentation78Create comprehensive documentation for the object-oriented component(s) at: `${input:ComponentPath}`.910Analyze the component by examining code in the provided path. If folder, analyze all source files. If single file, treat as main component and analyze related files in same directory.1112## Documentation Standards1314- DOC-001: Follow C4 Model documentation levels (Context, Containers, Components, Code)15- DOC-002: Align with Arc42 software architecture documentation template16- DOC-003: Comply with IEEE 1016 Software Design Description standard17- DOC-004: Use Agile Documentation principles (just enough documentation that adds value)18- DOC-005: Target developers and maintainers as primary audience1920## Analysis Instructions2122- ANA-001: Determine path type (folder vs single file) and identify primary component23- ANA-002: Examine source code files for class structures and inheritance24- ANA-003: Identify design patterns and architectural decisions25- ANA-004: Document public APIs, interfaces, and dependencies26- ANA-005: Recognize creational/structural/behavioral patterns27- ANA-006: Document method parameters, return values, exceptions28- ANA-007: Assess performance, security, reliability, maintainability29- ANA-008: Infer integration patterns and data flow3031## Language-Specific Optimizations3233- LNG-001: **C#/.NET** - async/await, dependency injection, configuration, disposal34- LNG-002: **Java** - Spring framework, annotations, exception handling, packaging35- LNG-003: **TypeScript/JavaScript** - modules, async patterns, types, npm36- LNG-004: **Python** - packages, virtual environments, type hints, testing3738## Error Handling3940- ERR-001: Path doesn't exist - provide correct format guidance41- ERR-002: No source files found - suggest alternative locations42- ERR-003: Unclear structure - document findings and request clarification43- ERR-004: Non-standard patterns - document custom approaches44- ERR-005: Insufficient code - focus on available information, highlight gaps4546## Output Format4748Generate well-structured Markdown with clear heading hierarchy, code blocks, tables, bullet points, and proper formatting for readability and maintainability.4950## File Location5152The documentation should be saved in the `/docs/components/` directory and named according to the convention: `[component-name]-documentation.md`.5354## Required Documentation Structure5556The documentation file must follow the template below, ensuring that all sections are filled out appropriately. The front matter for the markdown should be structured correctly as per the example following:5758```md59---60title: [Component Name] - Technical Documentation61component_path: `${input:ComponentPath}`62version: [Optional: e.g., 1.0, Date]63date_created: [YYYY-MM-DD]64last_updated: [Optional: YYYY-MM-DD]65owner: [Optional: Team/Individual responsible for this component]66tags: [Optional: List of relevant tags or categories, e.g., `component`,`service`,`tool`,`infrastructure`,`documentation`,`architecture` etc]67---6869# [Component Name] Documentation7071[A short concise introduction to the component and its purpose within the system.]7273## 1. Component Overview7475### Purpose/Responsibility76- OVR-001: State component's primary responsibility77- OVR-002: Define scope (included/excluded functionality)78- OVR-003: Describe system context and relationships7980## 2. Architecture Section8182- ARC-001: Document design patterns used (Repository, Factory, Observer, etc.)83- ARC-002: List internal and external dependencies with purposes84- ARC-003: Document component interactions and relationships85- ARC-004: Include visual diagrams (UML class, sequence, component)86- ARC-005: Create mermaid diagram showing component structure, relationships, and dependencies8788### Component Structure and Dependencies Diagram8990Include a comprehensive mermaid diagram that shows:91- **Component structure** - Main classes, interfaces, and their relationships92- **Internal dependencies** - How components interact within the system93- **External dependencies** - External libraries, services, databases, APIs94- **Data flow** - Direction of dependencies and interactions95- **Inheritance/composition** - Class hierarchies and composition relationships9697```mermaid98graph TD99 subgraph "Component System"100 A[Main Component] --> B[Internal Service]101 A --> C[Internal Repository]102 B --> D[Business Logic]103 C --> E[Data Access Layer]104 end105106 subgraph "External Dependencies"107 F[External API]108 G[Database]109 H[Third-party Library]110 I[Configuration Service]111 end112113 A --> F114 E --> G115 B --> H116 A --> I117118 classDiagram119 class MainComponent {120 +property: Type121 +method(): ReturnType122 +asyncMethod(): Promise~Type~123 }124 class InternalService {125 +businessOperation(): Result126 }127 class ExternalAPI {128 <<external>>129 +apiCall(): Data130 }131132 MainComponent --> InternalService133 MainComponent --> ExternalAPI134```135136## 3. Interface Documentation137138- INT-001: Document all public interfaces and usage patterns139- INT-002: Create method/property reference table140- INT-003: Document events/callbacks/notification mechanisms141142| Method/Property | Purpose | Parameters | Return Type | Usage Notes |143|-----------------|---------|------------|-------------|-------------|144| [Name] | [Purpose] | [Parameters] | [Type] | [Notes] |145146## 4. Implementation Details147148- IMP-001: Document main implementation classes and responsibilities149- IMP-002: Describe configuration requirements and initialization150- IMP-003: Document key algorithms and business logic151- IMP-004: Note performance characteristics and bottlenecks152153## 5. Usage Examples154155### Basic Usage156157```csharp158// Basic usage example159var component = new ComponentName();160component.DoSomething();161```162163### Advanced Usage164165```csharp166// Advanced configuration patterns167var options = new ComponentOptions();168var component = ComponentFactory.Create(options);169await component.ProcessAsync(data);170```171172- USE-001: Provide basic usage examples173- USE-002: Show advanced configuration patterns174- USE-003: Document best practices and recommended patterns175176## 6. Quality Attributes177178- QUA-001: Security (authentication, authorization, data protection)179- QUA-002: Performance (characteristics, scalability, resource usage)180- QUA-003: Reliability (error handling, fault tolerance, recovery)181- QUA-004: Maintainability (standards, testing, documentation)182- QUA-005: Extensibility (extension points, customization options)183184## 7. Reference Information185186- REF-001: List dependencies with versions and purposes187- REF-002: Complete configuration options reference188- REF-003: Testing guidelines and mock setup189- REF-004: Troubleshooting (common issues, error messages)190- REF-005: Related documentation links191- REF-006: Change history and migration notes192193```