Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions examples/plugins/archviewer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 👷‍♂️ Antigravity ArchViewer Plugin

**ArchViewer** is a zero-token, privacy-first architectural diagram generator for [Google Antigravity](https://github.com/google-antigravity/antigravity-cli).

It intelligently watches your agentic brainstorming sessions and, the moment an architecture plan is solidified, autonomously drafts and renders a professional, full-color system topology map using [D2 (Declarative Diagramming)](https://d2lang.com/)—without spending a single LLM token on image generation.

## 🌟 Value Proposition for the Developer Community

1. **Zero-Token High-Fidelity Rendering**: Spare yourself from wasting expensive image-generation tokens or dealing with messy text generation. The agent drafts a deterministic D2 file, and local rendering takes over.
2. **Absolute Data Privacy**: Sensitive cloud topologies and node relationships never leave your machine to be rendered by third-party web services.
3. **Diagrams-as-Code (GitOps Ready)**: The intermediate `architecture.d2` means the layout is natively version-controllable. Manually tweak the file, PR the changes, and generate diffs in your CI/CD pipelines.
4. **Frictionless Portability**: Works out of the box locally provided the `d2` compiler is installed.

## 📦 Installation

Ensure you have D2 installed on your system (e.g., `brew install d2` on macOS).

Copy this directory structure into your workspace's `.agents` or your global `~/.gemini/config` directory:

```text
.agents/plugins/archviewer/
├── plugin.json
├── README.md
├── architecture.d2 (Auto-generated)
├── logo.svg (Official Chat Logo)
├── rules/
│ └── AGENTS.md (Agent instructions)
└── skills/
└── arch/
└── SKILL.md (Slash command definition)
```

## 🚀 How it Works

When chatting with Antigravity:
1. Brainstorm your architecture.
2. When the plan is **solidified** (e.g., you say "Looks good, let's build it"), Antigravity automatically outputs an `architecture.d2` file.
3. Antigravity runs the D2 compiler to generate an `architecture.png` file and automatically opens it.
4. Type `/arch` in the chat at any time to instantly pop open the latest generated diagram on your OS.
19 changes: 19 additions & 0 deletions examples/plugins/archviewer/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions examples/plugins/archviewer/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "archviewer",
"description": "D2 declarative architecture diagram builder.",
"author": "gretchenboria"
}
21 changes: 21 additions & 0 deletions examples/plugins/archviewer/skills/arch/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: arch
description: Generates a D2 architectural diagram based on the current conversation and opens it.
---

# ArchViewer Generation Skill

When the `/arch` slash command is used or when this skill is invoked:
1. Analyze the current conversation and proposed system architecture.
2. Use the `write_to_file` tool to draft a declarative D2 diagram in `architecture.d2` within the current workspace or artifacts directory.
- **Important Layout:** Strictly use `direction: down` (vertical) without any exceptions.
- **Important Styling (Light Background + Max Contrast):** Do not use default colors. Use a modern, light-themed aesthetic with high-contrast accents. Exclusively use this precise color palette:
- Primary accents (Nodes/Shapes): `#ED1B76` (Vivid Pink) and `#037A76` (Deep Teal)
- Backgrounds/Containers: `#F4F4F4` (Light Grey) or `#FFFFFF` (White)
- Strokes/Borders: Must be `#1F1F1F` (Dark Grey/Black) with `stroke-width: 3` for sharp visibility against the light background.
- Text: MUST explicitly set `font-color: "#FFFFFF"` (Stark White) on the colored nodes, but use `#1F1F1F` (Dark Grey/Black) for text on the light backgrounds or containers.
- Use shapes like `circle`, `hexagon`, `cylinder`, and `square` where symbolically appropriate. Do not use unsupported shapes (like `triangle` for node shapes).
3. Use the `run_command` tool to compile and open the diagram using the exact path written in step 2:
`if command -v d2 >/dev/null 2>&1; then d2 --pad 50 "architecture.d2" "architecture.png" && { command -v open >/dev/null && open "architecture.png" || xdg-open "architecture.png"; }; else echo "D2_MISSING"; fi`
4. If the command output includes `D2_MISSING`, inform the user that the D2 compiler is required and provide the installation command: `curl -fsSL https://d2lang.com/install.sh | sh -s --` or `brew install d2`. Do NOT proceed to the next step.
5. Briefly summarize the architecture that was generated.
Loading