-
Notifications
You must be signed in to change notification settings - Fork 3.9k
add claude pr review skills #4946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
816a2e4
3bd13a1
c159c12
cc12fd4
847bb41
495e2c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # IsaacLab Agent Skills Overview | ||
|
|
||
| This directory contains automated workflow skills for the `isaac-sim/IsaacLab` repository. | ||
| Each skill is a self-contained `SKILL.md` file that an agent reads and executes. | ||
|
|
||
| ## Skill Index | ||
|
|
||
| | Skill | Trigger phrase | SKILL.md | | ||
| |-------|---------------|----------| | ||
| | `isaaclab-issue-triage` | `"Run the issue triage workflow for issue #N"` | `skills/isaaclab-issue-triage/SKILL.md` | | ||
| | `isaaclab-bug-reproduce` | Called internally by triage | `skills/isaaclab-bug-reproduce/SKILL.md` | | ||
| | `isaaclab-bug-fix` | Called internally by reproduce, or `"Fix issue #N and open a PR"` | `skills/isaaclab-bug-fix/SKILL.md` | | ||
| | `isaaclab-pr-respond` | `"Address review comments on PR #N"` | `skills/isaaclab-pr-respond/SKILL.md` | | ||
| | `isaaclab-pr-resolve-conflicts` | `"Resolve merge conflicts on PR #N"` | `skills/isaaclab-pr-resolve-conflicts/SKILL.md` | | ||
|
|
||
| --- | ||
|
|
||
| ## When to use which skill | ||
|
|
||
| ``` | ||
| A GitHub issue is filed | ||
| └─► isaaclab-issue-triage | ||
| ├─ Not a bug / missing info → comment & stop | ||
| └─ Valid bug report | ||
| └─► isaaclab-bug-reproduce | ||
| ├─ Cannot reproduce → comment & stop | ||
| ├─ Fixed on latest develop → comment, close & stop | ||
| └─ Still broken on latest | ||
| └─► isaaclab-bug-fix | ||
| ├─ Search open/merged PRs for existing fix | ||
| │ ├─ Open PR found → comment pointing to it & stop | ||
| │ ├─ Merged PR found → comment "already fixed on develop" & stop | ||
| │ └─ No prior PR → Branch → fix → test → changelog → pre-commit → PR → comment on issue | ||
|
|
||
|
|
||
| A PR is open and has reviewer comments | ||
| └─► isaaclab-pr-respond | ||
| ├─ Question | ||
| │ └─ Post a direct reply | ||
| ├─ Improvement request | ||
| │ └─ Implement → pre-commit → commit → push → reply with hash | ||
| └─ New issue reported by reviewer | ||
| ├─ Recent PR already fixes it | ||
| │ └─ Comment pointing to that PR & stop | ||
| └─ No prior fix found | ||
| ├─ Related to current PR & small scope | ||
| │ └─ Fix in current PR branch → commit → push → reply | ||
| └─ Unrelated or would make PR too large | ||
| └─► isaaclab-bug-fix (new branch + separate PR) | ||
| └─ Reply with link to new PR | ||
|
|
||
|
|
||
| A PR has merge conflicts with its target branch | ||
| └─► isaaclab-pr-resolve-conflicts | ||
| ├─ Already mergeable → report & stop | ||
| └─ Has conflicts | ||
| ├─ Rebase onto target branch (default) | ||
| │ └─ For each conflict: read both sides → resolve → stage → continue | ||
| └─ Rebase irrecoverable → fall back to merge commit | ||
| └─ pre-commit → tests → force-push → comment on PR | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Skill Details | ||
|
|
||
| ### `isaaclab-issue-triage` | ||
| **When:** A GitHub issue is opened or needs processing. | ||
| **What it does:** | ||
| 1. Fetches open bug issues from `isaac-sim/IsaacLab`. | ||
| 2. Validates required fields (steps to reproduce, commit hash). | ||
| 3. Routes: comments requesting missing info, or hands off to `isaaclab-bug-reproduce`. | ||
|
|
||
| ### `isaaclab-bug-reproduce` | ||
| **When:** Called by `isaaclab-issue-triage` once a valid bug report is confirmed. | ||
| **What it does:** | ||
| 1. Checks out the commit reported in the issue (falls back to latest `develop`). | ||
| 2. Runs the reproduction steps. | ||
| 3. If reproducible, re-tests on the latest `develop` commit. | ||
| 4. Routes: comments "cannot reproduce", closes as "fixed on latest", or hands off to `isaaclab-bug-fix`. | ||
|
|
||
| ### `isaaclab-bug-fix` | ||
| **When:** A bug is confirmed to still reproduce on `develop`; or when directly asked to fix an issue and open a PR. | ||
| **What it does:** | ||
| 1. Searches open and recently merged PRs for an existing fix (by issue number and keywords); comments and stops if one is found. | ||
| 2. Creates a branch `isaaclab-bot/fix-issue-<N>` from `develop`. | ||
| 3. Implements the fix following `AGENTS.md` coding standards. | ||
| 4. Writes a regression test (verified to fail without the fix). | ||
| 5. Updates the changelog and bumps the version in `extension.toml`. | ||
| 6. Runs pre-commit (`./isaaclab.sh -f`) until clean. | ||
| 7. Commits, pushes, opens a PR, and comments on the original issue. | ||
|
|
||
| ### `isaaclab-pr-respond` | ||
| **When:** A PR has reviewer comments that need to be addressed. | ||
| **What it does:** | ||
| Categorizes each comment and acts accordingly: | ||
| - **Question** → posts a direct reply. | ||
| - **Improvement** → implements the change, commits on the PR branch, replies with the commit hash. | ||
| - **New issue** → searches recent merged/open PRs for an existing fix first: | ||
| - If found: comments pointing to that PR. | ||
| - If not found and in-scope: fixes it in the current PR branch. | ||
| - If not found and out-of-scope / too large: opens a dedicated new PR via `isaaclab-bug-fix` logic. | ||
|
|
||
| ### `isaaclab-pr-resolve-conflicts` | ||
| **When:** A PR has merge conflicts with its target branch (e.g., `develop`) and cannot be merged. | ||
| **What it does:** | ||
| 1. Checks out the PR branch and fetches the latest target branch. | ||
| 2. Rebases the PR branch onto the target (preferred) or falls back to a merge commit. | ||
| 3. For each conflict: reads both sides, understands intent from git log, resolves manually. | ||
| 4. Runs pre-commit and the affected tests. | ||
| 5. Force-pushes with `--force-with-lease`. | ||
| 6. Posts a comment on the PR listing each resolved conflict. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you consider forcing the agent to use https://github.com/anthropics/claude-code/tree/main/plugins/pr-review-toolkit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,207 @@ | ||
| --- | ||
| name: isaaclab-bug-fix | ||
| description: Fix a reproduced IsaacLab bug by creating a branch, implementing the fix, updating changelogs, running pre-commit, and opening a PR following project guidelines. Use when a bug has been reproduced and needs a code fix, or when asked to fix an issue and create a pull request. | ||
| --- | ||
|
|
||
| # IsaacLab Bug Fix | ||
|
|
||
| Implement a fix for a reproduced bug, following all IsaacLab contribution guidelines. | ||
|
|
||
| ## Inputs | ||
|
|
||
| - **Issue number**: GitHub issue `#N` | ||
| - **Issue title and description**: For PR context | ||
| - **Reproduction steps and error**: From the reproduce phase | ||
| - **Affected code location**: Identified during reproduction | ||
|
|
||
| ## Workflow | ||
|
|
||
| ### Step 0: Check for an existing PR or branch that already addresses the issue | ||
|
|
||
| Before creating anything, search for open and recently merged PRs that may already fix this issue: | ||
|
|
||
| ```bash | ||
| # Search open PRs by issue number and keywords from the issue title | ||
| gh pr list --repo isaac-sim/IsaacLab --state open --limit 50 \ | ||
| --json number,title,body,headRefName \ | ||
| | jq '.[] | select(.body | test("#<NUMBER>"; "i"))' | ||
|
|
||
| gh search prs --repo isaac-sim/IsaacLab --state open \ | ||
| "<keyword1> <keyword2>" --limit 20 \ | ||
| --json number,title,body,headRefName | ||
|
|
||
| # Search recently merged PRs (last 60 days) | ||
| gh pr list --repo isaac-sim/IsaacLab --state merged --limit 100 \ | ||
| --json number,title,body,mergedAt \ | ||
| | jq '.[] | select(.body | test("#<NUMBER>"; "i"))' | ||
|
|
||
| gh search prs --repo isaac-sim/IsaacLab --state merged \ | ||
| "<keyword1> <keyword2>" --limit 20 \ | ||
| --json number,title,body,mergedAt | ||
|
Comment on lines
+24
to
+40
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This forces users to have the github cli. The agent will find a work around, but maybe we could be explicit about it? |
||
| ``` | ||
|
|
||
| Use multiple keyword searches drawn from the issue title, error message, and affected file/class names to maximize coverage. | ||
|
|
||
| For each candidate, confirm overlap by reading its diff: | ||
| ```bash | ||
| gh pr diff <CANDIDATE_PR_NUMBER> --repo isaac-sim/IsaacLab | ||
| ``` | ||
|
|
||
| **Decision:** | ||
|
|
||
| ``` | ||
| Existing PR found? | ||
| ├─ YES — open PR already addresses this issue | ||
| │ └─ Comment on the issue pointing to the open PR, then STOP: | ||
| │ gh issue comment <NUMBER> --repo isaac-sim/IsaacLab \ | ||
| │ --body "This appears to be addressed in PR #<OTHER> (_<title>_). Tracking there." | ||
| ├─ YES — merged PR already contains the fix | ||
| │ └─ Comment on the issue that the fix is already on develop, then STOP: | ||
| │ gh issue comment <NUMBER> --repo isaac-sim/IsaacLab \ | ||
| │ --body "This was fixed in PR #<OTHER> (merged <DATE>). The fix is available on \`develop\`." | ||
| └─ NO — no existing PR → proceed to Step 1 | ||
|
Comment on lines
+53
to
+62
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the agent still check if he can repro the issue? on the branch / develop. Sometimes, the fix is not complete |
||
| ``` | ||
|
|
||
| ### Step 1: Create a feature branch | ||
|
|
||
| ```bash | ||
| git checkout origin/develop | ||
| git checkout -b isaaclab-bot/fix-issue-<NUMBER> | ||
| ``` | ||
|
|
||
| Branch naming: `isaaclab-bot/fix-issue-<NUMBER>` (e.g. `isaaclab-bot/fix-issue-1234`). | ||
|
|
||
| ### Step 2: Implement the fix | ||
|
|
||
| Follow the coding standards defined in `AGENTS.md` and `docs/source/refs/contributing.rst`. Read both files before implementing. | ||
|
|
||
| ### Step 3: Write a regression test | ||
|
|
||
| Add a test that: | ||
| 1. **Fails** without the fix (verify by temporarily reverting your change) | ||
| 2. **Passes** with the fix applied | ||
|
|
||
| Use pytest: | ||
| ```bash | ||
| ./isaaclab.sh -p -m pytest <PATH_TO_TEST>::<TEST_METHOD> | ||
| ``` | ||
|
|
||
| ### Step 4: Update the changelog | ||
|
|
||
| Determine which `source/<package>/` directories were modified and update each affected package's changelog. | ||
|
|
||
| 1. Find the current version in `source/<package>/config/extension.toml` | ||
| 2. Bump the **patch** version (e.g. `1.5.0` → `1.5.1`) | ||
| 3. Add a new version entry at the top of `source/<package>/docs/CHANGELOG.rst` | ||
| 4. Update `version` in `source/<package>/config/extension.toml` to match | ||
|
|
||
| Changelog entry format: | ||
|
|
||
| ```rst | ||
| X.Y.Z (YYYY-MM-DD) | ||
| ~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Fixed | ||
| ^^^^^ | ||
|
|
||
| * Fixed <concise description of bug> in :meth:`~package.Class.method`. | ||
| <Brief explanation of the root cause and what was changed.> | ||
| ``` | ||
|
|
||
| Use today's date. Use past tense. Use Sphinx cross-references for class/method names. | ||
|
|
||
| ### Step 5: Run pre-commit | ||
|
|
||
| **CRITICAL: Run BEFORE committing.** | ||
|
|
||
| ```bash | ||
| ./isaaclab.sh -f | ||
| ``` | ||
|
|
||
| If it modifies files, stage them and run again: | ||
| ```bash | ||
| git add -A | ||
| ./isaaclab.sh -f | ||
| ``` | ||
|
|
||
| Repeat until all checks pass. | ||
|
|
||
| ### Step 6: Commit | ||
|
|
||
| Stage only project files — never include skill/agent files in the fix commit: | ||
|
|
||
| ```bash | ||
| git add -A | ||
| git reset HEAD -- .agent/ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The workflow goes straight from "write regression test" to "update changelog" without an explicit step to re-run the original reproduction steps and confirm the bug is actually fixed end-to-end. The "Important Notes" section mentions runtime verification, but it should be a first-class workflow step between Step 3 and Step 4: ### Step 3b: Verify the fix
Re-run the original reproduction steps from the issue to confirm the bug no longer occurs:
```bash
./isaaclab.sh -p <original_repro_command>Also run a short smoke test of the affected workflow (e.g., |
||
| git commit -m "$(cat <<'EOF' | ||
| Fix #<NUMBER>: <short imperative description> | ||
|
|
||
| <What was broken and why. What this commit changes to fix it. | ||
| Wrap at 72 characters.> | ||
| EOF | ||
| )" | ||
| ``` | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would add another step here. By running:
For self review of the code. Doing two rounds with clear context could be good. |
||
| Rules: | ||
| - Imperative mood subject line (~50 chars) | ||
| - No trailing period on subject | ||
| - Body explains what and why | ||
| - **No AI attribution lines** | ||
|
pascal-roth marked this conversation as resolved.
|
||
|
|
||
| ### Step 7: Push and create PR | ||
|
|
||
| ```bash | ||
| git push -u origin HEAD | ||
| ``` | ||
|
Comment on lines
+153
to
+155
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This step issues The same gap exists in:
Consider adding a note to each |
||
|
|
||
| Determine the base branch: use the branch that was checked out in Step 1 (e.g. `develop`, `main`). The PR must target the same upstream branch the fix branch was created from. | ||
|
|
||
| Create PR using the project template: | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 to @AntoineRichard's suggestion about adding a self-review step. After pre-commit but before committing, the agent should review its own changes with fresh context. This could be:
Two rounds of review (implement → review → fix → commit) would catch a lot of issues before human reviewers see the PR. |
||
| ```bash | ||
| gh pr create --repo isaac-sim/IsaacLab --base <BASE_BRANCH> --title "Fix #<NUMBER>: <short description>" --body "$(cat <<'EOF' | ||
| # Description | ||
|
|
||
| <Summary of what the bug was and how it's fixed.> | ||
|
|
||
| Fixes #<NUMBER> | ||
|
|
||
| ## Type of change | ||
|
|
||
| - Bug fix (non-breaking change which fixes an issue) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Suggest adding a note here and at every other # NOTE: Requires dangerouslyDisableSandbox: true for network access
git push -u origin HEADSame applies to:
|
||
|
|
||
| ## Screenshots | ||
|
|
||
| N/A | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) | ||
| - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` | ||
| - [x] I have made corresponding changes to the documentation | ||
| - [x] My changes generate no new warnings | ||
| - [x] I have added tests that prove my fix is effective or that my feature works | ||
| - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file | ||
| - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there | ||
|
|
||
| EOF | ||
| )" | ||
| ``` | ||
|
|
||
| ### Step 8: Post-PR comment on the issue | ||
|
|
||
| ```bash | ||
| gh issue comment <NUMBER> --repo isaac-sim/IsaacLab --body "A fix has been submitted in PR #<PR_NUMBER>. The root cause was <brief explanation>." | ||
| ``` | ||
|
|
||
| ## Important Notes | ||
|
|
||
| - **Isaac Sim source access.** When the bug involves Isaac Sim internals (e.g., errors originating in `isaacsim.*` or `omni.*` modules), use the `_isaac_sim` symlink at the repo root. It points to the Isaac Sim installation and contains the source files. Search and read files under `_isaac_sim/` to understand simulator APIs, verify correct usage, or trace the root cause of issues that cross the IsaacLab–IsaacSim boundary. | ||
| - **Prefer runtime verification over pure code analysis.** After implementing a fix, actually run the affected training scripts, rendering pipelines, or other relevant entry points with minimal step/iteration counts (e.g., `num_steps=10`, `max_iterations=2`) to confirm the fix works end-to-end. Runtime execution catches issues that static analysis misses — wrong tensor shapes, missing assets, device mismatches, simulator state ordering, etc. A short live run provides far stronger confidence that the fix is correct than code inspection alone. | ||
|
|
||
| ## References | ||
|
|
||
| - Coding standards and changelog rules: read `AGENTS.md` | ||
| - Contributing guidelines and code style: read `docs/source/refs/contributing.rst` | ||
| - PR template: read `.github/PULL_REQUEST_TEMPLATE.md` | ||
| - Bug report template: read `.github/ISSUE_TEMPLATE/bug.md` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good index file. Consider adding a Prerequisites section at the top listing shared requirements:
ghCLI installed and authenticated (gh auth status)originremote pointing toisaac-sim/IsaacLabdangerouslyDisableSandbox: truefor any skill that pushes or creates PRsRight now only
isaaclab-issue-triagelists prerequisites — having them centralized avoids repetition and ensures agents always check.