Agent skill

Code Quality Tools

by Yikai-Liao in Yikai-Liao/symusic

Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects.

MITAuto-check passedDevelopment

Install Code Quality Tools

skills CLI
$ npx skills add Yikai-Liao/symusic --skill code-quality-tools -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Yikai-Liao/symusic code-quality-tools --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Yikai-Liao/symusic.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/code-quality-tools .claude/skills/code-quality-tools && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-quality-tools
GitHub stars
189
Token cost
~2.9k tokens
SKILL.md length
1,100 words
Files
6 (incl. references, assets)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects.

  • Works in 3 steps: Ruff: The All-in-One Linter and Formatter → MyPy: Static Type Checking → Pre-commit: Automated Quality Gates
  • Tasks that involve Linting and formatting
  • SKILL.md covers Quick Reference Card, When to Use This Skill, Core Concepts and Configuration, plus 6 more sections
  • Calls ruff, uv and mypy

What it does

Code Quality Tools is an agent skill from Yikai-Liao/symusic. Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects. Covers linting rules, type checking configuration, formatting, and CI integration.

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files and assets (for example `assets/pre-commit-config.yaml`, `references/common-issues.md` and `references/configuration-patterns.md`).

It sits in Development, covering Linting and formatting, Type safety and Code quality. It works with Ruff and Python. The repository describes itself as: A swift and unified toolkit for symbolic music processing. The licence is MIT.

When your agent uses it

  • Tasks that involve Linting and formatting
  • Tasks that involve Type safety
  • Tasks that involve Code quality

Example prompts

  • “/code-quality-tools”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Ruff: The All-in-One Linter and Formatter
  2. MyPy: Static Type Checking
  3. Pre-commit: Automated Quality Gates

What it can do on your machine

Read from SKILL.md and the folder at commit 3cdd0ee. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • ruff
    • uv
    • mypy
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.astral.sh
    • pre-commit.com
    • numpy.org
    • pre-commit.ci
    • learn.scientific-python.org
    • numpydoc.readthedocs.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Quality Tools loads about 2.9k tokens when it runs, and up to ~5.8k if it reads all its reference files. Until then it costs about 51 tokens; SKILL.md has 1,100 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Yikai-Liao/symusic at commit 3cdd0ee, republished under its MIT licence (© Yikai-Liao). 1,100 words, ~2,917 tokens.

Download SKILL.mdSave it as .claude/skills/code-quality-tools/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
code-quality-tools
description
Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects. Covers linting rules, type checking configuration, formatting, and CI integration.
metadata.assets
assets/pre-commit-config.yaml, assets/pyproject-ruff-mypy.toml
metadata.references
references/common-issues.md, references/configuration-patterns.md, references/type-hints.md

Code Quality Tools for Scientific Python

Master the essential code quality tools that keep scientific Python projects maintainable, consistent, and error-free. Learn how to configure ruff for lightning-fast linting and formatting, mypy for static type checking, and pre-commit hooks for automated quality gates. These tools help catch bugs early, enforce consistent style across teams, and make code reviews focus on logic rather than formatting.

Key Tools:

  • Ruff: Ultra-fast Python linter and formatter (replaces flake8, black, isort, and more)
  • MyPy: Static type checker for Python
  • Pre-commit: Git hook framework for automated checks

Quick Reference Card

Installation & Setup
bash
# Using uv (recommended for scientific projects)
uv add --dev ruff mypy pre-commit

# Or install into the active virtual environment
uv pip install ruff mypy pre-commit

# Initialize pre-commit
pre-commit install
Essential Ruff Commands
bash
# Check code (linting)
ruff check .

# Fix auto-fixable issues
ruff check --fix .

# Format code
ruff format .

# Check and format together
ruff check --fix . && ruff format .
Essential MyPy Commands
bash
# Type check entire project
mypy src/

# Type check with strict mode
mypy --strict src/

# Type check specific file
mypy src/mymodule/analysis.py

# Generate type coverage report
mypy --html-report mypy-report src/
Essential Pre-commit Commands
bash
# Run all hooks on all files
pre-commit run --all-files

# Run hooks on staged files only
pre-commit run

# Update hook versions
pre-commit autoupdate

# Skip hooks temporarily (not recommended)
git commit --no-verify
Quick Decision Tree
Need to enforce code style and catch common errors?
  YES → Use Ruff (linting + formatting)
  NO → Skip to type checking

Want to catch type-related bugs before runtime?
  YES → Add MyPy
  NO → Ruff alone is sufficient

Need to ensure checks run automatically?
  YES → Set up pre-commit hooks
  NO → Run tools manually (not recommended for teams)

Working with legacy code without type hints?
  YES → Start with Ruff only, add MyPy gradually
  NO → Use both Ruff and MyPy from the start

When to Use This Skill

Use this skill to establish or improve code quality practices in scientific Python projects:

  • Starting a new scientific Python project and want to establish code quality standards from day one
  • Maintaining existing research code that needs consistency and error prevention
  • Collaborating with multiple contributors who need automated style enforcement
  • Preparing code for publication or package distribution
  • Catching bugs early through static type checking before runtime
  • Automating code reviews to focus on logic rather than style
  • Integrating with CI/CD for automated quality checks
  • Migrating from older tools like black, flake8, or isort to modern alternatives

Core Concepts

1. Ruff: The All-in-One Linter and Formatter

Ruff is a blazingly fast Python linter and formatter written in Rust that replaces multiple tools you might be using today.

What Ruff Replaces:

  • flake8 (linting)
  • black (formatting)
  • isort (import sorting)
  • pyupgrade (syntax modernization)
  • pydocstyle (docstring linting)
  • And 50+ other tools

Why Ruff for Scientific Python:

Ruff is 10-100x faster than traditional tools, which matters when you have large codebases with thousands of lines of numerical code. Instead of managing multiple configuration files and tool versions, you get a single tool that handles everything. Ruff can auto-fix most issues automatically, saving time during development. It includes NumPy-aware docstring checking, understanding the conventions used throughout the scientific Python ecosystem. Best of all, it's compatible with existing black and flake8 configurations, making migration straightforward.

Example:

python
# Before ruff format
import sys
import os
import numpy as np

def calculate_mean(data):
    return np.mean(data)

# After ruff format
import os
import sys

import numpy as np


def calculate_mean(data):
    return np.mean(data)

Ruff automatically organizes imports (standard library, third party, local) and applies consistent formatting.

2. MyPy: Static Type Checking

MyPy analyzes type hints to catch errors before your code ever runs. This is especially valuable in scientific computing where dimension mismatches and type errors can lead to subtle bugs in numerical calculations.

Example of what MyPy catches:

python
import numpy as np
from numpy.typing import NDArray

def calculate_mean(data: NDArray[np.float64]) -> float:
    """Calculate mean of array."""
    return float(np.mean(data))

# MyPy catches this error at type-check time:
result: int = calculate_mean(np.array([1.0, 2.0, 3.0]))
# Error: Incompatible types (expression has type "float", variable has type "int")

Benefits for Scientific Code:

Type hints catch dimension mismatches in array operations before you run expensive computations. They validate function signatures, ensuring you pass the right types to numerical functions. Type hints serve as documentation, making it clear what types functions expect and return. They prevent None-related bugs that can crash long-running simulations. Modern IDEs use type hints to provide better autocomplete and inline documentation.

3. Pre-commit: Automated Quality Gates

Pre-commit runs checks automatically before each commit, ensuring code quality standards are maintained without manual intervention.

Workflow:

  1. Developer runs git commit
  2. Pre-commit automatically runs ruff, mypy, and other checks
  3. If checks fail, commit is blocked
  4. Developer fixes issues and commits again
  5. Once all checks pass, commit succeeds

This ensures that code quality issues are caught immediately, before they enter the codebase.

Configuration

See assets/pyproject-ruff-mypy.toml for complete Ruff and MyPy configuration examples.

See assets/pre-commit-config.yaml for pre-commit hook configuration.

Configuration Patterns

See references/configuration-patterns.md for detailed patterns including:

  • Basic Ruff configuration
  • MyPy configuration for scientific Python
  • Pre-commit configuration
  • Ruff rule selection for scientific Python
  • Fixing common Ruff warnings

Type Hints

See references/type-hints.md for type hint patterns including:

  • Gradual type hint adoption
  • NumPy array type hints
  • Handling optional and union types

Common Issues and Solutions

See references/common-issues.md for solutions to:

  • Ruff and Black formatting conflicts
  • MyPy can't find imports
  • Pre-commit hooks too slow
  • Too many Ruff errors on legacy code
  • Type hints break at runtime
  • MyPy errors in test files
  • Ruff conflicts with project style
  • Pre-commit fails in CI

Best Practices Checklist

Show full SKILL.md (452 more words)Show less
Initial Setup
  • Install ruff, mypy, and pre-commit in dev environment
  • Create pyproject.toml with tool configurations
  • Create .pre-commit-config.yaml
  • Run pre-commit install to enable git hooks
  • Run pre-commit run --all-files to check existing code
  • Document common quality commands with uv run or in project automation
Configuration
  • Set appropriate Python version target
  • Enable NumPy-specific rules (NPY) for scientific code
  • Configure NumPy-style docstring checking
  • Set up per-file ignores for special cases (init.py, scripts)
  • Configure mypy strictness appropriate for project maturity
  • Install type stubs for third-party libraries
Workflow Integration
  • Add quality checks to CI/CD pipeline
  • Document quality standards in CONTRIBUTING.md
  • Create documented uv run workflows for common quality checks
  • Set up IDE integration (VS Code, PyCharm)
  • Configure editor to run ruff on save
  • Add quality check badge to README
Team Practices
  • Run ruff check --fix before committing
  • Run ruff format before committing
  • Address mypy errors (don't use # type: ignore without reason)
  • Review pre-commit failures before using --no-verify
  • Keep pre-commit hooks updated (pre-commit autoupdate)
  • Add type hints to new functions
  • Gradually add types to existing code
Maintenance
  • Update ruff regularly (fast-moving project)
  • Update pre-commit hook versions monthly
  • Review and adjust ignored rules as project matures
  • Increase mypy strictness gradually
  • Monitor CI/CD for quality check failures
  • Refactor code flagged by quality tools

Resources and References

Official Documentation
Ruff Resources
MyPy Resources
Pre-commit Resources
Scientific Python Resources

Summary

Code quality tools are essential for maintaining scientific Python projects. Ruff provides fast, comprehensive linting and formatting. MyPy catches type errors before runtime. Pre-commit automates quality checks in your workflow.

Key takeaways:

Start with ruff for immediate impact as it replaces multiple tools with a single fast solution. Add mypy gradually as you add type hints to catch bugs early. Use pre-commit to enforce standards automatically without manual intervention. Integrate with uv for reproducible development environments. Configure tools in pyproject.toml for centralized management. Run quality checks in CI/CD to maintain standards across the team.

Next steps:

Set up ruff and pre-commit in your project today. Add type hints to new functions you write. Gradually increase mypy strictness as your codebase matures. Share configurations with your team for consistency. Integrate quality checks into your development workflow.

Quality tools save time by catching errors early and maintaining consistency across your scientific codebase. They make code reviews more productive by automating style discussions, allowing reviewers to focus on scientific correctness and algorithmic choices rather than formatting details.

© Yikai-Liao, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references, assets) in .agents/skills/code-quality-tools of Yikai-Liao/symusic.

  • SKILL.md
  • assets/pre-commit-config.yaml
  • assets/pyproject-ruff-mypy.toml
  • references/common-issues.md
  • references/configuration-patterns.md
  • references/type-hints.md

Open the folder on GitHubat commit 3cdd0ee

Compare with similar skills

Code Quality Tools next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Quality Tools compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Quality Tools this skillYikai-Liao/symusic189—~2.9kAutomated safety check: PassMIT
Cb Code QualityBlkLeg/CircuitBreaker201—~1.9kAutomated safety check: PassMIT
Vibe Python Style Guidemistralai/mistral-vibe5.1k—~1.2kAutomated safety check: PassApache-2.0
Minimizing Ty Ecosystem Changesastral-sh/ruff50k—~4.6kAutomated safety check: PassMIT
Kedro Babysitkedro-org/kedro11k—~4kAutomated safety check: PassCustom licence
Update Dependenciesalorence/django-modern-rpc111—~1.3kAutomated safety check: PassMIT

Similar skills

  • Cb Code Quality

    BlkLeg/CircuitBreaker

    Circuit Breaker code conventions and the quality gates that actually block a push — ruff, mypy, eslint, the pytest coverage ratchet, and the make verify tiers.

    201 GitHub stars~1.9k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Vibe Python Style Guide

    mistralai/mistral-vibe

    Official

    Python conventions for the Mistral Vibe codebase covering style, strict typing, imports, Pydantic patterns, logging, error handling and file I/O.

    5.1k GitHub stars~1.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "minimize this ty ecosystem change", "reproduce this ecosystem result", "investigate a primer difference", "investigate a mypyprimer difference"…

    50k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Kedro Babysit

    kedro-org/kedro

    Run Kedro's local lint / format / type-check / tests on changed files (uses the project's pre-commit hooks, ruff, mypy, pytest, lint-imports, detect-secrets, Make targets — in the right venv), or…

    11k GitHub stars~4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Update Dependencies

    alorence/django-modern-rpc

    Routine update of all project dependencies — uv itself, uv.lock (all groups), tool versions pinned in GitHub workflows and .pre-commit-config.yaml (uv, ruff, mypy...), and SHA-pinned GitHub Actions.

    111 GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Align Recipe pyproject.toml

    google/adk-recipes

    Official

    Brings a Python recipe's pyproject.toml in line with the repo's CI rules, either as a read-only dry run or by rewriting the file while keeping comments.

    10k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed

More from Yikai-Liao/symusic

All 11 skills in this repo
  • Uv Package Manager

    Yikai-Liao/symusic

    Master the uv package manager for fast Python dependency management, virtual environments, and modern Python project workflows.

    189 GitHub starsUsed in 16 repos~4k tokens
    Auto-check: notes
  • Code Reviewer

    Yikai-Liao/symusic

    Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then…

    189 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Cpp Pro

    Yikai-Liao/symusic

    Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques.

    189 GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check passed
  • Python Packaging

    Yikai-Liao/symusic

    Create and publish distributable scientific Python packages following Scientific Python community best practices.

    189 GitHub stars~2.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Debugging Wizard

    Yikai-Liao/symusic

    Parses error messages, traces execution flow through stack traces, correlates log entries to identify failure points, and applies systematic hypothesis-driven methodology to isolate and resolve bugs.

    189 GitHub starsUsed in 1 repo~909 tokens
    Auto-check passed
  • Devops Engineer

    Yikai-Liao/symusic

    Creates Dockerfiles, configures CI/CD pipelines, writes Kubernetes manifests, and generates Terraform/Pulumi infrastructure templates.

    189 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed

Works with

Categories

Questions about Code Quality Tools

What does Code Quality Tools do?

Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects. Code Quality Tools is an agent skill from Yikai-Liao/symusic. Configure and use automated code quality tools (ruff, mypy, pre-commit) for scientific Python projects.

When should I use Code Quality Tools?

Code Quality Tools fits situations like: tasks that involve Linting and formatting; tasks that involve Type safety; tasks that involve Code quality.

How do I install Code Quality Tools in Claude Code?

Run `npx skills add Yikai-Liao/symusic --skill code-quality-tools -a claude-code`. Or copy the skill folder (.agents/skills/code-quality-tools in Yikai-Liao/symusic) into .claude/skills/code-quality-tools in your project. Claude Code loads it when a task matches its description.

How do I install Code Quality Tools in Codex?

Run `npx skills add Yikai-Liao/symusic --skill code-quality-tools -a codex`. Or copy the skill folder (.agents/skills/code-quality-tools in Yikai-Liao/symusic) into .agents/skills/code-quality-tools in your project. Codex loads it when a task matches its description.

Can I use Code Quality Tools in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Yikai-Liao/symusic --skill code-quality-tools -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-quality-tools, .gemini/skills/code-quality-tools, .github/skills/code-quality-tools and .opencode/skills/code-quality-tools in your project.

What does Code Quality Tools need to run?

Going by SKILL.md and its folder, Code Quality Tools needs the command-line tools its instructions call (ruff, uv, mypy and git). Our summary lists: Python 3.

Does Code Quality Tools access the network?

SKILL.md names 6 domains. As links in the text: docs.astral.sh, pre-commit.com, numpy.org, pre-commit.ci, learn.scientific-python.org and numpydoc.readthedocs.io. This is read from the text; nothing was executed.

Is Code Quality Tools safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Quality Tools use?

Code Quality Tools is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Quality Tools use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.9k tokens, read only when the agent opens those files.

What are the alternatives to Code Quality Tools?

Skills that share tags, products or a category with Code Quality Tools: Cb Code Quality (BlkLeg/CircuitBreaker, 201 stars), Vibe Python Style Guide (mistralai/mistral-vibe, 5.1k stars), Minimizing Ty Ecosystem Changes (astral-sh/ruff, 50k stars) and Kedro Babysit (kedro-org/kedro, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Quality Tools?

Yikai-Liao (a GitHub user) maintains it in Yikai-Liao/symusic, which has 189 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on August 11, 2026.

Source: Yikai-Liao/symusic on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.