.claude/skills/reflection/SKILL.md
Meta-improvement skill that analyzes conversation context and uncommitted git changes to propose improvements to the AI agent ecosystem itself (agents, skills, commands). Use when the user asks to reflect on the conversation, improve the agent ecosystem, or optimize workflows based on patterns observed. This skill ALWAYS acts as supervisor first, producing an initial analysis report, then spawns specialized builder agents based on user-approved plan. Always requires user approval before making changes.
npx skillsauth add ruska-ai/orchestra reflectionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyzes conversation context and uncommitted git changes to identify strategic improvements for the AI agent ecosystem (agents, skills, commands), then synchronizes documentation (CLAUDE.md) to reflect changes. This skill is about META-improvement - improving how AI agents themselves work and collaborate.
The AI agent ecosystem has a natural dependency chain:
This creates: Agents → Skills → Commands
Understanding this chain is critical for determining whether builder agents can run in parallel or must execute sequentially.
.claude/ structure:
.claude/agents/ (specialized sub-agents).claude/skills/ (domain knowledge packages).claude/commands/ (workflow automation slash commands)CLAUDE.md (AI agent instructions)This skill is about META-improvement: Rather than improving project code or user documentation, it improves the AI agent ecosystem itself. The goal is to make future AI interactions more efficient, accurate, and user-friendly by continuously evolving the agent, skill, and command infrastructure.
Supervisor-First Approach: This skill ALWAYS starts as a supervisor, analyzing the current state and producing an initial report. Only after user approval does it spawn builder agents to generate specific proposals.
The reflection workflow consists of 4 sequential phases, with the supervisor analysis ALWAYS coming first.
Before spawning any builder agents, act as supervisor and produce an initial analysis report. This report determines the optimal approach for the rest of the workflow.
Steps:
Analyze Conversation Context
Analyze Git Changes
git status to see uncommitted changesgit diff to understand what code changedReview Current Ecosystem
.claude/agents/.claude/skills/.claude/commands/Produce Initial Report
Use this exact format:
## Reflection Analysis Report
### Observed Context
**Conversation Summary**: [What was discussed, patterns observed, user goals]
**Git Changes**: [What files changed, architectural patterns that emerged]
### Current Ecosystem State
- **Agents**: [count] existing ([list names])
- **Skills**: [count] existing ([list names])
- **Commands**: [count] existing ([list names])
### Identified Opportunities
#### Agents
[Describe gaps or improvements identified, or "No changes needed"]
#### Skills
[Describe gaps or improvements identified, or "No changes needed"]
#### Commands
[Describe gaps or improvements identified, or "No changes needed"]
### Recommendation
**Approach**: [Sequential/Parallel/Agents Only/Skills Only/Commands Only/Skip]
**Reasoning**: [Why this approach is optimal]
### Dependency Assessment
**Can Parallelize**: [Yes/No]
**Reason**: [Explanation of dependencies or independence]
- If YES: Proposed changes are independent improvements that don't rely on each other
- If NO: Changes have dependencies (e.g., new agents need new skills, new commands need new agents)
Present the initial report and ask the user which approach to take.
Use this exact question format:
Based on the analysis above, how should I proceed?
**Options**:
1. **Full Sequential (Recommended if dependencies exist)** - Run agent-builder, then skill-builder, then command-builder in order
2. **Parallel (Fast if no dependencies)** - Run all three builders simultaneously
3. **Agents Only** - Only review and propose agent improvements
4. **Skills Only** - Only review and propose skill improvements
5. **Commands Only** - Only review and propose command improvements
6. **Skip** - No changes needed at this time
Please select an option (1-6):
Wait for user response before proceeding to Phase 3.
Based on the user's selection from Phase 2, invoke builder agents using one of these patterns:
Step 1: Agent Builder Phase
Invoke agent-builder agent with Task:
"Review existing agents in `.claude/agents/` and analyze the conversation context and git changes. Propose:
- Improvements to existing agents (better instructions, tool access, model selection)
- New agents based on conversation patterns or emerging needs
Provide concrete proposals with file paths and justifications."
Wait for agent-builder to complete
Present agent proposals to user:
## Agent Proposals
[List proposals with #A1, #A2, etc. format]
Which agent improvements should I apply?
- [ ] Accept All
- [ ] #A1: [description]
- [ ] #A2: [description]
- [ ] Skip All
Apply approved agent changes
Step 2: Skill Builder Phase (runs AFTER agent changes applied)
Step 3: Command Builder Phase (runs AFTER skill changes applied)
Only use if supervisor determined NO dependencies exist.
Execute in SINGLE message:
After all complete:
Invoke only the selected builder (agent-builder, skill-builder, OR command-builder):
No builder agents invoked. End workflow.
After ALL approved changes from all builder phases are applied, update CLAUDE.md to reflect the new agent ecosystem state.
CLAUDE.md Updates (only if changes were applied):
Update the "AI Agent Workflows" section (or create if missing):
## AI Agent Workflows
### Available Agents
[List all agents with their purposes - updated to reflect new/changed agents]
### Available Skills
[List all skills with their triggers - updated to reflect new/changed skills]
### Available Commands
[List all commands with their usage - updated to reflect new/changed commands]
### Workflow Recommendations
[Update based on new capabilities - how to use the agent ecosystem effectively]
Key Points:
When presenting proposals to the user (in each builder phase), use this format:
## [Agent/Skill/Command] Proposals
Based on the builder analysis, here are the recommended improvements:
**Improvements to Existing [Type]**:
- [ ] #[X]1: [Name] - [Brief description]
**File**: [path]
**Current**: [what exists now]
**Proposed**: [what will change]
**Justification**: [why this helps]
**Priority**: [High/Medium/Low]
**New [Type] to Create**:
- [ ] #[X]2: [Name] - [Brief description]
**File**: [path]
**Proposed**: [what will be created]
**Justification**: [why this helps]
**Priority**: [High/Medium/Low]
**Options**:
- [ ] Accept All
- [ ] Custom - I'll specify modifications in my response
- [ ] Skip All
Which improvements should I apply?
When applying approved changes (in each builder phase):
For each approved proposal:
If improving existing agent/skill/command:
If creating new agent/skill/command:
.claude/agents/, .claude/skills/, .claude/commands/)Track what was applied:
Application Order:
Guide the spawned builder agents to focus on these areas:
For agent-builder:
For skill-builder:
For command-builder:
The builder agents should analyze both conversation and code:
Conversation Context Analysis:
Git Changes Analysis:
git status for uncommitted changesgit diff to see what code changedExisting Ecosystem Review:
.claude/agents/.claude/skills/.claude/commands/User: "Reflect on our conversation and suggest improvements"
Phase 1: Supervisor Initial Report
Assistant analyzes conversation and git changes, then produces:
## Reflection Analysis Report
### Observed Context
**Conversation Summary**: Worked on database migration feature, discussed async testing patterns, debugged SQL injection vulnerability
**Git Changes**: Added new migration files, updated database schema, modified authentication endpoints
### Current Ecosystem State
- **Agents**: 7 existing (agent-builder, skill-builder, command-builder, code-review, blog-writer, system-architect, technical-writer)
- **Skills**: 5 existing (reflection, test-backend, test-frontend, manage-app, explaining-code)
- **Commands**: 5 existing (build, plan, prime, worktree, reflection)
### Identified Opportunities
#### Agents
- code-review agent lacks security-specific checklist (missed SQL injection)
- Gap: No specialized database agent for migrations/queries
#### Skills
- test-backend skill missing async testing patterns
- Gap: No database schema design skill
#### Commands
- Repetitive workflow: User manually ran migration steps 3 times
- Gap: No /migrate command to automate this
### Recommendation
**Approach**: Full Sequential
**Reasoning**: New database agent → new database skill → new migrate command that uses both. Clear dependency chain.
### Dependency Assessment
**Can Parallelize**: No
**Reason**: The proposed database command would depend on the database agent and database skill. Must build in Agents → Skills → Commands order.
Phase 2: User Decision Point
Assistant presents options:
Based on the analysis above, how should I proceed?
**Options**:
1. **Full Sequential (Recommended if dependencies exist)** - Run agent-builder, then skill-builder, then command-builder in order
2. **Parallel (Fast if no dependencies)** - Run all three builders simultaneously
3. **Agents Only** - Only review and propose agent improvements
4. **Skills Only** - Only review and propose skill improvements
5. **Commands Only** - Only review and propose command improvements
6. **Skip** - No changes needed at this time
Please select an option (1-6):
User: "Option 1 - Full Sequential"
Phase 3: Builder Invocation - Step 1: Agent Builder
[Assistant spawns agent-builder agent]
Agent-builder completes and provides proposals. Assistant presents:
## Agent Proposals
**Improvements to Existing Agents**:
- [ ] #A1: code-review - Add OWASP Top 10 security checklist
**File**: `.claude/agents/code-review.md`
**Current**: General code review without specific security focus
**Proposed**: Add dedicated security review section with OWASP Top 10 checklist
**Justification**: Missed SQL injection vulnerability in conversation
**Priority**: High
**New Agents to Create**:
- [ ] #A2: database-expert - New agent for database operations
**File**: `.claude/agents/database-expert.md`
**Proposed**: Specialized agent for migrations, queries, schema design
**Justification**: Repeated database questions across conversation
**Priority**: Medium
**Options**:
- [ ] Accept All
- [ ] Custom - I'll specify modifications in my response
- [ ] Skip All
Which improvements should I apply?
User: "Accept All"
[Assistant applies #A1 and #A2]
Applied successfully:
Phase 3: Builder Invocation - Step 2: Skill Builder
[Assistant spawns skill-builder agent, now aware of new database-expert agent]
Skill-builder completes. Assistant presents:
## Skill Proposals
**Improvements to Existing Skills**:
- [ ] #S1: test-backend - Add async testing patterns
**File**: `.claude/skills/test-backend/SKILL.md`
**Current**: Missing guidance on async/await testing
**Proposed**: Add section on pytest-asyncio patterns
**Justification**: Struggled with async test setup twice
**Priority**: High
**New Skills to Create**:
- [ ] #S2: database-design - New skill for database schema design
**File**: `.claude/skills/database-design/SKILL.md`
**Proposed**: Best practices for migrations, indexing, normalization
**Justification**: Would complement new database-expert agent
**Priority**: Medium
**Options**:
- [ ] Accept All
- [ ] Custom
- [ ] Skip All
Which improvements should I apply?
User: "Accept All"
[Assistant applies #S1 and #S2]
Applied successfully:
Phase 3: Builder Invocation - Step 3: Command Builder
[Assistant spawns command-builder agent, now aware of database-expert agent and database-design skill]
Command-builder completes. Assistant presents:
## Command Proposals
**New Commands to Create**:
- [ ] #C1: /migrate - Automate database migration workflow
**File**: `.claude/commands/migrate.md`
**Proposed**: Generate migration → review with database-expert → apply → verify
**Justification**: User manually ran migration steps 3 times
**Priority**: High
**Options**:
- [ ] Accept All
- [ ] Custom
- [ ] Skip All
Which improvements should I apply?
User: "Accept All"
[Assistant applies #C1]
Applied successfully:
Phase 4: Sync Documentation
[Assistant updates CLAUDE.md with new agents, skills, and commands]
Updated CLAUDE.md "AI Agent Workflows" section ✓
Summary:
All improvements applied successfully. The agent ecosystem now has enhanced security reviews, database expertise, and automated migration workflow.
User: "Reflect on the conversation"
Phase 1: Supervisor Initial Report
## Reflection Analysis Report
### Observed Context
**Conversation Summary**: Discussed code formatting preferences, updated linting rules
**Git Changes**: Modified .prettierrc, updated ESLint config
### Current Ecosystem State
- **Agents**: 8 existing
- **Skills**: 6 existing
- **Commands**: 6 existing
### Identified Opportunities
#### Agents
- No gaps identified, all agents working well
#### Skills
- explaining-code skill could benefit from linting best practices section
#### Commands
- No repetitive workflows observed
### Recommendation
**Approach**: Skills Only (or Parallel if we want all builders to review)
**Reasoning**: Only one improvement needed, isolated to skills domain
### Dependency Assessment
**Can Parallelize**: Yes
**Reason**: The linting improvement to explaining-code skill is independent and doesn't depend on any new agents or impact any commands
Phase 2: User Decision Point
User: "Option 4 - Skills Only"
Phase 3: Builder Invocation
[Assistant spawns only skill-builder]
## Skill Proposals
**Improvements to Existing Skills**:
- [ ] #S1: explaining-code - Add linting best practices
**File**: `.claude/skills/explaining-code/SKILL.md`
**Current**: Focuses on code explanation, doesn't mention linting
**Proposed**: Add section on explaining linting rules and auto-formatting
**Justification**: Recent conversation involved linting configuration
**Priority**: Low
**Options**:
- [ ] Accept All
- [ ] Skip All
User: "Accept All"
[Assistant applies #S1]
Phase 4: Sync Documentation
Updated CLAUDE.md ✓
Summary:
User: "Reflect on our work"
Phase 1: Supervisor Initial Report
## Reflection Analysis Report
### Observed Context
**Conversation Summary**: Brief status check on current project
**Git Changes**: No uncommitted changes
### Current Ecosystem State
- **Agents**: 8 existing
- **Skills**: 6 existing
- **Commands**: 6 existing
### Identified Opportunities
#### Agents
No improvements needed - all agents up-to-date
#### Skills
No gaps identified
#### Commands
No repetitive workflows observed
### Recommendation
**Approach**: Skip
**Reasoning**: Conversation was brief status check, no patterns emerged that warrant ecosystem changes
### Dependency Assessment
**Can Parallelize**: N/A
**Reason**: No changes recommended
Phase 2: User Decision Point
User: "Option 6 - Skip"
No builder agents invoked. Reflection complete.
When analyzing conversation context:
When analyzing git changes:
When making recommendations:
Can parallelize when:
Must use sequential when:
The supervisor report should:
Avoid:
Only update CLAUDE.md if changes were actually applied:
Update or create "AI Agent Workflows" section with:
Keep it concise:
Proposed improvements should be:
Avoid:
This skill ALWAYS begins as a supervisor, never jumping directly to builder agents:
This skill has TWO required interaction points:
Never make changes without explicit user approval at each phase.
Agents → Skills → Commands creates natural dependencies:
When dependencies exist: Use Sequential mode to build in order When independent: Parallel mode works, but Sequential is safer default
Remember: This skill is NOT about improving project code or user documentation. It's about improving the AI agent ecosystem itself:
The goal is to make the AI agent infrastructure better, which indirectly improves all future work.
Default to Sequential when:
Only recommend Parallel when:
This skill has:
In Supervisor Report:
In Builder Proposals:
tools
Apply coordinated changes across multiple files efficiently using parallel Edit tool calls. Use when making systematic changes like renaming variables, updating imports, applying pattern changes, or refactoring across files. Triggers on: rename across files, update all imports, change pattern in multiple files, refactor across codebase, batch edit files.
testing
Record browser workflows as video and convert to high-quality GIFs using agent-browser and ffmpeg. Use when users ask to record workflow, create gif, record demo, browser recording, workflow gif, or screen recording.
development
Run and verify frontend tests for the React/Vite application.
development
Run and verify backend tests for the FastAPI/Python application.