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
1---2name: reflexion-23description: Use for self-correcting implementation. Implements the reflexion loop: implement, validate, self-critique, retry (max 3 iterations).4---56# Reflexion Skill
78Self-correcting implementation loop from the n-trax pattern.
910## Workflow
1112### Iteration Loop (max 3)
1314**Step 1: Implement**
15- Create the deliverable according to the specification/acceptance criteria.
16 - Software: write code. Content: write/produce content. AI tool: write prompts/configs. Service: document workflow.
17- Follow ${CLAUDE_PLUGIN_ROOT}/harness/engineering-principles.md (principles apply to all product types).
18- Apply patterns from patterns.md.
19- Check corrections.md for relevant past mistakes.
2021**Step 2: Validate**
22- Software: Run tests, linter, type checker, security scan, accessibility checks (if UI).
23 - **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.
24- Content: Review against learning objectives/editorial standards, check accessibility (captions, alt text), fact-check claims.
25- AI tool: Run eval test cases, red-team testing, bias assessment.
26- Service: Walk through the service blueprint end-to-end, verify documentation completeness.
27- All: Verify acceptance criteria.
2829**Step 3: Self-Critique**
30Review the implementation against (select items relevant to product_type):
31- [ ] Engineering principles: DRY, KISS, YAGNI, SoC (apply to all product types)
32- [ ] Security: Input validation, output encoding, no secrets, parameterized queries (software, ai_tool)
33- [ ] Accessibility: Semantic HTML, keyboard nav, contrast, screen reader (software); captions, transcripts, alt text (content)
34- [ ] Edge cases: What happens with unexpected input? Empty? Adversarial? (software, ai_tool)
35- [ ] Error handling / user recovery: Are errors handled gracefully? Can users recover? (software, service)
36- [ ] Quality: Factual accuracy, style consistency, source attribution (content); eval scores, safety scores (ai_tool)
37- [ ] Naming / clarity: Do names reveal intent? Would a new reader understand this? (all)
38- [ ] Completeness: Is anything missing that the user would expect? (all)
3940**Step 4: Decide**
41- If all validations pass AND self-critique finds no issues: **DONE**
42- If issues found AND iteration < 3: **FIX and return to Step 1**
43- If iteration = 3 AND issues remain: **ESCALATE** with documented issues
4445### Escalation Protocol
46When max iterations reached without full resolution:
471. Document what was attempted in each iteration.
482. Document remaining issues with severity assessment.
493. Recommend: fix now (blocking) vs. fix later (non-blocking) vs. accept risk.
504. Update corrections.md with learnings.
5152## Verification Modes
5354The validate step in the reflexion loop should use the appropriate verification mode:
5556### Rules-Based (deterministic)
57- Linters, formatters, schema validators, type checkers
58- Pass/fail is unambiguous — no judgment needed
59- Always run first — fastest and cheapest
60- Examples: `eslint`, `mypy`, `yamllint`, YAML schema validation against ${CLAUDE_PLUGIN_ROOT}/engine/canvas-guidance.yml
6162### Computational (deterministic)
63- Test runners, build systems, security scanners
64- Requires executing code — slower than rules-based
65- Results are objective but may need interpretation (flaky tests)
66- Examples: `pytest`, `npm test`, `cargo clippy`, OWASP dependency check
6768### Inferential (probabilistic)
69- LLM-as-judge, peer review, heuristic evaluation
70- Used when rules-based and computational verification are insufficient
71- Results require confidence scoring — never treat as definitive
72- Examples: `/mycelium:devils-advocate`, `/mycelium:usability-check`, auto-dogfood evaluation, design review
73- The auto-dogfood system is an inferential verification loop
7475**Order**: Always attempt rules-based → computational → inferential. Only escalate to the next mode when the previous mode cannot verify the property in question.
7677*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.*
7879## Rules
80- Each iteration must show measurable improvement over the previous.
81- If the same issue recurs across iterations, investigate root cause rather than patching symptoms.
82- Never skip the self-critique step, even if tests pass.
83- Log the reflexion loop outcome in delivery-journal.md.
84- **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).
8586## Theory Citations
87- Reflexion pattern (Shinn et al.)
88- Clean Code (Martin)
89- OWASP secure coding
90- WCAG 2.1 AA
Run npx skillmds add majiayu000/reflexion-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use for self-correcting implementation. Implements the reflexion loop: implement, validate, self-critique, retry (max 3 iterations). It is listed under Productivity on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
majiayu000 (@majiayu000) published this skill. Their other Agent Skills are listed on their SkillMD profile.