Skip to content

/format-cc

Formats Claude Code files with markdownlint, prettier, and shellcheck. Use when user asks to "format my files", "fix markdown formatting", "clean up CLAUDE.md", or "check shell scripts". Auto-fixes markdown, JSON, YAML formatting and analyzes shell script quality.

From plugin
claudelint
149 skills13 agents1 command1 hook

Claude Code

$ npx -y skills add pdugan20/claudelint --skill format-cc --agent claude-code

SKILL.md

format-cc.SKILL.md
name: format-cc
description: Formats Claude Code files with markdownlint, prettier, and shellcheck. Use when user asks to "format my files", "fix markdown formatting", "clean up CLAUDE.md", or "check shell scripts". Auto-fixes markdown, JSON, YAML formatting and analyzes shell script quality.
version: 1.0.0
argument-hint: "[flags]"
allowed-tools:
  - Bash(claudelint:*)

Format Claude Code Files

Runs `claudelint format` to format Claude Code project files using industry-standard tools:

  • **markdownlint** - Markdown structure and formatting
  • **prettier** - Code formatting for markdown, JSON, YAML
  • **shellcheck** - Shell script analysis

Usage

claudelint format --fix $ARGUMENTS

Modes

Fix Mode (default)

Auto-fix formatting issues:

claudelint format --fix

Or simply:

claudelint format

Check Mode

Check formatting without making changes:

claudelint format --check

Useful for CI/CD to verify formatting.

Options

  • `--check` - Check formatting without making changes
  • `--fix` - Fix formatting issues (default)
  • `--verbose` - Show detailed command output

What Gets Formatted

Markdown Files

  • `CLAUDE.md`
  • `.claude/**/*.md`

Tools:

  • markdownlint - MD041, MD031, MD032, MD040, MD022
  • prettier - Line wrapping, indentation

JSON Files

  • `.claude/**/*.json`
  • `.mcp.json`
  • `.claude-plugin/**/*.json`

Tool: prettier

YAML Files

  • `.claude/**/*.{yaml,yml}`

Tool: prettier

Shell Scripts

  • `.claude/**/*.sh`
  • `.claude/hooks/*`

Tool: shellcheck (analysis only, no auto-fix)

Examples

Format all Claude files:

claudelint format --fix

Check formatting in CI:

claudelint format --check

Verbose output:

claudelint format --fix --verbose

Required Tools

Install formatting tools globally or in your project:

markdownlint

npm install -g markdownlint-cli
# or
npm install --save-dev markdownlint-cli

prettier

npm install -g prettier
# or
npm install --save-dev prettier

shellcheck

brew install shellcheck
# or
npm install -g shellcheck

Configuration

The format command automatically scopes to Claude files only, so it won't conflict with your project's existing formatters.

Customizing Markdownlint

Create `.markdownlint.json` in your project root:

{
  "default": true,
  "MD013": false,
  "MD033": {
    "allowed_elements": ["kbd", "br"]
  },
  "MD041": true,
  "MD031": true,
  "MD032": true,
  "MD040": true,
  "MD022": true
}

`claudelint format` will automatically use this configuration.

Customizing Prettier

Create `.prettierrc.json` in your project root:

{
  "semi": true,
  "singleQuote": true,
  "printWidth": 100,
  "tabWidth": 2,
  "useTabs": false,
  "arrowParens": "always",
  "endOfLine": "lf",
  "proseWrap": "preserve"
}

`claudelint format` will automatically use this configuration.

Integration

Add to package.json scripts:

{
  "scripts": {
    "format:claude": "claudelint format --fix",
    "format:claude:check": "claudelint format --check",
    "lint:claude": "claudelint check-all"
  }
}

Add to pre-commit hooks:

#!/bin/sh
claudelint format --check
claudelint check-all

Exit Codes

  • `0` - All formatting checks passed
  • `1` - Formatting issues found

See Also

  • [validate-all](../validate-all/SKILL.md) - Validate Claude files
  • [CLI Reference](https://claudelint.com/guide/cli-reference) - Complete CLI documentation
Read more
@pdugan20
Ships withclaudelint

A linter for Claude Code projects. Validates CLAUDE.md files, skills, settings, hooks, MCP servers, plugins, and more.

Stars on GitHub

Momentum

stars in total
14
Star history of pdugan20/claudelint on GitHub, a chart by star-history.com

Other skills on claudelint.

optimize-cc-md
Auto-invoked

optimize-cc-md

Interactively helps users optimize their CLAUDE.md files. Use when user asks to "optimize my CLAUDE.md", "my CLAUDE.md is too…

@pdugan20@pdugan20Install Skill
validate-all
Auto-invoked

validate-all

Runs comprehensive claudelint validation on all Claude Code project files. Use when user asks to "check everything", "run all…

@pdugan20@pdugan20Install Skill
validate-cc-md
Auto-invoked

validate-cc-md

Validates CLAUDE.md files for size, imports, and structure. Use when user asks to "check my CLAUDE.md", "why is my CLAUDE.md too…

@pdugan20@pdugan20Install Skill
validate-hooks
Auto-invoked

validate-hooks

Validates Claude Code hooks.json files for schema, events, and commands. Use when user asks to "check my hooks", "validate…

@pdugan20@pdugan20Install Skill
validate-mcp
Auto-invoked

validate-mcp

Validates MCP server configuration files (.mcp.json). Use when user asks to "check my .mcp.json", "why isn't my MCP working",…

@pdugan20@pdugan20Install Skill
validate-plugin
Auto-invoked

validate-plugin

Validates Claude Code plugin manifest files (plugin.json). Use when user asks to "check my plugin.json", "validate plugin.json",…

@pdugan20@pdugan20Install Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about format-cc.

Which coding agents can use format-cc?
format-cc installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.