AgentSkillsCN

Skill: Report Generation

技能:报告生成

SKILL.md

Skill: Report Generation

Purpose

Generate comprehensive trading reports in multiple formats (Markdown, CSV, HTML). Combines data from analysis, portfolio, and journal skills to create professional trading reports.

When to Use

  • Creating daily/weekly/monthly performance reports
  • Generating tax documentation
  • Preparing investor updates
  • Documenting trading activity
  • Compliance and record-keeping

Workflow

Step 1: Generate Report

typescript
import { generateReport } from './skills/report-generation';

const report = await generateReport({
  type: 'performance',
  period: 'monthly',
  format: 'markdown',
  includeCharts: true,
  includeTransactions: true,
});

console.log(report.content);
console.log('Saved to:', report.filePath);

Step 2: Customize Content

typescript
const customReport = await generateReport({
  type: 'custom',
  sections: ['summary', 'holdings', 'trades', 'lessons'],
  title: 'Q4 Trading Review',
  author: 'Trading Team',
});

Report Types

TypeDescriptionContents
performanceOverall trading performanceP&L, win rate, metrics
portfolioPortfolio holdings reportAssets, allocation, value
transactionsTransaction historyAll trades with details
taxTax-ready exportGains, losses, cost basis
journalTrading journal summaryTrades, lessons, patterns
dailyDaily recapToday's activity
weeklyWeekly summaryWeek's performance
monthlyMonthly reportFull month analysis
customCustom sectionsUser-selected sections

Configuration

typescript
interface ReportConfig {
  type: ReportType;
  period?: 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly' | 'all';
  format?: 'markdown' | 'csv' | 'html' | 'json';
  outputPath?: string;
  title?: string;
  author?: string;
  sections?: string[];
  includeCharts?: boolean;
  includeTransactions?: boolean;
  symbols?: string[];
}

Output Formats

Markdown

Professional document with headers, tables, and formatting.

CSV

Spreadsheet-compatible data export for analysis.

HTML

Styled web page with interactive elements.

JSON

Structured data for programmatic use.

Example: Monthly Performance Report

typescript
const report = await generateReport({
  type: 'monthly',
  format: 'markdown',
  title: 'December 2024 Trading Report',
  author: 'Trading Bot',
  includeCharts: true,
});

/* Output:
# December 2024 Trading Report

Generated: 2024-12-31T00:00:00Z
Author: Trading Bot

## Executive Summary
- Total P&L: $2,450.00 (+12.3%)
- Win Rate: 68%
- Total Trades: 45

## Performance Metrics
| Metric | Value |
|--------|-------|
| Sharpe Ratio | 1.8 |
| Max Drawdown | 8.2% |
...
*/

Best Practices

  1. Consistent scheduling - Generate reports on regular schedule
  2. Archive old reports - Keep historical records
  3. Include context - Add market conditions and notes
  4. Use appropriate format - Markdown for reading, CSV for analysis
  5. Verify accuracy - Cross-check key figures

Related Skills

  • data-analysis - Data for reports
  • portfolio-analysis - Portfolio metrics
  • trading-journal - Trade documentation