blockslisted
Install: claude install-skill TheSethRose/blocks
# Blocks
A block is a small data app inside your answer. You give it rows and a list of parts. Every part reads the same rows, so when the reader filters, picks, opens or drags something, all parts change together. The point is to let the reader ask the data their own questions, which text can't do.
You write a short spec. A tested runtime draws it. You never hand-write the widget's HTML, CSS or event code.
## Build one
1. Write the spec to a file in your scratchpad, for example `findings.js`. It holds one call: `Blocks({ summary, rows, parts })`.
2. Run the builder from this skill's folder. It checks the spec, then prints the widget code.
```bash
node <this skill's folder>/bin/blocks.mjs findings.js
```
3. Fix every `error` line and run it again. Read each `warn` line and act on it or accept it.
4. Pass the printed code, unchanged, as `widget_code` to `show_widget`. Call `read_me` once per session first if you haven't; where it differs from Blocks on look or layout, Blocks wins.
The printed code is your spec plus one script tag that loads the runtime from jsDelivr, pinned to a version. If the block shows "The Blocks runtime did not load", build again with `--inline`, which puts the runtime inside the widget instead.
Read [spec.md](references/spec.md) for every part and option. Copy from the closest file in `examples/`: `triage.js` (filter, open, pick, send back), `whatif.js` (sliders and a projection), `compare.js` (weights re-rank options), `breakdown.js` (click a b