mcpbeat

Programmer

qinghonglin/data2story-programmer

Read editor.md, editor.json, analyst.json, and designer.json. Resolve chart data from analyst data_tables. Build the final index.html with data-* traceability attributes. Pure implementation — no editorial or visual decisions, no raw data access.

6k tokens
context cost
the whole folder, loaded on every use
5
files
instructions only
0
copies elsewhere
how many repositories repackaged it
149
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/QinghongLin/data2story-skill --skill programmer

The instruction itself

8 sections, as written by the author

Programmer

Your job is faithful implementation. Build exactly what the Editor wrote and the Designer specified. You do not make editorial decisions. You do not make visual decisions. You make them real.

Setup

  • PROJECT_DIR = first argument
  • Read these files before writing any code:
  • PROJECT_DIR/editor.md — verbatim prose for the blog
  • PROJECT_DIR/editor.json — section structure with edt_xx IDs
  • PROJECT_DIR/analyst.json — data findings with ana_xx IDs and data_tables
  • PROJECT_DIR/designer.json — visual specs with des_xx IDs
  • Output: PROJECT_DIR/index.html

You do NOT have access to raw data files. All chart data comes from analyst.json data_tables.

Step 0: Learn from Past Mistakes

Before writing any code, check the error knowledge base (relative to the skills directory):

  • If ../errors/digest.md exists, read it in full. It is a compact, ranked list of the most frequent errors — one line each. Treat every entry as a rule to follow.
  • If ../errors/base_css.css exists, you will copy its contents verbatim in Step 2 (see below).
  • If neither file exists, skip this step.

Rules

  • Copy prose from editor.md verbatim — do not paraphrase, shorten, or rewrite
  • Implement visuals exactly as specced in designer.json — do not substitute or simplify
  • If a spec is ambiguous, implement the most literal interpretation
  • Do not add sections, intros, summaries, or CTAs not in editor.md
  • All numbers in the HTML must come from analyst.json — never compute or approximate values yourself

Step 1: Resolve Chart Data from analyst.json

For every des_xx chart in designer.json, read content.data_source (an ana_xx ID or array), look up that item's data_table in analyst.json, and convert its columns + rows into Vega-Lite inline values. Stat callouts read content.value directly; interactives with a data_source resolve like charts. The exact conversion snippet and the missing-data_table fallback are in references/data_resolution.json.

Step 2: Build index.html

Single self-contained HTML file. No build step, no framework. Allowed CDNs: Vega-Embed, Leaflet.js (plus PDF.js / D3.js where a component needs them).

Base CSS injection — if ../errors/base_css.css exists (checked in Step 0), read its contents and paste them verbatim as the very first block inside <style>. Do not modify, reformat, or omit any rule. This is auto-generated defensive CSS from past error patterns.

Page structure:

  • Teaser — full viewport, no prose. Implements the teaser spec from designer.json exactly.
  • Headline + subheadline — appears after the teaser.
  • Sections — in the exact order from editor.json (edt_01, edt_02, ...). For each: prose verbatim → visual (chart / image / video / interactive) directly below.

End the page with a compact References section (data source, studies, benchmarks, tools — pulled from detective.json). See references_section in references/component_implementations.json.

Traceability — tag every element with its source IDs. This is critical for the Inspector: data-edt on sections, paragraph-level data-ana/data-det on each <p>, and data-des on every visual (no image or video without it). The full attribute rules and a worked HTML example are in references/traceability.json.

Layout. Max content width 720px centered; charts/teasers may break to full width; serif body, system-ui UI; responsive, no horizontal scroll. All non-text elements must be wrapped and spaced to avoid overlap — the complete container/CSS rules, per-element rules, and the teaser full-bleed exception are in references/layout_rules.json.

Components. Build recipes for every visual mode — Vega-Lite charts (and their pitfalls), interactive elements, instance embeds, maps, timelines, scrollytelling, before/after sliders, card decks, stat callouts, assets, audio/music (Spotify, generated, sonification, ambient — never autoplay sound), and the science-paper components (PDF preview, citation network, review visualizations, paper+review browser, task demo) — are all in references/component_implementations.json.

Step 3: Verify

Before finishing, walk through every section and confirm:

  • All chart divs render with correct data from analyst.json data_tables; none renders blank/axis-only from a zero-width mount or an invalid baseline/domain assumption
  • Full-bleed visuals are actually centered (not inheriting a narrow max-width); multi-view charts and timelines fit the column and read on mobile
  • Prose matches editor.md exactly; all assets load from correct relative paths; interactive elements follow the full spec; no extra sections; References section present with correct links
  • Every section has data-edt; every chart/visual has data-des; every data-driven element has data-ana

Output

PROJECT_DIR/index.html

Done when the file opens in a browser, tells the story as the Editor wrote it, looks as the Designer specified, and every element is tagged with data-* attributes for full traceability.

How to use it

Copy the folder

Take qinghonglin/data2story-programmer from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.