# Report Generator
Generate exportable HTML/PDF reports with interactive charts and visualizations from investment analysis data.
## Report Templates
1. **Executive Summary Report**
- High-level overview (1-2 pages)
- Key metrics and investment thesis
- Critical charts only
- Ideal for stakeholder presentations
2. **Comprehensive Analysis Report**
- Full detailed analysis (5-10 pages)
- All data sections and visualizations
- Methodology and assumptions
- Complete investment case
3. **Portfolio Review Report**
- Multi-stock comparison
- Portfolio allocation charts
- Risk metrics and diversification analysis
- Performance attribution
## Visualization Components
### Financial Charts
- **Line Charts**: Revenue/earnings trends, price history
- **Bar Charts**: Quarterly comparisons, segment breakdowns
- **Stacked Area**: Balance sheet composition, revenue mix
- **Waterfall Charts**: Cash flow analysis, earnings bridges
- **Pie Charts**: Geographic/product segment revenue split
### Valuation Charts
- **Comparison Charts**: P/E, P/B, EV/EBITDA vs. peers and historical averages
- **DCF Sensitivity Tables**: Value ranges under different scenarios
- **Multiple Expansion/Contraction**: Historical valuation bands
### Technical Charts
- **Price Charts**: Candlesticks with moving averages overlay
- **Volume Bars**: Trading volume patterns
- **Indicator Panels**: RSI, MACD, Bollinger Bands
- **Support/Resistance**: Key price levels annotated
## HTML Report Structure
Generate standalone HTML file with the following structure:
```html
Investment Analysis Report - [TICKER] - [DATE]
● Investment Analysis Report
[TICKER]
[Company Full Name] · [Exchange]
📋
Executive Summary
Key investment thesis and highlights
01
[Summary content]
Revenue (TTM)
$[X]B
▲ [X]% YoY
Net Income
$[X]B
▲ [X]% YoY
P/E Ratio
[X]x
vs sector [X]x
Market Cap
$[X]T
[Exchange]
📊
Financial Performance
Revenue, earnings, and margin trends
02
Revenue & Net Income — Annual ($B)
[Analysis content]
💰
Valuation Analysis
DCF, multiples, and comparable companies
03
[Valuation content]
📈
Technical Analysis
Price action, indicators, and key levels
04
[Technical content]
⚠️
Risk Factors
Key risks and mitigating considerations
05
[Risk content]
BULLISH
Investment Signal
BULLISH
Confidence
HIGH
Time Horizon
LONG-TERM
Action
BUY
Conviction
STRONG
```
## Chart Data Format
When receiving analysis data, structure chart data as follows:
```javascript
// Line chart data structure
{
chartType: 'line',
title: 'Revenue Growth Trend',
xAxis: ['2020', '2021', '2022', '2023', '2024'],
datasets: [
{
label: 'Revenue ($B)',
data: [100, 120, 145, 175, 210],
color: '#0284C7' // sky — primary series
}
]
}
// Bar chart with multiple series
{
chartType: 'bar',
title: 'Quarterly Earnings Comparison',
xAxis: ['Q1', 'Q2', 'Q3', 'Q4'],
datasets: [
{
label: '2023',
data: [1.2, 1.5, 1.8, 2.1],
color: '#0284C7' // sky — primary
},
{
label: '2024',
data: [1.5, 1.8, 2.2, 2.5],
color: '#0D9488' // teal — secondary
}
]
}
```
## PDF Export Instructions
To export the generated HTML report to PDF:
### Method 1: Browser Print-to-PDF
1. Open the HTML file in a web browser
2. Press Ctrl+P (Cmd+P on Mac) or File → Print
3. Select "Save as PDF" or "Microsoft Print to PDF"
4. Adjust settings: margins, orientation, scale
5. Save the PDF file
### Method 2: wkhtmltopdf (Command Line)
```bash
# Install wkhtmltopdf
# macOS: brew install wkhtmltopdf
# Linux: apt-get install wkhtmltopdf
# Convert HTML to PDF
wkhtmltopdf \
--page-size A4 \
--margin-top 15mm \
--margin-bottom 15mm \
--enable-local-file-access \
report.html report.pdf
```
### Method 3: Playwright/Puppeteer (Node.js)
```javascript
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('file:///path/to/report.html');
await page.pdf({
path: 'report.pdf',
format: 'A4',
printBackground: true
});
await browser.close();
})();
```
## Integration with Other Skills
### Input Formats Accepted
1. **Structured JSON Data**
```json
{
"ticker": "AAPL",
"companyName": "Apple Inc.",
"analysisType": "fundamental",
"metrics": {...},
"charts": [...]
}
```
2. **Markdown Analysis Output**
- Parse markdown from fundamental-analysis, technical-analysis, or portfolio-review
- Extract tables, metrics, and key findings
- Generate appropriate visualizations
3. **Custom Data Tables**
- CSV-formatted financial data
- Excel/spreadsheet data ranges
- Database query results
### Workflow Examples
**Example 1: Fundamental Analysis Report**
```
User: /fundamental-analysis AAPL
[Claude generates analysis]
User: /report-generator --type comprehensive --format html
[Claude generates HTML report with embedded fundamental analysis and charts]
```
**Example 2: Portfolio Review with Custom Data**
```
User: /report-generator --type portfolio --data [paste portfolio data]
[Claude generates multi-stock comparison report with allocation charts]
```
## Output
Generate a complete, standalone HTML file containing:
1. **File Metadata**
- Filename format: `investment-report-[TICKER]-[YYYYMMDD]-[HHMMSS].html`
- File size indication
- Estimated PDF size after export
2. **Report Contents**
- Professional header with company name, ticker, date
- Table of contents (for comprehensive reports)
- All analysis sections with appropriate formatting
- Interactive charts with Chart.js
- Data tables with styling
- Key metrics highlighted in cards
- Footer with disclaimer and generation info
3. **Technical Details**
- Inline CSS (no external dependencies except CDN for Chart.js)
- Responsive design (mobile and desktop)
- Print-optimized styling for PDF export
- Cross-browser compatible (Chrome, Firefox, Safari, Edge)
4. **Export Instructions**
- Step-by-step guide for converting to PDF
- Command-line examples for automated workflows
- Browser settings recommendations
## Usage Notes
- The HTML file is fully self-contained except for Chart.js CDN (can be inlined if needed)
- Charts are interactive in HTML (hover for data points, zoom, pan)
- PDF export flattens charts to static images
- For large portfolios (>20 stocks), consider pagination or summary views
- Color scheme follows professional financial report standards (blue for primary, green for positive, red for negative)
- All monetary values should be formatted with proper thousands separators and currency symbols
## Integration with Signal Format
When generating reports from other skills, the report MUST prominently display each skill's Investment Signal block in a styled box. Use the following HTML (matches the CSS in the template above):
```html
BULLISH
Investment Signal
BULLISH
Confidence
HIGH
Time Horizon
LONG-TERM
Action
BUY
Conviction
STRONG
```
Design notes:
- `.signal-box` class: deep navy background with teal/sky gradient top border
- Add `bullish`, `bearish`, or `neutral` modifier class to both `.signal-box` and `.signal-verdict` to apply the correct verdict color and watermark tint
- Score progress bar uses the `score-fill` width as a percentage (e.g. `style="width: 84%"` for 8.4/10)
- Large ghost watermark text (`.signal-watermark`) reinforces the verdict at a glance
For multi-skill bundle reports (like /research-bundle), show a composite signal summary at the top of the report with individual skill scores in a row of `.signal-stat` items inside a single `.signal-box`.
---
When this skill generates or embeds a signal in an HTML report, the signal block MUST follow this standardized format:
```
╔══════════════════════════════════════════════╗
║ INVESTMENT SIGNAL ║
╠══════════════════════════════════════════════╣
║ Signal: BULLISH / NEUTRAL / BEARISH ║
║ Confidence: HIGH / MEDIUM / LOW ║
║ Horizon: SHORT / MEDIUM / LONG-TERM ║
║ Score: X.X / 10 ║
╠══════════════════════════════════════════════╣
║ Action: BUY / HOLD / SELL ║
║ Conviction: STRONG / MODERATE / WEAK ║
╚══════════════════════════════════════════════╝
```
Score Guide: 8.0–10.0 Strongly Bullish | 6.0–7.9 Moderately Bullish | 4.0–5.9 Neutral | 2.0–3.9 Moderately Bearish | 0.0–1.9 Strongly Bearish
**Disclaimer:** Educational analysis only. Not financial advice.