Sync docs
Propagate Hissab's syntax documentation from its source of truth (lib/documentation/) out to every downstream surface — the five README.md files and the in-app docs under app/src/docs/. Invoke whenever lib/documentation/ changes (a new category, function, operator, unit, or syntax rule), when engine features land that users need to know about, or when the user asks to "sync docs", "update the docs", "update the READMEs", or fix doc drift. Verifies every example against the real engine before finishing.From its SKILL.md
npx -y skills add rawbytess/hissab --skill sync-docsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 7 stars7 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.3 KB, as published. Nobody here has run it
Sync Hissab docs from the source of truth
lib/documentation/ is the single source of truth for Hissab's user-facing
syntax. Everything else — the READMEs and the in-app docs — is a hand-written
view of it for a particular audience. They drift when the engine gains a
feature and only the source chunks get updated. This skill propagates a change
from the source out to every downstream surface and proves the examples still
run.
This skill does not rewrite the syntax reference itself. If a rule changed
(new function, new operator, changed precedence), that belongs in
lib/documentation/ first — see "Did the source change?" below. This skill's job
is to make the downstream copies agree with the source once it's correct.
The source of truth
lib/documentation/
tags.ts OPERATION_TAGS[] + tagDescriptions{} ← master category list
base.ts base overview: basics, labels/prev, pitfalls, limits
chunks/<tag>.ts full grammar + examples + gotchas, one file per tag
system-instructions.ts LLM system prompts (rarely a sync target)
index.ts getFullDocumentation(), getDocumentationChunk(tag)
OPERATION_TAGS in tags.ts is the canonical list of categories (currently 19:
arithmetic … labels_and_prev). Every category list on every surface must
match it — same set, same order, same naming. When a tag is added/removed/
renamed in tags.ts, that change has to reach all of the surfaces below.
The ground truth for what an expression actually returns is
engine/tests/expression/valid/*.txt — engine-verified ["expr", "result"]
pairs (and invalid/*.txt for expressions that must error). Treat those results
as authoritative; never invent an output in the docs.
Downstream surfaces (what this skill keeps in sync)
| Surface | What to keep in sync with the source |
|---|---|
README.md (root) | Intro one-liner examples; "What is Hissab" prose; the Features category table (one row per OPERATION_TAG); CLI command list; engine-exports paragraph |
cli/README.md | Command list; example invocations; the "Supported syntax" category sentence |
engine/README.md | "Supported expression families" sentence; the public-exports list |
skills/README.md | Category sentence in the intro; the documentation tags block (verbatim OPERATION_TAGS) |
app/README.md | Currently the stock Vite template — flag it; only replace with the user's go-ahead |
app/src/docs/content/**/*.md | One page per category + reference pages (functions/operators/units); examples in ```hissab blocks |
app/src/docs/registry.ts | Navigation manifest — every category page must be registered here |
Full per-surface detail (exact sections, line anchors, conventions) is in
references/surface-map.md. Read it before editing
so nothing is missed.
Out of scope — do not touch here:
skills/hissab-cli/documentation.mdis generated. Never hand-edit it. Runpnpm sync:skill-docsinstead.website/(Astro/Starlight) is a separate doc surface with its own cadence; only touch it if the user asks.
Did the source change?
If the user's request is really "the engine grew feature X, update the docs", the source must capture it first — otherwise there's nothing correct to sync from. Before propagating:
- Confirm the rule lives in
lib/documentation/— the rightchunks/<tag>.ts, plustags.ts/base.tsif it's a whole new category. If it doesn't, add it there first (that's the project's documented contract inCLAUDE.md). - Add example expressions to
engine/tests/expression/valid/<category>.txt(andinvalid/for things that must error) and run the engine tests, so the outputs you'll quote downstream are verified.
Only once the source is correct do you fan the change out.
Workflow
- Identify the delta. What changed in
lib/documentation/? Diff against the last sync if unsure:git log -p -- lib/documentation/. Note specifically whetherOPERATION_TAGSchanged (a tag added/removed/renamed) — that ripples to every category list. - Read the surface map. Open
references/surface-map.mdand treat it as the checklist of places to edit. - Update each surface to reflect the delta, matching each file's existing
tone and structure (the READMEs are prose; the app docs use ```hissab blocks +
:::cautionbullets). Pull example expressions and their results fromengine/tests/expression/valid/*.txt— don't make up outputs. If you add a new app docs page, register it inapp/src/docs/registry.tsunder the right section. - Keep category lists identical to
OPERATION_TAGS— same set, same order. The README Features table, the cli/engine/skills category sentences, theskills/README.mdtags block, and the app docs page set all derive from it. - Regenerate the generated skill docs:
pnpm sync:skill-docs(only ifbase.tschanged). Never editskills/*/documentation.mdby hand. - Verify (see below).
- Report what you changed surface-by-surface, and call out anything you left
for the user (e.g.
app/README.md, or the website).
Verify before finishing
Run these from the repo root. The verifier needs the engine built once:
pnpm -F engine build # so @rawbytes/hissab resolves
bun .claude/skills/sync-docs/scripts/verify-examples.ts # every ```hissab block in app docs must run
pnpm sync:skill-docs:check # generated skill docs not drifted
pnpm check:check # biome lint/format gate
verify-examples.tsevaluates every ```hissab block inapp/src/docs/contentthrough the real engine and fails on any line that doesn't parse. Pass file paths to scope it to what you touched:bun .claude/skills/sync-docs/scripts/verify-examples.ts app/src/docs/content/guide/<page>.md- It checks that examples run, not their printed output. For result
accuracy, cross-check against
engine/tests/expression/valid/*.txt, or spot-check a specific result:pnpm -F cli dev eval "<expr>". - README code fences are
text /ts (not executable), so verify their example outputs by hand against the test corpus orhissab eval.
Guardrails
- Source first. Never fix a syntax rule only in a README or app doc — change
lib/documentation/and let it flow down, or the surfaces diverge again. - One category list. It's
OPERATION_TAGS. If you find a surface listing categories in a different order or with a stale name, that's the bug — align it totags.ts. - Never hand-edit
skills/*/documentation.md— runpnpm sync:skill-docs. - Don't duplicate the reference. The app docs are a guide; they shouldn't
re-paste the full grammar from the chunks — link/point to the source instead
(see the note at the top of
app/src/docs/registry.ts). - No invented outputs. Every result you quote comes from the engine
(
engine/tests/expression/valid/*.txtorhissab eval). - Match the surface's voice. READMEs are prose; app docs use ```hissab fenced
blocks for runnable examples and
:::cautionbullets for mistakes.
Done checklist
- Source (
lib/documentation/) is correct and, if a rule changed, has backing tests inengine/tests/expression/. - Every surface in the table reflects the delta.
- Every category list matches
OPERATION_TAGS(set + order). - New app docs pages are registered in
app/src/docs/registry.ts. -
pnpm sync:skill-docsrun ifbase.tschanged;sync:skill-docs:checkpasses. -
verify-examples.tspasses; quoted results match the test corpus. -
pnpm check:checkpasses. - Reported what changed and what was deferred to the user.