add-functor

Add EmbodiChain functors for observations, rewards, events, actions, datasets, or randomizations.

206|20|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/DexForce/EmbodiChain --skill add-functor
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-functor
Source: https://github.com/DexForce/EmbodiChain/tree/main/skills/add-functor
Command: npx skills add https://github.com/DexForce/EmbodiChain --skill add-functor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of adding new EmbodiChain environment logic—such as observations, rewards, events, actions, datasets, or randomizations—without breaking the Functor/FunctorCfg architecture.

Core Features & Use Cases

  • Functor type selection: Choose the correct manager (observations, rewards, events, actions, datasets, or randomization) based on what you’re adding.
  • Correct function vs class scaffolding: Use function-style for stateless functors and class-style for stateful functors following the required call signatures.
  • Integration steps that match EmbodiChain conventions: Place the functor in the right module, update __all__, and create a test using mocks for deterministic validation.
  • Use cases: Adding a new observation term for sensor outputs, implementing a reward shaping component for RL training, introducing an event handler to react to environment state, or creating a randomization that perturbs physics/visual/spatial/geometry for Sim2Real.

Quick Start

Ask to add a new reward functor named "my_reward" to RewardManager, registered via RewardCfg using function-style, and include a test plan for validating the expected (num_envs,) output shape.

Frequently Asked Questions about add-functor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new observation functor to an embodied AI environment?▼

To add an observation functor, you select the correct manager, scaffold it as a stateless function or stateful class, register it via FunctorCfg, and place it in the corresponding module file.

What is the best way to implement reward shaping components for RL training?▼

The best way to implement reward shaping components is by scaffolding a new reward functor registered via RewardCfg, ensuring it adheres to manager-specific signatures and outputs the expected tensor shapes.

How do I create randomizations for Sim2Real transfer without breaking environment logic?▼

You create randomizations for Sim2Real by adding a randomization functor that perturbs physics, visual, spatial, or geometry properties, registering it correctly to maintain the Functor architecture.

When should I use a function-style versus a class-style functor for environment behavior?▼

Use function-style functors for stateless environment behavior and class-style functors for stateful logic, ensuring both follow the required call signatures for their specific manager integration.

How do I test new environment functors to ensure correct tensor shapes?▼

You test new environment functors by creating test scaffolding using mocks for deterministic validation, ensuring the functor adheres to manager-specific call semantics and returns correct tensor shapes.

Can I introduce event handlers to react to environment state changes in EmbodiChain?▼

Yes, you can introduce event handlers by adding a new event functor to the correct manager, updating the module exports, and validating its call semantics and tensor shapes with mock tests.