Skip to content
Content
Skill

/inspector

Run sentence-level traceability verification on a Data2Story blog (verify.py -> verifier.json), then emit the in-page Inspector panel (the reader-facing runnable verifier) + the verify/ artifacts (verify_map.json, run_cells.json, the reproducible notebook, cell_registry.json).

BOOST
From plugin
data2story-skill
15827 skills
Install
$ npx -y skills add QinghongLin/data2story-skill --skill inspector --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/inspector

Context preview

The summary Claude sees to decide when to auto-load this skill.

Run sentence-level traceability verification on a Data2Story blog (verify.py -> verifier.json), then emit the in-page Inspector panel (the reader-facing runnable verifier) + the verify/ artifacts (verify_map.json, run_cells.json, the reproducible notebook, cell_registry.json).

SKILL.md

inspector.SKILL.md
name: inspector
description: "Run sentence-level traceability verification on a Data2Story blog (verify.py -> verifier.json), then emit the in-page Inspector panel (the reader-facing runnable verifier) + the verify/ artifacts (verify_map.json, run_cells.json, the reproducible notebook, cell_registry.json). Mostly Python; the runnable layer recomputes each computation in-browser from its inlined data and grades it against the published output, while the bundled notebook re-executes from raw data. Use verify.py at Stage 6.4 (after validate.py, before the Critic) and generate_viewer.py at Stage 7 after the Programmer authors the verify/ files and pastes the panel shell. Triggers: a built index.html plus the role JSONs exist, or you need the traceability map / the in-page runnable verifier."
argument-hint: [PROJECT_DIR]
allowed-tools: Bash(*), Read, Write

Inspector

Your job is **traceability verification** plus standing up the **runnable verify layer** — a reader can recompute each computation in-browser (from its inlined data), and the bundled notebook re-executes the headline numbers from raw data (that notebook is the paper's coding verifier). You parse the blog HTML, link each visible sentence back to its evidence in the role JSONs (`verify.py → verifier.json`), and then build the **in-page Inspector panel**: a click-any-claim drawer embedded in `index.html` whose evidence is byte-identical to the on-disk `verify/` artifacts, backed by a reproducible notebook that re-runs the headline numbers from raw data.

**This whole layer is MANDATORY on every blog.** A blog without a working Inspector panel, the `verify/` artifacts, and a clean reproducible notebook is incomplete.

Setup

  • `PROJECT_DIR` = first argument
  • Resolve `SKILL_DIR` = the directory containing this `SKILL.md` (`.../skills/data2story-pro/inspector`). Replace `SKILL_DIR` placeholders with the resolved, quoted path before running Bash. Do not hard-code machine-local paths.
  • Required files in PROJECT_DIR: `index.html`, `analyst.json`, `detective.json`, `designer.json`, `editor.json`

Step 1: Run verify.py (sentence → evidence map) — early, at Stage 6.4

python3 SKILL_DIR/scripts/verify.py PROJECT_DIR

Produces `PROJECT_DIR/verifier.json` (the sentence→evidence mapping — the upstream traceability index). The output shape (format v3: `stats`, `sentences`, `unused_ids`) is in **[`references/inspector_schema.json`](references/inspector_schema.json)**.

**Ordering (important):** `verify.py` runs **early** — at **Stage 6.4**, after the contract gate (`validate.py`) and **before the Critic** — so `verifier.json` already exists when the Critic reads it. Re-run `verify.py` inside the Critic loop each round. The panel-injection (Step 2, `generate_viewer.py`) happens later, at **Stage 7**.

Step 2: Emit the Inspector panel + verify/ artifacts

The Inspector no longer ships a standalone reader-viewer. It now emits the **in-page verify panel** (the reader-facing front-end) plus the auditable `verify/` artifacts that back it — including the reproducible notebook, which is the paper's from-raw-data coding verifier:

1. **The in-page Inspector panel (lives in `index.html`).** The Programmer copies `references/inspector_panel_reference.html` **VERBATIM** into `index.html` (the `.v-*` `<style>`, the `#verifyToggle` button, the drawer/backdrop/toast markup, and the `window.__verify` IIFE — see the programmer's `inspector_panel` family). The `.v-*` CSS must stay **inside a `<style>` element in `<head>`** — if it lands after the document's own `</style>` the rules render as visible text (conspicuous on mobile). The Inspector fills the panel's two inline JSON islands:

  • `<script type="application/json" id="verifyMap">` — per-element provenance, **byte-identical** to `verify/verify_map.json`
  • `<script type="application/json" id="runCells">` — in-browser-runnable snippets, **byte-identical** to `verify/run_cells.json`

Clicking any element carrying a `data-{ana,det,des,sct,cin}` id opens the drawer for that id and renders the matching kind. A `computation` whose snippet is runnable gets a **Run** button that re-executes the statement in-browser (lazy Pyodide) and grades stdout against `expected_stdout` — recomputing the figure from the snippet's inlined data (the reproducible notebook performs the paper's from-raw-data re-execution; the panel makes that reproduction one-click for the reader).

2. **The `verify/` artifacts (on-disk source of truth).**

  • `verify/verify_map.json` — the per-element provenance map (the same bytes inlined as `verifyMap`). Schema: **[`references/verify_map.schema.json`](references/verify_map.schema.json)**.
  • `verify/run_cells.json` — the parallel runnable-snippet map (the same bytes inlined as `runCells`). Schema: **[`references/run_cells.schema.json`](references/run_cells.schema.json)**.
  • `verify/<topic>_forecast.ipynb` — the **reproducible notebook** that re-runs the pipeline from raw data and `assert`s the reproduced figures match the published ones (the notebook is a *proof*). Recipe: **[`references/reproducible_notebook.md`](references/reproducible_notebook.md)** (+ `references/notebook_template.ipynb` skeleton).
  • `verify/cell_registry.json` — maps each notebook `cell_id` to the atomic claim ids it backs (the inverse of `verify_map[id].cell_id`). Schema: **[`references/cell_registry.schema.json`](references/cell_registry.schema.json)**.
  • `verify/data/` — the dataset inputs the notebook reads (bundled at publish; see `reproducible_notebook.md` §7).
python3 SKILL_DIR/scripts/generate_viewer.py PROJECT_DIR

`generate_viewer.py` is the **deterministic panel + redirect emitter** — pure Python, no LLM. It runs at **Stage 7** and **requires** that the upstream authoring is already in place: the Programmer must have authored `verify/verify_map.json` + `verify/run_cells.json` (per their schemas) and copied `references/inspector_panel_reference.html` **VE

Read more
Ships withdata2story-skill

A data-journalist agent skill that turns any dataset into a verifiable, evidence-grounded multimodal story — a self-contained HTML article where every sentence traces back to the data or source that justifies it.

Get the whole plugin
Stats
158
Stars
23
Forks
Maintained
Maintenance
Python
Language
MIT
License
3mo ago
Last commit
5mo ago
Created
6d ago
Added

Repo: QinghongLin/data2story-skill

Other skills on data2story-skill.