From 57cbd0f40dd0308ce2c83b9f62c7ca7db13cc06f Mon Sep 17 00:00:00 2001 From: ElizioMartins Date: Wed, 10 Jun 2026 13:28:19 -0300 Subject: [PATCH] fix: add platform detection for PR/MR creation (issue #1609) - Detect hosting platform from git remote URL before creating PR/MR - Use 'gh pr create' for GitHub repos - Use 'glab mr create' for GitLab repos - Fall back to manual URL for unknown platforms - Includes issue-closing keywords template (Closes #xxx) Fixes the bug where 'gh pr create' was hardcoded and failed on GitLab/Bitbucket/self-hosted repos. --- .../finishing-a-development-branch/SKILL.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/skills/finishing-a-development-branch/SKILL.md b/skills/finishing-a-development-branch/SKILL.md index 7f5337aaf9..700696214a 100644 --- a/skills/finishing-a-development-branch/SKILL.md +++ b/skills/finishing-a-development-branch/SKILL.md @@ -123,6 +123,35 @@ git branch -d ```bash # Push branch git push -u origin + +# Detect hosting platform and create PR/MR +REMOTE_URL=$(git remote get-url origin) +if echo "$REMOTE_URL" | grep -q "github.com"; then + gh pr create --title "" --body "$(cat <<'EOF' +## Summary +<2-3 bullets of what changed> + +Closes #<issue-number> + +## Test Plan +- [ ] <verification steps> +EOF +)" +elif echo "$REMOTE_URL" | grep -qE "gitlab|gitlab.com"; then + glab mr create --title "<title>" --description "$(cat <<'EOF' +## Summary +<2-3 bullets of what changed> + +Closes #<issue-number> + +## Test Plan +- [ ] <verification steps> +EOF +)" +else + echo "Unknown platform — create PR/MR manually at your Git host" + echo "Pushed branch: <feature-branch>" +fi ``` **Do NOT clean up worktree** — user needs it alive to iterate on PR feedback.