antfu
यह क्या करती है
यह स्किल आपके AI को JavaScript और TypeScript प्रोजेक्ट के लिए कोडिंग आदतें और टूलिंग के चुनाव देती है। यह उन डेवलपरों के लिए है जो नए प्रोजेक्ट साफ़ और एकसमान ढंग से सेट करना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप नया TypeScript प्रोजेक्ट शुरू करते हैं और साफ़, मानक सेटअप चाहते हैं।
- ✓जब आप चाहते हैं कि कोड साफ़ फ़ाइलों में बँटे और टाइप अलग रखे जाएँ।
- ✓जब आपको लिंटिंग, प्रकाशन या मोनोरेपो के लिए टूल चुनने में मदद चाहिए।
Skill का लिंक
https://github.com/antfu/skills/blob/main/skills/antfu/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“साफ़ और आधुनिक परंपराओं का उपयोग करते हुए नया TypeScript लाइब्रेरी प्रोजेक्ट सेट कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट फ़ाइल लेआउट, टाइप के उपयोग, रनटाइम नोट्स और टूलिंग पर लिखित मार्गदर्शन का पालन करता है, और एक संदर्भ स्टार्टर प्रोजेक्ट को मॉडल के रूप में इस्तेमाल करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Reference template: antfu/starter-ts. When scaffolding a new TypeScript project, mirror its
package.jsonscripts,eslint.config.js,knip.json,tsdown.config.tsand workflows rather than inventing a new layout.
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 browser
TypeScript
- Explicit return types: Declare return types explicitly when possible
- Avoid complex inline types: Extract complex types into dedicated
typeorinterfacedeclarations
Explicitness
Favor explicit, traceable code over implicit "magic". A reader (human or agent) should be able to follow where every name comes from without running tooling.
- Explicit imports: Prefer explicit
importstatements. Avoid auto-imports — when a framework provides them (e.g. Nuxt/Nitro), turn them off for new projects (see app-development). - No path aliases by default: Use relative imports (
./foo,../bar). Only use path aliases (@/,~/,#imports, etc.) when they are already configured in the project; don't introduce new ones for greenfield code.
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) |
Checking npm Package Versions
Use fast-npm-meta to look up the latest version of a package — it queries a small metadata endpoint instead of downloading the full registry payload (which can be megabytes per package).
nlx fast-npm-meta version vite # 7.3.1
nlx fast-npm-meta version "nuxt@^3.5" # 3.5.22 — range-aware
nlx fast-npm-meta version vite nuxt vue # multiple at once
nlx fast-npm-meta version vite --json # JSON for scripting
nlx fast-npm-meta full vite # full version list + dist-tags
Prefer this over npm view <pkg> version when you only need the latest version, and over reading package.json from the registry directly.
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.js
import antfu from '@antfu/eslint-config'
export default antfu({
type: 'lib', // or 'app' (default)
pnpm: true, // enforce pnpm catalogs in package.json
antislop: true, // flag redundant/duplicated AI-style code, ban explicit `any`
})
Always enable antislop: true. It requires eslint-plugin-slop and eslint-plugin-sonarjs as dev dependencies.
For detailed configuration options: antfu-eslint-config
Knip
Use Knip to catch unused files, exports and dependencies — the linter only sees one file at a time.
// knip.json
{
"$schema": "https://unpkg.com/knip@6/schema.json",
"project": ["src/**/*.ts"],
"ignoreDependencies": []
}
Fix what Knip reports by deleting; only add to ignoreDependencies for tools invoked outside `p
अक्सर पूछे जाने वाले सवाल
क्या यह केवल Anthony Fu के प्रोजेक्ट के लिए है?
नहीं। यह परंपराओं का एक सेट है, जिसे कोई भी JavaScript और TypeScript प्रोजेक्ट पर लागू कर सकता है।
क्या यह ब्राउज़र और सर्वर कोड दोनों के लिए काम करती है?
हाँ। यह Node, ब्राउज़र और workers पर चलने वाले कोड को तरजीह देती है, और जो फ़ाइलें केवल एक जगह चलती हैं उन्हें चिह्नित करती है।
क्या यह लाइब्रेरी प्रकाशन को कवर करती है?
हाँ। यह लाइब्रेरी प्रकाशित करने और मोनोरेपो सेट करने को कवर करती है।
जानकारी
लेखक का मूल विवरण
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.
repo: antfu/skills
लोकप्रियता
- GitHub स्टार
- 6.0k
- रैंकिंग में स्थान
- #14439
- लाइसेंस
- MIT
- अपडेट की गई
- 30/10/2026
कमेंट
- …
इस repository की और skills
antfu-create-pr
6.0kआपके एजेंट को आपकी ब्रांच से GitHub पर साफ़ pull request खोलने में मदद करती है, जिसमें बदला गया और कारण का सरल सारांश होता है।
antfu-issue-triage
6.0kआपके एजेंट को खुले GitHub इश्यू और pull request छाँटने में मदद करती है, डुप्लिकेट और पहले से ठीक हो चुके आइटम पहचानकर, और कार्रवाई से पहले आपसे पूछकर।
antfu-query
6.0kआपके एजेंट को किसी योजना या विचार पर एक-एक करके सवाल पूछने देती है, जब तक आप दोनों एक स्पष्ट और परखी हुई समझ पर न पहुँच जाएँ।
antfu-simplify
6.0kआपके एजेंट को आपके कोड बदलावों को सबसे छोटे सही रूप में घटाने में मदद करती है, जिसमें जो ज़रूरी नहीं है उसे हटाया जाता है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।