Git

The Git rule connects project preferences to the actions an agent may take. Its main distinction is between doing local work, saving a commit and publishing that work to a remote destination.

Settings, everyday commit standards and portable safeguards belong here. Commands retain their own branch eligibility, preparation, target routing, release and recovery procedures. A copied Git/Safety pair remains usable for ordinary work without an installed plugin; loading it does not start a specialist workflow or grant access to its records.

Flow

Workflow diagram for Git
View full-size diagram

Configuration owner

The rule follows the instructions actually loaded by the client, including imports, nested files and overrides. The normal shared arrangement uses AGENTS.md, imported by CLAUDE.md, but an existing custom layout is not silently rewritten.

Conflicting settings block the actions that depend on them. A default applies only when a setting is genuinely absent; it does not replace an explicit false or another project’s declared policy.

Setting Absent-setting default What a choice means
ship-method direct Use direct publication or a PR/MR review handoff for ordinary shipping.
git-auto-commit true Commit completed local work after required checks; explicit false requires commit approval.
git-merge-strategy squash Select squash, merge or a permitted rebase for reviewed integrations.

A rebase preference does not authorize rewriting shared history. Team size and branch naming do not choose these settings. Log handles shared-instruction reconciliation.

If neither instruction file exists, Ship uses the absent-setting defaults and continues its normal assessment without a setup requirement. It creates no instruction files merely to publish. Existing declared settings remain authoritative, and an unreadable file, invalid value or real conflict is not treated as a missing setting.

Local work

Ordinary edits stay on the current permitted branch. Individual commands add their own preparation requirements; a source preview may be available where a saved scan or a fix is not.

The agent preserves unrelated staged, unstaged and untracked work. It does not reset, stash or commit someone else’s changes to satisfy a clean-tree requirement. Source inspection is also separate from permission to execute code or inspect operational records.

For example, a README correction can coexist with an unrelated pending UI change under ordinary editing rules. A command that requires a clean review snapshot must instead report that blocker without absorbing the UI change.

Auto-commit

When enabled, auto-commit allows completed coherent work to be committed after its required checks. It is not a blanket stage-all instruction. The agent reviews the actual content and index, stages only intended paths or hunks, and verifies the resulting commit.

Explicitly deferred commits remain deferred. Public legal-document commits still require exact content and commit approval. New commits identify the committing agent in a Co-authored-by trailer while preserving existing attribution.

Most importantly, auto-commit does not approve publication. A useful local result can remain entirely on your machine.

Conventional Commits

Helm uses a type, a lowercase module or domain scope and a short description. Project or explicit user policy takes precedence. The external Conventional Commits specification makes scope optional; Helm’s default requires it.

fix(payment): prevent duplicate retry charges
docs(setup): explain the required Node version
feat(auth)!: replace the session format

The scope describes what changed, not a review severity. A breaking change needs an explanation, whether marked with !, a BREAKING CHANGE: footer or both. Bodies and trailers retain useful context rather than being discarded for a shorter subject.

For a non-obvious change, the body can explain why it was needed and the important tradeoffs that a diff may not reveal. Simple changes need no body. The rule links to the commit specification, Git’s lease documentation and Google’s description guidance where they explain a specific policy. These references support later verification and maintenance; they are not mandatory reading during each coding session.

Quality checks

Verification starts with the changed behavior and the consumers that depend on it. The agent chooses the smallest established checks that cover those effects, including relevant regression cases. A filename or small diff alone cannot establish isolation: shared fixtures, configuration, dependencies and generated inputs can affect otherwise unchanged code.

For example, a wording change on a documentation page may need a site build and link checks. A change to a shared request contract may need tests for its callers and integration boundaries. Markdown that implements an agent workflow needs its relevant package and workflow checks, even though the file looks like documentation.

Fast checks provide early feedback, followed by slower checks when they add needed evidence. The agent uses supported test selectors and checks that the intended cases ran. An already fast adequate suite may cost less than an elaborate selection. If the runner cannot select cases separately, its smallest adequate suite is appropriate. A full run remains necessary when required, when effects span the project or when the affected scope cannot be established reliably. A shared file does not automatically trigger every suite, and saving time does not justify guessing which consumers are unaffected.

Passed results can be reused while their relevant source, tests, dependencies, configuration, tools and environment still match. Unknown external state prevents that reuse for affected checks. New changes or unexplained failures can require renewed checks; a new phase, local commit or final response alone does not. Repeated runs for flakiness or performance need a specific purpose, rather than continuing until one passes.

The report gives actual commands, tested scope, reused results and limits, with concise output and useful failure details. A focused pass does not prove whole-project health. Passed, failed, unavailable and deferred remain different outcomes, and project-specific gates still apply.

A test name, green result from an older commit or successful source build does not prove a new target integration is ready. Failures and unmet protection requirements block dependent publication.

Publication

Ship reviews the actual destination, outgoing commit, refs and effects before each approved push. Deploy-on-push behavior is part of that decision. PR handoffs, integrations, releases and deployment each need their own evidence.

Results are read back after publication or uncertainty before retries. Branches remain by default; base/environment branches and public published tags are protected. Normalized history and private archive backups use their dedicated proof and approval procedures. When original rewrite proof is unavailable, ship can offer an explicitly approved replacement with a verified current-remote backup and fixed leases, while reporting the original rewrite as unverified.

Explore the source

For implementation details, read rules/git.md.