mcpField
O
oxfmt

oxfmt

github.com/dobroslavradosavljevicDevelopment348 installsUpdated 5d ago
Repository

About oxfmt

A workflow skill for configuring and using Oxfmt, including formatting, sorting, migration, editor setup, and CI checks. It emphasizes checking the repository's existing conventions and verifying changes with Oxfmt.

Key features

  1. 01Inspect existing formatter configuration
  2. 02Configure Oxfmt and its CLI
  3. 03Sort imports and supported file content
  4. 04Guide Prettier or Biome migration
  5. 05Verify formatting in CI

Use cases

  1. 01Set up Oxfmt in a repository
  2. 02Migrate formatting from Prettier or Biome
  3. 03Add formatting checks for changed files

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dobroslavradosavljevic/skills --skill oxfmt

After installing, type/oxfmtin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
references/
languages-sorting-ignores.md
prettier-migration-ci.md
setup-cli-config.md
source-map.md
usage-guide.md

Details

From the project README

Oxfmt

Use this skill when work touches Oxfmt or Oxc formatting: install/config, day-to-day usage, Prettier/Biome migration, sorting extras, language support, editors, or CI --check gates.

Workflow

  1. Inspect the local Oxfmt surface before changing code:
    • Package version for oxfmt (still 0.x / beta until 1.0; 0.71 at last refresh).
    • Config: prefer oxfmt.config.ts / .mts with defineConfig; also accept .oxfmtrc.json(c) (one type per directory); Vite+ may use fmt in vite.config.* instead (nested configs always off in Vite+ mode).
    • Remaining Prettier/Biome setup, .prettierignore, scripts (format / format:check), editor default formatter.
  2. For setup, how-to, style choices, sorting, monorepos, pairing with Oxlint, or troubleshooting, follow the full guide first: usage-guide.md.
  3. Refresh current official docs when versions differ from the snapshot or the work touches language support, sorting, or migration. Start from source-map.md.
  4. Route deeper detail to the focused references:
  5. Preserve the project's print width, quote/semi style, and experimentalOperatorPosition unless migrating or the user asks to change them.
  6. Verify with bunx oxfmt --check (CI) or bunx oxfmt (write) on the touched paths.

Core Judgment

  • Oxfmt is Prettier-compatible for JS/TS (aim: match Prettier output; diffs vs recent Prettier are bugs). It is not 1.0 yet — pin lockfiles.
  • Default mode is write. CI gate is oxfmt --check (exit 1 on drift; exit 2 when no files matched).
  • No Prettier-style CLI style flags (--no-semi, etc.) — style lives in the config file only.
  • Default printWidth is 100, not Prettier's 80. Set printWidth: 80 when migrating to minimize diffs.
  • Prefer oxfmt.config.ts + defineConfig for new configs. Keep or use .oxfmtrc.json only when the project already has it. --init / --migrate still write JSON — convert to TS when adding a new config.
  • Prefer ignorePatterns for new projects; .prettierignore still works during migration. Patterns cannot use .. or match files outside the config directory.
  • .gitignore applies to walk/dir targets, not explicitly named files. A gitignored directory passed as a path is still skipped.
  • Built-in sorting (sortImports, sortTailwindcss, sortPackageJson, jsdoc) replaces Prettier plugins — Prettier plugins are unsupported.
  • Tailwind: enable sortTailwindcss; set stylesheet (v4) or config (v3); list helpers in functions (cn/clsx/…). Paths are relative to the Oxfmt config.
  • sortPackageJson defaults on — expect package.json diffs; disable if unwanted.
  • experimentalOperatorPosition is supported ("start" | "end", default "end"). experimentalTernaries is still unsupported.
  • YAML (.yml / .yaml) is native. HTML/Vue/Svelte/Markdown/MDX/Handlebars/MJML remain backed by bundled Prettier 3.9.9 (Vue/Svelte <script> is native; native Markdown is in progress).
  • Editor: Oxfmt owns format + import/Tailwind sort. Set editor.formatOnSaveMode to "file" (Oxfmt does not partial-format). Oxlint owns unused removal via source.fixAll.oxc. Disable TS organizeImports / removeUnusedImports.
  • Do not run Oxfmt alongside Prettier or Biome as formatters in the same pipeline.
  • Oxfmt formats; it does not replace a linter. Drop eslint-plugin-prettier; keep eslint-config-prettier only if ESLint remains.
  • Astro and formats that need Prettier plugins may be blockers until Oxfmt supports them.

Verification

Prefer repository-owned commands. For meaningful Oxfmt work, cover the relevant subset:

  • bunx oxfmt --check on changed paths or the whole repo for CI parity.
  • bunx oxfmt locally / lint-staged when applying format.
  • After Prettier migration: spot-check JS/TS diffs; confirm printWidth and experimentalOperatorPosition; remove Prettier scripts/deps when ready.
  • Sorting: confirm sortImports / Tailwind (stylesheet or config + functions) / package.json behavior matches team expectations.
  • Editor format-on-save (formatOnSaveMode: "file") + source.fixAll.oxc smoke when changing Oxc extension settings; confirm TS organize-imports is off.

Report which checks ran, which did not, and any 0.x maturity or language-support assumptions that remain.

Comments

Markdown supported