Skip to content
Development
Skill

/reflexion

Use for self-correcting implementation. Implements the reflexion loop: implement, validate, self-critique, retry (max 3 iterations).

From plugin
mycelium
5263 skills

Claude Code

$ npx -y skills add haabe/mycelium --skill reflexion --agent claude-code

SKILL.md

reflexion.SKILL.md
name: reflexion
description: "Use for self-correcting implementation. Implements the reflexion loop: implement, validate, self-critique, retry (max 3 iterations)."
metadata:
  instruction_budget: "52"
  framework_dependency: "mycelium"
  framework_dependency_note: "This skill is designed to run within the Mycelium framework (https://github.com/haabe/mycelium). Standalone use will skip the canvas state, theory gates, and harness behavior the skill assumes. Install: /plugin install mycelium@haabe-mycelium."

Reflexion Skill

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

Workflow

Iteration Loop (max 3)

**Step 1: Implement**

  • Create the deliverable according to the specification/acceptance criteria.
  • Software: write code. Content: write/produce content. AI tool: write prompts/configs. Service: document workflow.
  • Follow ${CLAUDE_PLUGIN_ROOT}/harness/engineering-principles.md (principles apply to all product types).
  • Apply patterns from patterns.md.
  • Check corrections.md for relevant past mistakes.

**Step 2: Validate**

  • Software: Run tests, linter, type checker, security scan, accessibility checks (if UI).
  • **Security validation (OWASP)**: Check input validation, output encoding, parameterized queries, no hardcoded secrets, authentication/authorization patterns, dependency vulnerabilities. Reference OWASP Top 10:2025 categories for each check.
  • Content: Review against learning objectives/editorial standards, check accessibility (captions, alt text), fact-check claims.
  • AI tool: Run eval test cases, red-team testing, bias assessment.
  • Service: Walk through the service blueprint end-to-end, verify documentation completeness.
  • All: Verify acceptance criteria.

**Step 3: Self-Critique** Review the implementation against (select items relevant to product_type):

  • [ ] Engineering principles: DRY, KISS, YAGNI, SoC (apply to all product types)
  • [ ] Security: Input validation, output encoding, no secrets, parameterized queries (software, ai_tool)
  • [ ] Accessibility: Semantic HTML, keyboard nav, contrast, screen reader (software); captions, transcripts, alt text (content)
  • [ ] Edge cases: What happens with unexpected input? Empty? Adversarial? (software, ai_tool)
  • [ ] Error handling / user recovery: Are errors handled gracefully? Can users recover? (software, service)
  • [ ] Quality: Factual accuracy, style consistency, source attribution (content); eval scores, safety scores (ai_tool)
  • [ ] Naming / clarity: Do names reveal intent? Would a new reader understand this? (all)
  • [ ] Completeness: Is anything missing that the user would expect? (all)

**Step 4: Decide**

  • If all validations pass AND self-critique finds no issues: **DONE**
  • If issues found AND iteration < 3: **FIX and return to Step 1**
  • If iteration = 3 AND issues remain: **ESCALATE** with documented issues

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)

  • Linters, formatters, schema validators, type checkers
  • Pass/fail is unambiguous — no judgment needed
  • Always run first — fastest and cheapest
  • Examples: `eslint`, `mypy`, `yamllint`, YAML schema validation against ${CLAUDE_PLUGIN_ROOT}/engine/canvas-guidance.yml

Computational (deterministic)

  • Test runners, build systems, security scanners
  • Requires executing code — slower than rules-based
  • Results are objective but may need interpretation (flaky tests)
  • Examples: `pytest`, `npm test`, `cargo clippy`, OWASP dependency check

Inferential (probabilistic)

  • LLM-as-judge, peer review, heuristic evaluation
  • Used when rules-based and computational verification are insufficient
  • Results require confidence scoring — never treat as definitive
  • Examples: `/mycelium:devils-advocate`, `/mycelium:usability-check`, auto-dogfood evaluation, design review
  • The auto-dogfood system is an inferential verification loop

**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

  • Each iteration must show measurable improvement over the previous.
  • If the same issue recurs across iterations, investigate root cause rather than patching symptoms.
  • Never skip the self-critique step, even if tests pass.
  • Log the reflexion loop outcome in delivery-journal.md.
  • **NUDGE-AT-FAILURE** (4-layer JIT composition): if the failure being reflexed on is a class a standard tool (linter, SAST, secrets scanner, dep audit) would have caught automatically, append a single-line nudge to the reflexion output: *"This class of failure is what `{tool}` catches automatically — want help wiring it up now?"* Never auto-install. Per `feedback-jit-nudge-not-push` (founder principle, 2026-05-26).

Theory Citations

  • Reflexion pattern (Shinn et al.)
  • Clean Code (Martin)
  • OWASP secure coding
  • WCAG 2.1 AA
Read more
@haabe
Ships withmycelium

Mycelium won't make your idea good. It keeps you and your agent honest about whether it is, from first idea to market. Built on Claude Code, where the gates are structural. The files and skills port to opencode, Codex and Cursor. Outcome over output.

Stars on GitHub

Momentum

stars in total
52
Star history of haabe/mycelium on GitHub, a chart by star-history.com

Other skills on mycelium.

a11y-check

a11y-check

Accessibility audit, scoped to the surfaces a product actually has. Detects web / rendered_markdown / terminal / native_app /…

@haabe@haabeInstall Skill
adopt

adopt

Bring Mycelium into a project that already has code. Detects that the repo predates the framework, asks before touching anything,…

@haabe@haabeInstall Skill
assumption-test

assumption-test

Design the smallest viable test to validate or invalidate a critical assumption. Based on Torres's assumption testing framework,…

@haabe@haabeInstall Skill
bias-check

bias-check

Use before any research activity or significant decision. Reviews cognitive biases relevant to the current stage.

@haabe@haabeInstall Skill
bvssh-check

bvssh-check

Use to evaluate whether current work aligns with Better Value Sooner Safer Happier. Run at diamond completion and periodically.

@haabe@haabeInstall Skill
canvas-health

canvas-health

Lint canvas files for staleness, missing fields, inconsistent evidence types, and orphaned references. Run periodically or before…

@haabe@haabeInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about reflexion.

Which coding agents can use reflexion?
reflexion installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.