> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opengoat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Organization Runtime

> Core architecture, invariants, and execution model for OpenGoat organizations.

## Runtime Premise

OpenGoat is an organization-first runtime with provider-bound agents.

* `goat` is the root manager and cannot be deleted.
* Every agent has a provider binding (`runtime.provider.id`).
* Default provider binding is `openclaw` unless overridden per agent.
* Manager behavior is implemented through skills and prompts, not a built-in planner loop.

## Default Entry Agent Resolution

OpenGoat resolves the target agent in this order:

1. `OPENGOAT_DEFAULT_AGENT`
2. `config.defaultAgent`
3. `goat`

## Hierarchy Model

Agent metadata lives in `agents/<agent-id>/config.json`.

Relevant fields:

* `organization.type`: `manager | individual`
* `organization.reportsTo`: `<agent-id> | null`
* `runtime.skills.assigned`

OpenGoat is the source of truth for hierarchy and syncs agent lifecycle with OpenClaw.

## Execution Flow (`opengoat agent ...`)

1. Resolve target agent (or default agent).
2. Resolve session semantics (`--session`, `--new-session`, `--no-session`).
3. Invoke the configured provider runtime.
4. Persist transcript events under agent sessions.
5. Persist run trace under `runs/<run-id>.json`.

## Session Mapping

OpenGoat session ids map 1:1 to OpenClaw session keys:

`agent:<agent-id>:<opengoat-session-id>`

## Skills and Provider-Aware Materialization

Role-skill behavior is provider-aware:

* `openclaw`
  * managers: `og-board-manager`
  * individuals: `og-board-individual`
* non-`openclaw`
  * managers: `og-boards`
  * individuals: `og-boards`

Workspace skill directories by provider:

* `openclaw`: `skills/`
* `claude-code`: `.claude/skills/`
* `codex`: `.agents/skills/`
* `copilot-cli`: `.copilot/skills/`
* `cursor`: `.cursor/skills/`
* `opencode`: `.opencode/skills/`
* `gemini-cli`: `.gemini/skills/`

## Filesystem Layout

Default home: `~/.opengoat` (override with `OPENGOAT_HOME`).

Key paths:

* `config.json`
* `agents.json`
* `workspaces/`
* `organization/`
* `agents/`
* `providers/`
* `skills/`
* `runs/`
