Output Format
Understanding the structure and format of CommitStudio's AI-generated code reviews
Output Format
CommitStudio produces structured output for code reviews. This document explains the format of the AI-generated analysis results.
Analysis Structure
Each commit analysis is structured with three main components:
- Summary: A high-level overview of the changes
- Comments: Detailed observations on specific parts of the code
- Suggestions: Recommendations for improvements
JSON Structure
When accessing the analysis programmatically, the data is structured as follows:
{
"commitSha": "abc123...",
"commitMessage": "Original commit message",
"summary": "A comprehensive overview of the changes in this commit...",
"comments": [
{
"file": "src/utils/helpers.js",
"line": "42",
"content": "This function might cause memory leaks because..."
},
{
"file": "src/components/Button.tsx",
"content": "The naming convention used here differs from the rest of the codebase..."
}
],
"suggestions": [
"Consider adding unit tests for the new utility functions",
"The error handling could be improved to be more specific about failure modes"
]
}
Fields Explanation
Root Level
| Field | Type | Description |
|-------|------|-------------|
| commitSha
| String | The SHA identifier of the analyzed commit |
| commitMessage
| String | The original commit message |
| summary
| String | A comprehensive overview of the changes |
| comments
| Array | Specific observations about parts of the code |
| suggestions
| Array | Recommendations for improvements |
Comments
Each entry in the comments
array has the following structure:
| Field | Type | Description |
|-------|------|-------------|
| file
| String | The path to the file being commented on |
| line
| String (optional) | The line number if the comment is line-specific |
| content
| String | The actual comment text |
GitHub Comment Format
When posted to GitHub, the analysis is formatted as a markdown comment with sections:
## AI Code Review Summary
An overview of the changes in this commit, discussing the main modifications and their impact.
### Specific Comments
#### src/utils/helpers.js
This function might cause memory leaks because it doesn't properly clean up event listeners.
#### src/components/Button.tsx
The naming convention used here differs from the rest of the codebase, which could lead to confusion.
### Suggestions
1. Consider adding unit tests for the new utility functions
2. The error handling could be improved to be more specific about failure modes
---
*Generated by CommitStudio v0.3.5*
Console Output
When running in verbose mode, the tool outputs analysis details to the console:
✓ Analyzing commit abc123...
↪ Summary: Fixed authentication bug in login form
↪ Comments: 3
↪ Suggestions: 2
✓ Posted comments to GitHub
YOLO Mode Output
In YOLO mode, the output includes a before/after comparison of commit messages:
Commit: abc123...
Original: fix login bug
Improved: 🐛 Fix authentication timeout issue in login form that prevented users from accessing the dashboard
Related Topics
- CLI Reference - Command line interface documentation
- JavaScript API - Programmatic usage of CommitStudio
- Standard Mode - Understanding how standard analysis works