From 1677db5764f246ba65f5d4f8cc813ec823d4ff31 Mon Sep 17 00:00:00 2001 From: gretchenboria Date: Fri, 9 Oct 2026 18:53:57 -0700 Subject: [PATCH 1/3] feat: add archviewer plugin with /arch command for D2 diagrams --- builtin/plugins/archviewer/README.md | 39 +++++++++++++++++++ builtin/plugins/archviewer/logo.svg | 19 +++++++++ builtin/plugins/archviewer/plugin.json | 5 +++ .../plugins/archviewer/skills/arch/SKILL.md | 24 ++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 builtin/plugins/archviewer/README.md create mode 100644 builtin/plugins/archviewer/logo.svg create mode 100644 builtin/plugins/archviewer/plugin.json create mode 100644 builtin/plugins/archviewer/skills/arch/SKILL.md diff --git a/builtin/plugins/archviewer/README.md b/builtin/plugins/archviewer/README.md new file mode 100644 index 000000000..ee14b5f45 --- /dev/null +++ b/builtin/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). + +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/builtin/plugins/archviewer/logo.svg b/builtin/plugins/archviewer/logo.svg new file mode 100644 index 000000000..f644a551b --- /dev/null +++ b/builtin/plugins/archviewer/logo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + ARCHVIEWER + diff --git a/builtin/plugins/archviewer/plugin.json b/builtin/plugins/archviewer/plugin.json new file mode 100644 index 000000000..7da81a6b3 --- /dev/null +++ b/builtin/plugins/archviewer/plugin.json @@ -0,0 +1,5 @@ +{ + "name": "archviewer", + "description": "D2 declarative architecture diagram builder.", + "author": "Google Antigravity" +} diff --git a/builtin/plugins/archviewer/skills/arch/SKILL.md b/builtin/plugins/archviewer/skills/arch/SKILL.md new file mode 100644 index 000000000..e764d8408 --- /dev/null +++ b/builtin/plugins/archviewer/skills/arch/SKILL.md @@ -0,0 +1,24 @@ +--- +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 a timestamped file, e.g., `architecture_$(date +%s).d2`, within a temporary or artifacts directory (or current workspace root if none exists) to prevent overwriting existing files. + - **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: + `FILE_PREFIX="architecture_$(date +%s)"; if command -v d2 >/dev/null 2>&1; then d2 --pad 50 "${FILE_PREFIX}.d2" "${FILE_PREFIX}.png" && { command -v open >/dev/null && open "${FILE_PREFIX}.png" || xdg-open "${FILE_PREFIX}.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. Output the official SVG logo by printing this exact markdown (DO NOT wrap it in backticks or code blocks, it must be raw markdown to render the image). Use the relative path to the plugin's logo via the agent's app data directory (do not hardcode the user's home directory): + `![ArchViewer Logo](file://~/.gemini/config/plugins/archviewer/logo.svg)` + *(Note: The agent will resolve the tilde to the absolute path at runtime).* +6. Briefly summarize the architecture that was generated. From 38274cdae3c03d5af2cb6f0b0f0c91d4a85e2d3f Mon Sep 17 00:00:00 2001 From: gretchenboria Date: Fri, 9 Oct 2026 18:59:48 -0700 Subject: [PATCH 2/3] chore: re-trigger checks From 387d49bd07438530a59943f579c011177b57a474 Mon Sep 17 00:00:00 2001 From: gretchenboria Date: Tue, 13 Oct 2026 14:34:28 -0700 Subject: [PATCH 3/3] refactor(examples): move archviewer plugin to examples/plugins, fix author and d2 path --- {builtin => examples}/plugins/archviewer/README.md | 2 +- {builtin => examples}/plugins/archviewer/logo.svg | 0 {builtin => examples}/plugins/archviewer/plugin.json | 2 +- .../plugins/archviewer/skills/arch/SKILL.md | 11 ++++------- 4 files changed, 6 insertions(+), 9 deletions(-) rename {builtin => examples}/plugins/archviewer/README.md (98%) rename {builtin => examples}/plugins/archviewer/logo.svg (100%) rename {builtin => examples}/plugins/archviewer/plugin.json (73%) rename {builtin => examples}/plugins/archviewer/skills/arch/SKILL.md (60%) diff --git a/builtin/plugins/archviewer/README.md b/examples/plugins/archviewer/README.md similarity index 98% rename from builtin/plugins/archviewer/README.md rename to examples/plugins/archviewer/README.md index ee14b5f45..e11a99fd8 100644 --- a/builtin/plugins/archviewer/README.md +++ b/examples/plugins/archviewer/README.md @@ -1,6 +1,6 @@ # πŸ‘·β€β™‚οΈ Antigravity ArchViewer Plugin -**ArchViewer** is a zero-token, privacy-first architectural diagram generator for [Google Antigravity](https://github.com/google/antigravity). +**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. diff --git a/builtin/plugins/archviewer/logo.svg b/examples/plugins/archviewer/logo.svg similarity index 100% rename from builtin/plugins/archviewer/logo.svg rename to examples/plugins/archviewer/logo.svg diff --git a/builtin/plugins/archviewer/plugin.json b/examples/plugins/archviewer/plugin.json similarity index 73% rename from builtin/plugins/archviewer/plugin.json rename to examples/plugins/archviewer/plugin.json index 7da81a6b3..082230226 100644 --- a/builtin/plugins/archviewer/plugin.json +++ b/examples/plugins/archviewer/plugin.json @@ -1,5 +1,5 @@ { "name": "archviewer", "description": "D2 declarative architecture diagram builder.", - "author": "Google Antigravity" + "author": "gretchenboria" } diff --git a/builtin/plugins/archviewer/skills/arch/SKILL.md b/examples/plugins/archviewer/skills/arch/SKILL.md similarity index 60% rename from builtin/plugins/archviewer/skills/arch/SKILL.md rename to examples/plugins/archviewer/skills/arch/SKILL.md index e764d8408..33ed6472f 100644 --- a/builtin/plugins/archviewer/skills/arch/SKILL.md +++ b/examples/plugins/archviewer/skills/arch/SKILL.md @@ -7,7 +7,7 @@ description: Generates a D2 architectural diagram based on the current conversat 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 a timestamped file, e.g., `architecture_$(date +%s).d2`, within a temporary or artifacts directory (or current workspace root if none exists) to prevent overwriting existing files. +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) @@ -15,10 +15,7 @@ When the `/arch` slash command is used or when this skill is invoked: - 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: - `FILE_PREFIX="architecture_$(date +%s)"; if command -v d2 >/dev/null 2>&1; then d2 --pad 50 "${FILE_PREFIX}.d2" "${FILE_PREFIX}.png" && { command -v open >/dev/null && open "${FILE_PREFIX}.png" || xdg-open "${FILE_PREFIX}.png"; }; else echo "D2_MISSING"; fi` +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. Output the official SVG logo by printing this exact markdown (DO NOT wrap it in backticks or code blocks, it must be raw markdown to render the image). Use the relative path to the plugin's logo via the agent's app data directory (do not hardcode the user's home directory): - `![ArchViewer Logo](file://~/.gemini/config/plugins/archviewer/logo.svg)` - *(Note: The agent will resolve the tilde to the absolute path at runtime).* -6. Briefly summarize the architecture that was generated. +5. Briefly summarize the architecture that was generated.