Development guidelines and commands for Our World In Data's Grapher platform - an interactive data visualization codebase using TypeScript, React 19, and MySQL 8
Development assistant for the Our World In Data Grapher platform - a TypeScript monorepo for creating interactive data visualizations with React 19, Node 22, and MySQL 8.
Run these yarn/make commands for development workflow:
**Pre-commit validation:**
```bash
yarn fixPrettierChanged > /dev/null 2>&1 && yarn typecheck
```
Fix any errors before committing.
**Database queries:**
```bash
yarn query "QUERY TEXT" # Query production database (read-only)
yarn query -s "QUERY TEXT" # Query staging database for current branch
```
Use class-based components with TC-39 stage 3 decorators:
- Site styles: `/site/owid.scss`
- Grapher styles: `/packages/@ourworldindata/grapher/src/core/grapher.scss`
Monorepo organized by dependency chain (low to high):
| Directory | Purpose |
|-----------|---------|
| `./packages/types` | Shared TypeScript type definitions |
| `./packages/utils` | Utility functions |
| `./packages/core-table` | Custom dataframe classes for Grapher |
| `./packages/components` | Shared React components |
| `./packages/grapher` | Data visualization component (MobX 6 state management) |
| `./packages/explorer` | Data explorer wrapper with dropdowns for complex datasets |
| `./db` | MySQL 8 database access + ArchieML Google Docs business logic |
| `./site` | Website code (React hooks, no MobX, renders ArchieML) |
| `./baker` | Static HTML generator (renders React to HTML) |
| `./adminSiteServer` | Internal admin API |
| `./adminSiteClient` | Admin client UI |
| `./devTools` | Development utilities |
| `./functions` | CloudFlare Functions for dynamic features (thumbnails, data downloads at `/grapher/*`) |
Primary datastore: **MySQL 8**
**ALWAYS** read database documentation before writing queries or migrations:
1. Start with `db/docs/README.md` for overview
2. List available tables: `db/docs/` directory
3. Read relevant `TABLE-NAME.yml` files for detailed schema
Use `yarn query` to explore table contents and cardinality.
Read these files before working on related features:
1. **Before implementing**: Read relevant database documentation (`db/docs/`)
2. **During development**: Follow code style guidelines (double quotes, types, avoid `any`)
3. **After changes**: Run validation command (`yarn fixPrettierChanged && yarn typecheck`)
4. **Before commit**: Follow commit message guidelines in `docs/agent-guidelines/commit-messages.md`
5. **For database work**: Use `yarn query` to explore, then write migrations with `make migrate`
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/owid-grapher-development-7bc1od/raw