Skip to content

docs: add AI coding agent skills and cross-reference throughout documentation#247

Merged
yuecideng merged 3 commits intomainfrom
docs/add-ai-agent-skills
Apr 28, 2026
Merged

docs: add AI coding agent skills and cross-reference throughout documentation#247
yuecideng merged 3 commits intomainfrom
docs/add-ai-agent-skills

Conversation

@yuecideng
Copy link
Copy Markdown
Contributor

Description

This PR adds built-in AI coding agent skills (Claude Code / Copilot CLI) for common EmbodiChain development tasks and replaces verbose boilerplate examples in AGENTS.md with concise skill references.

Changes

  • New skill files (.claude/skills/): add-functor, add-task-env, add-test, pre-commit-check, pr, benchmark
  • AGENTS.md: Replaced inline code examples for functor scaffolding, test writing, and PR submission with references to the corresponding skills. Added a Skills Quick Reference table.
  • Documentation cross-references: Added contextual tip boxes in 10 doc pages (guides, tutorials, reference pages) pointing developers to relevant skills for their current task.

Skill summary

Skill Command Purpose
Add Task Env /add-task-env Scaffold a new EmbodiedEnv task
Add Functor /add-functor Scaffold observation/reward/event/action/dataset/randomization functors
Add Test /add-test Write tests following project conventions
Pre-Commit Check /pre-commit-check Run all local CI checks before committing
Create PR /pr Create a PR following the project template
Benchmark /benchmark Write benchmark scripts for EmbodiChain modules

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

🤖 Generated with Claude Code

…entation

Add Claude Code / AI agent skill files for common development tasks
(add-functor, add-task-env, add-test, pre-commit-check, pr, benchmark)
and replace verbose boilerplate examples in AGENTS.md with concise skill
references. Add contextual tip boxes in guides, tutorials, and reference
pages pointing developers to relevant skills.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 25, 2026 15:04
@yuecideng yuecideng added docs Improvements or additions to documentation enhancement New feature or request labels Apr 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a set of built-in “skills” for AI coding agents (e.g., Claude Code / Copilot CLI) and updates EmbodiChain documentation to reference those skills instead of repeating long boilerplate snippets.

Changes:

  • Added new .claude/skills/*/SKILL.md documents describing common development workflows (env scaffolding, functors, tests, pre-commit checks).
  • Updated AGENTS.md to point to the skills and added a “Skills Quick Reference” table.
  • Added tip/admonition cross-references to skills across tutorials, guides, and gym overview docs.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/source/tutorial/modular_env.rst Adds an RST tip linking to relevant skills for modular env workflows.
docs/source/tutorial/basic_env.rst Adds an RST tip pointing readers to env/test/pre-commit skills.
docs/source/quick_start/install.md Adds an “AI Coding Agent” section listing available skills/commands.
docs/source/overview/gym/reward_functors.md Adds a MyST tip pointing to /add-functor and /add-test.
docs/source/overview/gym/observation_functors.md Adds a MyST tip pointing to /add-functor and /add-test.
docs/source/overview/gym/event_functors.md Adds a MyST tip pointing to /add-functor and /add-test.
docs/source/overview/gym/env.md Adds a MyST tip summarizing key env-related skills.
docs/source/overview/gym/dataset_functors.md Adds a MyST tip pointing to /add-functor for dataset functors.
docs/source/overview/gym/action_functors.md Adds a MyST tip pointing to /add-functor for action terms.
docs/source/guides/add_robot.rst Adds an RST tip cross-referencing skills relevant to robot extensions.
AGENTS.md Replaces verbose examples with skill references and adds a quick reference table.
.claude/skills/pre-commit-check/SKILL.md New skill doc for local CI-style checks before committing.
.claude/skills/add-test/SKILL.md New skill doc describing EmbodiChain test conventions and patterns.
.claude/skills/add-task-env/SKILL.md New skill doc for scaffolding new task environments.
.claude/skills/add-functor/SKILL.md New skill doc for adding observation/reward/event/action/dataset/randomization functors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| Benchmark | `/benchmark` | Write benchmark scripts for EmbodiChain modules |

Run `/pre-commit-check` before every commit to catch formatting, header, annotation, and export issues locally — the same checks the CI pipeline enforces.
```
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a stray Markdown code fence (), which will start an unclosed code block at end-of-file and can break/garble the rendered page in the Sphinx/MyST build. Remove the trailing or replace it with the intended content.

Suggested change
```

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
Comment on lines +112 to 115
Managers (observation, event, reward, randomization) use a `Functor`/`FunctorCfg` pattern with two styles:

- **Function-style**: a plain function with signature `(env, env_ids, ...) -> None`.
- **Class-style**: a class inheriting `Functor`, with `__init__(cfg, env)` and `__call__(env, env_ids, ...)`.
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Functor/Manager section states function-style functors have signature (env, env_ids, ...) -> None, but reward/observation functors in this codebase take (env, obs, ...) / (env, obs, action, info, ...) and return tensors (see embodichain/lab/gym/envs/managers/rewards.py and observations.py). Please adjust this documentation to describe signatures as manager-specific (or point readers to the /add-functor skill’s signature table).

Copilot uses AI. Check for mistakes.
Comment thread .claude/skills/add-task-env/SKILL.md Outdated
Comment on lines +3 to +9
description: Use before committing or creating a PR for EmbodiChain to verify code style, headers, annotations, exports, and docstrings pass CI checks
---

# Pre-Commit Check

Run all local checks that the CI pipeline enforces, catching issues before pushing.

Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This skill claims these are "checks that the CI pipeline enforces", but the CI workflow only runs Black, pytest, and the Sphinx docs build (.github/workflows/main.yml). Headers/__future__/__all__/docstring checks are useful conventions, but they aren’t currently enforced by CI—please reword to avoid misleading users about what will fail CI vs what is best-practice guidance.

Copilot uses AI. Check for mistakes.
|-------|---------------|
| Black formatting | `black --check --diff --color ./` |
| Auto-fix formatting | `black .` |
| Header check | Verify first line is `# ---...---` |
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quick reference says the header check is to verify the first line is # ---...---, but earlier in this doc the actual required first line is shown as # ----------------------------------------------------------------------------. Please make these consistent to avoid false positives when users follow the checklist.

Suggested change
| Header check | Verify first line is `# ---...---` |
| Header check | Verify first line is `# ----------------------------------------------------------------------------` |

Copilot uses AI. Check for mistakes.
yuecideng and others added 2 commits April 28, 2026 16:31
Co-authored-by: Copilot <copilot@github.com>
@yuecideng yuecideng marked this pull request as ready for review April 28, 2026 16:32
Copilot AI review requested due to automatic review settings April 28, 2026 16:32
@yuecideng yuecideng merged commit 06258f1 into main Apr 28, 2026
1 check passed
@yuecideng yuecideng deleted the docs/add-ai-agent-skills branch April 28, 2026 16:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CONTRIBUTING.md

If you want to implement your tasks in a new repo and with some customized functors and utilities, you can also use the [Task Template Repo](https://github.com/DexForce/embodichain_task_template). No newline at end of file
* For large features, break the work into small, focused tasks and handle them one at a time using the appropriate skill for each step.
* If you add a new skill to `.claude/skills/`, make sure to also add it to the Skills table and "When to use each skill" list in this document so contributors can discover it. No newline at end of file
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The <details> block opened above is never closed. This can cause the remainder of the rendered page (or following sections) to be swallowed into the details element depending on the Markdown renderer. Add a closing </details> tag at the end of the Claude Code section (after the Tips list).

Suggested change
* If you add a new skill to `.claude/skills/`, make sure to also add it to the Skills table and "When to use each skill" list in this document so contributors can discover it.
* If you add a new skill to `.claude/skills/`, make sure to also add it to the Skills table and "When to use each skill" list in this document so contributors can discover it.
</details>

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
Comment on lines +112 to 116
Managers (observation, event, reward, randomization) use a `Functor`/`FunctorCfg` pattern with two styles:

- **Function-style**: a plain function with signature `(env, env_ids, ...) -> None`.
- **Class-style**: a class inheriting `Functor`, with `__init__(cfg, env)` and `__call__(env, env_ids, ...)`.
- Registered in a manager config via `FunctorCfg(func=..., params={...})`.

Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Functor signature guidance here is inaccurate for several of the listed managers. Observation functors typically take (env, obs, entity_cfg, ...) and return a tensor, and reward functors take (env, obs, action, info, ...) and return a tensor; (env, env_ids, ...) -> None is primarily for event/randomization-style functors. Please update the bullets to either (a) list signatures per manager type, or (b) describe the pattern without hardcoding the env_ids/None signature.

Copilot uses AI. Check for mistakes.
Comment on lines +134 to +137
2. **test** job: `pytest tests`
3. **build** job: Sphinx docs build

This skill covers items 1 and 2 locally. Docs build is heavier and typically only needed for documentation changes.
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section describes CI as running linttestbuild, but .github/workflows/main.yml runs lint, then (on PRs) runs build and test in parallel after lint (and test is PR-only). Please update this list to reflect the actual workflow so contributors aren’t misled about which jobs run when and in what order.

Suggested change
2. **test** job: `pytest tests`
3. **build** job: Sphinx docs build
This skill covers items 1 and 2 locally. Docs build is heavier and typically only needed for documentation changes.
2. After **lint** passes, PRs run these jobs in parallel:
- **build** job: Sphinx docs build
- **test** job: `pytest tests`
This skill helps you run the local checks that most closely match CI, especially `lint` and targeted test runs before opening a PR. Docs build is heavier and typically only needed for documentation changes.

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +30
Tests mirror the source tree under `tests/`:

```
embodichain/lab/sim/solvers/pytorch_solver.py → tests/sim/solvers/test_pytorch_solver.py
embodichain/lab/gym/envs/managers/rewards.py → tests/gym/envs/managers/test_reward_functors.py
embodichain/toolkits/graspkit/pg_grasp/foo.py → tests/toolkits/test_pg_grasp.py
embodichain/lab/gym/envs/tasks/rl/push_cube.py → tests/gym/envs/tasks/test_push_cube.py
```

Rules:
- File name: `test_<module>.py`
- Directory path mirrors `embodichain/` structure under `tests/`
- Create `__init__.py` files in new `tests/` subdirectories if needed
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “Tests mirror the source tree under tests/” / “Directory path mirrors embodichain/ structure” guidance is not accurate for the current repo layout (e.g., embodichain/lab/... tests live under tests/sim, tests/gym, etc., and some toolkits collapse into a single test module). Consider rewording this to match the established structure (grouped by top-level domain like tests/gym, tests/sim, tests/agents, tests/toolkits) and recommend locating the nearest existing test file/directory for the module being changed rather than implying a strict 1:1 path mirror.

Copilot uses AI. Check for mistakes.
| Benchmark | `/benchmark` | Write benchmark scripts for EmbodiChain modules |

Run `/pre-commit-check` before every commit to catch formatting, header, annotation, and export issues locally — the same checks the CI pipeline enforces.
```
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra closing triple-backtick at the end of this page (after the /pre-commit-check paragraph). This leaves an unterminated/stray code fence in the rendered Markdown and is likely to break the Sphinx/MyST docs build. Remove the trailing ``` or convert the surrounding content into a properly opened+closed code block if that was the intent.

Suggested change
```

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants