# Demo Research Skill

Create a complete, impressive notebook-style data analysis page for US electricity energy in the `web/scratch` site. This skill demonstrates the full workflow for turning research data (CSVs, DuckDB) into interactive visualizations with a narrative story.

## Quick start

```bash
# From the workspace root
cd /home/workspace

# Run the skill
python Skills/demo-research/scripts/run-skill.py
```

The skill will:
1. Generate JSON data files from the DuckDB database
2. Create the React page component with all charts and narrative
3. Add the route to the application
4. Verify the page works

## What it creates

- **Data files**: `web/scratch/src/data/usa_energy/energy_story.json` and `regional_data.json`
- **Page component**: `web/scratch/src/pages/UsaEnergy.tsx`
- **Route**: Adds `/usa-energy` route to `App.tsx`

## Cleaning up between demos

To delete the page and rerun the skill:

```bash
# Delete the generated files
rm -rf web/scratch/src/data/usa_energy
rm web/scratch/src/pages/UsaEnergy.tsx

# Run the skill again
python Skills/demo-research/scripts/run-skill.py
```

## The page

The resulting page includes:
- Headline summary cards showing key metrics
- Interactive charts (line, area, stacked) using Recharts
- Narrative sections explaining the data story
- Regional comparisons across major ISOs (CAISO, ERCOT, PJM, NYISO)
- Key takeaways and follow-up questions

## Skill structure

- `SKILL.md` - Complete documentation
- `scripts/run-skill.py` - Main execution script
- `scripts/generate-story-json.py` - Generate JSON from DuckDB
- `assets/UsaEnergyTemplate.tsx` - React page template
- `README.md` - This file