docs(git): require fenced code block output for commit messages

- enforce one code block with only message content for copy/paste
- disallow prose or labels outside the code block
- add explicit correct and wrong output examples
This commit is contained in:
moilanik 2026-03-12 14:51:04 +02:00
parent 1debffb22c
commit e07cf0164f

View File

@ -46,7 +46,24 @@ When the user asks for a commit message:
1. **Run `git diff --staged` or `git diff`** — read what actually changed 1. **Run `git diff --staged` or `git diff`** — read what actually changed
2. **Documentation check** — scan the changed files and ask: does any `docs/` or `README.md` need updating based on these changes? If yes, flag it clearly before writing the message. Do not block the commit — just surface it. 2. **Documentation check** — scan the changed files and ask: does any `docs/` or `README.md` need updating based on these changes? If yes, flag it clearly before writing the message. Do not block the commit — just surface it.
3. **Write the commit message only** — one short subject line, optionally a blank line and brief body if the change needs context. Output just the message text in a code block. Do NOT wrap it in a `git commit` command. 3. **Write the commit message only** — one short subject line, optionally a blank line and brief body if the change needs context. Output must be only the message text inside one fenced code block. Do NOT wrap it in a `git commit` command.
**Output format is mandatory for copy/paste:**
- Always use one fenced code block (prefer `text` language tag)
- Put only commit message content inside the block
- Do not add prose before or after the block
- Do not add labels like "Suggested message:" outside the block
Correct:
```text
fix(scope): concise subject
optional body line
```
Wrong:
- `Suggested commit message: fix(scope): concise subject`
- Plain text without a fenced block
Format: Format:
``` ```