xiaohongshu
xiaohongshu
agent-improvement
Self-improvement loop for multi-agent workflows. Diagnose failures, improve tool descriptions, and learn from success/failure patterns.
Full skill instructions
Enable continuous improvement of multi-agent workflows through:
Reference: Anthropic achieved 40% faster task completion through LLM-based tool description improvements.
┌─────────────────────────────────────────────────┐
│ │
│ 1. COLLECT │
│ └── Gather traces from completed sessions │
│ │
│ 2. ANALYZE │
│ └── Identify failure patterns & bottlenecks │
│ │
│ 3. DIAGNOSE │
│ └── Use LLM to understand root causes │
│ │
│ 4. IMPROVE │
│ └── Update tool descriptions & agent prompts │
│ │
│ 5. VALIDATE │
│ └── Test improvements on similar tasks │
│ │
│ 6. DEPLOY │
│ └── Roll out to all agents │
│ │
└─────────────────────────────────────────────────┘
Store in .temp/improvement/patterns/:
{
"pattern_id": "pat_001",
"type": "failure|success",
"frequency": 5,
"context": {
"task_type": "ui_component_creation",
"agent": "mobile-ui-specialist",
"phase": "implementation"
},
"description": "Agent often misses accessibility labels",
"examples": [
{
"session_id": "sess_abc",
"file": "StationCard.tsx",
"issue": "Missing accessibilityLabel on TouchableOpacity"
}
],
"proposed_fix": "Add explicit reminder in agent prompt",
"status": "identified|proposed|implemented|validated"
}
{
"tool": "read",
"usage_count": 1523,
"success_rate": 0.98,
"avg_duration_ms": 45,
"common_errors": [
{
"error": "File not found",
"frequency": 23,
"cause": "Path alias not resolved"
}
],
"improvement_opportunities": [
"Add path alias resolution hint to tool description"
]
}
Input: Session traces with failures Output: Categorized failure patterns
## Failure Analysis Report
### Category 1: Agent Boundary Violations
- Frequency: 12 occurrences
- Pattern: UI agent attempting to modify services
- Root Cause: Task boundaries not clear in delegation
- Fix: Add explicit "DO NOT" list to delegation template
### Category 2: Missing Dependencies
- Frequency: 8 occurrences
- Pattern: UI agent starts before types available
- Root Cause: Dependency order not enforced
- Fix: Add dependency check before spawning
### Category 3: Tool Misuse
- Frequency: 5 occurrences
- Pattern: Using grep instead of read for known files
- Root Cause: Tool descriptions don't clarify when to use each
- Fix: Update tool descriptions with decision criteria
Input: Session metrics Output: Performance bottlenecks
## Bottleneck Analysis
### Bottleneck 1: Sequential Agent Spawning
- Impact: 40% time overhead
- Pattern: Agents spawned one at a time
- Fix: Spawn independent agents in parallel
### Bottleneck 2: Excessive Iterations
- Impact: 2x token usage
- Pattern: Average 3.2 iterations per task
- Fix: Improve initial task decomposition
### Bottleneck 3: Quality Gate Failures
- Impact: 25% rework
- Pattern: TypeScript errors on first integration
- Fix: Add pre-integration type check
Before:
Read: Reads a file from the filesystem
After:
Read: Reads a file from the filesystem.
- Use when you know the exact file path
- Prefer over grep for reading specific known files
- Use path aliases (@components, @services)
- Returns line-numbered content
Before:
You are a mobile UI specialist...
After:
You are a mobile UI specialist...
CRITICAL REMINDERS:
- Always add accessibilityLabel to interactive elements
- Use memo() for components with complex props
- Check LINE_COLORS constant for subway line colors
Before:
### Task Boundaries
- DO NOT modify services
After:
### Task Boundaries (EXPLICIT)
Files you CAN modify:
- src/components/**
- src/screens/**
Files you CANNOT modify:
- src/services/** (backend agent)
- src/models/** (shared types)
- **/__tests__/** (test agent)
STOP if you need to modify excluded files.
Identify test cases
Run A/B comparison
Quality threshold
## Improvement Validation
### Change: Added accessibility reminder to mobile-ui-specialist
### Test Results
| Metric | Before | After | Change |
|--------|--------|-------|--------|
| Accessibility issues | 12% | 2% | -83% |
| Success rate | 88% | 96% | +9% |
| Token usage | 45K | 47K | +4% |
### Verdict: APPROVE
Accessibility issues reduced significantly with minimal token overhead.
.temp/improvement/
├── patterns/
│ ├── failures/
│ │ └── pat_{id}.json
│ └── successes/
│ └── pat_{id}.json
├── proposals/
│ └── prop_{id}.md
├── validations/
│ └── val_{id}.json
└── history/
└── {date}/
└── changes.json
1. Aggregate traces from past week
2. Run failure analysis
3. Generate improvement proposals
4. Prioritize by impact × frequency
5. Implement top 3 improvements
6. Validate before merge
1. After each session:
- If failed: Add to failure patterns
- If succeeded but slow: Add to bottleneck analysis
- If succeeded optimally: Add to success patterns
2. Check pattern thresholds:
- If failure pattern frequency > 5: Trigger improvement proposal
| Metric | Target | Current | Trend |
|---|---|---|---|
| Success rate | >95% | 92% | ↑ |
| Avg iterations | <2 | 2.3 | → |
| Token efficiency | <80K | 75K | ↓ |
| Time to complete | <10min | 12min | ↑ |
| Change | Implemented | Impact |
|---|---|---|
| Accessibility reminder | 2025-01-01 | -83% issues |
| Tool description update | 2025-01-02 | +5% success |
| Delegation template | 2025-01-03 | -20% iterations |
# View failure patterns
cat .temp/improvement/patterns/failures/*.json | jq '.description'
# Count patterns by type
ls .temp/improvement/patterns/failures/ | wc -l
# View pending proposals
cat .temp/improvement/proposals/*.md
# Check improvement history
cat .temp/improvement/history/*/changes.json | jq '.'
Version: 1.0 | Last Updated: 2025-01-04
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience