feat(scripts): Add AIDLC Code Reviewer to scripts/aidlc-codereview/#1
Open
ayushtr-aws wants to merge 1 commit into
Open
Conversation
Adds AI-powered code review tool following the aidlc-designreview structure. Features static analysis + AI-powered critical findings, structure critique, and business logic review via Amazon Bedrock (Strands Agents SDK). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Task-Id: 01KRKWAXJVAX3DV2D80SZYJANX Prompt-Version: 1c9c10e027a2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the AIDLC Code Reviewer tool to
scripts/aidlc-codereview/, following theaidlc-designreviewpackage structure. The tool provides AI-powered code review via Amazon Bedrock (Strands Agents SDK) with three analysis modes: critical findings, structure critique, and business logic review.Changes
scripts/aidlc-codereview/— new standalone Python packagepyproject.toml— hatchling build, entry pointcode-reviewer = "code_reviewer.common.cli:main",packages = ["src/code_reviewer"]LICENSE— MIT-0 (MIT No Attribution)CHANGELOG.md— v0.2.0 initial releaseLEGAL_DISCLAIMER.md— standard AWS AI legal disclaimerREADME.md— full documentationdocs/SETUP.md— installation and AWS Bedrock configuration guidesrc/code_reviewer/— main package with all imports usingcode_reviewer.prefixagent/—BaseAgentABC (Strands + Bedrock + backoff retry),CriticalFindingsAgent,StructureCritiqueAgent,BusinessLogicAgentcommon/—cli.py(Click entry point),config.py(ConfigManager usingPath(__file__).parentfor YAML resolution),models.py(Pydantic:Severity,Finding,ReviewResult,CodeReviewReport),scanner.py(code file discovery with.gitignoresupport)tools/—ToolRegistrywithread_fileandlist_filestools for Strands agentsprompts/— system prompt markdown files for each review typereview-config.yaml/agent-config.yaml— config files kept insidesrc/code_reviewer/(not a separateconfig/) to preservePath(__file__).parentresolutionrunner.py—ReviewRunnerorchestrating the full pipeline with Rich progress displayUser experience
Before: No automated code review tool in the AIDLC workflow scripts.
After: Users can run:
The tool scans source files, runs three AI-powered review agents against Amazon Bedrock, and produces a structured Markdown or JSON report with severity-rated findings across critical security issues, structural problems, and business logic gaps.
Checklist
Test Plan
All 20 unit tests pass (testing
CodeScanner: file discovery, exclusions, metadata,.gitignoresupport, edge cases). Package builds cleanly as both sdist and wheel. Lint (ruff) passes with zero warnings.Agent notes
What went well:
aidlc-traceabilityandaidlc-designreview(fetched from upstreamfeature/aidlc-designreviewbranch) provided clear patterns for the hatchling build system, Strands Agents integration, and Rich console output style.uvworkflow (sync, build, test) worked smoothly.What was difficult:
https://github.com/ayushtr-aws/ai-dlc-code-reviewerreferenced in the task does not exist publicly, so the code reviewer was implemented from scratch based on the task specification and patterns from the design reviewer tool.mise run build,mise run lint) are not configured at any level in this repo — builds are done viauvdirectly per-package.Conventions discovered:
scripts/subdirectory is an independent Python package with its ownpyproject.toml,uv.lock,LICENSE,CHANGELOG.md, andtests/.packages = ["src/<pkg>"]in[tool.hatch.build.targets.wheel].<type>(<scope>): descriptionconventional commit format.Suggestions for future tasks:
mise.tomlat repo root (or per-script) to standardizemise run build/mise run lint/mise run testcommands.tool-install/approach.motoorunittest.mock.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.