lint-with-conform

clempat's avatarfrom clempat

Run formatters on files based on the user's conform neovim configuration. Supports multiple languages including JavaScript, TypeScript, Python, Go, Nix, Lua, and more. Use this when the user asks to format, lint, or clean up code files.

⭐6stars🔀0forks📁View on GitHub🕐Updated Dec 19, 2025⬇️4downloads

When & Why to Use This Skill

This Claude skill automates code formatting and linting by leveraging a Neovim 'conform' configuration. It ensures consistent code style across a wide array of programming languages—including Python, JavaScript, TypeScript, Go, and Nix—by executing industry-standard formatters like Prettier, Black, and Shfmt. By integrating these tools directly into the agent's workflow, it streamlines code cleanup and maintains high-quality standards without manual intervention.

Use Cases

  • Automating Python code refinement by sequentially running isort for import organization and black for PEP 8 compliance.
  • Ensuring consistent styling in frontend development by applying prettierd to JavaScript, TypeScript, CSS, and HTML files.
  • Standardizing infrastructure-as-code and configuration files such as Terraform, Nix, and YAML to maintain project-wide conventions.
  • Quickly fixing linting issues in shell scripts or Lua configurations during the development process to prevent syntax errors and improve maintainability.
namelint-with-conform
descriptionRun formatters on files based on the user's conform neovim configuration. Supports multiple languages including JavaScript, TypeScript, Python, Go, Nix, Lua, and more. Use this when the user asks to format, lint, or clean up code files.

Lint with Conform

This skill runs formatters on files according to the conform neovim setup in ~/workspace/nvim-config.

Formatter Configuration

Based on the user's conform setup, the following formatters should be used:

  • CSS: prettierd
  • HTML/Django Templates: djlint (for htmldjango), prettierd (for html)
  • GraphQL: prettierd
  • JavaScript/JSX: prettierd
  • JSON: prettierd
  • Lua: stylua
  • Markdown: prettierd
  • Nix: nixfmt
  • Python: isort, then black (run in sequence)
  • Shell scripts: shfmt
  • Svelte: prettierd
  • Sass: prettierd
  • TypeScript/TSX: prettierd
  • Vue: prettierd
  • YAML: prettierd
  • Go: gofumpt
  • Go templates: gofumpt
  • Terraform: terraform_fmt

Instructions

When asked to lint or format files:

  1. Determine file type: Check the file extension or content to determine the language
  2. Select formatter: Use the appropriate formatter(s) from the configuration above
  3. Run formatter: Execute the formatter command with appropriate flags
  4. Show results: Display any errors or changes made

Common Formatter Commands

  • prettierd: prettierd <file> (prints formatted output to stdout)
  • nixfmt: nixfmt <file> (formats file in place)
  • stylua: stylua <file> (formats file in place)
  • black: black <file> (formats file in place)
  • isort: isort <file> (sorts imports in place)
  • shfmt: shfmt -w <file> (formats file in place)
  • gofumpt: gofumpt -w <file> (formats file in place)
  • terraform_fmt: terraform fmt <file> (formats file in place)
  • djlint: djlint --reformat <file> (formats file in place)

For Python files

Run both formatters in sequence:

isort <file> && black <file>

Handling Multiple Files

When multiple files are provided, process them according to their file types and run the appropriate formatter for each.

Error Handling

  • If a formatter is not installed, inform the user which tool is missing
  • If formatting fails, show the error message and suggest fixes
  • Skip files in node_modules directories (per user's config)

Examples

Format a single JavaScript file

prettierd src/components/Button.jsx

Format a Python file

isort main.py && black main.py

Format a Nix file

nixfmt flake.nix

Notes

  • The user's setup disables eslint_d as it's not available
  • Files in node_modules should be skipped
  • For files with formatters that modify in place, ensure to read the file first to preserve content if formatting fails