|
| 1 | +--- |
| 2 | +description: ALWAYS use when you are asked to create a pull request. This rule guides generating GitHub PR creation commands to ensure standardized PR structure with proper formatting, comprehensive descriptions, and adherence to commitizen conventions. This rule ensures consistent PR structure with detailed summaries, change lists, and additional notes. |
| 3 | +globs: |
| 4 | +alwaysApply: false |
| 5 | +--- |
| 6 | + |
| 7 | +<critical-rules> |
| 8 | +- Before interpreting the Diff context, execute `git parent` command to dynamically get the base branch which will be used as the value for the `--base` flag. |
| 9 | +- You will NOT use the `run_terminal_cmd` tool, you will generate the command in text format surrounded with ```bash code block. |
| 10 | +</critical-rules> |
| 11 | + |
| 12 | +# GitHub Pull Request Creation Standards |
| 13 | + |
| 14 | +## Critical Rules |
| 15 | + |
| 16 | +- Always use `gh pr create` as the base command |
| 17 | +- Use the `--title` flag with a concise title following the commitizen convention |
| 18 | +- Use the `--body` flag to provide a comprehensive description |
| 19 | +- Structure the PR body with these mandatory sections: |
| 20 | + - `## Summary` - Brief overview of changes |
| 21 | + - `## Changes` - Bullet list of specific modifications |
| 22 | + - `## Additional Notes` - Extra information, limitations, or follow-ups |
| 23 | +- Escape all backticks within the PR body using backslashes (`\``) |
| 24 | +- Never use newline characters in the command itself |
| 25 | +- Always wrap the entire command in a ```bash code block for easy copy-pasting |
| 26 | + |
| 27 | +## Examples |
| 28 | + |
| 29 | +<example> |
| 30 | +User: "Create a pull request based on @PR Diff" |
| 31 | +Agent: Getting the base branch |
| 32 | +```bash |
| 33 | +git parent |
| 34 | +``` |
| 35 | + |
| 36 | +Agent: Analyzing the diff context |
| 37 | + |
| 38 | +```bash |
| 39 | +gh pr create --base <base-branch> --title "feat: implement user authentication" --body "## Summary |
| 40 | + |
| 41 | +Added user authentication functionality using JWT tokens. |
| 42 | + |
| 43 | +## Changes |
| 44 | + |
| 45 | +- Created AuthService for token generation and validation |
| 46 | +- Added login and register endpoints |
| 47 | +- Implemented middleware for protected routes |
| 48 | +- Added unit tests for auth functionality |
| 49 | + |
| 50 | +## Additional Notes |
| 51 | + |
| 52 | +Future work: Add refresh token capability" |
| 53 | +``` |
| 54 | +</example> |
| 55 | + |
| 56 | +<example type="invalid"> |
| 57 | +gh pr create --base main --title "User auth" --body "Added authentication" |
| 58 | + |
| 59 | +// Problems: |
| 60 | +// - Not wrapped in code block |
| 61 | +// - Hardcoded base branch |
| 62 | +// - Insufficient title (not following commitizen) |
| 63 | +// - Inadequate body without proper sections |
| 64 | +</example> |
0 commit comments