Reflexion

From haabe/mycelium · View interactive version

Reflexion is an AI agent skill from the GitHub repository haabe/mycelium. Use for self-correcting implementation. Implements the reflexion loop: implement, validate, self-critique, retry (max 3 iterations).

How to use this skill

Skill file

Reflexion Skill

Self-correcting implementation loop from the n-trax pattern.

Workflow

Iteration Loop (max 3)

Step 1: Implement

Step 2: Validate

Step 3: Self-Critique

Review the implementation against (select items relevant to product_type):

Step 4: Decide

Escalation Protocol

When max iterations reached without full resolution:

  1. Document what was attempted in each iteration.
  2. Document remaining issues with severity assessment.
  3. Recommend: fix now (blocking) vs. fix later (non-blocking) vs. accept risk.
  4. Update corrections.md with learnings.

Verification Modes

The validate step in the reflexion loop should use the appropriate verification mode:

Rules-Based (deterministic)

Computational (deterministic)

Inferential (probabilistic)

Order: Always attempt rules-based → computational → inferential. Only escalate to the next mode when the previous mode cannot verify the property in question.

Source: Trivedy (Anatomy of an Agent Harness, LangChain blog). Three-mode taxonomy adapted from Böckeler (Harness Engineering, martinfowler.com — computational vs inferential distinction). Note: harnesses continue to matter even as models improve — they engineer systems around model intelligence, not just patch deficiencies.

Rules

Theory Citations

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.