Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agy",
"version": "0.7.3",
"version": "0.7.4",
"description": "Delegate work to Google's Antigravity CLI (agy) with fast Gemini access - five personas: staffer (general), researcher, reviewer (code and plans), implementer, ask.",
"author": {
"name": "Keli Wen",
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agy",
"version": "0.7.3",
"version": "0.7.4",
"description": "Delegate work to Google's Antigravity CLI (agy) with fast Gemini access - five personas: staffer (general), researcher, reviewer (code and plans), implementer, ask.",
"author": {
"name": "Keli Wen",
Expand Down
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Check out text files with LF on every platform: the Pi skill generator and
# Check out text files with LF on every platform: the skill generator and
# its tests parse SKILL.md frontmatter with \n, which CRLF breaks.
* text=auto eol=lf

pi-skills/** linguist-generated=true
opencode-skills/** linguist-generated=true
2 changes: 1 addition & 1 deletion .github/workflows/consistency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '24'
- run: npm run check:pi
- run: npm run check:skills

test-ubuntu:
name: Tests (Ubuntu)
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p align="center"><a href="https://claude.com/claude-code"><img src="assets/badges/claude-code-plugin.svg" height="20" alt="Claude Code plugin"></a> <a href="https://developers.openai.com/codex/"><img src="assets/badges/codex-plugin.svg" height="20" alt="Codex plugin"></a> <a href="LICENSE"><img src="assets/badges/license-mit.svg" height="20" alt="license: MIT"></a></p>

Hire Google's Antigravity CLI (`agy`) as a staffer for **Claude Code**, **OpenAI Codex**, and **Pi**.
Hire Google's Antigravity CLI (`agy`) as a staffer for **Claude Code**, **OpenAI Codex**, **Pi**, and **OpenCode**.

![agy-staff design](assets/design.png)

Expand Down Expand Up @@ -63,6 +63,21 @@ Update with `pi update --extension git:github.com/keli-wen/agy-staff`, then run

</details>

<details>
<summary>Using OpenCode?</summary>

With OpenCode V1 (verified on 1.18.34), install the package through its native plugin manager:

```bash
opencode plugin 'agy-staff@git+https://github.com/keli-wen/agy-staff.git' --global
```

Restart OpenCode, then run `/agy-ask reply with OK`. The plugin automatically registers all seven `agy-*` skills and their native slash commands, including `/agy-lead` and `/agy-jobs`. No separate skills path or command wrappers are needed. Node.js and an authenticated `agy` are required, as above.

OpenCode caches the complete package spec. Restarting does not refresh an unchanged Git spec. To upgrade, choose a newer Git tag or commit and run `opencode plugin 'agy-staff@git+https://github.com/keli-wen/agy-staff.git#<tag-or-commit>' --global --force`, then restart. See [the reference](docs/REFERENCE.md#opencode) for config and local development. OpenCode V2 is not covered by this adapter.

</details>

Restart Claude Code or Codex afterwards. First run: `/agy:ask reply with OK` (Claude Code) or `$agy:ask reply with OK` (Codex). Ask is tool-free and needs no setup.

> [!IMPORTANT]
Expand Down Expand Up @@ -95,7 +110,7 @@ Claude Code and Codex cache per version directory, so an upgrade lands only if t

### CUJs

Examples below use Claude Code's `/agy:…`; in Codex use `$agy:…`.
Examples below use Claude Code's `/agy:…`; in Codex use `$agy:…`, in Pi `/skill:agy-…`, and in OpenCode `/agy-…`.

| Use case | Invocation |
|---|---|
Expand All @@ -116,7 +131,7 @@ Examples below use Claude Code's `/agy:…`; in Codex use `$agy:…`.

## Core design

`lead` adds task orchestration guidance for your current agent. Within lead, orient enough to frame the assignment, delegate substantive work to `staffer` by default, wait for the result, then assess it and integrate or follow up. Specialists provide dedicated guidance when useful, while `ask` is reserved for testing. The host owns cross-task decisions, acceptance, integration, and delivery, using the existing jobs workflow. Invoke `/agy:lead` in Claude Code, `$agy:lead` in Codex, or `/skill:agy-lead` in Pi.
`lead` adds task orchestration guidance for your current agent. Within lead, orient enough to frame the assignment, delegate substantive work to `staffer` by default, wait for the result, then assess it and integrate or follow up. Specialists provide dedicated guidance when useful, while `ask` is reserved for testing. The host owns cross-task decisions, acceptance, integration, and delivery, using the existing jobs workflow. Invoke `/agy:lead` in Claude Code, `$agy:lead` in Codex, `/skill:agy-lead` in Pi, or `/agy-lead` in OpenCode.

`ask` answers in the same call. The other personas return a job id and a collection command, such as `wait <id> --timeout 10m`. Your agent waits using the host's available capabilities, with one independent background wait per job where supported.

Expand All @@ -143,7 +158,7 @@ A few things worth knowing before you open a PR:
- **Run the tests**: `npm test`. The standard suite uses temporary repos and HOME directories with fake `agy`, plus focused module tests. Keep regression tests offline and independent of personal settings. Real AGY validation is a separate opt-in suite described in [tests/README.md](tests/README.md).
- **Docs come in pairs**: `README.md` / `README.zh-CN.md` and `docs/REFERENCE.md` / `docs/REFERENCE.zh-CN.md` are kept in sync. Change one, change its counterpart.
- **Runtime code lives in `companion/`**: the entrypoint handles modes and job commands; separate modules handle streaming execution, observations and state locking. Skills call the companion, and `templates/` holds the shared prompts.
- **Canonical skills are the source of truth**: edit personas in `skills/`, never in `pi-skills/`. Run `npm run generate:pi` to generate Pi entrypoints, and `npm run check:pi` to verify consistency.
- **Canonical skills are the source of truth**: edit personas in `skills/`, never in `pi-skills/` or `opencode-skills/`. Run `npm run generate:skills` to generate both host entrypoints, and `npm run check:skills` to verify consistency. The existing `generate:pi` and `check:pi` commands remain available. Use `npm run pack:checked` to check freshness before packing; publishing also runs the check.

Adding a mode or a flag changes the public surface, so please open an issue first and we can agree on the shape.

Expand Down
25 changes: 20 additions & 5 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p align="center"><a href="https://claude.com/claude-code"><img src="assets/badges/claude-code-plugin.svg" height="20" alt="Claude Code plugin"></a> <a href="https://developers.openai.com/codex/"><img src="assets/badges/codex-plugin.svg" height="20" alt="Codex plugin"></a> <a href="LICENSE"><img src="assets/badges/license-mit.svg" height="20" alt="license: MIT"></a></p>

把 Google 的 Antigravity CLI(`agy`)雇来当 **Claude Code**、**OpenAI Codex** 和 **Pi** 的「agy 员工」。
把 Google 的 Antigravity CLI(`agy`)雇来当 **Claude Code**、**OpenAI Codex**、**Pi** 和 **OpenCode** 的「agy 员工」。

![agy-staff 设计图](assets/design.png)

Expand Down Expand Up @@ -53,6 +53,21 @@ codex plugin add agy@agy-staff

</details>

<details>
<summary>在 OpenCode 中安装</summary>

使用 OpenCode V1(已在 1.18.34 验证)的原生插件管理命令安装:

```bash
opencode plugin 'agy-staff@git+https://github.com/keli-wen/agy-staff.git' --global
```

重启 OpenCode 后运行 `/agy-ask reply with OK`。插件会自动注册七个 `agy-*` 技能及其原生斜杠命令,包括 `/agy-lead` 和 `/agy-jobs`,无需单独配置技能路径或命令包装。仍需安装 Node.js,并完成 `agy` 登录。

OpenCode 按完整包规格缓存;仅重启不会刷新相同的 Git 规格。升级时选择新的 Git 标签或提交,运行 `opencode plugin 'agy-staff@git+https://github.com/keli-wen/agy-staff.git#<tag-or-commit>' --global --force`,然后重启。配置与本地开发方式见[参考手册](docs/REFERENCE.zh-CN.md#opencode)。此适配器不覆盖 OpenCode V2。

</details>

安装完成后,重启 Claude Code 或 Codex,再做一次简单的验证:在 Claude Code 中输入 `/agy:ask reply with OK`,在 Codex 中输入 `$agy:ask reply with OK`。`ask` 不调用工具,也不需要额外的权限配置。

> [!IMPORTANT]
Expand Down Expand Up @@ -80,7 +95,7 @@ install and verify the agy-staff plugin for the harness you are running in. Resp

![Codex 中的 $agy 技能选择器](assets/codex-desktop-screenshot.png)

下面的示例使用 Claude Code 的 `/agy:…` 写法。在 Codex 中把它换成 `$agy:…` 即可;Pi 使用 `/skill:agy-…`。
下面的示例使用 Claude Code 的 `/agy:…` 写法。在 Codex 中把它换成 `$agy:…` 即可;Pi 使用 `/skill:agy-…`,OpenCode 使用 `/agy-…`。

| 想做的事 | 示例 |
| --- | --- |
Expand All @@ -101,7 +116,7 @@ install and verify the agy-staff plugin for the harness you are running in. Resp

## 核心设计

`lead` 为当前主 agent 增加任务编排指导。在 lead 工作流中,主 agent 了解至足以明确任务后,默认用 `staffer` 承担实质性工作,等待结果返回后再验收、整合或追加任务;专门指导有帮助时再选择 specialist,`ask` 仅用于测试。主 agent 负责跨任务决策、验收、整合和交付,复用现有 jobs 工作流。Claude Code 使用 `/agy:lead`,Codex 使用 `$agy:lead`,Pi 使用 `/skill:agy-lead`。
`lead` 为当前主 agent 增加任务编排指导。在 lead 工作流中,主 agent 了解至足以明确任务后,默认用 `staffer` 承担实质性工作,等待结果返回后再验收、整合或追加任务;专门指导有帮助时再选择 specialist,`ask` 仅用于测试。主 agent 负责跨任务决策、验收、整合和交付,复用现有 jobs 工作流。Claude Code 使用 `/agy:lead`,Codex 使用 `$agy:lead`,Pi 使用 `/skill:agy-lead`,OpenCode 使用 `/agy-lead`。

`ask` 会在同一次调用中返回答案。其他角色启动后会先返回任务 ID,并给出收取结果的命令,例如 `wait <id> --timeout 10m`。主 agent 根据所在环境的能力等待任务;如果支持后台命令,就为每个任务保留一个独立的等待命令。

Expand Down Expand Up @@ -131,7 +146,7 @@ Codex 的更新命令是:
codex plugin marketplace upgrade && codex plugin add agy@agy-staff
```

这两个环境都按版本号管理插件缓存。如果更新后仍然看到旧行为,请先确认是否已重启应用,再参考[升级说明](docs/REFERENCE.zh-CN.md#升级)检查版本和实际安装的提交。Pi 的更新方式见上方安装说明。
这两个环境都按版本号管理插件缓存。如果更新后仍然看到旧行为,请先确认是否已重启应用,再参考[升级说明](docs/REFERENCE.zh-CN.md#升级)检查版本和实际安装的提交。Pi 和 OpenCode 的更新方式见上方安装说明。

## 社区

Expand All @@ -143,7 +158,7 @@ codex plugin marketplace upgrade && codex plugin add agy@agy-staff

提交代码前请运行 `npm test`。标准测试使用临时仓库、临时 HOME 和假的 agy,不会调用真实模型或改动你的个人配置。新增回归测试也应保持这一点。需要验证真实 AGY 时,请使用[测试说明](tests/README.md)中单独启用的集成测试。

运行逻辑位于 `companion/`:入口负责模式和任务命令,独立模块负责流式执行、进度快照和状态锁。角色技能位于 `skills/`,共享的提示词模板位于 `templates/`。修改技能时请以 `skills/` 为准,再运行 `npm run generate:pi` 生成 `pi-skills/`,用 `npm run check:pi` 检查两者是否一致。
运行逻辑位于 `companion/`:入口负责模式和任务命令,独立模块负责流式执行、进度快照和状态锁。角色技能位于 `skills/`,共享的提示词模板位于 `templates/`。修改技能时请以 `skills/` 为准,再运行 `npm run generate:skills` 生成 `pi-skills/` 与 `opencode-skills/`,用 `npm run check:skills` 检查一致性。不要直接编辑生成文件;原有 `generate:pi` 和 `check:pi` 命令仍然可用。打包时使用 `npm run pack:checked`,先检查一致性再生成归档;发布前也会自动检查。

README 和参考手册都有中英文版本。修改使用方法或行为说明时,请同步更新对应版本,让两种语言的读者得到一致的信息。

Expand Down
30 changes: 27 additions & 3 deletions docs/INSTALL_FOR_AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ You normally know which product you are. If unsure, check:
- **Claude Code** — you have `/plugin` slash commands, project instructions arrive via `CLAUDE.md`, and your Bash tool typically has `CLAUDECODE=1` in the environment. → Follow section 2a.
- **Codex** — you invoke skills with `$name` syntax, follow `AGENTS.md`, and plugins are managed through the `codex` CLI. → Follow section 2b.
- **Pi** — you invoke skills with `/skill:name` and manage packages with `pi install`. → Follow section 2c.
- **Anything else** — this package documents Claude Code, Codex, and Pi. Report the unsupported harness and stop.
- **OpenCode V1** — you use `opencode`, its `plugin` config or `opencode plugin` installer, and native `/agy-*` commands. Verified with OpenCode 1.18.34; V2 is not covered. → Follow section 2d.
- **Anything else** — this package documents Claude Code, Codex, Pi, and OpenCode V1. Report the unsupported harness and stop.

Follow exactly one of the three sections below.
Follow exactly one of the four sections below.

## 2a. Claude Code — install / upgrade

Expand Down Expand Up @@ -78,22 +79,45 @@ pi update --extension git:github.com/keli-wen/agy-staff

Restart Pi or run `/reload` afterwards. Use `pi list` to verify the package is registered, then check Pi's skill picker for `agy-lead`, `agy-ask`, `agy-staffer`, `agy-researcher`, `agy-reviewer`, `agy-implementer`, and `agy-jobs`.

## 2d. OpenCode V1 — install / upgrade / local development

Use the native plugin installer (verified with OpenCode 1.18.34):

```bash
opencode plugin 'agy-staff@git+https://github.com/keli-wen/agy-staff.git' --global
```

This installs the full package and adds it to the `plugin` array in OpenCode's config, preserving other settings. Do not replace the user's config file. The plugin registers its bundled skills automatically; do not manually clone the repository or add `skills.paths` as an installation workaround. For an explicitly provided local checkout, use `opencode plugin /absolute/path/to/checkout --global`. Regenerate modified canonical skills with `npm run generate:skills` in that checkout.

Restart OpenCode, then verify with `opencode debug skill`: expect `agy-ask`, `agy-staffer`, `agy-researcher`, `agy-reviewer`, `agy-implementer`, `agy-jobs`, and `agy-lead` alongside any other installed skills. OpenCode exposes these directly as `/agy-*` commands. Existing skill permissions remain in effect. Install the entire package, since its companion, templates and references are relative resources.

OpenCode 1.18.34 caches the full package spec. Restarting or reinstalling the same Git spec does not guarantee an update, even with `--force`. Select a newer tag or commit containing the adapter, replace the placeholder below, then restart:

```bash
opencode plugin 'agy-staff@git+https://github.com/keli-wen/agy-staff.git#<tag-or-commit>' --global --force
```

Changing the ref creates a fresh cache key; `--force` replaces the configured plugin entry. Do not clear unrelated caches. This adapter covers V1, not V2.

## 3. Smoke test

Run the zero-setup ask mode — it needs no allowlist and answers in ~3 seconds:

- Claude Code: `/agy:ask "reply with OK"` — **after the restart**, otherwise you are testing the old copy or nothing at all
- Codex: `$agy:ask reply with OK`
- Pi: `/skill:agy-ask reply with OK` — after restart or `/reload`
- OpenCode: `/agy-ask reply with OK` — after restart

If you cannot restart the session, call the companion of the freshly installed copy directly from the shell. It is the same code path the skill takes, so a pass here means the install is sound:

For Claude Code, resolve its installed copy with:

```bash
AGY_ROOT=$(node -p 'require(process.env.HOME+"/.claude/plugins/installed_plugins.json").plugins["agy@agy-staff"][0].installPath')
node "$AGY_ROOT/companion/agy-companion.mjs" ask --prompt "reply with OK"
```

Resolve the root that way rather than globbing `cache/agy-staff/agy/*/`: superseded version directories are left behind after an upgrade, so the glob expands to several paths and the command fails with `unknown subcommand`. `installPath` is always the copy in use. (Codex's equivalent root is printed by `codex plugin list`.) A fallback pass still leaves the restart outstanding — report it as "installed and verified, restart Claude Code to use it".
Resolve the root that way rather than globbing `cache/agy-staff/agy/*/`: superseded version directories are left behind after an upgrade, so the glob expands to several paths and the command fails with `unknown subcommand`. `installPath` is always the copy in use. (Codex's equivalent root is printed by `codex plugin list`.) For OpenCode, `opencode debug skill` reports each skill location; resolve `../../companion/agy-companion.mjs` from the installed `agy-ask` skill directory and invoke it with `node` from the user’s project directory. For Pi, use the registered package root from `pi list`. A fallback pass still leaves the restart outstanding — report it as "installed and verified, restart the current harness to use it".

Expect a short answer on stdout with no telemetry mixed in, plus an `[agy-staff]` telemetry line on stderr (mode, profile, model, duration, tokens, conversation id — for you, not for the user). If it errors, relay the error verbatim; the usual causes are expired agy auth (user runs `agy` interactively once to re-login) or an invalid model id (`agy models` lists valid ids). Do not improvise flags to work around errors.

Expand Down
Loading
Loading