conventional-commit.prompt
Guides you to write conventional commit messages for staged Git changes using a structured XML prompt template.
What this file does
Guides you to write conventional commit messages for staged Git changes using a structured XML prompt template.
When to use it
- You want consistent commit messages across a team
- You need to enforce commit message formatting in CI
- You are automating commit message generation with an AI assistant
- You want to include breaking change markers and issue references
Assumes this stack
description: 'Prompt and workflow for generating conventional commit messages for staged changes using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation.'
Instructions
This file contains a prompt template for generating conventional commit messages for staged changes. It provides instructions, examples, and formatting guidelines to help users write standardized, descriptive commit messages in accordance with the Conventional Commits specification.
Workflow
Follow these steps:
- Run
git statusto review staged files. - Run
git diff --cachedto inspect staged changes.
Commit Message Structure
- You must use max 50 characters for the description.
- You must include body if the change is modifying more than one file.
- You must use imperative mood in the description. Not "moved", but "move".
<commit-message>
<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert</type>
<scope>()</scope>
<description>A short, imperative summary of the change</description>
<body>(more detailed explanation)</body>
<footer>(optional: e.g. BREAKING CHANGE: details, or issue references)</footer>
</commit-message>
Examples
<examples>
<example>feat(parser): add ability to parse arrays</example>
<example>fix(ui): correct button alignment</example>
<example>docs: update README with usage instructions</example>
<example>refactor: improve performance of data processing</example>
<example>chore: update dependencies</example>
<example>feat!: send email on registration (BREAKING CHANGE: email service required)</example>
</examples>
fix: prevent racing of requests
Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.
Remove timeouts which were used to mitigate the racing issue but are
obsolete now.
Reviewed-by: Z
Refs: #123
chore!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6.
Validation
<validation>
<type>Must be one of the allowed types. See <reference>https://www.conventionalcommits.org/en/v1.0.0/#specification</reference></type>
<scope>Optional, but recommended for clarity.</scope>
<description>Required. Use the imperative mood (e.g., "add", not "added").</description>
<body>Optional. Use for additional context.</body>
<footer>Use for breaking changes or issue references.</footer>
</validation>
Final Step
<final-step>
<cmd>git commit -m "type(scope): description"</cmd>
<note>Replace with your constructed message. Include body and footer if needed.</note>
</final-step>
What's inside
1 XML prompt template, 6 commit examples, 1 validation section, 1 final step with command
Change this for your project
- Replace
Cyber-Syntax/copilot-instructionswith your own repository name if copying the file - Replace
https://www.conventionalcommits.org/en/v1.0.0/#specificationwith your own commit style guide URL if different
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Use XML tags to structure AI prompts for predictable output
- Include validation rules directly in the prompt to reduce errors
- Provide concrete examples alongside abstract instructions
Related Documents
How you work
Defines personality, planning, task execution, and communication conventions for a coding agent in the Codex CLI environment.
内置 Agent 提示词
Documents the system prompts, tool permissions, and model assignments for six built-in subagents in Claude Code.
System Prompt — Voice Interview Agent
Defines a voice agent named Carol that conducts structured five-question interviews about gender topics for a magazine article.
SolidInvoice - AI Assistant Guide
Guides AI assistants on SolidInvoice's architecture, conventions, workflows, and best practices for contributing to the codebase.