| name | enhance |
| description | Improve existing code — refactor, optimize performance, tighten security, or enhance UX. Use when the user wants to make code better without changing its purpose. Triggers: enhance, improve, refactor, optimize, review, cải thiện, tối ưu, nhanh hơn, code dài quá. |
| encoding | UTF-8 |
| agents | ["performance-optimizer","security-auditor","frontend-specialist"] |
| related-skills | ["debug","test","plan"] |
Memory Protocol
START: Read .ai-memory.md from project root. Check past enhancements, known pain points, tech debt notes, performance baselines, and architecture decisions.
END: Update .ai-memory.md using Memory Compaction Rules with: what changed, impact, tradeoffs, and remaining tech debt.
Goal
Improve an existing implementation without breaking working behavior.
Agent Routing
- If enhancing performance → read
.kiro/skills/agents/agents/performance-optimizer.md and apply its knowledge
- If tightening security → read
.kiro/skills/agents/agents/security-auditor.md and apply its knowledge
- If improving UI/UX → read
.kiro/skills/agents/agents/frontend-specialist.md and apply its knowledge
- If refactoring backend/API → read
.kiro/skills/agents/agents/backend-specialist.md and apply its knowledge
- If improving database queries → read
.kiro/skills/agents/agents/database-architect.md and apply its knowledge
Socratic Gate
Before enhancing, verify:
- What specific aspect needs improvement? (performance, security, UX, maintainability?)
- What is the current pain point or metric?
- Are there existing tests that must continue to pass?
If any answer is unclear, ASK before proceeding.
Workflow
- Read Memory — Load
.ai-memory.md for project context and past enhancement history.
- Understand the current state and pain points.
- Identify high-impact improvements in quality, maintainability, performance, reliability, or UX.
- Prioritize improvements by value versus effort.
- Implement or recommend the top changes.
- Explain tradeoffs and validation steps.
- Quality Gate — Read
.kiro/skills/_scripts/checklist.md and verify enhancements don't break existing behavior.
- Update Memory — Save enhancement details and outcomes to
.ai-memory.md.
Checklist
Rules
- Preserve behavior unless the user asked for a behavior change.
- Prefer small, meaningful upgrades over broad rewrites.
- If performance is discussed, explain where the gain comes from.
- Avoid changing unrelated files; if improvement requires broad refactor, ASK before doing it.
- Always read and update the memory file.
Related Skills
/debug → read .kiro/skills/debug/SKILL.md — Fix issues found during enhancement
/test → read .kiro/skills/test/SKILL.md — Verify enhancements don't break things
/plan → read .kiro/skills/plan/SKILL.md — Plan large-scale refactoring
Encoding
All code snippets and example files referenced or produced by this skill must be UTF-8 encoded. When applicable, include encoding: "UTF-8" in SKILL.md front-matter and ensure saved files use UTF-8 (no BOM).