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 .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "legion",
"version": "8.0.3",
"version": "8.0.4",
"description": "Official Codex plugin bundle for Legion's multi-agent planning, execution, review, and shipping workflows.",
"author": {
"name": "9thLevelSoftware",
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Legion

A multi-CLI plugin for orchestrating 48 AI specialist personalities as a coordinated legion. Works with Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot CLI, Google Gemini CLI, Kiro CLI, Windsurf, OpenCode, and Aider.
A multi-CLI plugin for orchestrating 49 AI specialist personalities as a coordinated legion. Works with Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot CLI, Google Gemini CLI, Antigravity CLI, Kiro CLI, Windsurf, OpenCode, Kilo CLI, and Aider.

## MANDATORY: User Interaction Rule

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to the Legion plugin are documented here.
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
This project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [8.0.4] - 2026-05-27

### Added
- **Antigravity CLI Support** — Full native integration for the brand new Antigravity CLI (`agy`), the successor to Gemini CLI.
- **Antigravity Plugin Installer** — Native installation surface mapping under `.agents/plugins/legion` (local) and `~/.gemini/config/plugins/legion` (global) with a generated `plugin.json` manifest.
- **CLI Adapter & Routing** — Comprehensive `adapters/antigravity-cli.md` adapter detailing capabilities, known quirks, interaction protocol, and parallel wave execution protocols.
- **Versioning & Website Updates** — Synchronized metadata, updated README, website, and certification checklists to ensure smooth NPM publication.

## [8.0.3] - 2026-05-17

### Changed
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Legion

A multi-CLI plugin for orchestrating 48 AI specialist personalities as a coordinated legion. Works with Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot CLI, Google Gemini CLI, Kiro CLI, Windsurf, OpenCode, and Aider.
A multi-CLI plugin for orchestrating 49 AI specialist personalities as a coordinated legion. Works with Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot CLI, Google Gemini CLI, Antigravity CLI, Kiro CLI, Windsurf, OpenCode, Kilo CLI, and Aider.

## MANDATORY: User Interaction Rule

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Replace `--claude` with your runtime of choice:
| `--cursor` | Cursor |
| `--copilot` | GitHub Copilot CLI |
| `--gemini` | Google Gemini CLI |
| `--antigravity` | Antigravity CLI |
| `--kiro` | Kiro CLI (preferred) |
| `--amazon-q` | Deprecated alias for `--kiro` |
| `--windsurf` | Windsurf |
Expand All @@ -42,6 +43,7 @@ Replace `--claude` with your runtime of choice:
| OpenAI Codex CLI | Beta | Native prompt commands plus a Legion bridge skill; use `/project:legion-start` or `/prompts:legion-start` |
| GitHub Copilot CLI | Beta | Native `/legion-start` skills plus a `legion-orchestrator` agent profile |
| Google Gemini CLI | Beta | Native `/legion:start` custom commands in `.gemini/commands/legion/` |
| Antigravity CLI | Certified | Native `/legion:start` plugins in `.agents/plugins/legion/` (local) or `~/.gemini/config/plugins/legion/` (global) |
| Kiro CLI (formerly Amazon Q Developer CLI) | Beta | Native `@legion-orchestrator` custom agent plus steering files |
| OpenCode | Beta | Native `/legion-start` custom commands plus a Legion subagent |
| Kilo CLI | Beta | Native `/legion-start` custom commands plus a Legion subagent |
Expand Down Expand Up @@ -87,6 +89,7 @@ This repository now also ships a repo-native Codex plugin manifest at `.codex-pl
| OpenAI Codex CLI | `/project:legion-start` | `/prompts:legion-start` |
| GitHub Copilot CLI | `/legion-start` or `/agent legion-orchestrator` | `/legion-start` or `/agent legion-orchestrator` |
| Google Gemini CLI | `/legion:start` | `/legion:start` |
| Antigravity CLI | `/legion:start` | `/legion:start` |
| Kiro CLI | `@legion-orchestrator` | `@legion-orchestrator` |
| OpenCode | `/legion-start` | `/legion-start` |
| Kilo CLI | `/legion-start` | `/legion-start` |
Expand Down Expand Up @@ -984,8 +987,8 @@ These activate automatically when their prerequisites are met:
## Requirements

- Node.js 18+ (install-time only; the installer lazy-loads `yaml` for safe Kilo Code mode merges)
- One of the 10 supported AI CLI runtimes or the Kilo Code plugin:
Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot CLI, Google Gemini CLI, Kiro CLI, Windsurf, OpenCode, Kilo CLI, Aider, or Kilo Code Plugin
- One of the 11 supported AI CLI runtimes or the Kilo Code plugin:
Claude Code, OpenAI Codex CLI, Cursor, GitHub Copilot CLI, Google Gemini CLI, Antigravity CLI, Kiro CLI, Windsurf, OpenCode, Kilo CLI, Aider, or Kilo Code Plugin

## Contributing

Expand Down
71 changes: 71 additions & 0 deletions adapters/antigravity-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
cli: antigravity-cli
cli_display_name: "Antigravity CLI"
version: "1.0"
support_tier: "certified"
capabilities:
parallel_execution: true
agent_spawning: true
structured_messaging: false
native_task_tracking: true
read_only_agents: true
supports_extended_thinking: true
detection:
primary: "plugin.json exists in .agents/plugins/legion or ~/.gemini/config/plugins/legion"
secondary: "AGENTS.md exists in CWD or ~/.gemini/antigravity-cli/settings.json exists"
max_prompt_size: 2097152
known_quirks:
- "no-structured-messaging"
---

# Antigravity CLI Adapter

Antigravity CLI (`agy`) is the certified successor to Google's Gemini CLI. It supports native plugins staged under `.agents/plugins/legion` (local) or `~/.gemini/config/plugins/legion` (global). Legion installs as a compliant Antigravity plugin with a `plugin.json` manifest, bringing its full suite of 49 agents, skills, and slash commands.

## Tool Mappings

| Generic Concept | Implementation |
|-----------------|---------------|
| `spawn_agent_personality` | Spawn a background agent with the specified personality and task using the Antigravity agent system (`agy subagent spawn`). |
| `spawn_agent_autonomous` | Spawn an autonomous background agent task (`agy task spawn`). |
| `spawn_agent_readonly` | Spawn a background agent with explicit read-only instruction sets. Read-only is enforced by blocking write/edit tools. |
| `coordinate_parallel` | Concurrent dispatch of multiple subagents inside the Antigravity plugin harness. Each agent writes results to its respective file. |
| `collect_results` | Each agent writes its outcome to `.planning/phases/{NN}/{NN}-{PP}-RESULT.md`. |
| `shutdown_agents` | Terminate active background agents using the `/tasks kill` slash command or direct API call. |
| `cleanup_coordination` | Clean up temporary workspace plugin directories. |
| `ask_user` | Structured question prompts via the Antigravity CLI prompt overlay (similar to `AskUserQuestion`). |
| `model_planning` | `gemini-2.5-pro` (default planning model) |
| `model_execution` | `gemini-2.5-flash` (default execution model) |
| `model_check` | `gemini-2.5-flash` |
| `global_config_dir` | `~/.gemini/antigravity-cli/` |
| `plugin_discovery_glob` | `<home>/.gemini/config/plugins/legion/plugin.json` — **resolve `<home>` first** using `os.homedir()` or `echo $HOME` to get the absolute path. Do NOT pass `~` or environment variables directly to the Glob tool. |
| `commit_signature` | `Co-Authored-By: Antigravity <noreply@google.com>` |

## Interaction Protocol

Antigravity CLI supports high-fidelity interactive user prompts. The `ask_user` tool utilizes the CLI's native prompt overlay to present multiple-choice list selections. If unavailable, it falls back to a numbered plain-text menu prompt that parses numerical choices from standard input.

## Execution Protocol

### Phase Initialization

Write the wave checklist and plan artifacts to `.planning/phases/{NN}/WAVE-CHECKLIST.md`.

### Wave Execution

**Dispatch mode:** parallel plugin-based execution via native subagent spawning + filesystem polling.

Antigravity CLI natively coordinates parallel background agents using its agent system:
1. For each plan in the active wave, resolve its assigned agent personality from the `agents/` directory in the Legion plugin.
2. Initialize parallel background processes using the `/tasks` scheduler.
3. Plans that share file workspaces are protected from concurrent edits by verifying that their `files_modified` arrays do not overlap.
4. Each background subagent writes its final plan outcome and task outputs directly to `.planning/phases/{NN}/{NN}-{PP}-RESULT.md`.
5. The orchestrator polls the designated result paths every 5 seconds until all tasks in the current wave complete or a 30-minute timeout is reached.

### Result Collection

After each wave, read and parse the generated plan result files. Update the phase execution checklist with status and outcome metrics.

### Phase Cleanup

No special cleanup needed. Stale background task logs are closed and archived.
80 changes: 80 additions & 0 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Runtime (pick one):
--cursor Cursor
--copilot GitHub Copilot CLI
--gemini Google Gemini CLI
--antigravity Antigravity CLI
--agy Alias for --antigravity
--kiro Kiro CLI (preferred)
--amazon-q Deprecated alias for --kiro
--windsurf Windsurf
Expand Down Expand Up @@ -1253,6 +1255,84 @@ function install(runtimeKey, scope, verify = false) {
break;
}

case 'antigravity-plugin': {
// 1. Write plugin.json manifest
const pluginJsonPath = joinPath(surface.path, 'plugin.json');
const manifest = {
name: "legion",
version: pkg.version,
description: pkg.description,
author: pkg.author.name || pkg.author,
repository: pkg.repository.url || pkg.repository,
keywords: pkg.keywords,
license: pkg.license
};
Comment on lines +1261 to +1269

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Accessing nested properties of pkg.author and pkg.repository directly can cause a TypeError if these fields are undefined or null in package.json. Since Node.js 18+ is required, we should use optional chaining (?.) to safely access these properties and prevent potential installer crashes.

Suggested change
const manifest = {
name: "legion",
version: pkg.version,
description: pkg.description,
author: pkg.author.name || pkg.author,
repository: pkg.repository.url || pkg.repository,
keywords: pkg.keywords,
license: pkg.license
};
const manifest = {
name: "legion",
version: pkg.version,
description: pkg.description,
author: pkg.author?.name || pkg.author,
repository: pkg.repository?.url || pkg.repository,
keywords: pkg.keywords,
license: pkg.license
};

writeManagedFile(pluginJsonPath, JSON.stringify(manifest, null, 2), nativeArtifacts);
console.log(` ${surface.key}: plugin.json -> ${pluginJsonPath}`);

// 2. Copy skills/ directory recursive to surface.path/skills
const destSkillsDir = joinPath(surface.path, 'skills');
ensureDirs([destSkillsDir]);
const skillSrcDirs = listDirs(src.skillsSrc);
for (const skillSrc of skillSrcDirs) {
const skillName = path.basename(skillSrc);
const destSkillPath = joinPath(destSkillsDir, skillName);
ensureDirs([destSkillPath]);
for (const entry of fs.readdirSync(skillSrc)) {
const srcPath = joinPath(skillSrc, entry);
const destPath = joinPath(destSkillPath, entry);
if (fs.statSync(srcPath).isDirectory()) {
copyDirRecursive(srcPath, destPath);
} else if (entry === 'SKILL.md') {
let content = fs.readFileSync(srcPath, 'utf8');
if (skillName === 'workflow-common') {
content = rewriteAgentPathResolution(content, paths.manifestFile);
}
fs.writeFileSync(destPath, content);
} else {
fs.copyFileSync(srcPath, destPath);
}
}
// Recursively push all files inside to nativeArtifacts
const walkArtifacts = (dir) => {
const entries = fs.readdirSync(dir, { withFileTypes: true });
for (const entry of entries) {
const full = joinPath(dir, entry.name);
if (entry.isDirectory()) {
walkArtifacts(full);
} else {
nativeArtifacts.push({ path: full });
}
}
};
walkArtifacts(destSkillPath);
nativeArtifacts.push({ path: destSkillPath, kind: 'dir' });
}
console.log(` ${surface.key}: skills -> ${destSkillsDir}`);

// 3. Copy agents/ directory to surface.path/agents
const destAgentsDir = joinPath(surface.path, 'agents');
ensureDirs([destAgentsDir]);
const agentFiles = listMdFiles(src.agentsSrc);
for (const agentFile of agentFiles) {
const base = path.basename(agentFile);
const destAgentPath = joinPath(destAgentsDir, base);
fs.copyFileSync(agentFile, destAgentPath);
nativeArtifacts.push({ path: destAgentPath });
}
console.log(` ${surface.key}: agents -> ${destAgentsDir}`);

// 4. Copy transformed commands/ to surface.path/commands
const destCommandsDir = joinPath(surface.path, 'commands');
ensureDirs([destCommandsDir]);
for (const [commandName, commandContent] of transformedCommands.entries()) {
const commandPath = joinPath(destCommandsDir, `${commandName}.md`);
writeManagedFile(commandPath, commandContent, nativeArtifacts);
}
console.log(` ${surface.key}: commands -> ${destCommandsDir}`);
break;
}

case 'opencode-agent': {
const backedUp = writeManagedFile(surface.path, generateOpenCodeAgent(paths), nativeArtifacts);
if (backedUp) {
Expand Down
35 changes: 35 additions & 0 deletions bin/runtime-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,40 @@ const RUNTIME_METADATA = {
},
],
},
antigravity: {
key: 'antigravity',
flag: '--antigravity',
aliases: ['--agy'],
label: 'Antigravity CLI',
adapterFile: 'antigravity-cli.md',
supportTier: 'certified',
disposition: 'native-plugins',
installSurface: 'native plugins with manifest, skills, and agents',
scopeSupport: { local: true, global: true },
storageLayout: 'legion',
allowedTools: ['Read', 'Write', 'Edit', 'Bash', 'Grep', 'Glob'],
supportsAtRefs: false,
nativeSurfaces: [
{
key: 'antigravity-plugin',
type: 'antigravity-plugin',
pathKind: 'dir',
localPath: '$PROJECT/.agents/plugins/legion',
globalPath: '$HOME/.gemini/config/plugins/legion',
},
],
entrypoints: {
local: '/legion:start',
global: '/legion:start',
},
evidence: [
{
title: 'Plugins structure',
url: 'https://antigravity.google',
verifiedOn: '2026-03-11',
},
],
},
kiro: {
key: 'kiro',
flag: '--kiro',
Expand Down Expand Up @@ -598,6 +632,7 @@ const RUNTIME_ORDER = [
'cursor',
'copilot',
'gemini',
'antigravity',
'kiro',
'windsurf',
'opencode',
Expand Down
19 changes: 10 additions & 9 deletions checksums.sha256
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
5fdacb1222b3e2e10fac707b112ad2162c63e52f2e6af84723086d3538c5f69a .codex-plugin/plugin.json
7a3b03b5db1c7d38027ea39c05c4ee319fff5ef61e4da16c66bf883b7a7d6e10 .codex-plugin/plugin.json
ba73af176b9915c9d5857c92dacf20a8c9396274ac99b0c01c1e5b8e522ecf81 adapters/ADAPTER.md
57e66234293d10037ad39ecc54ddbc07c5bc68205e3f958167a0f85ecd1f6b77 adapters/aider.md
76277abb2d7f26c9a0d640027264a7689e9c5a3e0a4e0eb9233d002e4158b4a5 adapters/antigravity-cli.md
06961cf1290db71811a753f72d1587e99783c15baee5634889f56c940f0c3f17 adapters/claude-code.md
aa87795826ae75e0df45e777763d12b34487a5411c48e3e13f8193c3ae918f41 adapters/codex-cli.md
05b808da111d624716f6f3fccf607136975c0db207f2d2f853ca0b2b1e6f7bde adapters/copilot-cli.md
Expand Down Expand Up @@ -60,8 +61,8 @@ b4426eccac6df34166c4f66523fd713a00812ab19c0c2a7b2d1d3a2987392a71 agents/testing
d419cedcfefaa32faeb0c2ac21439c9f77d0442670ed4560bd0f950954fd5940 agents/xr-cockpit-interaction-specialist.md
156e480600de5a008a7b2f5b9fdcb66ec4b71cf2f1dacb3b905a8183ac608c85 agents/xr-immersive-developer.md
9b146d8c8e08554e366778b59a95c03f6deb7a7733921a57414ae21fe987890c agents/xr-interface-architect.md
b7ebb80427c03bc03097815450715b359df269a992546d434948d87a17257522 bin/install.js
9930f8fe3b0ad0fb5eeaa4bff684f4faf205e335b6f3604e947767a24b363507 bin/runtime-metadata.js
b0975dd0a6f3d422f842430b831bf081e5c3250cf742b95ba1f2a688c5b5d2f1 bin/install.js
abca4d84c47a5b85bfd03ff19073cefbe9d4667ac678697f4eb38aae4d1206ad bin/runtime-metadata.js
6258017a9bfb6ef967d1f1d95682d37b4d155779f61151c4a5757f2d422b03ad commands/advise.md
678e94a09f951ba1f6172f004506958dd1dda95583065901d7e993a0cf99e123 commands/agent.md
3437849ecaad8ee282b9ac355b0f9389ea2a97f010b9b8479095f32b276dc7c1 commands/board.md
Expand All @@ -79,15 +80,15 @@ d3828355bba0db2e7d176d04bee595c95ab32a6d3303fd12da605fb142d58d4e commands/revie
e073e325d7981e85a523351561d2653796adcd5fce769c73b033798078b4e728 commands/ship.md
c2e2b38cd51bda71fda6f524767bbb1b28b855736cf92dd54931d46f94c6f350 commands/start.md
74d5061f338ac4b91a6f601c9798446afaf09f36f9966e41108d5c6b0e081d09 commands/status.md
d71f42f3ff8e427746d68dba41875403d33ba3723bfc53910ce392a4d5025c69 commands/update.md
704152627220aa1e7983cc3de73c359c14ce8a5a65d6cdcc9169116cdfbade88 commands/update.md
c259f17a410f9cfc948c5a7bbb7f9c0f5cda02f7c381a859752b33f08f0e141d commands/validate.md
6d6328964998c37acb4eb21bdc8485339a3bd2bfc749f0157498864a8ecb8310 docs/control-modes.md
e9d3786ccdd7cb32ec06a64e54b4074bab1d3ab6f05d184d6253cf080fbb053a docs/runtime-audit.md
639338e6e5ee5fc32c755de575b9e87e2270a816fcb310f13f7703a4d8a53d5e docs/runtime-certification-checklists.md
5ba9ee52d3066771dc09d7deef1ee389acf2fc7436c7b836378a9b8828ab650b docs/runtime-audit.md
6f2f91394ac834929fcdf3e9917932e98de0c5e24fd4bfb604d5df23f26ef0f6 docs/runtime-certification-checklists.md
b5ba3aefa7b87dd8fe95017801976515d704ac82ec8fd0a115d9dc1098fdc59a docs/security/install-integrity.md
e43149ae6e8cdc675f54b7c5fc5d5ea5847bd7f404fbc4bc36ad847a34b8b9ff docs/settings.schema.json
ae3c6ecc86b2fbde941271d8349a5914ed5f78d1996e20bcc459569a81b893aa package.json
5c29f47a51898778d57d8d55ca7fcd5656ee100e7b9bc1b1c79b2958a469ce73 README.md
a50f5d94cb9dbeb2908a1b25f2041a3e4b4e4b40889d67348f7718a1c1fdcc11 package.json
123b06e4b41ba4263700f2d8b7a975d6cb54a8b05eb0fc387ff379539e8944df README.md
6693f48633f8527f6feeb7cf3d9f88c7b235c728129848625a8aa9443d6e63e5 settings.json
2e8909340b49da1d32fd361ea800db7e4e3c58681781cc5ab84d896f7e061fa1 skills/agent-creator/SKILL.md
d3755d1a037b92fc518049051e8e07bd04b378ad11a90cfef8accb8bbb751602 skills/agent-registry/CATALOG.md
Expand Down Expand Up @@ -130,4 +131,4 @@ bc7d13659b5e4ae4a75fbc84ba60d3724cf1a50a06ff4bd18984f159d0701614 skills/ship-pi
27b587dbe5bb4be8faaf0fbc4b7b50399f8bac544a9a1ab3da1a27b365ac6003 skills/workflow-common-domains/SKILL.md
ed808a0eab115829e76c9cfadf86004109fd221ce0af1994367d150b4a5ec641 skills/workflow-common-github/SKILL.md
3cfba03208bfae33f0c940d3ffb4cf66d1e1939c3759930f0251e12d36c7375f skills/workflow-common-memory/SKILL.md
d35720610b24bc4c9e94a7d22d4534e6dce6c3c7b6a13ef7dbd8b9bf4b3b839c skills/workflow-common/SKILL.md
867ddec5df26560d02cd634dd6e3345e1d44e168b3c33c9717970f525ba84bc4 skills/workflow-common/SKILL.md
1 change: 1 addition & 0 deletions commands/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ skills/workflow-common-core/SKILL.md
- cursor → --cursor
- copilot-cli → --copilot
- gemini-cli → --gemini
- antigravity-cli → --antigravity
- kiro-cli → --kiro
- amazon-q → --amazon-q (deprecated alias for --kiro)
- windsurf → --windsurf
Expand Down
Loading
Loading