9thlevelsoftware/legion/workflow-common

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

DEPRECATED compatibility shim; workflow-common-core is canonical for all conventions referenced here

Install

npx vskill@latest install 9thlevelsoftware/legion/workflow-common

SKILL.md

Legion Workflow Common (DEPRECATED)

DEPRECATED — DO NOT USE FOR NEW COMMANDS.
Canonical source: skills/workflow-common-core/SKILL.md for CLI detection, adapter reference, user interaction, settings resolution, agent path resolution, and state file locations.
Migration path: Legacy references to workflow-common.md in commands, skills, or agent files MUST be updated to point at workflow-common-core/SKILL.md (always-load) plus the specific workflow-common-{domain} extension (github, memory, domains) needed. When every reference has migrated, this file SHOULD be deleted.
Precedence rule: Any content in this file that diverges from workflow-common-core/SKILL.md (agent counts, division lists, settings keys, protocol steps) is STALE. Trust workflow-common-core/SKILL.md — not this file.
The sections below are retained verbatim for legacy pointer compatibility only. They are NOT the source of truth.

CLI Detection and Adapter Loading

Legion supports multiple AI CLIs through an adapter layer. Before any command executes, the active CLI must be detected and its adapter loaded.

Detection Protocol
Step 0: Check for override file
- Read .legion-cli in the project root (if it exists)
- If it contains a valid CLI identifier (e.g., "claude-code", "codex-cli"):
→ Use that adapter directly, skip Steps 1-3
→ Log: "CLI override: {cli} (from .legion-cli)"
Step 1: Tool probe (primary detection)
- For each adapter in adapters/, check the detection.primary field:
- Claude Code: TeamCreate tool is available
- Codex CLI: `.codex-plugin/plugin.json`, `.codex/prompts/legion-start.md`, or `~/.codex/prompts/legion-start.md` exists
- Cursor: `.cursor/rules/legion.mdc` exists
- Copilot CLI: `.github/skills/legion-start/SKILL.md`, `~/.copilot/skills/legion-start/SKILL.md`, `.github/agents/legion-orchestrator.agent.md`, or `~/.config/copilot/agents/legion-orchestrator.agent.md` exists
- Gemini CLI: `.gemini/commands/legion/start.toml` or `~/.gemini/commands/legion/start.toml` exists
- Antigravity CLI: `.agents/plugins/legion/plugin.json` or `~/.gemini/config/plugins/legion/plugin.json` exists
- Kiro CLI: `.kiro/agents/legion-orchestrator.md`, `~/.kiro/agents/legion-orchestrator.md`, `.kiro/steering/legion.md`, or `~/.kiro/steering/AGENTS.md` exists
- Windsurf: `.windsurf/rules/legion.md` exists
- OpenCode: `.opencode/command/legion-start.md`, `~/.config/opencode/command/legion-start.md`, `.opencode/agent/legion-orchestrator.md`, or `~/.config/opencode/agent/legion-orchestrator.md` exists
- Kilo Code Plugin: `.kilocodemodes` contains `slug: legion` or `~/.kilocode/globalStorage/kilo code.kilo-code/settings/custom_modes.yaml` contains `slug: legion`
- Kilo CLI: `.kilo/commands/legion-start.md`, `~/.config/kilo/commands/legion-start.md`, `.kilo/agents/legion-orchestrator.md`, `~/.config/kilo/agents/legion-orchestrator.md`, `.kilo/skills/code-polish/SKILL.md`, or `~/.kilo/skills/code-polish/SKILL.md` exists
- Aider: `.aider.conf.yml`, `AGENTS.md`, or `CONVENTIONS.md` exists
- If exactly one primary matches: use that adapter
- If multiple match: use the first match in the order above (Claude Code wins ties; Kilo Code wins over Kilo CLI when the Kilo Code mode bridge is installed because both targets may share `.kilo/` workflow/skill paths)
Step 2: Secondary detection (fallback)
- If no primary matched, check each adapter's detection.secondary field
- These are additional filesystem markers or runtime-native configuration directories
- Use the first match
Step 3: Default
- If no detection matched: default to Claude Code adapter
- Log: "No CLI detected — defaulting to Claude Code adapter"
Step 4: After detection
- Read the full adapter file: adapters/{cli}.md
- Parse YAML frontmatter for capabilities and tool mappings
- Log: "Active adapter: {cli_display_name} (parallel: {parallel_execution}, messaging: {structured_messaging})"
Adapter Reference Convention

Throughout skills and commands, adapter fields are referenced with dot notation:

  • adapter.spawn_agent_personality — how to spawn an agent with personality
  • adapter.model_execution — which model to use for execution
  • adapter.global_config_dir — where global config lives (e.g., ~/.claude/legion/)
  • adapter.commit_signature — Co-Authored-By line for commits
  • adapter.ask_user — how to present choices to the user

These resolve to the active adapter's Tool Mappings table at runtime.

User Interaction Convention

All commands use adapter.ask_user for user prompts. This maps to:

  • Claude Code: AskUserQuestion tool (structured questions with labeled options)
  • Codex CLI / Gemini CLI / Cursor / Windsurf / Aider / Kiro / OpenCode / Copilot CLI: plain numbered lists printed to stdout when the runtime does not offer a better structured question surface
  • Other CLIs: per adapter's Interaction Protocol section

Commands reference adapter.ask_user in their process body. The allowed-tools frontmatter retains the Claude Code tool name (AskUserQuestion) for backward compatibility.

State File Locations

FilePathPurpose
PROJECT.md.planning/PROJECT.mdProject vision, requirements, constraints, decisions
ROADMAP.md.planning/ROADMAP.mdPhase breakdown with agent assignments and progress
STATE.md.planning/STATE.mdCurrent position, recent activity, next action
Templatesskills/questioning-flow/templates/Schema files for generating PROJECT/ROADMAP/STATE
Phase Plans.planning/phases/{NN-name}/Plan and summary files per phase
Compacted Summaries.planning/phases/{NN-name}/{NN}-COMPACTED.mdAI-compacted phase summaries preserving decisions and outcomes while trimming verbose details (via memory-manager skill)
PORTFOLIO.md{adapter.global_config_dir}/portfolio.mdGlobal portfolio registry — all Legion projects
Milestone Summaries.planning/milestones/MILESTONE-{N}.mdCompletion summaries with metrics per milestone
Milestone Archive.planning/archive/milestone-{N}/Archived phase directories from completed milestones
Memory Outcomes.planning/memory/OUTCOMES.mdAgent performance and task outcome records for cross-session learning
Memory Patterns.planning/memory/PATTERNS.mdSuccessful patterns with reuse criteria — distilled from agent outcomes (via memory-manager skill)
Memory Errors.planning/memory/ERRORS.mdError signatures mapped to known fixes — troubleshooting reference for agents (via memory-manager skill)
Memory Preferences.planning/memory/PREFERENCES.mdUser decision signals (accepted/rejected/modified proposals) for preference-informed agent routing (via memory-manager skill)
Custom Agentsagents/{agent-id}.mdUser-created agent personality files (via /legion:agent)
Codebase Map.planning/CODEBASE.md + .planning/codebase/Structured architecture doc plus retrieval index generated by /legion:map
Campaign Documents.planning/campaigns/{campaign-slug}.mdStructured campaign plans with objectives, messaging, audience, channels, calendar, and agent assignments (via marketing-workflows skill)
Design Documents.planning/designs/{project-slug}-system.mdStructured design system specifications with tokens, components, accessibility, and agent assignments (via design-workflows skill)
Exploration Documents.planning/explorations/YYYY-MM-DD-{slug}-design.mdDesign discovery outputs from /legion:explore sessions (via polymath-engine skill)
Spec Documents.planning/specs/{NN}-{phase-slug}-spec.mdStructured specification documents produced by spec-pipeline skill before coding phases

Settings Resolution Protocol

Legion commands MAY be configured via settings.json in the repository root. This file is optional.

Step 1: Try to read ./settings.json from current working directory.
Step 2: If the file is missing or invalid JSON, continue with built-in defaults.
Step 3: Resolve these runtime settings once per command invocation:
- planning.max_tasks_per_plan (default: 3, per-plan task cap only)
- review.max_cycles (default: 3)
- execution.agent_personality_verbosity (default: full)
- integrations.github (default: prompt)
- memory.enabled (default: true)
- memory.project_scoped_only (default: true)
Step 4: Log resolved values in command notes before execution.

When settings are present, command skills must honor them instead of hardcoded values.

Agent Personality Paths

All 52 built-in agent personalities live under agents/ in the plugin root (not necessarily the user's CWD). The path must be resolved before use:

{AGENTS_DIR}/{agent-id}.md

Agent IDs include their division as a prefix (e.g., engineering-senior-developer, testing-qa-verification-specialist). Exceptions: Spatial Computing agents use descriptive prefixes (xr-, visionos-, macos-, terminal-) and Specialized agents use domain prefixes (agents-, data-, lsp-) for shorter, more readable filenames.

Divisions: Engineering, Design, Marketing, Product, Project Management, Testing, Support, Spatial Computing, Specialized, Custom

Custom agents created via /legion:agent follow the same path pattern.

To load an agent personality: Read {AGENTS_DIR}/{agent-id}.md

Pre-Flight Alignment Agent

Polymath (agents/polymath.md)

  • Role: Pre-flight alignment specialist
  • Invoked by: /legion:explore command
  • Purpose: Turn raw ideas into a saved design document before optional formal planning
  • Key behaviors: Context inspection, research-first workflow, focused structured choices, approach comparison, design-doc output
  • Division: Specialized
  • Task types: exploration, clarification, research-first, structured-questions, gap-detection
Agent Path Resolution Protocol

Before loading ANY agent personality file, resolve AGENTS_DIR once per command invocation.

Legion agents are installed via the npm installer (npx @9thlevelsoftware/legion). Resolution checks these locations in order:

Step 1: Try Claude Code's native agents directory
- Run: Bash ls ~/.claude/agents/agents-orchestrator.md 2>/dev/null && echo "FOUND"
- If output contains "FOUND":
- Run: Bash cd ~/.claude/agents && pwd
- Store the absolute path as AGENTS_DIR
→ Log: "AGENTS_DIR: {AGENTS_DIR} (installed)"
→ Done.
Step 1.5: Try Legion's generic agents directory (non-Claude runtimes)
- Run: Bash ls ~/.legion/agents/agents-orchestrator.md 2>/dev/null && echo "FOUND"
- If output contains "FOUND":
- Run: Bash cd ~/.legion/agents && pwd
- Store the absolute path as AGENTS_DIR
→ Log: "AGENTS_DIR: {AGENTS_DIR} (legion-global)"
→ Done.
- This path is used by runtimes with storageLayout: 'legion' (Codex CLI,
Cursor, Copilot CLI, Gemini CLI, Kiro CLI, Windsurf, OpenCode, Aider).
Checking it before local/manifest avoids unnecessary fallbacks.
Step 2: Try local (CWD) path — for plugin development
- Attempt to Read agents/agents-orchestrator.md from the current working directory
- If the file exists and is readable:
→ AGENTS_DIR = "agents" (relative — local dev mode)
→ Log: "AGENTS_DIR: agents (local)"
→ Done.
Step 3: Fallback — read npm install manifest
- Try Claude Code manifest first:
Run: Bash cat ~/.claude/legion/manifest.json 2>/dev/null
- If not found, try generic manifest:
Run: Bash cat ~/.legion/manifest.json 2>/dev/null
- If the file exists and contains valid JSON:
- Extract the "paths.agents" value
- Set AGENTS_DIR = {paths.agents}
- Verify by attempting to Read {AGENTS_DIR}/agents-orchestrator.md
- If readable:
→ Log: "AGENTS_DIR: {AGENTS_DIR} (npm manifest)"
→ Done.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 93 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
62
Repository forks
7
7-day trend score
21

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/9thlevelsoftware/legion/workflow-common/badge)](https://verified-skill.com/skills/9thlevelsoftware/legion/workflow-common)

Something wrong with this skill or its page? Tell us.