git-user_skill

This skill guides you through maintaining a linear Git workflow with rebases, feature branches, and fast-forward merges.
  • Swift

11

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill nonameplum/agent-skills --skill git-user

  • SKILL.md5.1 KB

Overview

This skill provides step-by-step guidance for maintaining a strict linear Git workflow using rebases, feature branches, and fast-forward merges. It enforces protected main branch rules and safe commit-rewriting policies for AI-assisted changes. The goal is clear, reviewable history and predictable CI/PR integration.

How this skill works

The skill inspects branch workflows and prescribes commands and rules: create feature/fix/chore branches from main, rebase frequently on origin/main, and resolve conflicts locally. It enforces never merging main into feature branches, requires fast-forward-only merges into main, and specifies when force-push with --force-with-lease is appropriate after rewriting history. It also provides a decision checklist for when an AI agent may rewrite commits.

When to use it

  • When creating a new feature, fix, or chore branch from main
  • Before and after rebasing work on a feature branch
  • When preparing a branch for code review or CI validation
  • When deciding whether to rewrite or squash commits produced by AI edits
  • When finalizing a pull request to be fast-forward merged into main

Best practices

  • Always use the Git CLI for explicit control and reproducibility
  • Create small, atomic commits with imperative verbs and clear bodies for complex changes
  • Rebase frequently: git fetch && git rebase origin/main or git pull --rebase origin main
  • Never merge main into a feature branch; avoid merge commits and squash merges
  • After rewriting published branch history, push with git push --force-with-lease (never force-push main)

Example use cases

  • Start a feature branch: git checkout -b feature/payment origin/main, develop, rebase on origin/main before PR
  • CI fails after rebase: resolve conflicts locally, run tests, and push --force-with-lease
  • AI refactor changed APIs: follow checklist to decide whether to reword/squash commits to match final code
  • Review-ready PR: ensure branch is rebased onto latest origin/main and request human review before fast-forward merge
  • Recover noisy local history: git rebase -i origin/main to squash WIP/fixup commits, then push --force-with-lease

FAQ

Force-push is allowed only on non-main branches after you rewrite history; always use git push --force-with-lease and communicate with collaborators.

Can I ever merge main into my feature branch?

No. Merging main into feature branches creates merge commits and breaks linear history—always rebase onto origin/main instead.

When should an AI agent rewrite commits?

Only when commits no longer accurately describe the code, fragment a single logical change, duplicate work, or obscure intent; otherwise do not rewrite history.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
git-user skill by nonameplum/agent-skills | VeilStrat