xiaohongshu
xiaohongshu
debugging-agent
Self-Improving Agent that monitors all other agent skills, analyzes their logs, detects issues, and proposes improvements. AUTO-TRIGGERS: - Every 30 minutes (scheduled) - When error rate > 5% (any agent) - When 3+ recurring errors in 24h (same error type) - When performance degrades > 2x baseline
Full skill instructions
Self-Improving Agent System의 핵심 컴포넌트
다른 모든 agent의 로그를 분석하여 문제를 발견하고 개선안을 제안합니다.
python backend/ai/skills/system/debugging-agent/scripts/log_reader.py \
--days 1 \
--categories system,war-room,analysis
수집 대상:
backend/ai/skills/logs/*/*/execution-*.jsonlbackend/ai/skills/logs/*/*/errors-*.jsonlbackend/ai/skills/logs/*/*/performance-*.jsonlOutput:
{
"agents": ["signal-consolidation", "war-room-debate", ...],
"total_executions": 50,
"total_errors": 3,
"time_range": "2025-12-25 to 2025-12-26"
}
python backend/ai/skills/system/debugging-agent/scripts/pattern_detector.py \
--input logs_summary.json \
--output patterns.json
감지 패턴:
TypeError: missing required positional argument (3회)Output:
{
"patterns": [
{
"type": "recurring_error",
"agent": "war-room-debate",
"error_type": "TypeError",
"count": 3,
"impact": "CRITICAL",
"first_seen": "2025-12-25T18:30:00",
"last_seen": "2025-12-26T09:15:00"
}
]
}
관련 agent의 SKILL.md를 읽어서 컨텍스트 파악:
# Read related skills
cat backend/ai/skills/war-room/war-room-debate/SKILL.md
cat backend/api/war_room_router.py
파악 내용:
python backend/ai/skills/system/debugging-agent/scripts/improvement_proposer.py \
--patterns patterns.json \
--output proposals/proposal-20251226-100822.md
Proposal 포맷:
# Improvement Proposal: Fix War Room TypeError
**Generated**: 2025-12-26 10:08:22
**Agent**: war-room-debate
**Priority**: CRITICAL
**Confidence**: 87%
---
## 🔍 Issue Summary
**Pattern Detected**: Recurring Error (3 occurrences in 24h)
**Error**:
```
TypeError: missing required positional argument for AIDebateSession
```
**Impact**:
- War Room debates failing
- No trading signals generated
- User experience degraded
---
## 📊 Root Cause Analysis
**Evidence**:
1. Error occurs in `war_room_router.py:L622`
2. `AIDebateSession.__init__()` called with missing argument
3. Recent code change added new required field
**Root Cause**:
Schema mismatch between `AIDebateSession` model and router code.
---
## 💡 Proposed Solution
### Option 1: Add Missing Argument (Recommended)
**File**: `backend/api/war_room_router.py`
```python
# Line 622 - Add missing argument
session = AIDebateSession(
ticker=ticker,
consensus_action=pm_decision["consensus_action"],
# ... existing fields ...
dividend_risk_vote=next((v["action"] for v in votes if v["agent"] == "dividend_risk"), None), # ← ADD THIS
created_at=datetime.now()
)
```
**Confidence**: 90% (high evidence)
### Option 2: Make Field Optional
Alternatively, update the model to make the field optional.
**Confidence**: 70% (lower impact but safer)
---
## 🎯 Expected Impact
- ✅ Eliminates TypeError
- ✅ War Room debates resume
- ✅ Trading signals restored
- ⚠️ Requires testing with all agents
---
## 🧪 Verification Plan
1. Apply fix to `war_room_router.py`
2. Run War Room debate: `POST /api/war-room/debate {"ticker": "AAPL"}`
3. Verify no TypeError
4. Check logs for successful execution
---
## 📝 Risk Assessment
**Risk Level**: LOW
**Potential Issues**:
- May need to update other agent votes similarly
- Database migration if schema changed
**Rollback Plan**:
- Revert commit if issues arise
- Monitor error logs for 24h
---
**Confidence Breakdown**:
- Error Reproducibility: 100% (3/3 occurrences)
- Historical Success: 80% (similar fixes worked)
- Impact Clarity: 90% (clear user impact)
- Root Cause Evidence: 85% (stack trace clear)
- Solution Simplicity: 85% (1-line fix)
**Overall Confidence**: 87%
Proposal confidence는 5가지 메트릭의 가중 평균:
Error Reproducibility (30%)
Historical Success (25%)
Impact Clarity (20%)
Root Cause Evidence (15%)
Solution Simplicity (10%)
Formula:
confidence = (
reproducibility * 0.30 +
historical_success * 0.25 +
impact_clarity * 0.20 +
root_cause_evidence * 0.15 +
solution_simplicity * 0.10
)
# Analyze recent logs
python backend/ai/skills/system/debugging-agent/scripts/log_reader.py --days 1
# Detect patterns
python backend/ai/skills/system/debugging-agent/scripts/pattern_detector.py
# Generate proposals
python backend/ai/skills/system/debugging-agent/scripts/improvement_proposer.py
# scripts/run_debugging_agent.py
import schedule
def run_debugging_agent():
subprocess.run(["python", "backend/ai/skills/system/debugging-agent/scripts/log_reader.py"])
subprocess.run(["python", "backend/ai/skills/system/debugging-agent/scripts/pattern_detector.py"])
subprocess.run(["python", "backend/ai/skills/system/debugging-agent/scripts/improvement_proposer.py"])
schedule.every(30).minutes.do(run_debugging_agent)
backend/ai/skills/logs/system/debugging-agent/
├── execution-2025-12-26.jsonl # Debugging agent's own logs
├── errors-2025-12-26.jsonl
└── proposals/
├── proposal-20251226-100822.md # Improvement proposal
├── proposal-20251226-103045.md
└── accepted/
└── proposal-20251226-100822.md # User accepted
After Phase 2 complete:
Created: 2025-12-26
Version: 1.0
Status: In Development
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