AI Scan Summary
How radar summary generates 3-line executive summaries of scan results in 5 output formats using Claude Sonnet.
AI Scan Summary
radar summary takes a completed scan result and produces a 3-line executive summary using Claude Sonnet. The summary tells you what changed, what the biggest risks are, and what to do next --- in a format you can paste into Slack, email, or a status report.
Plan requirement: AI Scan Summary requires the Solo plan or higher.
How It Works
- Run
radar scanto produce a deterministic analysis result - Run
radar summaryto send the result metadata to Claude Sonnet - Claude returns a structured 3-line summary:
- Line 1: What changed in this scan (new violations, fixed violations, score delta)
- Line 2: Biggest risk (the most severe finding and its production impact)
- Line 3: Recommended action (what to fix first and why)
Only the violation metadata is sent to the AI --- rule IDs, severities, categories, file paths, and debt scores. Source code is not included in the summary prompt.
Usage
# Generate a summary after scanning
radar scan .
radar summary
# Pipe scan results directly
radar scan . --format json | radar summary
# Specify output format
radar summary --format slack
The 3-Line Format
Every summary follows the same structure, regardless of output format:
[What changed] — New violations, resolved violations, score movement
[Biggest risk] — The most severe finding and its potential impact
[Action item] — What to fix first, with file path and line number
Example output:
This scan found 4 new violations (+12 debt points) and 2 resolved (-10 points).
Net delta: +2 points. Score: 34 → 36.
Biggest risk: unbounded findMany() on the orders table (XL, 1.2M rows) in
src/orders/order.repository.ts:18 — this will OOM under production load.
Fix the unbounded query first (add take: 100 + cursor pagination), then
address the sync file read in order.service.ts:42. Both are blocking violations.
Output Formats
| Format | Flag | Description |
|---|---|---|
| Text | --format text | Plain text (default). Human-readable paragraphs. |
| JSON | --format json | Structured JSON with whatChanged, biggestRisk, and action fields. |
| Markdown | --format markdown | Markdown with headers and code references. Suitable for PR descriptions or wiki pages. |
| Slack | --format slack | Slack Block Kit JSON. Paste directly into a Slack webhook or bot message. Includes severity emoji and formatted code blocks. |
--format email | HTML email body with inline styles. Suitable for automated email reports via SendGrid, SES, or any SMTP provider. |
JSON Format Example
{
"whatChanged": "4 new violations (+12 points), 2 resolved (-10 points). Net: +2.",
"biggestRisk": "unbounded-query on orders table (XL) in src/orders/order.repository.ts:18",
"action": "Add pagination to order.repository.ts:18, then fix sync-fs in order.service.ts:42",
"score": {
"before": 34,
"after": 36,
"delta": 2
},
"violations": {
"new": 4,
"resolved": 2,
"total": 11
}
}
Slack Format Example
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Radar Scan Summary — my-api"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*What changed:* 4 new violations (+12 pts), 2 resolved (-10 pts)\n*Biggest risk:* :red_circle: unbounded query on `orders` (XL) — `order.repository.ts:18`\n*Action:* Add pagination to `order.repository.ts:18` first"
}
}
]
}
Cost
Each summary consumes 1 AI credit, approximately $0.005 per summary. The prompt is small (violation metadata only, no source code), so API costs are minimal.
Integration Examples
Slack Notification on Every PR
# .github/workflows/radar.yml
- name: Radar Scan
run: radar scan . --format json > scan-result.json
- name: Post Summary to Slack
run: |
radar summary --format slack > slack-payload.json
curl -X POST $SLACK_WEBHOOK_URL \
-H 'Content-Type: application/json' \
-d @slack-payload.json
Daily Email Report
# Cron job — daily scan summary via email
radar scan . --format json | radar summary --format email > report.html
# Send report.html via your email provider