- Get Started

Adding Skills

Skills are the primary extension point in OpenFlows. A skill is a declarative unit of capability: a directory, a specification document, and a registry entry. It does not require a code change, a recompilation, or a restart. NEXUS discovers skills by reading orchestration/agent/registry.json v2, and agent roles execute them according to their own flow phases.

This page explains how to design a new skill, where to place it, how to write the SKILL.md specification, how to register it under the correct role’s skills array, and how to test it before submitting. The process is intentionally lightweight so that domain experts can contribute capabilities without learning the entire Rust codebase.

What a Skill Is

A skill is a contract between a human contributor and an agent role. It answers three questions: what problem does this solve, what inputs and outputs are expected, and what procedure should the agent follow. The skill is not a script; it is a specification that an LLM-driven agent interprets in context. Good skills are precise, composable, and failure-aware.

Because Coder is the only runtime, a skill never manages infrastructure directly. It operates inside an ephemeral Coder workspace via the agent CLI or through the Coder API. The orchestration layer decides when to invoke a skill; the skill tells the agent how to execute it.

No code change required

Adding a skill means dropping a directory into orchestration/plugin/skills/ and listing it in registry.json. If your proposal requires changing the flow engine, SharedStore contracts, or the Coder transport, open an architecture issue instead. Those are core features, not skills.

Directory Structure

Every skill lives in its own directory under orchestration/plugin/skills/. The directory name becomes the skill identifier, so choose it carefully and match the name field in the registry entry.

text
orchestration/plugin/skills/
├── run-cargo-test/
│   ├── SKILL.md
│   ├── examples/
│   │   ├── input.json
│   │   └── output.txt
│   └── tests/
│       └── validation.json
└── write-adr/
    ├── SKILL.md
    └── examples/
        └── sample-adr.md
File / DirectoryPurpose
SKILL.mdRequired. The skill specification: what it does, when it runs, inputs, outputs, and examples.
examples/Optional but strongly recommended. Sample inputs and expected outputs for manual and automated validation.
tests/Optional. Custom test fixtures that exercise the skill through the CLI or a flow node.
assets/Optional. Diagrams, reference tables, or other files referenced by SKILL.md.

SKILL.md Format

SKILL.md is the specification. It must be complete enough that another agent can execute the skill without asking for clarification. The following sections are required unless explicitly marked optional.

SectionWhat to include
# Skill NameShort, verb-first title. Example: Run cargo test.
## PurposeOne paragraph explaining the outcome and why it matters.
## When to UseTrigger conditions: which flow phase, which agent role, and what decision criteria.
## InputsTyped inputs with required vs optional, defaults, and validation rules.
## OutputsWhat the skill returns or writes. Include file paths and SharedStore keys if applicable.
## ProcedureStep-by-step instructions for the agent. Be precise enough to reproduce deterministically.
## ExamplesOne or more worked examples showing input, execution, and output.
## Failure ModesWhat can go wrong, how to detect it, and what the agent should do next.
## Registry EntryThe exact JSON snippet to add to registry.json under the role’s skills array.
markdown
# Run cargo test

## Purpose
Execute the Rust test suite for a given crate or workspace and report the
result in a structured format that NEXUS can act on.

## When to Use
- VESSEL runs this skill after FORGE opens a pull request to verify CI status.
- FORGE runs it before opening a PR when the issue includes a test requirement.
- The skill is triggered by the "/test" command in a PR comment.

## Inputs
| Name | Type | Required | Default | Description |
|------|------|----------|---------|-------------|
| crate | string | no | "workspace" | Crate to test, or "workspace" for all crates |
| target | string | no | "x86_64-unknown-linux-gnu" | Build target |
| extra_args | array[string] | no | [] | Extra arguments passed to cargo test |

## Outputs
- stdout: raw cargo test output.
- exit_code: 0 for pass, non-zero for fail.
- summary_file: path to a JSON file with counts for passed, failed, and ignored tests.

## Procedure
1. Navigate to the repository root in the workspace.
2. Run `cargo test -p {crate}` if crate is not "workspace", otherwise run `cargo test --workspace`.
3. Append any extra_args to the command.
4. Capture stdout, stderr, and exit code.
5. Parse the output and write summary_file to the workspace.
6. If the exit code is non-zero, stop and report failure.

## Examples
### Input
```json
{
  "crate": "openflows-core",
  "extra_args": ["--no-fail-fast"]
}
```

### Output
```json
{
  "exit_code": 0,
  "summary_file": "/workspace/.openflows/test-summary.json"
}
```

## Failure Modes
- Missing crate: return exit_code 1 and set summary_file to null.
- Compile failure: include the first compiler error in stderr.
- Timeout: if the test run exceeds 10 minutes, kill the process and report TIMEOUT.

## Registry Entry
```json
{
  "name": "run-cargo-test",
  "description": "Run the Rust test suite and return a structured summary",
  "role": "vessel",
  "path": "orchestration/plugin/skills/run-cargo-test",
  "required": true
}
```

Registering the Skill in registry.json

The registry entry lives under the skills array of the relevant agent role. Each role can have its own skills, and the same skill can be listed under multiple roles if the context differs. NEXUS uses the role to decide when the skill is available.

json
{
  "agents": {
    "vessel": {
      "provider": "openai",
      "model": "gpt-4o",
      "coder_module": "codex",
      "active": true,
      "instances": 1,
      "skills": [
        {
          "name": "run-cargo-test",
          "description": "Run the Rust test suite and return a structured summary",
          "path": "orchestration/plugin/skills/run-cargo-test",
          "required": true
        }
      ]
    }
  }
}
FieldTypeDescription
namestringUnique identifier, matching the directory name.
descriptionstringOne-line summary shown in the TUI and CLI help.
rolestringAgent role that owns the skill: nexus, forge, sentinel, vessel, or lore.
pathstringRelative path to the skill directory under orchestration/plugin/skills/.
requiredboolIf true, the role must be able to execute this skill; the setup doctor checks it.

Path must be relative to the workspace root

The path field is resolved from the repository root inside the Coder workspace. Do not use absolute paths or paths that depend on the host machine layout. The same registry must work in local mode, Coder mode, and CI.

Design Conventions

A skill is a contract, not a black box. The following conventions keep the registry consistent and make it possible for NEXUS to reason about skill availability without executing the skill itself.

ConventionRule
Verb-first namesSkills are actions. Use run-tests, not test-runner.
Single responsibilityOne skill does one thing. Compose complex behavior through the flow graph, not by piling steps into a single skill.
Deterministic inputsEvery input must have a schema or contract. No free-form string parsing unless explicitly documented.
Typed outputsOutput must be a JSON value, a file path, or a SharedStore key. The flow node must know what to expect.
Documented failureEvery skill must list its failure modes and the recommended escalation.
No core code changesAdding a skill should never require editing Rust source. If it does, it is not a skill; it is a core feature.

Testing a Skill

A skill without tests is a skill that will drift. Every skill contribution must include at least one of the following validation layers, and ideally all four.

LayerHow
Manual validationRun the skill via the CLI or a scratch workspace and compare output to the examples/ directory.
Unit test of the flow nodeIf the skill is invoked by a flow node, add a test that mocks the skill directory and verifies the node dispatch.
Registry schema testRun the registry validation command after editing registry.json.
Coder mode smoke testProvision a Coder workspace, ensure the skill directory is mounted, and run the skill through the agent CLI.
bash
# Validate the registry schema after adding a skill
cargo run -p openflows --bin openflows -- registry validate

# Run a single skill manually in a local workspace
cargo run -p openflows --bin openflows -- skill run run-cargo-test   --input orchestration/plugin/skills/run-cargo-test/examples/input.json

The schema validation command checks that every skill entry has a valid path, a declared role, and a matching directory. The manual run command executes the skill with the provided input and prints the output. Both should pass before you open a PR.

Review Checklist

Start with a narrowly scoped skill

The best first contribution is a skill that automates one repetitive task, such as running a linter, generating a changelog entry, or validating a schema. Avoid skills that require new flow phases or SharedStore keys until you are familiar with the core architecture.