Git drill
Hands-on git coaching skills for AI coding agents: real commands, plain-English why, undo-first recovery, and safe practice drills.
npx -y skills add smanaton/git-coach --skill git-drillAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Practice git hands-on in a safe throwaway sandbox or create a reusable drill scenario spec. Manufactures realistic scenarios (first commit, merge conflict, detached HEAD, wrong branch, bad reset) in a disposable repo, then coaches fixing them with hints, solution on request, and retry. Use when the user wants to practice, drill, rehearse, train, or add a new git-drill scenario rather than fix their real repo. Skip when they have a real problem to solve now, which is git-next, or want to run a real operation, which is git-guide-me.
SKILL.md
9.0 KB, as published. Nobody here has run it
git-drill
Run a git dojo: the user wants to practice a situation, not fix real work. Build a realistic mess in a disposable sandbox, coach them through it, and let them retry until it's muscle memory. This is the one skill that creates git states on purpose, so isolation is the absolute rule.
SAFETY — read first
- Never build a drill in the user's real repo or working directory. The sandbox is
created for you by
scenarios/build.mjsunder the OS temp directory — use it and nothing else. - Every git command you run for a drill must run inside the sandbox (use
git -C "<sandbox>" …). Never run drill commands against the current directory. - Cleanup is
node scenarios/build.mjs clean "<sandbox>"— it refuses any path that isn't agit-drill-sandbox, so it can't touch a real repo. - If you can't create an isolated sandbox, stop and say so — do not improvise in a real repo.
The scenario engine is cross-platform (Node + git): it works on Windows, macOS, and
Linux. Drive everything through scenarios/build.mjs, not shell-specific commands like
mktemp or rm.
All scenarios/build.mjs paths below are relative to this skill's directory, not the
user's working directory (which is their own repo). Invoke the engine with its full path
from the skill directory, e.g. node "<skill-dir>/scenarios/build.mjs" build <name>.
Transparency contract (every action)
$ <literal command>
✓ <one line: what it did, plain language>
↩ undo: <reversing command, or "— (not reversible)">
The learner sees and types the real commands — that's the whole point.
The drill loop
Reminder: the node scenarios/build.mjs … commands below are shorthand. The engine lives
in this skill's directory, not the user's repo (their cwd), so invoke it with the full
path — node "<skill-dir>/scenarios/build.mjs" … — or cd into the skill directory first.
The git -C "<sandbox>" commands work from anywhere.
- Pick a scenario. From the catalog in
reference/scenarios.md(first-commit,unstage-file,discard-local-edit,amend-last-commit,revert-commit,stash-before-switch,merge-conflict,detached-head,wrong-branch,bad-reset,pr-update,pr-conflict), or the one the user named.node scenarios/build.mjs listprints the authoritative set. If they're vague and clearly new to git, start withfirst-commit; otherwise offer the list. - Build the sandbox. Run the engine — it creates an isolated temp dir and prints its
path on the last line. Capture that path as the sandbox.
Show the command and that it created a throwaway practice repo. Exit: you hold the sandbox path and the repo is in the scenario's starting (messy) state.node scenarios/build.mjs build <name> - Present the situation + goal from the catalog. State plainly where they are and
what "done" looks like. Tell them they can type a git command, or
hint,solution,reset,new, orquit. - Coach the attempt. For each command they try: show it with the transparency block,
run it inside the sandbox (
git -C "<sandbox>" …), and react. Let them drive — don't solve it for them. The sandbox only isolates the engine's writes, not arbitrary typed commands: if a learner's command targets a path outside the sandbox or is destructive to the host (e.g.rm -rf, agit -C <other-path>), decline and explain rather than run it — run learner commands only against the sandbox.hint→ give the next escalating hint only (not all of them).solution→ show the full solution commands, explain why each step works (ground concepts inreference/sources.md/git helpif they ask "why"). For recovery drills (bad-reset,detached-head,wrong-branch), pull the exact recipe fromreference/recovery.md.reset→ clean the sandbox and rebuild the same scenario to try again.new→ pick another scenario.
- Verify. Run the engine's check — exit 0 /
PASSmeans solved, non-zero /FAIL: <reason>says what's still off:
On success, give a short recap: what they practiced, and the escape hatch they didn't need (node scenarios/build.mjs verify <name> "<sandbox>"merge --abort, etc.). On a wrong turn, point at theFAILreason and let them try again — mistakes in the sandbox are free. AFAIL: could not check the sandbox …reason means the repo is in an unexpected state (e.g. a tracked file was deleted), not that their git answer was wrong — offerreset, don't tell them they failed. Exit:verifyreturnsPASS, or the user choosesreset/new/quit. - Finish. Offer
reset/new, orquit. To step up the difficulty, usenewto pick a harder scenario (the●●●ones:bad-reset,pr-conflict). Clean up on any exit from the loop — quit, abandonment, or an error mid-drill — so sandboxes never pile up:
(It refuses any path that isn't anode scenarios/build.mjs clean "<sandbox>"git-drill-sandbox.) Confirm it's removed.
Creating new scenarios
Use this mode only when the user asks to add, create, design, or author a reusable git-drill scenario. If they only ask to "set up a scenario to practice," use the drill loop above.
- Pick a lowercase slug, e.g.
first-commitorundo-staged-file. - Scaffold a declarative spec:
node scenarios/build.mjs create <slug> - Edit
scenarios/specs/<slug>.json. Keep it declarative: use onlyinit,write, and sandboxedgitbuild steps. Do not add shell scripts. - Add or update the matching catalog entry in
reference/scenarios.md: situation, goal, hints, solution, escape hatch, and verify line. - Validate the spec:
node scenarios/build.mjs validate-spec <slug> - Smoke-test it: build the scenario, run the documented solution commands inside the
sandbox with
git -C "<sandbox>" ..., verify it passes, then clean up.
If the requested scenario cannot be expressed in the JSON spec format, update
scenarios/build.mjs directly using the existing hard-coded scenario pattern, then keep
the catalog and tests in sync.
When to use
- The user wants to practice / drill / rehearse a git situation: "give me a first commit drill", "give me a merge conflict to practice on", "let me practice detached HEAD", "quiz me on a bad reset".
- They want a safe place to fail and retry, separate from real work.
- They want to create a new reusable git-drill scenario for the catalog.
When NOT to use
- Real problem right now? "I'm actually stuck", a live conflict in their real repo → git-next (diagnose and recommend). Don't manufacture a drill.
- Wants to do a real operation? "Actually merge this branch" → git-guide-me.
- Just wants the concept? "What is a rebase?" → git-explain.
Worked example (merge-conflict drill)
User: give me a merge conflict to practice on
> node scenarios/build.mjs build merge-conflict
$ (creates an isolated sandbox) → /tmp/git-drill-a1b2c3
✓ throwaway practice repo created
↩ undo: node scenarios/build.mjs clean /tmp/git-drill-a1b2c3
DRILL: Merge conflict ●●○
You're on main; `git merge spicy` conflicted in recipe.txt. Resolve it
keeping both ideas, then complete the merge. (type a command, or
hint / solution / reset / new / quit)
User: git status
$ git -C /tmp/git-drill-a1b2c3 status
✓ shows "both modified: recipe.txt" → edit the file, remove the <<< === >>> markers
User: (edits file) then: git add recipe.txt && git commit --no-edit
✓ merge committed
> node scenarios/build.mjs verify merge-conflict /tmp/git-drill-a1b2c3
PASS → ✅ Drill passed. You read status, removed the markers, added, committed.
Escape hatch you didn't need: git merge --abort.
quit → node scenarios/build.mjs clean /tmp/git-drill-a1b2c3
References
Bundled in this skill so it installs self-contained:
reference/scenarios.md— the scenario catalog: situation, goal, hints, solution, and verify check per drill, plus how to add new ones.scenarios/build.mjs— the cross-platform engine (Node + git) that builds, verifies, and cleans each drill. Works on Windows, macOS, and Linux.reference/recovery.md— undo/recovery recipes (thebad-reset,detached-head, andwrong-branchdrills lean on these).reference/sources.md— authoritative sources for "why did that work?" follow-ups.