Expert Review
Overview
Review the codebase as a senior product-minded engineer. Produce a ranked list
of recommendations to improve maintainability, consistency, component reuse,
quality, and upgrade safety without changing the current end-user experience.
Recommendations should be direct and appropriately bold: if the structure of
the project needs a large change to reduce long-term risk, say so clearly
instead of only suggesting small local fixes.
Default to review only. Do not implement code changes, alter behavior, close
issues, or start a large refactor unless the user explicitly asks.
The audience is technical but not development-oriented, so explain findings in
plain language while still being precise about risk, impact, and effort.
Review Principles
- Preserve the current user experience unless recommending an explicitly
optional consistency improvement.
- Favor clean upgrade paths: existing users should keep working after upgrading,
with defaults, migrations, compatibility layers, or documented transition
steps where needed.
- Prefer reusable components, shared helpers, clear boundaries, and established
project patterns over one-off implementations.
- Reduce duplication when it lowers future maintenance risk. Do not recommend
abstraction for its own sake.
- Be willing to recommend large structural changes when the evidence shows that
incremental fixes would leave the same maintenance or upgrade risk in place.
- Do not soften important recommendations just because they are disruptive.
Label them clearly, explain why they are worth doing, and separate the
recommendation from the rollout plan.
- Always pair large or high-risk recommendations with a practical mitigation
plan so the user can see how the work can be controlled.
- Separate user-facing polish suggestions from internal quality improvements.
- Rank work by practical importance, not by what is easiest to spot.
Workflow
1. Establish Project State
Inspect the current branch, local changes, and recent structure.
git status --short --branch
find . -maxdepth 3 -type f | sort
If there are local changes, work with them. Do not revert or overwrite user
work.
2. Map the Product and Architecture
Identify the main user experiences and the code paths that support them. Read
enough of the repository to understand:
- Web or configuration UI surfaces
- Firmware, device, or generated configuration paths
- Shared scripts, validators, and build or release workflows
- Repeated patterns, duplicated logic, or parallel implementations
- Data formats and compatibility boundaries users depend on
Prefer targeted searches with rg and file reads over broad assumptions.
3. Evaluate Consistency and Quality
Look for improvement opportunities in these areas:
- Component reuse: repeated UI structures, controls, layout patterns, scripts,
configuration fragments, validation logic, or firmware/device definitions
- Interaction consistency: similar actions behaving differently, inconsistent
labels, validation feedback, defaults, save flows, navigation, or presentation
- Data and migration safety: changed schemas, generated files, saved settings,
firmware configuration, API contracts, version handling, and upgrade fallback
behavior
- Code organization: unclear ownership, mixed responsibilities, duplicated
business rules, fragile coupling, and scattered constants
- Test and validation coverage: missing checks for shared behavior, generated
output, compatibility, or high-risk workflows
- Developer workflow: unreliable scripts, hard-to-repeat checks, inconsistent
formatting, stale generated assets, and unclear release confidence
4. Validate Before Recommending
For each significant recommendation, gather concrete evidence:
- Name the affected files or areas.
- Explain what pattern or risk was observed.
- Confirm whether the recommendation preserves the current user experience.
- Describe how existing users would migrate cleanly.
- Identify the main risks of making the change and how to reduce them.
- Estimate the work in small, medium, or large terms.
Run lightweight checks only when they help validate the review. Avoid expensive
or invasive checks unless the user asks for deeper confidence.
5. Add Risk Controls for Large Changes
For every medium, large, or structurally significant recommendation, include
steps to mitigate and manage the risk of doing the work. The risk controls
should be practical and staged, such as:
- Split the work into reviewable phases with a clear stopping point after each
phase.
- Preserve old behavior behind compatibility layers, defaults, feature flags, or
adapter functions while the new structure is introduced.
- Add characterization tests or generated-output comparisons before moving code,
so current behavior is captured before refactoring starts.
- Migrate one representative path first, verify it, then repeat the pattern for
the remaining paths.
- Keep user-facing output, saved settings, generated firmware/configuration, and
public interfaces stable until a deliberate migration step is ready.
- Define rollback points, manual test steps, and release checks before changing
high-impact areas.
- Document any user-visible migration path in plain language.
Do not use risk as a reason to avoid recommending necessary structural work.
Instead, explain how to make the work safer.
6. Prioritize
Rank recommendations using this order:
- Upgrade safety, data compatibility, or release risk
- User-facing consistency problems that can confuse users
- Shared duplication that increases bug risk across multiple experiences
- Missing validation or test coverage for important workflows
- Code organization improvements that unlock future work
- Nice-to-have polish or documentation improvements
When two items are close, put the one with broader user or maintenance impact
first.
Output Format
Start with a short plain-English summary of the overall health and the biggest
theme.
Then provide ranked recommendations:
1. <Recommendation title>
Importance: Critical / High / Medium / Low
Recommendation strength: Strong / Moderate / Optional
Why it matters: <plain-English reason>
Evidence: <files, patterns, or examples reviewed>
User experience impact: <no change / optional consistency improvement / needs careful handling>
Migration approach: <how existing users upgrade cleanly>
Risk management: <specific steps to reduce rollout, regression, and migration risk>
Work required: Small / Medium / Large, with the main tasks
Suggested first step: <practical next action>
Finish with:
Quick wins:
- <small, low-risk improvements>
Not recommended right now:
- <tempting refactors or behavior changes that should wait, with why>
Checks run:
- <command or review activity>: <result, or skipped with reason>
If the review finds no meaningful issues, say so clearly and list any remaining
areas that were not inspected deeply.
1---2name: expert-review3description: Provide an expert codebase review for this repository. Use when the user says "Expert Review" or "/expert-review", asks for an expert review, wants refactoring or codebase improvement recommendations, wants consistency and quality assessed, or asks how to reduce duplication, improve component use, preserve the end-user experience, and keep upgrades cleanly migratable.4---56# Expert Review78## Overview910Review the codebase as a senior product-minded engineer. Produce a ranked list11of recommendations to improve maintainability, consistency, component reuse,12quality, and upgrade safety without changing the current end-user experience.13Recommendations should be direct and appropriately bold: if the structure of14the project needs a large change to reduce long-term risk, say so clearly15instead of only suggesting small local fixes.1617Default to review only. Do not implement code changes, alter behavior, close18issues, or start a large refactor unless the user explicitly asks.1920The audience is technical but not development-oriented, so explain findings in21plain language while still being precise about risk, impact, and effort.2223## Review Principles2425- Preserve the current user experience unless recommending an explicitly26 optional consistency improvement.27- Favor clean upgrade paths: existing users should keep working after upgrading,28 with defaults, migrations, compatibility layers, or documented transition29 steps where needed.30- Prefer reusable components, shared helpers, clear boundaries, and established31 project patterns over one-off implementations.32- Reduce duplication when it lowers future maintenance risk. Do not recommend33 abstraction for its own sake.34- Be willing to recommend large structural changes when the evidence shows that35 incremental fixes would leave the same maintenance or upgrade risk in place.36- Do not soften important recommendations just because they are disruptive.37 Label them clearly, explain why they are worth doing, and separate the38 recommendation from the rollout plan.39- Always pair large or high-risk recommendations with a practical mitigation40 plan so the user can see how the work can be controlled.41- Separate user-facing polish suggestions from internal quality improvements.42- Rank work by practical importance, not by what is easiest to spot.4344## Workflow4546### 1. Establish Project State4748Inspect the current branch, local changes, and recent structure.4950```bash51git status --short --branch52find . -maxdepth 3 -type f | sort53```5455If there are local changes, work with them. Do not revert or overwrite user56work.5758### 2. Map the Product and Architecture5960Identify the main user experiences and the code paths that support them. Read61enough of the repository to understand:6263- Web or configuration UI surfaces64- Firmware, device, or generated configuration paths65- Shared scripts, validators, and build or release workflows66- Repeated patterns, duplicated logic, or parallel implementations67- Data formats and compatibility boundaries users depend on6869Prefer targeted searches with `rg` and file reads over broad assumptions.7071### 3. Evaluate Consistency and Quality7273Look for improvement opportunities in these areas:7475- Component reuse: repeated UI structures, controls, layout patterns, scripts,76 configuration fragments, validation logic, or firmware/device definitions77- Interaction consistency: similar actions behaving differently, inconsistent78 labels, validation feedback, defaults, save flows, navigation, or presentation79- Data and migration safety: changed schemas, generated files, saved settings,80 firmware configuration, API contracts, version handling, and upgrade fallback81 behavior82- Code organization: unclear ownership, mixed responsibilities, duplicated83 business rules, fragile coupling, and scattered constants84- Test and validation coverage: missing checks for shared behavior, generated85 output, compatibility, or high-risk workflows86- Developer workflow: unreliable scripts, hard-to-repeat checks, inconsistent87 formatting, stale generated assets, and unclear release confidence8889### 4. Validate Before Recommending9091For each significant recommendation, gather concrete evidence:9293- Name the affected files or areas.94- Explain what pattern or risk was observed.95- Confirm whether the recommendation preserves the current user experience.96- Describe how existing users would migrate cleanly.97- Identify the main risks of making the change and how to reduce them.98- Estimate the work in small, medium, or large terms.99100Run lightweight checks only when they help validate the review. Avoid expensive101or invasive checks unless the user asks for deeper confidence.102103### 5. Add Risk Controls for Large Changes104105For every medium, large, or structurally significant recommendation, include106steps to mitigate and manage the risk of doing the work. The risk controls107should be practical and staged, such as:108109- Split the work into reviewable phases with a clear stopping point after each110 phase.111- Preserve old behavior behind compatibility layers, defaults, feature flags, or112 adapter functions while the new structure is introduced.113- Add characterization tests or generated-output comparisons before moving code,114 so current behavior is captured before refactoring starts.115- Migrate one representative path first, verify it, then repeat the pattern for116 the remaining paths.117- Keep user-facing output, saved settings, generated firmware/configuration, and118 public interfaces stable until a deliberate migration step is ready.119- Define rollback points, manual test steps, and release checks before changing120 high-impact areas.121- Document any user-visible migration path in plain language.122123Do not use risk as a reason to avoid recommending necessary structural work.124Instead, explain how to make the work safer.125126### 6. Prioritize127128Rank recommendations using this order:1291301. Upgrade safety, data compatibility, or release risk1312. User-facing consistency problems that can confuse users1323. Shared duplication that increases bug risk across multiple experiences1334. Missing validation or test coverage for important workflows1345. Code organization improvements that unlock future work1356. Nice-to-have polish or documentation improvements136137When two items are close, put the one with broader user or maintenance impact138first.139140## Output Format141142Start with a short plain-English summary of the overall health and the biggest143theme.144145Then provide ranked recommendations:146147```text1481. <Recommendation title>149 Importance: Critical / High / Medium / Low150 Recommendation strength: Strong / Moderate / Optional151 Why it matters: <plain-English reason>152 Evidence: <files, patterns, or examples reviewed>153 User experience impact: <no change / optional consistency improvement / needs careful handling>154 Migration approach: <how existing users upgrade cleanly>155 Risk management: <specific steps to reduce rollout, regression, and migration risk>156 Work required: Small / Medium / Large, with the main tasks157 Suggested first step: <practical next action>158```159160Finish with:161162```text163Quick wins:164- <small, low-risk improvements>165166Not recommended right now:167- <tempting refactors or behavior changes that should wait, with why>168169Checks run:170- <command or review activity>: <result, or skipped with reason>171```172173If the review finds no meaningful issues, say so clearly and list any remaining174areas that were not inspected deeply.