Skills and prompts
此内容尚不支持你的语言。
harness_policy.runtime.skills
Section titled “harness_policy.runtime.skills”Skills: the API a model’s programs call.
A skill is a package skills/<name>/ in the source checkout with
skill.toml name, summary, layer, the names it exports, what it needs__init__.py a mixin class with the methods (and optional exports(session) and turn_report(session): what the skill adds to the model's next turn after every program)A skill runs on the embodiment kinds its embodiments names (default robot). The
kernel’s session class is the embodiment’s session (runtime/episode.py) plus the mixin of
every skill for that embodiment, so skills can call each other’s methods. Which skills a
program sees is decided per run: the system names them (or the interface layers do), and
a skill whose services are missing, or that does not run on the run’s embodiment, is
dropped, from the kernel namespace and from the prompt alike (runtime/prompts.py), so the
model never reads about an API it cannot call.
class SkillA skill as its skill.toml declares it (SKILL_KEYS); path is its directory.
public
Section titled “public”def public() -> tuple[str, ...]The exports without a leading underscore: the API programs are told about (the
driver’s hook __wrap_up__ is left out).
load_skills
Section titled “load_skills”def load_skills(root: Path=SKILLS_ROOT) -> dict[str, Skill]Every skill under root, in prompt order.
skills_for_layers
Section titled “skills_for_layers”def skills_for_layers(layers: dict | None, root: Path=SKILLS_ROOT, *, embodiment: str='robot') -> list[str]The skills of an interface rung given as layer switches ({“learned”: bool, …}; defaults: learned off, reactive and handlers on) for an embodiment kind, without the optional ones.
available_services
Section titled “available_services”def available_services(options: dict) -> set[str]Service kinds a kernel’s options provide: the segmenter, pointer, VLM and verifier configs, and at least one policy, world model or MCP server.
Resolution
Section titled “Resolution”class ResolutionThe outcome of resolve: the enabled skills in prompt order, and each dropped
skill with the reason.
to_dict
Section titled “to_dict”def to_dict() -> dictThe resolution as a plain dict.
resolve
Section titled “resolve”def resolve(requested, services: set[str], *, strict: bool=False, root: Path=SKILLS_ROOT, embodiment: str='robot') -> ResolutionThe requested skills that can run on this embodiment kind with these services. A skill is dropped when it does not run on the embodiment, a service it needs is missing or a skill it requires is not enabled (repeated until nothing changes); the embodiment’s required skills are always enabled. strict: dropping is an error (evaluation runs must not run a smaller system than the one they name).
mixins
Section titled “mixins”def mixins(root: Path=SKILLS_ROOT, *, embodiment: str='robot') -> list[type]The mixin class of every skill for an embodiment kind, imported, in the skills’ order (the session’s method resolution order).
namespace
Section titled “namespace”def namespace(session, names, root: Path=SKILLS_ROOT) -> dictThe kernel namespace of a session with the skills names enabled: each skill’s
exports(session) when its module defines one, else the session attributes it
exports.
reporters
Section titled “reporters”def reporters(names, root: Path=SKILLS_ROOT) -> listThe turn reports of the skills names, in skill order: each skill module’s
turn_report(session) -> {“text”, “images”} or None, which the session calls after
every program (EpisodeCore.drain).
exported_names
Section titled “exported_names”def exported_names(root: Path=SKILLS_ROOT) -> dict[str, tuple[str, ...]]Every exported name and the skills that export it (more than one only for skills that conflict).
harness_policy.runtime.prompts
Section titled “harness_policy.runtime.prompts”System prompts assembled from a prompt pack for the skills a run enables.
A pack is a directory of Markdown sections (prompts/robodojo, prompts/robotwin). Its
pack.toml lists the sections in order; a section with skills is included only when
one of them is enabled:
sections = [ { file = "core.md" }, { file = "learned.md", skills = ["vla", "wam"] }, { file = "rules_learned.md", skills = ["vla"], optional = true },]Inside a section, lines can be kept for some skills only:
<!-- if: pointing, segmentation --> kept when all named skills are enabled...<!-- else --> kept otherwise (optional)...<!-- end -->Markers may also name features of the robot connection (FEATURES): measured_gripper holds when gripper readings are measured openings, not under a contract that reports only the last command, and step_limit when the episode’s step limit is reported (core/contract.py). The marker lines themselves never reach the model, so a prompt with every skill and feature enabled is the pack’s text without them. The API documentation stays in the pack because it describes one embodiment (its frames, reach and numbers); the skills’ code is the same for every embodiment.
features_for
Section titled “features_for”def features_for(runtime: dict) -> set[str]The prompt features of a runtime configuration (its observation contract).
def pack(directory: Path) -> dictThe pack’s settings: sections and the exported names it leaves undocumented.
sections
Section titled “sections”def sections(directory: Path) -> list[dict]The pack’s sections in order ({“file”, and optionally “skills”, “optional”}): pack.toml’s, or DEFAULT_SECTIONS without one.
select
Section titled “select”def select(text: str, skills) -> strKeep the lines of text whose if/else markers hold for the enabled skills.
marked_skills
Section titled “marked_skills”def marked_skills(text: str) -> set[str]Skills named in the markers of text.
assemble_prompt
Section titled “assemble_prompt”def assemble_prompt(directory: Path, skills, overrides: dict | None=None, features=('measured_gripper',)) -> strThe pack’s sections for the enabled skills and connection features, joined.
overrides maps a section name (file stem) to another file, e.g. another
embodiment’s core section.
mentions
Section titled “mentions”def mentions(text: str, name: str) -> boolWhether the prompt refers to an API name: a call for functions, the bare word for constants (upper case).
documentation_gaps
Section titled “documentation_gaps”def documentation_gaps(directory: Path, skills, exported: dict, features=('measured_gripper',)) -> dictWhat the assembled prompt gets wrong about the API: missing are functions of
enabled skills it never shows being called (except those the pack lists as
undocumented), stray are names of disabled skills it still mentions.
exported maps each exported name to its skill, or to the skills that export it.