agentleFS
GRIDLOCK-NYCGRIDLOCK-NYC/claude-skills/skills/update-pr/SKILL.md

update-pr

Skill0 starsChanged 7 months agoMITView on GitHub

Auto-commit dirty working tree, push feature branch, and create or update the GitHub PR with an auto-generated description. One command to go from uncommitted changes to an up-to-date PR. Use when user says 'update my PR', 'update the PR', 'push and update PR', 'refresh PR', 'sync my PR', 'create a PR', 'open a PR', 'push my changes', 'get my PR up to date', 'rebase and push', 'push to the PR', 'PR update', or 'ship it'. Do NOT use for reviewing PRs, reading PR comments, or merging PRs.

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use native-nostalgia-stack, software-engineering-excellence and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • frostneySkill

    native-nostalgia-stack

    Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.

    Also in 3 projects that use this

  • frostneySkill

    software-engineering-excellence

    Applies the user's engineering standards during substantial technical work: preserve scope, use current evidence, delegate independent parts, and complete authorized outcomes. Use during substantial implementation, debugging, refactoring, or multi-part delivery work.

    Also in 3 projects that use this

  • withpiperSkill

    roadmap-review

    Audit roadmap health — issues, dependency order, spec coverage, doc freshness. Use when speccing a new initiative. Use when /phase-plan output looks suspicious. Use before /roadmap-create reruns.

    Also in 3 projects that use this

  • Model Context ProtocolSkill

    project-structure

    Where things live in the Inspector repo — which client owns which surface, what is in core/ versus clients/web, and what each top-level directory is for. Use when locating code, deciding where a new module belongs, or answering which package owns or contains a given area of the codebase.

    Also in 3 projects that use this

  • ReinaMacCredySkill

    codebase-audit

    Deep codebase audit that first reads project docs (AGENTS.md, README.md) and investigates the architecture, then systematically finds hardcoded constants that should be dynamic and unfinished code (TODOs, "will"/"would" in comments). Use this skill when the user wants a thorough code review for hygiene issues, asks to find hardcoded values, wants to audit for TODOs or incomplete code, says things like "audit this codebase", "find hardcoded stuff", "what's unfinished", "find tech debt", "code hygiene check", or asks you to look across the whole project for issues. Also use when the user asks to understand a project before making changes, or wants a comprehensive health check of their codebase.

    Also in 3 projects that use this

  • sahinSkill

    create-issue

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

19 rules. 0 are common, 15 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    NEVER push to main: Never checkout main. Never modify main.

    line 20
  2. Distinctive:

    NEVER force push: If a push is rejected after rebase, tell the user to run the force push manually outside Claude Code (supply-chain-guard …

    line 21
  3. Distinctive:

    Auto-commit is the default: If there are uncommitted changes, commit them automatically.

    line 22
  4. Distinctive:

    If the branch is main or master, STOP.

    line 30
  5. Very specific:

    Run git diff origin/main...HEAD --name-only and git diff --name-only to understand all changes in this branch + uncommitted work.

    line 34
  6. Very specific:

    Check which of these files exist at the project root: CLAUDE.md, TASKS.md, SESSION.md, ARCHITECTURE.md.

    line 35
  7. Distinctive:

    CLAUDE.md: Add new patterns, dependencies, or workflow notes introduced this branch.

    line 37
  8. Distinctive:

    ARCHITECTURE.md: Update only if structural changes were made (new modules, changed data flow, new integrations).

    line 40
  9. Distinctive:

    If the working tree is clean (no output), skip to Step 4 (Rebase).

    line 46
  10. Very specific:

    If there are changes: a. Review the list of changed/untracked files.

    line 47
  11. Distinctive:

    If conflicts occur, STOP. List conflicting files.

    line 59
  12. Distinctive:

    If rejected (non-fast-forward — typical after rebasing a previously-pushed branch):

    line 64
  13. Distinctive:

    Do NOT attempt force push.

    line 65
  14. Distinctive:

    Run these in parallel:

    line 71
  15. Very specific:

    If gh pr view found an open PR:

    line 82
  16. Distinctive:

    If no open PR exists for this branch:

    line 91
  17. Distinctive:

    On main/master: Stop. Tell user to create a feature branch.

    line 130
  18. Distinctive:

    Rebase conflicts: Stop. List files. Provide resolve/abort commands.

    line 131
  19. Distinctive:

    Push rejected: Stop. Provide manual force-push command.

    line 132

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Update PR

Important

  • NEVER push to main. Never checkout main. Never modify main. Only push the current feature branch. If on main, stop immediately.
  • NEVER force push. If a push is rejected after rebase, tell the user to run the force push manually outside Claude Code (supply-chain-guard blocks it).
  • Auto-commit is the default. If there are uncommitted changes, commit them automatically. Do not ask, do not stop.
  • Commits use Co-Authored-By — PR descriptions do NOT.

Instructions

Step 1: Validate Branch

  1. Run git branch --show-current.
  2. If the branch is main or master, STOP. Tell the user: "You're on main. Check out a feature branch first."

Step 2: Refresh Project Docs

  1. Run git diff origin/main...HEAD --name-only and git diff --name-only to understand all changes in this branch + uncommitted work.
  2. Check which of these files exist at the project root: CLAUDE.md, TASKS.md, SESSION.md, ARCHITECTURE.md.
  3. For each file that exists, read it and update based on what changed:
    • CLAUDE.md: Add new patterns, dependencies, or workflow notes introduced this branch. Remove stale instructions that no longer apply.
    • TASKS.md: Mark completed tasks as done. Add any new tasks discovered during the session.
    • SESSION.md: Overwrite with a concise summary of what was done this session (what changed, decisions made, blockers hit).
    • ARCHITECTURE.md: Update only if structural changes were made (new modules, changed data flow, new integrations).
  4. Skip any file where nothing meaningful changed. Don't touch files that don't exist — never create them.

Step 3: Auto-Commit

  1. Run git status --short.
  2. If the working tree is clean (no output), skip to Step 4 (Rebase).
  3. If there are changes: a. Review the list of changed/untracked files. Skip any that look like secrets (.env, *.pem, credentials, tokens). b. Stage relevant files by name — do NOT use git add -A or git add .. c. Read the staged diff to understand what changed. d. Generate a concise commit message (imperative mood, focused on why not what). e. Commit with the Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> trailer. f. Report: "Committed: <message> (<N> files)"

Step 4: Rebase on Main

  1. Run git fetch origin main.
  2. Run git rebase origin/main.
  3. If conflicts occur, STOP. List conflicting files. Tell the user to resolve (git rebase --continue or git rebase --abort).

Step 5: Push to Remote

  1. Run git push -u origin <branch-name>.
  2. If rejected (non-fast-forward — typical after rebasing a previously-pushed branch):
    • Do NOT attempt force push.
    • Tell the user: "Push rejected — rebase rewrote history. Run this manually: git push --force-with-lease origin <branch>"
    • STOP.

Step 6: Gather Context

Run these in parallel:

  1. git log origin/main..HEAD --format="%h %s" --reverse — commit list since branching.
  2. git diff origin/main...HEAD --stat — file-level diffstat.
  3. git log origin/main..HEAD --format="%b" --reverse — commit bodies for detail.
  4. gh pr view --json number,title,url,state 2>/dev/null — check for existing open PR.

Analyze the commits to understand the overall change.

Step 7a: Update Existing PR

If gh pr view found an open PR:

  1. Generate an updated title (under 70 characters) reflecting ALL commits, not just the latest.
  2. Generate a PR body using the format below. Incorporate the argument context if provided.
  3. Run gh pr edit <number> --title "<title>" --body "$(cat <<'EOF' ... EOF)".
  4. Report: "PR #N updated: <url>"

Step 7b: Create New PR

If no open PR exists for this branch:

  1. Generate a title (under 70 characters) from the full commit history.
  2. Generate a body using the format below. Incorporate the argument context if provided.
  3. Run gh pr create --base main --title "<title>" --body "$(cat <<'EOF' ... EOF)".
  4. Report: "PR created: <url>"

PR Description Format

## What & Why

<1-3 sentences: what changed and why it matters. Lead with impact, not implementation.>

## Changes

- <structural change 1 — what component/layer was affected>
- <structural change 2>

## Blast Radius

- <what systems/workflows this touches>
- <downstream effects or dependencies affected>

## Test Plan

- [ ] <concrete verification step>

Rules for the PR body

  • What & Why: One breath. No "This PR..." openers.
  • Changes: Structural, not per-commit. Group related commits logically.
  • Blast Radius: Think like an operator. What could break?
  • Test Plan: Actionable. Not "it works."
  • No "Generated by Claude" or "Co-Authored-By" lines in PR descriptions.

Error Handling

  1. On main/master: Stop. Tell user to create a feature branch.
  2. Rebase conflicts: Stop. List files. Provide resolve/abort commands.
  3. Push rejected: Stop. Provide manual force-push command.
  4. gh not authenticated: Tell user to run gh auth login.
  5. No commits ahead of main: Tell user branch is up to date with main, nothing to PR.
  6. PR already merged/closed: Tell user. Offer to create a new PR if there are new commits.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.