Skip to main content

reflexion

After a failed attempt (test fails, command errors, wrong output), write a short reflection on WHY it failed and what to change, then retry with that lesson in context, instead of blindly trying again. Use on the 2nd attempt at any failing task. Trigger with /reflexion or "that failed, rethink", "why did it fail", "learn from this and retry".

Zur Installation springen

Quellinformationen

Repository
Zavelinski/reflexion
Letzte Quellaktivität
30. Juni 2026 um 02:57
Erkannte Sprache von SKILL.md
Englisch
Sterne
0
Forks
0

Installationsoptionen

Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.

Quelldateien prüfen

Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.

SKILL.md wird angezeigt

SKILL.md
Quellanweisungen · Schreibgeschützte Vorschau
name
reflexion
description
After a failed attempt (test fails, command errors, wrong output), write a short reflection on WHY it failed and what to change, then retry with that lesson in context, instead of blindly trying again. Use on the 2nd attempt at any failing task. Trigger with /reflexion or "that failed, rethink", "why did it fail", "learn from this and retry".
version
0.1.0
user-invocable
true
metadata
{"emoji":"🔁"}
# reflexion Blind retry repeats the same mistake. After a failure, turn the failure signal into a written lesson, then retry WITH that lesson in front of you. Verbal self-reflection as memory between attempts. ## Why this exists (evidence) - Reflexion (Shinn et al., arXiv:2303.11366): agents that verbally reflect on failure feedback and keep it as episodic memory across attempts get large gains, e.g. up to 91% pass@1 on HumanEval vs 80% for the prior best at the time, and big jumps on decision-making/reasoning tasks, without finetuning. - Mechanism: the failure (stack trace, failed test, wrong result) is signal; a concrete "what went wrong + what to change" note steers the next attempt instead of resampling the same path. ## When to use - The 2nd (and later) attempt at any task that just failed: failing test, runtime error, wrong answer, rejected approach. - A loop that is about to retry: insert a reflection step first. - NOT on the first attempt (nothing to reflect on yet) and not when the fix is obvious (just fix it). ## The loop 1. **Capture the failure precisely:** exact error / failing assertion / wrong output. Quote it, do not paraphrase. 2. **Reflect (short, concrete):** WHY did it fail? What specific assumption was wrong? What is the ONE change that addresses the root cause (not the symptom)? 3. **Record the lesson** as a one-line note kept in context (e.g. "the API returns cents not dollars -> divide by 100"). 4. **Retry** with the lesson explicit. Change the approach the lesson implies, do not just rerun. 5. **If it fails again:** add a new lesson; after 2-3 failed reflections on the same root, STOP and escalate (you are stuck in a local minimum) rather than looping. ## Persist across sessions For recurring failures, write the lesson to memory (see recall / memory-persistence) so a future session does not relearn it. That is the "episodic memory" part of Reflexion. ## Composes with - `systematic-debugging`: reflexion is the between-attempts memory; debugging is the within-attempt method. - `testsmith` / `adversarial-verify`: produce the failure signal reflexion learns from. - `self-consistency`: when reflection is uncertain, sample a few candidate root causes and take the consistent one. ## Honest limits - Garbage reflection = garbage retry. The lesson must name a ROOT cause, not "try harder". - Cap the loop (2-3 reflections); reflexion does not rescue a fundamentally wrong approach, it just stops you repeating one mistake. - Reported numbers are from the paper's benchmarks; measure your own.
Auf GitHub ansehen