.config/opencode/skills/git-write/SKILL.md
Load this skill when performing git operations that modify repository state: add, commit, amend, rebase, merge, stash, worktree, reset, checkout, switch, branch create/delete.
npx skillsauth add ferdinandyb/dotfiles git-writeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
In other words: a commit must be able to become a fully functional pull/merge request on it's own if needed.
ci:, doc:, accounts:, server:. Do not use
conventional commit prefixes.Co-authored-by:, Fixes:, Link:)Never stage entire files blindly. Use these commands:
| Command | Purpose |
| -------------- | --------------------------------------- |
| git add -p | Stage by hunks interactively |
| git add -e | Edit the patch manually (most granular) |
| git reset -p | Unstage by hunks (reverse of add -p) |
This allows splitting unrelated changes in the same file into separate commits.
Before pushing to shared branches, actively rewrite history to create clean atomic commits.
git add <files>
git commit --amend # edit message
git commit --amend --no-edit # keep message
# Create a fixup commit targeting a specific commit
git add <files>
git commit --fixup=<commit-hash>
# Later, autosquash during rebase, does not use $EDITOR
git rebase --autosquash origin/main
# Reset to previous commit, keeping changes in working directory
git reset HEAD^
# Or soft reset to keep changes staged
git reset --soft HEAD^
# Then re-stage selectively with git add -p
Agents cannot use git rebase -i because it opens an interactive editor.
Instead, use GIT_SEQUENCE_EDITOR to manipulate the rebase plan
programmatically:
# Squash the last 2 commits into one
GIT_SEQUENCE_EDITOR="sed -i '2s/^pick/squash/'" git rebase -i HEAD~2
# Drop the 3rd-to-last commit
GIT_SEQUENCE_EDITOR="sed -i '3s/^pick/drop/'" git rebase -i HEAD~3
# Reword a commit (then follow up with git commit --amend -m "new message")
GIT_SEQUENCE_EDITOR="sed -i '1s/^pick/reword/'" git rebase -i HEAD~1
# Fixup all commits except the first (squash without keeping messages)
GIT_SEQUENCE_EDITOR="sed -i '2,\$s/^pick/fixup/'" git rebase -i HEAD~4
# Apply --autosquash (processes fixup!/squash! commits automatically)
git rebase --autosquash origin/main
Available actions: pick, reword, edit, squash, fixup, drop
The GIT_SEQUENCE_EDITOR command receives the todo file path as its argument.
The GIT_SEQUENCE_EDITOR command receives the todo file path as its argument. Use sed -i with one or more -e expressions (macOS requires sed -i '', Linux uses sed -i):
# Single change (macOS)
GIT_SEQUENCE_EDITOR="sed -i '' '2s/^pick/squash/'" git rebase -i HEAD~3
# Multiple changes — chain with -e
GIT_SEQUENCE_EDITOR="sed -i '' -e '2s/^pick/squash/' -e '3s/^pick/squash/' -e '4s/^pick/drop/'" git rebase -i HEAD~5
Line numbers are 1-indexed; line 1 = oldest commit in the range.
ORIG_HEAD references the commit before rebasegit reflog shows all recent commits, even "lost" onesgit range-diff ORIG_HEAD~4..ORIG_HEAD HEAD~4..HEAD to compare before/aftergit add -p (not git add . or git add -A)Some git commands open $EDITOR for interactive input. Agents CANNOT run these commands directly because they require interactive text editor input.
Examples:
git commit (without -m or --message)git rebase --continue (when fixing conflicts and editor opens for commit message)git merge (when it opens editor for merge commit message)git tag -a (annotated tags without -m)Workarounds:
git commit -m "message" instead of git commitGIT_EDITOR=true git rebase --continue to accept the default messageGIT_SEQUENCE_EDITOR to programmatically edit the rebase plan (see "Programmatic Rebase" section above)testing
Run Tecton plan and tests via Pants in the data-science repo. Handles long-running commands with proper output capture to avoid truncation.
documentation
IMMEDIATELY load this skill if you read ANY file containing "taskagent" (PLAN.md, org/projects, docs, etc). Also load for multi-session work or when user mentions agent tasks. For simple single-session tasks without taskagent references, use TodoWrite instead.
tools
MUST load before ANY git or yadm operation — reading, writing, branching, committing, diffing, logging, rebasing, or anything else git-related. No exceptions.
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".