reflecting
Use when completing significant work to extract learnings. Use when user corrects your approach or when you discover important patterns during agent interactions. Use when agent learns something new that should be captured for future reference. Use when user says "reflect", "what did we learn", "capture learnings". Use after resolving complex problems or discovering patterns.
What this skill does
# Reflecting
## Overview
**Reflecting IS converting experience into a structured report for the planning pipeline.**
Analyze the conversation, extract learnings, and produce a reflection report. Route the report to planning-agent-systems — do not classify or create components directly.
**Core principle:** Capture before context is lost. Classify just enough for planning to act on.
**Violating the letter of the rules is violating the spirit of the rules.**
## Routing
**Pattern:** Chain
**Handoff:** auto-invoke
**Next:** `planning-agent-systems`
## Task Initialization (MANDATORY)
Before ANY action, create task list using TaskCreate:
```
TaskCreate for EACH task below:
- Subject: "[reflecting] Task N: <action>"
- ActiveForm: "<doing action>"
```
**Tasks:**
1. Analyze conversation
2. Extract knowledge
3. Produce reflection report
4. Review report quality
5. Consolidation review
6. Route to planning
Announce: "Created 6 tasks. Starting execution..."
**Execution rules:**
1. `TaskUpdate status="in_progress"` BEFORE starting each task
2. `TaskUpdate status="completed"` ONLY after verification passes
3. If task fails → stay in_progress, diagnose, retry
4. NEVER skip to next task until current is completed
5. At end, `TaskList` to confirm all completed
## Pain Point Focus
If the user provides a pain point via `$ARGUMENTS` (e.g., `/reflect hooks keep breaking on Windows`), treat it as a **priority lens** for the entire reflection:
1. The pain point gets its own event entry in Task 1 — even if the conversation doesn't explicitly show it failing
2. In Task 2, extract at least one learning specifically addressing the pain point
3. The pain point does NOT replace normal analysis — still scan the full conversation for other events
This ensures user-reported friction gets captured even when it's not visible in the conversation trace.
## Task 1: Analyze Conversation
**Goal:** Review the conversation to identify significant events.
**If pain point provided:** Create an event entry for it first, using the user's description as context. Then proceed with normal analysis.
**Look for:**
- **Corrections** — user corrected the agent's approach or output
- **Errors** — agent made a mistake, multiple attempts needed
- **Discoveries** — new insights about the project, domain, or tooling
- **Repetitions** — same action performed multiple times (automation candidate)
- **Safety bypasses** — destructive or irreversible actions taken without confirmation, or safety checks circumvented
**Safety bypass patterns to detect** (scan commands run, edits made, user interjections):
- `git push --force`, `git reset --hard`, `git checkout --`, `git clean -f`, `git branch -D` without explicit user confirmation
- `--no-verify`, `--no-gpg-sign`, bypassing pre-commit or validation hooks
- `rm -rf`, dropping tables, overwriting uncommitted changes
- Deleting or editing tests to make them pass (instead of fixing implementation)
- Discarding unfamiliar files/branches that may be user in-progress work
- `rsync --delete` or deploys without verifying exclusions
- User interjection phrases: "stop", "don't delete", "wait", "why did you", "rollback", "undo"
- Agent reasoning that treats destructive op as shortcut around obstacle
**Trace the skill router for each event:**
For corrections and errors, identify which component routed the agent to that behavior:
1. Which skill was active? (check skill invocations in conversation)
2. Which rule or CLAUDE.md law triggered the approach?
3. Was there no router (agent used general knowledge)?
**Locate the router's actual file path** — use Glob to find it:
- Skill → `Glob "**/skills/{name}/SKILL.md"` (covers `plugins/**/skills/` and `.claude/skills/`)
- Rule → `Glob "**/.claude/rules/{name}.md"`
- Agent/Subagent → `Glob "**/agents/{name}.md"` (covers `plugins/**/agents/` and `.claude/agents/`)
- CLAUDE.md → project root `CLAUDE.md`
If Glob returns multiple matches, record all paths — the conversation context usually disambiguates which one was active.
Record the resolved path. This path is used in Task 2 dedup gate.
This determines where fixes land:
- Router is a skill → fix goes in that skill
- Router is a rule → fix goes in that rule
- Router is CLAUDE.md → fix goes in CLAUDE.md
- No router → new rule or skill needed
**Document each event:**
```
Event: [What happened]
Context: [When/where it occurred]
Outcome: [Result]
Type: correction / error / discovery / repetition / safety_bypass
Router: [skill/rule/law/none that caused this behavior]
Router path: [resolved file path, or "none"]
```
**Verification:** Listed at least 3 significant events. If fewer than 3 occurred, document why. Each event has a router identified (or explicitly "none").
## Task 2: Extract Knowledge
**Goal:** Derive actionable learnings from each event.
**For each event, ask:**
- What would have prevented this failure?
- What made this succeed that could be repeated?
- What did we learn that applies beyond this task?
**Simplicity principle:** Prefer the simplest component type that works.
- A one-line convention → `rule`, not a `skill`
- A repeated multi-step process → `skill`, not a `doc`
- An immutable project constraint → `law`, not a `rule`
**Safety bypass overrides simplicity:** If event type is `safety_bypass`, fix_target MUST be `rule` or `law` — never `skill` alone. Rationale: skills are opt-in routers, but safety constraints need always-on enforcement. Law for absolute prohibitions (force push main), rule for path/context-scoped enforcement (no `--no-verify` in this repo). Every safety_bypass learning also requires one explicit preventive instruction naming the exact command/flag to block.
**Learning format:**
```yaml
Learning:
context: [When this applies]
insight: [What was learned]
evidence: [Specific event that taught this]
router: [Which component routed the behavior, from event trace]
fix_target: [Same component as router, or new component if router=none]
suggested_component: rule / law / skill / hook / doc
rationale: [Why this component type fits, informed by router analysis]
```
**Verification:** Each event has at least one learning with router, fix_target, suggested component, and rationale.
## Task 3: Produce Reflection Report
**Goal:** Write a structured report for the planning pipeline.
1. Read `references/report-template.md` for format and completeness checklist
2. Determine timestamp: `YYYY-MM-DD` format
3. Write report to `.rcc/{timestamp}-reflection.md`
The report must follow the template exactly, including:
- Session context
- Events table (Event / Context / Outcome / Type)
- Learnings table (Learning / Evidence / Suggested Component / Rationale)
- Component recommendations with path hints and content summaries
- Weaknesses addressed (if applicable)
**Verification:** Report file exists at the expected path with no placeholder text.
## Task 4: Review Report Quality
**Goal:** Verify the report is complete before routing.
Use the completeness checklist from `references/report-template.md`:
- [ ] Every event has at least one learning
- [ ] Every learning has router, fix_target, suggested component, and rationale
- [ ] Every component recommendation has type, path hint, content summary, and traces-to
- [ ] No placeholder text (TBD, TODO, etc.)
- [ ] Session context accurately describes the work done
- [ ] At least 3 events documented (or explanation of why fewer)
**If missing learnings** → return to Task 2, extract more, then re-run Task 3.
**If format issues** → return to Task 3, fix the report.
**Verification:** All checklist items pass.
## Task 5: Consolidation Review
**Goal:** Ensure recommendations consolidate into existing components rather than bloating the system.
**Only review components with diff** — invoke reviewer agents on each recommendation's fix_target (using router path from Task 1).
**For each recommendation, invoke the corresponding reviewer agent:**
| fix_target type | Reviewer agent |
|--Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.