Back to skills
SkillHub ClubWrite Technical DocsFull StackTech Writer

code-style

Enforce code style and formatting preferences. Use when writing or reviewing code to ensure consistent style.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
3
Hot score
80
Updated
March 20, 2026
Overall rating
C0.8
Composite score
0.8
Best-practice grade
A92.4

Install command

npx @skill-hub/cli install legacy3-wowlab-code-style

Repository

legacy3/wowlab

Skill path: .claude/skills/code-style

Enforce code style and formatting preferences. Use when writing or reviewing code to ensure consistent style.

Open repository

Best for

Primary workflow: Write Technical Docs.

Technical facets: Full Stack, Tech Writer.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: legacy3.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install code-style into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/legacy3/wowlab before adding code-style to shared team environments
  • Use code-style for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: code-style
description: Enforce code style and formatting preferences. Use when writing or reviewing code to ensure consistent style.
---

# Code Style

Project code style and formatting rules.

## Control Flow

**Always use brackets** for control flow statements. Never single-line without braces.

### Wrong

```ts
if (condition) return early;

if (x) doSomething();
else doOther();

for (const item of items) process(item);
```

### Right

```ts
if (condition) {
  return early;
}

if (x) {
  doSomething();
} else {
  doOther();
}

for (const item of items) {
  process(item);
}
```

## DRY - Don't Repeat Yourself

**Always check for existing utilities before creating new ones.**

### Before Writing New Code

1. Search `src/hooks/` for existing React hooks
2. Search `src/lib/` for utility functions and modules
3. Search `src/lib/state/` for existing query/store hooks
4. Look for similar patterns in the codebase

### If Similar Code Exists

- Extend the existing utility
- Extract common logic into shared function
- Don't duplicate - refactor

## No Backwards Compatibility

**Prefer breaking and remaking over maintaining legacy support.**

### Do

- Delete obsolete code entirely
- Rename things to be correct, update all usages
- Remove deprecated APIs immediately
- Refactor aggressively when improving

### Don't

- Keep old function signatures "for compatibility"
- Add `// @deprecated` and leave code around
- Maintain multiple ways to do the same thing
- Add shims or adapters for old patterns
- Comment out code "in case we need it"

## No Legacy Code

**Remove, don't preserve.**

### Signs of Legacy Code to Remove

- Commented-out code blocks
- Functions with `_old`, `_legacy`, `_deprecated` suffixes
- `// TODO: remove after migration`
- Unused exports
- Dead code paths
- Backwards-compat shims

### When Refactoring

1. Delete the old implementation
2. Write the new implementation
3. Update all call sites
4. Don't provide migration period

## Code Cleanup Rules

- Delete unused imports immediately
- Remove empty files
- Delete unused variables (not just prefix with `_`)
- Remove console.log statements
- Clean up TODO comments by doing them or removing them

## Formatting - Use Intl APIs

**Use `Intl.NumberFormat` and `Intl.DateTimeFormat` for locale-aware formatting.**

### Wrong

```tsx
{
  value.toFixed(2);
}
{
  `${duration}ms`;
}
{
  (percent * 100).toFixed(1) + "%";
}
```

### Right

```tsx
// Get locale from next-intlayer
const { locale } = useLocale();

// Numbers with locale
new Intl.NumberFormat(locale).format(value);

// Compact notation (1.2M)
new Intl.NumberFormat(locale, { notation: "compact" }).format(value);

// Percentages
new Intl.NumberFormat(locale, { style: "percent" }).format(ratio);

// Relative time
new Intl.RelativeTimeFormat(locale, { numeric: "auto" }).format(days, "day");
```

## Instructions

When writing or reviewing code:

1. Check control flow has brackets
2. Search for existing utilities before creating new ones
3. Delete obsolete code, don't deprecate
4. Remove legacy patterns, don't maintain them
5. Keep codebase lean - when in doubt, delete
6. Use `Intl` APIs for locale-aware number/date/duration formatting
code-style | SkillHub