agentleFS
jmylchreestjmylchreest/aide/skills/git/SKILL.md

git

Skill19 starsChanged 3 months agoMITView on GitHub

Git operations and worktree management

  • Deletes or force-pushes
  • Commits and pushes

57 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use sql, databases and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • thechandanbhagatSkill

    sql

    Write SQL queries, optimize database performance, design schemas, and debug SQL issues. Use for database operations, query optimization, and schema design.

    Also in 4 projects that use this

  • mrgoonieSkill

    databases

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.

    Also in 3 projects that use this

  • mrgoonieSkill

    devops

    Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.

    Also in 4 projects that use this

  • MicrosoftSkill

    typescript

    TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.

    Also in 4 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 3 projects that use this

  • NVIDIASkill

    github

    Interact with GitHub using the gh CLI restricted to REST API only (no GraphQL). Use when the user wants to work with GitHub issues, pull requests, repos, releases, or Actions — especially in sandboxed environments where the GraphQL endpoint may be blocked. Trigger keywords - github, gh, pull request, PR, github issue, github actions, workflow, release, gh api.

    Also in 6 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 51 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never skip hooks unless explicitly asked

    line 33
  2. Distinctive:

    Pre-commit hook failure: - Read the error, fix the issue, create NEW commit (never amend after hook failure)

    line 107
  3. Distinctive:

    Branch already exists: - Use different name or checkout existing

    line 113
  4. Distinctive:

    Locked worktree: - Check git worktree list for stale entries, use git worktree prune

    line 115
  5. Distinctive:

    When reviewing diffs or preparing commits, use findings tools to understand the quality context of changed code:

    line 161

“Common” is measured: kept by at least 6 in 10 of the 51 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Mode

Recommended model tier: balanced (sonnet) - this skill performs straightforward operations

Expert git operations including worktree management for parallel work.

Commit Guidelines

Message Format

<type>: <short description>

[optional body]

Types: feat, fix, refactor, docs, test, chore

Commit Process

  1. Check status: git status
  2. Review diff: git diff
  3. Stage specific files (not git add .)
  4. Write descriptive message
  5. Never skip hooks unless explicitly asked

Worktree Management

Create Worktree

# For feature work
git worktree add ../feature-branch -b feature/name

# For parallel tasks
git worktree add ../aide-worktrees/task-1 -b aide/task-1

List Worktrees

git worktree list

Remove Worktree

git worktree remove ../feature-branch
git branch -d feature/name  # if merged

Common Operations

Feature Branch Workflow

git checkout -b feature/name
# ... work ...
git add <specific-files>
git commit -m "feat: add feature"
git push -u origin feature/name

Rebase onto Main

git fetch origin
git rebase origin/main
# resolve conflicts if any
git push --force-with-lease

Cherry-Pick

git cherry-pick <commit-hash>

Stash

git stash push -m "description"
git stash list
git stash pop

Safety Rules

Never run without explicit user request:

  • git push --force (use --force-with-lease if needed)
  • git reset --hard
  • git clean -f
  • git checkout . or git restore .

Safe operations:

  • git status, git diff, git log
  • git add <specific-files>
  • git commit
  • git push (without force)
  • git worktree operations

Failure Handling

Commit failures:

  1. Pre-commit hook failure - Read the error, fix the issue, create NEW commit (never amend after hook failure)
  2. Merge conflict - Report conflicts, do not auto-resolve without explicit request
  3. Push rejected - Fetch and rebase, report if conflicts arise

Worktree failures:

  1. Branch already exists - Use different name or checkout existing
  2. Dirty working tree - Stash or commit before worktree operations
  3. Locked worktree - Check git worktree list for stale entries, use git worktree prune

Recovery commands:

# Recover from bad merge (before commit)
git merge --abort

# Recover from bad rebase (before complete)
git rebase --abort

# Prune stale worktrees
git worktree prune

Verification Criteria

After commit:

# Verify commit was created
git log -1 --oneline

# Verify expected files changed
git show --stat HEAD

After push:

# Verify remote updated
git log origin/<branch> -1 --oneline

After worktree creation:

# Verify worktree exists
git worktree list | grep <worktree-path>

# Verify branch created
git branch -a | grep <branch-name>

Change Context with Findings

When reviewing diffs or preparing commits, use findings tools to understand the quality context of changed code:

  • mcp__plugin_aide_aide__findings_search — Search for known issues (complexity, secrets, clones) in changed files
  • mcp__plugin_aide_aide__findings_list — List all findings for a specific file to understand its health
  • mcp__plugin_aide_aide__findings_stats — Quick overview of finding counts across the project

This helps surface pre-existing issues in files you're touching, and can inform whether a commit should also address nearby problems.

Parallel Work Pattern

For swarm mode or parallel features:

# Setup
git worktree add ../work-1 -b feature/part-1
git worktree add ../work-2 -b feature/part-2

# Work in parallel (different terminals/agents)
cd ../work-1 && # ... implement part 1
cd ../work-2 && # ... implement part 2

# Merge
git checkout main
git merge feature/part-1
git merge feature/part-2

# Cleanup
git worktree remove ../work-1
git worktree remove ../work-2
git branch -d feature/part-1 feature/part-2

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.