Skip to content

haddock-development/claude-reflect-system / reflect

reflect

Verified

Analyzes conversation transcripts to extract user corrections, patterns, and preferences, then proposes skill improvements. Use this skill when users provide corrections, express preferences about code style, or when patterns emerge from successful approaches. Can be triggered manually with /reflect or automatically at session end when enabled.

FileKindSize
.state/auto-reflection.jsonconfig54 B
.state/last-reflection.timestampother0 B
README.mdmarkdown7.3 KB
SKILL.mdskill md2.8 KB
USER_GUIDE.mdmarkdown21.4 KB
commands/reflect-meta.mdmarkdown1.6 KB
commands/reflect-promote.mdmarkdown1.8 KB
commands/reflect-stats.mdmarkdown772 B
references/signal-patterns.mdmarkdown6.0 KB
scripts/extract_signals.pyexecutablescript12.3 KB
scripts/hook-stop.shexecutablescript2.2 KB
scripts/learning_ledger.pyscript12.6 KB
scripts/meta_learning.pyscript14.8 KB
scripts/present_review.pyexecutablescript9.9 KB
scripts/promote_learning.pyscript8.0 KB
scripts/reflect.pyexecutablescript5.3 KB
scripts/scope_analyzer.pyscript8.3 KB
scripts/semantic_detector.pyscript8.1 KB
scripts/toggle-off.shexecutablescript431 B
scripts/toggle-on.shexecutablescript499 B
scripts/toggle-status.shexecutablescript2.5 KB
scripts/update_skill.pyexecutablescript8.2 KB
---
name: reflect
description: >
  Analyzes conversation transcripts to extract user corrections, patterns, and preferences,
  then proposes skill improvements. Use this skill when users provide corrections, express
  preferences about code style, or when patterns emerge from successful approaches. Can be
  triggered manually with /reflect or automatically at session end when enabled.
---

# Reflect - Self-Improving Skills

## Overview

This skill enables Claude Code to learn from conversations by analyzing corrections,
approvals, and patterns, then proposing updates to relevant skills. It implements
a "correct once, never again" learning system.

## Usage Modes

### 1. Manual Reflection (/reflect)
Trigger analysis of the current conversation:
```
/reflect [skill-name]
```
- Without skill-name: Analyzes all skills used in conversation
- With skill-name: Focuses on specific skill

### 2. Automatic Reflection
When enabled via `/reflect-on`, runs automatically at session end via Stop hook.

### 3. Toggle Commands
- `/reflect-on` - Enable automatic reflection
- `/reflect-off` - Disable automatic reflection
- `/reflect-status` - Show current configuration

## Confidence Levels

**HIGH** - Explicit corrections:
- User contradicts Claude's approach with specific alternative
- Pattern: "Don't do X, do Y instead"
- Action: Direct updates with deprecation warnings

**MEDIUM** - Approvals and patterns:
- User approves specific approach
- Pattern succeeds multiple times
- Action: Add to "Best Practices" section

**LOW** - Observations:
- User questions or suggests alternatives
- Pattern: "Have you considered..." or "Why not try..."
- Action: Add to "Considerations" section

## Workflow

1. **Signal Detection** - Scan transcript for corrections/patterns
2. **Context Analysis** - Extract 5-message context around signals
3. **Skill Mapping** - Match signals to relevant skills
4. **Change Proposal** - Generate diff of proposed updates
5. **User Review** - Interactive approval with natural language editing
6. **Application** - Safe YAML/markdown updates with backups
7. **Git Commit** - Automatic commit with descriptive message

## Scripts

### Core Engine
- `scripts/reflect.py` - Main orchestration logic
- `scripts/extract_signals.py` - Pattern detection engine
- `scripts/update_skill.py` - Safe skill file updates
- `scripts/present_review.py` - Interactive review interface

### Automation
- `scripts/hook-stop.sh` - Stop hook integration
- `scripts/toggle-on.sh` - Enable auto-reflection
- `scripts/toggle-off.sh` - Disable auto-reflection
- `scripts/toggle-status.sh` - Show status

## Safety Features

- Timestamped backups before all edits
- YAML validation before writing
- Lock files prevent concurrent runs
- Graceful error handling with rollback
- Git status checks before commits

## References

See `references/signal-patterns.md` for detailed pattern library.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall