Git workflow
Use when committing work, creating branches, preparing PRs, resolving merge conflicts, when grouping related changes into commits, when cleaning up history before merging, or when deciding what should be a separate commit vs squashed.From its SKILL.md
npx -y skills add aneja5/forge-skills --skill git-workflowAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 3 stars3 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.
- runs commandsInstructs the agent to run 2 commands, including `git diff --staged` and 1 more.
SKILL.md
2.9 KB, 631 tokens by cl100k_base, as published. Nobody here has run it
Git Workflow
Overview
Each commit is an atomic, independently-revertable unit of work. Commit messages explain WHY, not WHAT (the diff shows what). Branch names reference task IDs. PRs link to the originating task and contract.
When to Use
- Committing completed work from
incremental-implementation - Creating a branch for a new task
- Preparing a PR for review
- Resolving merge conflicts
When NOT to Use
- You're in the middle of implementing — finish the task first, then commit
- Exploratory work not yet at a stable state — use
git stashor a WIP commit
Common Rationalizations
| Thought | Reality |
|---|---|
| "I'll squash it all at the end" | Squashing discards the incremental story — keep atomic commits |
| "The commit message can be 'fix'" | Future you and your teammates need to know WHY |
| "I'll just force push to clean up" | Force push rewrites shared history — never on shared branches |
| "One big commit is fine for a small change" | Small changes are the easiest place to practice atomic commits |
Red Flags
- Commit touches files from more than one task
- Commit message describes the diff ("update user.ts") not the reason ("guard against null session on logout")
- Unrelated test fixes bundled with a feature commit
- Merge conflict resolved by accepting one side wholesale without reading both
Core Process
Branch naming
feat/T001-user-registration
fix/T023-null-session-logout
chore/update-dependencies
Commit format
[T001] Implement user registration
Guard against duplicate email on create — UserService.create() now returns
DuplicateEmailError instead of throwing, matching the contract invariant.
Closes: T001
- First line:
[TASK-ID] imperative verb + what changed(≤72 chars) - Body: WHY this change was needed, not what the diff shows
- Footer: task reference
Before committing
- Only files from the current task are staged
-
git diff --stagedreviewed — no debug logs, no TODO left in - Tests pass:
<run test command> - Build passes:
<run build command>
PR checklist
- PR title matches the task title
- PR description links to task ID and to the relevant
.forge/contracts/file - "What changed and why" section in PR body — not just the task title
- No unresolved review comments before merge
- Merge strategy: squash only if commits are truly WIP; prefer merge commit to preserve atomic history
Verification
- Each commit is independently revertable
- Commit messages explain WHY, not WHAT
- No debug artifacts committed (console.log, TODO, commented-out code)
- Branch references task ID
- PR links to task and contract
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most pr commit review skills give in 631 tokens
Counted across 1,055 of the 1,911 authors here whose files we hold, read 2026-09-06
- Use conventional commit message formatin 150 of 1055, across 145 files
- Announce skill usage at startin 78 of 1055
- Use imperative mood for commit descriptionsin 54 of 1055, across 51 files
- Add directory to gitignore if not ignoredin 52 of 1055, across 41 files
- Use imperative mood for commit subjectin 52 of 1055
- Run tests to verify clean baselinein 42 of 1055, across 32 files
- Push branch to originin 40 of 1055, across 38 files
- Verify worktree directory is ignored before creationin 39 of 1055, across 32 files
- Delete branches after mergingin 38 of 1055, across 30 files
- Create worktree with new branchin 37 of 1055, across 32 files
- Wrap body text at 72 charactersin 36 of 1055, across 34 files
- Auto-detect and run project setupin 35 of 1055, across 27 files
Said here and by no other author read
- Link PRs to task and contract
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.