/jadis-official:jadis-officialfrom jadis-official
Teaches Jadis, a thin TypeScript layer over native Web Components with no virtual DOM or reactivity. Covers lifecycle, JSX/createElement templates, state with useChange, events, routing, translations, server rendering, and common mistakes from React/Vue/Lit habits.
Ships in jadis-official. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Jadis is a small TypeScript library over native Web Components. A component is a custom element: a class that extends Jadis. It draws its template once, as real DOM, then you change the nodes that need it when its state changes. There is no virtual DOM, no re-render, no reactive system and no framework runtime. Never bring React, Vue, Lit, a virtual DOM or a state library on top of it.
Written for @jadis/[email protected]. Documentation: https://bioleyl.github.io/jadis/ · Source: https://github.com/bioleyl/jadis
The project's own rules (AGENTS.md, CLAUDE.md, its README) and its consistent conventions win over this skill.
| You would write (React, Vue, Lit) | In Jadis |
|---|---|
| A function or class that renders again on every change | templateHtml() returns a Node, built once at the first connection, never again |
useState, ref(), @property, this.requestUpdate() | this.useChange(initial, (value) => /* change the nodes */): a value with a callback, not a re-render |
JSX in render() with {state} interpolated | JSX in templateHtml() for the structure; dynamic text written in callbacks with textContent |
ref, this.$refs, @query | this.useRefs((ref) => ({ name: ref('#name') })): getters that query the shadow root |
useEffect and its cleanup | onConnect(), and listeners added with this.on(), removed at disconnection on their own |
| Props | Public fields and methods; JSX props set properties; attributes through useChange(…, { attribute }) |
Callback props, $emit, dispatchEvent | readonly events = this.useEvents<{ save: Item }>() then this.events.emit('save', item) |
| Context, Redux, Pinia, stores | A Bus shared by the components that need it, or a plain module |
key and list diffing | You add, move and remove the row elements yourself, usually from a Map of id to element |
| React Router, vue-router | new Router(defineRoutes({…})).mountOn(element) |
| i18n libraries | Translator with defineTranslations, and this.useTranslation() |
The shape to copy. One file per component, its CSS beside it.
// src/components/quantity-stepper.tsx
import { Jadis } from '@jadis/core';
import styles from './quantity-stepper.css?inline';
const MIN_QUANTITY = 1;
export class QuantityStepper extends Jadis {
// A custom element name: lowercase, with a hyphen, unique in the app.
static readonly selector = 'quantity-stepper';
// Public and named `events`: a parent registers on it, and JSX accepts `onValueChange`.
readonly events = this.useEvents<{ valueChange: number }>();
// The state. The `value` attribute, a JSX prop `value={3}` and `stepper.value.set(3)` all set it.
readonly value = this.useChange(MIN_QUANTITY, (value) => this.drawValue(value), { attribute: 'value' });
// Getters on the template: each access queries the shadow root. Never read them in the constructor.
private readonly _refs = this.useRefs((ref) => ({
decrease: ref<HTMLButtonElement>('#decrease'),
increase: ref<HTMLButtonElement>('#increase'),
output: ref('output'),
}));
// Runs once, at the first connection. Structure only: the callbacks fill in the values.
templateHtml(): Node {
return (
<div class="stepper">
<button id="decrease" type="button" aria-label="Decrease">−</button>
<output />
<button id="increase" type="button" aria-label="Increase">+</button>
</div>
);
}
templateCss(): string {
return styles;
}
// A task after each connection. Listeners added with this.on() go at disconnection.
onConnect(): void {
this.on(this._refs.decrease, 'click', () => this.step(-1));
this.on(this._refs.increase, 'click', () => this.step(1));
}
private step(delta: number): void {
this.value.set((value) => Math.max(MIN_QUANTITY, value + delta));
this.events.emit('valueChange', this.value.get());
}
// Draws the value it is given, whole: it may run again with the same value.
private drawValue(value: number): void {
this._refs.output.textContent = String(value);
this._refs.decrease.disabled = value <= MIN_QUANTITY;
}
}
QuantityStepper.register();
/* src/components/quantity-stepper.css */
:host { display: inline-block; }
.stepper { display: flex; align-items: center; gap: 0.5rem; }
A parent uses it by its class in JSX (importing the class registers it), or by its tag in HTML:
<QuantityStepper value={2} onValueChange={(quantity) => this.drawTotal(quantity)} />
<quantity-stepper value="2"></quantity-stepper>
useRefs, useChange, useEvents, useAttributes). Nothing is rendered: reading a ref throws.appendChild into the document): templateCss() and templateHtml() run once. Then, in the same call: attribute callbacks, then useChange values set before the connection (once each, with the latest value) and immediate ones, then useTranslation callbacks. All before the browser paints.onConnect() runs a task later (setTimeout), not during appendChild; not at all if the component was removed meanwhile.this.on(), events.register() and onBus(), then onDisconnect() runs. The DOM is kept.onConnect() runs again.append, insertBefore, replaceChildren, moveBefore of an element already in the page) is not a removal: nothing runs, listeners stay.So: onConnect() must be safe to run again, guard one-time work by what the DOM already holds, pass this.killSignal to fetch, and check this.isConnected after an await. Details: references/components.md.
Each rule has a short name; use the name when you cite it in a review.
templateHtml() builds the structure once. A change of state changes only the nodes it concerns (textContent, classList.toggle, a property, adding or removing one row). Never rebuild the template, never call templateHtml() yourself, never assign innerHTML to redraw.useChange callback writes the state it is given, so running it twice with the same value changes nothing. Replace values (set((list) => [...list, item])), never change them in place.on… prop, or this.on() in onConnect(). Listeners on anything that outlives the component (window, document, a bus, another component's events): in onConnect(), through this.on(), onBus() or events.register(), or with { signal: this.killSignal }. Never removeEventListener by hand, never add them in the constructor.onConnect runs again. It runs after every reconnection, on the same DOM. Make it safe to repeat; guard one-time work (filling a list, a first fetch) by what the DOM or the state already holds, not a "done once" flag.connectedCallback, disconnectedCallback, attributeChangedCallback and static observedAttributes belong to Jadis. Use onConnect, onDisconnect, useAttributes and useChange(…, { attribute }).static readonly selector is lowercase with a hyphen and unique: a second class on a taken name is silently ignored. Call register() at the bottom of the component's module, and import a child's module before a parent renders it.useChange fields (JSX props), calls its methods, or sets attributes. A child reports with this.events.emit() on a public readonly events field. A Bus is for app-wide messages only.<user-card name="Ada" /> assigns element.name, it does not set the name attribute. Attributes come from attrs={{ name: 'Ada' }} and from hyphenated names (data-*, aria-*).textContent. Write data into the DOM with textContent, properties, or JSX children. Never innerHTML with data: it is a script injection.templateCss(), the same for every instance. It becomes one stylesheet shared by all instances. Give the host a display (:host { display: block; }), and an instance its own values through CSS custom properties or classes, never through different CSS text. Shadow DOM is on: global CSS does not reach inside.HTMLElement: never declare title, hidden, id, lang, dir, style, slot, translate, remove, click, focus, isConnected or another inherited member as a field or method of your own.fetch with a signal, URL, Intl, <form>, <dialog>, <template>, CSS. No package for what a few lines of DOM do, and never a second component model.appendChild; what onConnect does needs a task. Run the type check, the tests, and look at the page in a browser.Open only what the task needs.
| When you | Read |
|---|---|
| Start a project, set up Vite, TypeScript, JSX, plain JavaScript, or no build step | references/setup.md |
Write a component: refs, useChange, attributes, styles, shadow DOM, slots, the lifecycle in detail | references/components.md |
Write templates: JSX rules, lists, conditions, forms, createElement, toTemplate, VNodes | references/templating.md |
| Connect components: parent and child, events, buses, services | references/communication.md |
Add pages and navigation: routes, links, parameters, query, onRoute, canLeave | references/routing.md |
| Translate the app | references/translations.md |
Render on the server, or with @jadis/fastify | references/server-rendering.md |
| Write tests (Vitest, jsdom, Playwright) | references/testing.md |
| Want a worked example: a list, a form, a page that loads data, a dialog, an app shell | references/recipes.md |
| Need a signature | references/api.md |
| Are new to Jadis, or review code | references/agent-mistakes.md |
version in node_modules/@jadis/core/package.json. Its commented declarations, which work offline: node_modules/@jadis/core/dist/dts/ (base-component.d.ts for the Jadis class, helpers/, router/, translation/, server/).https://raw.githubusercontent.com/bioleyl/jadis/core-v<version>/packages/docs/<section>/<page>.md, the page's path on the site (/routing/routed-pages gives routing/routed-pages.md).npm view @jadis/core version), or do without it.@syware/jlib, jl-* components built on Jadis) also needs the jlib skill.Walk your diff once. Fix every "no", or say why it stays.
innerHTML redraw?useChange callback draw the whole value it gets, with values replaced, not changed in place?onConnect() through this.on(), onBus(), events.register() or the kill signal, with no removeEventListener by hand?onConnect() safe to run again, with this.killSignal given to fetch and this.isConnected checked after an await?observedAttributes declared?register() at the bottom of its module, its children imported before it renders them, and :host given a display?readonly events, and only app-wide messages go through a bus?attrs or hyphenated names where an attribute is meant, and is data written with textContent, never innerHTML?HTMLElement already has?Then report what the pass changed, as <file>:<line> — <what changed>, and end with one line: jadis self-check: 2 fixed or jadis self-check: clean.
A bug in Jadis, or something every app has to work around, is fixed once in Jadis for all apps.
gh issue list --repo bioleyl/jadis --search "…".gh issue create --repo bioleyl/jadis once they agree: the issue is public.references/agent-mistakes.md (opens in a new tab)references/api.md (opens in a new tab)references/communication.md (opens in a new tab)references/components.md (opens in a new tab)references/recipes.md (opens in a new tab)references/routing.md (opens in a new tab)references/server-rendering.md (opens in a new tab)references/setup.md (opens in a new tab)references/templating.md (opens in a new tab)references/testing.md (opens in a new tab)references/translations.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bioleyl/jadis --plugin jadis-officialOther plugins' skills for the same job