Automate git commit and push following the project's review workflow. Stages files, generates a Norwegian conventional-commit message, and optionally pushes via `git review` (never `git push`). Use when the user says 'commit', 'committ', 'lagre endringer', 'push', 'send til review', or asks to save/commit their work. Also trigger when a quality gate passes and the user wants to commit the result.
Automate the commit workflow for this project. The project uses a review-based flow where git review pushes to review/** branches, which triggers auto-PR creation via GitHub Actions. Direct git push to main is never allowed.
Run these four commands in parallel (all in a single response, as separate Bash tool calls):
git statusgit diff --stagedgit diffgit log --oneline -5Review the output carefully. Identify:
Based on the diff, write a commit message that:
Uses conventional commits format: type: kort beskrivelse
feat: — ny funksjonalitetfix: — feilrettingchore: — vedlikehold, oppdateringer, configtest: — nye/oppdaterte testerdocs: — dokumentasjonsendringerrefactor: — kodeomstrukturering uten atferdsendringa11y: — tilgjengelighetsforbedringerIs written in Norwegian, matching the project's existing style
Is concise — one short line summarizing the "why", optionally followed by a blank line and bullet points for multi-file changes
Uses a dash-separated summary after the type prefix when the change spans multiple concerns (e.g., fix: kodekvalitet-småfiks — typo, typesikkerhet, observer-scope m.m.)
Present the proposed commit message to the user and ask for confirmation before proceeding.
Stage only the files that are relevant to the current task/conversation. If git status
shows previously staged changes or modifications from other tasks, unstage them first with
git restore --staged <file> before staging the correct files. Never blindly commit what
happens to be in the staging area — verify that every staged file belongs to the current work.
Never stage these files:
.env, .env.*node_modules/coverage/)Use git add <specific-file> for each file — avoid git add -A or git add ..
Create the commit using a HEREDOC for proper formatting:
git commit -m "$(cat <<'EOF'