git-workflow

A set of guidelines for using Git, a tool that records code changes and supports collaboration. It covers commits, branches, pull requests, history, and keeping secrets out of the repository.

In plain words
What is it for?
Use it when creating branches, preparing commits, staging selected changes, opening pull requests, and cleaning up project history.
Why use it?
It helps keep changes easy to review, prevents unrelated work from being mixed together, and reduces the risk of committing credentials or generated files.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/nedcodes-ok/cursor-doctor/git-workflow
Clone the repo
git clone --depth 1 https://github.com/nedcodes-ok/cursor-doctor
Per session 891 This file is loaded in full into every session.
When invoked 891 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00891 $0.00891
Opus 5 $0.00445 $0.00445
Sonnet 5 $0.00178 $0.00178
Haiku 4.5 $0.00089 $0.00089

Measured 2d ago against content hash 577548f3fe98, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-workflow scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

pro-kit/templates/practices/git-workflow.mdc · 38 lines

How it starts

The opening of the file, as written. The whole thing — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Workflow Rules

Commits

  • Imperative mood, under 72 chars: "Add user authentication" not "Added user authentication" or "Adding user authentication." The commit message completes the sentence: "If applied, this commit will add user authentication"
  • Conventional commit format: type(scope): descriptionfeat(auth): add OAuth2 login, fix(api): handle null response from payment provider. Types: feat, fix, refactor, docs, test, chore, perf, ci
  • One logical change per commit. A commit that adds a feature, fixes a typo, and reformats a file is three commits. If you can't describe the change without "and," split it
  • Never commit: secrets/credentials (use .gitignore + pre-commit hooks to block), .env files (commit .env.example), build artifacts (dist/, node_modules/), large binary files (use Git LFS)
  • git add -p (patch mode) to stage specific hunks — don't blindly git add . when you have unrelated changes in the working tree

Branches

  • Branch from main (or develop if using Gitflow). Name format: type/short-descriptionfeature/add-auth, fix/login-crash, chore/upgrade-deps
  • Short-lived branches: merge within days, not weeks. Long-lived feature branches diverge from main, accumulate merge conflicts, and get harder to review with every day
  • Delete branches after merging — stale branches clutter the repo and confuse people about what's active. Enable auto-delete in your Git host
  • One developer per branch. If two people work on one branch, you get conflicts on every pull. Use stacked PRs or split the work into separate branches that depend on each other

Pull Requests

  • PR title is the commit message that will appear in main's history (if squash-merging) — make it meaningful, not "Update stuff"
  • Description template: What changed, Why (link to issue/ticket), How to test, Screenshots (if UI), Risks/concerns. A PR without context gets either rubber-stamped or ignored
  • Under 400 lines of meaningful diff. At 400+ lines, reviewers skim instead of reviewing — you get worse feedback on more code. Split large features into stacked PRs: infrastructure → API → UI
  • Draft PRs for early feedback on approach before writing all the code — cheaper to course-correct at 30% than at 100%

Read the full file on GitHub · 38 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 38 lines · 891 tokens per session scan A 577548f3fe98

Subscribe to this mod's changes

git-workflow is a cursor rule published in the GitHub repository nedcodes-ok/cursor-doctor (9 stars, last pushed 5mo ago), licensed MIT. It adds 891 tokens to every session, about $0.0045 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.