# Memento Optimize

> Use when a learned skill has low utility score, has been failing, or the user wants to improve an existing learned skill based on failure analysis

- Skill: `tmdgusya/memento-optimize` (Agent Skill)
- Install (CLI): `npx skillmds@latest add tmdgusya/memento-optimize`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tmdgusya/memento-optimize/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tmdgusya (https://skillmd.com/u/tmdgusya)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tmdgusya/memento-optimize

---


# Memento Optimize

Refine a learned skill based on failure analysis. Corresponds to the paper's skill-level reflective update.

## Protocol

### 1. Identify Target

If not specified by user, find candidates:
- Read metrics.json (global and project)
- List skills where `utility < utility_threshold` AND `usage_count >= min_samples_for_judgment`
- Present list to user, let them choose

### 2. Analyze Failures

Read the target skill's `trigger_log` for failure entries. Also read the SKILL.md itself. Identify:
- **Procedure gaps**: steps that are missing or unclear
- **Wrong scope**: skill is being triggered for tasks it shouldn't handle
- **Outdated approach**: the procedure worked before but conditions changed

### 3. Revise SKILL.md

Make targeted edits:
- Fix Procedure steps that caused failures
- Add failure modes to "Known Failure Modes" section
- Tighten "When to Use" if the skill is being misapplied
- Update the description if trigger conditions need refinement
- Update the utility summary line in the blockquote header

### 4. Update Metrics

Update the skill's metrics entry:
- `last_optimized`: today's date
- `optimization_count`: increment by 1

Do NOT reset usage/success/failure counts. The history is valuable.

### 5. Show Changes

Present a before/after diff of the SKILL.md changes to the user.

