# Coding Standards

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

- Repository: https://github.com/vibeeval/vibecosystem (541 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-08-08
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add vibeeval/vibecosystem --skill coding-standards -g -a claude-code -y`
Codex: `npx skills add vibeeval/vibecosystem --skill coding-standards -g -a codex -y`
Cursor: `npx skills add vibeeval/vibecosystem --skill coding-standards -g -a cursor -y`
Gemini CLI: `npx skills add vibeeval/vibecosystem --skill coding-standards -g -a gemini-cli -y`

## Description

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

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Coding Standards

## Naming Conventions

| Tip | Format | Ornek |
|-----|--------|-------|
| Variable | camelCase | `userName`, `itemCount` |
| Function | camelCase, verb-first | `getUserById`, `calculateTotal` |
| Class/Type | PascalCase | `UserService`, `OrderItem` |
| Constant | UPPER_SNAKE | `MAX_RETRIES`, `API_URL` |
| File | kebab-case | `user-service.ts`, `order-item.ts` |
| Boolean | is/has/should prefix | `isActive`, `hasPermission` |

## Immutability

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

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

## Error Handling

```typescript
// 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)

```typescript
// 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

The rest: https://github.com/vibeeval/vibecosystem/blob/HEAD/skills/coding-standards/SKILL.md
