daledesilva/obsidian_ink / .agents/skills/pr
pr
VerifiedPush the current branch and open a pull request into the default base branch using gh, linking ClickUp tasks.
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
PR host repo (forks)
Always open PRs against the repository that origin points to (this checkout / your account), not against an upstream parent unless the user explicitly asks to contribute upstream.
- Resolve once at the start:
ORIGIN_URL=$(git remote get-url origin) # Normalize to owner/name (strip scheme, host, .git, trailing slash) ORIGIN_REPO=$(printf '%s\n' "$ORIGIN_URL" | sed -E 's#^git@[^:]+:##; s#^https?://[^/]+/##; s#\.git$##; s#/$##') - Use that host for all
ghcalls in this command:gh repo view "$ORIGIN_REPO" --json defaultBranchRef,nameWithOwnergh pr list --repo "$ORIGIN_REPO" …gh pr view --repo "$ORIGIN_REPO" …gh pr create --repo "$ORIGIN_REPO" …
- Do not choose the PR host from bare
gh repo view/gh pr createwith no repo argument — on forks that often selects the parent (upstream). - After create, confirm the PR URL’s
owner/namematches$ORIGIN_REPO. If it does not, stop and fix before updating ClickUp.
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 tracking- Resolve
$ORIGIN_REPO(see PR host repo), thengh repo view "$ORIGIN_REPO" --json defaultBranchRef,nameWithOwner— default base branch on origin - 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 --repo "$ORIGIN_REPO" --json url,number,state 2>/dev/nullorgh pr list --repo "$ORIGIN_REPO" --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 (always pass
--repo "$ORIGIN_REPO"):
gh pr create --repo "$ORIGIN_REPO" --base <base> --head <branch> --title "<title>" --body "$(cat <<'EOF'
<body>
EOF
)"
-
After the PR is created, update each linked ClickUp task:
- Move it to the list's Review status/column (resolve the exact Review status when needed).
- Save the PR URL in the custom PR field: resolve the field with
clickup_get_custom_fields(match namePR, ignoring case; prefer URL type), then setcustom_fields: [{ id: <PR field id>, value: <PR URL> }]viaclickup_update_task. - Prefer ClickUp MCP
clickup_update_taskfor both the status and the PR field in one update when possible. - Leave status unchanged if the task is already in Review or a later review/done status, but still set or refresh the PR field.
- If MCP is unavailable, the Review status cannot be resolved, or the PR field cannot be resolved/updated, report that clearly and ask the user to finish those steps manually.
-
Report the PR URL, title, base branch,
--repo/ origin host, commit count, ClickUp tasks linked, ClickUp tasks moved to Review, PR field updates, and any warnings (no ClickUp tasks found, MCP unavailable, skipped push, status or PR-field update failed, wrong host, 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
- Host repo (
--repo/ originowner/name) - Number of commits included
- ClickUp tasks linked (IDs + URLs)
- ClickUp tasks moved to Review (IDs + status), or why they were not moved
- ClickUp PR custom field updates (IDs + URL), or why they were not set
- Any warnings
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |