The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
docs(skills): update README to reflect current module architecture
Steven Enamakeldba12bfc2161
diff --git a/crates/openhuman-core/src/skills/README.md b/crates/openhuman-core/src/skills/README.mdindex 37d88a7898..4eb997f800 100644--- a/crates/openhuman-core/src/skills/README.md+++ b/crates/openhuman-core/src/skills/README.md@@ -1,34 +1,73 @@# Skills-Discovery and parsing of agentskills.io-style skills (a directory containing `SKILL.md` with YAML frontmatter and Markdown instructions). Owns scope resolution (User vs Project vs Legacy), trust-marker enforcement, resource reading, and install / uninstall. Skills are surfaced to agents via the compact `## Installed Skills` catalog and executed via `run_skill` in an isolated worker — bodies are no longer spliced into chat turns. Does NOT own runtime execution internals or general tool execution (`tools/` / `javascript/`).+Discovery and parsing of agentskills.io-style skills (a directory containing `SKILL.md`/`WORKFLOW.md` with YAML frontmatter and Markdown instructions). Owns scope resolution (Builtin / User / Project / Legacy / Profile), trust-marker enforcement, resource reading, create/install/uninstall, run logging, search, and the agent-tool wrappers over all of it. Skills are surfaced to agents via the compact `## Installed Skills` catalog and executed via `run_skill`/`run_workflow` in an isolated worker — bodies are no longer spliced into chat turns. Remote catalog browsing lives in [`catalog/`](catalog/README.md) and run execution lives in [`runtime/`](runtime/README.md); this module owns local metadata only.-## Public surface+## Compile-time gate (`skills` feature, see `mod.rs`)-- `pub enum SkillScope` — `ops.rs:42-58` — discovery scope (`User` / `Project` / `Legacy`); decides precedence on name collision.-- `pub const MAX_SKILL_RESOURCE_BYTES: u64 = 128 * 1024` — `ops.rs:39` — bound on per-resource RPC payload.-- `pub use ops::*` — `mod.rs:9` — re-exports skill discovery, parsing, install, uninstall, resource reading, and frontmatter types.-- `pub struct ToolResult` / `pub enum ToolContent` — `types.rs:7-60` — content blocks returned by skill / tool execution.-- `pub mod bus` — `bus.rs` — emits skill events on the global event bus.-- RPC `skills.{skills_list, skills_read_resource, skills_create, skills_install_from_url, skills_uninstall}` — `schemas.rs` (re-exported `all_skills_controller_schemas` / `all_skills_registered_controllers` via `mod.rs:10`).+`pub mod skills` is always compiled — it is a facade. Its behavioural submodules (`ops`, `ops_create`, `ops_discover`, `ops_install`, `ops_parse`, `bundled`, `bus`, `preflight`, `registry`, `run_log`, `schemas`, `search`, `tools`) are gated on the default-ON `skills` Cargo feature; when it is off, [`stub.rs`](stub.rs) takes their place, mirroring **functions only** with no-op/empty bodies (`load_workflow_metadata` → `[]`, `init_workflows_dir` → `Ok(())`, empty controller aggregators) so always-on callers need no `#[cfg]`.++[`types.rs`](types.rs) and [`ops_types.rs`](ops_types.rs) are an ungated carve-out compiled in both directions: they are inert serde/std-only definitions with load-bearing consumers outside this domain — `tools::traits` re-exports `ToolResult`/`ToolContent` from `types` as the crate-wide tool-result type, and `Workflow`/`WorkflowFrontmatter`/`WorkflowScope` from `ops_types` appear in always-on agent-harness and prompt signatures. Gating them would take down the tool trait system, MCP, and the Node runtime. The stub therefore re-exports these types verbatim instead of redeclaring them.++`catalog` and `runtime` are themselves facade+stub pairs for the same feature, so their `pub mod` lines stay ungated. `webhooks` is ungated outright — it is not part of the `skills` feature at all and has always-compiled callers under `crates/openhuman-core/src/core/`.++Stub signatures must match the real ones exactly; `cargo check --no-default-features` is the only thing that catches drift.++## Key files++| File | Role |+| --- | --- |+| `ops.rs` | Facade re-exporting `ops_create`/`ops_discover`/`ops_install`/`ops_parse`/`bundled::install_bundled_skills`; the module doc explains scope precedence and the trust marker. |+| `ops_create.rs` | Scaffolds new `WORKFLOW.md`/`SKILL.md` skills on disk from declared `[[inputs]]`. |+| `ops_discover.rs` | Scans root directories, resolves scope precedence and collisions, initializes/prunes the skills directory. `load_workflow_metadata_for_profile` and `discover_workflows_with_profile` take a profile-local skills root and `include_skills` list so a profile can see its own private skills. |+| `ops_install.rs` | Facade over `ops_install_part_01.rs`/`ops_install_part_02.rs`: the hardened HTTPS skill-URL installer (size cap, timeout clamp, non-https/private-IP/non-SKILL.md rejection, GitHub blob→raw normalization). Localhost HTTP installs require `OPENHUMAN_SKILL_INSTALL_ALLOW_LOCAL_HTTP=1` and are for local fixtures only. |+| `ops_parse.rs` | Splits `SKILL.md`/`WORKFLOW.md` into frontmatter + body, builds the resource inventory, reads a single resource. |+| `ops_types.rs` | Ungated carve-out: `Workflow`, `WorkflowFrontmatter`, `WorkflowScope` (`Builtin` < `User`/`Project`/`Legacy`/`Profile` precedence), filename/size constants (`MAX_WORKFLOW_RESOURCE_BYTES = 128 KiB`). |+| `types.rs` | Ungated carve-out: `ToolResult`/`ToolContent`, the crate-wide tool-result content-block types re-exported through `tools::traits`. |+| `preflight.rs` | Gates that must pass before the orchestrator boots for a `skills_run` (currently the GitHub gate: Composio GitHub connected, `git` on PATH, `user.name`/`user.email` configured, optional strict identity match). Failures surface as a plain `Err` instead of cryptic orchestrator output. |+| `registry.rs` | A skill is an `AgentDefinition` plus declared `[[inputs]]`, flattened from the same `skill.toml`/`workflow.toml`; `render_inputs_block` renders them into the prompt. Also `prune_legacy_default_workflows`. |+| `run_log.rs` | Per-run streaming logs at `<workspace>/skills/.runs/<skill>_<UTC-ts>_<run>.log`, written live off the agent's `AgentProgress` channel; read back by `read_run_log_slice`/`scan_runs`. |+| `search.rs` | `skill_search` — return a capped projection (id, name, description, scope, tags) for one matching skill instead of serializing the whole catalog, mirroring `tool_search`'s deferred-schema bargain. |+| `tools.rs` | LLM-callable wrappers: read tools (`list_workflows`, `read_workflow_resource`, recent runs/log) are default-enabled; write tools (`create_workflow`, `install_workflow_from_url`, `uninstall_workflow`) ship default-OFF via `tools/user_filter.rs`. Launching a run is a separate tool (`run_workflow`/`AwaitWorkflowTool`) under `agent/tools/`. |+| `bundled/` | Skills shipped **inside the binary** (`include_str!`'d SKILL.md bundles, e.g. `flows/skills/flow-authoring`), materialised into the workspace at boot and discovered through the same code paths as a user-installed skill — lowest scope precedence, so a user/project skill of the same name always wins. |+| `bus.rs` | `TriggeredWorkflowIndex` + `TriggeredSkillSubscriber`: indexes skills that declare a `triggers:` list in frontmatter and registers on the global event bus. Logs which skill(s) match a `DomainEvent`; the actual agent-session launch is out of scope here and wired by the channel runtime. |+| `schemas/` | Controller schemas and thin handlers, split into `controller_schemas.rs`, `handlers.rs`, `helpers.rs`, `wire_types.rs`. All controllers resolve the workspace via `config::load_config_with_timeout`. |+| `stub.rs` | Disabled-feature facade; see above. |+| `catalog/` | `skill_registry` — remote catalog fetch/cache/search, install/uninstall by entry id, the `skill_setup` agent. See [catalog/README.md](catalog/README.md). |+| `runtime/` | `skill_runtime` — start/cancel runs, runtime resolution (Node/Python), the `skill_executor` agent. See [runtime/README.md](runtime/README.md). |+| `webhooks/` | Tunnel routing for skill/agent/echo webhook targets; ungated, unrelated to the `skills` feature. See [webhooks/README.md](webhooks/README.md). |++## RPC surface++Namespace `skills` (`schemas/controller_schemas.rs`, `skills_schemas`): `skills.list`, `skills.run`, `skills.cancel`, `skills.read_resource`, `skills.create`, `skills.install_from_url`, `skills.read_run_log`, `skills.recent_runs`, `skills.describe`, `skills.uninstall`.++Plus the sub-domain namespaces: `skill_registry.*` (`browse`, `search`, `sources`, `categories`, `install`, `uninstall`, `schemas` — see [catalog/README.md](catalog/README.md)) and `skill_runtime.*` (`run`, `cancel`, `recent_runs`, `read_run_log`, `resolve_runtimes`, `schemas` — see [runtime/README.md](runtime/README.md)).## Calls into-- `crates/openhuman-core/src/config/` — workspace path resolution and trust-marker location.-- `crates/openhuman-core/src/agent/` — the `## Installed Skills` catalog rendered in `agent_registry/agents/orchestrator/prompt.rs`, fed by the skill list on `PromptContext` (`agent/harness/session/turn/context.rs`).-- `crates/openhuman-core/src/config/workspace/` — workspace-relative skill paths.-- `crates/openhuman-core/src/core/event_bus/` — emits `DomainEvent::Skill(*)` on install / uninstall.+- `crates/openhuman-core/src/config/` — workspace path resolution and trust-marker location (`config::load_config_with_timeout`).+- `crates/openhuman-core/src/config/workspace/ops.rs` — calls `skills::init_workflows_dir` during workspace bootstrap.+- `crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs` — renders the `## Installed Skills` catalog, fed by the skill list on `PromptContext` (`agent/harness/session/turn/context.rs`).+- `crates/openhuman-core/src/agent/prompts/` — renders the `## Available Skills` catalog section.+- `crates/openhuman-core/src/core/bus.rs` / `crates/openhuman-core/src/core/events.rs` — `bus.rs` subscribes to `DomainEvent` for triggered skills; `ops`/`bus` publish `Workflow{Loaded,Stopped,StartFailed,Executed,sChanged}` on run and catalog changes.+- `crates/openhuman-core/src/agent/harness/definition.rs` — `registry.rs` flattens `AgentDefinition` fields from `skill.toml`.## Called by-- `crates/openhuman-core/src/tools/traits.rs` — `ToolResult` / `ToolContent` shape shared with the tool registry.-- `crates/openhuman-core/src/config/workspace/ops.rs` — workspace bootstrap touches the skill directory layout.-- `crates/openhuman-core/src/agent/registry/agents/integrations_agent/prompt.rs` — integrations agent reads the skill catalog.+- `crates/openhuman-core/src/tools/traits.rs` — re-exports `ToolResult`/`ToolContent` from `types.rs` as the shared tool-result shape.- `crates/openhuman-core/src/agent/harness/fork_context.rs` — fork context propagates injected skills.-- `crates/openhuman-core/src/agent/harness/session/turn.rs` — per-turn injection point.-- `crates/openhuman-core/src/agent/prompts/{mod,types}.rs` — render `## Available Skills` catalog section.-- `crates/openhuman-core/src/core/all.rs` — controller registry wiring.+- `crates/openhuman-core/src/agent/harness/session/turn/context.rs` and `.../turn/tools.rs` — per-turn skill injection and tool wiring.+- `crates/openhuman-core/src/agent/tools/run_workflow.rs` — the separate `run_workflow`/`AwaitWorkflowTool` launch path.+- `crates/openhuman-core/src/core/all.rs` — controller registry wiring for `skills`, `skill_registry`, and `skill_runtime`.## Tests-- Unit: tests live alongside `ops.rs`, `schemas.rs`, and `types.rs` as `#[cfg(test)] mod tests` blocks (no separate `*_tests.rs` files in this domain).-- Cross-cutting agent + skill behavior is covered indirectly by `crates/openhuman-core/src/agent/harness/session/{turn,runtime}_tests.rs`.+Behavior tests live beside their modules as `*_tests.rs` (e.g. `ops_tests.rs` and its `ops_tests_part_0{1,2,3}_tests.rs` siblings, `ops_types_tests.rs`, `ops_create_render_skill_toml_tests_tests.rs`, `ops_discover_include_skills_tests_tests.rs`, `ops_discover_profile_scope_tests_tests.rs`, `ops_install_install_fetch_tests_tests.rs`, `preflight_tests.rs`, `registry_tests.rs`, `run_log_tests.rs`, `schemas_tests.rs`, `search_tests.rs`, `tools_tests.rs`, `types_tests.rs`, `bus_tests.rs`), wired via `#[path]` from the module they cover.++`e2e_plumbing_tests.rs` and `e2e_run_tests.rs` are mock-LLM end-to-end tests: plumbing (create → registry round-trip, orchestrator turn calling `list_workflows`/`run_workflow`, `await_run_outcome` polling) and run execution (`spawn_workflow_run_background` → terminal `DONE` → `await_run_outcome`, `#[ignore]`d and serial because they set the process-global `OPENHUMAN_WORKSPACE`).++Cross-cutting agent + skill behavior is covered indirectly by `crates/openhuman-core/src/agent/harness/session/turn_tests*.rs`.++## Notes++- Per AGENTS.md, skill discovery rejects symlinked bundles — copy skills into the `Harness` workspace rather than symlinking them.+- `WorkflowScope` precedence on name collision, lowest to highest: `Builtin` < `User`/`Project`/`Legacy` < `Profile` (profile-local skills are private to the active agent profile).