setup-claude-auto-lint-format
Installs a PostToolUse hook that runs the project's linter and formatter on every file Claude Code or one of its subagents writes or edits, and speaks up only…
Skill by Lichens-Innovation
Chalk Labs
Need help deploying setup-claude-auto-lint-format?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/lichens-innovation-setup-claude-auto-lint-format
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Node.js package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/setup-claude-auto-lint-format
What's inside
- Skill name
setup-claude-auto-lint-format- Description
- Installs a PostToolUse hook that runs the project's linter and formatter on every file Claude Code or one of its subagents writes or edits, and speaks up only when a problem is found (so Claude fixes it): no interruption, no extra tokens when clean. Detects the project's tools (ruff, eslint, prettier, biome, ...) and writes the per-project config. Use when the user wants automatic linting/formatting after Claude's edits, or invokes /setup-claude-auto-lint-format.
- License
- MIT
- Instructions
- 101 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (5)
- README.md
- SKILL.md
- auto-lint-format.md · assets/
- auto-lint-format.mjs · scripts/
- test-auto-lint-format.sh · scripts/
SKILL.md (first lines)
# Setup Claude Auto Lint Format
After each `Write`, `Edit` or `MultiEdit` (subagents included), run the project's formatter and linter on the file. Clean: no output. A problem: the output goes back to Claude, who fixes it.
| File | Role |
| ---- | ---- |
| `.claude/hooks/auto-lint-format.mjs` | The hook, from `scripts/auto-lint-format.mjs` |
| `.claude/hooks/auto-lint-format.json` | Which commands run on which files |
| `.claude/settings.json` | Registers the hook (`PostToolUse`, `Write\|Edit\|MultiEdit`) |
| `.claude/rules/auto-lint-format.md` | Optional: tells Claude not to run these tools itself (from `assets/auto-lint-format.md`) |
Committed by default (a team convention); `.claude/settings.local.json` if the user wants it personal.
Hook behavior: all commands pass → exit 0, no output. One fails → exit 2, its output on stderr, which PostToolUse shows to Claude (nothing is blocked). A command that cannot run (not installed) → exit 1, shown to the user only. Internal errors, timeouts (30 s, or the rule's `timeout` up to 120), files outside the project, deleted files and `node_modules` are ignored silently.
Config (`{file}` = quoted absolute path; `match` globs test the project-relative path, or the file name if the glob has no `/`; `cwd` is relative to the root; `timeout` is seconds per command; both optional):
```json
{
"ignore": ["**/generated/**"],
"rules": [
{ "match": ["*.py"], "commands": ["ruff format {file}", "ruff check {file}"] },
{ "match": ["*.ts", "*.tsx"], "cwd": "apps/web", "timeout": 60, "commands": ["just format-file {file}", "just lint-file {file}"] }
]
}
```
Every command of every matching rule runs in order: put a rewriting formatter before the linter, so only what remains is reported.
## Workflow
1. **Prerequisites.** `node --version` >= 18, else stop. Work from the git root (`git rev-parse --show-toplevel`).
2. **Detect.** Use only what the project already has.
- Python: `ruff`, `black`, `isort`, `flake8`. JS/TS: `eslint`, `prettier`, `biome`, with the package manager from the lockfile (`pnpm exec`, `npx`, ...); in a monorepo, `cwd` is the package that owns the tool. Others: `gofmt`, `rubocop`, `shfmt`, `terraform fmt`, `markdownlint`, ...
- Read `.pre-commit-config.yaml`, `lefthook.yml`, `.husky/`, package scripts, Makefile, justfile and `.claude/rules` for the intended commands and flags.
- Want commands that take one file and run in about a second, via the repo's own invocation. Whole-project scripts do not fit: skip and say so. This hook runs outside Claude's Bash tool, so a just-usage hook does not block the raw tools here.
- **Justfile** (`git ls-files` for `justfile`, `Justfile`, `.justfile`; `just --list`): note recipes already covering lint/format and whether they take a file.
- **Extra checks** that could run on a file: type checkers (`pyright`, `mypy`, `tsc`), `shellcheck`, `actionlint`, `hadolint`, related tests (`vitest related`, `jest --findRelatedTests`). Run each once and record whether it scopes to one file and how long it takes. Whole-project ones (`tsc --noEmit`, `mypy .`, `cargo clippy`) are slow and report other files' errors: flag them.
3. **Propose.** One rule per language/package: `match`, `cwd`, formatter then linter. Formatters use the fix flag (`ruff format`, `prettier --write`), linters check only (`ruff check`, `eslint`), unless the user wants `--fix`. Add `ignore` globs for generated or vendored code.
- **With a justfile, propose per-file recipes** the rule calls (`just format-file {file}`, `cwd` the justfile's directory), so the repo owns the flags. Show them, append them next to the existing lint recipes in its style, `@` prefix so just does not echo the line into the findings:
```just
# Format one file in place (used by the Claude auto-lint-format hook)
format-file file:
@ruff format {{file}}
# Lint one file, no fixes (used by the Claude auto-lint-format hook)
lint-file file:
@ruff check {{file}}
```
Several languages: one recipe per language (`lint-py-file`) or one picking by extension. A suitable recipe exists: reuse it. If the level has `.claude/rules/use-just-commands.md`, tell the user to re-run `/setup-claude-just-usage` to list the new recipes. If the user declines, call the tools directly.
- **Extra checks** that are file-scoped and take a few seconds go after the linter (same rule, or a `check-file` recipe); slow ones get a `timeout`. No whole-project check unless the user picks it in step 4.
- Run each command once by hand on a real tracked file; fix the proposal if it fails for a reason other than a finding (flags, config, `cwd`).
4. **Ask** in one `AskUserQuestion` call, with the rules shown compactly:
- "Install these rules?": yes (recommended) or adjust (apply, show again).
- "Formatter mode": fix silently (recommended) or check only (formatter also reports; more usage).
- Only if extra checks were found: "Run more than lint and format after each edit?" (multi-select), each with scope and measured time (e.g. "pyright on the file, ~2 s", "tsc --noEmit, whole project, ~15 s, reports other files' errors"). Default: none beyond the fast file-scoped ones. Each check adds time to every edit and its findings cost tokens.
- Only if a justfile exists without per-file recipes: "Add per-file recipes?": yes (recommended) or no.
- "Add a rule telling Claude not to run the linter and formatter itself?": yes (recommended: avoids duplicate runs) or no.
- If `.claude/settings.json` is untracked or gitignored: register in `settings.json` (recommended if tracked) or `settings.local.json`.
5. **Write.**
- Copy `scripts/auto-lint-format.mjs` to `<root>/.claude/hooks/auto-lint-format.mjs`; if it exists and differs, show the diff and ask.
- `<root>/.claude/hooks/auto-lint-format.json`, 2-space indentation; if it exists, merge by rule `match`, keep the user's rules.
- If the rule was chosen: `<root>/.claude/rules/auto-lint-format.md` from `assets/auto-lint-format.md`, with the real tools and extensions, and under "Not covered" only what applies here. Drop the comment and empty placeholders. If `.claude/rules/use-just-commands.md` exists, keep the wording "Don't run them on those files" (not "never") so it does not clash with "always use just". If the file exists, show the change and ask.
- `<root>/.claude/settings.json` (`{}` if absent): merge, never replace; skip if the same `command` is there.
```json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [{ "type": "command", "command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/auto-lint-format.mjs\"" }]
}
]
}
}
```
6. **Verify.**
- `bash scripts/test-auto-lint-format.sh <root>/.claude/hooks/auto-lint-format.mjs` from this skill's directory (always `bash`); report failures verbatim.
- With `CLAUDE_PROJECT_DIR=<root>`, pipe `{"tool_name":"Edit","cwd":"<root>","tool_input":{"file_path":"<a tracked file per rule>"}}` to the hook: exit 0, no output. Then create a probe file in the project (`<dir>/zz_lint_probe.<ext>`) with an obvious error, expect exit 2 with the linter's message, and delete it. Never alter a user's file.
- If the rule was written: its extensions and tools match the config, no `<` placeholder is left.
7. **Report** the rules, the files written (tracked or not) and the limits. Hooks load at session start: restart Claude Code.
## Limits: tell the user
- Only `Write`, `Edit`, `MultiEdit` are seen: not Bash edits (`sed -i`, generators) or `NotebookEdit`.
- Checks are per file: whole-project problems (types, import cycles) need a type checker or CI.
- A fixing formatter rewrites the file after Claude wrote it; if it fights a hand-written style, tune its config.
- Every edit runs every command; one past its timeout is dropped silently. Keep them fast.
- The rule is advice, not enforcement. Rules, recipes and the rule file reflect today's tools: re-run the skill after the lint setup changes; it merges.
- With the guardrails hook active, `.claude/settings.json` edits ask for confirmation.From Lichens-Innovation/ai-dev-tools, MIT.
More from Lichens-Innovation/ai-dev-tools
- 0.570score
setup-claude-just-usage
Lichens-Innovation
Reads the justfiles of a repository and, for each level that has one (root, apps/frontend, packages/ui, ...), writes a .claude/rules/use-just-commands.md…
SkillAFreshness: AClaude Code +9 - 0.570score
chromatic-init
Lichens-Innovation
Adds Chromatic visual testing to a Storybook project.
SkillAFreshness: AClaude Code +9 - 0.570score
design-loop
Lichens-Innovation
Runs the Claude Design -> React implementation loop: takes an approved component or screen proposal (or the palette card) from a Claude Design project…
SkillAFreshness: AClaude Code +9 - 0.570score
design-palette
Lichens-Innovation
Creates or migrates the canonical CSS theme palette: light/dark inputs, generated scales, semantic tokens shared by web and React Native, hand-authored…
SkillAFreshness: AClaude Code +9 - 0.570score
design-refresh
Lichens-Innovation
The one skill for updating Claude Design from the code: checks whether the synced components are behind their code, rebuilds stale screen mockups, offers…
SkillAFreshness: AClaude Code +9 - 0.570score
claude-light
Lichens-Innovation
Applies a lightweight Claude Code configuration to this project's .claude/settings.local.json: optional auto-compact window, connectors, workflows, bundled…
SkillAFreshness: AClaude Code +9 - 0.570score
react-flow-canvas-geometry
Lichens-Innovation
Compute React Flow (@xyflow) canvas geometry correctly — edge label anchors, bezier control points, handle coordinates, node bounds — so labels and edges land…
SkillAFreshness: AClaude Code +9 - 0.570score
react-coding-standards
Lichens-Innovation
Enforces internal React and TypeScript coding standards using avoid/prefer rules.
SkillAFreshness: AClaude Code +9 - 0.566score
setup-claude-guardrails
Lichens-Innovation
Installs guardrails in this project's .claude/ (and its git worktrees) that keep Claude Code from reading, writing or running commands on paths outside a…
SkillAFreshness: AClaude Code +9 - 0.566score
storybook-init
Lichens-Innovation
Installs and configures Storybook in a React or React Native project.
SkillAFreshness: AClaude Code +9 - 0.565score
react-hook-form
Lichens-Innovation
Guide for setting up react-hook-form with Zod validation in React.
SkillAFreshness: AClaude Code +9 - 0.565score
generate-pr-description
Lichens-Innovation
Generates pull request descriptions by comparing current branch with parent branch.
SkillAFreshness: AClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 6
- Last commit (this folder)
- Oct 3, 2026 (27 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Lichens-Innovation
- 0.570score
design-palette
Lichens-Innovation
Creates or migrates the canonical CSS theme palette: light/dark inputs, generated scales, semantic tokens shared by web and React Native, hand-authored…
SkillAFreshness: AClaude Code +9 - 0.570score
design-loop
Lichens-Innovation
Runs the Claude Design -> React implementation loop: takes an approved component or screen proposal (or the palette card) from a Claude Design project…
SkillAFreshness: AClaude Code +9 - 0.570score
chromatic-init
Lichens-Innovation
Adds Chromatic visual testing to a Storybook project.
SkillAFreshness: AClaude Code +9 - 0.570score
claude-light
Lichens-Innovation
Applies a lightweight Claude Code configuration to this project's .claude/settings.local.json: optional auto-compact window, connectors, workflows, bundled…
SkillAFreshness: AClaude Code +9 - 0.570score
setup-claude-just-usage
Lichens-Innovation
Reads the justfiles of a repository and, for each level that has one (root, apps/frontend, packages/ui, ...), writes a .claude/rules/use-just-commands.md…
SkillAFreshness: AClaude Code +9 - 0.570score
design-refresh
Lichens-Innovation
The one skill for updating Claude Design from the code: checks whether the synced components are behind their code, rebuilds stale screen mockups, offers…
SkillAFreshness: AClaude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get setup-claude-auto-lint-format running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
setup-claude-auto-lint-format skill. Agent Mart. https://agentmart.dev/skills/lichens-innovation-setup-claude-auto-lint-format (last updated 2026-10-24)