|
| 1 | +--- |
| 2 | +name: engineering-change-descriptions |
| 3 | +description: 'Use when writing, rewriting, or reviewing PR/CL descriptions, commit messages, or code-change summaries that explain what changed and why. TRIGGER on "write PR description", "improve this commit message", "summarize this diff", "CL description", "change description", or "make this PR/CL description easier to review". DO NOT TRIGGER for code review, PR splitting, code restructuring, user-facing changelogs, or reviewer replies unless the requested output is a change description.' |
| 4 | +--- |
| 5 | + |
| 6 | +# Engineering Change Descriptions |
| 7 | + |
| 8 | +A change description is permanent engineering history. It should let reviewers understand the change now and help future maintainers find and understand it later. |
| 9 | + |
| 10 | +Adapted from Google Engineering Practices Documentation, especially "Writing good CL descriptions." Source: <https://google.github.io/eng-practices/review/developer/cl-descriptions.html>. License: CC-BY 3.0. |
| 11 | + |
| 12 | +## What a Good Description Answers |
| 13 | + |
| 14 | +- What changed? |
| 15 | +- Why did it change? |
| 16 | +- What context, constraints, or tradeoffs are not obvious from the code? |
| 17 | +- How was it tested? |
| 18 | +- What risks, migrations, rollbacks, or follow-ups should reviewers know? |
| 19 | + |
| 20 | +Even small changes deserve context when the reason is not obvious. |
| 21 | + |
| 22 | +## First Line |
| 23 | + |
| 24 | +The first line should: |
| 25 | + |
| 26 | +- Stand alone in version control history. |
| 27 | +- Be short, specific, and focused on what the change does. |
| 28 | +- Use an imperative form when writing a commit or CL title. |
| 29 | +- Avoid vague labels like "fix bug", "cleanup", "phase 1", "misc", or "add helpers". |
| 30 | +- Be followed by a blank line when there is a body. |
| 31 | + |
| 32 | +## Body |
| 33 | + |
| 34 | +Include only useful context: |
| 35 | + |
| 36 | +- Problem being solved. |
| 37 | +- Why this approach was chosen. |
| 38 | +- User-visible or developer-visible behavior changes. |
| 39 | +- Important implementation notes. |
| 40 | +- Known limitations or follow-up work. |
| 41 | +- Bug IDs, issue links, benchmark results, design docs, migration docs, or rollout plans. |
| 42 | +- Enough context for links that might later become inaccessible. |
| 43 | +- Test commands and results, when appropriate. |
| 44 | + |
| 45 | +Before submitting, reread the description after review changes and make sure it still matches the final diff. |
| 46 | + |
| 47 | +## Templates |
| 48 | + |
| 49 | +### Standard PR |
| 50 | + |
| 51 | +```markdown |
| 52 | +[Imperative one-line summary] |
| 53 | + |
| 54 | +## Why |
| 55 | +[Problem, user need, production issue, maintainability reason, or design context.] |
| 56 | + |
| 57 | +## What Changed |
| 58 | +- ... |
| 59 | +- ... |
| 60 | + |
| 61 | +## Testing |
| 62 | +- ... |
| 63 | + |
| 64 | +## Risk / Rollback |
| 65 | +- Risk: |
| 66 | +- Rollback: |
| 67 | +``` |
| 68 | + |
| 69 | +### Small Change |
| 70 | + |
| 71 | +```markdown |
| 72 | +[Imperative one-line summary] |
| 73 | + |
| 74 | +[One paragraph explaining why this change exists and any non-obvious context.] |
| 75 | + |
| 76 | +Testing: [command or manual check] |
| 77 | +``` |
| 78 | + |
| 79 | +### Refactor |
| 80 | + |
| 81 | +```markdown |
| 82 | +[Describe the structural change and what it replaces] |
| 83 | + |
| 84 | +This prepares for [future change] by [specific reason], without intentionally changing behavior. |
| 85 | + |
| 86 | +Testing: [existing or new tests that protect behavior] |
| 87 | +``` |
| 88 | + |
| 89 | +### Generated or Mechanical Change |
| 90 | + |
| 91 | +```markdown |
| 92 | +[Describe the mechanical rewrite] |
| 93 | + |
| 94 | +Generated by [tool/version/command] to [reason]. Manual edits: [none/list]. |
| 95 | + |
| 96 | +Verification: [format/test/build command] |
| 97 | +``` |
| 98 | + |
| 99 | +## Rewrite Checklist |
| 100 | + |
| 101 | +When improving an existing description: |
| 102 | + |
| 103 | +1. Extract the actual behavior from the diff. |
| 104 | +2. Replace vague first lines with a concrete action. |
| 105 | +3. Add the missing why. |
| 106 | +4. Preserve useful issue links and test evidence. |
| 107 | +5. Remove process noise that does not help reviewers or future maintainers. |
| 108 | + |
| 109 | +## Common Mistakes |
| 110 | + |
| 111 | +- Describing only the implementation without the reason. |
| 112 | +- Writing a title that future searchers cannot distinguish from similar changes. |
| 113 | +- Depending entirely on external links for crucial context. |
| 114 | +- Leaving the description stale after review significantly changes the diff. |
| 115 | +- Hiding risk, limitations, or rollout requirements because they feel inconvenient. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +*Also published in [agentara/skills](https://github.com/agentara/skills/tree/main/skills/engineering) (MIT, Copyright (c) 2026 agentara) by the same author. The content is adapted from Google Engineering Practices under CC-BY 3.0; see the source note above. Full notices: [`NOTICE.md`](../../NOTICE.md).* |
0 commit comments