feat(scripts): Add AIDLC Code Reviewer to scripts/#2
Open
ayushtr-aws wants to merge 1 commit into
Open
Conversation
Adds scripts/aidlc-codereview/ — a pip-installable Python package that provides static analysis + AI-powered code review via Amazon Bedrock. Source: cloned from ayushtr-aws/aidlc-codereview (AIDLC-CodeReviewer/) Structure follows scripts/aidlc-traceability/ conventions. Key changes from upstream: - Package namespace: code_reviewer (all imports prefixed with code_reviewer.) - Entry point: code_reviewer.common.cli:main → aidlc-code-reviewer CLI - Config YAMLs kept in src/code_reviewer/ (Path(__file__).parent.parent resolves correctly) - Excluded: setup.py, bandit.py/pyflakes.py/semgrep.py/google_java_format.py tool wrappers, reports/, docs/*.drawio, docs/*.png - Fixed pre-existing ruff issues: duplicate generate_summary_html, unused imports, bare f-strings Testing: - pip install -e . succeeds - aidlc-code-reviewer --preflight passes (AWS credentials + Bedrock access validated) - ruff check src/ → All checks passed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Task-Id: 01KRMA0YBBZC67W7Z6JWT1NT19 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
scripts/aidlc-codereview/— a pip-installable Python package providing automated, language-agnostic code quality analysis with AI-powered review via Amazon BedrockAIDLC-CodeReviewer/directoryscripts/aidlc-traceability/package structure conventionPackage Structure
Key Decisions
code_reviewer— all cross-module imports updated tofrom code_reviewer.X import Ysrc/code_reviewer/review-config.yamlandagent-config.yamlremain siblings to the package root soPath(__file__).parent.parentresolution incommon/config.pyandagent/config.pyworks correctly afterpip install -e .code_reviewer.common.cli:main→aidlc-code-reviewerCLIsetup.py,bandit.py/pyflakes.py/semgrep.py/google_java_format.pytool wrappers,reports/,docs/*.drawio,docs/*.pnggenerate_summary_htmlfunction (dead code in original), fixed unused imports and bare f-strings identified by ruffBuild and Test Results
Note:
mise run buildandmise run lintare not defined at the repo root level — no build system for the monorepo itself. Package-levelruffpasses cleanly.Agent notes
What went well:
Path(__file__).parent.parentpattern in config.py and agent/config.py resolves correctly with thesrc/code_reviewer/layout — no path hacks neededtools/registry.pyaddscode_reviewer/tosys.path, so generated wrappers can still usefrom common.models import ...as-isWhat was difficult:
common/report.pyhad a duplicategenerate_summary_htmlfunction (and duplicate CSS string) — pre-existing bug in the source. Removed the first (incomplete) definition./app/.venv) and user-installed pip (~/.local) were different Python environments. Theaidlc-code-reviewerbinary was placed in~/.local/binand uses the user-local Python;PYTHONPATHworkaround was needed for directpython3 -cimport testing.Patterns discovered:
src/<package_name>/layout withhatchling(traceability) orsetuptools(this package)docs/ADMINISTRATIVE_GUIDE.mddescribes the release processSuggestions for future tasks:
tests/directory with at least import-smoke testsmise.tomltasks if the repo gains a build systemtools/registry.pydynamic loading could be enhanced to usecode_reviewer.tools.{name}namespace for generated wrappers to avoid potentialsys.pathpollutionBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.