मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग6.0k · #14439

antfu

यह क्या करती है

यह स्किल आपके AI को JavaScript और TypeScript प्रोजेक्ट के लिए कोडिंग आदतें और टूलिंग के चुनाव देती है। यह उन डेवलपरों के लिए है जो नए प्रोजेक्ट साफ़ और एकसमान ढंग से सेट करना चाहते हैं।

कब इस्तेमाल करें

  • ✓जब आप नया TypeScript प्रोजेक्ट शुरू करते हैं और साफ़, मानक सेटअप चाहते हैं।
  • ✓जब आप चाहते हैं कि कोड साफ़ फ़ाइलों में बँटे और टाइप अलग रखे जाएँ।
  • ✓जब आपको लिंटिंग, प्रकाशन या मोनोरेपो के लिए टूल चुनने में मदद चाहिए।

Skill का लिंक

https://github.com/antfu/skills/blob/main/skills/antfu/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/antfu/skills/blob/main/skills/antfu/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“साफ़ और आधुनिक परंपराओं का उपयोग करते हुए नया TypeScript लाइब्रेरी प्रोजेक्ट सेट कीजिए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट फ़ाइल लेआउट, टाइप के उपयोग, रनटाइम नोट्स और टूलिंग पर लिखित मार्गदर्शन का पालन करता है, और एक संदर्भ स्टार्टर प्रोजेक्ट को मॉडल के रूप में इस्तेमाल करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Reference template: antfu/starter-ts. When scaffolding a new TypeScript project, mirror its package.json scripts, eslint.config.js, knip.json, tsdown.config.ts and 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.ts or types/*.ts
  • Constants extraction: Move constants to a dedicated constants.ts file

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 type or interface declarations

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 import statements. 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/it API (not test)
  • Use toMatchSnapshot for complex outputs
  • Use toMatchFileSnapshot with 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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस 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