optimize

Guides structured code optimization through phased analysis, diff confirmation, and metric validation.

Updated Aug 1, 2026
One-click install
npx skills add https://github.com/lov-b/Skills --skill optimize-lov-b
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: optimize
Source: https://github.com/lov-b/Skills/tree/main/skills/optimize
Command: npx skills add https://github.com/lov-b/Skills --skill optimize-lov-b

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents ad-hoc optimization attempts that skip baseline analysis, lack measurable goals, or ship unverified changes by enforcing a disciplined, phase-gated optimization workflow. ## Core Features & Use Cases - Phased Workflow: Ten phases from context collection and baseline analysis through goal definition, solution design, implementation, environment refresh, effect verification, and summary archiving. - Confirmation Gate: Requires presenting a diff preview and obtaining explicit user approval before any code changes are made. - Quantified Verification: Compares before/after metrics in a structured table, runs regression tests, and archives a summary document to docs/optimize/ with a conventional-commit message. - Use Case: When retrieval latency is too high, trigger the skill to record baseline P95 latency, compare candidate solutions, confirm the diff, implement parallelized retrieval, and verify the latency improvement against the baseline. ## Quick Start Start a message with "optimize:" followed by the feature you want to improve, such as "optimize: reduce the search API response time".

Frequently Asked Questions about optimize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a structured code optimization workflow?

Start your message with "optimize:" or say "优化" while pointing at an existing feature. The workflow walks through context collection, baseline analysis, goal definition, solution comparison, a diff confirmation gate, implementation, and effect verification.

What is the difference between optimize and bugfix workflows?

The optimize workflow targets improving existing working features and allows refactoring or replacing implementations, while bugfix focuses on minimal changes to eliminate a defect. Optimize verifies metric improvement; bugfix verifies the bug is gone.

Can optimization be done across multiple conversation turns?

Yes, the analysis and design phases can span multiple conversation rounds with progress tracked via a checklist. The diff confirmation gate cannot be skipped, and later turns resume from the last completed phase.

When should I not use the optimize skill?

Do not use it for confirmed bugs, which belong in a bugfix workflow, or for brand-new feature development, which belongs in a planning workflow. It is designed only for improving or refactoring existing functionality.

What happens if optimization results do not meet the target?

The workflow analyzes whether the cause is the solution, implementation, or metric choice, then either returns to solution design or accepts the current effect. Results and limitations are recorded in the archived summary.