Biome

From G1Joshi/Agent-Skills · View interactive version

Biome is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert Biome toolchain assistance covering ultra-fast Rust-based formatting, linting, and imports sorting. Use when configuring Biome, replacing Prettier and ESLint, or enforcing sub-millisecond CI lint gates in JavaScript/TypeScript projects.

How to use this skill

Skill file

Biome

Biome is a unified, high-performance toolchain written in Rust that provides sub-millisecond code formatting and linting for JavaScript, TypeScript, and JSON.

When to Use

Quick Start

# Initialize Biome configuration in project
npx @biomejs/biome init

# Format and lint entire workspace in milliseconds
npx @biomejs/biome check --write ./src

Core Concepts

Declarative Configuration (biome.json)

Consolidating formatting, linting, and import sorting:

{
  "$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true
  },
  "formatter": {
    "enabled": true,
    "formatWithErrors": false,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "suspicious": {
        "noExplicitAny": "error"
      },
      "style": {
        "useConst": "error"
      }
    }
  },
  "organizeImports": {
    "enabled": true
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "double",
      "semicolons": "always"
    }
  }
}

Biome CLI Execution in Workflows

Formatting, checking, and applying autofixes:

# Check formatting, lint rules, and import ordering
npx @biomejs/biome check .

# Automatically apply safe fixes and formatting across all files
npx @biomejs/biome check --write .

# Format only (drop-in Prettier replacement)
npx @biomejs/biome format --write ./src

# CI verification (fails with non-zero exit code if changes needed)
npx @biomejs/biome ci .

Migrating from Prettier & ESLint

Importing existing rules automatically:

# Migrate from Prettier configuration
npx @biomejs/biome migrate prettier --write

# Migrate from ESLint configuration
npx @biomejs/biome migrate eslint --write

Common Patterns

Complete biome.json Configuration with Recommended Rules

Problem: Slow CI linters (ESLint + Prettier taking >60s on large codebases).

Solution:

Adopt unified biome.json replacing both:

{
  "$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
  "organizeImports": { "enabled": true },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "correctness": { "noUnusedVariables": "error" }
    }
  },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100
  }
}

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :------------------------------------------ | :----------------------------------------------------- | :----------------------------------------------------------------------------------------------------- |

| Biome failed to parse file | Unsupported syntax or invalid JSON/CSS file extension. | Add path glob to files.ignore in biome.json. |

| Conflict with ESLint / Prettier in editor | Multiple formatters configured simultaneously in IDE. | Set Biome as default formatter in .vscode/settings.json: editor.defaultFormatter: "biomejs.biome". |

| biome command not found in CI | Package not installed in dependencies. | Use npx @biomejs/biome ci ./src in CI pipeline. |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.