code-quality-checker

garimto81's avatarfrom garimto81

코드 품질 검사 자동화. 린트, 포맷, 타입 체크, 보안 스캔 통합.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 8, 2026

When & Why to Use This Skill

The Code Quality Checker is a comprehensive Claude skill designed to automate code quality inspections across Python and JavaScript/TypeScript projects. It integrates industry-standard tools for linting, formatting, static type checking, and security vulnerability scanning. By providing automated fixes and specialized React performance audits, it ensures codebase consistency, reduces technical debt, and strengthens security posture throughout the development lifecycle.

Use Cases

  • Automated Linting and Formatting: Maintain a clean and consistent code style across multi-language projects using tools like Ruff, Black, and Prettier to ensure readability.
  • Static Type Safety: Catch potential runtime errors early in the development process by enforcing strict type checking with Mypy for Python and TSC for TypeScript.
  • Security Vulnerability Scanning: Proactively identify and mitigate security risks in project dependencies and source code using pip-audit, Bandit, and npm audit.
  • React Performance Auditing: Optimize frontend applications by detecting critical bottlenecks such as waterfall requests, inefficient barrel file imports, and unnecessary component re-renders.
  • CI/CD Workflow Integration: Streamline the DevOps pipeline by embedding automated quality gates into GitHub Actions or pre-commit hooks to prevent substandard code from being merged.
namecode-quality-checker
description>
version2.0.0
model_preferencehaiku
phase[2, 2.5]
auto_triggertrue
token_budget1400

Code Quality Checker

코드 품질 검사 자동화 워크플로우입니다.

Quick Start

# 전체 품질 검사
python .claude/skills/code-quality-checker/scripts/run_quality_check.py

# Python만 검사
python scripts/run_quality_check.py --python-only

# 자동 수정 적용
python scripts/run_quality_check.py --fix

검사 항목

Python

도구 용도 명령어
ruff 린트 + 포맷 ruff check src/
black 포맷팅 black --check src/
mypy 타입 체크 mypy src/
pip-audit 보안 취약점 pip-audit

TypeScript/JavaScript

도구 용도 명령어
eslint 린트 npx eslint src/
prettier 포맷팅 npx prettier --check src/
tsc 타입 체크 npx tsc --noEmit
npm audit 보안 취약점 npm audit

검사 수준

Level 1: 기본 (CI 필수)

# Python
ruff check src/
black --check src/

# TypeScript
npx eslint src/
npx prettier --check src/

Level 2: 타입 검사 (권장)

# Python
mypy src/ --strict

# TypeScript
npx tsc --noEmit --strict

Level 3: 보안 (배포 전 필수)

# Python
pip-audit --strict
bandit -r src/

# TypeScript
npm audit --audit-level=high

자동 수정

안전한 자동 수정

# Python 포맷팅
black src/
ruff check src/ --fix

# TypeScript 포맷팅
npx prettier --write src/
npx eslint src/ --fix

수동 확인 필요

이슈 이유
타입 오류 로직 변경 가능성
보안 취약점 의존성 호환성
복잡한 린트 규칙 의도적일 수 있음

설정 파일

Python (pyproject.toml)

[tool.ruff]
line-length = 100
select = ["E", "F", "W", "I", "N", "UP", "B", "C4"]

[tool.black]
line-length = 100

[tool.mypy]
python_version = "3.11"
strict = true

TypeScript (eslint.config.js)

export default [
  {
    rules: {
      "@typescript-eslint/no-unused-vars": "error",
      "@typescript-eslint/explicit-function-return-type": "warn",
    }
  }
];

CI 통합

GitHub Actions

- name: Code Quality
  run: |
    ruff check src/
    black --check src/
    mypy src/

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.1.0
    hooks:
      - id: ruff
      - id: ruff-format

오류 해결 가이드

일반적인 ruff 오류

코드 설명 해결
E501 줄 길이 초과 줄 분할 또는 무시 설정
F401 미사용 import import 제거
F841 미사용 변수 변수 제거 또는 _ 사용

mypy 오류

오류 설명 해결
Missing return 반환 타입 누락 -> Type 추가
Incompatible types 타입 불일치 타입 수정 또는 캐스팅
Module has no attribute 모듈 속성 없음 타입 스텁 설치

React 성능 검사

React 검사 모드

# React 성능 규칙 검사
/check --react

# 특정 디렉토리만
/check --react src/components/

# 품질 + React 검사 조합
python scripts/run_quality_check.py --react

검사 항목

우선순위 카테고리 검사 내용
🔴 CRITICAL Waterfall sequential await 감지
🔴 CRITICAL Bundle barrel file import 감지
🟠 HIGH Server RSC 직렬화 최적화
🟡 MEDIUM Re-render stale closure, 불필요한 렌더링

연동 스킬

vercel-react-best-practices 스킬의 49개 규칙을 기반으로 검사합니다. 상세 규칙: .claude/skills/vercel-react-best-practices/AGENTS.md


관련 도구

도구 용도
scripts/run_quality_check.py 통합 검사
code-reviewer 에이전트 코드 리뷰
security-auditor 에이전트 보안 검사
vercel-react-best-practices 스킬 React 성능 검사
/check 통합 검증 커맨드

참조: CLAUDE.md 섹션 2 Build & Test