/scaffolding:git-operationsfrom scaffolding
Provides git command patterns, branching strategies, and safety protocols for managing branches, resolving merge conflicts, and running commit/merge/push operations.
Ships in scaffolding. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Core git command patterns, branching strategies, and safety protocols for a project.
Current branch: !git branch --show-current 2>/dev/null || true
| Branch Pattern | Purpose |
|---|---|
main | Production branch, always stable |
scaffolding/{task_id[:12]} | Worktree task branches (auto-created) |
backup/{task_id[:12]} | Safety backup before destructive ops |
git status
git stash list
git log --oneline -5
git branch backup/$(date +%s) HEAD
git merge --no-commit --no-ff branch_name
git diff --cached --stat
git merge --continue # or --abort
git diff --name-only --diff-filter=U
git checkout --ours path/to/file # keep ours
git checkout --theirs path/to/file # keep theirs
git cherry-pick --no-commit <commit>
git diff --cached --stat
git cherry-pick --continue
| Error | Fix |
|---|---|
fatal: not a git repository | Verify path, check .git exists |
CONFLICT (content) | Use conflict resolution protocol |
cannot lock ref | Wait and retry, check stale locks |
worktree is not clean | Stage+commit or stash |
# 1. Verify unpushed commits exist
git log --oneline origin/main..HEAD
# 2. Push to remote
git push origin main
# 3. Verify push succeeded
git log --oneline origin/main..HEAD # should be empty
--force or --force-with-lease without explicit user confirmationAfter work is complete on a branch, execute one of these four actions based on context.
git checkout main
git merge --ff-only <branch> # try fast-forward first
# if ff fails: git merge --no-ff <branch>
# MANDATORY cleanup -- see Post-Merge Cleanup
Applies to ff, --no-ff, and squash merges (PR merged via gh/Gitea too). Squash merges are invisible to git branch --merged.
# from the main checkout, never from inside the worktree
git -C <worktree> status --porcelain --untracked-files=no # must be empty
git worktree remove <worktree> # --force only for untracked build output (node_modules)
git branch -D <branch>
git worktree prune
/worktree-gc (dry run by default).git push -u origin <branch>
gh pr create --title "<title>" --body "<body>"
# keep branch and worktree
# no action needed -- branch stays as-is
git push -u origin <branch> # optional: push to remote for safety
git checkout main
git worktree remove .scaffolding/worktrees/<task_id> 2>/dev/null
git branch -D <branch>
git worktree prune
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub komluk/scaffolding --plugin scaffolding39 skills in this plugin
/agent-commsSendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a worktreePath from another agent before acting on it. SKIP: routing topology (agent Comms Protocol); git ops (use git-operations); worktree recovery (use worktree-management)./agent-memoryRepo-local file memory under .scaffolding/ (shared/agent/conversation tiers). TRIGGER when: reading or writing .scaffolding/ memory files, or choosing which file tier an insight belongs in. SKIP: vector memory / MCP search and store (use semantic-memory-mcp); distilling conversations (use distill)./api-designRESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new API endpoints, defining error response shapes, or adding pagination/filtering. SKIP: implementing FastAPI route code (use python-patterns); error-handling internals (use error-handling)./context-engineeringOptimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an agent, or trimming what gets injected into a task. SKIP: persisting knowledge across sessions (use agent-memory); semantic recall tuning (use semantic-memory-mcp)./database-optimizationSchema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a migration, or diagnosing a slow query. SKIP: writing ORM model code (use python-patterns); generic backend patterns (use python-patterns)./distillKnowledge distillation: candidate extraction, confidence scoring, tier routing. Invoked by /learn and the memory-ingest Stop hook, not loaded proactively by agents. TRIGGER when: /learn or the Stop hook asks to distill, or scoring a candidate. SKIP: file memory writes (use agent-memory); vector store (use semantic-memory-mcp).Other plugins' skills for the same job