datapressr / references
AGENTS.md6 starsChanged 2 months agoMITView on GitHub
You are helping wrangle raw data finds into clean, publishable datasets on DataHub. Do NOT linewrap markdown files. Catalog-as-repo rule: if the source is a portal or collection containing many datasets, give it its own repo and DataHub publication — not a subfolder inside another dataset. A dataset doesn't need to be complete to be published. Lifecycle stages: Set "status": "<stage>" in datapackage.json to track this. Every dataset is a directory: Minimal valid example: Rules: - name must be URL-safe:…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 5
Do NOT linewrap markdown files.
- Distinctive: line 15
Catalog-as-repo rule: if the source is a portal or collection containing many datasets, give it its own repo and DataHub publication — not …
- Distinctive: line 36
Every dataset is a directory:
- Very specific: line 85
Every file in data/ that should be published must be in resources
- Very specific: line 89
Every resource should declare a schema with a type per field and a primaryKey where one exists.
- Very specific: line 90
Use .datahubignore to exclude scratch files, large intermediaries, raw downloads
- Distinctive: line 100
One value per cell, one row per observation: No merged headers, no totals rows mixed in with data rows.
- Very specific: line 109
Add a views array to datapackage.json to render charts on the dataset page:
- Distinctive: line 137
Create the directory structure:
- Very specific: line 144
Create datapackage.json with at minimum name, title, description.
- Very specific: line 150
Skip this step if
dhor credentials are not set up: Commit and push to GitHub — that is sufficient. - Very specific: line 159
Always pass
--publicationexplicitly: Use $DATAHUB_PUBLICATION if set, otherwise datapressr.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DataPressr — AI Agent Instructions
You are helping wrangle raw data finds into clean, publishable datasets on DataHub.
Do NOT linewrap markdown files.
Concepts
Data hierarchy
- Catalog — a collection of datasets. Maps to one GitHub repo + one DataHub publication. Example: "World Bank Open Data", "Our World in Data".
- Dataset — a coherent data concept with defined schema and coverage. One directory, one
datapackage.json. Example: "World GDP 1960–2024". - Data file — a concrete file artifact (csv, json, parquet…). Listed as a resource in
datapackage.json.
Catalog-as-repo rule: if the source is a portal or collection containing many datasets, give it its own repo and DataHub publication — not a subfolder inside another dataset.
Dataset lifecycle
A dataset doesn't need to be complete to be published. Lifecycle stages:
| Stage | Description |
capture | Just a URL or note — intent to explore |
stub | Title, description, source link. No files yet. Publishable. |
archived | Raw files downloaded locally |
structured | Cleaned, normalised, schema documented |
enriched | Analysis, visualisations, derived data added |
monitored | Living source, versioned and updated over time |
Set "status": "<stage>" in datapackage.json to track this.
Dataset structure
Every dataset is a directory:
<name>/
datapackage.json # metadata and resource list (required)
data/ # data files go here
.datahubignore # gitignore-style exclusions for dh publish
AGENTS.md # this file (copy into new datasets)datapackage.json
Minimal valid example:
{
"name": "world-gdp",
"title": "World GDP",
"description": "GDP by country from World Bank, 1960–2024",
"status": "structured",
"licenses": [
{ "name": "ODbL-1.0", "title": "Open Data Commons Open Database License", "path": "https://opendatacommons.org/licenses/odbl/" }
],
"sources": [
{ "title": "World Bank Open Data", "path": "https://data.worldbank.org/indicator/NY.GDP.MKTP.CD" }
],
"resources": [
{
"path": "data/gdp.csv",
"name": "gdp",
"title": "GDP by Country",
"mediatype": "text/csv",
"schema": {
"fields": [
{ "name": "country_code", "type": "string" },
{ "name": "year", "type": "year" },
{ "name": "gdp_usd", "type": "number" }
],
"primaryKey": ["country_code", "year"]
}
}
]
}Rules:
namemust be URL-safe: lowercase, hyphens only- Every file in
data/that should be published must be inresources statusshould reflect the lifecycle stage abovelicensesandsourcesare not optional once the dataset leavesstub. We are republishing other people's data — record where it came from and what it's licensed under as soon as both are known. Use an SPDX id inlicenses[].namewhen one applies (CC-BY-4.0,ODbL-1.0,CC0-1.0,PDDL-1.0...); if there's no SPDX id, use the license's own name and a link.- Licence policy: ship and cite. An unclear, missing or non-standard licence does not block publishing. Publish, and cite the source prominently (title, URL, retrieval date, suggested citation if the publisher gives one) in
sources, the README and any story that uses it. Record what you found inlicenses(e.g.{ "name": "No licence stated", "path": "<terms page if any>" }). Hold back only when the terms explicitly prohibit redistribution or reuse, and then tell the owner rather than deciding alone. - Every resource should declare a
schemawith atypeper field and aprimaryKeywhere one exists. This is what makes the dataset actually structured, not just "a CSV that exists." - Use
.datahubignoreto exclude scratch files, large intermediaries, raw downloads
Data conventions
Applies from structured onward — the bar a dataset must clear before it's more than a stub:
- Encoding: UTF-8, no BOM.
- Column names:
snake_case, no spaces. Include units where the value is ambiguous without them (gdp_usd_millions, notgdp). - Missing values: a genuinely empty cell. Don't mix
NA,N/A,-,0, and empty string for "missing" within one column, and note the converse: where a literalNAis a real code (North America, Namibia), keep it verbatim and say so in the field description. - Dates: ISO 8601 (
YYYY-MM-DD, orYYYYfor year-only series). Date a monthly series by the first of the month (YYYY-MM-01) and type itdate, which both DataHub's simple charts and Observable Plot accept as an x-axis. - One value per cell, one row per observation. No merged headers, no totals rows mixed in with data rows.
- CSV output: LF line endings, trailing newline, RFC 4180 quoting. No Frictionless
dialectblock indatapackage.json— the defaults (comma,"quote, LF) are the house format. - Reproducibility: any transform beyond a trivial rename should be a checked-in script (
build.ts, run directly withnode build.ts— no build step) living in the dataset directory next to the raw snapshot — not a one-off interactive edit that can't be re-run when the source updates. The raw snapshot plus the script should be able to reproducedata/*.csvdeterministically. Default to plain Node (fetch,fs, built-ins); reach for one targeted pure-JS package only when the source format needs it (exceljsfor modern.xlsx; SheetJSxlsxfor legacy BIFF8.xls, whichexceljscan't read;csv-parsefor quoted CSV). A build with a dependency gets its own committedpackage.json+package-lock.jsonand anpm install && node build.tsrun line, withnode_modules/andpackage.jsonin.datahubignore. DuckDB earns its place when the transform is genuinely one SQL query — many-to-many joins, window functions, or reshaping a wide table to long across dozens of columns — not for keyed lookups and group-bys, which stay plain Node even across several files, and not for "clean up one messy source." - Scale: this workflow assumes small data — comfortably fits in memory in a single Node process (rule of thumb: well under ~1GB raw). If a source is bigger than that, say so explicitly rather than quietly forcing it through the same pipeline; it needs a different approach.
Definition of done for status: structured: every resource has a schema with typed fields, a primaryKey if one exists, licenses and sources are filled in, the build is reproducible from a script, /validate passes with no warnings (it checks the CSV values against the declared schema, not just the metadata), and, if the build has a custom parser (PDF, HTML, prose, or a spreadsheet with a preamble or several layouts) or draws on many source documents, an independent adversarial review has returned APPROVED (step 7 of the structure skill).
Adding charts (views)
Add a views array to datapackage.json to render charts on the dataset page:
{
"views": [
{
"name": "gdp-over-time",
"title": "GDP Over Time",
"specType": "simple",
"resources": ["gdp"],
"spec": {
"type": "line",
"group": "year",
"series": ["gdp_usd"]
}
}
]
}Supported chart types: line, bar, lines-and-points. Only CSV and GeoJSON resources can be visualised. group is the x-axis field, series is the list of y-axis fields. On DataHub, simple bar and lines-and-points charts need group and series[0] typed year, yearmonth, date or number (not integer or string) and plot only series[0]; use line for several series, or "specType": "vega-lite" or "plot" otherwise.
Workflow
Start a new dataset
Create the directory structure:
mkdir -p <name>/data
cd <name>Create datapackage.json with at minimum name, title, description. Add "status": "stub" if no data files yet.
In the DataPressr repository, run node scripts/sync-dataset-agents.mjs to copy these conventions into each dataset. In a standalone dataset or installed skill, copy this entire conventions file into the new dataset directory.
Publish to DataHub
Skip this step if dh or credentials are not set up. Commit and push to GitHub — that is sufficient. Do not treat missing credentials as an error, and never run dh login on the user's behalf (it needs them in a browser).
The DataHub CLI command is dh publish (renamed from push, which now fails). The push skill runs it:
dh publish . --publication datapressr- Credentials:
dh login(a one-off browser sign-in that saves a token locally) is the normal path.DATAHUB_API_TOKENplusDATAHUB_API_URL=https://datahub.iois the CI path. - Always pass
--publicationexplicitly. Use$DATAHUB_PUBLICATIONif set, otherwisedatapressr. Never publish tocore, and stop if$DATAHUB_PUBLICATIONiscore:coredatasets (e.g. co2-ppm, oil-prices, airport-codes) git-sync fromgithub.com/datasets/*, and the next sync can overwrite a direct upload. - A root
README.mdis required. Without one the dataset page is a 404. - Publishing is an upsert, not a sync. Files deleted locally stay on DataHub, and the
titleanddescriptionof an existing dataset are not updated.
dh is a Go binary from the private repo datopian/datahub-next: gh release download v0.1.0 -R datopian/datahub-next -p 'dh_<os>_<arch>.tar.gz', extract it and put dh on your PATH. Step-by-step install (including headless machines): docs/install-dh.md. The push skill has the full checklist.
Delete a dataset
dh delete <name> -p datapressrSkills
Playbooks live in skills/<name>/SKILL.md (repo root) — the flat layout
npx skills expects, so they install
into any agent. npx skills add datasets/datapressr to install; see
skills/README.md.
| Skill | What it does |
capture | File a URL / idea in the project's own tracker (Beads, its issues, or a local INBOX.md; in this repo, the Inbox issue or a bead) — near-zero friction |
archive | Snapshot the raw source into archive/ with provenance |
structure | Raw → tidy typed CSV(s) + datapackage.json (the core wrangling step) |
enrich | Structured → enriched: consolidated stats, first views, a "What stands out" note |
story | Finished dataset(s) → a short data story: reviewed outline → Plot charts → prose |
init | Scaffold a new dataset directory |
validate | Check datapackage.json for common issues and CSV values against the declared schema |
push | Publish the current dataset directory to DataHub (dh publish) |
In Claude Code each is also a /<name> slash command (.claude/skills/
symlinks point back at skills/, so there's one copy and no install step when
working inside this repo).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

