Execute automatically formats and validates code files using Prettier and other formatting tools.

MITAuto-check passedDevelopment

Install Code Formatter

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill code-formatter -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace code-formatter --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/code-formatter .claude/skills/code-formatter && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-formatter
GitHub stars
2.8k
Token cost
~1.2k tokens
SKILL.md length
512 words
Files
4 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Execute automatically formats and validates code files using Prettier and other formatting tools.

  • Works in 7 steps: Check whether Prettier is available by… → Detect existing configuration by… → Run npx prettier --check… → …
  • Users mention format my code
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Calls npx, npm and prettier

What it does

Code Formatter is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute automatically formats and validates code files using Prettier and other formatting tools. Use when users mention "format my code", "fix formatting", "apply code style", "check formatting", "make code consistent", or "clean up code formatting". Handles JavaScript, TypeScript, JSON, CSS, Markdown, and many other file types. Trigger with relevant phrases based on skill purpose.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/errors.md`, `references/examples.md` and `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in Development, covering Linting and formatting. It works with Prettier, JavaScript, TypeScript and npm. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Users mention format my code
  • Apply code style
  • Check formatting
  • Make code consistent

Example prompts

  • “format my code”
  • “fix formatting”
  • “apply code style”
  • “/code-formatter”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(cmd:*)

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Check whether Prettier is available by running npx prettier --version. If missing, install it locally with npm install --save-dev prettier…
  2. Detect existing configuration by searching for .prettierrc, .prettierrc.json, prettier.config.js, or a "prettier" key in package.json. If…
  3. Run npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path .prettierignore to identify files that need formatting. Report…
  4. Apply formatting to identified files using npx prettier --write on the target paths. For single files, specify the exact path; for…
  5. Create or update .prettierignore to exclude generated outputs (dist/, build/, *.min.js, *.min.css), dependencies (node_modules/, vendor/)…
  6. Optionally set up pre-commit enforcement by installing husky and lint-staged, then configuring lint-staged in package.json to run prettier…
  7. Run a final npx prettier --check to confirm all target files now conform to the configured style rules.

What it can do on your machine

Read from SKILL.md and the folder at commit 23ea8d4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(cmd:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • npm
    • prettier

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • prettier.io
    • eslint.org
    • typicode.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Code Formatter loads about 1.2k tokens when it runs, and up to ~2.1k if it reads all its reference files. Until then it costs about 100 tokens; SKILL.md has 512 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 23ea8d4, republished under its MIT licence (© jeremylongshore). 512 words, ~1,238 tokens.

Download SKILL.mdSave it as .claude/skills/code-formatter/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
code-formatter
description
Execute automatically formats and validates code files using Prettier and other formatting tools. Use when users mention "format my code", "fix formatting", "apply code style", "check formatting", "make code consistent", or "clean up code formatting". Handles JavaScript, TypeScript, JSON, CSS, Markdown, and many other file types. Trigger with relevant phrases based on skill purpose.
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(cmd:*)
compatibility
Designed for Claude Code
version
2.26.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
example, typescript, code-formatter

Code Formatter

Overview

Formats and validates code files using Prettier and related formatting tools. Supports JavaScript, TypeScript, JSON, CSS, Markdown, and many other file types.

Prerequisites

  • Node.js (v16+) and npm/npx installed
  • Prettier available globally (npm install -g prettier) or locally in the project
  • Write permissions for target files and configuration directories
  • Supported file types present in the project (.js, .jsx, .ts, .tsx, .json, .css, .md)

Instructions

  1. Check whether Prettier is available by running npx prettier --version. If missing, install it locally with npm install --save-dev prettier or globally with npm install -g prettier.
  2. Detect existing configuration by searching for .prettierrc, .prettierrc.json, prettier.config.js, or a "prettier" key in package.json. If no configuration exists, create a .prettierrc with sensible defaults (see ${CLAUDE_SKILL_DIR}/references/implementation.md).
  3. Run npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}" --ignore-path .prettierignore to identify files that need formatting. Report the count and list of non-conforming files.
  4. Apply formatting to identified files using npx prettier --write on the target paths. For single files, specify the exact path; for directories, use glob patterns.
  5. Create or update .prettierignore to exclude generated outputs (dist/, build/, *.min.js, *.min.css), dependencies (node_modules/, vendor/), and lock files.
  6. Optionally set up pre-commit enforcement by installing husky and lint-staged, then configuring lint-staged in package.json to run prettier --write on staged files matching supported extensions.
  7. Run a final npx prettier --check to confirm all target files now conform to the configured style rules.

Output

A formatting execution report containing:

  • Count of files checked and files reformatted
  • List of files that were modified with before/after formatting status
  • Configuration file(s) created or updated (.prettierrc, .prettierignore)
  • Any git hook integration changes applied
  • Confirmation of final formatting compliance
Show full SKILL.md (237 more words)Show less

Error Handling

ErrorCauseSolution
prettier: command not foundPrettier not installed globally or locallyRun npm install -g prettier or npx prettier --version to use npx
Syntax errors in source filesMalformed code that Prettier cannot parseFix syntax errors first using npx eslint --fix-dry-run <file> then retry formatting
Configuration conflictsMultiple .prettierrc files or conflicting editorconfigLocate all config files with find . -name ".prettier*" and consolidate to a single config
Permission denied on writeFile or directory lacks write permissionRun chmod u+w <file> to grant write access
Parser not found for file typeUnsupported file extension or missing Prettier pluginInstall the appropriate Prettier plugin (e.g., prettier-plugin-svelte) or exclude the file type

Examples

Format a single file: Trigger: "Format src/app.js" Process: Run npx prettier --write src/app.js. Report the file as reformatted or already conformant.

Project-wide formatting setup: Trigger: "Set up code formatting for this project." Process: Create .prettierrc with project defaults, create .prettierignore excluding build outputs, run npx prettier --write "src/**/*.{js,ts,json,css}", install husky and lint-staged for pre-commit hooks, verify compliance.

Check formatting without modifying files: Trigger: "Check formatting across the project." Process: Run npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}". Report non-conforming files with their paths. Suggest npx prettier --write to fix.

Resources

  • ${CLAUDE_SKILL_DIR}/references/implementation.md -- detailed implementation guide with configuration examples
  • ${CLAUDE_SKILL_DIR}/references/errors.md -- common error scenarios and solutions
  • Prettier documentation -- official configuration and CLI reference
  • ESLint -- complementary linting and code quality tool
  • Husky -- git hooks for pre-commit formatting enforcement

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/.curated/code-formatter of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/errors.md
  • references/examples.md
  • references/implementation.md

Open the folder on GitHubat commit 23ea8d4

Compare with similar skills

Code Formatter next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Formatter compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Formatter this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.2kAutomated safety check: PassMIT
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.3k1 repos~2.2kAutomated safety check: PassMIT
Code Qualityredis/RedisInsight8.9k—~1.2kAutomated safety check: PassCustom licence
Prepare Rslint npm Releaseweb-infra-dev/rslint460—~1.5kAutomated safety check: PassMIT
Migrate Oxfmtdxos/dxos5253 repos~2.2kAutomated safety check: PassCustom licence
Headless Modelive-codes/livecodes1.5k—~1.1kAutomated safety check: PassMIT

Similar skills

  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.3k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Code Quality

    redis/RedisInsight

    Official

    Code-quality standards for RedisInsight: TypeScript strictness, naming conventions (camelCase, PascalCase, UPPERSNAKECASE), linting rules, no any without reason, no !important in styles, and…

    8.9k GitHub stars~1.2k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Prepare Rslint npm Release

    web-infra-dev/rslint

    Prepare a stable release PR for the unified rslint npm packages by updating package versions and rule/TypeScript release metadata.

    460 GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrate Oxfmt

    dxos/dxos

    Guide for migrating a project from Prettier or Biome to Oxfmt.

    525 GitHub starsUsed in 3 repos~2.2k tokens
    DevelopmentAuto-check passed
  • Headless Mode

    live-codes/livecodes

    Run playground without visible UI using SDK methods directly.

    1.5k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Migrate or upgrade TypeScript tooling in the Phoenix monorepo.

    12k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Analyzing Text With NLP

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to perform natural language processing and text analysis using the nlp-text-analyzer plugin.

    2.8k GitHub starsUsed in 1 repo~819 tokens
    Auto-check passed
  • Building Neural Networks

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill allows AI assistant to construct and configure neural network architectures using the neural-network-builder plugin.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Detecting Data Anomalies

    jeremylongshore/tons-of-skills-marketplace

    Process identify anomalies and outliers in datasets using machine learning algorithms.

    2.8k GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Explaining Machine Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill enables AI assistant to provide interpretability and explainability for machine learning models.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Optimizing Prompts

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill optimizes prompts for large language models (llms) to reduce token usage, lower costs, and improve performance.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed

Categories

Questions about Code Formatter

What does Code Formatter do?

Execute automatically formats and validates code files using Prettier and other formatting tools. Code Formatter is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute automatically formats and validates code files using Prettier and other formatting tools.

When should I use Code Formatter?

Code Formatter fits situations like: users mention format my code; apply code style; check formatting; make code consistent.

How do I install Code Formatter in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill code-formatter -a claude-code`. Or copy the skill folder (skills/.curated/code-formatter in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/code-formatter in your project. Claude Code loads it when a task matches its description.

How do I install Code Formatter in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill code-formatter -a codex`. Or copy the skill folder (skills/.curated/code-formatter in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/code-formatter in your project. Codex loads it when a task matches its description.

Can I use Code Formatter in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill code-formatter -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-formatter, .gemini/skills/code-formatter, .github/skills/code-formatter and .opencode/skills/code-formatter in your project.

What does Code Formatter need to run?

Going by SKILL.md and its folder, Code Formatter needs the command-line tools its instructions call (npx, npm and prettier). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(cmd:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Code Formatter access the network?

SKILL.md names 3 domains. As links in the text: prettier.io, eslint.org and typicode.github.io. This is read from the text; nothing was executed.

Is Code Formatter safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Formatter use?

Code Formatter is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Formatter use?

About 1.2k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 826 tokens, read only when the agent opens those files.

What are the alternatives to Code Formatter?

Skills that share tags, products or a category with Code Formatter: Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.3k stars), Code Quality (redis/RedisInsight, 8.9k stars), Prepare Rslint npm Release (web-infra-dev/rslint, 460 stars) and Migrate Oxfmt (dxos/dxos, 525 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Formatter?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,821 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 8, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.