CherryHQ/cherry-studio / .agents/skills/gh-pr-review
gh-pr-review
UnverifiedAutomated Cherry Studio review for local branches, PRs, commits, files, architecture docs, and repository skills. Use for code or documentation reviews that need project-specific naming, main/renderer/shared placement and dependency rules, IpcApi and DataApi boundaries, lifecycle/service ownership, renderer hooks, React/UI conventions, and tests. Review depth adapts to diff size and runtime subagent capability (single-agent or multi-agent reviewer-verifier). Report-only by default; code fixes and GitHub submission each require explicit invocation-time authorization (`fix` / `submit`). Normal-review prompts and safe interruption behavior follow the interaction contract below. To diagnose gaps in the skill after a review session, run `/gh-pr-review diag`.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 15.4 KB |
| agents/openai.yaml | config | 247 B |
| references/checklist-evolution.md | markdown | 4.7 KB |
| references/cherry-review-guidance.md | markdown | 40.0 KB |
| references/code-checklist.md | markdown | 10.3 KB |
| references/consumer-review.md | markdown | 7.4 KB |
| references/diagnosis.md | markdown | 2.6 KB |
| references/doc-checklist.md | markdown | 3.8 KB |
| references/judgment-matrix.md | markdown | 6.8 KB |
| references/local-review.md | markdown | 6.2 KB |
| references/pr-review.md | markdown | 19.7 KB |
| references/teams-review.md | markdown | 19.0 KB |
references/judgment-matrix.md
View on GitHub# Judgment Matrix
## Risk Level Assessment
Risk level is per-issue, not per-type — the same category (e.g., rename) can be
low or high risk depending on scope and impact.
| Risk | Rule | Examples |
|------|------|----------|
| Low | Only one reasonable fix exists | null check, fix incorrect comment, rename to match convention, remove redundant duplicate code, fix obvious off-by-one error, missing useEffect cleanup, missing i18n key, over-broad DataApi refresh with an obvious narrower key |
| Medium | Multiple fixes possible, but no design decision or external contract involved | extracting shared logic across functions, removing unused internal methods, simplifying cross-function control flow, adjusting internal module boundaries, moving handler business logic into an existing service method, fixing unstable SWR keys or external-store snapshots |
| High | Involves design decisions or external contracts | public API change (signature, behavior, deprecation), IpcApi contract change, architecture restructuring, algorithm replacement with multiple viable approaches, introducing a new dependency, changing data persistence/serialization format, performance optimization involving space-time trade-offs, user-facing behavior change beyond the stated bug scope, build system configuration change, new DataApi endpoint for non-SQLite side effects, new BootConfig key, cross-service transaction redesign, persistence migration |
## Handling by Risk Level
| Mode | Low risk | Medium risk | High risk |
|------|----------|-------------|-----------|
| Report-only (default — any target) | Report | Report | Report |
| Authorized fix (explicit `fix` invocation, local targets) | Auto-fix | Report options and trade-offs | Report options and trade-offs |
Authority comes from the invocation, never from the target type or reviewer
confidence. Medium and high risk can have multiple reasonable fixes: surface
the feasible options and key trade-offs, optionally identify a reviewer
recommendation, and leave the implementation choice with the user. Never
present an option as already chosen, and never ask mid-flow which issues to
fix. **Test-baseline rule**: fixes that would change test baselines (screenshot
comparisons, golden files) are never auto-applied — report them instead,
regardless of risk level.
**Legacy-data rule on `main`**: Redux is removed, and Dexie/ElectronStore are
throwaway v1 stacks. Do not repair or extend them. When the diff introduces new
v1 use, report it and route the implementation to Cache, Preference, DataApi,
or the v2 migrators as appropriate. When already editing an area, removal of
dead v1 residue is allowed; unrelated cleanup remains out of scope. A true v1
maintenance fix belongs on the `v1` branch and must not be auto-fixed on
`main`.
## Worth Fixing?
Code-checklist and doc-checklist define **what to look for**. This section
defines **whether to fix** a discovered issue.
### Decision principles
1. **Must fix** — The issue affects runtime correctness, safety, or security.
2. **Fix when clear** — The issue improves code quality (performance,
simplification, architecture). Fix only when the solution is unambiguous and
does not introduce new risk. Performance changes require both high confidence
in semantic equivalence and a net benefit after weighing the gain against
added code complexity.
3. **Fix when inconsistent** — The issue involves naming, initialization,
comments, or file organization. Fix only when it violates project rules
loaded in context or contradicts the surrounding code's established patterns.
4. **Always skip** — Pure style preferences (not violating any consistency
rule), suggestions based on assumed future requirements rather than current
code, and alternative implementation rewrites for stable code that has no
correctness issue.
### Exceptions
- Duplicate code extraction: fix when identical logic is clearly duplicated
(not by count threshold — judge by complexity and maintenance cost).
- Public API signature changes that are not bug fixes: fix only when justified
by clear benefit to API consumers. Always high risk.
- Test coverage gaps and regression risks are **flagged, not fixed** — report
them for the user's awareness rather than auto-fixing.
- `console.log` → `loggerService`: always worth fixing (project convention).
- Hardcoded UI strings → i18n: always worth fixing (project convention).
- Mandatory-doc violations (naming conventions, process architecture docs,
data docs, plus on-demand lifecycle/IPC/window/job docs when touched):
always worth reporting at Warning minimum; never excluded as style
preference or "matches nearby code".
- Entity leakage into a generic surface (cross-module or intra-module): always
worth reporting. The only valid fix restores ownership — relocating the
concern to its owning domain or an explicit extension point. Side tables,
metadata flags on generic contracts, or additional special cases are not
fixes and must not be applied or suggested as such. Typically medium risk
when the extension point already exists, high when it must be designed.
- DataApi misuse for pure side effects: always worth reporting; fixing is high
risk if it changes IPC/API contracts.
- Handler-level business logic: worth fixing when the owning service and
smallest move are clear; otherwise report as a design confirmation.
- Bypassing an owning service's business rules: worth reporting. Do not flag
read-only `left join` data matching unless it reimplements another domain's
validation, filtering, ordering, or row mapping.
- Renderer data hook bugs that can leave stale UI, corrupt optimistic state, or
leak subscriptions are worth reporting.
- New BootConfig keys require explicit pre-lifecycle justification and tech-lead
confirmation.
## Anti-patterns (Do NOT Fix)
Patterns that frequently produce false positives. Skip unless there is strong
evidence of an actual bug:
- **Speculative optimizations** — build system tweaks, caching additions, or
conditional guards with no proven failure or measured bottleneck.
- **Documentation example "simplification"** — removing attributes, parameters,
or steps from examples that are intentionally verbose for pedagogical
purposes. This is NOT the same as removing redundant code.
- **Behavior changes disguised as bug fixes** — if a proposed fix changes
observable behavior (not just implementation details), verify the original
behavior is actually a bug, not an intentional design choice. When intent
cannot be confirmed from the diff context alone, flag but do not fix.
- **Legacy-stack repairs on `main`** — do not fix Dexie/ElectronStore behavior
or reintroduce Redux. Report newly introduced dependencies; route v1
maintenance to the `v1` branch. Removing dead residue in an already-touched
area is allowed when it cannot affect live v2 behavior.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |