format

Format code across languages using project-specific tools like prettier or gofmt.

1|Updated Dec 12, 2024
One-click install
npx skills add https://github.com/Xantibody/dotfiles --skill format-xantibody
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: format
Source: https://github.com/Xantibody/dotfiles/tree/main/configs/claude/skills/format
Command: npx skills add https://github.com/Xantibody/dotfiles --skill format-xantibody

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automatically formats your codebase, ensuring consistent code style and adherence to project standards, which prevents style-related code review comments and improves maintainability.

Core Features & Use Cases

  • Automated Code Formatting: Applies formatters like Prettier, Biome, or Go fmt to your code.
  • Multi-language Support: Detects and uses project-specific formatters defined in Nix, Makefiles, or Justfiles.
  • Use Case: Before committing your code, run this Skill to automatically fix any style inconsistencies, ensuring a clean and uniform codebase.

Quick Start

Run the code formatter on the entire project.

Frequently Asked Questions about format

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format code across multiple programming languages in one project?

Code formatting across multiple languages is handled by detecting and executing project-specific formatters like prettier, biome, gofmt, or black based on your configuration files. The Skill identifies the appropriate formatter from your flake.nix, Makefile, or justfile to ensure consistent style.

What is the best way to ensure code style consistency before committing?

Ensuring code style consistency before committing is achieved by running automated formatting tools on your codebase. This Skill applies project standards defined by tools like nix fmt, cargo fmt, or ruff format to fix style inconsistencies and prevent style-related code review comments.

Does this code formatting tool work with project configurations like Nix or Makefiles?

Yes, this code formatting tool works directly with project configurations like Nix, Makefiles, and Justfiles. It requires the identification of appropriate formatter commands by reading these configuration files to execute the correct formatting tool for your environment.

How does automated code formatting detect which formatter to use?

Automated code formatting detects the correct tool by reading project configuration files such as flake.nix, Makefile, or justfile. It then executes the corresponding formatter commands like prettier, biome, gofmt, cargo fmt, black, or ruff format to apply the established project standards.

Can I use biome or prettier to fix style inconsistencies automatically?

Yes, you can use biome, prettier, or other supported formatters to automatically fix style inconsistencies. The Skill applies these tools to your code to ensure adherence to project formatting standards and improve overall maintainability.

When do I need to run a code formatter on my project?

You need to run a code formatter on your project before committing code to prevent style-related code review comments. Applying formatters like gofmt, black, or ruff format ensures a clean, uniform codebase and adherence to project formatting standards.