VS Code extension for generating architecture diagrams from code
Top 40.6% on sourcepulse
Swark is a VS Code extension that automatically generates architecture diagrams from codebases using Large Language Models (LLMs), specifically integrating with GitHub Copilot. It aims to simplify understanding complex or unfamiliar codebases for developers, aiding in onboarding, documentation, and code review.
How It Works
Swark retrieves code files from a selected directory, dynamically adjusting the quantity to respect LLM token limits. It then constructs a prompt containing the code and instructions for diagram generation, which is sent to GitHub Copilot via the VS Code Language Model API. The LLM's response, a Mermaid.js-formatted diagram, is saved as a Markdown file and previewed within VS Code. This approach offers universal language support as the LLM handles code interpretation, and ensures privacy by only sharing code with GitHub Copilot.
Quick Start & Requirements
Swark: Create Architecture Diagram
or use keybindings cmd+shift+r
(Mac) / ctrl+shift+r
(Windows).Highlighted Details
Maintenance & Community
Contributions are welcomed; details are available in the Contribution Guide. Telemetry data is collected for product improvement, which can be disabled in VS Code settings.
Licensing & Compatibility
Licensed under the GNU Affero General Public License v3.0. This is a strong copyleft license, meaning derivative works must also be open-sourced under the same license.
Limitations & Caveats
The number of files processed is limited by both the swark.maxFiles
setting and the LLM's maximum token limit. The extension collects telemetry data by default.
4 months ago
1 week