Create Pr Flow
npx machina-cli add skill avi1234/claude-team-plugins/create-pr-flow --openclawFiles (1)
SKILL.md
1.3 KB
You are helping me with a complete PR workflow. Follow these steps:
1. Check Branch Safety
- Get current branch
- If "main" or "master", STOP with error
2. Run Definition of Done
{YOUR_LINT_COMMAND}{YOUR_BUILD_COMMAND}{YOUR_TEST_COMMAND}{YOUR_FORMAT_COMMAND}
If any check fails, STOP and report the error. Do not proceed.
3. Commit and Push
- Stage all changes
- Generate meaningful commit message from staged diff
- Commit and push to remote
4. Create or Find PR
- Check if PR exists for current branch
- If no PR:
- Extract ticket from branch name (e.g., {YOUR_TICKET_PREFIX}-12345)
- Use $ARGUMENTS as title if provided, otherwise generate:
<ticket>: <summary> - Generate PR body with summary and key modifications
- Create PR and extract PR number
5. Check CI
- Check pipeline status for current repo + branch
- If running: poll 60s intervals, max 15 attempts (display "waiting...")
- If failed: show logs, ask for fixes, commit/push after confirmation, re-check
- If success: report "CI passed"
6. Show Final Status
- Display PR URL, state, and CI status
Notes
- Stop on any command failure and report error
- Keep me informed at each step
Source
git clone https://github.com/avi1234/claude-team-plugins/blob/main/team1-plugin/skills/create-pr-flow/SKILL.mdView on GitHub Overview
Create Pr Flow automates the full PR lifecycle: safety checks, running a DoD suite (lint, build, tests, and format), committing and pushing changes, creating or locating a PR, and validating CI before reporting the final status.
How This Skill Works
It first prevents PRs from main by checking branch safety, then runs the DoD commands, stages and commits changes from the diff, and pushes to the remote. It then locates an existing PR or creates a new one using the branch ticket and optional title, and finally polls CI until completion, reporting success or failure with logs.
When to Use It
- When you want a repeatable, branch-driven PR workflow that enforces DoD checks before submission
- When your team uses ticket based branches like feature/ABC-123 and needs automatic PR titles and bodies
- When you need automatic PR creation or reuse and CI status integration in a single flow
- When you want to stop committing directly to main or master and gate changes through PRs
- When you want immediate feedback on CI status and a final PR status summary
Quick Start
- Step 1: Check Branch Safety and run the DoD commands (lint, build, test, format) to validate your changes
- Step 2: Commit and push the changes; the flow will create or find a PR using your branch name and optional title
- Step 3: Monitor CI status; once CI passes the final PR status is shown
Best Practices
- Fill in the actual commands for YOUR_LINT_COMMAND, YOUR_BUILD_COMMAND, YOUR_TEST_COMMAND, and YOUR_FORMAT_COMMAND to match your repo
- Ensure branch names include the ticket prefix to derive PR titles from the branch for consistency
- Keep diffs small so the commit message from the diff is meaningful
- Run the flow locally on a feature branch before raising a real PR
- Review CI logs during failures and fix the code before re-running the flow
Example Use Cases
- Branch feature/ABC-1234-auth-service: automated PR with DoD checks and CI validation
- Branch bug/DEF-5678-typo-fix: single PR with automatic PR body and title
- Branch chore/ABC-8901-code-cleanup: format and lint in DoD before PR
- Branch feature/GHI-2345-adding-api-endpoint: CI polling until success
- Branch fix/JKL-3456-fix-ci-warnings: re-run flow after fixes until CI passes
Frequently Asked Questions
Add this skill to your agents