Engineering leads and release managers need changelogs that categorize every commit by impact: breaking changes, features, fixes, and maintenance. Manual curation is slow and error-prone. This prompt converts a raw git log into a structured changelog with linked issues, contributor attribution, and category assignments. Use it when you have commit history from a version control system and need a draft changelog that a human can review and publish.
Prompt
Commit History to Structured Changelog Prompt Template

When to Use This Prompt
Convert raw git log output into a structured, categorized changelog ready for human review and publication.
The prompt expects a formatted git log as input—typically generated with a command like git log v1.0.0..v1.1.0 --pretty=format:'%h %s (%an) [%ai]' --no-merges. It works best with commit messages that follow a conventional format (e.g., feat:, fix:, BREAKING CHANGE:), but the prompt includes instructions to infer categories from unstructured messages when conventions are absent. The output schema includes fields for category, summary, commit hash, author, date, linked issues, and a migration note flag for breaking changes.
Do not use this prompt for real-time incident communication, legal compliance filings, or security vulnerability disclosures where exact wording is regulated. For security patches, use the Security Patch Release Note Prompt Template instead. For breaking changes that require detailed migration guides, pair this prompt with the Breaking Change Detection and Migration Guidance Prompt Template. Always run the Changelog Entry Validation and QA Prompt Template against the output before publication.
Use Case Fit
Where this prompt works, where it fails, and what you must provide before running it in production.
Good Fit: Conventional Commits
Use when: commit history follows a consistent convention (Conventional Commits, semantic-prefix, or team-standard format). The prompt can parse feat:, fix:, BREAKING CHANGE: tokens reliably. Guardrail: validate that at least 80% of commits match the expected pattern before running the prompt; otherwise, fall back to manual categorization.
Bad Fit: Unstructured or Squash-Merged History
Avoid when: the repository uses squash merges that discard individual commit messages, or commit messages are vague (wip, fix stuff, updates). The prompt will hallucinate categories or produce empty sections. Guardrail: require PR descriptions or issue tracker data as supplementary input; do not rely on commit messages alone.
Required Inputs
Must provide: a git log or commit list with at minimum hash, author, date, and message body. Optional but recommended: PR numbers, issue references, and previous changelog for diff context. Guardrail: strip CI-generated commits, merge commits, and bot-authored noise before passing to the prompt to reduce token waste and miscategorization.
Operational Risk: Contributor Attribution Gaps
Risk: commit authors may use different emails, usernames, or pair-programming aliases, causing duplicate or missing contributor entries. Guardrail: run a .mailmap normalization step or identity resolution before the prompt; validate the output contributor list against expected team members.
Operational Risk: Breaking Change Misses
Risk: breaking changes not explicitly marked with BREAKING CHANGE: or ! in the commit footer will be miscategorized as features or fixes. Guardrail: add a post-generation validation step that cross-references the changelog against a manual breaking-change checklist or tagged issues; flag entries that modify public API surfaces without the breaking label.
Scale Limit: Large Commit Ranges
Risk: passing thousands of commits in a single prompt window causes truncation, category collapse, or hallucinated entries. Guardrail: chunk commits by release tag or date range; process each chunk independently, then run a deduplication and merge step. Set a hard cap of 200-300 commits per prompt call.
Copy-Ready Prompt Template
A copy-ready prompt that converts raw git commit history into a structured, categorized changelog with linked issues and contributor attribution.
This prompt template transforms a raw git log into a structured changelog suitable for release notes. It instructs the model to categorize each commit as a Breaking Change, Feature, Fix, or Maintenance item, link to referenced issues, and credit contributors. Use this as the foundation for your changelog automation pipeline, adapting the placeholders to match your repository's conventions and output format requirements.
codeYou are a technical release manager converting raw git commit history into a structured changelog. ## INPUT Commit history (one commit per line, oldest first):
[COMMIT_HISTORY]
code## OUTPUT SCHEMA Return a JSON object with the following structure: { "release_version": "[RELEASE_VERSION]", "release_date": "[RELEASE_DATE]", "categories": { "breaking_changes": [ { "description": "Human-readable summary of the breaking change", "commit": "[commit_hash]", "issue_refs": ["#123", "#456"], "contributors": ["[author_name]"], "migration_notes": "What consumers must do to adapt, if known" } ], "features": [ { "description": "Human-readable summary of the new feature", "commit": "[commit_hash]", "issue_refs": ["#789"], "contributors": ["[author_name]"] } ], "fixes": [ { "description": "Human-readable summary of the bug fix", "commit": "[commit_hash]", "issue_refs": ["#101"], "contributors": ["[author_name]"] } ], "maintenance": [ { "description": "Human-readable summary of refactoring, dependency bumps, or CI changes", "commit": "[commit_hash]", "issue_refs": [], "contributors": ["[author_name]"] } ] }, "contributor_summary": { "[author_name]": { "commit_count": 5, "categories_contributed_to": ["features", "fixes"] } }, "statistics": { "total_commits": 42, "breaking_changes_count": 1, "features_count": 5, "fixes_count": 12, "maintenance_count": 24 } } ## CONSTRAINTS - Categorize each commit into exactly one category: breaking_changes, features, fixes, or maintenance. - A breaking change is any commit that removes, renames, or alters existing behavior in a way that requires consumer code changes. Look for keywords like "BREAKING", "remove", "deprecate", "rename", or conventional commit "!" suffix. - Extract issue references from commit messages using patterns like "#123", "fixes #456", or "closes #789". - Extract contributor names from the commit author field. - If a commit message is vague (e.g., "fix stuff"), infer the best category from the diff context if available, or default to "maintenance" and note the ambiguity. - Do not invent changes not present in the commit history. - If [RELEASE_VERSION] is empty, omit the "release_version" field. - If [RELEASE_DATE] is empty, omit the "release_date" field. ## EXAMPLES Input commit: "a1b2c3d feat: add user export endpoint (#42) (Jane Smith)" Output entry: { "description": "Add user export endpoint", "commit": "a1b2c3d", "issue_refs": ["#42"], "contributors": ["Jane Smith"] } -> category: features Input commit: "e5f6g7h fix: resolve timeout on large datasets (#88) (John Doe)" Output entry: { "description": "Resolve timeout on large datasets", "commit": "e5f6g7h", "issue_refs": ["#88"], "contributors": ["John Doe"] } -> category: fixes Input commit: "i9j0k1l chore: bump lodash to 4.17.21 (Alice Wong)" Output entry: { "description": "Bump lodash to 4.17.21", "commit": "i9j0k1l", "issue_refs": [], "contributors": ["Alice Wong"] } -> category: maintenance
Before wiring this into production, replace [COMMIT_HISTORY] with your actual git log output (formatted as one commit per line with hash, message, and author). Replace [RELEASE_VERSION] and [RELEASE_DATE] with your release metadata, or remove those fields from the schema if you inject them downstream. Test the prompt against a known release with a manually verified changelog to calibrate category accuracy before automating. For high-stakes releases, always route the output through human review and cross-reference against your issue tracker to catch misclassified or missing entries.
Prompt Variables
Inputs the prompt needs to produce a reliable, structured changelog from commit history. Validate each placeholder before calling the model to prevent category misclassification and contributor misattribution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[COMMIT_HISTORY] | Raw git log output or structured commit data to convert into changelog entries | git log v1.2.0..v1.3.0 --oneline --format='%h %s (%an)' | Must contain at least one commit. Validate that the input is not empty and includes commit messages. For structured input, confirm required fields (hash, message, author) are present. |
[VERSION] | Target release version for the changelog | v1.3.0 | Must match semver pattern (MAJOR.MINOR.PATCH). Reject if version is missing or does not match the tag format used in the repository. |
[PREVIOUS_VERSION] | Previous release version for diff baseline | v1.2.0 | Must be a valid git tag or release identifier. Validate that [PREVIOUS_VERSION] is chronologically before [VERSION]. Null allowed for initial release. |
[REPOSITORY_NAME] | Name of the repository for context and linking | api-gateway | Must be a non-empty string. Used to construct issue and PR links. Validate against known repository naming conventions. |
[ISSUE_TRACKER_URL] | Base URL for the issue tracker to generate clickable references | Must be a valid URL. Validate that the URL is reachable or matches the expected pattern for the organization's issue tracker. Null allowed if no issue linking is required. | |
[CHANGELOG_CATEGORIES] | List of categories to classify commits into | ['Breaking Changes', 'Features', 'Fixes', 'Maintenance', 'Documentation'] | Must be a non-empty array of strings. Validate that categories cover the expected changelog sections. Default to standard categories if not provided. |
[CONTRIBUTOR_MAP] | Mapping of commit author emails or usernames to display names for attribution | {'alice@example.com': 'Alice Chen', 'bob@example.com': 'Bob Smith'} | Must be a valid JSON object. Validate that keys match author identifiers in [COMMIT_HISTORY]. Missing entries will result in raw email display; warn on unmatched authors. |
[OUTPUT_FORMAT] | Desired output structure for the changelog | markdown | Must be one of: 'markdown', 'json', 'yaml'. Validate against allowed format list. Default to 'markdown' if not specified. Schema validation applies for structured formats. |
Implementation Harness Notes
How to wire the commit-to-changelog prompt into a CI/CD pipeline or release workflow with validation, retries, and human review gates.
This prompt is designed to run as a step in an automated release pipeline, not as a one-off manual copy-paste. The typical integration point is after a release branch is cut or a tag is pushed, where git log output from the relevant commit range is piped into the prompt. The harness should supply the raw commit history as [COMMIT_HISTORY], a target version string as [VERSION], and a repository identifier as [REPO_NAME]. The prompt expects the commit history to include full commit messages, not just subjects, so the harness must use git log --format=fuller or an equivalent command that captures the body and author fields. If your commit convention uses conventional commits, include that convention in [COMMIT_CONVENTION] to improve categorization accuracy.
Validation and retry logic is critical because changelogs ship to users. After the model returns the structured changelog, the harness must validate the output against the expected JSON schema: confirm that every entry has a non-empty category, description, and commit reference, and that categories are limited to the allowed set (breaking, feature, fix, maintenance, dependency). If validation fails, retry once with the validation errors appended to the prompt as [PREVIOUS_ERRORS]. If the retry also fails, flag the run for human review and do not auto-publish. For contributor attribution, cross-reference extracted author emails against a team roster or .mailmap file to deduplicate identities before the entry is finalized.
Model choice and tool use should favor models with strong structured output support. Use a model that supports JSON mode or function calling with a strict schema, and set response_format to json_schema where available. If your pipeline already uses a GitHub or GitLab API, add a post-processing step that enriches each changelog entry with issue titles and PR descriptions fetched via the API, rather than asking the model to hallucinate them. For high-volume repositories with hundreds of commits per release, split the commit history into batches of 50–100 commits, run the prompt per batch, and merge the results with a deduplication pass. Log every run's input commit range, output, validation result, and reviewer decision for auditability.
Human review gates should be mandatory for any entry categorized as breaking and for any release where the model's confidence score (if you request one in [OUTPUT_SCHEMA]) falls below a threshold. Integrate the review step into your existing PR or release approval workflow: post the generated changelog as a draft in a release issue or PR description, and require an engineering lead or technical writer to approve before the changelog is published to your docs site or GitHub Releases. Avoid the temptation to fully automate changelog publication without review—mischaracterized breaking changes erode developer trust faster than a delayed release note.
Expected Output Contract
Fields, format, and validation rules for the structured changelog generated from commit history. Use this contract to build a parser or validator before the output enters your release pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
changelog.version | string (semver) | Must match semver pattern (MAJOR.MINOR.PATCH). Reject if missing or malformed. | |
changelog.release_date | string (ISO 8601) | Must parse as valid date. Reject if date is in the future or before the previous release date. | |
changelog.categories | array of objects | Must contain at least one category. Allowed category names: breaking_changes, features, fixes, maintenance, deprecations, security, known_issues. Reject unknown categories. | |
changelog.categories[].name | string (enum) | Must match one of the allowed category names exactly. Case-sensitive check required. | |
changelog.categories[].entries | array of objects | Must contain at least one entry per category. Empty array allowed only for known_issues. | |
changelog.categories[].entries[].summary | string | Must be non-empty, 10-200 characters. Reject if summary contains unresolved commit hashes or placeholder text like 'TODO' or 'fix stuff'. | |
changelog.categories[].entries[].commit_refs | array of strings | Each string must match a valid short (7-char) or full (40-char) hex SHA pattern. Reject if array is empty for non-maintenance categories. | |
changelog.categories[].entries[].linked_issues | array of strings | If present, each string must match issue reference pattern (e.g., '#1234' or full URL). Null allowed. Reject malformed references. | |
changelog.categories[].entries[].contributors | array of strings | Must contain at least one contributor handle or name. Reject empty array. Deduplication check: same contributor should not appear twice per entry. | |
changelog.migration_notes | string or null | If breaking_changes category has entries, this field must be non-null and non-empty. Reject if breaking changes exist but migration_notes is null or whitespace. |
Common Failure Modes
What breaks first when converting commit histories into structured changelogs, and how to guard against it in production.
Category Misclassification
What to watch: The model miscategorizes a breaking change as a feature, or buries a security fix under maintenance. This happens when commit messages are ambiguous or use internal jargon. Guardrail: Add a pre-processing step that scans commit messages for breaking change indicators (e.g., 'BREAKING:', '!:', 'major:') and injects them as explicit hints into the prompt. Validate category assignments against a known taxonomy before publishing.
Contributor Attribution Collapse
What to watch: The model merges multiple contributors into one, attributes work to the wrong person, or fails to deduplicate authors with different email addresses. This erodes trust with engineering teams. Guardrail: Extract contributor mappings from git log (--format='%an <%ae>') and provide them as a structured lookup table in the prompt. Post-process output to verify every attributed commit exists in the source log.
Issue Reference Hallucination
What to watch: The model invents issue numbers, links to non-existent tickets, or confuses similar-sounding issue IDs across repositories. This breaks traceability and frustrates readers who click dead links. Guardrail: Provide a validated list of closed issue IDs and URLs as grounded context. Add an output validator that checks every referenced issue against the source tracker API before the changelog is published.
Breaking Change Understatement
What to watch: The model softens breaking change language, omits migration steps, or fails to flag deprecated surfaces that will break downstream consumers. This causes production incidents when users upgrade. Guardrail: Require every breaking change entry to include a migration_required boolean and a before/after code block. If the model cannot produce both, escalate the entry for human review before release.
Merge Commit Noise Pollution
What to watch: The model treats every merge commit as a meaningful entry, flooding the changelog with 'Merge branch X into Y' noise that obscures actual changes. Guardrail: Filter merge commits from the input unless they resolve conflicts with substantive changes. Use git log --no-merges or equivalent filtering before passing commit history to the prompt.
Version Scope Drift
What to watch: The model includes commits from outside the target version range, pulling in changes from future or unrelated branches. This makes the changelog inaccurate for the specific release. Guardrail: Constrain the input to commits between two verified git tags or SHAs. Add a pre-generation check that confirms the commit range matches the intended release boundary, and reject output that references commits outside that range.
Evaluation Rubric
Criteria for testing changelog output quality before shipping. Run these checks against a sample of generated entries to catch category errors, missing attribution, and vague language before the changelog reaches users.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Category Accuracy | Every entry is assigned to exactly one correct category: breaking, feature, fix, maintenance, or security | A breaking change appears under Features or a fix is labeled as maintenance | Spot-check 20 random entries; compare category against commit message and diff context |
Breaking Change Detection | All entries that remove, rename, or alter existing public API behavior are flagged as breaking | A deprecated parameter removal or signature change appears without a breaking label | Diff the generated changelog against a manual list of known breaking changes from the release manager |
Issue Reference Linkage | Every entry that references an issue includes a valid, resolvable link to the issue tracker | Issue references are missing, malformed, or point to closed unrelated issues | Parse all issue references with a regex; attempt HEAD requests against each URL |
Contributor Attribution | Each entry credits the correct contributor handle extracted from commit author metadata | A commit by user A is attributed to user B or the author field is empty | Sample 15 entries; compare the credited handle against git log author for the linked commit |
Vagueness Check | No entry uses placeholder phrases like 'various fixes', 'improvements', or 'other changes' without specifics | An entry reads 'Fixed some bugs' or 'General improvements' | Run a banned-phrase grep across all entry descriptions; flag any match |
Migration Note Presence | Every breaking change entry includes a concrete migration step or before/after code example | A breaking entry describes the change but provides no upgrade path for consumers | Check each breaking entry for a non-empty migration_notes field with at least one actionable sentence |
Duplicate Entry Prevention | No single change appears in more than one category or as multiple entries in the same category | The same commit hash or issue ID appears in two different entries | Group entries by commit SHA; flag any SHA that appears more than once |
Semantic Version Alignment | The distribution of breaking, feature, and fix entries supports the declared semver bump | A major version bump contains zero breaking entries, or a patch bump contains new features | Count entries per category; validate against semver rules: major requires >=1 breaking, minor requires >=1 feature and zero breaking, patch requires zero breaking and zero features |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a single git log dump. Use a lightweight model (GPT-4o-mini, Claude Haiku) with relaxed output validation. Skip contributor deduplication and cross-reference checks initially. Focus on getting category assignment (breaking, feature, fix, maintenance) correct before adding linked issues.
code[COMMIT_HISTORY] Group into: breaking, features, fixes, maintenance. For each entry include: commit message, author, date.
Watch for
- Merge commits and revert commits appearing as features
- Vague commit messages producing useless entries
- Category misclassification when commits touch multiple concerns

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us