Skip to main content
rule CX Codex

coding-style · worldflowai — Claude Code rule: what it does and how to install

coding-style is a Claude Code rule for code structure and quality checks. It applies while an agent writes or changes code.

MIT ★ 6,739 updated 2026-01-23

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code
Open on GitHub

What coding-style does

The rule asks the agent to return new objects rather than alter existing ones, and to split code into small files grouped by feature or domain. Errors need handling with a clear message, and user input needs validation.

Before finishing, the checklist covers readable names, function size, nesting, error handling, and avoiding console.log and hardcoded values. Files have an 800-line ceiling; functions should stay under 50 lines.

What it helps with

  • update objects without changing the originals
  • split large files by project feature
  • handle failures with clear messages
  • validate input from users
  • review code against a completion checklist

Example prompts for the agent

  • Split this large component into smaller files grouped by feature.
  • Rewrite the user update so the original object stays unchanged.
  • Check these changes before finishing and fix input-handling issues.

How to install coding-style

1Plugin marketplace

/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code

2Manually: put the files in place

.claude/rules/coding-style.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about coding-style

How do I install coding-style in Claude Code?

Run these commands in order: /plugin marketplace add WorldFlowAI/everything-claude-code, then /plugin install everything-claude-code@everything-claude-code. The rule file is .claude/rules/coding-style.md.

What does coding-style do?

It sets guidelines for immutable objects, file organization, error handling, and input validation. It also provides checks to run before work is marked complete.

What file and function sizes does coding-style specify?

Files have an 800-line maximum, and functions should be shorter than 50 lines.

Source text

coding-style.md · MIT
# Coding Style

## Immutability (CRITICAL)

ALWAYS create new objects, NEVER mutate:

```javascript
// WRONG: Mutation
function updateUser(user, name) {
  user.name = name  // MUTATION!
  return user
}

// CORRECT: Immutability
function updateUser(user, name) {
  return {
    ...user,
    name
  }
}
```

## File Organization

MANY SMALL FILES > FEW LARGE FILES:
- High cohesion, low coupling
- 200-400 lines typical, 800 max
- Extract utilities from large components
- Organize by feature/domain, not by type

## Error Handling

ALWAYS handle errors comprehensively:

```typescript
try {
  const result = await riskyOperation()
  return result
} catch (error) {
  console.error('Operation failed:', error)
  throw new Error('Detailed user-friendly message')
}
```

## Input Validation

ALWAYS validate user input:

```typescript
import { z } from 'zod'

const schema = z.object({
  email: z.string().email(),
  age: z.number().int().min(0).max(150)
})

const validated = schema.parse(input)
```

## Code Quality Checklist

Before marking work complete:
- [ ] Code is readable and well-named
- [ ] Functions are small (<50 lines)
- [ ] Files are focused (<800 lines)
- [ ] No deep nesting (>4 levels)
- [ ] Proper error handling
- [ ] No console.log statements
- [ ] No hardcoded values
- [ ] No mutation (immutable patterns used)

© Affaan Mustafa · MIT · WorldFlowAI/everything-claude-code

Similar IDE rules

All IDE rules for Code review and refactoring →

coding-style by other authors comes first.

coding-style Aaronontheweb The coding-style rule guides C# structure and style, from data types to error handling. Use it when you want an agent to follow functional patterns and keep abstractions focused. CX Codex +1 ★ 138repo stars coding-standards affaan-m coding-standards is a Claude Code skill that sets conventions for naming, immutability, and clean code. Use it during code reviews and refactoring. CX Codex +1 7,900installs dry-refactoring kucherenko The dry-refactoring skill automates refactoring of copy-paste clones found by jscpd. It guides you through extraction strategies—function, parameterization, module or class—and highlights which files to start with. CX Codex +1 4,100installs daily-coding Galaxy-Dawn daily-coding — a checklist skill for everyday coding: it makes the agent read a file before editing, keep changes minimal and check for security holes. CX Codex +1 376installs typescript-quality claude-dev-suite typescript-quality — a skill for TypeScript and JavaScript code quality: ESLint, Biome and strict tsconfig setups. Useful when lint rules pile up and types start drifting. CX Codex +1 1,100installs code-quality zernie code-quality — a skill for refactoring TypeScript and JavaScript: tightens types, removes impossible states, and separates logic from IO. CX Codex +1 392installs javascript-typescript-code-quality-cursorrules-pro PatrickJS javascript-typescript-code-quality-cursorrules-pro — a Cursor rule for cleaner JavaScript and TypeScript work. It guides code structure, comments, function order, and narrowly scoped edits. CX Codex +1 ★ 41,178repo stars

From the same set29

The whole set →
git-workflow The git-workflow rule defines commit formats (feat, fix, docs and five other types), PR steps, and a three-stage flow with planner, TDD-guide and code-reviewer agents. CX Codex +1 ★ 6,739repo stars patterns patterns sets standard TypeScript interfaces for APIs and repositories, provides a useDebounce hook, and defines a workflow for evaluating skeleton repos. CX Codex +1 ★ 6,739repo stars verify The verify command checks the build, types, lint, tests, logs, and Git state. Use it before a commit or pull request. CX Codex +1 ★ 6,739repo stars performance performance — a Claude Code rule that matches model to task and keeps heavy refactors away from the tail of the context window. CX Codex +1 ★ 6,739repo stars hooks The hooks rule defines actions before and after tool calls, plus a final session check. It helps run code checks and review Git-related changes. CX Codex +1 ★ 6,739repo stars agents Defines nine agents in ~/.claude/agents/ for different development tasks: planning, design, testing, code review, and more. Run them in parallel for independent work. CX Codex +1 ★ 6,739repo stars checkpoint Saves named Git checkpoints during a Claude Code workflow and compares changed files, test results, and test coverage against earlier marks. CX Codex +1 ★ 6,739repo stars learn The learn slash command turns reusable lessons from the current session into skills. Run it after a difficult fix, debugging session, or project-specific discovery. CX Codex +1 ★ 6,739repo stars

Project sponsors

Companies that keep this analytics open