optimize-approach
Skill20 starsChanged 13 days agoMITView on GitHub
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>]".
In this repository48 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- skills/workflow/autonomous-workflow/CLAUDE.mdCLAUDE.md
- ideateSkill
- interviewSkill
- playwright-trace-analyzerSkill
- profile-optimizerSkill
- rum-trackingSkill
- screencastSkill
- video-analyserSkill
- youtube-transcriptSkill
- create-skillSkill
- docsSkill
- handoffSkill
- optimize-claude-mdSkill
- persistent-memorySkill
- attach-mediaSkill
- ci-auto-fixSkill
- create-prSkill
- github-actions-authorSkill
- resolve-conflictsSkill
- animations-nativeSkill
- animationsSkill
- behavioral-designSkill
- chartingSkill
- storybookSkill
- uxSkill
- visual-designSkill
- ai-engineeringSkill
- confidenceSkill
- criticalSkill
- impact-mapSkill
- jev-assertSkill
- measurableSkill
- polishSkill
- pr-reviewSkill
- review-loopSkill
- tddSkill
- verify-behaviorSkill
- aw-verifySkill
- e2e-testing-mobileSkill
- e2e-testingSkill
- telemetry-verifySkill
- ui-verifySkill
- autonomous-workflowSkill
- aw-create-planSkill
- aw-create-walkthroughSkill
- fix-bugSkill
- implement-suggestionSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Read every unit in full, plus its callers and any existing utility or pattern an alternative would reuse (grep before you claim one exists).
- Very specific: line 42
No axis fires → the unit is optimal.
- Distinctive: line 61
When in doubt, say nothing: silence on a sound approach costs nothing.
- Very specific: line 72
Every unit optimal → print exactly Approach: optimal — no materially better approach found.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Optimize approach
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.
Step 0 — Scope
- Target: the named files or
plan.md; else the branch diff (git diff <base>...HEAD, base defaultorigin/main). - Intent: one or two lines from the plan, the PR title and body, or the commit messages.
- Split the target into approach units — one cohesive way of solving one sub-goal. Judge each unit separately.
- Read every unit in full, plus its callers and any existing utility or pattern an alternative would reuse (
grepbefore you claim one exists).
Step 1 — Score the four axes
| 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.
Step 2 — Drop what another lens owns
Drop the candidate (the unit stays optimal) when any of these holds:
- Mechanical tidy — a rename, guard-clause flip, dead-code removal, or constant extraction. That is
/polish. - Failure mode without a better shape — "this could fail because X" with no approach that structurally avoids X. That is
/critical. - Wrong behaviour — the change does not do what it claims, or breaks a caller. That is a review finding, not an approach.
- Taste — the alternative is equally good, just different.
Step 3 — The materiality bar
Propose only when the alternative is all three:
- Material — a namable win: a reused util, a complexity class dropped, a race removed.
- Grounded — stated in two sentences with
file:lineevidence you read, not a guess. - Worth the switch — the win outweighs the blast radius of changing approach now.
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."Output
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>Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

