// Operate the Agent Hive Cortex orchestration engine. Use this skill when running Cortex commands, analyzing project dependencies, finding ready work, understanding the orchestration system, or troubleshooting Cortex issues.
| name | cortex-operations |
| description | Operate the Agent Hive Cortex orchestration engine. Use this skill when running Cortex commands, analyzing project dependencies, finding ready work, understanding the orchestration system, or troubleshooting Cortex issues. |
The Cortex is Agent Hive's orchestration engine - the central nervous system that reads project state, analyzes dependencies, and coordinates AI agents.
Runs complete analysis using an LLM to identify blocked tasks, suggest state updates, and detect new project requests.
# Run full analysis
uv run python -m src.cortex
# Or using make
make cortex
What it does:
last_cortex_run timestampRequirements:
OPENROUTER_API_KEY environment variableOPENROUTER_MODEL (optional, defaults to anthropic/claude-haiku-4.5)Quickly finds projects ready for an agent to claim without requiring API calls.
# Human-readable output
uv run python -m src.cortex --ready
# JSON output for programmatic use
uv run python -m src.cortex --ready --json
Ready criteria:
status == 'active'blocked == falseowner == null (unclaimed)dependencies.blocked_byVisualizes project dependencies and detects cycles.
# Human-readable tree view
uv run python -m src.cortex --deps
# JSON output
uv run python -m src.cortex --deps --json
Output includes:
| Command | Description |
|---|---|
uv run python -m src.cortex | Full LLM analysis |
uv run python -m src.cortex --ready | Find ready work |
uv run python -m src.cortex --deps | Show dependency graph |
uv run python -m src.cortex --json | JSON output (with --ready or --deps) |
uv run python -m src.cortex --path /custom/path | Use custom base path |
============================================================
READY WORK
============================================================
Timestamp: 2025-01-15T14:30:00
Found 2 project(s) ready for work
!! feature-auth
Priority: high
Tags: feature, security
Path: projects/feature-auth/AGENCY.md
! docs-update
Priority: medium
Tags: documentation
Path: projects/docs-update/AGENCY.md
============================================================
Priority indicators:
!!! - critical!! - high! - medium - low============================================================
DEPENDENCY GRAPH
============================================================
BLOCKED PROJECTS:
----------------------------------------
*** phase-2
Status: active
Blocked by: phase-1
Reason: Blocked by uncompleted: phase-1
UNBLOCKED PROJECTS:
----------------------------------------
phase-1 [active]
Blocks: phase-2
standalone [active]
DEPENDENCY TREE:
----------------------------------------
[*] phase-1
[*] phase-2
[*] standalone
Legend: [+] completed [*] active [!] blocked [-] pending
============================================================
The Cortex detects circular dependencies that can never be resolved:
!!! CYCLES DETECTED !!!
project-a -> project-b -> project-c -> project-a
To fix cycles:
blocked_by relationships--deps to verify resolutionThe Cortex runs automatically every 4 hours via .github/workflows/cortex.yml:
on:
schedule:
- cron: '0 */4 * * *' # Every 4 hours
Workflow steps:
Required secrets:
OPENROUTER_API_KEY# Set in .env file
echo "OPENROUTER_API_KEY=sk-or-v1-xxxxx" >> .env
# Or export directly
export OPENROUTER_API_KEY="sk-or-v1-xxxxx"
Ensure you're running from the hive root directory:
cd /path/to/agent-hive
uv run python -m src.cortex
Or specify the path:
uv run python -m src.cortex --path /path/to/agent-hive
Verify projects directory exists with AGENCY.md files:
ls projects/*/AGENCY.md
The Cortex expects JSON from the LLM. If parsing fails:
OPENROUTER_MODELfrom src.cortex import Cortex
# Initialize
cortex = Cortex(base_path="/path/to/hive")
# Discover projects
projects = cortex.discover_projects()
# Get ready work
ready = cortex.ready_work(projects)
# Check if specific project is blocked
blocking_info = cortex.is_blocked("project-id", projects)
# Get full dependency summary
summary = cortex.get_dependency_summary(projects)