Receber por email
← Voltar para o catálogo

push-and-pr

Push current branch and create a pull request. Rebase workflow, auto-PR, merge prompt after checks pass. Triggers: "push-and-pr", "/push-and-pr", "push and pr", "create pr", "сделай пр"

11estrelas
Atualizado há 3 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add DefaultPerson/agent-setup

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/push-and-pr-defaultperson/svg)](https://www.skillteca.com.br/skills/push-and-pr-defaultperson)

Skills relacionadas

Ver todas de Segurança →

Alerta por categoria

Receba novas skills de Segurança toda segunda

1 email curto, só com as skills novas de Segurança. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Context

  • Status: !git status
  • Branch: !git branch --show-current
  • Remote: !git remote -v
  • Unpushed commits: !git log @{u}..HEAD --oneline 2>/dev/null || echo "No upstream set"

Git Rules

  • Trunk-based development with rebase (linear history)
  • PR title = Conventional Commit format, ≤72 chars
  • PR description: what / why / how to test / risks
  • PR base always main, merge strategy: Rebase and merge
  • --force-with-lease only on personal feature branches after rebase
  • Use gh for all GitHub operations
  • Large PRs (>400 LOC) — consider splitting

Algorithm

  1. Guard: git status — ensure working tree is clean (everything committed).
  2. If on main: ask user (AskUserQuestion): "You're on main. Push directly or create a feature branch for PR?"
  3. Push directly: git push origin main → output "Pushed to main." STOP.
  4. Create branch: help create feature branch, switch to it, then continue.
  5. If on feature branch: continue.
  6. Sync: git fetch origin → git rebase origin/main → git push -u origin HEAD --force-with-lease.
  7. PR:
  8. Check if PR exists: gh pr view --json number — if exists, just push updates.
  9. Create: gh pr create --base main --head <current-branch>.
  10. Title: Conventional Commit format.
  11. Body: what / why / how to test / risks.
  12. Checks: gh pr checks --watch — if failing, diagnose and fix, re-push.
  13. Review: Review using repo's PR template/checklist if present.
  14. Merge: All checks green → ask user (AskUserQuestion): "Merge and delete branch?"
  15. Yes: gh pr merge --rebase → git switch main && git pull origin main → git branch -D <branch> && git push origin --delete <branch>.
  16. No: output PR link and stop.
  17. Output: PR link, check statuses, summary of what was done.

Act immediately — no confirmation needed (except merge step).

Compartilhar X LinkedIn