Robotwin

From nssmd/RoboRSI · View interactive version

Robotwin is an AI agent skill from the GitHub repository nssmd/RoboRSI. VLM-authored skill creation. When the existing toolbox can't accomplish what you need, define a new helper function with Python code and register it. After register_skill returns ok=True the function is: - Available in the namespace of subsequent exec_python(code=...) calls (call it like any other b

How to use this skill

Skill file

register_skill · RoboTwin

Example

register_skill(
    name="find_yellow_handle_xyz",
    docstring="Locate the yellow plastic handle of a tool via color HSV "
              "filter + bbox-narrow point cloud + centroid.",
    code='''
def find_yellow_handle_xyz(camera="head_camera", bbox_pad_px=30):
    """Locate yellow handle XYZ via color HSV + bbox cloud centroid."""
    coarse = find_pixel(object="hammer handle")
    if not coarse.get("ok"):
        return {"ok": False, "reason": "find_pixel failed"}
    u, v = int(coarse["u"]), int(coarse["v"])
    seg = segment_object_pointcloud(
        object="hammer", ee_xyz=None, vlm_verify=False)
    if not seg.get("ok"):
        return {"ok": False, "reason": "segment failed"}
    import numpy as np
    cloud = np.asarray(seg["xyz"])
    centroid = cloud.mean(axis=0)
    return {"ok": True, "xyz": centroid.tolist(),
            "n_points": int(len(cloud))}
''',
    test_call_args={"camera": "head_camera"},
)

Why proactive skill creation matters

CaP-X / Rollout evolve skills passively (count occurrences across trials,

promote at threshold). That's a slow flywheel.

This skill makes evolution PROACTIVE: when the VLM realizes mid-task

that a multi-step idiom keeps repeating or that no existing skill quite

fits, it stops, defines the helper, and uses it.

The skill is persisted to ~/.roborsi/data/<task>/_function_library.json

with occurrences=1. Future trials that reach success will increment the

count; ≥2 promotes it into the system prompt's PROMOTED FUNCTIONS section

of every subsequent run.

Sandbox constraints (same as exec_python)

only the one matching name is registered).

at execution time via exec_python's binding mechanism).

functools, collections, operator, traceback, copy, dataclasses.

Failure modes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.