agentleFS
simscalsimscal/sapiens-dtj/.claude/skills/git/SKILL.md

git

Skill0 starsChanged 4 months agoMITView on GitHub

Use for git and GitHub PR operations. Owns the local-git + PR surface — branches (sprint, story, bug, revert, refactor), checkout, commit, push, and PR create/read/list/review/delete. Confirms before mutating ops.

  • Commits and pushes

57 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use sql, databases and 9 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.
  • thechandanbhagatSkill

    sql

    Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.

    Also in 4 projects that use this

  • mrgoonieSkill

    databases

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.

    Also in 3 projects that use this

  • mrgoonieSkill

    devops

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.

    Also in 4 projects that use this

  • MicrosoftSkill

    typescript

    TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.

    Also in 4 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    test

    Also in 8 projects that use this

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 51 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run Confirmation Protocol before mutating ops.

    line 12
  2. Very specific:

    Before any mutating op: summarise all planned mutations in one block, ask once "Proceed?

    line 51
  3. Very specific:

    Remove stop words: a, an, the, and, or, for, to, of, in, on, at, by, with, when, then.

    line 78
  4. Distinctive:

    Keep first 4 remaining words.

    line 79
  5. Very specific:

    Collision: if the derived name exists on remote (check via Check Branch Exists), append -2, -3, etc.

    line 81
  6. Very specific:

    Never hardcode owner/repo — always derive via gh repo view from the codebase directory.

    line 169
  7. Very specific:

    Never write commit message content — the caller provides {message}.

    line 170
  8. Very specific:

    Never write PR or review body content from scratch — render via github-templates.

    line 171
  9. Distinctive:

    Never auto-create missing base branches — stop and surface.

    line 172
  10. Distinctive:

    Never run mutating ops without confirmation, even from a higher-level orchestrator.

    line 173
  11. Very specific:

    Never silently swallow errors other than remote ref does not exist on delete.

    line 174
  12. Distinctive:

    Never operate on a codebase whose path isn't in the Codebases table.

    line 175

“Common” is measured: kept by at least 6 in 10 of the 51 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

Git and PR Operations

Prerequisites: gh CLI installed + authenticated. gh: command not found or auth error → stop and surface, no workarounds.

  • Resolve repo per Repo Derivation — codebases resolve independently.
  • Run Confirmation Protocol before mutating ops.
  • Multi-codebase ops → per codebase → aggregate into one report.

Operation Index

Request shapeSection
Create branch (any kind)Create Branch
Checkout / switch / go to branchCheckout
Branch exists checkCheck Branch Exists
Commit and pushCommit and Push
Delete branch / clean upDelete Branch
Delete all story branchesDelete All Story Branches
Create / open / raise PRCreate PR
Show / view / read PRFetch PR
List PRsList PRs
Approve / LGTM / request changes / reviewSubmit Review
Merge / squash / land PRMerge PR
Diff / compare branchesDiff Branch Files

Placeholders

  • {N} — issue number (#42 → 42). In feature/sprint-{N}, the sprint number.
  • {short-description} — derived per Branch Naming.
  • {branch} / {branch_name} — full branch name from the caller or context.
  • {message} — commit message, provided by the caller.
  • {files} — file paths to stage, provided by the caller.
  • {body} — PR or review body, rendered via the github-templates skill.

Repo Derivation

owner/repo derived at runtime, never hardcoded. Run from inside the codebase directory (path from the Codebases table, never cwd); derive once per codebase and cache.

gh repo view --json owner,name --jq '[.owner.login,.name]|join("/")'

Confirmation Protocol

Before any mutating op: summarise all planned mutations in one block, ask once "Proceed? (y/n)", proceed only if confirmed.

ClassConfirmation
Read-only (list, fetch, check exists, diff)Skip
Create branch, checkout, commit, push, create PR, submit reviewStandard
Delete branch, delete all story branches, force pushAlways, even within a larger flow

Branch Naming

ContextPatternBase branch
Sprintfeature/sprint-{N}main
Storyfeature/issue-{N}-{short-description}feature/sprint-{N}
Bug (production)fix/issue-{N}-{short-description}main
Bug (in-sprint)fix/issue-{N}-{short-description}feature/sprint-{N}
Revertrevert/issue-{N}-{short-description}main
Refactor (standalone)refactor/issue-{N}-{short-description}main
Refactor (in-sprint)refactor/issue-{N}-{short-description}feature/sprint-{N}
Design system (setup)chore/design-systemcodebase default branch

Base fixed by caller, never inferred — caller names which Branch Naming row applies. Standalone bug/refactor → base off main; in-sprint bug/refactor → base off sprint branch.

short-description derivation:

  1. Strip leading [Tag] prefix (e.g. [Story], [Bug]).
  2. Lowercase; replace spaces and special chars with hyphens.
  3. Remove stop words: a, an, the, and, or, for, to, of, in, on, at, by, with, when, then.
  4. Keep first 4 remaining words; trim trailing hyphens.

Collision: if the derived name exists on remote (check via Check Branch Exists), append -2, -3, etc. until unique.

Operations

Create Branch

git checkout {base_branch} && git pull
git checkout -b {new_branch}
git push -u origin {new_branch}

Story branches: confirm the sprint branch exists via Check Branch Exists first; absent → stop and surface, never auto-create. Run the collision check before creating.

Checkout

git checkout {branch_name}
git pull

"Checkout sprint branch" → feature/sprint-{N} for the current sprint.

Check Branch Exists

git ls-remote --exit-code --heads origin {branch_name} — exit 0 = exists (true), exit 2 = not found (false).

Commit and Push

git add {files}
git commit -m "{message}"
git push origin {branch_name}

{message} is caller-provided. Asked to author it → stop and surface: "Commit message authoring is out of scope — provide a message or use a commit-message skill."

Delete Branch

git push origin --delete {branch}

remote ref does not exist → treat as success, skip silently. Any other error surfaces.

Delete All Story Branches

  • gh api --paginate repos/{owner}/{repo}/branches --jq '.[].name'
  • Filter for feature/issue-{N}-*, fix/issue-{N}-*, or revert/issue-{N}-*.
  • Confirm the full delete list, then delete each via git push origin --delete {branch} (skip silently on "remote ref does not exist").
  • Report: count deleted, count skipped, failures.

Create PR

  • gh pr create --repo {owner}/{repo} --title "{title}" --body "{body}" --head {head} --base {base} — returns PR URL.
  • body rendered via github-templates (e.g. pr-story, pr-bug) — never freeform.
  • Resolve the number from the URL or gh pr view {url} --json number,url. Report both number and URL.

Fetch PR

  • gh pr view {id} --repo {owner}/{repo} --json title,body,headRefName,baseRefName,files,merged,closingIssuesReferences
  • Also gh pr diff {id} for file list and diff content.

List PRs

  • gh pr list --repo {owner}/{repo} --state {state} --json number,title,url,headRefName,state,merged
  • state: open | closed | merged | all. "Merged only" → --state merged.

Submit Review

  • Approve: gh pr review {pr_id} --approve --body "{body}"
  • Request changes: gh pr review {pr_id} --request-changes --body "{body}"
  • {body} for structured reviews rendered via github-templates.

Merge PR

  • gh pr merge {pr_id} --repo {owner}/{repo} --squash

Diff Branch Files

  • gh api repos/{owner}/{repo}/compare/{base}...{head} --jq '[.files[].filename]' — array of changed file paths.

Multi-codebase Operations

Resolve owner/repo per codebase → build full mutation plan across all → run Confirmation Protocol once with combined list → execute per codebase sequentially (parallel pushes can race) → aggregate per-codebase success/skip/error into one summary.

Constraints

  • Never hardcode owner/repo — always derive via gh repo view from the codebase directory.
  • Never write commit message content — the caller provides {message}.
  • Never write PR or review body content from scratch — render via github-templates.
  • Never auto-create missing base branches — stop and surface.
  • Never run mutating ops without confirmation, even from a higher-level orchestrator.
  • Never silently swallow errors other than remote ref does not exist on delete.
  • Never operate on a codebase whose path isn't in the Codebases table.
  • Force pushes require explicit caller request plus confirmation — never inferred.

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.