rule-code-style

Official

Enforce clean, consistent code across schemas.

Authorcarrot-foundation
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The schemas package benefits from consistent, readable code; this rule codifies conventions to reduce cognitive load, prevent drift, and streamline maintenance across all schema modules.

Core Features & Use Cases

  • Naming: use descriptive, intention-revealing names; functions should be verbs; variables are nouns.
  • Guard clauses and early returns: flatten control flow by handling edge cases first to keep the happy path clear.
  • Nesting depth: limit nesting to two levels; extract helpers when adding a third level.
  • Functional patterns: prefer pure functions and simple data transformations over unnecessary classes.
  • Single responsibility: ensure functions do one thing and separate concerns when they grow.
  • File organization: organize by role with clear file naming and separation of schemas, types, and utilities.
  • Error handling & formatting: follow safe parsing, consistent error reporting, and automatic formatting per project standards.

Quick Start

Apply these style guidelines to new and existing schema files to ensure consistency.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: rule-code-style
Download link: https://github.com/carrot-foundation/schemas/archive/main.zip#rule-code-style

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.