home / skills / codyswanngt / lisa / git-submit-pr

This skill pushes the current branch, creates or updates a pull request with a full description, and enables auto-merge for faster review.

npx playbooks add skill codyswanngt/lisa --skill git-submit-pr

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.6 KB
---
name: git-submit-pr
description: This skill should be used when pushing changes and creating or updating a pull request. It verifies the branch state, pushes to remote, creates or updates a PR with a comprehensive description, and enables auto-merge.
allowed-tools: ["Bash", "mcp__github__create_pull_request", "mcp__github__get_pull_request", "mcp__github__update_pull_request"]
---

# Submit Pull Request Workflow

Push current branch and create or update a pull request. Optional hint: $ARGUMENTS

## Workflow

### Check current state

!git status
!git log --oneline -10

### Apply these requirements

1. **Branch Check**: Verify not on `dev`, `staging`, or `main` (cannot create PR from protected branches)
2. **Commit Check**: Ensure all changes are committed before pushing
3. **Push**: Push current branch to remote with `-u` flag and the following environment variable - GIT_SSH_COMMAND="ssh -o ServerAliveInterval=30 -o ServerAliveCountMax=5"
4. **PR Management**:
   - Check for existing PR on this branch
   - If exists: Update description with latest changes
   - If not: Create PR with comprehensive description (not a draft)
5. **Auto-merge**: Enable auto-merge on the PR using `gh pr merge --auto --merge`

### PR Description Format

Include in the PR description:

- **Summary**: Brief overview of changes (1-3 bullet points)
- **Test plan**: How to verify the changes work correctly

### Never

- use `--force` push without explicit user request
- create PR from protected branches (dev, staging, main)
- skip pushing before PR creation

## Execute

Execute the workflow now.

Overview

This skill automates pushing a feature branch and creating or updating a pull request with a clear, actionable description. It validates branch and commit state, pushes to the remote with a resilient SSH command, and ensures the PR is configured for auto-merge. The result is a reliable, policy-compliant submit workflow for TypeScript projects using GitHub CLI.

How this skill works

The skill inspects the current git status and recent commits, confirms you are not on protected branches (dev, staging, main), and verifies there are no uncommitted changes. It pushes the current branch to the remote using GIT_SSH_COMMAND to keep SSH connections alive, then checks for an existing PR on that branch. If a PR exists, it updates the description with the latest summary and test plan; if not, it creates a new non-draft PR and enables auto-merge via the GitHub CLI.

When to use it

  • After finishing work on a feature branch and before merging to mainline
  • When you need a consistent PR description that includes summary and test plan
  • To ensure pushes use a resilient SSH command and avoid transient SSH drops
  • When you want the PR auto-merge enabled after required checks pass

Best practices

  • Do not run this from protected branches (dev, staging, main); switch to a feature branch first
  • Commit all local changes before invoking the workflow to avoid incomplete pushes
  • Review and edit the generated PR description to add context or reviewers as needed
  • Avoid --force pushing unless you explicitly intend to rewrite history and confirm with an argument
  • Keep the summary to 1–3 bullet points and include a concise test plan for reviewers

Example use cases

  • Submit a bugfix branch: validate branch, push, create PR with summary and test steps
  • Update an open PR after additional commits: push and refresh the PR description with the newest changes
  • Create a feature PR and enable auto-merge so the merge runs automatically once checks pass
  • Ensure CI flakiness is reduced by using the resilient SSH command during push operations

FAQ

What happens if I run this on main or dev?

The skill aborts and instructs you to switch to a non-protected feature branch; PR creation from protected branches is blocked.

Will it force-push my branch?

No. The workflow never uses --force by default; it only supports force push if you explicitly request it.

How does auto-merge get enabled?

After creating or updating the PR, the skill calls gh pr merge --auto --merge to enable auto-merge so the PR merges when all checks and required reviews are satisfied.