code-standards
Skill6 starsChanged 5 months agoApache-2.0View on GitHub
Language-agnostic code standards for writing clean, maintainable code. Covers modular design, functional patterns, error handling, security, and testing. Make sure to use this skill whenever writing, refactoring, or reviewing any code, even for quick fixes, prototypes, or single-file changes. This is the baseline for all code quality. Language-specific skills, if present, may override these defaults.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- Vivswan/skillstheir own version, first seen Oct 4, 2026
- meowdiocre/meowpitheir own version, first seen Sep 19, 2026
- subsequence-cpu/agent-skillstheir own version, first seen Sep 18, 2026
- tamdogood/builder-essential-skillstheir own version, first seen Jul 18, 2026
- Bobagi/claude-skillstheir own version, first seen Jul 4, 2026
- metraton/gaiatheir own version, first seen Jul 2, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- tamdogood/builder-essential-skills★ 214same name
- metraton/gaia★ 4same name
- meowdiocre/meowpi★ 2same name
- onejaejae/skills★ 2same name
- BCuracao/cursor-universal-rules★ 1same name
- subsequence-cpu/agent-skills★ 1same name
- Vivswan/skills★ 1same name
- Bobagi/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cookSkill
- security-auditorSkill
- testingSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Separate by rate of change: don't weld a fast-changing concern into a slow-changing one.
- Distinctive: line 19
Golden Rule: If you can't easily test it, refactor it.
- Distinctive: line 26
Stdlib does it?: Use it.
- Distinctive: line 28
An already-installed dependency solves it?: Use it. Never add one for what a few lines do.
- Distinctive: line 35
No unrequested abstractions: no interface with one implementation, no factory for one product, no config for a value that never changes.
- Very specific: line 46
Immutability: create new data, never mutate what you were given.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Standards
Language-agnostic defaults. Language-specific skills override where they conflict. These are the Chef's taste stated as directives: apply them as written, and do not substitute your own or your provider's defaults where they differ.
Core Philosophy
- Modular: small, focused, reusable components.
- Functional first: pure functions, immutability, composition. A house choice, not a suggestion.
- Maintainable: self-documenting, testable, predictable.
- Single source of truth: one authoritative owner per fact; no drifting duplicates.
- Separate by rate of change: don't weld a fast-changing concern into a slow-changing one; couple the layers loosely so each moves at its own pace.
- Docs are part of the system: incorrect documentation is a bug. When a change alters docs that describe the system's behavior, verify them against the code as it stands, not just for prose. (OpenBSD.)
Golden Rule: If you can't easily test it, refactor it.
Laziness (the YAGNI ladder)
The best code is the code you never wrote. Before writing any, stop at the first rung that holds:
- Does this need to exist? Speculative need = skip it, say so in one line.
- Stdlib does it? Use it.
- Native platform feature covers it? (
<input type="date">over a picker lib; a DB constraint over app code.) Use it. - An already-installed dependency solves it? Use it. Never add one for what a few lines do.
- One line? One line.
- Only then: the minimum code that works.
- Order speed after subtraction: Accelerate only after the design is validated as minimal or to remove an observed bottleneck; automate only a stable, understood process with understood failure modes and deterministic verification signals. Neither may trade away safety, accessibility, data protection, rollback, or verification.
- Question every addition, including your own and the system's own docs and process: "do you need X, or does Y already cover it?" The lazy lens applies hardest to your own work, not just to feature code; ceremony, prose, and citations are over-build too.
- Lazy means less code, not the flimsier choice: when two correct approaches are the same size, take the more edge-case-correct one.
- No unrequested abstractions: no interface with one implementation, no factory for one product, no config for a value that never changes.
- Deletion over addition. Boring over clever. Fewest files, shortest working diff.
- Mark a deliberate shortcut with a
kiss:comment naming its ceiling and upgrade path (# kiss: O(n^2) scan, index it if the list grows). Simple should read as intent, not ignorance. - Laziness governs the process too, but selectively; this is the harder cut. Separate the function a step protects from the ceremony that only resembles it. To drop a step, name the outcome it protects and show that outcome is covered elsewhere or no longer at risk. If you can't name it, it's load-bearing: keep it. (See
skills/code-standards/reference/load-bearing-vs-liturgy.mdfor the test and worked examples.) - Never cut the steering or the safety carve-outs. Validation at trust boundaries, error handling that prevents data loss, and security; plus the verification that stops you declaring done when it isn't: tests with meaningful coverage (they steer you and catch a premature "done"), independent review, the done-gate. For an agent this is asymmetric: completion bias pushes you to cut the steering and keep the ritual, so weight against both.
Ladder adapted from ponytail (MIT); see NOTICE.
The House Style, as Directives
- Pure functions: same input, same output, no side effects.
const addToTotal = (v) => { total += v; }is the smell;const add = (a, b) => a + bis the rule. - Immutability: create new data, never mutate what you were given.
items.push(item)→[...items, item]. - Composition over inheritance:
pipe(validate, enrich, save), notclass ExtendedUserManagerWithValidation extends UserManager. - Explicit dependencies: inject collaborators (
createService(database, logger)), never import-and-reach from inside (import db from './database'). Hidden dependencies kill testability. - Small units, single responsibility: functions < 50 lines, modules < 200 lines. Deep nesting (> 3 levels), global state, and god modules are refusals, not warnings.
Policy Predicates
Policy decisions (access gating, capability checks, state validation) must live in named predicates on the owning type, not as raw comparisons scattered at call sites.
// Bad: policy duplicated at every call site
if (permissionManager.status === 'allGranted' && !licensed) { ... }
// Good: policy centralized on the owning type
if (permissionManager.areGranted && !licenseManager.isLicensed) { ... }When to extract: the same boolean check appears in more than one place, or the check requires knowing another type's internal state. Migration: grep for raw field comparisons (status == .X, type === 'Y'), extract to a named predicate on the owning type, replace all call sites, add a unit test for the predicate.
Validation, Errors, Security
- Validate at boundaries: check null/nil/None, validate types and ranges, sanitize all user input, return clear error messages.
- Catch specific errors, not generic; log them with context; return meaning to the caller (
parseJSONreturns{ success, data | error }, it does not rethrow soup). Never expose internals to users. - NEVER: log passwords/tokens/API keys; hardcode credentials; skip input validation. ALWAYS: secrets from the environment or a secret manager; least privilege.
- Log at conventional levels (debug/info/warning/error); errors always carry context.
Naming
Files lowercase-with-dashes; functions are verb phrases (getUser, validateEmail); predicates read as questions (isValid, hasPermission, canAccess, areGranted); variables descriptive (userCount, not uc); constants UPPER_SNAKE_CASE.
Code Review Checklist
- Error handling comprehensive
- Input validation present
- No hardcoded secrets
- Tests cover new code
- Documentation updated, and any claims about the code verified against it
- Follows project conventions
- Policy decisions use named predicates, not raw comparisons at call sites
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

