Agent skill

Tabler Shared Lib Helpers

by tabler in tabler/tabler

Moves logic out of Astro frontmatter into tested helper modules under shared/lib, with rules for naming, typing, deterministic demo data and sibling test files.

MITAuto-check passedDevelopment

Install Tabler Shared Lib Helpers

skills CLI
$ npx skills add tabler/tabler --skill shared-lib -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tabler/tabler shared-lib --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tabler/tabler.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/shared-lib .claude/skills/shared-lib && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shared-lib
GitHub stars
42k
Token cost
~1.2k tokens
SKILL.md length
531 words
Files
1
Skills in repo
21
Repo updated
First seen
Licence
MIT

At a glance

Moves logic out of Astro frontmatter into tested helper modules under shared/lib, with rules for naming, typing, deterministic demo data and sibling test files.

  • Works in 6 steps: What belongs here → Module conventions → Every module has a sibling test → …
  • Frontmatter in a component or page has grown beyond assembling classes
  • SKILL.md covers 1. What belongs here, 2. Module conventions, 3. Every module has a sibling… and 4. Demo data must be…, plus 2 more sections
  • Calls pnpm

What it does

Components in the Tabler repository stay as markup, and anything with a branch worth testing belongs in shared/lib as a named TypeScript module. The skill lists what qualifies: formatting of dates, numbers and strings, data access that turns a JSON file into a typed export, generation of deterministic demo values, SVG and markdown handling, and any helper duplicated across two components.

Class assembly, a ternary over props and a single map over a prop stay in the component, and DOM code, Astro rendering and build tooling do not go in lib at all. Modules use named exports, one topic per kebab-case file, explicit return types and pure functions, with a header comment when they encode a quirk and relative imports inside shared.

Every module gets a sibling test file, because the Vitest config collects lib/**/*.test.ts. The skill gives the pnpm commands for a single run, watch mode and the whole workspace through turbo, and asks for tests of fallbacks, empty ranges and thrown errors, not only the happy path.

When your agent uses it

  • Frontmatter in a component or page has grown beyond assembling classes
  • Demo data needs shaping, formatting or deterministic generation
  • The same helper appears in two components
  • Adding a unit test under shared for an existing helper

Example prompts

  • “Move the date formatting out of the activity card frontmatter into shared/lib and add a test.”
  • “Extract the duplicated currency formatter from the invoice components into a helper with tests.”
  • “Add a Vitest file for the pseudo-random module covering the edge cases.”

Requirements

  • The Tabler monorepo with pnpm and its shared package

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. What belongs here
  2. Module conventions
  3. Every module has a sibling test
  4. Demo data must be deterministic
  5. Strict TypeScript patterns
  6. Checklist

What it can do on your machine

Read from SKILL.md and the folder at commit dcacb65. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tabler Shared Lib Helpers loads about 1.2k tokens when it runs. Until then it costs about 124 tokens; SKILL.md has 531 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~124
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from tabler/tabler at commit dcacb65, republished under its MIT licence (© tabler). 531 words, ~1,232 tokens.

Download SKILL.mdSave it as .claude/skills/shared-lib/SKILL.md (or your agent's skills folder).
name
shared-lib
description
Move logic out of Astro frontmatter into `shared/lib/*.ts` and cover it with a vitest test. Use when a component's or page's frontmatter grows past assembling classes, when demo data needs shaping or formatting, when the same helper appears in two components, or when the user asks for a helper, utility or unit test under `shared/`. Covers what belongs there, module conventions, the sibling `*.test.ts` rule, deterministic demo data, and the strict-TypeScript patterns the repo uses.

Helpers in shared/lib

shared/lib/*.ts is the only place in shared/ where real logic lives. Components stay markup; anything with a branch worth testing moves here, gets a name, and gets a test.

1. What belongs here

Move it to shared/lib when it is:

  • formatting — dates, numbers, strings (date-format.ts, string-format.ts)
  • data access — turning a JSON file into a typed export (people.ts, site.ts)
  • generation — deterministic demo values (pseudo-random.ts), SVG/icon handling (svg.ts), markdown rendering (render-markdown.ts)
  • anything duplicated in two components, or longer than a few lines in frontmatter

Keep it in the component when it is class assembly, a ternary over props, or a single .map() over a prop — pushing that into lib only adds an import.

Do not put in shared/lib: DOM code (that is an inline script — see the astro-scripts skill), Astro-specific rendering (that is a component), or build-time tooling (that is .build/).

2. Module conventions

ts
// Demo data date formatting quirks:
// - unix seconds are shifted by local timezone offset (not the true epoch)
const MONTHS = ['January', 'February', /* … */]

/** Formats a date as "Month DD, YYYY" using its UTC components. */
export function formatLongDate(date: Date): string {
  return `${MONTHS[date.getUTCMonth()]} ${String(date.getUTCDate()).padStart(2, '0')}, ${date.getUTCFullYear()}`
}
  • Named exports only, one topic per file, filename in kebab-case matching the topic.
  • Explicit return types; pure functions with no module-level mutable state (page-scripts.ts is the deliberate exception — a render-scoped registry).
  • A file-header comment when the module encodes a quirk (why the epoch is shifted, why the RNG is fake). A /** … */ line on each exported function.
  • Export the types consumers need (export interface Person), so call sites do not re-cast.
  • Imports inside shared/ are relative (./array, ../data/people.json). Any bare npm import must be declared in shared/package.json.

3. Every module has a sibling test

shared/vitest.config.mts collects lib/**/*.test.ts, so foo.ts gets foo.test.ts next to it. This is not optional — every module in the directory has one.

bash
pnpm --filter @tabler/shared test        # one run
pnpm --filter @tabler/shared test:watch  # while writing
pnpm run test                            # all packages, via turbo

Test the branches, not the happy path only: the fallback when a regex does not match, the empty range, the thrown error. globals: true is set, but the existing files still import describe/it/expect from vitest — keep that style.

Show full SKILL.md (234 more words)Show less

4. Demo data must be deterministic

Pages are rebuilt constantly and the rendered HTML is compared byte-for-byte (html-diff skill), so a helper that produces different output on each run breaks the harness and pollutes diffs.

  • Use pseudo-random.ts (randomNumber, randomDate, randomItem, timeagoLabel), seeded by the loop index — never Math.random().
  • Never seed demo data from Date.now() / new Date() without arguments. Fixed dates only.

5. Strict TypeScript patterns

Every package extends astro/tsconfigs/strictest, so indexing an array yields T | undefined:

  • Use requireIndex(items, i) from array.ts when the demo data is trusted to have the entry — it throws with a useful message instead of rendering undefined.
  • Cast a JSON import to its type once, in the lib module, and export the typed value (export const people = peopleData as Person[]). Call sites import the typed export; they never re-cast the JSON.
  • Give such interfaces an index signature ([key: string]: unknown) when the JSON has more fields than the components read.

pnpm run type-check runs astro check per package and covers these files.

6. Checklist

  • Logic is out of the frontmatter and named after what it does
  • Named exports, explicit return types, no hidden state
  • Header comment for quirks, doc comment per exported function
  • Sibling *.test.ts covering the branches, not just the happy path
  • Deterministic: pseudo-random.ts, no Math.random(), no unseeded dates
  • JSON cast once in the lib module, requireIndex for trusted indexing
  • pnpm --filter @tabler/shared test, repo-level type-check and format:prettier clean

© tabler, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/shared-lib of tabler/tabler.

Open the folder on GitHubat commit dcacb65

Compare with similar skills

Tabler Shared Lib Helpers next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tabler Shared Lib Helpers compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tabler Shared Lib Helpers this skilltabler/tabler42k—~1.2kAutomated safety check: PassMIT
Effect TSmattiacerutti/supernova187—~2.8kAutomated safety check: PassMIT
Effect TSpproenca/dot-skills214—~2kAutomated safety check: PassMIT
Effect TStellahq/opensession392—~3.7kAutomated safety check: PassMIT
Typescript Idiomsirahardianto/awesome-agv157—~6.1kAutomated safety check: PassMIT
Vue Idiomsirahardianto/awesome-agv157—~6kAutomated safety check: PassMIT

Similar skills

  • Effect TS

    mattiacerutti/supernova

    Write idiomatic Effect v4 TypeScript following official best practices from effect-solutions and the Effect source.

    187 GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Effect TS

    pproenca/dot-skills

    Effect-TS library usage in TypeScript — Effect.gen generators, Schema.Struct/Schema.Class definitions, Layer/Context.Tag/Service patterns, Effect.pipe pipelines, Data.TaggedError/Data.Class error…

    214 GitHub stars~2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Effect TS

    tellahq/opensession

    Write idiomatic Effect v4 TypeScript verified against the pinned effect@4.0.0-rc.112 source.

    392 GitHub stars~3.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Typescript Idioms

    irahardianto/awesome-agv

    TypeScript strict typing: type narrowing, discriminated unions, Zod runtime validation, generic utility types, and Vitest testing.

    157 GitHub stars~6.1k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Vue Idioms

    irahardianto/awesome-agv

    Vue 3 Composition API patterns: <script setup syntax, reactive state with Pinia stores, reusable composables, and Vitest component testing.

    157 GitHub stars~6k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Ha Frontend Testing

    home-assistant/frontend

    Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed

More from tabler/tabler

All 21 skills in this repo
  • Starts the right Tabler dev server, keeps it from clashing with builds and verifies changes in the browser before a page or component is handed back.

    42k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Rules for adding or fixing client-side scripts in Tabler's Astro components so the copied preview HTML stays readable, self-contained and runs in the right order.

    42k GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Sets the file structure, typing and Data API pattern for writing a new Bootstrap-style JavaScript component class in Tabler's vendored port of Bootstrap's JS.

    42k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Writes or updates the classnames front matter that renders the class table at the end of a Tabler component docs page.

    42k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Guidance for changing the Tabler framework's own JavaScript in core/js: the tabler.js and tabler-theme.js bundles, the Bootstrap port and their tests.

    42k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Tabler Core SCSS

    tabler/tabler

    Rules for adding or changing styles in Tabler's core/scss framework: file placement, custom properties, dark mode, RTL, tests and build gates.

    42k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Tabler Shared Lib Helpers

What does Tabler Shared Lib Helpers do?

Moves logic out of Astro frontmatter into tested helper modules under shared/lib, with rules for naming, typing, deterministic demo data and sibling test files. Components in the Tabler repository stay as markup, and anything with a branch worth testing belongs in shared/lib as a named TypeScript module. The skill lists what qualifies: formatting of dates, numbers and strings, data access that turns a JSON file into a typed export, generation of deterministic demo values, SVG and markdown handling, and any helper duplicated across two components.

When should I use Tabler Shared Lib Helpers?

Tabler Shared Lib Helpers fits situations like: frontmatter in a component or page has grown beyond assembling classes; demo data needs shaping, formatting or deterministic generation; the same helper appears in two components; adding a unit test under shared for an existing helper.

How do I install Tabler Shared Lib Helpers in Claude Code?

Run `npx skills add tabler/tabler --skill shared-lib -a claude-code`. Or copy the skill folder (.agents/skills/shared-lib in tabler/tabler) into .claude/skills/shared-lib in your project. Claude Code loads it when a task matches its description.

How do I install Tabler Shared Lib Helpers in Codex?

Run `npx skills add tabler/tabler --skill shared-lib -a codex`. Or copy the skill folder (.agents/skills/shared-lib in tabler/tabler) into .agents/skills/shared-lib in your project. Codex loads it when a task matches its description.

Can I use Tabler Shared Lib Helpers in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tabler/tabler --skill shared-lib -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shared-lib, .gemini/skills/shared-lib, .github/skills/shared-lib and .opencode/skills/shared-lib in your project.

What does Tabler Shared Lib Helpers need to run?

Going by SKILL.md and its folder, Tabler Shared Lib Helpers needs the command-line tools its instructions call (pnpm). Our summary lists: The Tabler monorepo with pnpm and its shared package.

Does Tabler Shared Lib Helpers access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tabler Shared Lib Helpers safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tabler Shared Lib Helpers use?

Tabler Shared Lib Helpers is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tabler Shared Lib Helpers use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tabler Shared Lib Helpers?

Skills that share tags, products or a category with Tabler Shared Lib Helpers: Effect TS (mattiacerutti/supernova, 187 stars), Effect TS (pproenca/dot-skills, 214 stars), Effect TS (tellahq/opensession, 392 stars) and Typescript Idioms (irahardianto/awesome-agv, 157 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tabler Shared Lib Helpers?

tabler (a GitHub organization) maintains it in tabler/tabler, which has 41,821 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on October 6, 2026.

Source: tabler/tabler on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.