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
/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-codeWhat 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-code2Manually: put the files in place
.claude/rules/coding-style.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/coding-style.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/coding-style.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/coding-style.mdManually: put the files in place
.clinerules/coding-style.mdStep 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.