Commit and Push
- •
Lint check: Look for lint/check commands in the repo by inspecting project configs (e.g.,
package.jsonscripts,Makefiletargets, etc.) at the repo root and in any subdirectories that have changed files. Common commands includebun run check,bun lint,pnpm lint,npm run lint,yarn lint,make lint,cargo clippy,go vet ./..., etc. Run whatever lint/format checks are available — if it's a monorepo, run checks at the root AND in affected subdirectories (e.g.,cd apps/engine && make lint). If a check fails with auto-fixable issues, run the corresponding fix command (e.g.,bun run fix,bun format,make format), then re-run the check to confirm. If no linter is found, skip this step. - •
Run
git statusto see what's changed - •
Run
git diffandgit diff --stagedto understand the changes - •
Run
git log --oneline -5to see recent commit style - •
Stage all relevant changed files by name (do NOT use
git add -Aorgit add .) - •
If
$ARGUMENTSis provided, use it as the commit message. Otherwise, write a concise commit message based on the diff. Always append the co-author trailer:textCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- •
Commit using a HEREDOC:
bashgit commit -m "$(cat <<'EOF' message here Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> EOF )"
- •
Push to the current branch with
git push - •
If the current branch is not
main, check if a PR already exists withgh pr view --json url 2>&1. If no PR exists, create a draft PR:bashgh pr create --draft --title "PR title" --body "$(cat <<'EOF' ## Summary <description> 🤖 Generated with [Claude Code](https://claude.com/claude-code) EOF )"
Use the commit message as the PR title (first line) and expand on the changes in the body.
- •
Report the result, including the PR URL if one was created