code-linting

Run Python (ruff) and JavaScript (Biome) linting.

290 stars

Best use case

code-linting is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Run Python (ruff) and JavaScript (Biome) linting.

Teams using code-linting should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/code-linting/SKILL.md --create-dirs "https://raw.githubusercontent.com/notque/claude-code-toolkit/main/skills/code-linting/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/code-linting/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How code-linting Compares

Feature / Agentcode-lintingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Run Python (ruff) and JavaScript (Biome) linting.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Code Linting Skill

Unified linting workflow for Python (ruff) and JavaScript (Biome). Covers check, format, and auto-fix for both languages. Only handles Python and JavaScript/TypeScript -- complex logic issues and other languages are out of scope.

## Instructions

### 1. Read Project Configuration

Before running any linter, read the repository's CLAUDE.md for project-specific linting rules -- those override every default below. Then locate the project's linter config files (`pyproject.toml` for ruff, `biome.json` for Biome). All linter invocations must use these configs as-is; never override line width, rule sets, or other project settings.

### 2. Detect Languages and Run Checks

When a project contains both Python and JavaScript/TypeScript, lint both unless the user explicitly requests a single language. Run the check command first to see what violations exist:

```bash
# Python -- use project venv when available
ruff check .
# or: ./venv/bin/ruff check .

# JavaScript/TypeScript
npx @biomejs/biome check src/
```

**Always display the complete linter output.** Never summarize results as "no issues found" or describe output secondhand -- show the actual command output so the user can see every error, warning, and style issue together.

### 3. Review Output Before Fixing

Read the full output and understand what violations exist and their severity before applying any fixes. Jumping straight to `--fix` without reviewing risks auto-removing imports that are still needed or making changes that reduce readability.

### 4. Apply Auto-Fixes

Apply `--fix` for safe categories: formatting, import ordering, and style issues that the linter can correct mechanically.

```bash
# Python
ruff check --fix .
ruff format .

# JavaScript/TypeScript
npx @biomejs/biome check --write src/
npx @biomejs/biome format --write src/
```

Only run the linters and fixes that were requested. Do not add custom rules, configuration changes, or additional tooling unless the user explicitly asks.

### 5. Review the Diff

After auto-fix, review the diff to verify changes are correct and safe:

```bash
git diff
```

Auto-fixes can occasionally remove imports that are still needed, reformat code in ways that hurt readability, or introduce subtle bugs through variable shadowing changes. Revert any problematic auto-fixes before proceeding.

### 6. Fix Remaining Issues Manually

For violations that cannot be auto-fixed, explain each one and how to resolve it:

**Python common fixes:**
- Unused import (F401): Remove or use the import
- Import order (I001): Run `ruff check --fix`
- Line too long (E501): Break into multiple lines or adjust line-length config

**JavaScript common fixes:**
- noVar: Replace `var` with `let`/`const`
- useConst: Use `const` for unchanging values
- noDoubleEquals: Use `===` instead of `==`

### 7. Verify Before Commit

Run the linter one final time to confirm zero violations before suggesting a commit:

```bash
ruff check .
ruff format --check .
npx @biomejs/biome check src/
```

Report output factually -- no self-congratulation, just the command results.

### 8. Clean Up

Remove any temporary lint report files or cache files created during execution.

### Combined Commands (if Makefile configured)

```bash
make lint       # Check both Python and JS
make lint-fix   # Fix both Python and JS
```

### Configuration Reference

| Tool | Config | Typical Line Width |
|------|--------|-------------------|
| ruff | pyproject.toml | 88-120 |
| biome | biome.json | 80-120 |

### Optional Modes

- **Strict mode**: Treat warnings as errors (fail on any issue) -- enable when requested
- **Format only**: Skip linting, only run formatting -- enable when requested
- **Ignore specific rules**: Disable particular lint rules for edge cases -- enable when requested

## Error Handling

### Error: "ruff not found"
**Cause**: Virtual environment not activated or ruff not installed
**Solution**:
- Use virtual environment path: `./venv/bin/ruff` or `./env/bin/ruff`
- Or install globally: `pip install ruff`
- Or use pipx: `pipx run ruff check .`

### Error: "biome not found"
**Cause**: Biome not installed in project
**Solution**: Run `npx @biomejs/biome` to use npx-based execution

### Error: "Configuration file not found"
**Cause**: Running from wrong directory
**Solution**: cd to project root where pyproject.toml/biome.json exist

## References

- [ruff documentation](https://docs.astral.sh/ruff/)
- [Biome documentation](https://biomejs.dev/)

Related Skills

x-api

290
from notque/claude-code-toolkit

Post tweets, build threads, upload media via the X API.

worktree-agent

290
from notque/claude-code-toolkit

Mandatory rules for agents in git worktree isolation.

workflow

290
from notque/claude-code-toolkit

Structured multi-phase workflows: review, debug, refactor, deploy, create, research, and more.

workflow-help

290
from notque/claude-code-toolkit

Interactive guide to workflow system: agents, skills, routing, execution patterns.

wordpress-uploader

290
from notque/claude-code-toolkit

WordPress REST API integration for posts and media uploads.

wordpress-live-validation

290
from notque/claude-code-toolkit

Validate published WordPress posts in browser via Playwright.

with-anti-rationalization

290
from notque/claude-code-toolkit

Anti-rationalization enforcement for maximum-rigor task execution.

voice-writer

290
from notque/claude-code-toolkit

Unified voice content generation pipeline with mandatory validation and joy-check. 8-phase pipeline: LOAD, GROUND, GENERATE, VALIDATE, REFINE, JOY-CHECK, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".

voice-validator

290
from notque/claude-code-toolkit

Critique-and-rewrite loop for voice fidelity validation.

vitest-runner

290
from notque/claude-code-toolkit

Run Vitest tests and parse results into actionable output.

video-editing

290
from notque/claude-code-toolkit

Video editing pipeline: cut footage, assemble clips via FFmpeg and Remotion.

verification-before-completion

290
from notque/claude-code-toolkit

Defense-in-depth verification before declaring any task complete.