Antfu Coding Style

Opinionated coding style and tooling preferences by Anthony Fu.

514 stars 146 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI --skill antfu-coding-style
Manual install
git clone --depth 1 https://github.com/Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI.git /tmp/Agent-Skills-4-Vibe-Coding-CLI
mkdir -p ~/.claude/skills
cp -r /tmp/Agent-Skills-4-Vibe-Coding-CLI/.agent/skills/antfu-coding-style ~/.claude/skills/antfu-coding-style

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Antfu Coding Style & Philosophy

> **Goal**: Maximal Developer Experience (DX) through minimalism and smart defaults. "Works out of the box."

## 1. Code Organization

- **Single Responsibility**: Keep files small. If you scroll too much, split it.
- **Export**: Use Named Exports for libraries, Default Exports for components.
- **Constants**: Extract magic strings/numbers to `constants.ts`.

## 2. TypeScript Preferences

- **Implicit over Explicit**: Let TS infer types when obvious.
    - *Bad*: `const count: number = 0`
    - *Good*: `const count = 0`
- **Return Types**: Explicitly type return values for library limits (public API), infer for internal functions.
- **No Enums**: Use `const assertion` object or String Unions.
    - `type Mode = 'dark' | 'light'` > `enum Mode { ... }`

## 3. Tooling Stack

- **Package Manager**: `pnpm` (Fast, disk efficient).
- **Runner**: `ni` (NPM/Yarn/PNPM/Bun Agnostic runner).
    - `ni` -> install
    - `nr dev` -> run dev
    - `nu` -> upgrade
- **Testing**: `Vitest` (Fast, Jest compatible, Native ESM).
    - Naming: `*.test.ts`.
    - Verification: Use `toMatchSnapshot()` sparingly, prefer `toMatchInlineSnapshot()`.

## 4. CSS / Styling

- **UnoCSS**: Atomic CSS engine.
- **Attributify**: Use attributes for styles to keep clean class strings.
    - `<div text="red 4xl" hover="text-blue">` (Controversial but preferred by Antfu for clean template).

## 5. Vue.js Specifics

- **Script Setup**: `<script setup lang="ts">`.
Read the full skill on GitHub

Details

Skill name
antfu-coding-style
Path
.agent/skills/antfu-coding-style/SKILL.md
Repo updated
11 June 2026

FAQ

What does the Antfu Coding Style skill do?

Opinionated coding style and tooling preferences by Anthony Fu.

How do I install the Antfu Coding Style skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI --skill antfu-coding-style. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Antfu Coding Style popular?

It lives in Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI, which has 514 GitHub stars and 146 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.