Communitygithub.com

코드 스타일 강제기

린터가 잡지 못하는 프로젝트별 서식 규칙을 적용하여 코드 스타일 일관성을 분석합니다. 코드 리뷰, 스타일 일관성 확인, 또는 코드 스타일 개선 요청 시 사용하세요.

코드 스타일 강제기란 무엇인가요?

이 스킬은 프로젝트의 고유한 코딩 스타일 규칙을 자동으로 감지하고, 린터 같은 도구가 놓칠 수 있는 패턴까지 찾아내어 일관된 코드 스타일을 유지하도록 돕습니다. JavaScript, TypeScript, Python, Ruby, Go, Java 등 다양한 언어를 지원하며, `.editorconfig`, `CONTRIBUTING.md`, `STYLE_GUIDE.md` 같은 설정 파일을 분석하여 프로젝트별 스타일 가이드를 파악합니다. 단순한 서식 검사뿐 아니라 네이밍 일관성, 코드 구조, 주석 스타일, 에러 처리 패턴, 매직 넘버 사용 등 고급 스타일 이슈를 식별하고 우선순위에 따라 수정 권장 사항을 제공합니다. 또한 Prettier, Black, isort, RuboCop 등 자동화 도구를 추천하고, 부재 시 `.editorconfig` 파일 생성을 제안하여 장기적인 스타일 일관성을 확보합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/crazydubya/code-style-enforcer

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

코드 스타일 강제기은(는) 무엇을 하나요?

이 스킬은 자동화된 린터가 놓칠 수 있는 프로젝트별 스타일 규칙과 패턴을 코드가 따르도록 보장합니다.

이 스킬을 사용해야 할 때

  • 사용자가 코드 스타일 리뷰 또는 개선을 요청할 때
  • 코드베이스 전체의 일관성을 보장할 때
  • 새 코드나 기여자를 온보딩할 때
  • 커밋 전 코드 리뷰 시
  • 사용자가 "스타일", "일관성", "서식", 또는 "규칙"을 언급할 때

지침

1. 프로젝트 스타일 가이드 감지

스타일 설정 파일을 찾습니다:

JavaScript/TypeScript:

  • .eslintrc.* - ESLint 설정
  • .prettierrc.* - Prettier 설정
  • tsconfig.json - TypeScript 컴파일러 옵션
  • .editorconfig - 에디터 설정

Python:

  • .pylintrc, pylint.cfg - Pylint
  • pyproject.toml - Black, isort 설정
  • .flake8 - Flake8 설정
  • setup.cfg - 다양한 도구 설정

Ruby:

  • .rubocop.yml - RuboCop 설정

Go:

  • go.fmt 적용 (표준)
  • .golangci.yml - GolangCI-Lint

Java:

  • checkstyle.xml - Checkstyle
  • .editorconfig

일반:

  • CONTRIBUTING.md - 기여 가이드라인
  • STYLE_GUIDE.md - 프로젝트 스타일 가이드
  • .editorconfig - 교차 에디터 설정

Glob을 사용하여 이러한 파일을 찾고 Read를 통해 프로젝트의 스타일 선호도를 이해합니다.

2. 기존 코드 패턴 분석

암묵적인 규칙을 이해하기 위해 기존 코드를 샘플링합니다:

파일 구성:

  • 디렉터리 구조 패턴
  • 파일 이름 규칙 (camelCase, kebab-case, snake_case)
  • import/export 구성

코드 구조:

  • 클래스/함수 순서
  • public vs private 메서드 배치
  • 상수/변수 선언 위치

서식:

  • 들여쓰기 (공백 vs 탭, 크기)
  • 줄 길이 제한
  • 빈 줄 사용
  • 주석 스타일

네이밍:

  • 변수 이름 (camelCase, snake_case)
  • 클래스 이름 (PascalCase, 대문자화)
  • 상수 이름 (UPPER_CASE 등)
  • 파일 이름 패턴

Grep을 사용하여 유사한 파일에서 공통 패턴을 찾습니다.

3. 린터 너머: 패턴 확인

자동화된 도구가 자주 놓치는 스타일 문제에 집중합니다:

네이밍 일관성:

  • 불리언 변수: is, has, should 접두사
  • 이벤트 핸들러: handle*, on* 패턴
  • Getter/Setter: get*, set* 일관성
  • 컬렉션 이름: 복수 vs 단수
  • 약어: 일관된 대문자화

코드 구성:

  • 관련 함수가 함께 그룹화됨
  • 모듈 간 일관된 파일 구조
  • 논리적 순서 (public이 private보다 먼저 등)
  • 관심사 분리

주석 및 문서:

  • JSDoc/docstring 완전성
  • 주석 스타일 일관성
  • TODO/FIXME 형식
  • 인라인 vs 블록 주석

Import/Export 패턴:

  • Import 순서 (외부, 내부, 상대)
  • Named vs default export
  • 구조 분해 할당 일관성
  • 별칭 패턴

에러 처리:

  • 일관된 에러 메시지 형식
  • 에러 클래스 사용
  • Try/catch 패턴
  • 로깅 형식

타입 사용 (TypeScript/타입 언어):

  • 명시적 vs 추론된 타입
  • interface vs type 선호도
  • 제네릭 이름 (T, K, V vs 설명적)
  • Null/undefined 처리

4. 일반적인 안티 패턴 식별

코드 스멜과 안티 패턴을 표시합니다:

매직 넘버:

// 나쁨
if (status === 200) { }

// 좋음
const HTTP_OK = 200;
if (status === HTTP_OK) { }

일관되지 않은 null 검사:

// 일관되지 않음
if (user === null) { }
if (!data) { }
if (typeof result === 'undefined') { }

// 일관됨
if (user === null) { }
if (data === null) { }
if (result === undefined) { }

중첩 삼항 연산자:

// 읽기 어려움
const value = a ? b ? c : d : e;

// 더 나음
let value;
if (a) {
  value = b ? c : d;
} else {
  value = e;
}

긴 매개변수 목록:

# 유지보수 어려움
def create_user(name, email, age, address, phone, ...):

# 더 나음
def create_user(user_data: UserData):

5. 프로젝트별 규칙 확인

이 프로젝트에 고유한 패턴을 찾습니다:

  • 특정 도메인에 대한 사용자 정의 이름 (예: "repo" vs "repository")
  • 일반 작업에 선호되는 라이브러리
  • 아키텍처 패턴 (MVC, 서비스 계층 등)
  • 테스트 파일 이름 및 구조
  • 설정 패턴

CONTRIBUTING.md, README.md 또는 유사 문서를 읽어 명시적인 지침을 확인합니다.

6. 스타일 권장 사항 생성

각 문제에 대해 다음을 제공합니다:

현재 코드:

function getData(id) {
  const d = fetch('/api/users/' + id);
  return d;
}

문제:

  • 일관되지 않은 이름 (getData vs 다른 함수는 fetch* 사용)
  • 한 글자 변수 이름 (d)
  • 템플릿 리터럴 대신 문자열 연결

권장:

function fetchUser(id) {
  const userData = fetch(`/api/users/${id}`);
  return userData;
}

7. 문제 우선순위 지정

영향도별로 정렬합니다:

높은 우선순위 (일관성):

  • 유사한 함수 간의 이름 불일치
  • 혼합된 들여쓰기 또는 서식
  • 일관되지 않은 에러 처리

중간 우선순위 (가독성):

  • 매직 넘버/문자열
  • 불명확한 변수 이름
  • 문서 부족

낮은 우선순위 (있으면 좋음):

  • 주석 서식
  • Import 순서
  • 불필요한 빈 줄

8. 자동화 도구 제안

스타일을 강제할 도구를 추천합니다:

JavaScript/TypeScript:

npm install --save-dev prettier eslint
npx prettier --write .
npx eslint --fix .

Python:

pip install black isort flake8
black .
isort .

Go:

go fmt ./...
golangci-lint run

Ruby:

gem install rubocop
rubocop -a

9. EditorConfig 생성 또는 업데이트

.editorconfig가 없으면 제안합니다:

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{js,ts,jsx,tsx}]
indent_style = space
indent_size = 2

[*.py]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab

10. 스타일 리뷰 체크리스트

코드 스타일을 리뷰할 때:

  • 이름이 프로젝트 규칙을 따름
  • 들여쓰기와 서식이 일관됨
  • Import가 적절히 구성됨
  • 필요한 곳에 주석이 있고, 과하지 않음
  • 매직 넘버나 문자열 없음
  • 에러 처리가 일관됨
  • 파일 구성이 프로젝트 구조와 일치
  • 명백한 코드 스멜 없음
  • 타입 어노테이션이 일관됨 (해당하는 경우)
  • 테스트가 테스트 규칙을 따름

모범 사례

  1. 완벽보다 일관성: 이상적이지 않더라도 기존 패턴을 따르세요
  2. 결정 사항 문서화: 모호한 경우 스타일 가이드를 추가하세요
  3. 가능한 자동화: Prettier, Black, gofmt 등을 사용하세요
  4. 실용적으로: 작동하는 코드를 스타일만으로 리팩터링하지 마세요
  5. 팀 합의: 중요한 스타일에 대해 팀과 조율하세요
  6. 점진적 개선: 모든 파일을 한 번에 수정하지 말고, 수정하는 파일의 스타일만 고치세요
  7. 가독성 우선: 스타일은 가독성을 위한 수단이지 목적이 아닙니다

일반적인 스타일 충돌

탭 vs 공백

  • .editorconfig 또는 기존 파일 확인
  • 확실하지 않으면 프로젝트의 다수 방식을 따르세요

따옴표 스타일 (작은따옴표 vs 큰따옴표)

  • JavaScript: 작은따옴표 (') 일반적
  • Python: 둘 다 가능, 일관성 유지
  • Go: 항상 큰따옴표 (")
  • 린터 설정이 있으면 따르세요

세미콜론 (JavaScript)

  • 기존 코드의 다수 방식을 확인
  • 혼합된 경우 Prettier로 강제할 것을 제안

줄 길이

  • 일반적인 제한: 80, 100, 120자
  • 린터 설정 또는 .editorconfig 확인

Import 순서

  • 일반적으로: 표준 라이브러리, 외부, 내부, 상대
  • 자동화된 도구 사용 (isort, organize imports)

지원 파일

  • reference/style-guides.md: 인기 스타일 가이드 링크
  • examples/before-after.md: 개선 사항을 보여주는 코드 예제

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬