For coding agents · kept up to date · started 8 November 2026
Working on tabelline, for agents
What a coding agent needs to change tabelline: how to set up, the commands it will run, where things are, and the rules of the repository. People new to the code can read it too.
The rules below are read from AGENTS.md when this page is built, so they are always the ones in the repository. A short map of the site for language models is at llms.txt. An agent using tabelline (not changing it) reads the whole API in one Markdown file, api.md, or as data, api.json: the Reference, as plain text. Two skills come with the repository.
Start here
In a fresh checkout or sandbox, run the setup first. It installs what is missing (Nim, atlas, libpcre3) and the pinned dependencies, and it is safe to run again:
sh tools/setup.sh
Then these are the commands an agent runs, in the order a change needs them:
| The commands | |
|---|---|
| what it does | |
| nim r tests/all.nim | runs the tests |
| nim r tools/specexamples.nim | runs every example in the specs and checks its output |
| nim r tools/specexamples.nim --update | rewrites the outputs after a change is built (--changes adds open changes) |
| nim r tools/drift.nim | checks that no page adds HTML, styles or colours (--update lowers the baseline) |
| nim r -d:release docs/all.nim | builds every page into docs/ (the HTML is not committed) |
| nim r book/bookbuild.nim | builds the book into docs/book/ (only the chapters that changed) |
| nim r tools/preview.nim | copies the built pages to ../tabelline-preview, for an artifact to show Pietro |
Where things are
src/tabelline/: the library. The core needs only Nim's standard library; nimib is used only bysrc/tabelline/nimib.nim, and nanuq only bysrc/tabelline/nanuq.nim.openspec/specs/: how tabelline behaves, requirement by requirement, each with an example. New work starts as a change inopenspec/changes/. Rendered on the specs page, which can show part of them:specs/?spec=<names>orspecs/?change=<names>.docs/: every page, a nimib notebook made of the blocks indocs/blocks.nim(the review mode's are indocs/review.nim); the look isdocs/theme.nim, explained in the Design guide. Posts are indocs/devlog/, stories (one for every release, told with tabelline) indocs/stories/.book/: the book, a nimibook (nim r book/bookbuild.nim); its planned sources are inbook/plan/.BACKLOG.md(ideas),CHANGELOG.md(what shipped),docs/coverage/gt.json(what of gt is covered),docs/piano.nim(the roadmap's data).
The rules, from AGENTS.md
Notes for coding agents (and people) changing this repository. How tabelline behaves is in
openspec/specs/ (rendered at specs/); how it is laid out is in README.md. This file holds the
working rules that are easy to miss.
Behaviour lives in the specs
- Every agreed behaviour is a requirement with scenarios in
openspec/specs/. New work starts as an OpenSpec change inopenspec/changes/(/opsx:propose), is built in a PR (/opsx:apply), and is archived when it ships (/opsx:archive).openspec/config.yamlhas the rules. - Ideas go in BACKLOG.md, not straight into work. When a change is archived, remove its BACKLOG entry and add a CHANGELOG.md line under Unreleased with the PR number.
- Every requirement about the API has an example: a
nim block followed by atext block with what it prints (echo tprints a table as text).nim r tools/specexamples.nimruns them all;--updaterewrites the outputs after a change is built;--changesincludes open changes. - Anything new that is not from gt or Great Tables gets a line in Not from gt in the
coverage map (
docs/coverage.nim): what it is, why, and the closest thing in gt or Great Tables, in Nim's own or, when gt and Great Tables could use it too (check that they lack it), Worth porting back. - Name verbs after gt in camelCase (
tab_headeristabHeader), and list differences from gt and Great Tables in every proposal.
Code
- The core (
src/tabelline/) needs only Nim's standard library. nimib is used only bysrc/tabelline/nimib.nimand the docs. Optional interop goes in its own module (src/tabelline/nanuq.nim, for nanuq's data frames). - Verbs take a
Tabella(sink) and return the new one; formats and styles resolve columns and rows when the verb is called and run when the table is rendered (build.nim), so every renderer agrees. Macros only where a proc cannot do the job (today:tabella(data): body,tableData:,tabOptions). - Examples in the docs and the specs write a table as
tabella(data): body, one verb per line, not as a chain of dots, and a verb that takes a list of pairs (colsLabel,colsWidth,colsUnits,textCaseMatch,summaryRows,grandSummaryRows,summaryColumns) as an indented block, one pair per line (summaryRows:thentotal: agg.sum). A new verb whose first argument is a list of pairs goes inpairVerbs(src/tabelline.nim). nim r tests/all.nimruns the tests. Dependencies are managed with atlas: nimib is thedocsfeature oftabelline.nimble, pinned inatlas.lock, cloned intodeps/(not committed) and put on the path bynim.cfg(committed, written by atlas).
Setup
- In a fresh checkout or sandbox, run
sh tools/setup.shbefore anything else. It installs what is missing (Nim from GitHub nightlies, atlas, libpcre3) and the pinned dependencies, and is safe to rerun. It prints theexport PATH=...line to use when it installed Nim or atlas. - To change a dependency:
atlas use <pkg>or edit thedocsfeature,atlas install --feature=docs, run the tests and the pages, thenatlas pin --feature=docsand commitatlas.lockandnim.cfg. Without--feature=docs, atlas leaves nimib out. atlas.lockkeeps a copy oftabelline.nimble, andatlas rep(sotools/setup.sh) writes that copy back: after editingtabelline.nimble, runatlas pin --feature=docsbefore the setup.
Pages
- Every page is a nimib notebook in
docs/that callsnb.useTabelline(...)afternbInitand writes an HTML file that shares its style, fonts and scripts with the other pages (docs/assets/:site.css, written bytheme.nim, the fonts,review.js; local, nothing remote), so a reader downloads them once;-d:singleFileinlines them, for a page that must work alone, such as a one-page artifact. It has two looks: Munari, the default (plain rules, so a page without JavaScript is Munari), and the quaderno (rules underhtml[data-tema="quaderno"]); the header switches between them and the choice is remembered. The pages of the islands of the Mediterranean offer the Minoan look instead of the quaderno (useTabelline(looks = ["munari", "minoan"], firstLook = "minoan")). Check new page elements at 390px in Munari; in the quaderno only what might affect it (a broken quaderno is a minor issue for now). The HTML is not committed: CI builds every page (nim r -d:release docs/all.nim) and deploysdocs/to GitHub Pages frommain. - Blocks, not HTML. A page is Markdown in
nbText, nimib's blocks,nbTable, and the blocks ofdocs/blocks.nim(nbTitle,nbToc,nbNote(text, kind),nbCards/nbCard,nbGallery/nbGalleryCard,nbTabs,nbShowCode,nbFoldCode,nbParts,nbBeside,nbSwatches,nbPart,nbDrawing). In a page that tells a story with tables (an explainer, a use-it post), what is about the code goes innbNote(text, nkCode), the green card, under the table it explains, with a first card that says so; the text tells the story. No HTML innbText, no CSS and no colours in a page. What is needed a second time becomes a block indocs/blocks.nim; its CSS goes indocs/theme.nim, from the tokens.nbRawHtmlis a last resort, for a one-off, with a comment saying why. Tables takeoptCssTheme(); a colour in a page is a token ("var(--secondary)"), never a hex value.nim r tools/drift.nim(in CI) fails when a page has more HTML, styles, scripts or colours than its line intools/drift.tsv; when a page loses some, lower its line with--update. - Every explainer, story and devlog post has a table of contents:
nbTocright afternbTitle, which also gives every heading its ↑ back to it (Pietro's review of the Mediterranean post). - Every link leads somewhere. After building the pages and the book,
nim r tools/links.nimchecks the links inside the site (files and#anchors, and links to this repository's files on main, the PR's branch or a commit, in the checkout), andnim r -d:ssl tools/links.nim --externalthe links to other sites too (404 and 410 fail). CI runs the first on every run and the second once a week (and by hand), so a page that moves upstream (Great Tables' Get Started became its User Guide) is caught without slowing every PR. - The home page shows the simplest example, then the gallery of the stories, and links the pages in three groups, by the question
a reader brings: Learn tabelline (Guide, Book, Reference), Where it's going (Feature map, Roadmap), How
it's made (Devlog, Specs, Design guide, For coding agents). Name pages in plain words a newcomer
reads without knowing how tabelline is made. The devlog lists only posts. A new page gets a card
there (
docs/index.nim), a line in the README, and indocs/agents.nim's llms.txt list. - The Design guide (
docs/design.nim) is updated in the PR that changes the look; a big design change starts as a devlog post. The page For coding agents reads this file when it builds. - Stories are the use it threads' output, one for every release, and a release may have
others (FOSDEM's data, for 0.1): a real subject told in tables, as a user would. A story is
docs/stories/<slug>.nim(first line## story: <release> | title | lede, data indocs/stories/data/<slug>/); the gallery of the home page and of the stories page finds it and shows a small table from it (previewindocs/stories/storie.nim), and the roadmap's thread links it (hrefindocs/piano.nim). A story is kept up to date, like the other pages: when a release makes one of its tables better, change the story. - The pages of the site are kept up to date. A devlog post
(
docs/devlog/<slug>.nim, first line## devlog: dd Mon yyyy X | title | lede) is dated and not rewritten afterwards, but takes edits (typos, links, small corrections); the devlog index finds it, and it gets a line in the README.Xis a letter for posts of the same day, in the order they were written (A, B, C, ...), so the index can show the newest first. - Shape for kind, colour for role. The circle is a place (sections, the indice), the triangle a
warning (
nkWarning, drawn as a road sign), the square a sheet set apart (notes, cards, gallery cards: their straight top edge). Each shape has a default colour, another only with a reason. Nothing that only decorates may look like something to press or drag (no dots, holes or knobs on cards). Colours are the tokens ofdocs/theme.nim: six values per look (paper, ink, primary, secondary, warning, success), and every other colour mixed from them (the neutrals--shade,--line,--mutedand the scale--neutral-0…--neutral-9,--surface,--x-soft,--x-text); the warning colour is never text. The old names--n-0…--n-9and--text(now--font) are kept only for the dated posts' own CSS. - The feature map (
docs/coverage.nim) readsdocs/coverage/gt.json. A PR that adds or completes a gt feature updates its row there (status, andplanwhile it is open), and a release PR checks the whole file. - Review mode: every page has it, turned on by
useTabelline(review = falseleaves it out), fromdocs/review.nim(a module of its own in English that can move to nimib, with its styles; a plain nimib page callsnbReview()). The page shows Version N · updated D under its lede, with ✎ Review beside it (nbVersion()moves the line); the version is the number of commits that changed the page's source, so CI checks out the whole history. In the review mode a reader selects text, comments, and exports the comments as Markdown with a block of YAML (format: nimib-review/5, where a comment kept from an older version says so;/4added thecommit,/3had no commit,/2had kinds,/1a front matter). When such an export is pasted in the chat, follow the skill.claude/skills/nimib-review/. The devlog postreview_moderecords its rounds indocs/devlog/review_mode/storia.nim. - A link can show part of the specs page:
specs/?spec=<names>orspecs/?change=<names>(comma-separated,name*for a prefix,all, or the same after#).
The book
- The book is
book/, a nimibook built bynim r book/bookbuild.nimintodocs/book/(see README.md). One theme, the Munari look with the Edo palette: the tokens ofdocs/theme.nimin the valuesedo, written by the build beforebook/theme/edo.css, which names no colour of its own. Its own tables (the sources) takeoptCssTheme(); the ported examples keep the colours of the guide. Chapters are written withbook/tabbook.nim's blocks (tabs,tabelline,sideBySide), not with HTML. - A ported page keeps the text of the original as it is; everything the book says about
tabelline goes in
tabelline "..."boxes, and every gap found goes tobook/gaps.md(and to the build thread, or BACKLOG.md). - A change to a chapter's Python needs uv (
book/gt/), and a change to its R needs R with gt: rebuild, then commitbook/gt/outputs/andbook/gt/outputs-r/. CI never runs Python or R. The R tab is written for the book (the gt way to make the same table); where gt has no way, pass""and the tab says so. - When tabelline gains a feature a chapter works around, update the chapter and
book/gaps.md. - The sources the book plans to port are in
book/plan/sources.json: each says where its pages are (find: a repository and paths), and lists by hand only the pages it has something to say about.nim r book/plan/plan.nimsearches the repositories (git, no API), maps each page to the features it uses and writesbook/plan/pages.json(committed); it reports pages found and not listed (port: "triage"until read: list them) and pages listed and gone. Rerun it whendocs/coverage/gt.jsonchanges or a source is added; findings of a port go tofound.nim r book/plan/plan.nim fmt_currency(or words of a feature) lists the pages that show a feature, the help pages of gt and Great Tables first: start there when porting or building it. The Table Contest entries are collected bynim r book/plan/contest.nim(forum and winners posts, cached;--offline) into the sourcetable-contest; run it, thenplan.nim.
Skills
skills/holds the skills for agents that use tabelline (the ones for working on this repository are in.claude/skills/):tabelline, its specifics, andtable-building, true of any table with any library..claude-plugin/makes the repository a Claude Code plugin and its own marketplace; its version is tabelline's.- A skill holds only what the docs do not say: how to work, the traps agents met, recipes. It does not copy the API (api.md has it) or the book (it links chapters at the release's tag). Every rule says what to do, not only what to avoid: agents follow a skill to the letter.
- Every
nim block of a skill that imports tabelline runs, and prints thetext block after it:nim r tools/skillexamples.nim(in CI). When tabelline fixes a trap, remove it from the skill in the same PR. - A rule enters a skill with evidence: an agent that lost time or got it wrong, and an eval case
in
skills/<skill>/evals/(the format ofclaude plugin eval) that fails without the rule.nim r tools/skillevals.nim <case> <run folder> --final:<reply>grades what an agent made. Test with agents that cannot read the answer (the book has most of the hard tables) and that know nothing else: a newclaude -pprocess in an empty folder outside any repository (--setting-sources local, the skills given with--plugin-dirand not named in the prompt, and the project memory left out: unsetCLAUDE_MEMORY_STORESandCLAUDE_COWORK_MEMORY_PATH_OVERRIDE), not a subagent, which carries this file. A skill does not rely on a pointer to another skill: agents do not follow it.
Previews and PRs
- Show Pietro a published preview of the pages before asking to merge; he reviews on his phone.
nim r tools/preview.nimcopies the built pages to../tabelline-previewfor an artifact (folder links point to index.html), withdocs/assets/and the book: publish the whole folder. A link to the artifact ending in#<page>opens that page: the folder with/as-, such as#devlog-three-threadsor#roadmap, and for the book#book-and the page's path without.html, such as#book-get-started-intro. Give Pietro the deep link to what changed.- When a change is visual, put before and after screenshots (phone width, Munari; the quaderno
only when the change might affect it) in the reply
to Pietro, and only the after shots of what changed in the PR description. To show them in the
PR without adding them to
main, commit them, link them by that commit's sha, and remove them in the next commit. - A change to CI comes with an estimate of the tradeoff, in the PR description: what it costs on every run (seconds, measured), what it catches, and the cheaper ways that were weighed.
- Nothing goes to
mainwithout his go. One clean PR per change; keep the PR description in sync with the branch.
Skills, for agents that use tabelline
A skill is a short Markdown file an agent reads before a task. Two are in the repository, in
skills/, and the post Skills for tabelline tells how they were made and
tested.
- tabelline:
what tabelline's docs do not say. Where the plain-text docs are and how to search them, how to
work (a recipe,
echo t, then the page), the traps agents met, and two pages for hard tables: data made in code, and drawings in cells. - table-building: for any table, with any library. What to decide first, in what order to build, and to look at the page, wide and on a phone, before saying it is done. It comes with a script that takes the two screenshots.
In Claude Code they install as one plugin: add this repository as a marketplace, then install the plugin from it.
/plugin marketplace add pietroppeter/tabelline
/plugin install tabelline@tabelline
Any other agent can be pointed at the two files. Their Nim examples run against the code
(nim r tools/skillexamples.nim, in CI), and each skill has eval cases in evals/, graded by
nim r tools/skillevals.nim <case> <run folder>.
How it is built
docs/agents.nim reads AGENTS.md from the repository when the pages are built, drops its
title and turns its ## sections into ###, so the rules on this page are the file's. It also
writes docs/llms.txt from the list of pages below it in the same file; CI publishes
it at the root of the site.