Give your coding agent repository-specific rules grounded in your team’s existing commits, then have it inspect the staged change before drafting. Specify what the subject should say, when a body is useful, and which prefixes or trailers the project actually requires. Treat the result as a draft to review: instructions can improve consistency, but they do not guarantee a compliant message.
Start with the commit conventions your team already uses
Before writing instructions, review recent commits and the repository’s contribution guide. Look for the conventions that matter in your project: subject format and capitalization, scope or ticket references, when to include a body, and any required trailers. If the project does not use a prefix scheme such as Conventional Commits, do not impose one just because it is familiar. Git’s contribution guidance recommends checking project history when local style is uncertain: Git’s SubmittingPatches guidance.
Use the repository’s actual patterns as the source of truth, rather than copying one memorable commit or assuming every team wants the same format. A useful instruction is specific enough to steer the agent but short enough to be easy to maintain.
Tell the agent what a readable message needs to do
The title is the text before the first blank line. It appears in Git output and can be used as a patch email subject, so it should make the change easy to scan. Git recommends a short summary, a blank line, and then a fuller description when more context is needed. Its suggested limit of 50 characters is a recommendation, not a universal rule: Git’s git-commit documentation.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
A body should add information the title cannot carry. Git’s contribution guidance says a meaningful body explains the problem being solved and why the chosen solution is appropriate. It should make sense on its own rather than requiring the reader to follow an external link for basic context: Git’s SubmittingPatches guidance.
- Subject: describe the actual effect of the staged change in the project’s usual style.
- Body: when needed, explain the problem and the reason this change addresses it.
- Project-specific details: include a scope, ticket reference, or trailer only if the repository’s conventions call for it.
- Accuracy: do not claim tests ran, state a motivation, link an issue, or promise behavior unless the staged change supports that claim.
Use a repository-level instruction the agent can follow
For GitHub Copilot, repository-wide custom instructions can describe project-specific standards, and GitHub lists commit-message generation as a use case. The documented repository-wide file is .github/copilot-instructions.md. Support differs among Copilot features and IDEs, so check the current product support information for the surface your team uses: GitHub’s Copilot response customization documentation.
VS Code also documents workspace instruction files for reusable guidance. It automatically detects .github/copilot-instructions.md for chat requests in a workspace; discovery for Local agent instructions has a separate setting. Product behavior can change, so confirm the current details in VS Code’s custom instructions documentation.
A practical starting point is:
When preparing a commit message, inspect the staged diff and follow the conventions in recent commits and CONTRIBUTING.md. Write a concise subject that describes the change’s actual effect. If a body is useful, explain the problem and why the change addresses it. Use imperative wording if that matches this repository’s convention. Do not claim tests, motivations, issue links, or behavior that the staged change does not establish. Do not add a type/scope prefix or trailer unless the project requires it.
Free tools Windows power users keep installed
One-click scans. No signup required.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
This is a synthesized example, not an official prompt prescribed by GitHub or Microsoft. Adapt its references and requirements to the files and conventions in your own repository.
Review the draft against the staged change
Natural-language instructions guide an agent; they are not a substitute for checking its output. GitHub cautions that Copilot may not follow custom instructions exactly every time: GitHub’s customization documentation.
Rank #4
- Confirm the message describes what is staged, not an earlier or broader version of the work.
- Check the subject against recent project commits and the contribution guide.
- Read the body, if present, for a clear problem and rationale; remove unsupported claims or unnecessary detail.
- Check required ticket references or trailers, and remove prefixes the project does not use.
Add a stricter check when consistency must be enforced
If a team needs more than guidance, Git supports hooks that can inspect or normalize a proposed commit message. A commit-msg hook receives the message and can reject or adjust it; Git documents this alongside other commit hooks in its commit-message guidance. This is a stronger workflow backstop than asking an agent to remember a rule, but it is not an absolute enforcement boundary: Git says hooks can be bypassed with --no-verify.
Choose the level of structure to match the team’s needs. A concise title may be enough for routine changes; a body is valuable when readers need the problem and reasoning; a hook is appropriate when a specific format must be checked. A 50-character subject, a prefix schema, and a body on every commit are not universal requirements—follow the repository’s convention.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




