DocDelta
A diff-aware documentation agent for VS Code that incrementally updates your Markdown documentation based on git diffs.
Overview
DocDelta is an intelligent documentation assistant that keeps your Markdown docs in sync with your codebase. Instead of regenerating entire documentation files, it detects added or modified functions through git diffs and updates only the corresponding sections using stable document anchors. This approach preserves your existing documentation structure, minimizes unnecessary changes, and ensures consistent, maintainable documentation.
Features
- 🔍 Diff-Aware Detection: Automatically detects added or modified functions in your codebase using git diffs
- 📝 Incremental Updates: Updates only the relevant documentation sections instead of regenerating entire files
- ⚓ Stable Anchors: Uses document anchors to maintain consistent documentation structure
- 🤖 AI-Powered: Leverages OpenAI's API to generate high-quality documentation updates
- 🎯 Minimal Changes: Preserves existing documentation and makes only necessary updates
- ⚡ Smart Dependencies: Automatically checks and installs required Python dependencies
Requirements
- Python 3: Python 3.x must be installed and available in your PATH
- Git: Your project must be a git repository to detect changes
- OpenAI API Key: Required for AI-powered documentation generation
- pip3: Python package manager for installing dependencies
Installation
- Install the extension from the VS Code Marketplace
- Ensure Python 3 is installed on your system
- Obtain an OpenAI API key from OpenAI's platform
Configuration
This extension requires the following configuration:
Settings
docdelta.openaiKey: Your OpenAI API key (required)
To configure your API key:
- Open VS Code Settings (
Cmd+, on macOS or Ctrl+, on Windows/Linux)
- Search for "docdelta"
- Enter your OpenAI API key in the
docdelta.openaiKey field
Alternatively, add to your settings.json:
{
"docdelta.openaiKey": "your-openai-api-key-here"
}
Usage
- Open your project in VS Code (must be a git repository)
- Make changes to your code and commit them
- Open the Command Palette (
Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux)
- Run the command: "docdelta"
- The extension will:
- Check and install Python dependencies if needed
- Analyze git diffs to detect code changes
- Update relevant documentation sections
- Show a success notification when complete
How It Works
- Change Detection: DocDelta analyzes your git diffs to identify added or modified functions
- Smart Analysis: The AI agent examines the changes and determines which documentation sections need updates
- Incremental Updates: Only the affected sections are updated using stable document anchors
- Structure Preservation: Your existing documentation structure and formatting remain intact
Python Dependencies
The extension automatically manages its Python dependencies. On first run, it will install:
openai: For AI-powered documentation generation
python-dotenv: For environment variable management
If automatic installation fails, you can manually install them:
pip3 install -r src/python/requirements.txt
Known Issues
- The extension requires Python 3 to be accessible via the
python3 command
- Only Markdown documentation is currently supported
- Requires an active internet connection for OpenAI API calls
Release Notes
0.0.1
Initial release of DocDelta:
- Diff-aware documentation updates
- Incremental section updates with stable anchors
- OpenAI integration for documentation generation
- Automatic Python dependency management
Contributing
Found a bug or have a feature request? Please open an issue on the project repository.
License
See LICENSE file for details.
Enjoy keeping your documentation in sync! ✨