agentsclimarketplace

Coding standards

Skill vibeeval/vibecosystem/skills/coding-standards

Universal coding standards - naming, formatting, error handling, immutability, SOLID principlesFrom its SKILL.md

Install
npx -y skills add vibeeval/vibecosystem --skill coding-standards

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

4.6 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it

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

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.