本文へ移動
cccskills
無料GitHub で公開

code-quality

Run code quality checks (ruff, mypy, pytest) and optionally simplify code. This skill should be used when the user wants to check code quality, run linters, run tests, or simplify recently modified code. Triggered by /lint, /check, or /code-quality commands.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Code Quality Check

This skill runs code quality tools (ruff, mypy, pytest) and optionally simplifies code.

Usage

/code-quality [options]

Options

  • --all or -a: Run on all synapse/ files (default: recently modified files only)
  • --no-simplify: Skip code-simplifier agent (by default, code-simplifier runs after checks pass)
  • --fix or -f: Auto-fix ruff issues with --fix flag
  • --test or -t: Run pytest after linting passes
  • --full: Run all checks including tests (equivalent to --fix --test)

Workflow

Step 1: Identify Target Files

If --all flag is provided:

  • Target all files in synapse/ directory

Otherwise:

  • Run git diff --name-only HEAD~1 to get recently modified files
  • Filter to only .py files in synapse/ or tests/

Step 2: Run Ruff Linter

ruff check [files]

If --fix flag is provided:

ruff check --fix [files]

Report any errors found. If errors remain after fix, stop and report.

Step 3: Run Mypy Type Checker

uv run mypy [files]

Report any type errors found. If errors exist, stop and report.

Step 4: Run Tests (if --test or --full)

If --test or --full flag is provided AND ruff/mypy passed:

pytest

For running specific tests related to modified files:

pytest tests/ -v

Report any test failures.

Step 5: Run Code Simplifier (Default)

By default, run code-simplifier after all checks pass. Skip with --no-simplify flag.

Use the code-simplifier:code-simplifier agent to simplify the recently modified code:

Task tool with subagent_type: code-simplifier:code-simplifier
Prompt: Simplify and refine the recently modified code in [files].
Look for opportunities to reduce duplication, simplify conditionals,
and improve readability while maintaining all functionality.

Step 6: Report Results

Summarize:

  • Number of files checked
  • Ruff status (pass/fail, errors fixed if --fix)
  • Mypy status (pass/fail)
  • Pytest status (pass/fail, skipped if not run)
  • Code simplifier status (run by default, skipped if --no-simplify)

Error Handling

When errors are found:

  1. Ruff errors: If --fix is provided, attempt auto-fix first. Report remaining errors with file:line format.
  2. Mypy errors: Report type errors with file:line format. Suggest fixes based on error messages.
  3. Test failures: Report failed test names and assertion errors. Do NOT proceed to simplification if tests fail.

Examples

Basic check on recent changes

/code-quality

Check all files with auto-fix

/code-quality --all --fix

Full quality check with tests

/code-quality --full

Run with tests only

/code-quality --test

Skip code simplification

/code-quality --no-simplify

Shorthand

/lint          # Same as /code-quality (includes simplification)
/check         # Same as /code-quality
/lint -a -f    # All files with auto-fix
/lint -t       # With tests
/lint --full   # Full check (--fix --test)
/lint --no-simplify  # Skip simplification

Tool Configuration

This project uses the following configurations (from pyproject.toml):

Ruff

  • Target: Python 3.10
  • Line length: 88
  • Rules: E, F, I, UP, B, SIM
  • Ignored: E501, B008
  • Excluded: synapse/proto/a2a_pb2*.py

Mypy

  • Strict mode with disallow_untyped_defs
  • Tests have relaxed rules (ignore_errors)
  • Proto files excluded

Pytest

  • asyncio_mode: auto
  • Run with: pytest or pytest tests/ -v

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Design, review, and improve Claude/Codex skills based on Anthropic's "The Complete Guide to Building Skills for Claude". Use when creating a new skill, rewriting SKILL.md frontmatter and workflows, fixing under-triggering or over-triggering, designing scripts/references/assets, building test cases, or preparing a skill for upload/distribution.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

This skill enables web searching using Brave Search API directly via curl. Use when searching for current information, news, articles, or web content. MCP server not required - calls API directly.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

Perform structured code reviews focusing on correctness, readability, security, and maintainability. Use this skill when reviewing pull requests, evaluating code changes, or establishing review standards for a team.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. This skill should be used after implementing features or bug fixes to clean up code, when refactoring for readability, or when reducing unnecessary complexity. It launches the code-simplifier subagent provided by the code-simplifier@claude-plugins-official plugin.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise. This skill should be used when code-quality checks pass but the code would benefit from structural cleanup — deduplication, branching simplification, naming improvements, or dead-code removal. Invoked as a subagent from /code-quality or directly via the Task tool.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

commit

無料

Create a well-formed git commit from current changes using session history for rationale and summary; use when asked to commit, prepare a commit message, or finalize staged work.

日本語の概要は準備中です。原文の説明を表示しています。

s-hiraoku/vscode-sidebar-terminal222026年10月8日 更新

s-hiraoku のスキルをすべて見る

このスキルの問題を報告する