AGY Lazy Prompt
by ShawTim
README.md
<p align="center">
<img src="assets/banner.png" alt="AGY Lazy Prompt — 1-Click Prompts & AI Replies for Google Antigravity" width="100%" />
</p>
<p align="center">
<strong>English</strong> · <a href="README.zh-TW.md">繁體中文</a> · <a href="README.zh-CN.md">简体中文</a>
</p>
# AGY Lazy Prompt
> **Stop retyping the same steering prompts.** **AGY Lazy Prompt** adds a native right-hand Side Pane (**Lazy Prompt**) to **Google Antigravity** with **phase-aware AI reply suggestions**, **1-click saved prompts** (drag-to-reorder, `{{input}}` variables, JSON import/export), and an **on-demand Quick Composer** — sending **real User chat messages** via Antigravity's official MCP Apps SDK while powering silent background suggestions on Antigravity's built-in models with **zero API keys**, **zero external CLIs**, and **zero leftover sidebar chats**.
https://github.com/user-attachments/assets/1858c5d4-befe-40ad-9e7d-2d15ca564fa7
---
## 8-Second Workflow
1. **0–3s · Silent Auto-Suggest on Turn Finish** — Toggle **`Auto`** ON in the panel; when an Antigravity turn finishes, the non-blocking `Stop` hook triggers the headless AGY Lazy Prompt sidecar (`Fast`, `Balanced`, or `Deep`) in the background to draft 3 tactical next replies tailored to your exact phase of work (planning, just-edited code, failing check, or pre-commit).
2. **3–6s · 1-Click Real User Chat Dispatch** — Click any card (or press **`1`**–**`3`**) to **send immediately** as a real User message in your active chat — or choose **`Edit & send`** (**`⇧1`**–**`⇧3`**) to tweak a few words in the docked **Quick Composer** before hitting **`⌘↵`** / **`Ctrl+↵`**.
3. **6–8s · Fill-In Variables & Context Attachment** — Click any Saved Prompt containing `{{input}}` to fill it inline (or auto-select `{{input}}` in the composer), or attach reusable notes straight to your next message's context pill.
---
## 1-Line Install (Zero Build, Zero API Keys, Zero CLI Setup)
AGY Lazy Prompt ships its pre-built single-file UI (`ui/dist/app.html`) with **zero runtime npm dependencies** — no `npm install`, no `agy` CLI, and no API keys required.
> **Prerequisite**: `node` (`>= 22`) available on your `PATH`.
**macOS / Linux:**
```bash
mkdir -p ~/.gemini/config/plugins && \
git clone https://github.com/ShawTim/agy-lazy-prompt.git ~/.gemini/config/plugins/agy-lazy-prompt
```
**Windows (PowerShell):**
```powershell
New-Item -ItemType Directory -Force "$HOME\.gemini\config\plugins" | Out-Null
git clone https://github.com/ShawTim/agy-lazy-prompt.git "$HOME\.gemini\config\plugins\agy-lazy-prompt"
```
Then in the **Google Antigravity App**:
1. **Reload Antigravity once**: Restart Antigravity (or toggle **Lazy Prompt** off and back on in **Customizations > Installed**) so Antigravity loads the plugin and starts its background suggestion service automatically.
2. **Open & pin**: In any conversation's right-hand **Side Panel**, click **`+`** -> **Lazy Prompt** (right-click the tab -> **Pin Tab** to keep it docked across conversations).
3. **Optional — enable Auto-Suggest**: **`Auto`** defaults to **OFF** so nothing runs without your consent; toggle **`Auto`** ON in the panel if you want fresh reply suggestions drafted automatically after each completed turn (excluding canceled/error turns and deduplicated stops).
---
## Why Hybrid MCP App + Headless Sidecar?
AGY Lazy Prompt combines the best of Antigravity's **MCP Apps SDK (`@modelcontextprotocol/ext-apps`)** and **Headless Sidecar** architectures:
- **100% Real User Chat Bubbles**: Dispatches prompts via `app.sendMessage({ role: "user" })` so every click enters the conversation as a real User turn (never a `"Message from system"` wrapper), plus supports `app.updateModelContext()` context pills.
- **Zero Duplicate Side Pane Entries**: The sidecar runs strictly headless (`"has_web_ui": false`), so **Lazy Prompt** appears once in the Side Panel **`+`** menu and left sidebar.
- **Zero Context Window Bloat**: Exposes **only 1 tiny read-only entry tool** (`open_prompt_deck`) returning a minimal `{ ok: true, opened: true }` acknowledgment; all state, CRUD, and suggestion tools use `_meta.ui.visibility: ["app"]` and are invisible to the model.
- **Follow Active Chat + Optional Pin**: Tracks each conversation's workspace, git status, transcript, and suggestions independently. By default a pinned Side Pane automatically follows whichever chat you are currently working in, and you can click the **Pin** icon (or pick any recent chat from the header dropdown) to lock it to a specific conversation.
- **Safe, Verified Ephemeral Cleanup & Zero CLI Dependency**: The headless sidecar calls `product.v1.ConversationService` using Antigravity's official model tier aliases (`flash_lite`, `flash`, `pro`) — creating an ephemeral run, polling to completion, reading the reply, and calling metadata-verified `DeleteConversation` in `finally` (plus a startup orphan sweep that verifies `metadata.tags` (`prompt-deck-ephemeral`) and non-project status so user chats are never touched).
- **Non-Blocking Lifecycle Hook**: `hooks.json` (`SessionStart` + `Stop`) updates `active-session.json` (`0600`, cross-process file-locked) with isolated hook-only ignore guards (`ignored-ids.json`) and triggers observable background suggestion generation without blocking the agent loop.
```mermaid
flowchart LR
UI["Lazy Prompt MCP App (ui/dist/app.html)"] -->|"app.sendMessage + updateModelContext"| Chat["Active Antigravity Chat (Real User Bubble)"]
UI <-->|"app-only tools/call"| MCP["MCP Server (server/mcp-server.mjs, 0 runtime deps)"]
Hook["SessionStart + Stop Hook (non-blocking)"] -->|"active-session.json (0600)"| Store[("~/.config/antigravity-prompt-deck")]
MCP <--> Store
Hook -.->|"202 Auto-Suggest"| Bridge["Headless Sidecar Bridge (127.0.0.1 + X-Bridge-Token)"]
MCP <-->|"/suggest"| Bridge
Bridge -->|"Create → Poll → Verified Delete"| Conv["ConversationService (Fast / Balanced / Deep)"]
```
---
## Features
- **Simple Speed/Depth Tiers (Zero Hardcoded Models)**: Switch between **`Fast`**, **`Balanced`** *(default)*, and **`Deep`** — mapped directly to Antigravity's official tier aliases using your existing sign-in, with no brittle model version strings to maintain.
- **Phase-Aware Suggested Replies**: Grounded in your recent chat turns and live `git status` / `git diff --stat`, naturally matching your conversation's language, with live status & error feedback for both manual and Auto-Suggest runs.
- **5 Senior-Engineer Default Saved Prompts**:
1. *Root-cause first (no edits)* — trace exact file:line cause and trade-offs before touching code.
2. *Audit uncommitted diff* — staff-level `git diff HEAD` review skipping style nitpicks.
3. *Run tests & fix root cause* — minimal fix without weakening assertions or silencing types.
4. *Simplify recent changes* — strip dead branches and duplication while keeping interfaces intact.
5. *Prep commit & PR summary* — catch leftover debug artifacts and draft a clean commit + PR note.
- **Drag-to-Reorder & Clean `⋯` Menu**: Reorder Saved Prompts via the left drag grip, click any card body for 1-click send, or open **`⋯`** for **`Edit & send`**, **`Edit & save`**, and **`Delete`** (with instant **`Undo`**).
- **`{{input}}` Template Guard**: Choosing **`Edit & send`** on a template auto-highlights `{{input}}` in the Quick Composer so typing replaces it immediately, and blocks accidental dispatch of literal `{{input}}`.
- **1-Click Export & Import JSON**: Share team prompt packs (`.json`) via file picker, clipboard copy, or paste.
- **Live Host Theme Sync**: Adapts instantaneously to every Antigravity light and dark theme via `applyDocumentTheme` and `applyHostStyleVariables`.
---
## Keyboard Shortcuts
| Shortcut | Action |
| :--- | :--- |
| **`1` – `3`** *(outside inputs)* | **Send** Suggested Reply #1–#3 straight to the active chat |
| **`⇧1` – `⇧3`** (`Shift+1 – 3`) | **`Edit & send`** Suggested Reply #1–#3 in the Quick Composer |
| **`⌘↵`** / **`Ctrl+Enter`** *(in composer)* | Send Quick Composer text to the active chat |
| **`/`** *(outside inputs)* | Focus Saved Prompts search filter |
| **`Esc`** | Close menu/modal, cancel drag or inline `{{input}}`, or clear search |
---
## Repository Layout
```text
agy-lazy-prompt/
├── plugin.json # Antigravity plugin manifest (v1.0.0)
├── mcp_config.json # MCP App server registration
├── hooks.json # Flat SessionStart + Stop hook (non-blocking)
├── assets/
│ ├── logo.png # 512x512 transparent-background plugin icon
│ ├── banner.png # 1280x720 README hero banner
│ └── social-preview.png # 1280x640 GitHub Social Preview image
├── server/
│ ├── core.mjs # 0600 atomic storage, transcript parser & verified ConversationService
│ ├── mcp-server.mjs # Stdio JSON-RPC 2.0 MCP server (0 runtime deps)
│ └── session-hook.mjs # Non-blocking session tracker + isolated ephemeral guards
├── sidecars/prompt_deck/
│ ├── sidecar.json # Headless sidecar manifest (has_web_ui: false)
│ ├── package.json # Module marker (0 dependencies)
│ └── main.mjs # Authenticated 127.0.0.1 ConversationService bridge
├── ui/
│ ├── src/ # MCP App UI source (@modelcontextprotocol/ext-apps)
│ └── dist/app.html # Pre-built single-file MCP App resource (<500 KB)
├── scripts/
│ ├── build-ui.mjs # esbuild single-file bundler
│ └── smoke-test.mjs # End-to-end automated test suite
├── .github/workflows/ci.yml # Ubuntu, macOS & Windows Node 22 CI
├── THIRD_PARTY_NOTICES.md # Upstream licenses for bundled UI SDK
└── LICENSE # MIT License
```
---
## Local Development & Verification
Requires Node.js `>= 22`:
```bash
npm ci
npm run build
npm test
```
---
## License
[MIT](LICENSE). Third-party open-source notices for libraries bundled into `ui/dist/app.html` are listed in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
*Unofficial community plugin for Google Antigravity — not affiliated with or endorsed by Google.*
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues