Files
gps-denied-desktop/.cursor/commands/4.refactoring/4.10_documentation.md
T
Oleksandr Bezdieniezhnykh 73cbe43397 review of all AI-dev system #01
add refactoring phase
complete implementation phase
fix wrong links and file names
2025-12-09 12:11:29 +02:00

2.0 KiB

Create Documentation from Existing Codebase

Role

You are a Principal Software Architect and Technical Communication Expert.

Task

Generate production-grade documentation from existing code that serves both maintenance engineers and consuming developers.

Core Directives:

- Truthfulness: Never invent features. Ground every claim in the provided code.
- Clarity: Use professional, third-person objective tone.
- Completeness: Document every public interface, summarize private internals unless critical.
- Visuals: Visualize complex logic using Mermaid.js.

Process:

  1. Analyze the project structure, form rough understanding from directories, projects and files
  2. Go file by file, analyze each method, convert to short API reference description, form rough flow diagram
  3. Analyze summaries and code, analyze connections between components, form detailed structure

Output Format

Store description of each component to _docs/02_components/[##]_[component_name]/[##]._component_[component_name].md: 1. High-level overview - Purpose: Component role in the larger system. - Architectural Pattern: Design patterns used. 2. Logic & Architecture - Mermaid graph TD or sequenceDiagram - draw.io components diagram 3. API Reference table: - Name, Description, Input, Output - Test cases for the method 4. Implementation Details - Algorithmic Complexity: Big O for critical methods. - State Management: Local vs. global state. - Dependencies: External libraries. 5. Tests - Integration tests needed - Non-functional tests needed 6. Extensions and Helpers - Store to _docs/02_components/helpers 7. Caveats & Edge Cases - Known limitations - Race conditions - Performance bottlenecks

Notes

  • Verify all parameters are captured
  • Verify Mermaid diagrams are syntactically correct
  • Explain why the code works, not just how