Built-in Module
git.diff
Generate git diffs for AI code review workflows. Outputs diff text that can be passed to ai.generate.
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
| operation | string | Yes | Operation type: diff, log, show |
| base_branch | string | No | Branch to diff against (default: main) |
| max_lines | number | No | Maximum diff lines to return (default: 500) |
Examples
Generate PR Diff
json
{
"id": "get_diff",
"type": "git.diff",
"config": {
"operation": "diff",
"base_branch": "main",
"max_lines": 300
}
}Full AI Code Review Workflow
json
{
"name": "code-review",
"steps": [
{
"id": "get_diff",
"type": "git.diff",
"config": {
"operation": "diff",
"base_branch": "main"
}
},
{
"id": "ai_review",
"type": "ai.generate",
"config": {
"prompt": "Review this code diff and provide feedback:\n{{steps.get_diff.diff}}",
"model": "gpt-4"
},
"depends_on": ["get_diff"]
},
{
"id": "notify",
"type": "slack.notify",
"config": {
"webhook_url": "{{env.SLACK_WEBHOOK_URL}}",
"message": "Code Review:\n{{steps.ai_review.text}}"
},
"depends_on": ["ai_review"]
}
]
}Output
diff- The git diff textfiles_changed- Number of files changedinsertions- Lines inserteddeletions- Lines deleted