install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/git-add" ~/.claude/skills/majiayu000-claude-skill-registry-git-add && rm -rf "$T"
manifest:
skills/data/git-add/SKILL.mdsource content
Agent protocol: Stage atomic git changes
Goal: Stage a single, cohesive set of related file changes for an atomic commit.
When: Use when the agent wants to stage selected files for a git commit.
: Use this skill only for staging selected files, but not
committing them.NOTE
Primary directives
-
Study
filesreferences/
if more than one file exists to stage.ONLY -
useNEVER
orgit add .
.git add -A -
useNEVER
orgit checkout
.git restore -
Assume a file in both
andstaged
states needs staging.unstaged -
Stage files explicitly:
.git add <file1> <file2> ... -
Leave unrelated changes
.unstaged -
Isolate
changes; stage them in a separate commit..gitignore -
Except for
,.gitignore
edit any filesDON'T
Git directives
Git commands (use
--no-pager and --no-ext-diff for diffs):
For unstaged
changes
unstagedgit --no-pager diff --no-ext-diff --stat --minimal --patience --histogram \ --find-renames --summary --no-color -U10 <file_group>
For staged changes
git --no-pager diff --staged --no-ext-diff --stat --minimal --patience \ --histogram --find-renames --summary --no-color -U10
For repository status
git status --porcelain=v2 --branch
For staging files
git add <file1> <file2> ...
Efficiency directives
- Optimize all operations for token and context efficiency
- Single-file shortcut: If one tracked
file, stage immediately (skip reference study)unstaged - Batch git operations on file groups, avoid individual file processing
- Use parallel execution when possible
- Analyze tracked files via
; read non-ignoredgit diff
files; omit ignored filesuntracked - Reduce token usage
Workflow
Exception: If exactly one tracked
unstaged file exists, stage it
immediately and skip steps below.
- Study references files
- Review repository status to identify all modified/new/
filesuntracked - Update
following reference guidelines.gitignore - Select smallest group of
files forming single logical changeunstaged - Stage the atomic group
- Output status as first line, then bullet list of staged files
Output
Files modified:
- Staging area - Files added to git staging area
Status communication:
First line of output indicates status:
- Files staged successfullySUCCESS: staged N files for atomic commit
- NoWARN: no files available to stage
changes foundunstaged
- Failed to stage filesERROR: [message]
Following lines (when SUCCESS): bullet point list of staged files