karpathy-jobs-bls-visualizer
karpathy-jobs-bls-visualizer — an installable skill for AI agents.
By reason-machines · 1,310 installs
npx skills add reason-machines/trending-skills --skill karpathy-jobs-bls-visualizer
Source repository · Upstream listing
karpathy/jobs — BLS Job Market Visualizer
Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
A research tool for visually exploring Bureau of Labor Statistics [Occupational Outlook Handbook](https://www.bls.gov/ooh/) data across 342 occupations. The interactive treemap colors rectangles by employment size (area) and any chosen metric (color): BLS growth outlook, median pay, education requirements, or LLM scored AI exposure. The pipeline is fully forkable — write a new prompt, re run scoring, get a new color layer.
Live demo: [karpathy.ai/jobs](https://karpathy.ai/jobs/)
Installation & Setup
Create a .env file with your OpenRouter API key (required only for LLM scoring):
Full Pipeline — Key Commands
Run these in order for a complete fresh build:
Key Files Reference
File Description
occupations.json Master list of 342 occupations (title, URL, category, slug)
occupations.csv Summary stats: pay, education, job count, growth projections
scores.json AI exposure scores (0–10) + rationales for all 342 occupations
prompt.md All data in one ~45K token file for pasting into an LLM
html/ Raw HTML pages from BLS (~40MB, source of truth)
pages/ Clean Markdown versions of each occupation page
site/index.html The treemap visualization (single HTML file)
site/data.json Compact merged data consumed by the frontend
score.py LLM scoring pipeline — fork this to write custom prompts
Writing a Custom LLM Scoring Layer
The most powerful feature: write any scoring prompt, run score.py , get a new treemap color layer.
1. Edit the prompt in score.py
2. Run the scoring pipeline
3. Rebuild site data
Data Structures
occupations.json entry
occupations.csv columns
Example row:
site/data.json entry (merged frontend data)
Frontend Treemap ( site/index.html )
The visualization is a single self contained HTML file using D3.js.
Color layers (toggle in UI)
Layer What it shows
BLS Outlook BLS projected growth category (green = fast growth)
Median Pay Annual median wage (color gradient)
Education Minimum education required
Digital AI Exposure LLM scored 0–10 AI impact estimate
Adding a new color layer to the frontend
Then update build site data.py to include your new score field in data.json .
Generating the LLM Ready Prompt File
Package all 342 occupations + aggregate stats into a single file for LLM chat:
Scraping Notes
The BLS blocks automated bots, so scrape.py uses non headless Playwright (real visible browser window):
If scraping fails or is rate limited:
The html/ directory already contains cached pages in the repo
You can skip scraping entirely and run from process.py onward
If re scraping, add delays between requests to avoid blocks
Common Patterns
Re score only missing occupations
Parse a single occupation page manually
Load and query occupations.csv
Combine CSV with AI scores for analysis
Troubleshooting
playwright install fails
BLS scraping blocked / returns empty pages
Ensure headless=False in scrape.py (already the default)
Add manual delays; do not run in CI
The cached html/ directory in the repo can be used directly
score.py OpenRouter errors
Verify OPENROUTER API KEY is set in .env
Check your OpenRouter account has credits
Default model is Gemini Flash — change model in score.py for a different LLM
site/data.json not updating after re scoring
Treemap shows blank / no data
Confirm site/data.json exists and is valid JSON
Serve with python m http.server (not file:// — CORS blocks local JSON fetch)
Check browser console for fetch errors
Important Caveats (from the project)
AI Exposure ≠ job disappearance. A score of 9/10 means AI is transforming the work, not eliminating demand. Software developers score 9/10 but demand is growing.
Scores are rough LLM estimates (Gemini Flash via OpenRouter), not rigorous economic predictions.
The tool does not account for demand elasticity, latent demand, regulatory barriers, or social preferences for human workers.
This is a development/research tool , not an economic publication.