Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ Enforced by CI (`.github/workflows/ci.yml`):
- Coverage thresholds from the jest configs: **bulma-ui 99%** (all metrics),
create-bestax 95% (78% branches).
- Stale skill catalog fails (`gen:catalog:check`); build, typecheck, lint, format, audit.
- House conventions fail via `pnpm check:conformance` (error messages name the file and fix);
a **React 18/19 matrix** builds and tests bulma-ui on both majors.

Enforced in review (a green CI does **not** check these):

- Every visible/interactive UI change needs a **Storybook story**.
- Every public API change needs a **docs page update** (`docs/docs/api/...`) before approval.
- Component/prop changes that affect the skills update `skills/` **in the same PR**.
- CI only checks that a story and docs page **exist** per component — prop-level changes still
need both updated, and skill-affecting changes update `skills/` **in the same PR**.
- Run `pnpm all` locally before opening a PR.

## Commits — release-affecting, not cosmetic
Expand Down Expand Up @@ -73,8 +74,9 @@ Full versioning details (breaking-change footers, tag formats): `VERSIONING.md`.
## Workflow

PRs target `main`; direct pushes to `main` are not allowed. Full contributor guide:
`CONTRIBUTING.md`. New components should stay within the Bulma spec — propose anything beyond
it in an issue first.
`CONTRIBUTING.md`; for a new component, `CONTRIBUTING-COMPONENTS.md` is the end-to-end
checklist. New components should stay within the Bulma spec — propose anything beyond it in
an issue first.

AI/LLM surfaces: the docs build publishes an LLM index (see `docs/CLAUDE.md`); the skills are a
shipped product (see `skills/CLAUDE.md`). This file is also read by **CodeRabbit** (PR reviews)
Expand Down
58 changes: 58 additions & 0 deletions CONTRIBUTING-COMPONENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# New component checklist

The definition of complete for adding a component to `@allxsmith/bestax-bulma` — for humans
and AI agents alike. `pnpm check:conformance` and CI enforce most of it; this file is the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm check:conformance does not exist — 🟠 Major · Correctness

What: This checklist and three CLAUDE.md files present pnpm check:conformance as a real, CI-enforced gate, but no such npm script, CI step, or implementing file exists in the repo.

Why it matters: These files are read by humans and AI agents (Claude Action, CodeRabbit). An agent following the checklist runs pnpm check:conformance in §4 → ERR_PNPM_NO_SCRIPT → the "gate" hard-fails on a command that was never added. Worse, the docs assert CI enforces house conventions through it, so a reader believes conventions are checked when nothing checks them.

Evidence
  • Root package.json scripts: only gen:catalog / gen:catalog:check — no check:conformance.
  • grep -rniI conformance (excluding node_modules/.git) matches only the docs being added/edited here — no script or workflow.
  • .github/workflows/ci.yml steps: gen:catalog:check, build, typecheck, test, test:coverage, bundle:stats, lint, format:check, audit, build-storybook, + React 18/19 matrix. No conformance step and no story/docs "existence" check.

Referenced (all currently false):

  • CONTRIBUTING-COMPONENTS.md:4 and :49
  • CLAUDE.md ("House conventions fail via pnpm check:conformance")
  • bulma-ui/CLAUDE.md:31 ("CI's check:conformance enforces")
  • docs/CLAUDE.md:37 ("check:conformance enforces the required sections")

Fix: Either land the check:conformance script + CI step in this PR, or reword every reference to describe it as proposed/not-yet-implemented (and drop the "CI enforces" / "CI only checks that a story and docs page exist" claims until the check is real).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm check:conformance does not exist — 🟠 Major · Correctness

What: This checklist (and three other files in this PR) present pnpm check:conformance as an existing, CI-enforced gate, but there is no such script anywhere in the repo — no check:conformance (or any check*) entry in the root/bulma-ui/docs package.json, no matching turbo.json task, and no CI step. scripts/ contains only gen-component-catalog.mjs.

Why it matters: These files are the machine-followable spec read by AI agents and CodeRabbit (root CLAUDE.md: "keep it accurate"). An agent or contributor who runs pnpm check:conformance gets Command "check:conformance" not found, and the repeated claim that "CI enforce most of it" / "House conventions fail via pnpm check:conformance" is simply false — CI enforces none of these house conventions.

All five references to the phantom script
File Line Text
CONTRIBUTING-COMPONENTS.md 4 "pnpm check:conformance and CI enforce most of it"
CONTRIBUTING-COMPONENTS.md 49 "pnpm check:conformance and pnpm gen:catalog:check"
docs/CLAUDE.md 37 "check:conformance enforces the required sections"
bulma-ui/CLAUDE.md 31 "CI's check:conformance enforces"
root CLAUDE.md (diff) +38 "House conventions fail via pnpm check:conformance"

Fix: Either add the check:conformance script + CI wiring in this PR, or remove/reword every reference to describe only gates that actually exist (pnpm gen:catalog:check, pnpm all, review-time checks). For this line:

Suggested change
and AI agents alike. `pnpm check:conformance` and CI enforce most of it; this file is the
and AI agents alike. `pnpm gen:catalog:check` and CI enforce part of it, and reviewers enforce
the rest; this file is the

full sequence. Conventions live in the folder `CLAUDE.md`s; templates in
`skills/bestax-custom-component/references/library-contributor.md`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken reference: library-contributor.md — 🟡 Minor · Correctness

What: This points readers to skills/bestax-custom-component/references/library-contributor.md for templates, but that file does not exist. The references folder contains api.md, component-catalog.md, and patterns.md — the worked template/example lives in patterns.md (the canonical Dialog walkthrough).

Why it matters: An agent or contributor following this checklist chases a dead path and can't find the templates it promises.

Fix:

Suggested change
`skills/bestax-custom-component/references/library-contributor.md`.
`skills/bestax-custom-component/references/patterns.md`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken template reference — library-contributor.md does not exist — 🟠 Major · Correctness

What: This points readers to skills/bestax-custom-component/references/library-contributor.md for templates, but that file does not exist. The references/ directory contains only api.md, component-catalog.md, and patterns.md.

Why it matters: The first thing this checklist tells an agent/contributor to open for templates is a dead path. The worked-example templates actually live in patterns.md (Dialog reference implementation), which SKILL.md:149 cites as "references/patterns.md for the complete [worked example]".

Fix:

Suggested change
`skills/bestax-custom-component/references/library-contributor.md`.
full sequence. Conventions live in the folder `CLAUDE.md`s; templates in
`skills/bestax-custom-component/references/patterns.md`.


## 0. Classify first — everything below forks on this

| | Stock Bulma (in the Bulma v1 spec) | Extra / "Beyond Bulma" |
| ---------------- | -------------------------------------- | ----------------------------------------------------------------- |
| Prerequisite | — | Issue discussion first (component proposal) |
| SCSS | **None** — Bulma provides the CSS | Partial required (register-vars pattern) |
| Homepage listing | `docs/src/data/componentCategories.js` | `docs/src/components/EnhancedAddons/index.js` + SVG in `icons.js` |

Before building anything: scan `skills/bestax-custom-component/references/component-catalog.md`
for an existing component or synonym. If one fits, use or extend it.

## 1. The artifacts

- [ ] `bulma-ui/src/<folder>/Foo.tsx` — helper props via `useBulmaClasses`, own classes via
`usePrefixedClassNames`, spread `rest`
- [ ] `bulma-ui/src/<folder>/__tests__/Foo.test.tsx` — 99% all metrics; must include a
`ConfigProvider classPrefix` test (pattern: `Reveal.test.tsx`)
- [ ] `bulma-ui/src/<folder>/Foo.stories.tsx` — import types from `@storybook/react-vite`;
`tags: ['autodocs']`; a `description` on every argType; no inline `style={{}}`
- [ ] _(extras only)_ `bulma-ui/src/scss/<folder>/_foo.scss` + `@use 'foo';` in that folder's
`_index.scss` — see `bulma-ui/src/scss/CLAUDE.md`
- [ ] `docs/docs/api/<folder>/foo.md` — mirror `docs/docs/api/components/avatar.md`;
frontmatter `title:` = the exact exported name (the catalog generator parses it)
- [ ] Export in `bulma-ui/src/index.ts`, then `pnpm gen:catalog`

## 2. Listing surfaces (the step everyone misses)

- [ ] `### Foo` section on the category guide page (`docs/docs/guides/library/components.md`
or `form.md`) — one prose sentence + a `tsx live` example
- [ ] Homepage: **exactly one** surface per the table above — never both. Plural group
containers (`Avatars`) are not listed as cards; the guide page lists them.

## 3. Skills sync (same PR, always)

- [ ] Themeable (SCSS partial or color/size props)? Add rows to
`skills/bestax-theming/references/themeable-components.md` and its new `--bulma-*` vars
to `css-variables.md`
- [ ] Changed shared helper props? Update `skills/bestax-custom-component/references/api.md`

## 4. Gates

- [ ] `pnpm check:conformance` and `pnpm gen:catalog:check`
- [ ] `pnpm all` (build, typecheck, test+coverage, bundle:stats, lint, format, storybook build)
- [ ] Works on **React 18 and 19** — CI runs both majors; avoid single-major APIs
- [ ] Visually inspect every variant in Storybook, light and dark mode

## 5. Before opening the PR

- [ ] Re-read your full diff against this checklist — each miss a reviewer catches costs a
review round
- [ ] Conventional commit with scope: `feat(bulma-ui): add Foo`
8 changes: 8 additions & 0 deletions bulma-ui/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ A new or changed component is **five artifacts, not one**. Touch all of:

…then run `pnpm gen:catalog` (CI's `gen:catalog:check` fails if the skill catalog is stale).
If the change invalidates guidance in `skills/`, update the skill in the same PR.
For a **new** component, `/CONTRIBUTING-COMPONENTS.md` is the complete checklist — it adds the
docs listing surfaces and skills sync that CI's `check:conformance` enforces.

The full worked walkthrough (including the SCSS side for extras) is
`skills/bestax-custom-component/SKILL.md` — follow it rather than improvising.
Expand All @@ -42,5 +44,11 @@ The full worked walkthrough (including the SCSS side for extras) is
widget) need an issue discussion first, and pair with SCSS in `src/scss/`.
- Tests: jest + ts-jest + Testing Library, in each folder's `__tests__/`. Run one file with
`pnpm --filter @allxsmith/bestax-bulma exec jest src/elements/__tests__/Button.test.tsx`.
The 99% bar is reachable with the techniques in `src/components/__tests__/Reveal.test.tsx`
(IntersectionObserver/matchMedia mocks, SSR via `renderToStaticMarkup`).
- Stories: types from `@storybook/react-vite`; `tags: ['autodocs']`; every argType gets a
`description` (meta-test enforced). No inline `style={{}}` in stories/docs examples — helper
props (no `gap` helper — space with `m*`/`p*`); legacy inline styles exist, don't copy them.
- Must build and pass tests on **React 18 and 19** (CI matrix) — avoid single-major APIs.
- Bundle size is marketing-visible (the READMEs link the live bundlephobia badge) — check `pnpm bundle:stats`
(writes `dist/stats.html`) when adding anything with real runtime weight.
7 changes: 6 additions & 1 deletion bulma-ui/src/scss/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ Rules the pattern encodes:
- **Never a raw color/size value** in declarations — derive from Bulma tokens via `cv.getVar()`
so the extra is themeable exactly like stock Bulma (`--bulma-collapse-border-color: …`).
This is the contract the `Theme` component and the `bestax-theming` skill rely on.
- **Register every themable value** — durations, offsets, and insets included, not just colors.
Prefer an existing Bulma token (`cv.getVar('radius-rounded')`, never `9999px`); dark mode
works only through scheme tokens (`scheme-main`, `text`, `border`) — a hardcoded grey is a
dark-mode bug.
- **Reuse `extras-*` mixins** for transitions, focus outlines, and screen-reader-only content
instead of re-rolling them (focus style consistency is an a11y requirement).
- New CSS variables should be documented in
`skills/bestax-theming/references/css-variables.md` alongside the docs page.
`skills/bestax-theming/references/css-variables.md`, and the component's rows added to
`skills/bestax-theming/references/themeable-components.md`, in the same PR.
7 changes: 5 additions & 2 deletions docs/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ it, so a novel non-standard `package.json` key and extra release churn weren't w

## Conventions

- Pages carry frontmatter (`title`, `sidebar_position`); API pages use consistent sections
(props table, examples) — mirror a sibling page, don't invent a new structure.
- API pages mirror `docs/api/components/avatar.md` (the house exemplar), not older siblings;
`check:conformance` enforces the required sections. Frontmatter `title:` = the exported
name, and the first `## Overview` sentence becomes its catalog one-liner (`gen:catalog`).
- No inline `style={{}}` in examples — use `Block`/helper props; there is no `gap` helper,
space children with `m*`/`p*`.
- Code examples must compile against the current library API; when a component changes, its
docs page changes in the same PR (CONTRIBUTING requires docs before approval).
- Markdown is prettier-formatted (`pnpm format:check` covers `md`/`mdx`).
Loading