Prompt file imported from daledesilva/obsidian_project-browser (
.cursor/commands/pr.md). Copyright stays with the author.
Create pull request
Push the current branch (if needed) and open a pull request into the default base branch (usually main) using gh.
Any text after /pr is optional context — e.g. a ClickUp task ID (/pr 86abc1234), a target base branch hint, or a note about what the PR covers.
Git safety
- NEVER update the git config
- NEVER run destructive/irreversible git commands (push --force, hard reset, etc.)
- NEVER skip hooks (--no-verify, --no-gpg-sign, etc.)
- NEVER force push to main/master — warn and stop if the push would require it
- Do not commit as part of
/pr— if there are uncommitted changes, warn and stop (use/commitfirst) - Never use git commands with the
-iflag - If the branch has no commits ahead of the base branch, report that and stop — do not open an empty PR
Steps
-
Run in parallel:
git status— confirm working tree is clean (or only allow untracked files the user clearly intends to exclude)git branch -vv— current branch and upstream trackinggh repo view --json defaultBranchRef,nameWithOwner— default base branch and repo- Resolve the merge-base base branch: use text after
/prif it names a base (e.g.into develop); otherwise use the repo default (main/master) git log --oneline <base>...HEAD— commits included in the PRgit diff <base>...HEAD— full change set for the conceptual summarygh pr view --json url,number,state 2>/dev/nullorgh pr list --head $(git branch --show-current) --json url,number,state— check for an existing PR on this branch
-
If uncommitted tracked changes exist, stop and tell the user to
/commitfirst. -
If a PR already exists for this branch, report its URL and stop unless the user clearly asked to update it.
-
Collect ClickUp task IDs from (dedupe, preserve order):
- Text after
/pr - The current conversation
- The branch name (e.g.
feat/86abc1234-short-desc) - Commit bodies on
<base>...HEAD— lines matchingClickup Task: <id>(case-insensitive)
- Text after
-
For each ClickUp task ID, resolve link and title:
- Prefer ClickUp MCP
clickup_get_taskwhen available — use the taskurlandnamefrom the response - If MCP is unavailable or lookup fails, use fallback URL
https://app.clickup.com/t/<task_id>and title<task_id>
- Prefer ClickUp MCP
-
Draft the PR:
- Title: One concise line — conceptual what changed, not a file list. Prefer the dominant theme across commits; use
/prhint text when provided. - Body: Use the format below. Summary bullets must describe why and what at a conceptual level (not a file manifest). Commits list must include every commit on
<base>...HEAD, newest first or oldest first — pick oldest-first ( chronological ) so readers follow the story.
- Title: One concise line — conceptual what changed, not a file list. Prefer the dominant theme across commits; use
-
Push if needed:
git pushorgit push -u origin <branch>when no upstream is set. Stop on push failure. -
Create the PR:
gh pr create --base <base> --head <branch> --title "<title>" --body "$(cat <<'EOF'
<body>
EOF
)"
-
After the PR is created, move each linked ClickUp task to the list's Review status/column:
- Resolve the exact Review status when needed.
- Prefer ClickUp MCP
clickup_update_taskwithstatus. - Leave tasks unchanged if they are already in Review or a later review/done status.
- If MCP is unavailable or the Review status cannot be resolved, report that clearly and ask the user to move the task manually.
-
Report the PR URL, title, base branch, commit count, ClickUp tasks linked, ClickUp tasks moved to Review, and any warnings (no ClickUp tasks found, MCP unavailable, skipped push, status update failed, etc.).
PR body format
## Summary
- <Conceptual bullet — what changed and why>
- <Additional bullet if needed; usually 1–3 bullets total>
## Commits
- `<short-hash>` — <full first line of commit message>
- `<short-hash>` — <full first line of commit message>
## ClickUp
- [<task name>](<task url>) — `<task id>`
Summary: Past tense, conceptual, emphasis on why. No file lists or line-level diffs unless essential to explain the change.
Commits: One line per commit from git log <base>...HEAD. Use the abbreviated hash from --oneline (or git log --format=%h).
ClickUp: One line per linked task with markdown link, display name, and task ID in backticks. If no task IDs were found, replace the section with:
## ClickUp
None linked.
Optional test plan
Add a ## Test plan section only when the change has non-obvious verification steps (user flows, device testing, regression areas). Keep it a short checklist.
Output
When done, show:
- PR URL
- PR title
- Base ← head branches
- Number of commits included
- ClickUp tasks linked (IDs + URLs)
- ClickUp tasks moved to Review (IDs + status), or why they were not moved
- Any warnings
