
Coding Standards
Universal coding standards - naming, formatting, error handling, immutability, SOLID...
Install
npx skills add vibeeval/vibecosystem --skill coding-standards -g -a claude-code -y- Repository
- vibeeval/vibecosystem541
- Category
- Engineering
- Updated
- 3mo ago
- License
- MIT
- Context cost
- Lightabout 1,153 tokens
- Runs scripts
- No, instructions only
What it does
Universal coding standards - naming, formatting, error handling, immutability, SOLID principles
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
// 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);
}
