Skip to content
Back to skills

Using Git

ASecurity

Use when running git commands or fixing repository state. Triggers on commit messages, conventional commits (feat/fix/chore/docs), merge conflicts, rebases, worktrees, creating, merging or cleaning up a feature worktree, branch cleanup, or history rewrites, even when the user doesn't say 'git'.

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsgoshellnodegit

Security analysis

A100/100

Pro scans all 14 files and shows the line behind each finding

Scanned November 30, 2026

npx -y skills add xonovex/platform --skill using-git --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Using Git?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Using Git
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/xonovex-using-git/badge)](https://www.skillsdirectory.com/skills/xonovex-using-git)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: using-git
description: "Use when running git commands or fixing repository state. Triggers on commit messages, conventional commits (feat/fix/chore/docs), merge conflicts, rebases, worktrees, creating, merging or cleaning up a feature worktree, branch cleanup, or history rewrites, even when the user doesn't say 'git'."
---

# Git Guidelines

Create conventional commits, resolve conflicts, and manage worktrees with explicit validation and publication steps.

## Core Principles

- **Conventional Commits** - Use type prefixes (feat, fix, chore, docs, refactor, test, ci), see [references/commit.md](references/commit.md)
- **Auto-Generate Messages** - Analyze changed files and context, see [references/commit.md](references/commit.md)
- **Isolated Development** - Use worktrees for feature branches, see [references/worktree-create.md](references/worktree-create.md)
- **Validate Before Merge** - Run typecheck/lint/build/test, see [references/worktree-validate.md](references/worktree-validate.md)
- **Publish and Rebase** - Push a branch upstream and rebase onto the base before opening a PR / MR, see [references/push.md](references/push.md)
- **Explicit Effects** - Worktree create, merge, and cleanup default to preview and mutate only for an explicit apply

## Commit Operations

- **Auto-commit** - Analyze changes, infer type, generate message, optional push, see [references/commit.md](references/commit.md)

## Branch Operations

- **Push + rebase-onto-base** - Publish a branch upstream and keep its PR / MR diff just this change; the host skill (**using-github** / **using-gitlab**) drives the PR itself, see [references/push.md](references/push.md)

## Conflict Resolution

- **Detect and classify** - Find conflicts, suggest strategy (ours/theirs/merge), see [references/merge-resolve.md](references/merge-resolve.md)
- **Validate** - Run typecheck/lint after resolution before staging, see [references/merge-resolve.md](references/merge-resolve.md)

## Worktree Operations

- **Create** - Preview or apply creation of a `<worktree>-feature-<name>` directory and branch, see [references/worktree-create.md](references/worktree-create.md)
- **Validate** - Pre-merge validation checkpoint, see [references/worktree-validate.md](references/worktree-validate.md)
- **Merge** - Preview or apply integration into the source branch without cleanup, see [references/worktree-merge.md](references/worktree-merge.md)
- **Cleanup** - Preview or apply removal of exact stale or merged targets, see [references/worktree-cleanup.md](references/worktree-cleanup.md)
- **Abandon** - Inspect and document a stopped feature without mutation, see [references/worktree-abandon.md](references/worktree-abandon.md)

## Workflow Operations

- **Serve the workflow** - Give the git command for each version-control operation that **recording-handoff** defines, under the same name: current state, worktree list, create and remove, base diff, content hash, change hash and commit, see [references/workflow-operations.md](references/workflow-operations.md)

## Gotchas

- `git pull` is `fetch` + `merge`, on a shared branch this creates spurious merge commits; prefer `pull --rebase` or `fetch` then explicit merge
- Detached HEAD: committing in this state silently loses commits when you `checkout` away. Note the SHA or branch immediately
- Hooks in `.git/hooks/` are not version-controlled: share via `core.hooksPath` pointing at a tracked directory
- A feature `worktree-merge` integrates a branch into its **parent** branch; landing on the mainline goes through push + PR + CI review, never a direct local merge to `main`
- Merge, abandon, and cleanup are separate operations, none may silently perform another
- Long-lived feature branches drift and conflict: keep them short-lived; integrate work spanning sessions incrementally behind feature flags / branch-by-abstraction
- A temporary index set only in front of `git add`, as in `GIT_INDEX_FILE=x git add -A && git write-tree`, leaves `git write-tree` reading the real index: export it inside a subshell, see [references/workflow-operations.md](references/workflow-operations.md)
- Deleting a worktree directory by hand leaves a stale admin entry: run `git worktree prune`; and each worktree needs its own dependency install (`node_modules` is not shared across worktrees)

## Progressive Disclosure

### Commit Operations

- Read [references/commit.md](references/commit.md) - Load when committing changes with auto-generated conventional messages
- Read [references/push.md](references/push.md) - Load when publishing a branch upstream and rebasing it onto the base before opening a PR / MR
- Read [references/merge-resolve.md](references/merge-resolve.md) - Load when detecting and resolving merge conflicts

### Worktree Operations

- Read [references/worktree-create.md](references/worktree-create.md) - Load when creating a feature worktree with branch
- Read [references/worktree-validate.md](references/worktree-validate.md) - Load when running pre-merge validation in a feature worktree
- Read [references/worktree-merge.md](references/worktree-merge.md) - Load when merging a feature worktree back to its source branch
- Read [references/worktree-cleanup.md](references/worktree-cleanup.md) - Load when removing stale or merged worktrees
- Read [references/worktree-abandon.md](references/worktree-abandon.md) - Load when documenting and removing an abandoned feature worktree

### Workflow Operations

- Read [references/workflow-operations.md](references/workflow-operations.md) - Load when a workflow step names a version-control operation: the branch and uncommitted files, a worktree, the base diff, the content hash or change hash of a verdict, or the delivery commit

Files in this skill

  • SKILL.md5.6 KB
  • eval-output.json4.2 KB
  • eval-trigger.json5.9 KB
  • moon.yml86 B
  • references/commit.md2.6 KB
  • references/merge-resolve.md709 B
  • references/push.md1 KB
  • references/workflow-operations.md4.2 KB
  • references/worktree-abandon.md1.4 KB
  • references/worktree-cleanup.md1.9 KB
  • references/worktree-create.md2.2 KB
  • references/worktree-merge.md2.4 KB
  • references/worktree-validate.md617 B
  • sources.json3.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.