본문으로 건너뛰기
cccskills
무료GitHub에 공개

coding-standards

Universal coding standards - naming, formatting, error handling, immutability, SOLID principles

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Coding Standards

Naming Conventions

TipFormatOrnek
VariablecamelCaseuserName, itemCount
FunctioncamelCase, verb-firstgetUserById, calculateTotal
Class/TypePascalCaseUserService, OrderItem
ConstantUPPER_SNAKEMAX_RETRIES, API_URL
Filekebab-caseuser-service.ts, order-item.ts
Booleanis/has/should prefixisActive, hasPermission

Immutability

// YANLIS: Mutate
user.name = newName;
items.push(newItem);

// DOGRU: Yeni obje
const updated = { ...user, name: newName };
const newItems = [...items, newItem];

Error Handling

// Custom error class
class AppError extends Error {
  constructor(public code: string, message: string, public statusCode = 500) {
    super(message);
  }
}

// Try-catch with specific errors
try {
  const result = await riskyOperation();
  return result;
} catch (error) {
  if (error instanceof ValidationError) {
    throw new AppError('VALIDATION', error.message, 400);
  }
  throw new AppError('INTERNAL', 'Unexpected error', 500);
}

Function Rules

  • Max 50 satir, tek sorumluluk
  • Max 3 parametre (fazlasi obje olarak)
  • Early return (nested if yerine guard clause)
  • Pure function tercih et (side effect yok)
// YANLIS: Deep nesting
function process(user) {
  if (user) {
    if (user.isActive) {
      if (user.hasPermission) {
        return doWork(user);
      }
    }
  }
}

// DOGRU: Early return
function process(user) {
  if (!user) return null;
  if (!user.isActive) return null;
  if (!user.hasPermission) return null;
  return doWork(user);
}

SOLID Principles

PrensipKural
S - Single ResponsibilityHer sinif/fonksiyon tek is
O - Open/ClosedExtension'a acik, modification'a kapali
L - Liskov SubstitutionAlt tip, ust tipin yerine gecebilmeli
I - Interface SegregationKucuk, specific interface'ler
D - Dependency InversionAbstraction'a baglan, concrete'e degil

Result<T,E> Pattern (Functional Error Handling)

Exception fırlatmak yerine explicit error dondur. Ozellikle API katmaninda, service'lerde ve veri islemede kullan.

// Result type tanimi
type Result<T, E = Error> =
  | { ok: true; value: T }
  | { ok: false; error: E };

// Kullanim
function parseConfig(raw: string): Result<Config, ValidationError> {
  try {
    const parsed = JSON.parse(raw);
    if (!isValidConfig(parsed)) {
      return { ok: false, error: new ValidationError('Invalid config shape') };
    }
    return { ok: true, value: parsed as Config };
  } catch {
    return { ok: false, error: new ValidationError('Invalid JSON') };
  }
}

// Tuketim
const result = parseConfig(input);
if (!result.ok) {
  logger.warn('Config parse failed', { error: result.error.message });
  return fallbackConfig;
}
const config = result.value;

Ne zaman kullan: Service layer, parser, validator, external API cagrisi Ne zaman kullanma: Basit utility, internal fonksiyon (try/catch yeterli)

Comment Rules

  • Yorumlar zamansiz olmali: "Simdi boyle cunku..." yerine "Bu yaklasim X sebebiyle tercih edildi" yaz
  • Neden > Ne: Kod ne yaptigini zaten gosteriyor, NEDEN yaptigini yaz
  • Clarity over brevity: Kisa yorum ama anlamsizsa, uzun ama anlamli yorum yaz
  • Yanlis yorum > yorum yok: Yanlis yorum tehlikelidir, guncellenmeyen yorum sil
// YANLIS: Ne yaptigini anlatiyor (gereksiz)
// Kullanici adini buyuk harfe cevir
const name = user.name.toUpperCase();

// DOGRU: Neden yapildigini anlatiyor
// Legacy API buyuk harf bekliyor, v3'te kaldirilacak
const name = user.name.toUpperCase();

function vs Arrow Function

DurumTercihNeden
Exported fonksiyonfunction declarationHoisted, debug stack trace'de gorunur
React componentfunction declarationTutarlilik, DevTools'da isim gorunur
Callback, inlineArrow =>Kisa, this binding yok
MethodArrow (class field)this binding garantili
// DOGRU: Exported fonksiyon
export function calculateTotal(items: Item[]): number {
  return items.reduce((sum, item) => sum + item.price, 0);
}

// DOGRU: Callback
const filtered = items.filter(item => item.active);

Anti-Patterns

Anti-PatternCozum
Magic numberNamed constant kullan
God class/functionParcala, tek sorumluluk
console.log debugLogger kullan, commit etme
Hardcoded valuesConfig/env variable
Any typeSpecific type tanimla

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

WCAG 2.2 AA compliance, ARIA patterns, keyboard navigation, screen reader optimization

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vibeeval/vibecosystem5382026년 8월 9일 업데이트

axe-core integration, WCAG 2.2 AA checklist, keyboard navigation testing, screen reader testing, and ARIA pattern validation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vibeeval/vibecosystem5382026년 8월 9일 업데이트

Steam-style achievement system with XP, levels, streaks, and skill trees. Gamifies the development workflow. 25 achievements across 5 categories.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vibeeval/vibecosystem5382026년 8월 9일 업데이트

Framework for measuring and tracking agent response quality over time. Detects regressions before they reach production. Use when evaluating agent changes, auditing quality, or establishing performance baselines.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vibeeval/vibecosystem5382026년 8월 9일 업데이트

Agent Context Isolation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vibeeval/vibecosystem5382026년 8월 9일 업데이트

Agent ve skill dosyalarinin yapisal dogrulamasi. Frontmatter kontrol, naming convention, zorunlu bolum kontrolu, tutarlilik denetimi. Yeni agent/skill eklendiginde veya mevcut dosyalar duzenlediginde otomatik calistirilir.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vibeeval/vibecosystem5382026년 8월 9일 업데이트

vibeeval의 스킬 모두 보기

이 스킬의 문제 신고