reflexion

Record feedback on pattern effectiveness. Stores episodes that train the recommendation system and enable pattern discovery via learner.

$ Installer

git clone https://github.com/majiayu000/claude-skill-registry /tmp/claude-skill-registry && cp -r /tmp/claude-skill-registry/skills/data/reflexion ~/.claude/skills/claude-skill-registry

// tip: Run this command in your terminal to install the skill


name: "reflexion" description: "Record feedback on pattern effectiveness. Stores episodes that train the recommendation system and enable pattern discovery via learner."

Reflexion - Evaluate Pattern Effectiveness

What This Skill Does

Records feedback on patterns and approaches used during work. This feedback:

  1. Trains the recommendation system for better pattern suggestions
  2. Provides data for learner skill to auto-discover new patterns
  3. Tracks what works and what doesn't over time

Use this AFTER completing work to record what helped and what didn't.


Quick Reference

# Store feedback
npx agentdb reflexion store "session-id" "task description" reward success "critique"

# Retrieve similar experiences
npx agentdb reflexion retrieve "search query" --k 5 --only-successes

# Get critique summary
npx agentdb reflexion critique-summary "topic" true

Primary Method: Store Feedback

npx agentdb reflexion store \
  "dp-004" \
  "Used domain-adapter pattern for new HTTP source" \
  1.0 \
  true \
  "Pattern was complete - followed Source trait steps exactly, tests passed first try"

Parameters (positional)

PositionParameterDescription
1session-idFeature ID (e.g., dp-004, air-011)
2taskDescription of what you did
3rewardSuccess score 0-1
4successtrue or false
5critiqueSpecific feedback (required)
6inputOptional: task input
7outputOptional: task output
8latency-msOptional: execution time
9tokensOptional: tokens used

Examples

Pattern Worked Well

npx agentdb reflexion store \
  "dp-004" \
  "Used domain-adapter pattern for new HTTP source" \
  1.0 \
  true \
  "Pattern was complete - followed Source trait steps exactly, tests passed first try"

Pattern Partially Worked

npx agentdb reflexion store \
  "dp-004" \
  "Used add-stream pattern but needed adjustment" \
  0.6 \
  true \
  "Pattern missing retention field requirement added in v2.0 - should update pattern via save-pattern"

Pattern Failed

npx agentdb reflexion store \
  "dp-004" \
  "Pattern mqtt-routing failed for multi-topic subscription" \
  0.2 \
  false \
  "Pattern assumes single topic per source - needs update for multi-topic. Used workaround with topic array."

No Pattern Found

npx agentdb reflexion store \
  "dp-004" \
  "Implemented TimescaleDB continuous aggregate - no existing pattern" \
  0.85 \
  true \
  "No pattern existed. Created new approach using hypertable + continuous_aggregate. Should save as new pattern."

Retrieve Similar Experiences

# Find successful similar work
npx agentdb reflexion retrieve "HTTP source implementation" \
  --k 5 \
  --only-successes \
  --min-reward 0.7

# Find failures to learn from
npx agentdb reflexion retrieve "MQTT configuration" \
  --k 5 \
  --only-failures

# Get synthesized summary
npx agentdb reflexion retrieve "parquet storage" \
  --k 10 \
  --synthesize-context

Retrieve Parameters

ParameterDescription
--kNumber of results
--only-successesOnly successful episodes
--only-failuresOnly failed episodes
--min-rewardMinimum reward threshold
--synthesize-contextGenerate summary

Get Critique Summary

Aggregate lessons from critiques:

# Get critique summary for failures
npx agentdb reflexion critique-summary "mqtt" true

# Get all critiques for a topic
npx agentdb reflexion critique-summary "architecture" false

Reward Scale

ScoreMeaningWhen to Use
1.0PerfectPattern/approach worked exactly as expected
0.8GoodMinor adjustments needed
0.6PartialSignificant modifications required
0.4WeakMarginally helpful, major workarounds
0.2FailedDidn't work, caused issues
0.0HarmfulActively wrong, wasted time

Session ID Convention

Use consistent session IDs for aggregation:

Session IDUse For
{feature-id}Feature work (e.g., dp-004, air-011)
{feature-id}-{phase}Specific phase (e.g., dp-004-spec)
maintenanceBug fixes, refactoring
explorationResearch, spikes, experiments

Critique Best Practices

Good critiques (specific, actionable):

"Pattern was complete - followed steps exactly and deployment succeeded"
"Missing retention field that's now required in v2.0 schema"
"TimescaleDB connection pattern assumed localhost but we use Docker networking"
"Architecture pattern outdated - ADR-005 superseded the approach"

Poor critiques (vague, unusable):

"It worked"              # Too vague
"Failed"                 # No actionable info
"Good pattern"           # Doesn't explain what made it good

The Pattern Workflow

1. BEFORE work:  get-pattern  → Search for relevant patterns
2. DURING work:  Apply patterns, note gaps and discoveries
3. AFTER work:   reflexion    → Record what helped (THIS SKILL)
                 save-pattern → Store NEW discoveries (if any)
                 learner      → Auto-discover patterns from episodes (periodic)

After Recording Feedback

If your critique identifies a pattern that needs updating:

# 1. Record the feedback (this skill)
npx agentdb reflexion store \
  "dp-004" \
  "Used add-stream pattern" \
  0.6 \
  true \
  "Pattern missing required retention field"

# 2. Update the pattern (save-pattern skill)
npx agentdb skill create \
  "add-stream-v2" \
  "Add Data Stream (v2.0): Now requires retention field. Steps: 1) Create config.yaml, 2) Add retention field (required), 3) Run sync..." \
  "tags: streams, config, updated"

Related Skills

  • get-pattern - Search patterns BEFORE work
  • save-pattern - Store NEW patterns after discovering reusable approaches
  • learner - Auto-discover patterns from reflexion episodes

What NOT to Use This For

Don't RecordUse Instead
New patterns you discoveredsave-pattern
Swarm coordination stateclaude-flow memory tools
Transient task/agent memoryclaude-flow memory tools
Architecture decisionssave-pattern

Reflexion is for FEEDBACK on work done, not storing new knowledge.