# code-style

A rule set that shapes how the agent writes and edits code: small functions, short files, ordered helpers. Kicks in when you ask for a refactor or a split.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 880 installs · ★ 158
- Author: frappe
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/frappe/skills/tree/HEAD/skills/code-style/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/code-style

## What it does

The skill gives the agent boundaries while it writes or edits code. Functions stay small: if one has several jobs, or needs section headers to be readable, it gets split. Files stay under 300 lines where practical, cut by responsibility rather than by layer.

Inside is a short list of rules. Object-oriented code is preferred over scattered functions, higher-order and public functions sit near the top of the file, low-level utilities at the bottom. Comments are terse and explain the surprising part instead of narrating obvious code. No new abstraction until the same concrete use shows up more than once.

For Frappe work the skill points you at `frappe-app-dev` instead, so its rules do not get dragged into that framework's tasks. Install is one command per platform, and the skill file lands in the platform's skills directory, for example `~/.claude/skills/code-style/SKILL.md` in Claude.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add frappe/skills --skill code-style -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/code-style/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/code-style/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add frappe/skills --skill code-style -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/code-style/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add frappe/skills --skill code-style -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/code-style/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install frappe/skills code-style
```

2. **Manually: put the files in place**
- File: `.github/skills/code-style/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add frappe/skills --skill code-style -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/frappe/skills --path skills/code-style
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/code-style/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add frappe/skills --skill code-style -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/frappe/skills/tree/HEAD/skills/code-style/SKILL.md

## When to use it
- split a function that grew too large
- trim a file past the 300-line mark
- fix the ordering of helpers in a module
- replace scattered functions with an object structure
- drop comments that restate the code

## Example prompts
- refactor this file following code-style rules
- this function does too much — split it
- check the function order in this module and fix it

## Similar
- [code-style-consistency-cursorrules-prompt-file](https://affpapa.org/en/nevibecode/rules/code-style-consistency-cursorrules-prompt-file.md) — rule · ★ 41011
- [golang-code-style](https://affpapa.org/en/nevibecode/skills/golang-code-style.md) — skill · 44200 installs
- [python-code-style](https://affpapa.org/en/nevibecode/skills/python-code-style.md) — skill · 16456 installs
- [go-style-core](https://affpapa.org/en/nevibecode/skills/go-style-core.md) — skill · 1200 installs
- [typescript-variables](https://affpapa.org/en/nevibecode/skills/typescript-variables.md) — skill · 3800 installs
- [go-declarations](https://affpapa.org/en/nevibecode/skills/go-declarations.md) — skill · 1000 installs

From the same set: [frappe/skills](https://affpapa.org/en/nevibecode/by/frappe/skills.md) — 5 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
