Prompt file imported from antoniopaya22/go-rest-template (
.github/prompts/commit.prompt.md). Copyright stays with the author.
Commit the current work in this repository.
Use the repository workflows already defined in Makefile and ci.yml when choosing validation commands.
Workflow:
- Inspect the current branch,
git status --short --branch, and a diff summary before making changes. - If the user supplied extra text with
/commit, treat it as commit intent, preferred scope, or issue reference. - If there are merge conflicts, an in-progress rebase/cherry-pick, or multiple clearly unrelated change sets, stop and ask before committing.
- If there is nothing to commit, say so and stop.
- Stage the intended changes with
git add -A. - Write the commit message using Conventional Commits:
- Format:
<type>(<optional-scope>): <imperative summary> - Choose the most accurate type, such as
feat,fix,refactor,docs,test,build,ci, orchore - Keep the subject concise and specific
- Add a body only when it adds value, for example rationale, validation, or breaking-change context
- Avoid vague messages such as
update,changes, orfix stuff
- Format:
- Run sensible validation before committing when the diff warrants it:
- Prefer the repo workflows, for example
make vet,make lint,make test, or the smallest relevant subset - If validation fails, stop and report the failure instead of committing
- Prefer the repo workflows, for example
- Commit non-interactively.
- Push to the current branch:
- Use the existing upstream when present
- If no upstream exists, use
git push -u origin <current-branch>
Safety rules:
- Never force-push
- Never amend unless the user explicitly asks
- Never include unrelated changes just to make the working tree clean
- Prefer non-interactive git commands only
Report back with:
- current branch name
- final commit message
- short commit hash
- whether validation ran and what passed