Skip to content
Skill

Init prettier git hooks

Sets up Prettier, LF line endings and git hooks in Node.js projects safely

Init prettier git hooks is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
JavaScript
Platforms
Claude Code, Codex, Cursor
GitHub stars
5
Last commit
License
MIT
Listing updated

Similar skills

About Init prettier git hooks

This skill audits an existing Node.js project and makes targeted edits to its Prettier, lint-staged, simple-git-hooks and line-ending configuration instead of overwriting files. It pins the prettier-plugin-lint-md plugin to an exact version, loads it through a top-level string entry, and checks that the lockfile and runtime resolution agree.

The workflow asks for user approval before installing dependencies, installing hooks, or renormalizing the Git index. It also includes a repair path for risky post-commit hooks in other repositories, with a verification script that runs from the target project root. Verification uses real Markdown samples through both the regular and experimental Prettier CLIs.

The skill also provides an optional GitHub Actions workflow that formats only changed files in same-repository pull requests, and a link-check gate for Markdown-heavy projects using lychee. It expects Node.js, pnpm and Git, and some steps require lychee to be installed.

When your agent uses it

Use when 初始化或纠偏 Node.js 项目的 Prettier、lint-staged、simple-git-hooks、LF 行尾配置,或需要在 GitHub PR 云端任务中安装 Node/pnpm 环境并安全格式化 PR 改动;适用于 prettier-plugin-lint-md 版本漂移、插件加载失败、git hooks、EOL、CRLF/LF 和幽灵修改问题, 也适用于修复任意目标仓库里已有的危险 post-commit。

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 20 files (68 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the common-tools plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add ruan-cat/monorepo
/plugin install common-tools@ruan-cat-tools

Or copy only this skill to ~/.claude/skills/init-prettier-git-hooks:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/init-prettier-git-hooks &&
cp -R "$tmp/ai-plugins/common-tools/skills/init-prettier-git-hooks" ~/.claude/skills/init-prettier-git-hooks &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/init-prettier-git-hooks inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/init-prettier-git-hooks to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/init-prettier-git-hooks &&
cp -R "$tmp/ai-plugins/common-tools/skills/init-prettier-git-hooks" ~/.agents/skills/init-prettier-git-hooks &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/init-prettier-git-hooks inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/init-prettier-git-hooks to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/init-prettier-git-hooks &&
cp -R "$tmp/ai-plugins/common-tools/skills/init-prettier-git-hooks" ~/.cursor/skills/init-prettier-git-hooks &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/init-prettier-git-hooks inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/ruan-cat/monorepo.git --path ai-plugins/common-tools/skills/init-prettier-git-hooks

Or copy the folder to ~/.gemini/skills/init-prettier-git-hooks yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/init-prettier-git-hooks:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/init-prettier-git-hooks &&
cp -R "$tmp/ai-plugins/common-tools/skills/init-prettier-git-hooks" ~/.copilot/skills/init-prettier-git-hooks &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/init-prettier-git-hooks inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/ruan-cat/monorepo.git

Then copy monorepo/ai-plugins/common-tools/skills/init-prettier-git-hooks into your agent's skills folder as init-prettier-git-hooks. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Exact plugin version pinning
Keeps prettier-plugin-lint-md at version 1.0.1 across package.json, the lockfile and runtime resolution.
Targeted config merging
Edits existing Prettier and hook configuration file by file, preserving project rules and notes.
LF line ending setup
Aligns .gitattributes, .editorconfig and Prettier settings on LF line endings.
Safe git hook repair
Replaces unsafe post-commit commands with a guarded version that checks for clean diffs first.
Cloud PR formatting workflow
Formats only changed files in same-repository pull requests and commits results to the PR branch.
Optional Markdown link checks
Adds an offline lychee link check to pre-commit and a scheduled external link check for Markdown-heavy repositories.

Good for

  • Set up Prettier and lint-staged in a new Node.js project
  • Fix CRLF and LF line-ending drift across a repository
  • Repair an existing dangerous post-commit hook in a target repository
  • Configure a GitHub workflow that formats pull request changes with Prettier
  • Add a broken-link check to Markdown documentation before commits

Init prettier git hooks FAQ

Does the skill change files without asking?

No. It lists the files it will edit first, and dependency installs, hook installs and git renormalization require explicit user approval.

Which tools does the project need?

It expects a Node.js project with pnpm, and Git for status checks. The optional link gate also needs lychee installed.

Will Init prettier git hooks overwrite existing hook configuration?

No. It merges the simple-git-hooks file by hand and keeps existing project-specific hook chains and commented keep markers.

How do I install Init prettier git hooks in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/init-prettier-git-hooks to use it in all your projects, or to .claude/skills/init-prettier-git-hooks in one project. Or install the common-tools plugin, which includes it: /plugin marketplace add ruan-cat/monorepo, then /plugin install common-tools@ruan-cat-tools.

Does Init prettier git hooks run scripts?

Yes. It runs JavaScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Init prettier git hooks?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Init prettier git hooks?

The closest alternatives to Init prettier git hooks are Code quality tooling edho ferdian, Git hooks, Vibe pre commit audit, Ljg push and Git commits and reporting.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from ruan-cat/monorepo

  1. Works through an OpenSpec change's task list, implementing and checking off each task

    • Open source
    • 5 GitHub stars
    • Developer tools
  2. Finalizes a completed OpenSpec change, syncing its specs and moving it to the archive

    • Open source
    • 5 GitHub stars
    • Developer tools
  3. Generates all OpenSpec planning artifacts for a change in one pass

    • Open source
    • 5 GitHub stars
    • Developer tools
  4. Starts a new OpenSpec change and shows its first artifact template for review

    • Open source
    • 5 GitHub stars
    • Developer tools
  5. Checks and normalizes package.json, tsup and tsconfig setup for monorepo Node packages

    • Open source
    • 5 GitHub stars
    • Developer tools
  6. Turns incident reports and repeated failures into durable, verifiable agent skill rules

    • Open source
    • 5 GitHub stars
    • Developer tools