diff --git a/examples/plugins/archviewer/README.md b/examples/plugins/archviewer/README.md new file mode 100644 index 000000000..e11a99fd8 --- /dev/null +++ b/examples/plugins/archviewer/README.md @@ -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. diff --git a/examples/plugins/archviewer/logo.svg b/examples/plugins/archviewer/logo.svg new file mode 100644 index 000000000..f644a551b --- /dev/null +++ b/examples/plugins/archviewer/logo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + ARCHVIEWER + diff --git a/examples/plugins/archviewer/plugin.json b/examples/plugins/archviewer/plugin.json new file mode 100644 index 000000000..082230226 --- /dev/null +++ b/examples/plugins/archviewer/plugin.json @@ -0,0 +1,5 @@ +{ + "name": "archviewer", + "description": "D2 declarative architecture diagram builder.", + "author": "gretchenboria" +} diff --git a/examples/plugins/archviewer/skills/arch/SKILL.md b/examples/plugins/archviewer/skills/arch/SKILL.md new file mode 100644 index 000000000..33ed6472f --- /dev/null +++ b/examples/plugins/archviewer/skills/arch/SKILL.md @@ -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.