Git

From nexxeln/opencode-config · View interactive version

Git is an AI agent skill from the GitHub repository nexxeln/opencode-config. git workflows for agents. use when handling commits, atomic split commits, selective staging, hunk-level staging with `git-hunk`, branch pushes, or pull request creation with `gh`. triggers on: commit, pr, push, stage, hunk, git-hunk, selective staging, pull request, atomic commit.

How to use this skill

Skill file

git

use this skill when the job is to turn a messy diff into clean commits or a clean pull request. prefer atomic commits, short lowercase conventional messages, and explicit staging over convenience.

defaults

commit message convention

commit workflow

if the user provides extra instructions, treat them as constraints on scope, file selection, commit count, message hints, or exclusions.

  1. inspect the entire change first
  1. decide how to split
  1. stage the next atomic unit
  1. use git-hunk safely when needed
  1. commit and continue
  1. failure handling

pull request workflow

if the user provides extra instructions, treat them as constraints on commit scope, base branch, title, body, draft state, labels, reviewers, or other gh options.

  1. run the commit workflow first for all intended uncommitted changes
  2. inspect branch state with git status, git branch --show-current, tracking status, git log, and git diff <base>...HEAD
  3. if the current branch is the default branch (e.g. main), create a new branch named nxl/<short-descriptive-name> before pushing (e.g. nxl/fix-auth-refresh, nxl/add-usage-metrics)
  4. choose the base branch from arguments when provided; otherwise prefer the repo default or current tracking setup
  5. push the branch with git push -u origin <branch> when needed; never force push
  6. create the pull request with gh pr create
  7. keep the PR title concise and aligned with the overall change set
  8. keep the PR body short and useful; default shape:
## summary
- ...
- ...

## testing
- ...
  1. return the PR URL

argument handling

references

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.