swark  by swark-io

VS Code extension for generating architecture diagrams from code

created 9 months ago
915 stars

Top 40.6% on sourcepulse

GitHubView on GitHub
Project Summary

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

  • Install Swark via the VS Code Extension Marketplace.
  • Requires GitHub Copilot (free tier available).
  • Optional: Mermaid Markdown Preview extension for in-editor previews.
  • Usage: Open Command Palette, run Swark: Create Architecture Diagram or use keybindings cmd+shift+r (Mac) / ctrl+shift+r (Windows).

Highlighted Details

  • Leverages GitHub Copilot for LLM integration, requiring no separate API keys or authentication.
  • Generates diagrams in Mermaid.js syntax, allowing for further editing and refinement.
  • Supports all programming languages natively due to LLM-based interpretation.
  • Prioritizes privacy by sharing source code exclusively with GitHub Copilot.

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.

Health Check
Last commit

4 months ago

Responsiveness

1 week

Pull Requests (30d)
1
Issues (30d)
0
Star History
55 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.