Commit, push, and open a PR
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemintgit/<worktree_status>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/worktree-context.sh 2>&1
</worktree_status>
<stack_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/machete-context.sh 2>&1
</stack_context>
<pr_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/pr-context.sh 2>&1
</pr_context>
<context_sources>
Gather context from these sources to populate the PR:
.claude/plans/*.md - Contains the why, design decisions, considerationsgit log origin/main..HEAD - What was actually donegit diff origin/main..HEAD --stat - What files changed<pr_template_detection></context_sources>
<pr_template_detection>
Check for existing PR templates in the repository:
# GitHub PR template locations (check in order)
templates=(
".github/PULL_REQUEST_TEMPLATE.md"
".github/pull_request_template.md"
"PULL_REQUEST_TEMPLATE.md"
"pull_request_template.md"
"docs/PULL_REQUEST_TEMPLATE.md"
".github/PULL_REQUEST_TEMPLATE/default.md"
)
for template in "${templates[@]}"; do
if [[ -f "$template" ]]; then
echo "Found PR template: $template"
break
fi
done
If repository template exists:
Template priority:
Example merge:
Repository template has:
## Description
<!-- Describe your changes -->
## Checklist
- [ ] Tests added
- [ ] Documentation updated
Crew fills in:
## Description
This PR adds user authentication with JWT tokens...
## Checklist
- [x] Tests added
- [x] Documentation updated
</pr_template_detection>
<templates>Select template based on primary commit type:
| Commit Type | Template |
|---|---|
feat | skills/git/templates/pr-feature.md - Full template |
fix | skills/git/templates/pr-fix.md - Bug fix template |
refactor/docs/test | skills/git/templates/pr-refactor.md - Light template |
| Mixed/other | skills/git/templates/pr-default.md - Minimal |
Analyze commits to determine template:
git log origin/main..HEAD --pretty=format:"%s" | head -10
</templates>
<notes>
Writing style per @rules/writing-style.md. Machete patterns per @rules/machete-workflow.md.
</notes>
<process>
Check state: git branch --show-current && git status --short
If on main → create feature branch
Stage & commit: git add . && git commit -m "type(scope): msg"
Gather PR context:
ls .claude/plans/*.md 2>/dev/nullCheck stacking (if branch not in machete layout):
If <stack_context> shows "is NOT in machete layout", ask about stacking FIRST:
// Get available parent branches from machete status or git branches
// Prioritize: open PRs, then branches with recent activity
const parentOptions = [
{ label: "main", description: "Stack directly on main branch" },
// Add other branches from machete layout or open PRs
// e.g., { label: "feat/auth-v2", description: "PR #5097: Auth improvements" }
];
AskUserQuestion({
questions: [
{
question: "Add this branch to a stack?",
header: "Stacking",
options: [
{ label: "No", description: "Create standalone PR against main" },
...parentOptions.slice(0, 3), // Show available parent branches
],
multiSelect: false,
},
],
});
If user selects a parent branch (not "No"), run:
git machete add $(git branch --show-current) --onto <selected-parent>
Note: After PR is created, step 11 will call crew:git:update-pr which runs
git machete github update-pr-descriptions --related to update all parent PRs
with the new stack chain.
AskUserQuestion({
questions: [
{
question: "PR type?",
header: "Type",
options: [
{ label: "Ready for review", description: "Ready to merge" },
{ label: "Draft", description: "Work in progress" },
],
multiSelect: false,
},
{
question: "Enable auto-merge when checks pass?",
header: "Auto-merge",
options: [
{ label: "No", description: "Manual merge required" },
{
label: "Yes",
description: "Auto-merge with squash when checks pass",
},
],
multiSelect: false,
},
],
});
Generate PR body using selected template:
<!-- ... -->) but preserve machete markersCreate PR:
If machete-managed:
git machete github create-pr [--draft]
git machete github anno-prs
If traditional:
git push -u origin $(git branch --show-current)
gh pr create --title "type(scope): description" --body "$(cat <<'EOF'
[Generated PR body from template]
EOF
)" [--draft]
# Get PR number
PR_NUM=$(gh pr view --json number -q '.number')
# Enable auto-merge with squash
gh pr merge $PR_NUM --auto --squash
Note: Auto-merge requires repository to have this feature enabled in settings.
Skill({ skill: "crew:git:update-pr" });
<pr_title_format>
Match the primary commit type:
type(scope): summary of changes</pr_title_format>
<machete_integration>
Machete markers are auto-added when using machete commands.
The update-pr skill called in step 10 handles all machete annotation updates, including:
git machete github anno-prs - Annotate PRs with stack infogit machete github update-pr-descriptions --related - Update all related PRsSee @rules/machete-workflow.md for marker format.
</machete_integration>