Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots.

MITAuto-check passedDevelopment

Install Gap

skills CLI
$ npx skills add graph-robots/graph-as-policy --skill gap -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install graph-robots/graph-as-policy gap --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/graph-robots/graph-as-policy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/skills/gap .claude/skills/gap && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gap
GitHub stars
155
Token cost
~3.3k tokens
SKILL.md length
1,155 words
Files
6 (incl. references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots.

  • Works in 9 steps: Bootstrap / install check → Discover what the robot can do → Run an existing graph in sim → …
  • The user mentions GaP
  • SKILL.md covers SAFETY — standing rules, 0. Bootstrap / install check, 1. Discover what the robot can… and 2. Run an existing graph in sim, plus 7 more sections
  • Calls uv and git; reaches github.com; needs OPENROUTER_API_KEY and HF_TOKEN

What it does

Gap is an agent skill from graph-robots/graph-as-policy. Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots. Use when the user mentions GaP or graph-as-policy, robot manipulation, robot skills, robot tools or capabilities, skill registries, open-robot-skills, LIBERO or MuJoCo manipulation sims, pick-and-place, grasping or perception strategies, generating or hand-authoring robot task graphs, robot benchmarks, or asks what a robot can do. Covers searching registries…

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/authoring-bundles.md`, `references/authoring-graphs.md` and `references/cli.md`).

It sits in Development, covering Project scaffolding, Skill management and Unit testing. The repository describes itself as: gap — graph as policy: compile language instructions into typed, verified robot skill graphs and execute them on simulators or real robots. The licence is MIT.

When your agent uses it

  • The user mentions GaP
  • Graph-as-policy
  • Robot manipulation
  • Skill registries

Example prompts

  • “/gap”

Requirements

  • Python 3
  • A credential in OPENROUTER_API_KEY

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Bootstrap / install check
  2. Discover what the robot can do
  3. Run an existing graph in sim
  4. Compile a graph from language
  5. Author a graph (gap.builder) — the default path
  6. Author a new skill or tool bundle
  7. Create / wire registries
  8. Debug failures
  9. Real robots (human-gated)

What it can do on your machine

Read from SKILL.md and the folder at commit c8b5515. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • OPENROUTER_API_KEY
    • HF_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gap loads about 3.3k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 229 tokens; SKILL.md has 1,155 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~229
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from graph-robots/graph-as-policy at commit c8b5515, republished under its MIT licence (© graph-robots). 1,155 words, ~3,304 tokens.

Download SKILL.mdSave it as .claude/skills/gap/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
gap
description
Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots. Use when the user mentions GaP or graph-as-policy, robot manipulation, robot skills, robot tools or capabilities, skill registries, open-robot-skills, LIBERO or MuJoCo manipulation sims, pick-and-place, grasping or perception strategies, generating or hand-authoring robot task graphs, robot benchmarks, or asks what a robot can do. Covers searching registries (gap registry / gap skills / gap tools), capability checks (gap check), running graphs in sim (gap run --sim), generating graphs from language (gap generate), authoring graphs with gap.builder, creating skill bundles and registries with scaffolded unit tests (gap skills new / gap skills test / gap registry init), debugging traces (gap viz, gap trace-diff), and safety-gated real-robot runs.
license
MIT
metadata.category
robotics
metadata.tags
robotics, manipulation, simulation, skills

graph-as-policy — GaP

GaP compiles robot tasks into typed, verified skill graphs and executes them. The policy is the graph: nodes call tools (perception models, planners, robot motions) or run skill scripts; postcondition checkpoints verify progress against the simulator state. Two kinds of repos exist:

  • the engine (graph-as-policy, imports as gap) — CLI, runtime, builder, codegen, connectors (LIBERO sim / real Franka & UR);
  • skill registries — directories of bundles (skills/<name>/SKILL.md strategies, tools/<name>/SKILL.md model-backed tools). open-robot-skills is the canonical public registry, normally cloned side-by-side with the engine and auto-discovered. Any number of registries layer by precedence.

Ground truth: gap <command> --help is authoritative; references/cli.md here is a generated snapshot. When working inside a checkout, prefer its docs/ (design.md, runtime.md, skills.md, safety.md) over the digests in this skill.

SAFETY — standing rules

  • NEVER run gap run --real ... or gap.connector.real(...) unless the human has explicitly confirmed that specific run in this conversation. Real-robot work requires a human with the E-stop in hand and docs/safety.md read. Do not weaken this gate, ever.
  • Sim-first, always: validate (gap run <graph> --validate-only), then sim (--sim), and only then discuss real hardware.
  • Use --checkpoints raise on anything real; warn (the default) in sim.
  • Never claim a task succeeded without evidence: checkpoint pass in the trace, sim.check_success, or gap benchmark --gate.
  • Never commit API keys or tokens; set them as env vars.

0. Bootstrap / install check

Always start by finding out what exists and what can run:

bash
uv run gap check            # inside a checkout (or just `gap check` if on PATH)
gap check --format json     # machine-readable; parse this when deciding

If the CLI is missing, set up from scratch (Linux; GPU needed for sim):

bash
git clone --recurse-submodules https://github.com/graph-robots/graph-as-policy.git
git clone https://github.com/graph-robots/open-robot-skills.git   # side-by-side
cd graph-as-policy
uv sync --extra quickstart        # engine + sim + sam3/grounding-dino/geometry
uv run gap skills check --download   # verify bundles + prefetch model weights

Gotchas: cloning without --recurse-submodules breaks uv sync ("does not appear to be a Python project") — run git submodule update --init; --extra grocery|all need CUDA_HOME set (cuRobo compiles CUDA at install); sim runs want MUJOCO_GL=egl.

Env vars that matter: OPENROUTER_API_KEY (default codegen provider) / Vertex via gcloud ADC + GOOGLE_CLOUD_PROJECT; GAP_LLM_PROVIDER + GAP_LLM_MODEL pin a non-default provider per shell (vertex also needs uv run --extra vertex); GAP_SKILLS_PATH (colon-separated registry roots); HF_TOKEN (gated weights); GAP_LLM_CACHE_DIR, GAP_LLM_NO_CACHE.

1. Discover what the robot can do

bash
gap registry list                      # active registries, precedence order
gap skills list                        # every bundle (skills + tools) + registry
gap skills table --format markdown     # paste-ready catalog
gap tools list                         # flat tool catalog with live schemas
gap tools show geometry.compute_obb    # full input/output schema + runnability
gap check                              # what is operational HERE + fix hints

gap check is the decision input: a bundle is READY (deps importable, declared GPU/env requirements met) or NOT READY with a fix hint; each skill is READY or BLOCKED by the tool bundles it needs. Apply the fix hints (uv sync --extra X, export KEY=...) before attempting tasks that need those bundles. Resolution precedence for registries: --skills flags > $GAP_SKILLS_PATH > project pyproject [tool.gap].registries > ~/.config/gap/registries.toml > the side-by-side open-robot-skills checkout. Details: references/registries.md.

2. Run an existing graph in sim

bash
MUJOCO_GL=egl uv run gap run examples/libero_quickstart/graph \
    --sim libero_object/0 --checkpoints warn
  • --validate-only first when in doubt — structural validation without a robot.
  • --inputs key=value binds top-level workflow inputs.
  • --record-video (sim only) saves <trace-dir>/run_video.mp4 of the run.
  • Every run writes a trace (dag_trace.json + per-node assets) under --trace-dir (default outputs/run_<timestamp>). Read it for node inputs/outputs, checkpoint results, and failures.
  • gap viz serves an interactive trial browser at localhost:9432.
  • The repo's examples/ each have a README: libero_quickstart (start here), grocery_fulfillment (benchmark-gated), steered_policy, collect_and_train, cable_ur, real_franka_pick_place.

Programmatic equivalent:

python
import gap
conn = gap.connector.sim("libero", task="libero_object/0")
result = gap.execute("examples/libero_quickstart/graph", conn,
                     checkpoints="warn")
print(result.success, result.exit_status, result.trace_path)

3. Compile a graph from language

When this skill is running inside Claude Code, you are the codegen pipeline — do NOT call gap generate. Turning a task into a graph is a §4 hand-authoring job: read the task, pick skills from the active registries, build the nodes with gap.builder, attach checkpoints, and drive gap run --validate-only to a clean pass. You are a stronger model than the one gap generate would dispatch to, and you stay in the loop to fix validation errors — so author directly, don't shell out.

gap generate is the headless path: benchmark grids, cron, or gap.agent.generate_sync() called from code — any run with no interactive model present. It dispatches a coordinator → per-subgraph → checkpoint pipeline to the configured provider's API (--provider/--model; see gap check for what's configured). Reach for it only when there is no Claude in the loop.

bash
# headless only — NOT the path to use from inside Claude Code:
uv run gap generate "pick up the alphabet soup and put it in the basket" \
    --provider openrouter --out outputs/soup
Show full SKILL.md (541 more words)Show less

4. Author a graph (gap.builder) — the default path

This is how you turn a task into a graph. The loop:

  1. Decompose the task into one subgraph per skill it needs (gap skills list). Canonical pick-and-place shape: perceive target → perceive container → grasp → transport.
  2. Read the contracts first — don't guess field names. gap tools show <tool> gives exact input/output fields (what you bind with Ref); each chosen skill's SKILL.md gives its recommended inner state flow and canonical scripts. Mirror them — they are the contract the skill was validated with.
  3. Build the Subgraphs and the top-level Workflow, then write a script file for every type="script" node.
  4. Attach validate=True checkpoints per subgraph so success is verified against sim ground truth, not assumed (a grasp/place with no checkpoint is unverified).
  5. Validate → fix → repeat (gap run --validate-only) until clean, then sim.
python
from gap.builder import Workflow, Subgraph, Ref

sg = Subgraph(name="grasp_sg", skill="grasping-direct-ik")
sg.add_input("target_obb", type_name="OrientedBoundingBox")
sg.add_node("open", type="tool", tool="robot.open_gripper")
sg.add_node("grasp", type="tool", tool="geometry.top_down_grasp_candidates",
            inputs={"obb": Ref("in.target_obb")})
sg.add_exit("grasped")
sg.set_on_error("failed")
sg.add_edge("START", "open"); sg.add_edge("open", "grasp")
sg.add_edge("grasp", "grasped"); sg.add_edge("grasped", "END")

wf = Workflow(name="my_task")
wf.add_subgraph(sg)
wf.add_node("grasp_node", type="subgraph", ref="grasp_sg")
wf.add_node("done", type="end", status="success")
wf.add_edge("START", "grasp_node")
wf.add_conditional_edges("grasp_node", {"grasped": "done", "failed": "done"},
                         router_field="exit")
wf.save("my_graph/workflow.json")

Iterate against the validator until clean — failures cite rule codes (workflow W1–W8, subgraph S1–S11):

bash
uv run gap run my_graph --validate-only

Wire tool names exactly as gap tools list reports them; bind dataflow with Ref("node.field") / Ref("in.<input>"). Add postcondition checkpoints (sg.add_checkpoint(...)) so success is verified, not assumed. Full surface + rule digest: references/authoring-graphs.md.

5. Author a new skill or tool bundle

bash
uv run gap skills new my-skill --kind skill          # or --kind tool
# targets the highest-precedence registry; --registry NAME to choose

The scaffold includes SKILL.md, scripts/example.py (or tools.py), and a unit-test skeleton tests/test_my_skill.py. Then:

  1. Fill SKILL.md: name == dirname; description must contain a "Use when …" sentence (it is the planner's entire view of the bundle); GaP extensions only under the gap: key; declare gap.requires: ({gpu: true, env: [KEY], env_any: [...], weights: true}, or {}) so gap check can vouch for it.
  2. Implement. Skill scripts: def run(ctx, *, typed_kwargs) -> TypedDict, call tools via ctx.tool("bundle.fn", ...), load prompt templates via load_prompt(__package__, name, **vars). Tool bundles: @tool(name="bundle.fn", summary=..., tags=...) with lazy heavy imports — importing tools.py must never import torch (test-enforced).
  3. Declare one pip extra named after the bundle in the registry's pyproject.toml ([] when no deps) and run uv lock.
  4. Test CPU-only with gap.testing.FakeContext (canned tool responses, call assertions) and make_test_observation (synthetic RGB-D); GPU/LLM smokes go behind the gpu/llm markers (deselected by default).
  5. Verify: gap skills check && gap skills test my-skill && gap check.

Full contract, test patterns, PR checklist: references/authoring-bundles.md.

6. Create / wire registries

bash
gap registry init ~/my-lab-skills --name my-lab-skills --add   # new registry
gap registry add lab ~/existing-skills                         # layer existing
gap registry list                                              # inspect

Registries are local directories (clone remote ones yourself). Multiple registries merge; earlier entries shadow same-named bundles (loud warning) — fork-and-shadow one bundle instead of forking the whole public registry. Projects pin their set in pyproject.toml [tool.gap].registries = ["./skills", "../open-robot-skills"].

7. Debug failures

  • Validation errors cite W*/S* rule codes — fix the graph, re-run --validate-only (digest table in references/authoring-graphs.md).
  • Runtime: read dag_trace.json in the trace dir (per-node inputs/outputs/subcalls), or browse with gap viz.
  • Two runs disagree? gap trace-diff <trace_a> <trace_b>.
  • Install/runtime gotchas (submodules, CUDA_HOME, EGL, numpy pin, keys, weights): references/troubleshooting.md. gap check's fix hints are the first stop.

8. Real robots (human-gated)

Only after ALL of: the human explicitly confirmed this exact command in this conversation; the same graph passed in sim; --validate-only is clean; --checkpoints raise; the human has read docs/safety.md (E-stop, clear workspace; robot.go_home is disabled on real robots by design). Reference setups: examples/real_franka_pick_place/ (Franka + Robotiq via robots_realtime), examples/cable_ur/ (UR + ZED, perception-only).

References

  • references/cli.md — generated --help for every command
  • references/registries.md — the registry model + config files
  • references/authoring-graphs.md — builder API, workflow v3, W*/S* rules
  • references/authoring-bundles.md — SKILL.md contract, tests, PR checklist
  • references/troubleshooting.md — failure → fix table, trace anatomy
  • In a checkout: docs/design.md, docs/runtime.md, docs/skills.md, docs/safety.md, examples/*/README.md

© graph-robots, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in agent/skills/gap of graph-robots/graph-as-policy.

  • SKILL.md
  • references/authoring-bundles.md
  • references/authoring-graphs.md
  • references/cli.md
  • references/registries.md
  • references/troubleshooting.md

Open the folder on GitHubat commit c8b5515

Compare with similar skills

Gap next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gap compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gap this skillgraph-robots/graph-as-policy155—~3.3kAutomated safety check: PassMIT
Git Command Class Implementationruby-git/ruby-git1.8k—~3kAutomated safety check: PassMIT
Git::Repository Facade Methodsruby-git/ruby-git1.8k—~3.4kAutomated safety check: PassMIT
Exp Test Maintainabilitydotnet/skills5.6k1 repos~2.5kAutomated safety check: PassMIT
Npx CLIjwynia/agent-skills165—~2.4kAutomated safety check: PassNone
Create Saleor Packagesaleor/apps162—~608Automated safety check: PassCustom licence

Similar skills

  • Scaffolds and reviews `Git::Commands::*` classes in the ruby-git library, with unit tests, integration tests and YARD docs, using the Base command architecture.

    1.8k GitHub stars~3k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Scaffolds and reviews facade methods on Git::Repository in ruby-git, with unit tests, integration tests and YARD documentation.

    1.8k GitHub stars~3.4k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Official

    Detects duplicate boilerplate, copy-paste tests, and structural maintainability issues across .NET test suites.

    5.6k GitHub starsUsed in 1 repo~2.5k tokens
    DevelopmentAuto-check passed
  • Npx CLI

    jwynia/agent-skills

    Build and publish npx-executable CLI tools using Bun as the primary toolchain with npm-compatible output.

    165 GitHub stars~2.4k tokensUpdated 7 mo ago
    DevelopmentAuto-check passed
  • Scaffold a new shared package in the saleor-apps monorepo under ./packages/.

    162 GitHub stars~608 tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Leetcode Py

    wislertt/leetcode-py

    Generates Python LeetCode practice environments and manages a 307-problem catalog with the lcpy CLI.

    142 GitHub stars~1.4k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed

Questions about Gap

What does Gap do?

Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots. Gap is an agent skill from graph-robots/graph-as-policy. Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots.

When should I use Gap?

Gap fits situations like: the user mentions GaP; graph-as-policy; robot manipulation; skill registries.

How do I install Gap in Claude Code?

Run `npx skills add graph-robots/graph-as-policy --skill gap -a claude-code`. Or copy the skill folder (agent/skills/gap in graph-robots/graph-as-policy) into .claude/skills/gap in your project. Claude Code loads it when a task matches its description.

How do I install Gap in Codex?

Run `npx skills add graph-robots/graph-as-policy --skill gap -a codex`. Or copy the skill folder (agent/skills/gap in graph-robots/graph-as-policy) into .agents/skills/gap in your project. Codex loads it when a task matches its description.

Can I use Gap in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add graph-robots/graph-as-policy --skill gap -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gap, .gemini/skills/gap, .github/skills/gap and .opencode/skills/gap in your project.

What does Gap need to run?

Going by SKILL.md and its folder, Gap needs the command-line tools its instructions call (uv and git) and credentials named OPENROUTER_API_KEY and HF_TOKEN. Our summary lists: Python 3; A credential in OPENROUTER_API_KEY.

Does Gap access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Gap safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Gap use?

Gap is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gap use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.7k tokens, read only when the agent opens those files.

What are the alternatives to Gap?

Skills that share tags, products or a category with Gap: Git Command Class Implementation (ruby-git/ruby-git, 1.8k stars), Git::Repository Facade Methods (ruby-git/ruby-git, 1.8k stars), Exp Test Maintainability (dotnet/skills, 5.6k stars) and Npx CLI (jwynia/agent-skills, 165 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gap?

graph-robots (a GitHub organization) maintains it in graph-robots/graph-as-policy, which has 155 GitHub stars. The repository was last updated on September 30, 2026.

Source: graph-robots/graph-as-policy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.