Back to skills
SkillHub ClubShip Full StackFull Stack

self-reflection

Continuous self-improvement through structured reflection and memory

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
3,087
Hot score
99
Updated
March 20, 2026
Overall rating
C4.6
Composite score
4.6
Best-practice grade
B81.2

Install command

npx @skill-hub/cli install openclaw-skills-self-reflection-1-1-1

Repository

openclaw/skills

Skill path: skills/86293073/self-reflection-1-1-1

Continuous self-improvement through structured reflection and memory

Open repository

Best for

Primary workflow: Ship Full Stack.

Technical facets: Full Stack.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: openclaw.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install self-reflection into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/openclaw/skills before adding self-reflection to shared team environments
  • Use self-reflection for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: self-reflection
description: Continuous self-improvement through structured reflection and memory
version: 1.1.1
metadata: {"openclaw":{"emoji":"πŸͺž","requires":{"bins":["jq","date"]}}}
---

# πŸͺž Self-Reflection

A skill for continuous self-improvement. The agent tracks mistakes, lessons learned, and improvements over time through regular heartbeat-triggered reflections.

## Quick Start

```bash
# Check if reflection is needed
self-reflection check

# Log a new reflection
self-reflection log "error-handling" "Forgot timeout on API call" "Always add timeout=30"

# Read recent lessons
self-reflection read

# View statistics
self-reflection stats
```

## How It Works

```
Heartbeat (60m) β†’ Agent reads HEARTBEAT.md β†’ Runs self-reflection check
                                                      β”‚
                                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                            β–Ό                   β–Ό
                                           OK              ALERT
                                            β”‚                   β”‚
                                       Continue            Reflect
                                                               β”‚
                                                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                     β–Ό                   β–Ό
                                                   read               log
                                              (past lessons)     (new insights)
```

## Commands

| Command | Description |
|---------|-------------|
| `check [--quiet]` | Check if reflection is due (OK or ALERT) |
| `log <tag> <miss> <fix>` | Log a new reflection |
| `read [n]` | Read last n reflections (default: 5) |
| `stats` | Show reflection statistics |
| `reset` | Reset the timer |

## OpenClaw Integration

Enable heartbeat in `~/.openclaw/openclaw.json`:

```json
{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "60m",
        "activeHours": { "start": "08:00", "end": "22:00" }
      }
    }
  }
}
```

Add to your workspace `HEARTBEAT.md`:

```markdown
## Self-Reflection Check (required)
Run `self-reflection check` at each heartbeat.
If ALERT: read past lessons, reflect, then log insights.
```

## Configuration

Create `~/.openclaw/self-reflection.json`:

```json
{
  "threshold_minutes": 60,
  "memory_file": "~/workspace/memory/self-review.md",
  "state_file": "~/.openclaw/self-review-state.json",
  "max_entries_context": 5
}
```

## Author

Created by [hopyky](https://github.com/hopyky)

## License

MIT


---

## Skill Companion Files

> Additional files collected from the skill directory layout.

### README.md

```markdown
# πŸͺž Self-Reflection

A continuous self-improvement skill for AI agents. Track mistakes, log lessons learned, and build institutional memory over time.

## Why?

AI agents make mistakes. Without memory, they repeat them. This skill creates a structured feedback loop where agents regularly pause, reflect on their performance, and document learnings.

```
"The only real mistake is the one from which we learn nothing."
                                                    β€” Henry Ford
```

## Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         OPENCLAW GATEWAY                            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Heartbeat     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚             β”‚    (every 60m)   β”‚                              β”‚ β”‚
β”‚  β”‚   AGENT     β”‚ ───────────────► β”‚  HEARTBEAT.md                β”‚ β”‚
β”‚  β”‚             β”‚                  β”‚  └─► "self-reflection check" β”‚ β”‚
β”‚  β”‚             β”‚                  β”‚                              β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         β”‚                                                           β”‚
β”‚         β”‚ executes                                                  β”‚
β”‚         β–Ό                                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    SELF-REFLECTION SKILL                     β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚                                                             β”‚   β”‚
β”‚  β”‚   $ self-reflection check                                   β”‚   β”‚
β”‚  β”‚         β”‚                                                   β”‚   β”‚
β”‚  β”‚         β–Ό                                                   β”‚   β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                           β”‚   β”‚
β”‚  β”‚   β”‚ < 60 min ?  β”‚                                           β”‚   β”‚
β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                                           β”‚   β”‚
β”‚  β”‚          β”‚                                                  β”‚   β”‚
β”‚  β”‚    YES   β”‚   NO                                             β”‚   β”‚
β”‚  β”‚    β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”                                            β”‚   β”‚
β”‚  β”‚    β–Ό           β–Ό                                            β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                       β”‚   β”‚
β”‚  β”‚  β”‚OK β”‚    β”‚ ALERT   │──► Agent reflects                     β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    └──► self-reflection read          β”‚   β”‚
β”‚  β”‚    β”‚                          └──► self-reflection log      β”‚   β”‚
β”‚  β”‚    β–Ό                                     β”‚                  β”‚   β”‚
β”‚  β”‚  Continue                                β–Ό                  β”‚   β”‚
β”‚  β”‚  normally                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚   β”‚
β”‚  β”‚                                   β”‚ MEMORY.md  β”‚            β”‚   β”‚
β”‚  β”‚                                   β”‚ (lessons)  β”‚            β”‚   β”‚
β”‚  β”‚                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β”‚   β”‚
β”‚  β”‚                                                             β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚   STATE FILE     β”‚
                        β”‚ (last_reflection β”‚
                        β”‚  timestamp)      β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

## How It Works

1. **Heartbeat triggers** β†’ OpenClaw runs heartbeat every 60 minutes (08:00-22:00)
2. **Agent reads HEARTBEAT.md** β†’ Sees instruction to run `self-reflection check`
3. **Skill checks timer** β†’ Compares current time with last reflection
4. **If ALERT** β†’ Agent reviews past lessons and logs new insights
5. **Memory persists** β†’ Lessons stored in markdown for future reference

## Quick Start

### Installation

```bash
# Clone the skill
git clone https://github.com/hopyky/self-reflection.git ~/.openclaw/skills/self-reflection

# Add to PATH
ln -sf ~/.openclaw/skills/self-reflection/bin/self-reflection ~/bin/self-reflection

# Create config
cp ~/.openclaw/skills/self-reflection/self-reflection.example.json ~/.openclaw/self-reflection.json
```

### OpenClaw Integration

Add heartbeat to your `~/.openclaw/openclaw.json`:

```json
{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "60m",
        "activeHours": {
          "start": "08:00",
          "end": "22:00"
        }
      }
    }
  }
}
```

Add to your `HEARTBEAT.md`:

```markdown
## Self-Reflection Check (required)

Run `self-reflection check` at each heartbeat.

- If **OK**: Continue normally.
- If **ALERT**: Run `self-reflection read`, reflect, then `self-reflection log`.
```

## Commands

| Command | Description |
|---------|-------------|
| `self-reflection check` | Check if reflection is due (OK or ALERT) |
| `self-reflection check --quiet` | Silent mode for scripts |
| `self-reflection log <tag> <miss> <fix>` | Log a new reflection |
| `self-reflection read [n]` | Read last n reflections (default: 5) |
| `self-reflection stats` | Show statistics and top tags |
| `self-reflection reset` | Reset the timer |

## Usage Examples

### Check Status

```bash
$ self-reflection check
OK: Status good. Next reflection due in 45 minutes.

# When reflection is needed:
$ self-reflection check
ALERT: Self-reflection required. Last reflection was 65 minutes ago.
```

### Log a Reflection

```bash
$ self-reflection log "error-handling" \
    "Forgot to handle API timeout" \
    "Always add timeout parameter to requests"

Reflection logged successfully.
  Tag:  error-handling
  Miss: Forgot to handle API timeout
  Fix:  Always add timeout parameter to requests
```

### Read Past Lessons

```bash
$ self-reflection read 3
=== Last 3 reflections (of 12 total) ===

## 2026-01-30 14:30 | error-handling

**Miss:** Forgot to handle API timeout
**Fix:** Always add timeout parameter to requests

---

## 2026-01-30 10:15 | communication

**Miss:** Response was too verbose
**Fix:** Lead with the answer, then explain

---
```

### View Statistics

```bash
$ self-reflection stats
=== Self-Reflection Statistics ===

Last reflection: 2026-01-30 14:30:00
Total reflections: 12

Entries in memory: 12

Top tags:
  error-handling: 4
  communication: 3
  api: 2

Threshold: 60 minutes
Memory file: ~/workspace/memory/self-review.md
```

## Configuration

Create `~/.openclaw/self-reflection.json`:

```json
{
  "threshold_minutes": 60,
  "memory_file": "~/workspace/memory/self-review.md",
  "state_file": "~/.openclaw/self-review-state.json",
  "max_entries_context": 5
}
```

| Option | Default | Description |
|--------|---------|-------------|
| `threshold_minutes` | 60 | Minutes between required reflections |
| `memory_file` | `~/workspace/memory/self-review.md` | Where reflections are stored |
| `state_file` | `~/.openclaw/self-review-state.json` | Timer state file |
| `max_entries_context` | 5 | Default entries shown by `read` |

## Memory Format

Reflections are stored in human-readable Markdown:

```markdown
# Self-Review Log

This file contains lessons learned and improvements for continuous growth.

---

## 2026-01-30 14:30 | error-handling

**Miss:** Forgot to handle API timeout
**Fix:** Always add timeout parameter to requests

---

## 2026-01-30 10:15 | communication

**Miss:** Response was too verbose
**Fix:** Lead with the answer, then explain

---
```

## Recommended Tags

| Tag | Use for |
|-----|---------|
| `error-handling` | Missing try/catch, unhandled edge cases |
| `communication` | Verbose responses, unclear explanations |
| `api` | API usage mistakes, wrong endpoints |
| `performance` | Slow code, inefficient algorithms |
| `ux` | Poor user experience decisions |
| `security` | Security oversights |
| `testing` | Missing tests, untested edge cases |

## File Structure

```
~/.openclaw/
β”œβ”€β”€ skills/
β”‚   └── self-reflection/
β”‚       β”œβ”€β”€ bin/
β”‚       β”‚   └── self-reflection     # CLI script
β”‚       β”œβ”€β”€ README.md
β”‚       β”œβ”€β”€ SKILL.md                # OpenClaw manifest
β”‚       β”œβ”€β”€ LICENSE
β”‚       └── self-reflection.example.json
β”œβ”€β”€ self-reflection.json            # Your config
└── self-review-state.json          # Timer state (auto-created)

~/workspace/
└── memory/
    └── self-review.md              # Lessons (auto-created)
```

## Dependencies

- `bash` (4.0+)
- `jq` (JSON processing)
- `date` (GNU coreutils)

## License

MIT License - See [LICENSE](LICENSE) for details.

## Author

Created by [hopyky](https://github.com/hopyky)

## Contributing

Issues and PRs welcome at [github.com/hopyky/self-reflection](https://github.com/hopyky/self-reflection)

```

### _meta.json

```json
{
  "owner": "86293073",
  "slug": "self-reflection-1-1-1",
  "displayName": "Self Reflection 1.1.1",
  "latest": {
    "version": "1.0.0",
    "publishedAt": 1772541558671,
    "commit": "https://github.com/openclaw/skills/commit/35ca7c77054584325e10005a3e31e3ee3b206117"
  },
  "history": []
}

```