Skip to content
Skills Library
Programming · Building & coding

code-style

/code-style

Language-agnostic code-design rules for explicit state, failure, ownership, and I/O boundaries. Use when implementing, refactoring, or reviewing code.

Repository
skills ↗
Licence
MPL-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
18
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MPL-2.0, otwarta.

What it does and when to use it

Language-agnostic code-design rules for explicit state, failure, ownership, and I/O boundaries. Use when implementing, refactoring, or reviewing code.

Original author description

Language-agnostic code-design rules for explicit state, failure, ownership, and I/O boundaries. Use when implementing, refactoring, or reviewing code.

How it works

  1. Effective Strategies for Clear, Correct Code
Original SKILL.md headings · 32 lines, 348 words
SKILL.md preview
---
name: code-style
description: Language-agnostic code-design rules for explicit state, failure, ownership, and I/O boundaries. Use when implementing, refactoring, or reviewing code.
---

# Code Style

This skill keeps code explicit, linear, and honest about state, failure, ownership, and side effects. Its directives favor enforceable invariants, narrow boundaries, simple abstractions, and sans-I/O decision logic.

Treat each directive as a language-agnostic semantic requirement. Adapt its TypeScript example to the target language's native syntax, type system, resource-management mechanisms, and compiler checks.

## Effective Strategies for Clear, Correct Code

Follow the guidelines below. Read each linked reference that applies before writing or reviewing code.

1. Express control flow so that the permitted state and successful path are easy to read.
   - [Use affirmative conditions when a condition needs mental negation to understand.](./references/affirmative-conditions.md)
   - [Reject invalid or exceptional cases early with guard clauses.](./references/guard-clauses.md)
   - [Make decisions visible at their point of effect instead of concealing valid values or control flow through implicit behavior.](./references/explicit-over-implicit.md)
   - [Select simple values with conditional expressions and insert optional fields or elements into owned results with statements.](./references/conditional-expressions.md)
2. Make valid state explicit and enforce it throughout the system.
   - [Make contradictory field combinations unrepresentable by enforcing invariants.](./references/enforce-invariants.md)
   - [Fail impossible states when an internal guarantee is broken instead of continuing with invented state.](./references/fail-impossible-states.md)
   - [Prevent new finite-state members from silently inheriting a fallback through exhaustive decisions.](./references/exhaustive-decisions.md)
3. Keep failure, ownership, and information at their decision-owning boundaries.
   - [Handle each failure once, preserve its cause, and distinguish narrow recovery or translation from terminal presentation.](./references/narrow-error-boundaries.md)
   - [Bind resource ownership to lifetime so a resource never escapes uninitialized or unreleased.](./references/resources-own-lifetimes.md)
   - [Preserve caller-relevant information when normalizing external data so continuation, retry, filtering, fallback, and other policy choices remain with the caller.](./references/preserve-information.md)
   - [Let consumers control continuation and stopping through lazy pagination.](./references/lazy-pagination.md)
4. Keep abstractions and public contracts intentional.
   - [Remove cosmetic pack/unpack layers while keeping abstractions that own meaningful behavior.](./references/simple-abstractions.md)
   - [Convert untrusted external payloads into trusted values at the first controlled boundary.](./references/validate-at-boundaries.md)
   - [Keep required absence explicit and reject fabricated defaults unless the domain defines the exact value.](./references/no-fabricated-defaults.md)
   - [Keep consumer APIs intentional and side-effect-free with narrow public surfaces.](./references/narrow-public-surfaces.md)
   - [Put decisions in a pure core and keep I/O in the imperative shell.](./references/pure-core-imperative-shell.md)
Files in this package (18)
  • SKILL.md 3 KB
  • agents/openai.yaml 1 KB
  • references/affirmative-conditions.md 1 KB
  • references/conditional-expressions.md 2 KB
  • references/enforce-invariants.md 1 KB
  • references/exhaustive-decisions.md 1 KB
  • references/explicit-over-implicit.md 1 KB
  • references/fail-impossible-states.md 1 KB
  • references/guard-clauses.md 1 KB
  • references/lazy-pagination.md 1 KB
  • references/narrow-error-boundaries.md 5 KB
  • references/narrow-public-surfaces.md 1 KB
  • references/no-fabricated-defaults.md 1 KB
  • references/preserve-information.md 1 KB
  • references/pure-core-imperative-shell.md 1 KB
  • references/resources-own-lifetimes.md 1 KB
  • references/simple-abstractions.md 2 KB
  • references/validate-at-boundaries.md 2 KB

Versions

RepositoryScoreLicence
This page · bastidood/skills100MPL-2.0
automattic/wordpress-activitypub100MIT
fubits1/svelte-skills100MIT
microsoft/semantic-link-labs100MIT
Casper-Studios/casper-marketplace100MPL-2.0
avsm/ocaml-claude-marketplace100ISC
railtownai/railtracks96MIT
LemurDaniel/claude-code-storyline-style95MIT

Database snapshot: 13.11.2026 · package version 2b863028c6ed (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100coding-principles
    Language-agnostic coding principles for maintainability, readability, and quality. Use when implementing features, refactoring code, or reviewing code quality.
  • 100coding
    This skill should be used when writing or reviewing code in any language. Provides language-agnostic coding conventions for code quality, comments, error handling, and formatting. Project-specific conventions always take priority.
  • 100style-guide
    Apply language-specific style guide rules to your code. Use when writing or reviewing code to ensure consistency with best practices.
  • 100coding-principles
    This skill provides language-agnostic coding principles for maintainability, readability, and quality. Automatically loaded when implementing features, refactoring code, reviewing code quality, or when the user mentions "clean code", "best practices", "code quality", or "maintainability".
  • 90concept-model
    Guide new development and maintenance with concise concept principles. Use for state and behavior ownership, concept boundaries, or cross-concept collaboration; complements ub-mode.
  • 100frontend-typescript-rules
    Applies React/TypeScript type safety, component design, and state management rules. Use when implementing React components.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.