Skip to content

feat(me): improve create-pr skill with auto update branch detection - #193

Merged
baleen37 merged 3 commits into
mainfrom
fix/remove-pr-trigger-from-release-workflow
Jan 27, 2026
Merged

feat(me): improve create-pr skill with auto update branch detection#193
baleen37 merged 3 commits into
mainfrom
fix/remove-pr-trigger-from-release-workflow

Conversation

@baleen37

@baleen37 baleen37 commented Jan 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Simplify create-pr skill workflow (60→130 lines)
  • Add clear instruction '→ Run: git merge origin/main' when branch is behind
  • Remove NEEDS_UPDATE flag, use direct message instead
  • Auto-detect when update branch is needed

Test plan

  • Tested pr-check.sh shows clear instruction
  • Tested update branch workflow (git merge origin/main)
  • Tested conflict-check.sh
  • Committed and pushed changes
  • Created PR

Summary by CodeRabbit

Release Notes

  • New Features

    • Added explicit base branch option (--base ) for PR creation workflow.
    • Enhanced branch update handling with automatic merge when branch is behind origin.
  • Documentation

    • Reorganized workflow steps with clearer sequencing and naming.
    • Updated PR title/body guidance and auto-merge criteria.
    • Refined example commands and conflict handling instructions.

✏️ Tip: You can customize this high-level summary in your review settings.

baleen37 and others added 3 commits January 27, 2026 12:44
… execution

The pull_request trigger was causing the workflow to run on both:
1. PR merge (pull_request event)
2. The resulting push to main (push event)

This created duplicate executions. Now the workflow only triggers on
push to main branch, which covers both direct pushes and PR merges.

Removed:
- pull_request trigger (lines 7-10)
- Conditional PR merge logic in Release step

The workflow now:
- Triggers only on push to main
- Runs semantic-release to update version files
- Creates a release PR if changes are detected

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jan 27, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request updates the create-pr skill by adding an explicit base branch option to the workflow, reorganizing documentation steps to include an "Update Branch" phase before conflict checks, and refining messaging. A minor script change updates the user-facing message when branches are out of sync.

Changes

Cohort / File(s) Summary
Create-PR Skill Documentation
plugins/me/skills/create-pr/SKILL.md
Reorders workflow steps to add explicit "Update Branch" phase prior to conflict checks; reorganizes Gather Context outputs; updates conflict handling flow with merged merge-and-push logic; refines auto-merge criteria and guidance; updates example commands and Common Mistakes sections to reflect new workflow sequencing.
PR Check Script
plugins/me/skills/create-pr/scripts/pr-check.sh
Updates user-facing message for out-of-sync branch status from "Consider: git merge origin/$BASE" to "→ Run: git merge origin/$BASE" to clarify expected action.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • baleen37/claude-plugins#172: Modifies create-pr skill's conflict-handling documentation and introduces explicit BASE handling in conflict-check flow/scripts.

Poem

🐰 A clearer path the skill now shows,
With base branches—explicit flows!
Steps reordered, messages bright,
Conflicts caught before they bite,
Our create-PR hops just right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main improvement: adding auto update branch detection to the create-pr skill.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@plugins/me/skills/create-pr/SKILL.md`:
- Around line 79-105: The markdown in the "PR Body Template" section of SKILL.md
has fenced code blocks that violate MD031; fix by adding a blank line
immediately before and after each fenced code block (the ```markdown block and
both ```bash blocks) so there is an empty line separating the surrounding text
and headings from the opening and closing ``` fences, ensuring markdownlint
MD031 passes.
🧹 Nitpick comments (1)
plugins/me/skills/create-pr/SKILL.md (1)

30-38: Clarify how --base argument overrides auto-detected BASE.

The --base <branch> argument is documented in line 18, but the workflow examples use $BASE without showing how the override works. Consider adding a note that when --base is provided, it should be used instead of the auto-detected value from pr-check.sh.

Comment on lines 79 to 105
**PR Body Template:**
```markdown
## Summary
- Change 1 (from commits)
- Change 2 (from commits)
- Change 1
- Change 2

## Test plan
- [x] Tests pass
- [x] Manual verification
```

**After PR creation (NO_PR/MERGED):**
If `--automerge` flag passed:
**After PR creation (if --automerge):**
```bash
gh pr merge --auto --squash
```

## Auto-Merge (Optional)

**Default:** Don't auto-merge. Let CI run first.

Ask user after PR creation: "Wait for CI and merge automatically? (yes/no)"
Default: Don't auto-merge. Ask user: "Wait for CI and merge automatically? (yes/no)"

If **yes**:
If yes:
```bash
gh run watch # Wait for CI
gh run view --json conclusion,state # Confirm passed
gh run watch
gh run view --json conclusion,state
# If passed, ask: "CI passed. Merge with squash? (y/n)"
gh pr merge --squash --delete-branch # Only if confirmed
gh pr merge --squash --delete-branch
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix markdownlint MD031 violations: add blank lines around fenced code blocks.

The static analysis tool flagged missing blank lines before code blocks at lines 80, 91, and 100. Per coding guidelines, markdownlint should pass.

📝 Proposed fix
 **PR Body Template:**
+
 ```markdown
 ## Summary
 - Change 1
 - Change 2

 ## Test plan
 - [x] Tests pass
 - [x] Manual verification

After PR creation (if --automerge):
+

gh pr merge --auto --squash

Auto-Merge (Optional)

Default: Don't auto-merge. Ask user: "Wait for CI and merge automatically? (yes/no)"

If yes:
+

gh run watch
gh run view --json conclusion,state
# If passed, ask: "CI passed. Merge with squash? (y/n)"
gh pr merge --squash --delete-branch
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
**PR Body Template:**

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

80-80: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


91-91: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


100-100: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
In `@plugins/me/skills/create-pr/SKILL.md` around lines 79 - 105, The markdown in
the "PR Body Template" section of SKILL.md has fenced code blocks that violate
MD031; fix by adding a blank line immediately before and after each fenced code
block (the ```markdown block and both ```bash blocks) so there is an empty line
separating the surrounding text and headings from the opening and closing ```
fences, ensuring markdownlint MD031 passes.

@baleen37
baleen37 merged commit 3fb831d into main Jan 27, 2026
2 checks passed
@baleen37
baleen37 deleted the fix/remove-pr-trigger-from-release-workflow branch January 27, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant