.cursor/skills/antfu/SKILL.md
Anthony Fu's opinionated tooling and conventions for JavaScript/TypeScript projects. Use when setting up new projects, configuring ESLint/Prettier alternatives, monorepos, library publishing, or when the user mentions Anthony Fu's preferences.
npx skillsauth add victorgarciaesgi/regle antfuInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
types.ts or types/*.tsconstants.ts file// @env node
// @env browser
type or interface declarationsfoo.ts → foo.test.ts (same directory)describe/it API (not test)toMatchSnapshot for complex outputstoMatchFileSnapshot with explicit path for language-specific snapshots| Command | Description |
|---------|-------------|
| ni | Install dependencies |
| ni <pkg> / ni -D <pkg> | Add dependency / dev dependency |
| nr <script> | Run script |
| nu | Upgrade dependencies |
| nun <pkg> | Uninstall dependency |
| nci | Clean install (pnpm i --frozen-lockfile) |
| nlx <pkg> | Execute package (npx) |
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
}
// eslint.config.mjs
import antfu from '@antfu/eslint-config'
export default antfu()
When completing tasks, run pnpm run lint --fix to format the code and fix coding style.
For detailed configuration options: antfu-eslint-config
{
"simple-git-hooks": {
"pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
},
"lint-staged": { "*": "eslint --fix" },
"scripts": {
"prepare": "npx simple-git-hooks"
}
}
Use named catalogs in pnpm-workspace.yaml for version management:
| Catalog | Purpose |
|---------|---------|
| prod | Production dependencies |
| inlined | Bundler-inlined dependencies |
| dev | Dev tools (linter, bundler, testing) |
| frontend | Frontend libraries |
Avoid the default catalog. Catalog names can be adjusted per project needs.
| Topic | Description | Reference | |-------|-------------|-----------| | ESLint Config | Framework support, formatters, rule overrides, VS Code settings | antfu-eslint-config | | Project Setup | .gitignore, GitHub Actions, VS Code extensions | setting-up | | App Development | Vue/Nuxt/UnoCSS conventions and patterns | app-development | | Library Development | tsdown bundling, pure ESM publishing | library-development | | Monorepo | pnpm workspaces, centralized alias, Turborepo | monorepo |
development
Validate Regle forms with schema libraries via `@regle/schemas` — Zod, Valibot, ArkType, and any Standard Schema spec library using `useRegleSchema`, `useRules`, `refineRules`, and `InferInput`. Use when a form's validation is defined by an external schema instead of `@regle/rules`. For native rules see regle-rules; for form setup see regle.
tools
Regle validation rules — built-in rules from `@regle/rules`, custom rules with `createRule`, rule wrappers (`withMessage`, `withParams`, `withAsync`, `withTooltip`), and rule operators (`and`, `or`, `xor`, `not`, `applyIf`, `assignIf`, `pipe`). Use when declaring, customizing, composing, or conditionally applying validation rules in a Regle form. For form setup see regle.
data-ai
Migrate Vuelidate form validation to Regle. Use when porting forms that import from `@vuelidate/core`/`@vuelidate/validators` or call `useVuelidate` over to `useRegle`/`useScopedRegle`, including rules, validation properties, `v-model` bindings, nested/scoped validation, and parent-child form propagation.
development
Core Regle form validation in Vue 3 — setup with `useRegle`, the reactive `r$` object, validation properties, displaying errors, and modifiers. Use when adding or editing Regle forms, binding `v-model` to `r$.$value`, or reading `$error`/`$errors`/`$invalid`/`$validate`/`$reset`. For validation rules see regle-rules; for advanced patterns see regle-advanced.