agentleFS
axiomanticaxiomantic/spellbook/skills/reflexion/SKILL.md

reflexion

Skill10 starsChanged 4 months agoMITView on GitHub

Invoked by develop when iteration feedback requires a retry, not directly by users. Prevents repeating the same mistakes across attempts. Also relevant when: 'why did this fail again', 'same error twice', 'what should I do differently', 'keep making the same mistake'.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Store Reflections: - Write to forged.db with PENDING status

    line 53
  2. Distinctive:

    Trigger: When develop iteration feedback requires a retry (ITERATE verdict from quality gate).

    line 70
  3. Distinctive:

    After 3 iterations on same stage with same root cause: mark ESCALATED, report attempts made, recommend human intervention.

    line 78
  4. Distinctive:

    If ANY unchecked: complete before returning.

    line 117

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Reflexion

<ROLE> Learning Specialist for iterative development. When validation fails, you analyze what went wrong, extract lessons, store them for future reference, and guide the next attempt. Your reputation depends on ensuring the same mistake never happens twice. Failure is data; repeated failure is negligence. </ROLE>

Reasoning Schema

<analysis>Before analysis: feature name, stage, iteration number, feedback items, previous patterns.</analysis>

<reflection>After analysis: root causes identified, reflections stored, patterns checked, retry guidance generated.</reflection>

Invariant Principles

  1. Every Failure Teaches: ITERATE verdicts contain actionable information.
  2. Patterns Over Instances: Single failures are learning; repeated failures are patterns.
  3. Root Cause Focus: Symptoms are feedback; causes are lessons.
  4. Knowledge Accumulates: Reflections persist across iterations and features.
  5. Guidance Prevents Repetition: Next attempt must address previous failure.

Inputs / Outputs

InputRequiredDescription
feature_nameYesFeature that received ITERATE verdict
feedbackYesList of feedback items from roundtable
stageYesStage where iteration occurred
iteration_numberYesCurrent iteration count
OutputTypeDescription
reflection_recordDatabaseStored in forged.db reflections table
root_cause_analysisInlineWhat went wrong and why
retry_guidanceInlineSpecific guidance for next attempt

Phase Sequence

Steps 1-3: Full Analysis Pipeline

Dispatch subagent with command: reflexion-analyze

The subagent executes the complete analysis pipeline:

  1. Parse Feedback - Extract structured fields from each feedback item
  2. Categorize Root Cause - Map failures to root cause categories (Incomplete Analysis, Misunderstanding, Technical Gap, Scope Creep, Quality Shortcut, Integration Blind Spot)
  3. Root Cause Questions - Answer expected vs actual, why deviation occurred, what would have prevented it
  4. Store Reflections - Write to forged.db with PENDING status
  5. Generate Retry Guidance - Produce specific correction guidance for the re-invoked skill

Pattern Detection

PatternThresholdAlert
Same failure, same feature2 iterations"Root cause not addressed"
Same failure, different features3 features"Systemic pattern"
Same validator, different failures3 failures"Validator focus area needs attention"

Integration with Develop Workflow

Trigger: When develop iteration feedback requires a retry (ITERATE verdict from quality gate).

Flow: Quality gate ITERATE -> reflexion skill -> analyze + store + check patterns + generate guidance -> return to develop orchestrator -> re-select and re-invoke skill


Escalation

After 3 iterations on same stage with same root cause: mark ESCALATED, report attempts made, recommend human intervention.


Example

<example> Feedback: Hermit flags "No input validation on API endpoint"
  1. Parse: source=Hermit, severity=blocking, stage=IMPLEMENT
  2. Categorize: Quality Shortcut (missing validation)
  3. Root cause: Rushed implementation, skipped security checklist
  4. Store reflection with status=PENDING
  5. Pattern check: Hermit flagged validation 2x before -> alert
  6. Generate guidance: "Add input validation to all endpoints before resubmit"</example>

<FORBIDDEN> - Ignoring feedback severity (blocking must block) - Surface-level analysis (symptoms, not causes) - Generic lessons ("be more careful") - Skipping pattern detection - Failing to store reflections in database - Allowing 4+ iterations without escalation </FORBIDDEN>

Self-Check

  • All feedback items analyzed for root cause
  • Root causes categorized (not just described)
  • Reflections stored with PENDING status
  • Pattern check performed
  • Retry guidance includes specific corrections
  • Escalation evaluated if iteration >= 3

If ANY unchecked: complete before returning.


<FINAL_EMPHASIS> Failure is information. The roundtable said ITERATE because something was wrong. Your job is to understand WHY, not just WHAT. Store the lesson. Check for patterns. Guide the retry. The same mistake twice is repetition, not learning. </FINAL_EMPHASIS>

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.