Self-Reflect — Agent Self-Learning System
Core Principle
Correction detected → Write to target file immediately → No queue
Sync Targets (3-Layer Architecture)
| Rule Type | Target File |
|---|---|
| Code-enforceable | .kiro/rules/enforcement.md |
| High-frequency | CLAUDE.md / AGENTS.md |
| Low-frequency | .kiro/rules/reference.md or knowledge/ |
| Mistakes | knowledge/lessons-learned.md |
Trigger Patterns
High confidence (90%):
- •
remember:/always: - •
don't ... unless - •
I told you
Medium confidence (80%):
- •
no, use X/not X, use Y - •
you missed/why didn't you - •
research first/verify first
Implicit negation (75%):
- •
not good enough - •
you forgot - •
you failed to
Positive feedback (70%, also captured):
- •
perfect!/exactly right - •
great approach/that's what I wanted - •
keep doing this
Exclusion Patterns (Don't capture)
- •Questions ending with
? - •Requests starting with
please/help me - •Error reports (
error,failed) - •Messages over 300 characters (likely context, not correction)
On Detection
- •Confirm:
📝 Learning captured: '[preview]' - •Write to target file immediately (no queue)
- •Continue answering the user's question
Target Selection Logic
| Indicator | Target |
|---|---|
Model names (gpt-, claude-, gemini-) | Global (~/.kiro/AGENTS.md) |
| Format/naming/style rules | enforcement.md |
| Templates, SOPs, workflows | reference.md |
| Everything else | CLAUDE.md / AGENTS.md |
Commands
| Command | Purpose |
|---|---|
/reflect | Review queue, sync to 3-layer architecture |
/reflect-skills | Discover repeated patterns, generate skills |
/view-queue | View pending learnings |
/skip-reflect | Clear queue |
Examples
Correction → Immediate Learning
code
User: no, use gpt-5.1 not gpt-5
Agent: 📝 Learning captured: 'use gpt-5.1 not gpt-5'
OK, switching to gpt-5.1.
Constraint Rule
code
User: don't add comments unless I ask
Agent: 📝 Learning captured: 'don't add comments unless I ask'
Got it, no comments unless requested.
Review & Sync
code
User: /reflect Agent: ═══════════════════════════════════════ LEARNINGS QUEUE (3 items) ═══════════════════════════════════════ 1. [90%] "use gpt-5.1 not gpt-5" → Suggested: ~/.kiro/AGENTS.md (global) 2. [85%] "don't add comments unless I ask" → Suggested: AGENTS.md (project) 3. [80%] "filenames must use kebab-case" → Suggested: .kiro/rules/enforcement.md (codifiable) Action: [A]pply all / [R]eview each / [S]kip