About code-style
A set of code organization and style rules for developers aiming to keep code concise and readable. It covers function and file structure, ordering, comments, and when to introduce abstractions.
Key features
- 01Keep functions small and focused
- 02Split long files by responsibility
- 03Place public functions near the top
- 04Comment on surprising behavior and why
- 05Avoid premature abstractions
Use cases
- 01Set code review conventions for a team
- 02Refactor functions with multiple jobs
- 03Plan how to split a long file
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ frappe/ skills --skill code-styleAfter installing, type/code-stylein Claude Code to confirm it loaded.
Details
From the project READMECode Style Rules
- Keep functions small. Split when a function has multiple jobs or needs sections to be readable.
- Keep files under 300 lines when practical. Split by responsibility, not by arbitrary layer.
- Prefer object-oriented code over scattered functions.
- Put higher-order/public functions near the top of the file; keep low-level utilities at the bottom.
- Write terse, simple English comments. Explain why something is surprising; do not narrate obvious code.
- Do not add abstractions until there are repeated concrete uses.
Comments
Markdown supported