Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Automated report generator for daily, weekly, and monthly performance summaries. Creates markdown reports with trading performance, defensive wins, agent accuracy, and constitutional compliance statistics.
.claude/skills/majiayu000-report-writer-agent/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | 180% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 161% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 226% | 0% |
일일/주간/월간 거래 성과, 방어 실적, Agent 정확도, 헌법 준수율을 자동으로 분석하여 마크다운 리포트를 생성합니다.
python# Trading Performance total_trades: int winning_trades: int losing_trades: int win_rate: float # winning_trades / total_trades average_return: float sharpe_ratio: float max_drawdown: float # Defensive Performance total_rejections: int defensive_wins: int # 거부한 제안이 실제 손실이었던 경우 defensive_win_rate: float avoided_loss_usd: float # Agent Accuracy agent_accuracies: Dict[str, float] # {agent_name: accuracy} best_performing_agent: str worst_performing_agent: str # Constitutional Compliance total_proposals: int constitutional_violations: int compliance_rate: float # (total - violations) / total
pythondef generate_daily_report(date: str) -> str: """Generate daily markdown report""" # Fetch data signals = get_signals_for_date(date) shadows = get_shadow_trades_for_date(date) # Calculate metrics metrics = calculate_metrics(signals, shadows) # Generate markdown report = format_report(metrics, template='daily') return report
markdown# 일일 거래 리포트 - 2025-12-21 ## 📊 거래 요약 - **총 Signal 수**: 5개 - **실행된 거래**: 3개 - **거부된 제안**: 2개 (헌법 위반) ## 🎯 Signal 성과 | Signal ID | Ticker | Action | Source | Status | Return | |-----------|--------|--------|--------|--------|--------| | SIG-001 | AAPL | BUY | war_room | EXECUTED | +2.3% | | SIG-002 | NVDA | BUY | deep_reasoning | EXECUTED | +5.1% | | SIG-003 | TSLA | SELL | manual_analysis | EXECUTED | +1.5% | | SIG-004 | XYZ | BUY | news_analysis | REJECTED | - | | SIG-005 | ABC | BUY | ceo_analysis | REJECTED | - | **일일 수익률**: +3.0% ## 🛡️ 방어 실적 ### Shadow Trades (거부된 제안 추적) | Ticker | Rejected Reason | Virtual P&L | Result | |--------|----------------|-------------|--------| | XYZ | 포지션 20% 초과 | -$1,200 | DEFENSIVE_WIN ✅ | | ABC | Stop Loss 미설정 | +$300 | MISSED_OPPORTUNITY | **방어 성공**: 1건 **회피한 손실**: $1,200 ## 📈 Agent 성과 | Agent | Signals | Accuracy | Contribution | |-------|---------|----------|--------------| | War Room | 1 | 100% | Excellent | | Deep Reasoning | 1 | 100% | Excellent | | Manual Analysis | 1 | 100% | Good | ## ⚖️ 헌법 준수 - **총 제안**: 5개 - **위반 건수**: 2개 - **준수율**: 60% - **주요 위반**: Article 4 (포지션 한도) ## 💡 인사이트 1. 모든 실행된 거래가 수익 (Win Rate 100%) 2. Shadow Trade 방어 성공으로 $1,200 손실 회피 3. 헌법 제4조 위반 주의 필요 --- Generated by Report Writer Agent v1.0
markdown# 주간 거래 리포트 - Week 51, 2025 ## 📊 주간 요약 - **기간**: 2025-12-15 ~ 2025-12-21 - **총 Signal**: 23개 - **실행 거래**: 15개 - **거부 제안**: 8개 ## 🎯 성과 지표 | Metric | Value | Target | Status | |--------|-------|--------|--------| | 주간 수익률 | +4.5% | +2% | ✅ 초과 달성 | | Win Rate | 73% | >55% | ✅ | | Sharpe Ratio | 1.45 | >1.0 | ✅ | | Max Drawdown | -3.2% | <-5% | ✅ | ## 🏆 Top Performers ### Best Signals 1. **NVDA** (deep_reasoning): +12.5% 2. **AAPL** (war_room): +8.3% 3. **MSFT** (ceo_analysis): +5.7% ### Worst Signals 1. **XYZ** (news_analysis): -2.1% 2. **ABC** (manual_analysis): -1.5% ## 🛡️ 방어 실적 - **총 거부**: 8건 - **Defensive Wins**: 6건 (75%) - **회피한 손실**: $5,400 - **Missed Opportunities**: 2건 (+$800) **순 방어 가치**: $4,600 ## 🤖 Agent 정확도 | Agent | Signals | Win Rate | Avg Return | Rank | |-------|---------|----------|------------|------| | Deep Reasoning | 5 | 80% | +6.2% | 1 | | War Room | 6 | 83% | +5.1% | 2 | | CEO Analysis | 3 | 67% | +3.8% | 3 | | Manual Analysis | 4 | 50% | +2.0% | 4 | | News Analysis | 5 | 60% | +1.5% | 5 | ## ⚖️ 헌법 준수 - **총 제안**: 23개 - **위반 건수**: 8개 - **준수율**: 65% **위반 내역**: - Article 4 (Risk Management): 6건 - Article 2 (Explainability): 2건 ## 💰 자본 보존 - **시작 자본**: $100,000 - **종료 자본**: $104,500 - **자본 보존율**: 104.5% - **헌법이 방어한 손실**: $5,400 (5.4%) ## 📝 권장 사항 1. **Article 4 위반 감소**: Risk Agent 가중치 증대 2. **News Analysis 정확도 개선**: 신뢰도 낮은 소스 필터링 3. **Deep Reasoning 활용 확대**: 가장 높은 승률 --- Generated on 2025-12-21
Step 1: Determine Report Type
- Daily: 당일 데이터
- Weekly: 최근 7일
- Monthly: 최근 30일
Step 2: Fetch Data
- trading_signals
- shadow_trades
- proposals
- agent_votes
Step 3: Calculate Metrics
- Performance: Win rate, returns, Sharpe
- Defensive: Shadow trades, avoided loss
- Agent: Individual accuracy
- Constitutional: Violation rate
Step 4: Generate Insights
- Best/worst performers
- Trend analysis
- Recommendations
Step 5: Format as Markdown
- Tables for data
- Alerts for important findings
- Charts (optional, via mermaid)
Step 6: Distribute
- Save to file
- Send to Telegram
- Display on dashboardpythonfrom backend.database.models import TradingSignal, ShadowTrade, Proposal from sqlalchemy import func from datetime import datetime, timedelta def get_weekly_performance(start_date: datetime) -> Dict: """Get weekly performance metrics""" end_date = start_date + timedelta(days=7) # Fetch signals signals = db.query(TradingSignal).filter( TradingSignal.created_at >= start_date, TradingSignal.created_at < end_date ).all() # Calculate metrics total_signals = len(signals) executed = [s for s in signals if s.status == 'EXECUTED'] returns = [s.actual_return for s in executed if s.actual_return is not None] win_rate = sum(1 for r in returns if r > 0) / len(returns) if returns else 0 avg_return = sum(returns) / len(returns) if returns else 0 # Shadow trades shadows = db.query(ShadowTrade).filter( ShadowTrade.created_at >= start_date, ShadowTrade.created_at < end_date ).all() defensive_wins = sum(1 for s in shadows if s.status == 'DEFENSIVE_WIN') return { 'total_signals': total_signals, 'executed': len(executed), 'win_rate': win_rate, 'avg_return': avg_return, 'defensive_wins': defensive_wins, 'shadows': len(shadows) }
pythonfrom backend.notifications.telegram_commander_bot import TelegramCommanderBot async def send_daily_report(report_markdown: str): """Send report via Telegram""" telegram = TelegramCommanderBot() await telegram.send_message( chat_id=os.getenv('TELEGRAM_COMMANDER_CHAT_ID'), text=report_markdown, parse_mode='Markdown' )
markdown## 주간 수익률 추이
line chart title "Daily P&L - Week 51" x-axis Mon, Tue, Wed, Thu, Fri] y-axis "Return %" -2 --> 6 line 1.2, 2.5, -0.8, 3.1, 4.5]
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | fail→pass | 9,171 | 13,787 | +50% | 1 | 1 | 0% | 1,524 | 4,262 | +180% | 0 | 0 | — |
case-11 | fail→pass | 16,179 | 16,535 | +2% | 1 | 1 | 0% | 1,848 | 4,821 | +161% | 0 | 0 | — |
case-12 | fail→pass | 17,025 | 23,129 | +36% | 1 | 1 | 0% | 3,355 | 6,609 | +97% | 0 | 0 | — |
case-13 | pass→pass | 25,426 | 22,796 | -10% | 1 | 1 | 0% | 3,667 | 6,145 | +68% | 0 | 0 | — |
case-01 | fail→pass | 32,251 | 25,682 | -20% | 1 | 1 | 0% | 5,505 | 6,542 | +19% | 0 | 0 | — |
case-02 | fail→fail | 23,948 | 23,658 | -1% | 1 | 1 | 0% | 3,257 | 6,201 | +90% | 0 | 0 | — |
case-03 | fail→pass | 12,020 | 14,039 | +17% | 1 | 1 | 0% | 1,234 | 4,027 | +226% | 0 | 0 | — |
case-04 | pass→pass | 18,773 | 14,548 | -23% | 1 | 1 | 0% | 2,319 | 4,546 | +96% | 0 | 0 | — |
case-05 | pass→pass | 21,979 | 26,092 | +19% | 1 | 1 | 0% | 2,952 | 6,937 | +135% | 0 | 0 | — |
case-06 | fail→pass | 22,994 | 23,671 | +3% | 1 | 1 | 0% | 3,039 | 6,261 | +106% | 0 | 0 | — |
case-07 | pass→pass | 26,689 | 19,804 | -26% | 1 | 1 | 0% | 3,239 | 6,200 | +91% | 0 | 0 | — |
case-08 | fail→fail | 14,481 | 14,782 | +2% | 1 | 1 | 0% | 1,502 | 4,449 | +196% | 0 | 0 | — |
case-09 | pass→pass | 4,596 | 10,705 | +133% | 1 | 1 | 0% | 828 | 3,729 | +350% | 0 | 0 | — |
case-14 | pass→pass | 7,950 | 8,142 | +2% | 1 | 1 | 0% | 1,397 | 4,606 | +230% | 0 | 0 | — |
case-15 | fail→fail | 25,606 | 17,908 | -30% | 1 | 1 | 0% | 3,026 | 5,794 | +91% | 0 | 0 | — |
case-16 | fail→pass | 21,104 | 17,625 | -16% | 1 | 1 | 0% | 2,260 | 4,782 | +112% | 0 | 0 | — |
case-17 | pass→pass | 8,596 | 9,794 | +14% | 1 | 1 | 0% | 1,354 | 4,457 | +229% | 0 | 0 | — |
case-23 | fail→pass | 8,773 | 7,263 | -17% | 1 | 1 | 0% | 1,304 | 3,144 | +141% | 0 | 0 | — |
case-18 | pass→pass | 18,311 | 13,259 | -28% | 1 | 1 | 0% | 2,183 | 5,204 | +138% | 0 | 0 | — |
case-19 | pass→pass | 13,268 | 12,042 | -9% | 1 | 1 | 0% | 1,327 | 3,871 | +192% | 0 | 0 | — |
case-20 | pass→pass | 18,840 | 22,495 | +19% | 1 | 1 | 0% | 2,647 | 5,881 | +122% | 0 | 0 | — |
case-21 | fail→pass | 17,738 | 14,326 | -19% | 1 | 1 | 0% | 2,215 | 4,376 | +98% | 0 | 0 | — |
case-22 | pass→pass | 13,704 | 7,552 | -45% | 1 | 1 | 0% | 2,304 | 3,191 | +38% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +39 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.