Skip to content
Back to skills

Coding Standards

ASecurity

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

  • 20 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 7, 2026
developmentjavascripttypescriptjavareactnextjsnodetestingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add changoo89/claude-pilot --skill coding-standards --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding Standards?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding Standards
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/changoo89-coding-standards/badge)](https://www.skillsdirectory.com/skills/changoo89-coding-standards)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: coding-standards
description: Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.
---

# Coding Standards & Best Practices

Universal coding standards applicable across all projects.

## Code Quality Principles

- **Readability First**: Clear names, self-documenting code
- **KISS**: Simplest solution, avoid over-engineering
- **DRY**: Extract common logic, reusable components
- **YAGNI**: Build only what's needed

## TypeScript/JavaScript Standards

### Immutability Pattern (CRITICAL)

```typescript
// ✅ Spread operator
const updated = { ...user, name: 'New' }
const items = [...list, newItem]

// ❌ Direct mutation
user.name = 'New'
items.push(newItem)
```

### Error Handling

```typescript
async function fetchData(url: string) {
  try {
    const response = await fetch(url)
    if (!response.ok) throw new Error(`HTTP ${response.status}`)
    return await response.json()
  } catch (error) {
    throw new Error('Failed to fetch')
  }
}
```

### Async/Await & Type Safety

```typescript
// ✅ Parallel execution
const [users, markets] = await Promise.all([fetchUsers(), fetchMarkets()])

// ✅ Proper types
interface Market { id: string; status: 'active' | 'resolved' }

// ❌ Using 'any' or sequential when unnecessary
```

## React Best Practices

### Component Structure

```typescript
interface ButtonProps {
  children: React.ReactNode
  onClick: () => void
  disabled?: boolean
}

export function Button({ children, onClick, disabled = false }: ButtonProps) {
  return <button onClick={onClick} disabled={disabled}>{children}</button>
}
```

### Custom Hooks & State

```typescript
export function useDebounce<T>(value: T, delay: number): T {
  const [debouncedValue, setDebouncedValue] = useState<T>(value)
  useEffect(() => {
    const handler = setTimeout(() => setDebouncedValue(value), delay)
    return () => clearTimeout(handler)
  }, [value, delay])
  return debouncedValue
}

// ✅ Functional update | ❌ Direct reference (stale)
setCount(prev => prev + 1) | setCount(count + 1)
```

## API Design Standards

### REST API Conventions

```
GET/POST/PUT/PATCH/DELETE /api/markets/:id
```

### Response Format & Validation

```typescript
interface ApiResponse<T> {
  success: boolean
  data?: T
  error?: string
}

import { z } from 'zod'
const Schema = z.object({ name: z.string().min(1) })
const validated = Schema.parse(body)
```

## File Organization

```
src/
├── app/          # Next.js App Router
├── components/   # React components (PascalCase.tsx)
├── hooks/        # Custom hooks (use*.ts)
├── lib/          # Utilities (camelCase.ts)
├── types/        # TypeScript types (*.types.ts)
└── styles/       # Global styles
```

## Code Smell Detection

- **Long Functions**: >50 lines → split
- **Deep Nesting**: >3 levels → early returns
- **Magic Numbers**: unexplained → named constants

## Testing Standards (AAA)

```typescript
test('returns empty array when no match', () => {
  const result = search(query)
  expect(result).toEqual([])
})
```

## Further Reading

**Internal**: @.claude/skills/coding-standards/REFERENCE.md - Advanced patterns, hooks library, API design, testing strategies | @.claude/skills/vibe-coding/SKILL.md - Code quality limits

**External**: [TypeScript Handbook](https://www.typescriptlang.org/docs/) | [React Docs](https://react.dev/)

Files in this skill

  • REFERENCE.md6.7 KB
  • SKILL.md3.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.