Back to Skills

code-formatter

CuriousLearner
Updated Yesterday
23 views
16
3
16
View on GitHub
Developmentautomation

About

This Claude Skill automatically formats code across multiple languages using opinionated configurations and popular style guides. It detects file types, respects existing project configs when available, and reports all formatting changes made. Use it to quickly standardize code style in projects supporting JavaScript, Python, Go, Rust, Java, and CSS.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/CuriousLearner/devkit
Git CloneAlternative
git clone https://github.com/CuriousLearner/devkit.git ~/.claude/skills/code-formatter

Copy and paste this command in Claude Code to install this skill

Documentation

Code Formatter Skill

Automatically format code across multiple languages with opinionated configurations.

Instructions

You are a code formatting expert. When invoked:

  1. Detect Languages: Identify all code file types in the current directory or specified path

  2. Check for Configs: Look for existing formatting configurations (.prettierrc, .editorconfig, pyproject.toml, etc.)

  3. Apply Formatting: Format code according to:

    • Existing project configuration (if found)
    • Language-specific best practices (if no config exists)
    • Popular style guides (e.g., PEP 8 for Python, StandardJS, Google Style Guide)
  4. Report Changes: Summarize what was formatted and any style decisions made

Supported Languages

  • JavaScript/TypeScript (Prettier)
  • Python (Black, autopep8)
  • Go (gofmt)
  • Rust (rustfmt)
  • Java (Google Java Format)
  • CSS/SCSS/LESS
  • HTML
  • JSON/YAML
  • Markdown

Usage Examples

@code-formatter
@code-formatter src/
@code-formatter --check-only
@code-formatter --language python

Formatting Rules

  • Use 2 spaces for JavaScript/TypeScript/CSS
  • Use 4 spaces for Python
  • Use tabs for Go
  • Maximum line length: 100 characters (unless project config specifies otherwise)
  • Always use semicolons in JavaScript (unless project uses StandardJS)
  • Single quotes preferred for JavaScript (unless project config says otherwise)
  • Trailing commas in multi-line structures

Notes

  • Always respect existing project configuration files
  • Ask before modifying configuration files
  • Never format generated code or vendor directories
  • Skip binary files and lock files

GitHub Repository

CuriousLearner/devkit
Path: skills/code-formatter

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill

Algorithmic Art Generation

Meta

This skill helps developers create algorithmic art using p5.js, focusing on generative art, computational aesthetics, and interactive visualizations. It automatically activates for topics like "generative art" or "p5.js visualization" and guides you through creating unique algorithms with features like seeded randomness, flow fields, and particle systems. Use it when you need to build reproducible, code-driven artistic patterns.

View skill

business-rule-documentation

Meta

This skill provides standardized templates for systematically documenting business logic and domain knowledge following Domain-Driven Design principles. It helps developers capture business rules, process flows, decision trees, and terminology glossaries to maintain consistency between requirements and implementation. Use it when documenting domain models, creating business rule repositories, or bridging communication between business and technical teams.

View skill