Engineering
code-formatting avatar

code-formatting

Format and lint JS, TS, and JSON files on the current branch using Biome. Useful for code cleanup before commits or PRs.

Introduction

The code-formatting skill provides an automated solution for maintaining clean, consistent, and performant codebases. Built upon Biome, an high-performance toolchain for web projects, this agentic tool streamlines the process of checking and formatting source code. It is designed to be executed directly within the repository environment, ensuring that code style remains unified across different developers and branches.

By targeting only the files modified on the current branch compared to a base branch (defaulting to 'main'), the tool optimizes performance by avoiding unnecessary scans of the entire codebase. This makes it an ideal pre-commit or pre-push hook for developers working on JavaScript, TypeScript, JSX, TSX, and JSON files. It adheres strictly to the configuration defined in the repository's biome.jsonc, ensuring that automated changes align with established project standards.

  • Automatically identifies and formats modified JS, TS, JSX, TSX, and JSON files.

  • Supports custom base branch comparison to accommodate different development workflows (e.g., develop or feature branches).

  • Integrates directly with existing Biome configurations to maintain consistency with CI/CD pipelines.

  • Requires Node.js and npx, providing a lightweight dependency footprint.

  • Reduces manual effort by automating the linting and formatting process before code review.

  • Operates in-place on the file system, enabling immediate feedback and rapid iteration.

  • Ensure Node.js is installed in your local or agentic environment to run npx commands.

  • Execute the script from the root of the repository for correct path resolution.

  • Use the provided script at .claude/skills/code-formatting/scripts/format-branch.sh to trigger the formatting.

  • For custom workflows, pass the desired base branch as an argument to the script.

  • Note that this tool currently focuses on code formatting and linting as defined in the biome-check.yml workflow; it is not a comprehensive static analysis or security scanning tool.

Repository Stats

Stars
4,401
Forks
754
Open Issues
770
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 08:06 AM
View on GitHub