본문으로 건너뛰기
Skillpedia
일반 코딩280k · #151

coding-standards

하는 일

이 도구는 작성된 코드가 좋은 프로그래밍 관행을 따르도록 돕습니다. 변수 이름, 가독성, 불변성(생성 후 데이터가 바뀌지 않는 성질), 전체 코드 품질을 확인합니다.

사용하는 경우

  • ✓새 프로젝트나 그 일부를 시작할 때.
  • ✓다른 사람의 코드를 검토해 명확하고 유지보수하기 쉬운지 확인할 때.
  • ✓기존 코드를 정리하거나 개선할 때.

스킬 링크

https://github.com/affaan-m/ECC/blob/main/pi/core/skills/coding-standards/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/pi/core/skills/coding-standards/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 코드가 좋은 이름 짓기와 가독성 관행을 따르는지 검토해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 코드를 명확성, 단순성, 구조에 관한 미리 정해진 규칙과 비교합니다. 이름이 설명적인지, 코드를 이해하고 유지보수하기 쉬운지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Coding Standards & Best Practices

Baseline coding conventions applicable across projects.

This skill is the shared floor, not the detailed framework playbook.

  • Use frontend-patterns for React, state, forms, rendering, and UI architecture.
  • Use backend-patterns or api-design for repository/service layers, endpoint design, validation, and server-specific concerns.
  • Use rules/common/coding-style.md when you need the shortest reusable rule layer instead of a full skill walkthrough.

When to Activate

  • Starting a new project or module
  • Reviewing code for quality and maintainability
  • Refactoring existing code to follow conventions
  • Enforcing naming, formatting, or structural consistency
  • Setting up linting, formatting, or type-checking rules
  • Onboarding new contributors to coding conventions

Scope Boundaries

Activate this skill for:

  • descriptive naming
  • immutability defaults
  • readability, KISS, DRY, and YAGNI enforcement
  • error-handling expectations and code-smell review

Do not use this skill as the primary source for:

  • React composition, hooks, or rendering patterns
  • backend architecture, API design, or database layering
  • domain-specific framework guidance when a narrower ECC skill already exists

Code Quality Principles

1. Readability First

  • Code is read more than written
  • Clear variable and function names
  • Self-documenting code preferred over comments
  • Consistent formatting

2. KISS (Keep It Simple, Stupid)

  • Simplest solution that works
  • Avoid over-engineering
  • No premature optimization
  • Easy to understand > clever code

3. DRY (Don't Repeat Yourself)

  • Extract common logic into functions
  • Create reusable components
  • Share utilities across modules
  • Avoid copy-paste programming

4. YAGNI (You Aren't Gonna Need It)

  • Don't build features before they're needed
  • Avoid speculative generality
  • Add complexity only when required
  • Start simple, refactor when needed

TypeScript/JavaScript Standards

Variable Naming

// PASS: GOOD: Descriptive names
const marketSearchQuery = 'election'
const isUserAuthenticated = true
const totalRevenue = 1000

// FAIL: BAD: Unclear names
const q = 'election'
const flag = true
const x = 1000

Function Naming

// PASS: GOOD: Verb-noun pattern
async function fetchMarketData(marketId: string) { }
function calculateSimilarity(a: number[], b: number[]) { }
function isValidEmail(email: string): boolean { }

// FAIL: BAD: Unclear or noun-only
async function market(id: string) { }
function similarity(a, b) { }
function email(e) { }

Immutability Pattern (CRITICAL)

// PASS: ALWAYS use spread operator
const updatedUser = {
  ...user,
  name: 'New Name'
}

const updatedArray = [...items, newItem]

// FAIL: NEVER mutate directly
user.name = 'New Name'  // BAD
items.push(newItem)     // BAD

Error Handling

// PASS: GOOD: Comprehensive error handling
async function fetchData(url: string) {
  try {
    const response = await fetch(url)

    if (!response.ok) {
      throw new Error(`HTTP ${response.status}: ${response.statusText}`)
    }

    return await response.json()
  } catch (error) {
    console.error('Fetch failed:', error)
    throw new Error('Failed to fetch data')
  }
}

// FAIL: BAD: No error handling
async function fetchData(url) {
  const response = await fetch(url)
  return response.json()
}

Async/Await Best Practices

// PASS: GOOD: Parallel execution when possible
const [users, markets, stats] = await Promise.all([
  fetchUsers(),
  fetchMarkets(),
  fetchStats()
])

// FAIL: BAD: Sequential when unnecessary
const users = await fetchUsers()
const markets = await fetchMarkets()
const stats = await fetchStats()

Type Safety

// PASS: GOOD: Proper types
interface Market {
  id: string
  name: string
  status: 'active' | 'resolved' | 'closed'
  created_at: Date
}

function getMarket(id: string): Promise<Market> {
  // Implementation
}

// FAIL: BAD: Using 'any'
function getMarket(id: any): Promise<any> {
  // Implementation
}

React Best Practices

Component Structure

// PASS: GOOD: Functional component with types
interface ButtonProps {
  children: React.ReactNode
  onClick: () => void
  disabled?: boolean
  variant?: 'primary' | 'secondary'
}

export function Button({
  children,
  onClick,
  disabled = false,
  variant = 'primary'
}: ButtonProps) {
  return (

…
자주 묻는 질문

‘불변성(immutability)’이란 무엇인가요?

데이터가 한번 만들어지면 바꿀 수 없다는 뜻입니다. 프로그래밍에서 데이터가 의도치 않게 바뀌지 않으므로, 예상치 못한 오류를 막는 데 도움이 됩니다.

‘코딩 모범 사례’란 무엇인가요?

읽기 쉽고, 이해하고, 유지보수하기 쉬우며, 올바르게 작동하는 고품질 코드를 쓰도록 돕는 규칙과 권장 사항의 집합입니다.

언제 이 도구 대신 더 구체적인 도구를 쓰나요?

React나 Node.js 같은 특정 기술에 집중하지 않고, 어떤 프로젝트에도 적용되는 일반적인 코드 품질 규칙이 필요할 때 이 도구를 쓰세요.

상세 정보

작성자의 원본 설명

Baseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-specific patterns. Use when reviewing code quality or naming with no framework-specific skill that applies.

repo: affaan-m/ECC

인기도

GitHub 스타
280k
순위
#151
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬