antfu
Skill21 starsChanged 10 months agoMITView on GitHub
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.
- Installs packages
6 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- antfu/skillsedited, first seen Sep 30, 2026
- wutongyuonce/skillsedited, first seen Sep 25, 2026
- ElyzeSolutions/skillsedited, first seen Aug 6, 2026
- reformovo/skillsedited, first seen Jun 24, 2026
- JetBrains/skillsedited, first seen Apr 28, 2026
- huangzida/skillsword for word, first seen Apr 4, 2026
Other versions6 projects use a version of this.
Word for word · 1
- huangzida/skills★ 2100% same
Edited · 5
- antfu/skills★ 5.9k37% same
- JetBrains/skills★ 36094% same
- wutongyuonce/skills★ 266% same
- ElyzeSolutions/skills★ 166% same
- reformovo/skills★ 166% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- build-toolingSkill
- designSkill
- find-skillsSkill
- nuxtSkill
- vitepressSkill
- vue-a11ySkill
- vue-clean-componentsSkill
- vue-dataSkill
- vue-formsSkill
- vue-performanceSkill
- vueSkill
The file
We split this skill into the rules it gives an agent
10 rules. 3 are common, 0 are distinctive, and 7 are very specific to this project.
3
Common
Most of the 5 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Type separation: Always separate types and interfaces into types.ts or types/*.ts
- Common: line 20
Prefer isomorphic code: Write runtime-agnostic code that works in Node, browser, and workers whenever possible
- Common: line 21
Clear runtime indicators: When code is environment-specific, add a comment at the top of the file:
- Very specific: line 40
Test files: foo.ts → foo.test.ts (same directory)
- Very specific: line 41
Use describe/it API (not test)
- Very specific: line 42
Use toMatchSnapshot for complex outputs
- Very specific: line 43
Use toMatchFileSnapshot with explicit path for language-specific snapshots
- Very specific: line 89
When completing tasks, run pnpm run lint --fix to format the code and fix coding style.
- Very specific: line 109
Use named catalogs in pnpm-workspace.yaml for version management:
- Common: line 118
Avoid the default catalog.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Coding Practices
Code Organization
- Single responsibility: Each source file should have a clear, focused scope/purpose
- Split large files: Break files when they become large or handle too many concerns
- Type separation: Always separate types and interfaces into
types.tsortypes/*.ts - Constants extraction: Move constants to a dedicated
constants.tsfile
Runtime Environment
- Prefer isomorphic code: Write runtime-agnostic code that works in Node, browser, and workers whenever possible
- Clear runtime indicators: When code is environment-specific, add a comment at the top of the file:
// @env node
// @env browserTypeScript
- Explicit return types: Declare return types explicitly when possible
- Avoid complex inline types: Extract complex types into dedicated
typeorinterfacedeclarations
Comments
- Avoid unnecessary comments: Code should be self-explanatory
- Explain "why" not "how": Comments should describe the reasoning or intent, not what the code does
Testing (Vitest)
- Test files:
foo.ts→foo.test.ts(same directory) - Use
describe/itAPI (nottest) - Use
toMatchSnapshotfor complex outputs - Use
toMatchFileSnapshotwith explicit path for language-specific snapshots
Tooling Choices
@antfu/ni Commands
| 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) |
TypeScript Config
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
}
}ESLint Setup
// 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
Git Hooks
{
"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"
}
}pnpm Catalogs
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.
References
| 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 |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

