agentleFS
sefaertuncsefaertunc/anthropic-watch/.claude/skills/git-conventions/SKILL.md

git-conventions

Skill1 starsChanged 7 months agoMITView on GitHub

Branch naming, commit message format, PR workflow, worktree conventions, versioning policy

  • Commits and pushes

18 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use simplify, writing-for-agents and 3 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.
  • Hugging FaceSkill

    simplify

    Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.

    Also in 3 projects that use this

  • MicrosoftSkill

    writing-for-agents

    Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

    Also in 3 projects that use this

  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 16 edited versions we read keep these.

  • 18

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Keep branch names under 50 characters.

    line 36
  2. Distinctive:

    Follow conventional commits format:

    line 40
  3. Distinctive:

    No period at the end of the subject line

    line 58
  4. Distinctive:

    Never append Co-Authored-By trailers, AI attribution lines, or "Generated with" footers

    line 61
  5. Distinctive:

    Commit after each logical unit of work:

    line 65
  6. Distinctive:

    Don't batch unrelated changes into one commit.

    line 70
  7. Very specific:

    All feature/bugfix branches are created from and merged back into develop.

    line 82
  8. Very specific:

    Create PR with gh pr create --base develop (feature/bugfix branches target develop)

    line 87
  9. Very specific:

    When on develop, PR targets main: gh pr create --base main (release merges only)

    line 88
  10. Distinctive:

    Do not add AI-generated footers (e.g., "Generated with Claude Code") to PR descriptions

    line 92
  11. Distinctive:

    Default preference: squash merge for feature branches, regular merge for release branches.

    line 100
  12. Distinctive:

    When using git worktree for parallel work:

    line 104
  13. Very specific:

    Always clean up worktrees when done: git worktree remove {path}

    line 108
  14. Distinctive:

    Don't leave stale worktrees — they hold refs and can cause confusion

    line 109
  15. Distinctive:

    Follow semver when the project publishes releases:

    line 127
  16. Distinctive:

    Publish from the primary branch (usually main),: not from feature or development branches.

    line 136
  17. Distinctive:

    Rule of thumb: If the change affects what users see, install, or depend on, it needs a version bump.

    line 146
  18. Very specific:

    Every PR targeting develop declares its intended version bump in the PR description:

    line 150
  19. Distinctive:

    Never force-push to main/master.

    line 199
  20. Distinctive:

    If a rebase goes wrong, git reflog is your friend.

    line 201
  21. Distinctive:

    Don't commit generated files (build output, node_modules, .pyc) — check .gitignore.

    line 202
  22. Distinctive:

    When working in worktrees, remember that stashes are shared across the repo.

    line 203
  23. Distinctive:

    Commit messages are documentation.

    line 205

“Common” is measured: kept by at least 6 in 10 of the 16 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 Conventions

Invocation Boundary

git commit, git push, and gh pr create are invoked only when the human explicitly types /commit-push-pr or /sync (or one of their listed Trigger Phrases). The slash commands themselves are not invoked autonomously — wait for the human trigger. The Version bump: AskUserQuestion in /commit-push-pr is non-skippable; refuse to proceed without an explicit human selection.

See CLAUDE.md Critical Rule 13.

Branch Naming

Pattern: {type}/{short-description}

Types:

  • feature/ — New functionality
  • fix/ — Bug fixes
  • refactor/ — Code restructuring without behavior change
  • docs/ — Documentation only
  • test/ — Test additions or fixes
  • chore/ — Tooling, dependencies, config

Examples:

  • feature/auth-flow
  • fix/login-timeout
  • refactor/extract-merger-module

Keep branch names under 50 characters. Use hyphens, not underscores.

Commit Messages

Follow conventional commits format:

type(scope): short description

Longer explanation if needed. Focus on WHY, not WHAT.
The diff already shows what changed.

Closes #123

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

Scope is optional but helpful: feat(auth): add OAuth2 token refresh

Rules:

  • Subject line under 72 characters
  • Imperative mood ("add" not "added" or "adds")
  • No period at the end of the subject line
  • Blank line between subject and body
  • Body explains motivation, not mechanics
  • Never append Co-Authored-By trailers, AI attribution lines, or "Generated with" footers

When to Commit

Commit after each logical unit of work:

  • A function is complete and tested
  • A refactor is done and tests pass
  • A bug is fixed and verified

Don't batch unrelated changes into one commit. Don't commit broken code.

Branching Strategy

feature-branch ──PR──▶ develop ──PR──▶ main (release)
  • develop — active development. Contributors fork, branch from develop, and PR back to develop.
  • main — production releases. Maintainer-only, merged from develop.
  • gh-pages — auto-deployed docs. Maintainer-only.

All feature/bugfix branches are created from and merged back into develop. Never PR directly to main.

PR Workflow

  1. Push your branch
  2. Create PR with gh pr create --base develop (feature/bugfix branches target develop)
  3. When on develop, PR targets main: gh pr create --base main (release merges only)
  4. PR title follows same format as commit subject: type(scope): description
  5. PR body includes: what changed, why, how to test, anything reviewers should know
  6. Request review if the project has reviewers configured
  7. Do not add AI-generated footers (e.g., "Generated with Claude Code") to PR descriptions

Squash vs Merge

  • Squash when: the branch has many small "wip" commits that don't individually matter
  • Merge when: each commit in the branch is a meaningful, atomic change
  • Rebase when: you need a linear history and commits are clean

Default preference: squash merge for feature branches, regular merge for release branches.

Worktree Conventions

When using git worktree for parallel work:

  • Worktrees go in a sibling directory, not inside the repo
  • Naming: {repo}-{branch-name} for the worktree directory
  • Always clean up worktrees when done: git worktree remove {path}
  • Don't leave stale worktrees — they hold refs and can cause confusion

Agents that use worktree isolation (code-simplifier, test-writer, bug-fixer, etc.) create and clean up their own worktrees automatically.

Shared-State Files

These files are modified ONLY on the develop branch (via /sync), never on feature branches:

  • docs/spec/PROGRESS.md — project progress tracker
  • docs/spec/SPEC.md — feature specification
  • README.md — project documentation
  • package.json version field — release versioning

This prevents merge conflicts when running parallel feature branches.

Versioning Policy

Follow semver when the project publishes releases:

What changedBumpExample
Bug fix, patch to existing behaviorpatchFixed edge case in date parser
New feature, command, or API surfaceminorAdded CSV export option
Breaking change to public API or CLImajorRenamed config key, removed flag
Only docs, CI, tests, internal refactorno bumpUpdated README, added test

Publish from the primary branch (usually main), not from feature or development branches. What is published must always match what is on the release branch.

When to bump: Include the version change in the same PR as the work — no separate "bump version" commits after the fact.

How to publish:

  1. Merge the release PR into main
  2. Pull locally: git checkout main && git pull
  3. Publish using your ecosystem's tool (npm publish, cargo publish, twine upload, etc.)
  4. Sync develop: git checkout develop && git merge main && git push origin develop

Rule of thumb: If the change affects what users see, install, or depend on, it needs a version bump. If it only affects the project's internal development workflow, it does not.

Per-PR bump declarations

Every PR targeting develop declares its intended version bump in the PR description:

Version bump: {major|minor|patch|none}
  • major — breaking change to public API, CLI, or scaffold contract
  • minor — new feature, command, agent, or flag
  • patch — bug fix or user-visible behavior change with no new surface
  • none — docs, CI, tests, internal refactor (nothing consumers notice)

/sync aggregates declarations from all PRs merged since the last version tag and picks the highest: major > minor > patch > none. If all merged PRs are none, no release is cut — /sync updates shared-state files but does not bump the version or open a PR to main.

This is how release batching works: internal-only work accumulates on develop without triggering publishes, and multiple user-facing PRs group into a single well-documented release.

Edge cases

  • Release PRs (develop → main): /sync excludes these from scanning. They ARE the release, not an input to one. Known limitation: any develop→main PR is excluded regardless of content. Safe in practice because that direction is only used for releases.
  • Revert PRs: Declare the same bump level as the PR being reverted. Reverting a patch is itself a patch. A patch + matching revert in the same release group produces a net-zero user-visible change but still bumps the version — something shipped internally and was un-shipped, which is part of the release's history. Do not cancel them out.
  • Missing declarations: Treated as none with a warning that propagates to the release PR body and CHANGELOG entry. Do not manually backfill old PR bodies — let them flow through as none so under-documentation is visible rather than silent.
  • No tags yet (first release): /sync prompts to create a starting tag (default v0.1.0, customizable, cancelable). The tool does NOT silently invent a tag.
  • Hotfix merged directly to main: Bypasses /sync entirely. Requires manual version management. Known limitation; out of scope.

Optional: GitHub labels (release:major, release:minor, etc.) can replace body-text declarations for maintainers who prefer them. Deferred to a future phase; not scaffolded by default.

Gotchas

  • Never force-push to main/master. Force-push to feature branches only when you own the branch and have communicated with collaborators.
  • If a rebase goes wrong, git reflog is your friend. The old state is still there.
  • Don't commit generated files (build output, node_modules, .pyc) — check .gitignore.
  • When working in worktrees, remember that stashes are shared across the repo. A stash in one worktree is visible in another.
  • Commit messages are documentation. Future you will read them. Write for that person.

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.