coding-standardslisted
Install: claude install-skill SilantevBitcoin/Base-system-Claude
# TypeScript Coding Standards
Universal TypeScript/JavaScript coding standards applicable across all projects.
## When to Activate
- Starting a new TypeScript 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
## Code Quality Principles
1. **Readability first** — code is read more than written; clear names; self-documenting over comments.
2. **KISS** — simplest solution that works; no premature optimization; understandable > clever.
3. **DRY** — extract common logic; share utilities; avoid copy-paste.
4. **YAGNI** — don't build features before needed; avoid speculative generality.
## Variable & Function Naming
```typescript
// GOOD: descriptive names
const marketSearchQuery = 'election'
const isUserAuthenticated = true
// BAD: unclear names
const q = 'election'
const flag = true
```
```typescript
// GOOD: verb-noun pattern
async function fetchMarketData(marketId: string) {}
function isValidEmail(email: string): boolean {}
// BAD: noun-only / unclear
async function market(id: string) {}
function email(e) {}
```
## Immutability (CRITICAL)
```typescript
// ALWAYS use spread / non-mutating ops
const updatedUser = { ...user, name: 'New Name' }
const updatedArray = [...items, newItem]
// NEVER mutate directly
user.name = 'New Name' // BAD
items.push(newItem) // BAD (unless deliberately