/frontend:validate-file [files]from frontend
Validates edited files by linting .svelte/.ts/.js, testing stories, and linting markdown. Auto-runs after every file edit before declaring done.
Ships in frontend. 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.
Run the correct validation for every file you edited OR have been prompted to review. No exceptions.
Before and during validation, apply the rules from these skills:
frontend:code-style: applies to ALL files (variable naming, braces, data attributes)svelte-5:code-style-svelte: applies to .svelte and .svelte.ts/.svelte.js filesfrontend:comments: applies to every comment you added, changed or deleted, and protects the existing comments in the files you editedfrontend:editing: applies to every edit (types, lint and TypeScript directives, refactors)any. Type it properly. If the type doesn't
exist, create a local type or import the right onefrontend:editing lists outside its rule.
Bare disables are cheating.After EVERY file edit. Not at the end of a batch, after EACH edit. If you edited 3 files, you validate 3 times (or group by tool).
To lint the .ts, .js and .svelte files currently staged in git, use pnpm lint:staged; it lints each staged file's working-tree content (unstaged edits included) and skips staged files outside the directory of the package.json that defines the script (in a monorepo package, files staged elsewhere in the repo). It runs only the lint:file chain documented below (its notes and the type-check caveats apply) and skips other file types (.md included), so, depending on what is staged, also run:
.test.ts files: pnpm lint:tests.stories.svelte files: pnpm test:story <Pattern> (<Pattern>: a Vitest file filter, story-loop).tsx, .mts, .mjs, .jsx and other JS/TS files: pnpm lint:file <path>.md, .yml and other types: the table below (lint:file runs no step on them and still reports a pass)To also include commits ahead of the upstream branch (or, when no upstream is set, commits not on any remote-tracking ref), use pnpm lint:staged --committed, for example right before pushing. With no upstream and no remote-tracking refs (no remote, or one never fetched), it skips the committed scan with a warning and lints the staged files only.
| File type | Command | Notes |
|---|---|---|
.svelte, .ts/.tsx/.mts/.cts (*.e2e.ts and *.spec.ts test files included), .js/.jsx/.mjs/.cjs | pnpm lint:file <path> [path2...] | Runs eslint + knip, oxlint for JS and TS files, plus svelte-check when the list holds a .svelte file, otherwise tsgo for TypeScript files (type-check caveats below) |
.stories.svelte | pnpm lint:file <path> AND pnpm test:story <Pattern> | Run both |
.test.ts | pnpm lint:tests | Lints the files matching TEST_GLOBS (src/**/*.test.ts and tests/**/*.test.ts by default); needs knip.tests.jsonc and tsconfig.tests.json (SETUP.md, repo root). *.e2e.ts, *.spec.ts and test files outside TEST_GLOBS: see below |
.md | pnpm exec markdownlint <path> (markdownlint-cli installed per SETUP.md; without it, pnpm dlx markdownlint-cli <path>) | Fix all errors before declaring done |
.yml/.yaml (CI) | Simulate with CI=true GITHUB_ACTIONS=true locally | Never guess at CI behavior |
vite.config.ts | create-vite Svelte template: pnpm exec tsgo -p tsconfig.node.json --noEmit (tsgo from @typescript/native-preview); SvelteKit: pnpm check | The create-vite Svelte template types vite.config.ts through tsconfig.node.json: svelte-check with tsconfig.app.json skips that file; the template's check script runs tsc -p tsconfig.node.json for it. On SvelteKit, the sv create tsconfig include lists vite.config.ts, so pnpm check reads it |
Lint *.e2e.ts and *.spec.ts test files, and any test file outside the TEST_GLOBS patterns, with pnpm lint:file. When TEST_GLOBS lists *.e2e.ts or *.spec.ts patterns, lint:tests runs oxlint and eslint on those files, but its svelte-check step fails only on .test.ts names (SETUP.md).
lint:file's type checks read the root tsconfig.json (svelte-check unless TSCONFIG_PATH names another file, tsgo always) and report ✓ without checking a file in these cases:
.svelte file) always reports ✓, and the svelte-check step (lists with a .svelte file) does too unless SVELTE_CHECK_FLAGS drops --tsgo. Install @typescript/native-preview; SVELTE_CHECK_FLAGS="--threshold error" fixes only the svelte-check step (how: SETUP.md §4)include of the tsconfig the step reads (e.g. a Playwright folder the include does not list): add that folder to that include list, keeping its other entries"files": [] and references (the create-vite Svelte template): set TSCONFIG_PATH=./tsconfig.app.json for svelte-check (how: SETUP.md §4), and check TypeScript files with pnpm exec tsgo --noEmit -p tsconfig.app.json (vite.config.ts: -p tsconfig.node.json, table row above)frontend:playwright + frontend:pixel-perfectAny edit that touches styles, .css, .scss, or <style> blocks
in .svelte files, requires visual regression verification via
the frontend:playwright and frontend:pixel-perfect skills. Lint alone cannot
catch visual regressions. Measure BEFORE, apply change, measure
AFTER, report a diff table with zero tolerance.
For a component + story pair, follow the exact loop in story-loop before moving to the next file. It also has command examples.
If you modify a shared component (context wrapper, utility component, store, type file, or anything imported by multiple consumers), you MUST verify no regressions across ALL consumers:
pnpm test:storybook: all storybook testspnpm test:unit: all unit/browser testsA change to a shared wrapper, type, or store can silently break every consumer, not just the story you're working on.
If invoked with <args>, validate those files.
If invoked without arguments:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fubits1/svelte-skills --plugin frontend13 skills in this plugin
/code-styleCode style rules for all languages: variable naming, brace style, HTML data attributes, markup, forms and locale formatting, CSS nesting. Auto-invoke when editing code files, writing new functions or markup, or naming variables./code-style-cssUse when editing CSS, SCSS, or style blocks in .svelte files. Covers CSS-specific code style rules. Auto-invoke when writing or modifying styles./commentsComment rules for every language: which comments survive, format, protected comments, placement, TODOs. Use when writing, editing, moving or deleting comments, docstrings or TODOs. Auto-invoke when editing code files./css-nestingConvert flat CSS to nested & syntax while satisfying stylelint's no-descending-specificity and no-duplicate-selectors rules. Use when nesting selectors, refactoring flat CSS to &, or fixing stylelint specificity/duplicate errors after nesting./css-subgridUse when building card grids, tile layouts, or repeated components where inner content (icons, titles, prices, buttons) must align across siblings. Also use when seeing misaligned card content at different text lengths./editingFile editing discipline: correct types, safe refactors, Svelte file rules, config overrides, markdown lint, visual refactors. Requires frontend:code-style and frontend:comments. Auto-invoke when editing code files.Other plugins' skills for the same job