diff --git a/.claude/skills/pr/SKILL.md b/.claude/skills/pr/SKILL.md new file mode 100644 index 00000000..59c3d3b6 --- /dev/null +++ b/.claude/skills/pr/SKILL.md @@ -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 . +``` + +If formatting changes were made, commit them first: + +```bash +git add -A +git commit -m "Format code with black" +``` + +### 5. Create or Update Branch + +If not already on a feature branch: + +```bash +git checkout -b +``` + +Recommended branch naming: +- `fix/` - for bug fixes +- `feat/` - for new features +- `enhance/` - for enhancements +- `docs/` - 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 " +``` + +### 7. Push to Remote + +```bash +git push -u origin +``` + +### 8. Create the PR + +Use the gh CLI with the proper PR template: + +```bash +gh pr create --title "" --body "" +``` + +## PR Template + +Use this template for the PR body: + +```markdown +## Description + + + +This PR [briefly describe what the PR does]. + + +[Add any relevant motivation and context here]. + + +Dependencies: [list any dependencies required] + + +Fixes # + +## Type of change + + +- [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 + + + +## 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) +``` + +## 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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8958fba..c8ce9852 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 +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. + ### Tips * Always run `black .` after Claude Code generates or edits Python files — Claude Code can do this for you if you ask.