code-format

Format TypeScript, JavaScript, JSON, Markdown and CSS/SCSS files in a repository using Prettier via npx.

1|1|Updated Jun 28, 2025
One-click install
npx skills add https://github.com/DarkMonkDev/WitchCityRope --skill code-format-darkmonkdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-format
Source: https://github.com/DarkMonkDev/WitchCityRope/tree/main/.claude/skills/code-format
Command: npx skills add https://github.com/DarkMonkDev/WitchCityRope --skill code-format-darkmonkdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires npm, npx, prettier, git, and includes scripts (resource) components.

What problem does it solve?

Inconsistent code formatting across a team leads to messy diffs, unnecessary merge conflicts, and wasted time on style debates, reducing developer productivity and code readability.

Core Features & Use Cases

  • Consistent Style: Formats TypeScript/JavaScript, JSON, Markdown, CSS/SCSS files using Prettier to enforce a unified code style.
  • Flexible Scope: Supports checking only, formatting only changed files (via Git), or applying formatting across the entire codebase.
  • Pre-commit Integration: Designed for use in pre-commit hooks to automatically ensure code is formatted before it's committed.
  • Use Case: Before creating a pull request, run this Skill to automatically format all your modified TypeScript files, ensuring they comply with project style guidelines without manual effort.

Quick Start

Format all changed files in the repository.

Frequently Asked Questions about code-format

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

FAQPage Schema
How do I automatically format TypeScript and JavaScript files in my repository?

Format TypeScript and JavaScript files using Prettier, which enforces consistent code style across your codebase. This Skill applies Prettier to .ts, .tsx, .js, .jsx files along with JSON, Markdown, and CSS/SCSS, eliminating style inconsistencies automatically.

Can I run code formatting before committing my changes?

Yes, this Skill integrates with pre-commit hooks to format code automatically before commits are made. Set it up in your pre-commit workflow to ensure all staged changes comply with your project's style guidelines without manual intervention.

What's the best way to format only changed files instead of the entire codebase?

Use the --changed-only mode, which formats only modified files tracked by Git. This reduces processing time and focuses formatting on recent changes, making it ideal for pull request preparation without reformatting untouched code.

Does Prettier work with my existing project configuration?

This Skill respects your Prettier configuration file when present and applies its rules automatically. If no configuration exists, it defaults to Prettier's standard rules, ensuring consistent formatting aligned with your project's established style.

How do I check if my code meets formatting standards without making changes?

Use the --check mode to verify formatting compliance without modifying files. This reports style violations and is useful for quality gates and pull request validation before any automatic formatting is applied.

Why should I automate code formatting instead of letting developers style code manually?

Automated code formatting eliminates style debates, reduces messy diffs, prevents unnecessary merge conflicts, and saves developer time. Consistent formatting across the team improves code readability and reduces friction in code reviews.