Skip to main content
Glama
AGY Local Skills Hub

AGY Local Skills Hub

README.md
# AGY Local Skills Hub (`agy-skills-hub`)

A native **MCP App UI plugin + CLI** for **Google Antigravity (AGY)** to toggle, organize, translate, and audit your local and remote Skills without duplicating directories or modifying `config.json`.

专为 **Google Antigravity (AGY)** 打造的本地 **Skills Hub** 可视化管理插件与命令行工具:直接集成在 AGY 左侧边栏和右侧辅助栏中,通过官方 `~/.gemini/config/skills.json` 无损开关各类 Skills,内建 [`backnotprop/pstack`](https://github.com/backnotprop/pstack) 全套 59 个技能的中文导读与翻译。

---

## Core Features | 核心特性

- **Native AGY UI (MCP App)**
  - Renders directly in AGY's left sidebar (`global` entrypoint) and right auxiliary pane (`aux_pane` `+` menu), plus `/skills-hub` in chat.
  - Strictly follows AGY theme variables (`--color-*`, light/dark mode) and `default-src 'none'` CSP (single bundled `ui.html`).
- **Non-Destructive Hot-Reload Toggling (`~/.gemini/config/skills.json`)**
  - Disables AGY global skills (`~/.gemini/config/skills/`) via top-level `exclude`.
  - Mounts external skills from `pstack`, `~/.codex/skills/`, `~/.agents/skills/`, or custom local/GitHub repositories via `entries` + `include_only`.
  - Never moves original folders, never breaks symlinks, and never touches `~/.gemini/config/config.json`. Changes apply automatically on the next AGY turn (or `/skills reload` in AGY CLI).
- **Bilingual Chinese & English Support | 中英双语与中文翻译**
  - Built-in Chinese titles, summaries, usage scenarios, categories, and tags for all **59 `pstack` skills** and common AGY skills.
  - Supports switching between `中英双语` / `纯中文` / `English`, inline editing custom translations into `~/.gemini/config/skills-hub/state.json`, or asking AGY to batch-translate missing entries.
- **Presets & Diagnostics | 场景预设与冲突体检**
  - 5 built-in presets (`opus-pstack`, `pstack-workflow`, `minimal-coding`, `office-ppt`, `agy-default-clean`) plus custom saved presets.
  - Automatically detects cross-source duplicates, built-in slash command collisions (e.g. `pstack:swarm` vs AGY `/swarm`), missing companion dependencies (e.g. `ketchup` → `bro`), broken symlinks, and estimates system-prompt token footprint.
- **Token Budget & Breakdown Card | 「技能与自定义」Token 预算面板**
  - Visualizes `项目规则` (`20,000` tokens) and `其他自定义项` (`20,000` tokens stacked across `技能列表` + `子代理` + `MCP 工具`) in real time, with expandable per-item breakdowns and one-click disable.
- **Plugin Lifecycle View | 插件启停管理**
  - Lists installed AGY plugins via fast read-only local discovery and toggles them cleanly via `agy plugin enable / disable`.

---

## Install & Deploy | 安装与部署

### Prerequisites
- Node.js `>= 22`
- Google Antigravity (`agy` CLI / App)
- `git` (for syncing remote skill repositories)

### Setup

```bash
git clone https://github.com/xiangbianpangde/agy-skills-hub.git
cd agy-skills-hub
npm install
npm run build
npm run deploy
```

`npm run deploy` will:
1. Install the plugin bundle into `~/.gemini/config/plugins/skills-hub/`.
2. Symlink the CLI binary to `~/.local/bin/skills-hub`.

### Optional: Pre-load `pstack` (Poteto's 59 engineering skills)

```bash
mkdir -p ~/.gemini/config/skills-hub/sources
git clone --depth 1 https://github.com/backnotprop/pstack.git ~/.gemini/config/skills-hub/sources/pstack
```

You can also clone any other GitHub skill repo directly inside the **来源与体检 (Sources & Doctor)** tab in the UI.

---

## Usage | 使用方式

### In Antigravity (AGY)
- Click **Skills Hub** in the left sidebar (full-page view) or the `+` menu in the right side pane.
- Or run `/skills-hub` in chat.
- Ask AGY directly in chat (powered by `skills_hub_manage`) to inspect skills, toggle them, apply a preset, or batch-translate untranslated skills.

### In Terminal (`skills-hub` CLI)

```bash
skills-hub doctor                     # Audit duplicates, broken symlinks, and token usage
skills-hub budget                     # Show 20k token budget breakdown (rules, skills, agents, mcp)
skills-hub list --source pstack       # List pstack skills with Chinese summaries
skills-hub preset apply opus-pstack   # Enable Opus-recommended pstack core suite (9 skills)
skills-hub on pstack:reframe          # Enable a single skill
skills-hub off officecli-pptx         # Disable a global AGY skill cleanly
skills-hub sync                       # Pull latest updates from git skill sources
skills-hub plugins                    # List installed AGY plugins
```

---

## Development & Testing | 开发与测试

```bash
npm run typecheck   # TypeScript strict check
npm run build       # Bundle server.mjs, cli.mjs, and single-file dist/ui.html
npm test            # Unit + real stdio MCP server E2E tests
npm run deploy      # Re-deploy to ~/.gemini/config/plugins/skills-hub
agy plugin validate ~/.gemini/config/plugins/skills-hub --json
```

---

## License

[MIT](./LICENSE)