Skip to content

Commit bfb31fb

Browse files
Update /pr prompt to always stage, commit, and push changes
1 parent 5ecbfea commit bfb31fb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/prompts/pr.prompt.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ $ARGUMENTS
4848
- **Important**: If the branch contains BOTH code changes AND documentation changes, classify based on the code changes, not the documentation
4949
- **Important**: Check the entire branch diff, not just uncommitted changes or the last commit
5050

51-
3. **Get current branch information**:
52-
- Determine the current branch name
53-
- Verify there are changes to commit (if uncommitted changes exist, stage and commit them first)
54-
- Push the branch to `origin` remote if not already pushed (always push to origin, even in fork mode).
51+
3. **Stage, commit, and push all changes**:
52+
- **ALWAYS run these commands before creating/updating the PR**:
53+
1. `git add .` - Stage all changes (tracked and untracked files)
54+
2. Check if there are staged changes with `git diff --cached --quiet`
55+
3. If there are staged changes, commit with: `git commit -m "Update for PR"`
56+
4. `git push origin <branch-name>` - Push to origin remote (even in fork mode)
57+
- This ensures the PR reflects all local changes
58+
- Get the current branch name for the push command
5559

5660
4. **Retrieve linked issue information** (if available):
5761
- Attempt to find the GitHub issue number associated with the current branch
@@ -121,10 +125,10 @@ $ARGUMENTS
121125
- `/PR Patch` - Create a PR for small improvements
122126
123127
**Notes**:
128+
- **This command always stages all changes (`git add .`), commits if needed, and pushes to origin before creating/updating the PR**
124129
- Changes are always pushed to `origin` remote
125130
- In fork mode, PRs and Issue operations are performed on the `upstream` repository
126131
- In origin mode, all operations use the `origin` repository
127-
- This command commits and pushes changes if there are uncommitted changes
128132
- The PR is always created as a draft to allow for review before marking as ready
129133
- Labels can be manually adjusted after PR creation if needed
130134
- The description should be written from the user's perspective, focusing on impact not implementation

0 commit comments

Comments
 (0)