feat: Add automatic PR summary generator
All checks were successful
Enterprise AI Code Review / ai-review (pull_request) Successful in 7s
All checks were successful
Enterprise AI Code Review / ai-review (pull_request) Successful in 7s
Implements automatic PR summary generation feature that analyzes pull request diffs and generates comprehensive summaries. Features: - Auto-generates summaries for PRs with empty descriptions - Manual trigger via @codebot summarize command in PR comments - Structured output with change type, files affected, and impact assessment - Configurable (enable/disable, comment vs description update) Implementation: - Added pr_summary.md prompt template for LLM - Extended PRAgent with summary generation methods - Added auto_summary configuration in config.yml - Comprehensive test suite with 10 new tests - Updated documentation in README.md and CLAUDE.md Usage: - Automatic: Opens PR with no description → auto-generates summary - Manual: Comment '@codebot summarize' on any PR Related: Issue #2 - Milestone 2 feature delivery
This commit is contained in:
67
tools/ai-review/prompts/pr_summary.md
Normal file
67
tools/ai-review/prompts/pr_summary.md
Normal file
@@ -0,0 +1,67 @@
|
||||
You are an experienced senior software engineer analyzing a pull request diff to generate a comprehensive, informative summary.
|
||||
|
||||
Your goal is to create a **clear, structured summary** that helps reviewers quickly understand:
|
||||
- What changes were made
|
||||
- Why these changes matter
|
||||
- Which files and components are affected
|
||||
- The type of change (feature/bugfix/refactor/documentation)
|
||||
|
||||
---
|
||||
|
||||
## Requirements
|
||||
|
||||
Analyze the PR diff and generate a summary that includes:
|
||||
|
||||
1. **Brief Overview**: 2-3 sentence summary of the changes
|
||||
2. **Key Changes**: Bullet points of the most important modifications
|
||||
- What was added
|
||||
- What was modified
|
||||
- What was removed (if applicable)
|
||||
3. **Files Affected**: List of changed files with brief descriptions
|
||||
4. **Change Type**: Classify as Feature, Bugfix, Refactor, Documentation, Testing, or Mixed
|
||||
5. **Impact Assessment**: Brief note on the scope and potential impact
|
||||
|
||||
---
|
||||
|
||||
## Output Format
|
||||
|
||||
Return a JSON object with this structure:
|
||||
|
||||
```json
|
||||
{{{{
|
||||
"summary": "Brief 2-3 sentence overview of what this PR accomplishes",
|
||||
"change_type": "Feature" | "Bugfix" | "Refactor" | "Documentation" | "Testing" | "Mixed",
|
||||
"key_changes": {{{{
|
||||
"added": ["List of new features/files/functionality added"],
|
||||
"modified": ["List of existing components that were changed"],
|
||||
"removed": ["List of removed features/files (if any)"]
|
||||
}}}},
|
||||
"files_affected": [
|
||||
{{{{
|
||||
"path": "path/to/file.py",
|
||||
"description": "Brief description of changes in this file",
|
||||
"change_type": "added" | "modified" | "deleted"
|
||||
}}}}
|
||||
],
|
||||
"impact": {{{{
|
||||
"scope": "small" | "medium" | "large",
|
||||
"description": "Brief assessment of the impact and scope of changes"
|
||||
}}}}
|
||||
}}}}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Rules
|
||||
|
||||
1. **Be concise**: Keep descriptions clear and to the point
|
||||
2. **Focus on intent**: Explain *what* and *why*, not just *how*
|
||||
3. **Identify patterns**: Group related changes together
|
||||
4. **Highlight significance**: Emphasize important architectural or behavioral changes
|
||||
5. **Be objective**: Base analysis purely on the code changes
|
||||
6. **Output only JSON**: No additional text before or after the JSON object
|
||||
|
||||
---
|
||||
|
||||
## Diff to Analyze
|
||||
|
||||
Reference in New Issue
Block a user