Claude-skill-registry lintstagedrc
Generates .lintstagedrc configuration to automatically fix and format staged files before commit. Runs ESLint, Stylelint, and Prettier on staged files.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/lintstagedrc" ~/.claude/skills/majiayu000-claude-skill-registry-lintstagedrc && rm -rf "$T"
manifest:
skills/data/lintstagedrc/SKILL.mdsource content
Lint-Staged Configuration Skill
Purpose
Generate lint-staged configuration to automatically fix and format staged files before commit.
🚨 MANDATORY FILE COUNT
This skill MUST create exactly 1 file:
(preferred format).lintstagedrc.json
🔍 BEFORE GENERATING - CRITICAL RESEARCH REQUIRED
⚠️ HIGH PRIORITY: Verify current tool CLI flags to prevent outdated commands
Required Research Steps:
- ESLint CLI Flags: Verify
is still the correct flageslint --fix- Check if ESLint CLI has deprecated or changed flags
- Verify
flag still works with current ESLint version--fix
- Prettier CLI Flags: Verify
is still correctprettier --write- Check if Prettier CLI has changed flags
- Verify
flag syntax hasn't changed--write
- Stylelint CLI (if project uses Stylelint):
- Check
forpackage.json
dependencystylelint - If found: Verify
is correct flagstylelint --fix - Include style file patterns in configuration
- Check
- File Patterns: Verify glob patterns work with lint-staged version
- Check if pattern syntax has changed
- Verify file extension support (jsx, tsx, css, scss)
- Command Chaining: Verify array of commands still executes sequentially
- Alternative Formats: Check if
is still recommended format.lintstagedrc.json- Verify not deprecated in favor of
or package.json field.lintstagedrc.js
- Verify not deprecated in favor of
Output
Create the file:
.lintstagedrc.json
Supported Format:
(strict preferred format - simple JSON configuration).lintstagedrc.json
Alternative Formats (only if JSON deprecated):
(JavaScript with dynamic logic).lintstagedrc.js
field inlint-stagedpackage.json
(CommonJS format).lintstagedrc.cjs
Example File
See:
examples.md in this directory for complete examples and detailed explanations.
⚠️ IMPORTANT: The examples.md file contains December 2025 configurations. Always verify current CLI flags before using.
Execution Checklist
- Research current ESLint CLI flags (verify
)--fix - Research current Prettier CLI flags (verify
)--write - Check if project has Stylelint in package.json
- If Stylelint found, verify
flagstylelint --fix - Determine file patterns based on project needs (jsx/tsx/css/scss)
- Verify lint-staged glob pattern syntax hasn't changed
- Create
with appropriate commands and patterns.lintstagedrc.json - Verify JSON format is still recommended (not deprecated)
🛑 BLOCKING VALIDATION CHECKPOINT
STOP! Before proceeding to the next skill, verify:
Automated Verification
Run this command to verify the file exists:
if [ -f ".lintstagedrc.json" ] || [ -f ".lintstagedrc.js" ] || [ -f ".lintstagedrc.cjs" ] || grep -q "lint-staged" package.json 2>/dev/null; then echo "✓ Lint-staged configuration found" if [ -f ".lintstagedrc.json" ]; then echo "✓ Using .lintstagedrc.json (preferred format)" # Validate JSON syntax if command -v jq >/dev/null 2>&1; then jq empty .lintstagedrc.json && echo "✓ Valid JSON syntax" || echo "✗ Invalid JSON syntax" fi fi else echo "✗ Lint-staged configuration missing" exit 1 fi
Manual Verification
- ✓
exists at project root.lintstagedrc.json - ✓ File contains valid JSON syntax
- ✓ File includes ESLint command with current flags
- ✓ File includes Prettier command with current flags
- ✓ File patterns match project file types (js/ts/vue, optionally jsx/tsx/css/scss)
- ✓ Commands use current CLI flags (not deprecated)
- ✓ If Stylelint in project, style files have stylelint command
If Validation Fails
DO NOT PROCEED to the next skill. Create or fix the missing/incorrect file immediately.
Notes
- ESLint Auto-Fix: Runs
on JS/TS/Vue files (verify flag current)eslint --fix - Prettier Formatting: Runs
on code and config files (verify flag current)prettier --write - Fast and Efficient: Only processes staged files, not entire codebase
- Husky Integration: Works with pre-commit hook for automated quality checks
- Prevents Bad Commits: Blocks commits that don't meet linting standards
- Sequential Execution: Commands in array run sequentially for each file
- File Patterns: Supports glob patterns (
,*.{js,ts,vue}
)*.{css,scss} - Extended Patterns: Include jsx/tsx if React, css/scss if using style files
- Stylelint Optional: Only include if project has
in package.jsonstylelint - Always verify current CLI flags - Tools may change flag syntax
- JSON Format Preferred: Simple, declarative, works without build step
- Command Arrays: Multiple commands per pattern run sequentially on same files