Skip to content
Français

defineHarnessSkill

import { defineHarnessSkill } from "@elie-laloum/outpost/harness";

Define a skill: instructions and optional tools that a built-in harness lists by name and description in its system prompt. The model calls load_skill to read the instructions; calls to the skill’s tools are denied until then.

Complete example and detailed rules.

  • optionsRequired
    HarnessSkillOptions
    Skill name, description, instructions and optional tools.
  • options.nameRequired
    string
    Unique skill name of 1 to 64 letters, digits, underscores or hyphens, passed by the model to load_skill.
  • options.descriptionRequired
    string
    Short description listed in the system instructions so the model knows when to load the skill.
  • options.instructionsRequired
    HarnessInstructionSource
    Instructions returned when the skill is loaded: text or a resolver receiving the sandbox, signal and model.
  • options.toolsOptional
    readonly (HarnessTool<unknown> | HarnessToolset)[] | undefined
    Tools or toolsets of the skill. They are offered to the model with the other tools, but a call is denied until the skill is loaded; names must be unique across the harness.

Templates below preserve the English text sent to the model. ${…} marks runtime substitutions, not brief template syntax.

When createHarness({ skills }) receives a nonempty skill list, it adds this catalog to the system instructions after profile and harness instructions, before session-start hook additions:

Skills are available on demand. Call load_skill with a skill name to read its instructions and enable its tools before using them:
- ${skill.name}: ${skill.description}

The name/description line repeats for each skill in declaration order. The injected load_skill tool has this model-visible description:

Load a skill listed in the instructions: returns its instructions and enables its tools for the following steps.

Loading a skill resolves its instructions and returns them as tool output. If the skill has tools, the output is:

${resolvedInstructions}

Tools now available: ${toolNames}.

toolNames joins the skill’s tool names with , . Without tools, only resolvedInstructions is returned. Loading does not append the skill body to the system prompt.

Skill names, descriptions and instruction sources are configurable. The catalog introduction, loader description and tool-availability suffix are fixed; there is no override option. Omitting skills removes this machinery. Whether tools stay unlocked is determined from the effective history, so compaction can require loading a skill again.

Implementation: skill.ts · harness.ts · harness-loop.ts.

HarnessSkill

export declare function defineHarnessSkill(
  options: HarnessSkillOptions,
): HarnessSkill;