Steven Gonsalvez
作者:Steven Gonsalvez更新日 2026-05-11全 2 バージョン · 最新版の公開日 2026-02-17reflect-learn@clawhub_stevengonsalvez/reflect-learn
ワークフロー編成コンテキスト管理メモリ強化#Self Improvement

AlphaMoatによると、2026-10時点でReflectのダウンロード数は27,573、スター数は16で、累計ダウンロード数で今回のランキング対象AIスキル10,914件中1,019位、AIエージェントでは1,632件中154位です。

一覧の初期表示は累計ダウンロード数順で、スター数順にも並べ替えできます。詳細ページの順位は累計ダウンロード数で計算しています。

ダウンロード数
2.8万
スター数
16
累計ダウンロード順位
#1,019
全体の上位 10% · AIエージェントの上位 10%
プラットフォームダウンロード数スター数コメント
ClawHub ↗892414-
SkillHub ↗2.8万16—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

利用者が行動を明示的に訂正したとき、会話を分析し、後のセッションで再利用できるルールを提案します。状態と記録は reflect-state.yaml(切替状態と確認待ち)、reflect-metrics.yaml(指標集計)、learnings.yaml(適用済みの学び)に保存されます。エージェントファイルの更新や新しいスキルを提案できますが、変更を適用する前に差分を示し、利用者の明示的な承認を得る必要があります。

資料公開日 2026-10-27

できること

  • 「今後はしないで」などの訂正を提案として記録する
  • 承認前に確認待ちの変更を見直す

使う場面

  • 利用者がエージェントの行動変更を明示したとき
  • 訂正を後のセッションでも活用したいとき

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

この訂正からルールを提案し、適用前に差分を見せてください。
まだ確認待ちの改善項目を表示してください。

月次の推移

ダウンロード数2.8万
1万2万2.9万2026-03 · ダウンロード数 1.2万2026-05 · ダウンロード数 1.4万2026-06 · ダウンロード数 1.4万2026-07 · ダウンロード数 1.5万2026-08 · ダウンロード数 1.5万2026-09 · ダウンロード数 1.7万2026-10 · ダウンロード数 2.8万26-0326-0926-10
スター数16
1415162026-03 · スター数 142026-05 · スター数 162026-06 · スター数 162026-07 · スター数 162026-08 · スター数 162026-09 · スター数 162026-10 · スター数 1626-0326-0926-10

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-102.8万—16
2026-091.7万—16
2026-081.5万+1.5%16
2026-071.5万+3.7%16
2026-061.4万+3.5%16
2026-051.4万—16
2026-031.2万—14

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 2026-10-23。

10 KB・ClawHub v2.1.0
---
name: reflect
description: |
  Self-improvement through conversation analysis. Extracts learnings from
  corrections and success patterns, proposes updates to agent files or
  creates new skills. Philosophy: "Correct once, never again."

  Use when: (1) User explicitly corrects behavior ("never do X", "always Y"),
  (2) Session ending or context compaction, (3) User requests /reflect,
  (4) Successful pattern worth preserving.
すべて表示(全 407 行)
version: 2.0.0
author: Claude Code Toolkit
allowed-tools:
  - Read
  - Write
  - Edit
  - Grep
  - Glob
  - Bash
---

# Reflect - Self-Improvement Skill

## Quick Reference

| Command | Action |
|---------|--------|
| `/reflect` | Analyze conversation for learnings |
| `/reflect on` | Enable auto-reflection |
| `/reflect off` | Disable auto-reflection |
| `/reflect status` | Show state and metrics |
| `/reflect review` | Review low-confidence learnings |
| `/reflect [agent]` | Focus on specific agent |

## Core Philosophy

**"Correct once, never again."**

When users correct behavior, those corrections become permanent improvements encoded into the agent system - across all future sessions.

## Workflow

### Step 1: Initialize State

Check and initialize state files using the state manager:

```bash
# Check for existing state
python scripts/state_manager.py init

# State directory is configurable via REFLECT_STATE_DIR env var
# Default: ~/.reflect/ (portable) or ~/.claude/session/ (Claude Code)
```

State includes:
- `reflect-state.yaml` - Toggle state, pending reviews
- `reflect-metrics.yaml` - Aggregate metrics
- `learnings.yaml` - Log of all applied learnings

### Step 2: Scan Conversation for Signals

Use the signal detector to identify learnings:

```bash
python scripts/signal_detector.py --input conversation.txt
```

#### Signal Confidence Levels

| Confidence | Triggers | Examples |
|------------|----------|----------|
| **HIGH** | Explicit corrections | "never", "always", "wrong", "stop", "the rule is" |
| **MEDIUM** | Approved approaches | "perfect", "exactly", accepted output |
| **LOW** | Observations | Patterns that worked, not validated |

See [signal_patterns.md](references/signal_patterns.md) for full detection rules.

### Step 3: Classify & Match to Target Files

Map each signal to the appropriate target:

**Learning Categories:**

| Category | Target Files |
|----------|--------------|
| Code Style | `code-reviewer`, `backend-developer`, `frontend-developer` |
| Architecture | `solution-architect`, `api-architect`, `architecture-reviewer` |
| Process | `CLAUDE.md`, orchestrator agents |
| Domain | Domain-specific agents, `CLAUDE.md` |
| Tools | `CLAUDE.md`, relevant specialists |
| New Skill | `.claude/skills/{name}/SKILL.md` |

See [agent_mappings.md](references/agent_mappings.md) for mapping rules.

### Step 4: Check for Skill-Worthy Signals

Some learnings should become new skills rather than agent updates:

**Skill-Worthy Criteria:**
- Non-obvious debugging (>10 min investigation)
- Misleading error (root cause different from message)
- Workaround discovered through experimentation
- Configuration insight (differs from documented)
- Reusable pattern (helps in similar situations)

**Quality Gates (must pass all):**
- [ ] Reusable: Will help with future tasks
- [ ] Non-trivial: Requires discovery, not just docs
- [ ] Specific: Can describe exact trigger conditions
- [ ] Verified: Solution actually worked
- [ ] No duplication: Doesn't exist already

See [skill_template.md](references/skill_template.md) for skill creation guidelines.

### Step 5: Generate Proposals

Produce output in this format:

```markdown
# Reflection Analysis

## Session Context
- **Date**: [timestamp]
- **Messages Analyzed**: [count]
- **Focus**: [all agents OR specific agent name]

## Signals Detected

| # | Signal | Confidence | Source Quote | Category |
|---|--------|------------|--------------|----------|
| 1 | [learning] | HIGH | "[exact words]" | Code Style |
| 2 | [learning] | MEDIUM | "[context]" | Architecture |

## Proposed Agent Updates

### Change 1: Update [agent-name]

**Target**: `[file path]`
**Section**: [section name]
**Confidence**: [HIGH/MEDIUM/LOW]
**Rationale**: [why this change]

```diff
--- a/path/to/agent.md
+++ b/path/to/agent.md
@@ -82,6 +82,7 @@
 ## Section

 * Existing rule
+* New rule from learning
```

## Proposed New Skills

### Skill 1: [skill-name]

**Quality Gate Check**:
- [x] Reusable: [why]
- [x] Non-trivial: [why]
- [x] Specific: [trigger conditions]
- [x] Verified: [how verified]
- [x] No duplication: [checked against]

**Will create**: `.claude/skills/[skill-name]/SKILL.md`

## Conflict Check

- [x] No conflicts with existing rules detected
- OR: Warning - potential conflict with [file:line]

## Commit Message

```
reflect: add learnings from session [date]

Agent updates:
- [learning 1 summary]

New skills:
- [skill-name]: [brief description]

Extracted: [N] signals ([H] high, [M] medium, [L] low confidence)
```

## Review Prompt

Apply these changes?
- `Y` - Apply all changes and commit
- `N` - Discard all changes
- `modify` - Adjust specific changes
- `1,3` - Apply only changes 1 and 3
- `s1` - Apply only skill 1
- `all-skills` - Apply all skills, skip agent updates
```

### Step 6: Handle User Response

**On `Y` (approve):**
1. Apply each change using Edit tool
2. Run `git add` on modified files
3. Commit with generated message
4. Update learnings log
5. Update metrics

**On `N` (reject):**
1. Discard proposed changes
2. Log rejection for analysis
3. Ask if user wants to modify any signals

**On `modify`:**
1. Present each change individually
2. Allow editing the proposed addition
3. Reconfirm before applying

**On selective (e.g., `1,3`):**
1. Apply only specified changes
2. Log partial acceptance
3. Commit only applied changes

### Step 7: Update Metrics

```bash
python scripts/metrics_updater.py --accepted 3 --rejected 1 --confidence high:2,medium:1
```

## Toggle Commands

### Enable Auto-Reflection

```bash
/reflect on
# Sets auto_reflect: true in state file
# Will trigger on PreCompact hook
```

### Disable Auto-Reflection

```bash
/reflect off
# Sets auto_reflect: false in state file
```

### Check Status

```bash
/reflect status
# Shows current state and metrics
```

### Review Pending

```bash
/reflect review
# Shows low-confidence learnings awaiting validation
```

## Output Locations

**Project-level (versioned with repo):**
- `.claude/reflections/YYYY-MM-DD_HH-MM-SS.md` - Full reflection
- `.claude/reflections/index.md` - Project summary
- `.claude/skills/{name}/SKILL.md` - New skills

**Global (user-level):**
- `~/.claude/reflections/by-project/{project}/` - Cross-project
- `~/.claude/reflections/by-agent/{agent}/learnings.md` - Per-agent
- `~/.claude/reflections/index.md` - Global summary

## Memory Integration

Some learnings belong in **auto-memory** (`~/.claude/projects/*/memory/MEMORY.md`) rather than agent files:

| Learning Type | Best Target |
|---------------|-------------|
| Behavioral correction ("always do X") | Agent file |
| Project-specific pattern | MEMORY.md |
| Recurring bug/workaround | New skill OR MEMORY.md |
| Tool preference | CLAUDE.md |
| Domain knowledge | MEMORY.md or compound-docs |

When a signal is LOW confidence and project-specific, prefer writing to MEMORY.md over modifying agents.

## Safety Guardrails

### Human-in-the-Loop
- NEVER apply changes without explicit user approval
- Always show full diff before applying
- Allow selective application

### Git Versioning
- All changes committed with descriptive messages
- Easy rollback via `git revert`
- Learning history preserved

### Incremental Updates
- ONLY add to existing sections
- NEVER delete or rewrite existing rules
- Preserve original structure

### Conflict Detection
- Check if proposed rule contradicts existing
- Warn user if conflict detected
- Suggest resolution strategy

## Integration

### With /handover
If auto-reflection is enabled, PreCompact hook triggers reflection before handover.

### With Session Health
At 70%+ context (Yellow status), reminders to run `/reflect` are injected.

### Hook Integration (Claude Code)

The skill includes hook scripts for automatic integration:

```bash
# Install hook to your Claude hooks directory
cp hooks/precompact_reflect.py ~/.claude/hooks/
```

Configure in `~/.claude/settings.json`:

```json
{
  "hooks": {
    "PreCompact": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "uv run ~/.claude/hooks/precompact_reflect.py --auto"
          }
        ]
      }
    ]
  }
}
```

See [hooks/README.md](hooks/README.md) for full configuration options.

## Portability

This skill works with any LLM tool that supports:
- File read/write operations
- Text pattern matching
- Git operations (optional, for commits)

### Configurable State Location

```bash
# Set custom state directory
export REFLECT_STATE_DIR=/path/to/state

# Or use default
# ~/.reflect/ (portable default)
# ~/.claude/session/ (Claude Code default)
```

### No Task Tool Dependency

Unlike the previous agent-based approach, this skill executes directly without spawning subagents. The LLM reads SKILL.md and follows the workflow.

### Git Operations Optional

Commits are wrapped with availability checks - if not in a git repo, changes are still saved but not committed.

## Troubleshooting

**No signals detected:**
- Session may not have had corrections
- Try `/reflect review` to check pending items

**Conflict warning:**
- Review the existing rule cited
- Decide if new rule should override
- Can modify before applying

**Agent file not found:**
- Check agent name spelling
- Use `/reflect status` to see available targets
- May need to create agent file first

## File Structure

```
reflect/
├── SKILL.md                      # This file
├── scripts/
│   ├── state_manager.py          # State file CRUD
│   ├── signal_detector.py        # Pattern matching
│   ├── metrics_updater.py        # Metrics aggregation
│   └── output_generator.py       # Reflection file & index generation
├── hooks/
│   ├── precompact_reflect.py     # PreCompact hook integration
│   ├── settings-snippet.json     # Settings.json examples
│   └── README.md                 # Hook configuration guide
├── references/
│   ├── signal_patterns.md        # Detection rules
│   ├── agent_mappings.md         # Target mappings
│   └── skill_template.md         # Skill generation
└── assets/
    ├── reflection_template.md    # Output template
    └── learnings_schema.yaml     # Schema definition
```

AIエージェントの人気スキル

self-improving agentAIエージェント

開発中の学び、エラー、訂正を Markdown ファイルに記録し、再利用やワークスペースの記憶への昇格に備えます。

↓ 160.3万★ 4544pskoett
技能发现·Find SkillsAIエージェント

やりたいことを自然文で伝えると、ローカルとリモートのカタログからスキルを探して推薦するスキルです。

↓ 157.4万★ 1810桂皮
Agent BrowserAIエージェント

AI エージェント向けのブラウザ自動化コマンドラインスキルです。

↓ 122.3万★ 1001Nicolas Kleiber
Self-Improving + Proactive AgentAIエージェント

利用者の訂正と自己点検を層構造の記憶に蓄え、使われ方に応じて昇格や保管を行うスキルです。

↓ 69.6万★ 1622Iván
Proactive AgentAIエージェント

AI エージェントの先回り、作業記憶、振り返りの手順を計画するためのワークスペース設定ガイドです。

↓ 57.9万★ 916halthelobster
Skill CreatorAIエージェント

効果的な Claude スキルの作成・更新ガイドです。

↓ 47.7万★ 485chindden
Skill VetterAIエージェント

第三者のスキルを入れる前に、出所と権限と危険な作りを手順に沿って調べるスキルです。

↓ 44.5万★ 1328spclaudehome
唐朝诗仙李白 · Ai Agent SkillAIエージェント

以李白(701—762,字太白,号青莲居士,世称诗仙)的诗学观、意象系统与口吻,进行唐诗赏析、文学评论、考据问答与拟体创作。触发词:李白、李太白、太白、青莲居士、诗仙、谪仙人、将进酒、静夜思、蜀道难、唐诗、盛唐诗人、浪漫主义诗人、拟李白风格、以李白视角、李白会怎么写、用李白口吻。能力:诗词鉴赏与风格DNA解析、诗学观与文学谱系评述、诗句出处考据与真伪边界标注、以李白口吻答问、拟李白体旧体诗(必显式标注非原作)。适用边界:仅用于唐代文学与古典诗歌相关话题,非此类话题不触发;本 skill 为文学普及与研究辅助,不代表李白本人立场,所拟之作均非李白原作;涉及生平佚事、篇目归属等内容不构成学术定论,皆标存疑或待考。

↓ 43.6万★ 4user_ff4d9420

データ月:2026-10 · ダウンロード数とスター数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。