Git Discipline logo

Git Discipline

Community
UnpaidAttention
git-discipline

Rules for commits, branches, diffs, and history when working in a git repository — checkpoint strategy, pre-commit diff review, message format, and the hard prohibitions on destructive operations. Trigger this whenever work happens in a git repo and involves staging, committing, branching, or any history-affecting command; before EVERY commit; and the moment you are tempted to run force-push, reset --hard, clean -fd, rebase, or amend. Do NOT trigger for the edit-test cycle itself (use verification-loop) or for reviewing code quality of a diff (use code-review) — this skill governs version-control mechanics and safety only.

Overview

PublisherUnpaidAttention
Repositoryfable5-methodology
Skill namegit-discipline
Stars
94
Forks
21
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by UnpaidAttention on GitHub. Read the source before you install it.

Installation

Install the Git Discipline AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/UnpaidAttention/fable5-methodology/tree/main/skills/git-discipline
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnpaidAttention/fable5-methodology.git /tmp/fable5-methodology
mkdir -p .claude/skills
cp -r /tmp/fable5-methodology/skills/git-discipline .claude/skills/git-discipline
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Git Discipline in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Git Discipline on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Git Discipline is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Git Discipline

Git is the safety net and the audit trail. Used carelessly it becomes the accident: history rewritten, work destroyed, secrets published. The rules below are ordered: prohibitions first because they are absolute; craft second.

Hard prohibitions (no exceptions without explicit user instruction)

  1. Never commit or push unless the user asked or their workflow clearly expects it. On a long task, ask ONCE at the start: "checkpoint-commit as I go, or leave everything unstaged?" If no commits are authorized, checkpoint with git stash push -m "checkpoint: <state>" or record known-good SHAs in your notes instead.
  2. No force pushes. No history rewrites of anything pushed (rebase, commit --amend, filter-branch on published commits). To undo a pushed commit, use git revert — it preserves history.
  3. No destructive working-tree operations without explicit confirmation in THIS conversation: reset --hard, checkout -- . over uncommitted work you didn't create, clean -fd, branch deletion with unmerged work. Before asking, run git status and git stash list and report what would be lost.
  4. Never commit on the default branch. Branch first: git checkout -b <type>/<short-slug> (e.g. fix/csv-last-row).
  5. No secrets, ever. Before every commit, scan the staged diff for keys, tokens, passwords, connection strings, and .env content. One match = unstage, move to env/secret manager, and check whether the value was ever committed before (if yes, tell the user it needs rotation — removal from HEAD does not un-leak it).
  6. No generated junk: build artifacts, node_modules/target/__pycache__, editor files, your own WORKING_NOTES.md. If it's generated and not ignored, fix .gitignore in the same commit rather than committing the junk.

Commit craft

  1. Small and coherent: one logical change per commit — a commit you can describe in one sentence without "and also". Mechanical rename and behavior change are two commits, so the reviewer can skim one and scrutinize the other.
  2. Stage by path, never blind: git add src/lib/csv.ts tests/csv.test.ts — never git add . or git add -A, which are how junk, secrets, and unrelated edits get in.
  3. Review the FULL staged diff before every commit: git diff --staged, read every hunk. You are looking for: leftover debug prints, unrelated drive-by edits, secrets, and hunks you can't explain. Any of those = fix before committing. This review is mandatory even when "sure" — especially when sure.
  4. Message format: imperative summary ≤72 chars stating the change (fix: include final row in CSV export); body only when the WHY isn't obvious from the diff — the constraint, the bug mechanism, the rejected alternative. Never narrate the process ("tried X then Y").
  5. Checkpoint rhythm (when commits are authorized): commit at every verified-green unit boundary (see verification-loop). Never commit a known-red state; if you must save a red work-in-progress, use a stash with a descriptive message instead.

Recovery habits

  • Before any risky operation you WERE authorized to run, note the current SHA (git rev-parse HEAD) in your working notes — that's the rollback target.
  • Prefer additive recovery (revert, new commit) over subtractive (reset) whenever the branch may have been seen by anyone else.
  • git reflog is the last-resort undo — remember it exists before declaring work lost.

Worked example

Task: fix a bug; user said "commit as you go" at session start.

  1. git checkout -b fix/csv-last-row (never on main).
  2. Fix + regression test; pnpm test green.
  3. git add src/lib/csv.ts tests/csv.test.ts (by path).
  4. git diff --staged — review finds a console.log(rows) left in. Remove, re-stage, re-test.
  5. Commit: fix: include final row in CSV export when trailing newline absent.
  6. Later, a second improvement to error messages in the same file → separate commit, not squashed in.
  7. Push only because the user asked for a PR; git push -u origin fix/csv-last-row — no force flags.

Done when

Every commit on the branch is one sentence-sized logical change whose full staged diff you read before committing; nothing was committed to the default branch, force-pushed, or history-rewritten; no secret or generated file is in any commit; and every destructive operation that ran had explicit user confirmation from this conversation.

Frequently asked questions

What does the Git Discipline AI skill do?

Rules for commits, branches, diffs, and history when working in a git repository — checkpoint strategy, pre-commit diff review, message format, and the hard prohibitions on destructive operations. Trigger this whenever work happens in a git repo and involves staging, committing, branching, or any history-affecting command; before EVERY commit; and the moment you are tempted to run force-push, reset --hard, clean -fd, rebase, or amend. Do NOT trigger for the edit-test cycle itself (use verification-loop) or for reviewing code quality of a diff (use code-review) — this skill governs version-c...

Why use Git Discipline on TypingMind?

Because you install it once and use it with any model. Git Discipline is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Git Discipline in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/UnpaidAttention/fable5-methodology/tree/main/skills/git-discipline. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Git Discipline?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Git Discipline?

As many as you like. As long as a model supports skills, you can use Git Discipline with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Git Discipline AI skill free?

It is published on GitHub by UnpaidAttention. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇