git-context
Skill1 starsChanged 56 days agoApache-2.0View on GitHub
Patterns for working with git branches, remotes, diffs against the default branch, and rebases. Use when resolving rebase conflicts, continuing interactive rebases, amending commits, or any git operation that would open an interactive editor.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jellydn/my-ai-toolstheir own version, first seen Sep 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jellydn/my-ai-tools★ 122same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository51 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agentic-workflowsSkill
- asking-questionsSkill
- branch-context-consumerSkill
- broSkill
- browser-accessSkill
- browser-controlSkill
- changeset-scopeSkill
- check-skill-updatesSkill
- chillSkill
- cleanup-unnecessary-variablesSkill
- code-reviewSkill
- decision-modelsSkill
- diagnoseSkill
- effect-principlesSkill
- evidence-firstSkill
- gh-stackSkill
- github-development-rulesetsSkill
- github-repository-setupSkill
- grillingSkill
- handoffSkill
- herdr-workflowsSkill
- home-assistant-frontendSkill
- home-assistant-lazy-contextSkill
- home-assistant-list-componentsSkill
- home-assistant-lit-renderingSkill
- human-step-guideSkill
- import-external-skillSkill
- lit-renderingSkill
- maintain-docsSkill
- opencode-effectSkill
- pitchfork-dev-serversSkill
- pkexec-rootSkill
- planSkill
- release-oxlint-rulesSkill
- remove-single-use-functionsSkill
- researchSkill
- retroSkill
- safe-process-signalsSkill
- session-coordinationSkill
- shared-workflowsSkill
- show-meSkill
- skill-prefixesSkill
- staged-implementationSkill
- task-focusSkill
- testingSkill
- to-questionnaireSkill
- types-enforce-tsSkill
- wranglerSkill
- writing-dot-skillsSkill
- writing-styleSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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
- Distinctive: line 10
Use this skill when working with branches, remotes, or comparing changes.
- Very specific: line 22
When <branch-context> is present:
- Distinctive: line 24
Use it as the primary source for branch analysis.
- Very specific: line 25
Use <work-scope> instead of rebuilding scope with separate git commands.
- Very specific: line 26
Avoid re-running git/gh commands unless the user asks for a fresh snapshot.
- Very specific: line 44
Prefer upstream as the comparison remote when present, otherwise origin.
- Distinctive: line 48
Prefer the installed helpers over rebuilding default-branch operations with ad-hoc shell commands:
- Distinctive: line 61
If a PR exists for the branch:
- Distinctive: line 85
Read each conflicted file and understand both sides.
- Distinctive: line 86
When both sides are additive (independent features touching the same location), keep both.
- Distinctive: line 87
After replacing conflict markers, verify full method/function bodies are intact — shared code between conflict markers is easily lost if …
- Distinctive: line 100
Use this when a branch is too large and needs to be split into stacked branches with predictable file counts.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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 Context Patterns
Use this skill when working with branches, remotes, or comparing changes.
Plugin-first branch context
BranchContextPlugin precomputes branch and scoped-work context for branch-oriented commands and scoped cleanup/type commands. It injects a <branch-context> block with tagged sections:
<branch-metadata>for default remote/branch resolution and base-ref identity<status>for compactgit status -sboutput<work-scope>for current work scope in this order: unstaged, staged, then branch diff<pull-request>for PR metadata and check output on branch-focused commands when available<warnings>for collection caveats, fallbacks, and missing data
When <branch-context> is present:
- Use it as the primary source for branch analysis.
- Use
<work-scope>instead of rebuilding scope with separate git commands. - Avoid re-running
git/ghcommands unless the user asks for a fresh snapshot. - For commands that require
BranchContextPluginscope, stop and report a plugin issue if context is missing instead of rebuilding scope.
Command-line context
For ad-hoc work without current injected context, load context-cli and use its repository snapshot workflow. That skill owns Context command options and output handling.
These commands do not replace a required plugin injection. If context is unavailable during ad-hoc work, report that limitation and use only the Git reads needed for the task:
git diff
git diff --cached
git remote
git symbolic-ref refs/remotes/<remote>/HEAD
gh repo view --json defaultBranchRef -q .defaultBranchRef.name
git diff <remote>/<default-branch>...HEADPrefer upstream as the comparison remote when present, otherwise origin.
Default branch helpers
Prefer the installed helpers over rebuilding default-branch operations with ad-hoc shell commands:
git-default-refis the guarded resolver used by all helpers. It prefersupstream, falls back toorigin, verifies local<remote>/HEADagainst the advertised default, and fetches it. A missing or mismatched ref requires human confirmation; underdot is-agentor without a TTY it fails instead of prompting.git-switch-default(gsd) switches to the resolved default branch and fast-forwards it.git-rebase-default(grd) rebases the checked-out branch onto the resolved default with--autostash.git-diff-default(gdd) diffs the resolved default branch's merge base againstHEAD.git-log-default(gld) lists commits inHEADthat are not in the resolved default branch.graprints a status message and runsgit rebase --abort.
These commands are stowed from scripts/.local/bin/; the aliases are defined in zsh/.zshrc.
Checking PR Status
If a PR exists for the branch:
gh pr view # Read description
gh pr checks # Check CI status, find failing checks
gh pr diff # See what's in the PRRebases and Interactive Editor Operations
Git opens an interactive editor for many operations. Since the agent runs in a non-interactive shell, bypass the editor with GIT_EDITOR=true (which makes the "editor" succeed immediately, accepting defaults).
Commands that need GIT_EDITOR=true
GIT_EDITOR=true git rebase --continue # After resolving conflicts
GIT_EDITOR=true git merge --continue # After resolving merge conflicts
GIT_EDITOR=true git revert --continue # After resolving revert conflictsFor any requested commit amendment, load dot-git-commit and use its dot git-commit --amend gateway flow instead of raw git commit --amend.
Resolving rebase conflicts
- Read each conflicted file and understand both sides.
- When both sides are additive (independent features touching the same location), keep both.
- After replacing conflict markers, verify full method/function bodies are intact — shared code between conflict markers is easily lost if not carefully included in the resolution.
- Stage resolved files with
git add. - Continue with
GIT_EDITOR=true git rebase --continue.
Operations that do NOT need the editor bypass
git rebase --abort/git merge --abort(no editor involved)git rebase --skip(no editor involved)
Ordinary commits are outside this skill. Load dot-git-commit after an explicit commit request and use its gateway.
Splitting a branch by changed files
Use this when a branch is too large and needs to be split into stacked branches with predictable file counts.
- Preferred helper script:
git-split-branch-by-files - Location:
~/.local/bin/git-split-branch-by-files - Naming: always
<source-branch>-b1,<source-branch>-b2, and so on
Default behavior:
- Splits against
origin/HEAD(fallbackdev,main, thenmaster) - Creates 5 branches by default
- Makes the first 4 branches equal in changed-file count by default (
--equal-up-to 4) - Puts any remainder into the tail branches
Typical commands:
# Preview only
git-split-branch-by-files --source <branch> --base <base> --branches 5 --equal-up-to 4 --dry-run
# Recreate output branches if they already exist
git-split-branch-by-files --source <branch> --base <base> --branches 5 --equal-up-to 4 --forceSafety notes:
- Requires a clean worktree for real execution.
- Uses stacked output branches where each next branch is based on the previous split branch.
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.

