antfu

antfu is a skill for Claude Code from pleaseai/claude-code-plugins. It costs 52 tokens per session (1,330 once invoked), scanned A, a copy of antfu, MIT.

A set of coding conventions associated with Anthony Fu for JavaScript and TypeScript projects. It covers code organization, runtime-neutral code, explicit types and imports, project setup, and monorepos, which are repositories containing several related packages or applications.

In plain words
What is it for?
Use it when setting up JavaScript or TypeScript projects, configuring linting or formatting alternatives, organizing monorepos, publishing libraries, or following Anthony Fu's preferences.
Why use it?
It helps teams make project structure and coding choices consistently, especially when setting up a new project or maintaining several packages together. The conventions favor code that is easy to trace and understand.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: installed under .agents/ (shared by several agents).

Part of the antfu plugin — 1 skill shipped together

Good fit Use it when setting up JavaScript or TypeScript projects, configuring linting or formatting alternatives, organizing monorepos, publishing libraries, or following Anthony Fu's preferences.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pleaseai/claude-code-plugins/antfu
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add pleaseai/claude-code-plugins --skill antfu
Clone the repo
git clone --depth 1 https://github.com/pleaseai/claude-code-plugins

Made for: Claude Code.

Or install antfu, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for antfu

README.md
[![agentmods](https://agentmods.dev/badge/skills/pleaseai/claude-code-plugins/antfu/github.svg)](https://agentmods.dev/skills/pleaseai/claude-code-plugins/antfu)
Your own site
<a href="https://agentmods.dev/skills/pleaseai/claude-code-plugins/antfu"><img src="https://agentmods.dev/badge/skills/pleaseai/claude-code-plugins/antfu/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for antfu

Your own site · 80×15
<a href="https://agentmods.dev/skills/pleaseai/claude-code-plugins/antfu"><img src="https://agentmods.dev/badge/skills/pleaseai/claude-code-plugins/antfu.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,330 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01330
Opus 5.5 $0.00021 $0.00532
Sonnet 5.5 $0.00010 $0.00266
Haiku 4.5 $0.00005 $0.00133

Measured 1mo ago against content hash 22f8a4129da8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

antfu scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to antfu — 77 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/antfu/.agents/skills/antfu/SKILL.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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)

Read the full file on GitHub · 152 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 152 lines · 52 tokens per session scan A 22f8a4129da8

Subscribe to this mod's changes

antfu is a skill published in the GitHub repository pleaseai/claude-code-plugins (16 stars, last pushed 5d ago), licensed MIT. It adds 52 tokens to every session and 1,330 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to antfu, differing in 77 lines, and is treated as a copy.

Related

Other skills, from other repositories

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

aws-sst-development

SST v4 (Ion) expert for managing AWS resources as code with the Pulumi-backed framework.

sickn33/agentic-awesome-skills · 26 tokens

league-akari-shard-development

Use when creating, extending, refactoring, splitting, or reviewing League Akari main or renderer shards, including shard file organization, controller/loader/executor/handler boundaries, naming conventions, renderer TSX usage, platform guards, and public contract compatibility.

LeagueAkari/LeagueAkari · 58 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

fast-typescript-check

Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…

internet-development/www-sacred · 84 tokens

typescript-magician

Designs complex generic types, refactors any types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing any types, strict typing, type errors, infer, extends…

mcollina/skills · 108 tokens