Context
- •Git status: !
git status - •Current branch: !
git branch --show-current - •Remote URL: !
git remote get-url origin - •Staged and unstaged changes: !
git diff HEAD - •Recent commit messages: !
git log --oneline -10
Determine the platform from the remote URL:
- •GitLab (e.g.
n7k.io): useglabfor MR operations - •GitHub (e.g.
github.com): useghfor PR operations
Phase 1: Review & Prepare
- •Review
git statuscarefully — I may have made changes since we last looked at files. Re-read any modified files you haven't seen yet. - •Only stage files directly relevant to our conversation that make sense as a single committable unit. Never
git add -A. - •Research the changes thoroughly. If you notice potential bugs, missing pieces, or improvements, pause and point them out so we can decide whether to address them now or move on.
Phase 2: Commit
- •Review recent commit messages on the main branch for the relevant files/directories — match their style.
- •On GitLab repos, this typically means
[subsystem/component]tags per the project's CLAUDE.md.
- •On GitLab repos, this typically means
- •Write a commit message:
- •Clear title explaining the changes at a high level
- •Body focused on why and context — let the code describe the "how"
- •Include links to relevant documentation, conversations, or references when available
- •Attempt
git commit. - •If pre-commit hooks (
prekor otherwise) report errors:- •If the fixes are straightforward, fix and re-commit without checking with me.
- •If the errors are significant, environment-related, or suggest insufficient test coverage, pause and let me know.
Phase 3: Push
- •
git push -u origin HEAD. - •If the push fails, run
git fetch originand diagnose:- •I may have pushed from another session
- •A colleague may have pushed to the branch
- •The branch may have been rebased onto an updated base
- •Never force-push if it would overwrite someone else's commits. If data loss has occurred, we can recover via
git reflog. Alert me before any force-push.
Phase 4: Open or Update MR/PR
- •Check if an MR/PR already exists for this branch. Only create one if none exists.
GitLab:
- •Create:
glab mr create --fill --remove-source-branch - •Assign to
joe.smith - •Add an agent label — your choices are
agent: claudeoragent: grok. Create the label if it doesn't exist, and let me know because that's a fun first! - •The first commit message populates the MR title and description. Do not manually override them unless the accumulated changes have diverged substantially.
- •If updating an existing MR, check for unresolved code review feedback relevant to our changes.
GitHub:
- •Create:
gh pr create --fill - •The first commit message populates the PR title and description. Do not manually override them.
- •Report the MR/PR URL.
- •Ask if I'd like you to request a review by commenting
@opus, please thoroughly code review this MR. Thank you!— and whether we should address any known concerns first.