oxfmt
Skill2 starsChanged 8 months agoMITView on GitHub
Run and configure oxfmt — the high-performance JavaScript/TypeScript formatter built on the Oxc compiler stack, ~30x faster than Prettier. Use this skill whenever working in a project that has oxfmt installed (check for `oxfmt` in package.json devDependencies or an `.oxfmtrc.json` / `.oxfmtrc.jsonc` config file). This includes when you need to format code after making changes, set up oxfmt in a new project, migrate from Prettier, configure formatting rules, set up editor integration (VS Code, Neovim, Zed, JetBrains), or add formatting checks to CI/CD pipelines. Also use when the user mentions "oxfmt", "oxc formatter", "format with oxc", or asks about Prettier alternatives with better performance.
- Installs packages
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/mcp/meta-prompter/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- a2a-js-devSkill
- adr-authorSkill
- animejsSkill
- inktuiSkill
- ladybugdbSkill
- oxlintSkill
- tauri-v2Skill
- telegram-botSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
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
- Distinctive: line 12
After modifying code in a project that has oxfmt installed
- Very specific: line 29
Add scripts to package.json:
- Very specific: line 116
Add ignorePatterns in the config file, or use a .oxfmtignore / .prettierignore file:
- Very specific: line 149
After migration, review the generated .oxfmtrc.json — especially printWidth since the default changed from 80 to 100.
- Very specific: line 213
Autofix (GitHub): Use autofix.ci — run oxfmt (no --check) and let the action commit fixes.
- Very specific: line 225
Use --no-error-on-unmatched-pattern so non-supported file types don't cause errors.
- Distinctive: line 241
When you've modified files in an oxfmt-enabled project:
- Very specific: line 243
Run pnpm oxfmt (or the project's fmt script) to format changed files
- Very specific: line 244
If in CI or a check context, use --check instead to verify without writing
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Oxfmt — The Oxc Formatter
Oxfmt is a Prettier-compatible formatter for the JavaScript ecosystem. It currently passes ~95% of Prettier's JS/TS test suite. It formats JavaScript, JSX, TypeScript, TSX, JSON, JSONC, JSON5, YAML, TOML, HTML, Angular, Vue, CSS, SCSS, Less, Markdown, MDX, GraphQL, Ember, and Handlebars.
When to use oxfmt
- After modifying code in a project that has oxfmt installed
- Setting up formatting in a new JS/TS project
- Migrating from Prettier to oxfmt
- Configuring formatting rules, editor integration, or CI checks
Quick reference
Installation
# Pick your package manager
npm add -D oxfmt
pnpm add -D oxfmt
yarn add -D oxfmt
bun add -D oxfmtAdd scripts to package.json:
{
"scripts": {
"fmt": "oxfmt",
"fmt:check": "oxfmt --check"
}
}Running oxfmt with no arguments formats the current directory (like prettier --write .).
CLI flags
| Flag | Purpose |
--check | Check formatting without writing (exit 1 if unformatted) |
--list-different | List files that would change |
--write | Format and write in place (default) |
--init | Create .oxfmtrc.json with defaults |
--migrate=prettier | Convert .prettierrc to .oxfmtrc.json |
--migrate=biome | Convert Biome config to .oxfmtrc.json |
-c PATH | Use a specific config file |
--ignore-path PATH | Custom ignore file (repeatable) |
--with-node-modules | Include node_modules/ (skipped by default) |
--no-error-on-unmatched-pattern | Don't fail on unmatched globs |
--stdin-filepath PATH | Format stdin, using PATH to infer parser |
--threads N | Thread count (set to 1 for single core) |
--lsp | Start the LSP server (used by editors) |
CLI does not support formatting options as flags (e.g., no --no-semi). Use the config file instead — this keeps formatting consistent across CLI, editors, and CI.
Configuration
Oxfmt looks for .oxfmtrc.json or .oxfmtrc.jsonc starting from the current directory, walking up.
Generate a starter config:
oxfmt --initCore options
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100, // Line width limit (default: 100, Prettier default is 80)
"tabWidth": 2, // Spaces per indent level
"useTabs": false, // Tabs vs spaces
"semi": true, // Semicolons
"singleQuote": false, // Quote style
"trailingComma": "all", // Trailing commas in multi-line
"insertFinalNewline": true
}Note: oxfmt defaults printWidth to 100, while Prettier defaults to 80. If migrating, decide which you prefer.
Per-file overrides
{
"printWidth": 100,
"overrides": [
{
"files": ["*.test.js", "*.spec.ts"],
"options": { "printWidth": 120 }
},
{
"files": ["*.json"],
"excludeFiles": ["package.json"],
"options": { "tabWidth": 4 }
}
]
}Built-in features
These are disabled by default but can be enabled in the config:
sortImports— Sorts import statementssortTailwindcss— Sorts Tailwind CSS classessortPackageJson— Sortspackage.jsonfields (enabled by default)
Ignore patterns
Add ignorePatterns in the config file, or use a .oxfmtignore / .prettierignore file:
{
"ignorePatterns": ["dist/", "coverage/", "*.min.js"]
}.editorconfig support
Oxfmt reads these .editorconfig properties (nearest file only, no merging):
end_of_line→endOfLineindent_style→useTabsindent_size→tabWidthmax_line_length→printWidthinsert_final_newline→insertFinalNewline
Migrating from Prettier
# Install oxfmt
pnpm add -D oxfmt
# Auto-convert .prettierrc → .oxfmtrc.json
oxfmt --migrate=prettier
# Format everything so the diff is clean
pnpm oxfmt
# Replace Prettier scripts in package.json
# "prettier --write ." → "oxfmt"
# "prettier --check ." → "oxfmt --check"After migration, review the generated .oxfmtrc.json — especially printWidth since the default changed from 80 to 100.
Editor integration
Editor extensions use the local oxfmt --lsp, so oxfmt must be installed in the project.
VS Code / Cursor: Install the "Oxc" extension from the VS Code Marketplace. Recommended team setup:
.vscode/extensions.json:
{ "recommendations": ["oxc.oxc-vscode"] }.vscode/settings.json:
{
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
}Zed: Install the oxc extension from Zed's marketplace.
JetBrains (IntelliJ / WebStorm): Install from JetBrains Marketplace.
Neovim:
- With nvim-lspconfig:
npm i -g oxfmtthenvim.lsp.enable('oxfmt') - With conform.nvim: set
formatters_by_ftfor js/ts/json/vue - With coc.nvim:
:CocInstall coc-oxc
Other LSP-compatible editors (Emacs, Helix, Sublime): Point at oxfmt --lsp.
Non-LSP editors: Pipe via stdin: cat file.js | oxfmt --stdin-filepath file.js
CI setup
GitHub Actions:
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run fmt:checkGitLab CI:
oxfmt:
image: node:lts
stage: test
before_script:
- npm install
script:
- npm run fmt:checkAutofix (GitHub): Use autofix.ci — run oxfmt (no --check) and let the action commit fixes.
Pre-commit hook (lint-staged)
{
"lint-staged": {
"*": "oxfmt --no-error-on-unmatched-pattern"
}
}Use --no-error-on-unmatched-pattern so non-supported file types don't cause errors.
Node.js API
import { format } from "oxfmt";
const result = format("foo.ts", "const x:string = 1", {
semi: false,
singleQuote: true,
});
console.log(result); // const x: string = 1Workflow after code changes
When you've modified files in an oxfmt-enabled project:
- Run
pnpm oxfmt(or the project's fmt script) to format changed files - If in CI or a check context, use
--checkinstead to verify without writing
The formatter is fast enough to run on the entire project — no need to target individual files unless piping via stdin.
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.

