git-and-pr-workflow
Skill0 starsChanged 4 months agoMITView on GitHub
Guides safe Git branches, atomic commits, rebases, conflicts, pull requests, and post-merge cleanup. Use when branching, staging or committing, tidying local history, resolving conflicts, or opening or updating a PR; use parallel-worktree-delivery for multi-agent worktree fleets.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-tool-interface-designSkill
- codebase-explorationSkill
- code-reviewSkill
- copilot-cloud-agentSkill
- documentation-maintenanceSkill
- external-skill-reviewSkill
- parallel-worktree-deliverySkill
- planning-and-task-breakdownSkill
- refactoring-and-dead-code-removalSkill
- repository-agent-bootstrapSkill
- requirements-and-spec-writingSkill
- security-reviewSkill
- shadow-architectureSkill
- shadow-dreamSkill
- shadow-driftSkill
- shadow-observeSkill
- skill-creatorSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- verification-disciplineSkill
- wayfinder-planningSkill
- web-research-and-verificationSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
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
- Distinctive: line 13
Run only the requested phase.
- Very specific: line 18
Read instructions; inspect branch, git status --short, worktrees, and ongoing operations.
- Very specific: line 30
Read delivery preflight before delivery-specific validation or installation: bind the whole unpublished range and its gates to the …
- Distinctive: line 38
Never use git add -A or git add ..
- Distinctive: line 39
Before every commit read the full git --no-pager diff --staged, including pre-existing staging.
- Distinctive: line 43
Run change-covering checks and all mandated gates.
- Distinctive: line 45
Use an imperative subject and required trailers.
- Very specific: line 58
No automatic force-push after rebase, no shared-branch force-push, no plain --force.
- Very specific: line 65
Create/update the intended PR without duplicates: what/why, issue links, exact checks/results, risks, and exclusions.
- Distinctive: line 71
Verify the correct PR's merge and fresh refs for unique/unpushed work.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git and PR Workflow
Run only the requested phase; loading/advice authorizes no Git or remote mutation. Repository rules apply.
Establish state
- Read instructions; inspect branch,
git status --short, worktrees, and ongoing operations. Record owned paths, base/remote, and authorized actions; do not assumemain/origin. Serialize shared-checkout mutations and recheck state. - Stay on an existing task branch. Never switch, pull, stash, commit, or overwrite another owner's live work to get a clean checkout.
- New branch only when requested:
git switch -c <topic> <base>from a verified base in an available clean checkout; otherwise use an approved worktree or report a blocker. Read worktrees and conflicts for isolation. Fetch relevant refs only when remote freshness is needed.
Delivery preflight, when delivery enters scope
Read delivery preflight before delivery-specific validation or installation: bind the whole unpublished range and its gates to the authorized target/base/head, preserving ownership and mandatory protections. Skip this for local-only work; local installation is not publishing approval.
Commit
- Review owned changes; stage one logical group by explicit paths/hunks.
Never use
git add -Aorgit add .. - Before every commit read the full
git --no-pager diff --staged, including pre-existing staging. Check secrets/debug output and scope. Do not commit or unstage another owner's work; stop on an inseparable shared index. Read large diffs in bounded sections, never truncate the review. - Run change-covering checks and all mandated gates; reuse fresh evidence only for unchanged tested inputs/environment. Isolate/serialize writable resources.
- Use an imperative subject and required trailers; read commit message rules when composing/rewording.
Integrate or resolve conflicts
- Integrate the verified base only when needed/requested. Prefer rebase for local-only commits; merge into shared branches. Never rebase/amend/squash published or shared history.
- Resume, not nest, operations. Reconcile both conflict intents; stage explicit
resolved paths, check markers, and validate affected behavior plus required
gates before the matching
--continue. Read worktrees and conflicts for recovery or an authorized--abort; never blindly choose a conflict side. - No automatic force-push after rebase, no shared-branch force-push, no plain
--force.--force-with-leasedoes not authorize rewriting shared history.
Pull request
- Recheck delivery preflight before an authorized normal push to the explicit remote/branch. Stop on unexpected history; do not delete stray commits blindly.
- Create/update the intended PR without duplicates: what/why, issue links, exact checks/results, risks, and exclusions. Read back head/base/URL; creation proves neither passing checks nor merge approval.
Cleanup, only when requested
- Verify the correct PR's merge and fresh refs for unique/unpushed work. Missing remote branches are not proof; for squash merges check PR/resulting content, not ancestry alone.
- Inspect tracked/untracked/ignored work. Remove only unused clean owned
worktrees normally before
git branch -d; never force a refusal. Remote deletion needs authorization and merged/no-unique-work evidence. Return to the base only in an available safe checkout.
Report
Return branch/base, commits, exact checks/results, PR URL/state, and pending actions/blockers. For delivery, include target, head/base SHAs, gate inventory, and readiness scope or invalidation. No unchanged log dump or unperformed-cleanup claim.
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
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.

