From 3b8e877abf5424b405a7ab6502b837b6e57ba9b6 Mon Sep 17 00:00:00 2001 From: HerbertJulio Date: Mon, 6 Jul 2026 16:28:55 -0300 Subject: [PATCH 1/2] [NO-ISSUE] fix(guardrails): repair enforce-component-create gate + broken tokens.md links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enforce-component-create.mjs called skillReferencedInTranscript (undefined; the function is pipelineReferencedInTranscript) → it threw and failed open, so the 'run the spec pipeline first' gate never blocked. Also repoint the dangling ./tokens.md links in no-invention/migration/ dependencies to the real catalog doc (.claude/docs/DESIGN.md § Animations). --- .claude/hooks/enforce-component-create.mjs | 2 +- .claude/rules/dependencies.md | 2 +- .claude/rules/migration.md | 4 ++-- .claude/rules/no-invention.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.claude/hooks/enforce-component-create.mjs b/.claude/hooks/enforce-component-create.mjs index e64498bba..ef5ef751e 100644 --- a/.claude/hooks/enforce-component-create.mjs +++ b/.claude/hooks/enforce-component-create.mjs @@ -88,7 +88,7 @@ async function main() { // edit-via-Write — let it pass (validate-tokens.mjs still applies). if (existsSync(filePath) && !fileIsRecent(filePath)) process.exit(0) - if (skillReferencedInTranscript(input.transcript_path)) process.exit(0) + if (pipelineReferencedInTranscript(input.transcript_path)) process.exit(0) const msg = [ `Component-create gate: blocked Write to ${relPath}`, diff --git a/.claude/rules/dependencies.md b/.claude/rules/dependencies.md index c1a410bcf..d68bd2faa 100644 --- a/.claude/rules/dependencies.md +++ b/.claude/rules/dependencies.md @@ -58,7 +58,7 @@ Use Vue `` when the overlay must escape an `overflow: hidden ``` -The catalog is in [`.claude/docs/DESIGN.md`](./tokens.md#animations--semanticanimationsjs). +The catalog is in [`.claude/docs/DESIGN.md`](../docs/DESIGN.md#animations--semanticanimationsjs). ## Hook coverage diff --git a/.claude/rules/migration.md b/.claude/rules/migration.md index f9e62e1c3..b191cc3ba 100644 --- a/.claude/rules/migration.md +++ b/.claude/rules/migration.md @@ -18,9 +18,9 @@ When importing a component, pattern, or any artifact from **outside** this codeb | Source | events may be camelCase (`onValueChange`) | Always kebab-case (`update:value`, `value-change`). | | Source | boolean props may have `is`/`has` prefixes | No prefix (`disabled`, `loading`, `open`). | | Source | `class` declared in `defineProps` | Never. Use `useAttrs()` + `rootClasses` merging `attrs.class`. | -| Source | Inline `@keyframes` or animation library | Only the semantic utilities catalogued in [`tokens.md`](./tokens.md#animations--semanticanimationsjs). No animation lib (see [`dependencies.md`](./dependencies.md)). | +| Source | Inline `@keyframes` or animation library | Only the semantic utilities catalogued in [`DESIGN.md`](../docs/DESIGN.md#animations--semanticanimationsjs). No animation lib (see [`dependencies.md`](./dependencies.md)). | | Source | `@floating-ui/vue` for positioning | CSS only (anchor positioning, Popover API, `` + `position: fixed`). | -| Source | Their tokens (`#fff`, `--brand-50`, `text-blue-600`) | Our tokens (`var(--bg-canvas)`, `var(--primary)`, `text-button-lg`). Catalog: [`tokens.md`](./tokens.md). | +| Source | Their tokens (`#fff`, `--brand-50`, `text-blue-600`) | Our tokens (`var(--bg-canvas)`, `var(--primary)`, `text-button-lg`). Catalog: [`DESIGN.md`](../docs/DESIGN.md). | ### When migrating from Figma diff --git a/.claude/rules/no-invention.md b/.claude/rules/no-invention.md index 2aaf60f92..9054db5a6 100644 --- a/.claude/rules/no-invention.md +++ b/.claude/rules/no-invention.md @@ -13,7 +13,7 @@ You are a transcriber, not an author. The spec at `.specs/.md` is the cont 7. **Do not edit files outside the paths your task names.** 8. **Do not bring artifacts from outside this codebase as-is.** Migrating from another design system, Figma, Base UI/Reka UI/Radix/shadcn/PrimeVue examples, a previous repo, or any inherited `CONTRACT.md`/`README.md` requires **rewriting** to our conventions. See [`migration.md`](./migration.md). 9. **Do not introduce external libs for positioning or animation.** No `floating-ui`, `popper.js`, `tippy`, `gsap`, `framer-motion`, `motion`, `@vueuse/motion`, `@formkit/auto-animate`, drag-drop runtimes, scroll virtualization. Use CSS + tokens + Vue primitives. Catalog: [`dependencies.md`](./dependencies.md). -10. **Do not improvise animations.** Every `animate-*` / `transition-*` class comes from the catalog. Every motion-bearing class pairs with `motion-reduce:*`. No component-local `@keyframes`. See [`tokens.md`](./tokens.md#animations--semanticanimationsjs). +10. **Do not improvise animations.** Every `animate-*` / `transition-*` class comes from the catalog. Every motion-bearing class pairs with `motion-reduce:*`. No component-local `@keyframes`. See [`DESIGN.md`](../docs/DESIGN.md#animations--semanticanimationsjs). 11. **Do not add Figma references to Storybook stories.** No `parameters.design`, no `parameters.figma`, no Figma URLs in `docs.description.component`, no addon-designs links. The story documents the **component API and behavior**; the Figma file documents the design. They stay separate. See [`.claude/docs/COMPONENT_REQUIREMENTS.md`](../docs/COMPONENT_REQUIREMENTS.md) § 13.x. 12. **Do not create CSS class presets in JavaScript** (`const kindClasses = {...}`, `const sharedClasses = [...]`, `const sizeClasses = {...}`, `const rootClasses = computed(...)` that only composes classes). Variants live on `data-*` attributes; styles live as Tailwind utilities on the root element's `class` attribute. No `