Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 170 additions & 0 deletions .claude/skills/pr/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
name: pr
description: Create a pull request for EmbodiChain following the project's PR template and conventions
---

# EmbodiChain Pull Request Creator

This skill guides you through creating a pull request that follows the EmbodiChain project's PR template and contribution guidelines.

## Usage

Invoke this skill when:
- You have completed a feature, bug fix, or other change and want to create a PR
- You want to ensure the PR follows the project's conventions
- You need help drafting a proper PR description

## Steps

### 1. Check Current State

First, check the current git status and changes:

```bash
git status
git diff HEAD
```

### 2. Determine Change Type

Based on the changes made, select one of these PR types:

- **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**

### 3. Draft the PR Description

Write a description that includes:

- **Summary**: A clear, concise summary of the change
- **Issue reference**: Which issue is fixed (e.g., "Fixes #123")
- **Motivation and context**: Why this change is needed
- **Dependencies**: List any dependencies required for this change

### 4. Run Code Formatting

Before creating the PR, ensure code is formatted:

```bash
black .
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The repo contributor docs pin the formatter version (black==24.3.0 in CONTRIBUTING.md and AGENTS.md), but this skill only says black .. To avoid formatter diffs/noise, consider mentioning the pinned version (or pointing to pyproject/CONTRIBUTING for the required black version).

Suggested change
black .
black . # use the black version pinned in CONTRIBUTING.md (black==24.3.0)

Copilot uses AI. Check for mistakes.
```

If formatting changes were made, commit them first:

```bash
git add -A
git commit -m "Format code with black"
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

Step 4 recommends committing formatting changes as "Format code with black", but Step 6 says to use conventional commits. If conventional commits are desired, the formatting commit example should follow the same convention (or clarify that conventional commits are optional).

Suggested change
git commit -m "Format code with black"
git commit -m "style: format code with black"

Copilot uses AI. Check for mistakes.
```

### 5. Create or Update Branch

If not already on a feature branch:

```bash
git checkout -b <branch-name>
```

Recommended branch naming:
- `fix/<description>` - for bug fixes
- `feat/<description>` - for new features
- `enhance/<description>` - for enhancements
- `docs/<description>` - for documentation changes

### 6. Commit Changes

Commit with a clear message following conventional commits format:

```bash
git commit -m "type(scope): brief description

Detailed description of the change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
```
Comment on lines +80 to +86
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

This example commit message instructs adding a specific Co-Authored-By: Claude Opus 4.6 ... trailer, but that convention isn’t mentioned elsewhere in the repo (and the project PR template doesn’t request it). Consider removing it or making it optional/generic so contributors aren’t required to attribute a specific model/version.

Copilot uses AI. Check for mistakes.

### 7. Push to Remote

```bash
git push -u origin <branch-name>
```

### 8. Create the PR

Use the gh CLI with the proper PR template:

```bash
gh pr create --title "<PR Title>" --body "<PR Body>"
Comment on lines +96 to +99
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

gh pr create --title "..." --body "..." is awkward for a multi-line Markdown body (requires heavy shell escaping and is easy to get wrong). Prefer gh pr create --body-file <file> or running gh pr create interactively so an editor opens with the PR template, then paste/fill the body there.

Suggested change
Use the gh CLI with the proper PR template:
```bash
gh pr create --title "<PR Title>" --body "<PR Body>"
Use the gh CLI and fill in the PR body using the template in your editor:
```bash
gh pr create --title "<PR Title>"

Copilot uses AI. Check for mistakes.
```

## PR Template

Use this template for the PR body:

```markdown
## Description

<!-- Clear summary of the change -->

This PR [briefly describe what the PR does].

<!-- Include motivation and context if needed -->
[Add any relevant motivation and context here].

<!-- List dependencies if applicable -->
Dependencies: [list any dependencies required]

<!-- Reference the issue -->
Fixes #<issue-number>

## Type of change

<!-- Select one and delete the others -->
- [x] 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

## Screenshots

<!-- Attach before/after screenshots if applicable -->

## Checklist

- [x] 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](https://claude.com/claude-code)
```
Comment on lines +102 to +143
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The PR body template embedded here diverges from the repository’s actual PR template at .github/PULL_REQUEST_TEMPLATE.md (different headings, adds checkbox “Type of change” items, and includes an extra Claude Code attribution line that isn’t in the repo template). To ensure PRs truly follow project conventions, either copy the repo template verbatim or reference it instead of maintaining a separate template here.

Copilot uses AI. Check for mistakes.

## PR Title Guidelines

- Keep titles short (under 70 characters)
- Use present tense and imperative mood
- Examples:
- "Fix KeyError when 'add' mode not present in observation_manager"
- "Add support for XYZ sensor"
- "Improve contact sensor data buffer"

## Quick Reference

| Command | Purpose |
|---------|---------|
| `git status` | Check current state |
| `git diff HEAD` | Show changes |
| `black .` | Format code |
| `git checkout -b branch-name` | Create branch |
| `git push -u origin branch` | Push to remote |
| `gh pr create` | Create PR |

## Notes

- Keep PRs small and focused. Large PRs are harder to review and merge.
- It's recommended to open an issue and discuss the design before opening a large PR.
- The checklist in the PR template should be completed honestly.
- Remember to include the Claude Code attribution at the bottom of the PR body.
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,25 @@ A `CLAUDE.md` file is present at the root of this repository. Claude Code reads
What could cause this and how should it be fixed?
```

**Create a pull request**

After you've made your changes and committed them, use the `/pr` command to create a pull request:

```
> /pr
```

This will guide you through:
1. Checking the current git state and changes
2. Determining the PR type (bug fix, enhancement, new feature, etc.)
3. Drafting a proper PR description following the project template
4. Running code formatting with `black .`
5. Creating a properly named feature branch
6. Committing changes with a conventional commit message
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

This workflow introduces “conventional commit message” as a requirement, but the repo’s existing contribution guidance in AGENTS.md doesn’t mention conventional commits (it only requires using the PR template/checklist). Consider aligning the docs (either add conventional-commit guidance to AGENTS.md too, or soften this to “use a clear commit message”).

Suggested change
6. Committing changes with a conventional commit message
6. Committing changes with a clear, descriptive commit message (conventional commit style is supported but not required)

Copilot uses AI. Check for mistakes.
7. Pushing to remote and creating the PR via `gh` CLI

The `/pr` skill ensures your PR follows the EmbodiChain contribution guidelines and populates the required checklist items.
Comment on lines +109 to +110
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The /pr workflow claims it "populates the required checklist items", but the skill documentation only guides the user and doesn’t actually auto-fill the repo PR template/checklist. Suggest rewording to avoid overstating behavior (e.g., "helps you draft a PR and complete the checklist").

Copilot uses AI. Check for mistakes.

### Tips

* Always run `black .` after Claude Code generates or edits Python files — Claude Code can do this for you if you ask.
Expand Down
Loading