--- name: ecommerce-code-review description: 'Perform a strict full-project code review for an ecommerce codebase. Use for harsh review of Python, React, architecture, performance, dependency hygiene, modern language features, and configuration-aware quality rules based on pyproject, package.json, and installed versions.' argument-hint: 'Describe whether to review the whole project or focus on backend, frontend, performance, architecture, or dependency quality' --- # Ecommerce Code Review ## When to use - Reviewing a whole ecommerce project before release. - Auditing an existing codebase for quality, maintainability, performance, dependency issues, and outdated patterns. - Enforcing strong standards for Python backend and React frontend code. ## Goal - Produce a harsh, technically defensible review. - Prefer findings over praise. - Create or update .ai/CODE-REVIEW.md with prioritized findings, risks, and remediation steps. ## Review stance - Be strict. - Prefer root-cause findings over stylistic nitpicks. - Check current project configuration before judging the code. - Use current framework and language capabilities when the installed version supports them. - If version-specific guidance matters, verify it against official documentation or authoritative up-to-date sources. ## Required workflow 1. Read `pyproject.toml`, `package.json`, `tsconfig.json`, lint configs, and other relevant project configs when they exist. 2. Detect the configured Python quality toolchain using [python quality matrix](./assets/python-quality-matrix.md). 3. Detect the React, Next.js, and TypeScript setup using [react review matrix](./assets/react-review-matrix.md). 4. Review the codebase against [project review checklist](./assets/project-review-checklist.md). 5. Classify issues with [severity rubric](./assets/severity-rubric.md). 6. Write or update .ai/CODE-REVIEW.md using [code review template](./assets/code-review-template.md). 7. Keep the final report findings-first, with concrete fixes and explicit assumptions. ## Python review expectations - Respect the configured checker in `pyproject.toml`. - If `mypy` is configured, review against `mypy --strict` expectations unless the project explicitly relaxes rules. - If `ty` is configured, review against `ty` expectations and the project's chosen strictness. - If `ruff` is configured, review import hygiene, complexity, unsafe patterns, and style issues that matter for maintainability. - If `deptry` is configured, review dependency hygiene, unused packages, misplaced dev dependencies, and import consistency. - If the project is missing these checks and the user is building new code, recommend adding a coherent baseline. - Prefer modern Python features only when supported by the configured Python version. ## React review expectations - Code should be readable, explicit, and easy for a human developer to modify. - Prefer clear component boundaries, descriptive prop names, predictable state flow, and minimal incidental abstraction. - Avoid clever patterns that obscure behavior. - Review hooks usage, render stability, accessibility, data fetching boundaries, loading and error states, and app-structure clarity. - When the installed React or Next.js version supports newer language or framework features, check whether their use would simplify or strengthen the code. - Do not force trendy APIs if they reduce clarity or conflict with the current architecture. ## Outputs - .ai/CODE-REVIEW.md. - Findings ordered by severity. - Explicit follow-up plan. ## References - [project review checklist](./assets/project-review-checklist.md) - [severity rubric](./assets/severity-rubric.md) - [python quality matrix](./assets/python-quality-matrix.md) - [react review matrix](./assets/react-review-matrix.md) - [code review template](./assets/code-review-template.md)