Review Python code changes with a focus on layered architecture boundaries, DI/DIP, configuration validation, typing quality (mypy/flake8 readiness), naming/docstring accuracy, and testability. Use when asked to “code review”, “PR review”, or “리뷰해줘” to prevent repeat feedback on architecture regressions and low-signal changes.
Provide a reusable code review workflow and checklist that applies across Python projects, especially ones that aim for layered architecture and dependency inversion. Produce actionable, concrete review comments (not vague style opinions).
Identify the change scope
domain/, service/, dataset/, adapters/, infra/).Apply hard blockers first
dict across layers; use TypedDict, dataclasses, or Pydantic models.None handling, unused variables, and any Any propagation caused by missing types.Apply design-quality checks
create()/entrypoint).Write review output
Architecture, DIP/DI, Typing, Config, Error handling, Tests, Naming/Docs.Load and apply:
references/principles.md for a project-agnostic checklist and comment templates.references/review-themes.md for common “review-driven refactor” patterns (kept generic on purpose).If your project uses clear “layer folders” under a package root, run:
python scripts/check_layered_imports.py --root <package_root_dir> --package-name <top_level_package>
Use flags to match your project layout:
--layers domain,service,adapters,infra--forbid domain:service,adapters,infra--forbid adapters:service