Judges whether a change or plan takes the best approach for its intent (codebase-fit, simplicity, performance, robustness) and proposes at most two materially better ones; says nothing when the approach is already sound. Slash-invoked: "/optimize-approach [<files>|<plan path>]".
82%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Answer one question: is this the best approach for what the change is trying to do — and if not, what is? Judge the shape of the solution, not its lines. Report only; never edit files.
Lens-eligible for the pr-reviewer agent: lens.md auto-loads on deep reviews.
plan.md; else the branch diff (git diff <base>...HEAD, base default origin/main).grep before you claim one exists).| Axis | A better approach would… | Look for |
|---|---|---|
| Codebase-fit | reuse a utility, hook, or pattern the change reinvents | a hand-rolled helper duplicating an export; a bespoke pattern next to a shared one |
| Simplicity | remove a structural layer the goal does not need | a class where a function suffices; premature generality; needless indirection |
| Performance | change complexity or cut work the current shape forces | O(n²) where O(n) is natural; per-item queries where one batch works |
| Robustness | pick a shape that cannot hit a failure class the current one invites | invariants kept by hand that a type or DB constraint would enforce; a race the shape allows |
No axis fires → the unit is optimal.
Drop the candidate (the unit stays optimal) when any of these holds:
/polish./critical.Propose only when the alternative is all three:
file:line evidence you read, not a guess.When in doubt, say nothing: silence on a sound approach costs nothing; a weak "better way" costs trust.
✗ Wrong — "`const timeoutMs = 5000` could be a named constant" (mechanical tidy → /polish)
✓ Right — "src/api/client.ts:40 adds retryWithBackoff; src/lib/retry.ts:12 already exports
withRetry with the same semantics. Reuse it: one call site, removes a duplicate."At most two proposals, strongest first.
Every unit optimal → print exactly Approach: optimal — no materially better approach found. and stop.
### <unit> — <axis>
**Now:** <the current approach, one line, with file:line>
**Better:** <the alternative, one or two lines, with the file:line it reuses or the constraint it relies on>
**Why it wins:** <the material gain>
**Cost:** <files touched, risk>mthines/agent-skills
0ec47ca
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.