LEGION

"My Name Is Legion, For We Are Many"

49 AI Specialist Personalities. 10 CLI Runtimes. One Coordinated Force.

Legion is a multi-CLI orchestrator that binds 49 specialist personalities into a single coordinated force. Engineers, designers, marketers, testers, product leads, project managers, and more — each with deep expertise, distinct voice, and hard-earned opinions. Speak the word, and the many answer as one.

49
Agents
9
Divisions
9
CLIs
18
Commands
33
Skills
1
Installer Dependency

Summon the Legion

Install with npx, open any project, and use the runtime-native Legion entry point.
Codex uses /project:legion-start; Gemini keeps /legion:start.

# Install for Claude Code
npx @9thlevelsoftware/legion --claude

# Or for other runtimes:
npx @9thlevelsoftware/legion --codex      # OpenAI Codex CLI
npx @9thlevelsoftware/legion --cursor     # Cursor
npx @9thlevelsoftware/legion --gemini     # Google Gemini CLI
npx @9thlevelsoftware/legion --antigravity # Antigravity CLI
# + copilot, kiro, windsurf, opencode, kilo, kilo-code, aider

# Then, in any project directory:
/project:legion-start    # Codex local install
/legion:start            # Gemini or Claude

The Forty-Nine

Not generic role labels. Each is a 156–472 line character sheet with deep expertise, communication style, hard rules, and personality quirks. When summoned, each receives its complete personality as instructions. Every agent includes structured metadata — languages, frameworks, artifact_types, review_strengths — for intelligent recommendation scoring.

9

Engineering

Full-stack, backend, frontend, AI, infrastructure/DevOps, mobile, prototyping, Laravel, security

6

Design

UI/UX, branding, visual storytelling, UX research, whimsy

4

Marketing

Content & social strategy, platform execution, growth, ASO

7

Testing

QA verification, performance, API testing, tool evaluation, workflow optimization, code polish

4

Product

Sprint planning, feedback synthesis, trend research, technical writing

5

Project Management

Coordination, portfolio, operations, experiments, production

4

Support

Finance, legal, executive summaries, support

6

Spatial Computing

VisionOS, XR, Metal, terminal integration, cockpit UI

4

Specialized

Orchestration, data analytics, LSP indexing, exploration (Polymath)

The Commands

Nineteen commands. Each a word of power.

CommandPurpose
/legion:startInitialize a new project with guided questioning flow
/legion:plan <N>Plan phase N with agent recommendations and wave-structured tasks
/legion:buildExecute current phase with parallel agent teams
/legion:reviewRun quality review cycle with testing/QA agents
/legion:statusShow progress dashboard and route to next action
/legion:quick <task>Run ad-hoc task with intelligent agent selection
/legion:advise <topic>Get read-only expert consultation from any personality
/legion:portfolioMulti-project dashboard with dependency tracking
/legion:milestoneMilestone completion, archiving, and metrics
/legion:agentCreate a new agent personality through guided workflow
/legion:mapMap codebase architecture, functionality, risks, and searchable index artifacts
/legion:exploreResearch-first design discovery with a saved design doc before optional start
/legion:boardConvene board of directors for governance decisions
/legion:retroRun structured retrospective on completed phases or milestones
/legion:shipPre-ship checklist, PR creation, deployment verification, canary monitoring
/legion:learnRecord, recall, and manage project-specific patterns and preferences
/legion:updateCheck for updates and install latest version from npm
/legion:polish4-pass code cleanup — comments, simplification, readability, consistency
/legion:validateValidate state file integrity, schema conformance, and cross-references

The Rite of Execution

Each phase follows the sacred cycle: plan, build, review. Within each wave, agents work in parallel. Between waves, they synchronize.

/legion:explore Pre-flight → Research, clarify, compare approaches, save design doc (optional)
/legion:map Codebase context → Architecture docs + searchable map artifacts (optional)
/legion:start Guided questioning → PROJECT.md + ROADMAP.md
/legion:plan 1 Phase decomposition → Wave-structured plans + agents
/legion:build Parallel execution → Agents work in character, wave by wave
/legion:review Quality gate → Review → Fix → Re-review (max 3 cycles)
/legion:polish Post-review → 4-pass code cleanup with safety rails (configurable)
/legion:ship Ship pipeline → Pre-ship gates → PR creation → deployment verification
/legion:retro Retrospective → What worked, what didn't, reusable patterns
/legion:plan 2 Next phase → Repeat until the work is done

The Sacred Powers

Personality Injection

Each of the 49 agents is spawned with its complete 156–472 line character sheet as system instructions. Not a role label — an identity.

Wave Execution

Plans are grouped into dependency waves. Everything within a wave runs in parallel. File overlap detection and sequential_files prevent conflicts between parallel agents.

Hybrid Selection

The system recommends agents by scoring languages, frameworks, artifact_types, division affinity, and archetype-weighted past performance. You always confirm or override.

Domain Detection

Marketing phase? Campaign planning activates. Design phase? Three-lens review (brand + accessibility + usability). Engineering isn't the only workflow.

Quality Gates

Structured dev-QA loop: review → fix → re-review. Hard cap at 3 cycles. If it still fails, the problem is systemic — escalate to human.

Code Polish

4-pass post-review cleanup: Comment Cleanup → Code Simplification → Readability Refactoring → Consistency Normalization. Safety rails auto-revert any file whose tests regress.

Review Panels

2–4 domain-weighted reviewers with non-overlapping rubrics. Max 2 from any division. At least one tester on every panel. Diversity by design.

Plan Critique

Pre-mortem analysis assumes the phase has already failed, then works backward. Assumption hunting flags high-impact, weak-evidence beliefs.

Cross-Session Memory

Outcomes recorded after each cycle. During future planning, past performance boosts agent recommendations — with time-based decay so the system evolves.

Read-Only Advisory

/legion:advise spawns any personality as a read-only consultant. Full character, full expertise, zero risk. Tool-level enforcement via Explore agents.

Atomic Commits

Every completed plan produces an independent commit. If Plan 2 breaks something, roll it back without losing Plan 1. Clean revert boundaries.

Graceful Degradation

GitHub integration, memory, codebase mapping, marketing workflows, design workflows, panels, critique — all opt-in. The core loop works without any of them.

Light Installer Surface

No custom CLI. No MCP server. No shell hooks. One lazy-loaded installer dependency for safe YAML merges. Skills, commands, agents. Install with npx and go.

Plan Contracts

files_forbidden, expected_artifacts, and mandatory verification_commands in every plan. Provable completion, enforced scope boundaries, output contracts.

Control Modes

Four presets — autonomous, guarded, advisory, surgical — adjust how strictly authority matrix rules are enforced, from full freedom to file-level lockdown.

Observability

Decision logging in SUMMARY.md captures why agents were chosen. Cycle-over-cycle diffs in REVIEW.md track whether review rounds are making progress or spinning.

Design Discovery

/legion:explore researches an idea, asks focused clarification questions, compares approaches, and saves a design document before optional planning.

Intent Routing

Natural language intent parsing routes ambiguous inputs to the right command. Context-aware suggestions consider project state when recommending next actions.

Escalation Protocol

Structured <escalation> blocks with severity, type, and decision context. Forward-only handoff between waves. No agent acts outside its authority without documenting why.

v6.0 — Discipline & Intelligence

Twelve phases of improvements transform Legion from a working orchestration protocol into a disciplined, observable, and smarter one. Plans have contracts. Agents have metadata. Reviews leave audit trails. Authority has modes. Exploration has structure.

What Changed

  • Plan Schema Hardeningfiles_forbidden, expected_artifacts, mandatory verification_commands
  • Wave Safety — File overlap detection, sequential_files for single-agent access
  • Control Modes — autonomous / guarded / advisory / surgical presets
  • Observability — Decision logging in SUMMARY.md, cycle-over-cycle diff in REVIEW.md
  • Agent Metadatalanguages, frameworks, artifact_types, review_strengths on all 49 agents
  • Recommendation Engine v2 — Metadata-aware scoring, task_type in outcomes, archetype boosts
  • Adapter Conformance — Schema tests, cross-reference validation, max_prompt_size / known_quirks
  • Codebase Mapper — Architecture docs, risk assessment, test coverage correlation, and searchable map artifacts
  • Polymath Design Discovery — Research-first clarification and approach comparison in /legion:explore
  • Authority & Conflict — Escalation protocol, agent-to-agent communication conventions
  • Intent Routing v2 — Natural language parsing, context-aware suggestions
  • Integration & Release — Cross-platform checksums, full regression suite, version 6.0.0

v7.0 — Governance & Cross-CLI Dispatch

A governance layer and cross-CLI orchestration. Claude Code can now convene boards of directors for high-stakes decisions and dispatch work to Gemini CLI and Codex CLI based on capability matching.

What Changed

  • Board of Directors/legion:board meet for 5-phase deliberation (assess → discuss → vote → resolve → persist); /legion:board review for quick assessments
  • Cross-CLI Dispatch — Capability-based routing to Gemini (UI/UX, web research) and Codex (implementation, testing) with file-based handoff
  • Multi-Pass Evaluators — Code Quality (6 passes), UI/UX (7 passes), Integration (6 passes), Business Logic (6 passes)
  • Anti-Sycophancy Rules — No performative agreement, pushback expected, every finding needs file:line + what/why/how
  • Structured Review Requests — Auto-populated context from SUMMARY.md files
  • Dynamic Board Composition — Agent-registry assembles 3-5 directors per topic from the 49-agent pool, no fixed roles
  • Control-Mode-Aware Dispatch — External CLIs respect current control mode (read-only in surgical mode)

v7.1.0 — Shipping, Learning & Consolidation

Three new commands complete the core workflow loop: ship, retro, and learn. Agent roster tightened from 53 to 49 through four strategic merges.

What Changed

  • /legion:ship — Pre-ship checklist, PR creation, deployment verification, canary monitoring
  • /legion:retro — Structured retrospective with pattern extraction and plan feedback loop
  • /legion:learn — Project-specific memory: record, recall, and manage patterns and preferences
  • Agent Consolidation — 4 merges reduced roster from 53 to 49 (UX+Interaction, Social+Platform, PM+Senior PM, Content+Social)

v7.2.0 — Agent Depth, Security & Infrastructure

The largest single release: 61 files changed. Deep agent enrichment, security hardening, git worktrees, structured schemas, hooks integration, and extended thinking for planning. All new features default to off — zero behavioral change for existing users.

Agent Enrichment

10 thin agents (88–131 lines) enriched to 200–338 lines with domain-specific depth. Code review rubrics, spatial interaction patterns, growth experiment templates, and more.

Security Hardening

Dependency vulnerability scanning (6 ecosystems), secret detection (12+ patterns), supply chain checks, and post-execution boundary verification in authority-enforcer.

/legion:validate

State file integrity checker for .planning/ artifacts. Schema conformance, cross-reference validation, corruption detection. Supports --ci and --fix flags.

Git Worktrees

Opt-in filesystem isolation during parallel agent waves. Full lifecycle: create → spawn → merge with conflict detection → cleanup.

Structured Schemas

JSON Schema validation for plan frontmatter, summaries, outcomes records, and review findings at docs/schemas/.

Hooks Integration

Claude Code hooks for lifecycle automation: pre-build plan validation, post-build notification, pre-ship security gate. All opt-in with graceful degradation.

Extended Thinking

models.planning_reasoning enables deeper requirement analysis and wave ordering rationale in phase-decomposer and polymath-engine.

Quick — --fix

Inline review + PR creation in a single command. GitHub issue linking support. Replaces the proposed /legion:hotfix command.

Plan Auto-refine

--auto-refine on /legion:plan triggers automatic re-planning when critique returns CRITICAL findings. Max 2 cycles with user fallback.

Memory Pruning

OUTCOMES.md pruning with archive mechanism. Old outcomes compressed and archived, keeping active memory lean. Configurable thresholds and age limits.

Consolidation

Final agent merge: data-analytics-reporter + support-analytics-reporterdata-analytics-engineer. Roster now 48 agents across 9 divisions.

Adapter Maturity

OpenCode adapter enriched with model routing and troubleshooting. Aider downgraded to community-contributed tier with manual operation guide.

Dynamic Knowledge Index

Compressed directory index in AGENTS.md maps all 49 agents and 33 skills by division. “Prefer retrieval-led reasoning” directive eliminates LLM laziness during agent spawning. Based on Vercel’s Context Engineering research (100% tool-use vs. 53–79% for skills).

v8.0.4 — Antigravity CLI Adapter

Official native plugin integration for the brand new Antigravity CLI (agy), the successor to Google Gemini CLI, bringing premium multi-agent workflows and parallel wave coordination.

Native Plugin Structure

Installs as a compliant Antigravity plugin under .agents/plugins/legion (local) or ~/.gemini/config/plugins/legion (global) with a generated plugin.json manifest.

Parallel Waves

Leverages Antigravity's native subagent spawn mechanics to execute coordinate parallel waves with filesystem-based result polling.

11 CLI Runtimes

Enriches the detection step 1 probe with Antigravity validation, expanding Legion's certified ecosystem coverage.

v8.0.3 — Codebase Map & Design Discovery

Codebase understanding and idea exploration are now separate, first-class workflows: /legion:map builds a queryable architecture dataset, while /legion:explore produces a design document before project initialization.

/legion:map

New standalone command for full maps, --check freshness reports, --refresh rebuilds, scoped maps, and --query readback against the existing index.

Map Dataset

Writes .planning/CODEBASE.md plus .planning/codebase/index.jsonl, symbols.json, search.md, and directory-mappings.yaml.

Search Without Services

Semantic search uses summaries, aliases, symbols, keywords, related files, and rg. No embeddings, vector database, network service, or API key required.

Start Preflight

/legion:start checks for a fresh map when source code exists and asks whether to use it, refresh it, skip it, or abort and map manually.

Design Docs

/legion:explore now researches, clarifies, compares approaches, and saves .planning/explorations/*-design.md before any optional handoff.

Installer Coverage

Command metadata, Codex bridge mappings, flat-command runtimes, checksum verification, README metrics, and installer smoke tests now include the map command.

v8.0.2 — Uncapped Phase Planning

Phase planning now favors traceability over artificial limits: phases can contain as many plans as the work needs, while max_tasks_per_plan remains a per-plan task cap.

Plan Counts Are Estimates

/legion:plan and startup roadmap generation split plans by dependency, ownership, verification, and traceability boundaries instead of fixed plan density.

Flexible Milestones

Milestone grouping no longer targets fixed milestone counts or fixed phase ranges; milestones follow coherent deliverables and dependency boundaries.

Regression Guard

New tests prevent active workflow surfaces from reintroducing plan-per-phase caps or fixed phase-count guidance.

v8.0.1 — Kilo Code Plugin Surface

Kilo Code plugin support now installs one Legion mode bridge plus native /legion-*.md and /legion-* workflows and the full Legion Agent Skills collection.

Native Workflows

--kilo-code populates both .kilocode/workflows/ and .kilo/commands/ with legion-start.md, legion-plan.md, legion-board.md, and the rest of the Legion command set.

Agent Skills

Reusable Legion internals such as planning, wave execution, board governance, and review panels are installed in both .kilocode/skills/ and .kilo/skills/.

Single Mode Bridge

The installer still creates only one Legion mode and preserves sticky model selection, user modes, comments, workflows, and skills.

v7.6.0 — Kilo CLI Support

Tenth runtime adapter. Kilo CLI joins the Legion matrix with full tool mappings, native command wrappers, and a legion-orchestrator subagent. Blocking-only task execution with file-based coordination.

Kilo CLI Adapter

Beta-tier adapter with Kilo-specific quirks: blocking task tool, XML <suggest> tags for the question tool, and sequential execution. No parallel subagents.

Native Wrappers

Installs flat /legion-start workflows to .kilo/commands/, a legion-orchestrator subagent to .kilo/agents/, and Agent-Skills-formatted copies of every Legion skill to .kilo/skills/<name>/SKILL.md for Kilo's native skill loader.

11 Runtimes

Legion now covers 11 AI CLI runtimes: Claude Code, Codex CLI, Cursor, Copilot CLI, Gemini CLI, Antigravity CLI, Kiro CLI, Windsurf, OpenCode, Kilo CLI, and Aider.

Detection Protocol

Kilo CLI added to workflow-common Step 1 probe. Primary detection via .kilo/commands/legion-start.md; secondary via .kilo/agents/legion-orchestrator.md; tertiary via .kilo/skills/code-polish/SKILL.md.

v7.5.0 — Code Polish

Automated “deslopping” — a structured 4-pass rubric that cleans up AI-generated code before it ships. Integrated into the review pipeline and available standalone via /legion:polish.

4-Pass Rubric

Comment Cleanup → Code Simplification → Readability Refactoring → Consistency Normalization. Each pass has auto-apply actions and flag-for-review judgment calls.

Safety Rails

Runs project tests before and after polish. Any file that causes test regression is reverted automatically. Type checker verification when available. Non-blocking — polish failures never prevent phase completion.

Convention Detection

Merges conventions from three sources: CLAUDE.md explicit rules, CODEBASE.md detected patterns, and code sampling implicit conventions. Project style is respected, not overridden.

/legion:polish

Standalone command for ad-hoc code cleanup. Target a specific path, a phase, or the working directory. Supports --dry-run for preview and --scope for breadth control.

Review Integration

When review.polish is enabled (default), /legion:review runs the 4-pass cleanup automatically after the QA loop passes. Configurable scope via review.polish_scope.

Code Polisher Agent

New testing-code-polisher (#49) in the Testing division. Specialized in code clarity, comment quality, naming conventions, structural simplification, and convention consistency.

Standing on the Shoulders of Giants

Legion didn't emerge from the void. It cherry-picked the best patterns from proven orchestration systems, combined them into something greater than the sum of its parts, and left behind the complexity that made each hard to adopt.

Agency Agents

Took: The specialist personality pattern — substantive character sheets with deep expertise, communication styles, hard rules, and personality quirks across 9 divisions. Started with 51 inherited + 2 Legion-native (53 total), consolidated to 48 via 5 merges across v7.1.0-v7.2.0, and now ships 49 current agents. The foundation everything else stands on.

Left behind: Original "Agency" branding and namespace

GSD (Get Shit Done)

Took: Adaptive questioning flow (vision → requirements → constraints), orchestrator/subagent split, human-readable .planning/ state management.

Left behind: 33+ workflow files, custom CLI tooling, complex config

Conductor

Took: Build → review → fix evaluate-loop, quality gates, parallel dispatch pattern, typed evaluators for different work.

Left behind: Board-of-directors governance, message bus IPC, 50+ iteration limits

Shipyard

Took: Wave-based execution, configurable per-plan task cap, atomic commits per completed plan.

Left behind: 29 commands, checkpoint/rollback system, complex hook infrastructure

Best Practice Config

Took: Plugin architecture (commands → skills → agents), agent frontmatter schema, structured metadata for programmatic catalog.

Left behind: RPI workflow, custom hooks infrastructure

Daem0n-MCP

Took: Semantic memory architecture — store, recall, decay primitives. Compute decay at recall time, not destructively. Full history always preserved.

Left behind: Hook-driven architecture, MCP server dependency

Feature-dev

Took: Confidence-based review filtering (80%+), competing architecture designs (2–3 approaches), 3-agent model.

Left behind: No state persistence, no memory, no quick mode

code-foundations

Took: Anti-rationalization tables, evidence-backed checklists, scope discipline.

Left behind: 614-check pipeline, heavy token consumption

beads

Took: Git-native state, ready primitive, semantic compaction, actor-based audit trails.

Left behind: Scope creep, MEOW naming, $100+/hour cost

Auto-Claude

Took: Worktree isolation, multi-stage spec pipeline, semantic merge, dynamic security profiles.

Left behind: 1,751 files, Python-Electron split, 50-iteration QA

bjarne

Took: Verification points, stale loop detection, environment auto-remediation, verbose output redirection.

Left behind: 2,500 lines of Bash, zero tests

Puzld.ai

Took: DPO preference extraction, debate-with-winner-tracking, clean adapter pattern.

Left behind: Near-zero test coverage, 95 releases in 3 months

The Tithe

The Legion asks not for blood, but for sustenance.
Those who have commanded the many and found them worthy
may offer tribute, that the voices may continue to serve.

Make an Offering

Your sacrifice sustains the many.