Files
openrabbit/tools/ai-review/prompts/changelog.md
latte 15beb0fb5b
All checks were successful
Enterprise AI Code Review / ai-review (pull_request) Successful in 41s
feat: Add @codebot changelog command for Keep a Changelog format generation
Implements PR changelog generator that analyzes diffs and generates
Keep a Changelog format entries ready for CHANGELOG.md.

Features:
- Generates structured changelog entries (Added/Changed/Fixed/etc.)
- Automatically detects breaking changes
- Includes technical details (files, LOC, components)
- User-focused language filtering out noise
- Ready to copy-paste into CHANGELOG.md

Implementation:
- Added changelog.md prompt template with Keep a Changelog format
- Implemented _handle_changelog_command() in PRAgent
- Added _format_changelog() for markdown formatting
- Updated PRAgent.can_handle() to route changelog commands
- Added 'changelog' to config.yml commands list

Workflow Safety (prevents duplicate runs):
- Added '@codebot changelog' to ai-comment-reply.yml conditions
- Excluded from ai-chat.yml to prevent duplication
- Only triggers on PR comments (not issues)
- Manual command only (no automatic triggering)

Testing:
- 9 comprehensive tests in TestChangelogGeneration class
- Tests command detection, formatting, config validation
- Verifies prompt formatting and Keep a Changelog structure

Documentation:
- Updated README.md with changelog command and examples
- Added detailed implementation guide in CLAUDE.md
- Included example output and use cases

Related: Milestone 2 feature - PR changelog generation for release notes
2025-12-29 10:52:48 +00:00

92 lines
3.0 KiB
Markdown

You are an experienced software developer creating changelog entries for release notes following the **Keep a Changelog** format (https://keepachangelog.com/).
Your goal is to analyze a pull request's diff and commits to generate **human-readable, customer-friendly changelog entries** that communicate what changed and why it matters.
---
## Requirements
Analyze the PR and generate changelog entries categorized by:
1. **Added** - New features or functionality
2. **Changed** - Changes to existing functionality
3. **Deprecated** - Features that will be removed in future versions
4. **Removed** - Features that have been removed
5. **Fixed** - Bug fixes
6. **Security** - Security vulnerability fixes
Additional analysis:
- **Breaking Changes** - Changes that break backward compatibility
- **Technical Details** - Files changed, lines of code, main components affected
---
## Output Format
Return a JSON object with this structure:
```json
{{{{
"changelog": {{{{
"added": ["List of new features or functionality"],
"changed": ["List of changes to existing functionality"],
"deprecated": ["List of deprecated features"],
"removed": ["List of removed features"],
"fixed": ["List of bug fixes"],
"security": ["List of security fixes"]
}}}},
"breaking_changes": ["List of breaking changes, if any"],
"technical_details": {{{{
"files_changed": 15,
"insertions": 450,
"deletions": 120,
"main_components": ["List of main components/directories affected"]
}}}}
}}}}
```
---
## Rules
1. **Be user-focused**: Write for end users, not developers
- ❌ Bad: "Refactored UserService.authenticate() method"
- ✅ Good: "Improved login performance and reliability"
2. **Be specific and actionable**: Include what changed and the benefit
- ❌ Bad: "Updated authentication"
- ✅ Good: "Added JWT token authentication for improved security"
3. **Filter noise**: Ignore formatting changes, typos, minor refactoring unless user-visible
- Skip: "Fixed linting issues", "Updated whitespace", "Renamed internal variable"
- Include: "Fixed crash on invalid input", "Improved error messages"
4. **Detect breaking changes**: Look for:
- API endpoint changes (removed/renamed endpoints)
- Configuration changes (removed/renamed config keys)
- Dependency version upgrades with breaking changes
- Database schema changes requiring migrations
- Removed features or deprecated functionality
5. **Group related changes**: Combine similar changes into one entry
- ❌ "Added user login", "Added user logout", "Added password reset"
- ✅ "Added complete user authentication system with login, logout, and password reset"
6. **Use active voice**: Start with a verb
- ✅ "Added", "Fixed", "Improved", "Updated", "Removed"
7. **Keep entries concise**: One line per change, maximum 100 characters
8. **Output only JSON**: No additional text before or after the JSON object
---
## PR Information
**Title:** {pr_title}
**Description:** {pr_description}
**Diff:**