[PATCH v9 0/4] devtools: add AI-assisted code review tools

Stephen Hemminger
2026-01-29T20:41:20Z

This series adds infrastructure for AI-assisted code review of DPDK
patches and documentation. It provides guidelines for AI tools and
scripts to interface with multiple AI providers.

The AGENTS.md file consolidates DPDK coding standards, commit message
requirements, and common review feedback into a format optimized for
AI code review tools. The accompanying scripts enable automated patch
analysis using Claude, ChatGPT, Grok, or Gemini.

Patches:
1. AGENTS.md - Guidelines document for AI review tools
2. analyze-patch.py - Multi-provider patch review script
3. compare-reviews.sh - Compare reviews across providers
4. review-doc.py - Documentation review with diff output

Changes in v9:
- Revised prompt to cleanup false positives
- Added flag to analyze patch to work for LTS releases --lts
and review date

Changes in v8:
- Batch processing: both scripts now accept multiple files and
generate separate output for each
- Changed -o/--output to -o/--output-dir for organized file output
- Added -d/--diff option to force .diff and .msg file generation
- Added -q/--quiet option to suppress stdout when processing batches
- Added strip_diff_markers() to clean output in non-text formats
- Expanded AGENTS.md with additional guidance and examples
- Improved help text with better examples and documentation

Changes in v7:
- Add "Review Philosophy" section to AGENTS.md with guidance on
confidence levels and concise feedback
- Add "Priority Areas" section covering security, correctness,
and architecture concerns that reviewers should focus on
- Minor code cleanups in analyze-patch.py

Changes in v6:
- Expanded AGENTS.md with "Unnecessary Code Patterns" section
- Added guidance on rte_malloc() and rte_memcpy() appropriate use
- Added symbol naming guidelines for static linking
- Improved email sending in review-doc.py with native SMTP support

Changes in v5:
- Added review-doc.py for documentation review
- Added email sending capability to scripts
- Expanded forbidden tokens documentation

Changes in v4:
- Added compare-reviews.sh script
- Multiple output formats (text, markdown, html, json)
- Improved error handling

Changes in v3:
- Added support for OpenAI, xAI Grok, and Google Gemini
- Added prompt caching for Anthropic to reduce costs
- Restructured AGENTS.md for better machine parsing

Changes in v2:
- Split into separate patches
- Added verbose mode with token usage statistics

Stephen Hemminger (4):
doc: add AGENTS.md for AI-powered code review tools
devtools: add multi-provider AI patch review script
devtools: add compare-reviews.sh for multi-provider analysis
devtools: add multi-provider AI documentation review script

AGENTS.md | 1198 +++++++++++++++++++++++++++++++++++
devtools/analyze-patch.py | 862 +++++++++++++++++++++++++
devtools/compare-reviews.sh | 192 ++++++
devtools/review-doc.py | 1098 ++++++++++++++++++++++++++++++++
4 files changed, 3350 insertions(+)
create mode 100644 AGENTS.md
create mode 100755 devtools/analyze-patch.py
create mode 100644 devtools/compare-reviews.sh
create mode 100755 devtools/review-doc.py

--
2.51.0