agentleFS
sp-hk2ldnsp-hk2ldn/SKILLS/repo-state-checkpoint/SKILL.md

repo-state-checkpoint

Skill0 starsChanged 5 days agoMITView on GitHub

Verify an exact repository, checkout, branch, SHA, and dirty-state before code changes, release promotion, delegation, or handoff work. Use when the user gives a repo path, expected commit, setup command sequence, dirty-tree warning, release branch, worktree/clone request, or asks for precise repo location/state with no guessing.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill before changing code or reporting repo readiness when the task depends on the exact checkout.

    line 8
  2. Distinctive:

    Treat an explicit user path as authoritative.

    line 12
  3. Very specific:

    Read local guidance before edits: nearest AGENTS.md or CLAUDE.md, README*, release docs, or repo-specific scripts named by the user.

    line 13
  4. Distinctive:

    If the worktree is dirty, stale, behind, detached unexpectedly, or ambiguous, do not make code changes until the blocker is reported and …

    line 14
  5. Distinctive:

    When the user gives an expected SHA or command sequence, execute it literally unless unsafe, then verify exact output.

    line 15
  6. Distinctive:

    Run the smallest useful set:

    line 20
  7. Distinctive:

    If an exact branch or SHA is requested:

    line 34
  8. Distinctive:

    If a release path is requested, also inspect likely policy files:

    line 42
  9. Distinctive:

    Keep the checkpoint compact and concrete:

    line 50
  10. Distinctive:

    When finishing repo work, include:

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

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

Repo State Checkpoint

Use this skill before changing code or reporting repo readiness when the task depends on the exact checkout. The goal is a small, reliable checkpoint: correct path, correct repo, correct branch/SHA, clean or explicitly blocked state.

Core Rules

  • Treat an explicit user path as authoritative. If it does not exist, stop and report the missing path; do not silently substitute a nearby repo.
  • Read local guidance before edits: nearest AGENTS.md or CLAUDE.md, README*, release docs, or repo-specific scripts named by the user.
  • If the worktree is dirty, stale, behind, detached unexpectedly, or ambiguous, do not make code changes until the blocker is reported and resolved.
  • When the user gives an expected SHA or command sequence, execute it literally unless unsafe, then verify exact output.
  • For release promotion, prefer repo-specific scripts/docs over generic PR or merge habits.

Checkpoint Procedure

Run the smallest useful set:

pwd
test -d "$REPO" && cd "$REPO"
git rev-parse --show-toplevel
git remote -v
git branch --show-current
git rev-parse HEAD
git status --short --branch
git fetch origin --prune
git status --short --branch

If an exact branch or SHA is requested:

git checkout <branch-or-ref>
git rev-parse HEAD
git status --short --branch

If a release path is requested, also inspect likely policy files:

rg -n "promote|release|production|main|develop|fast-forward|deploy" AGENTS.md CLAUDE.md README* docs scripts .github 2>/dev/null

Report Format

Keep the checkpoint compact and concrete:

  • repo: absolute path and git rev-parse --show-toplevel
  • remote: origin URL
  • branch: current branch/tracking state
  • HEAD: full SHA
  • status: clean, dirty file list, behind/ahead, detached, or missing path
  • guidance: files/scripts found that constrain the task
  • blocker: exact reason work cannot proceed, if any
  • next action: the fetch/pull/checkout/branch/confirmation needed

When finishing repo work, include:

  • changed files
  • tests run
  • branch/commit
  • blockers or remaining risk

Common Pitfalls

  • Nonexistent workdir failures happen before repo commands run; report the exact path failure.
  • A nearby similarly named checkout is only a clue, not permission to switch paths.
  • Detached worktrees can be normal for automations; prefer SHA/file-path evidence over branch assumptions.
  • git add . is too broad in messy repos. Stage only the intended files after checking git diff --name-only.

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.