RFC: Define and enforce a shared set of coding standards #1122
Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
-
.claude/rules/code-style.mdNamingFunctions are named as a verb phrase that states the action. Read the name and you know what it does without reading the body.
Variables are named as nouns describing what they hold. Singular for one, plural for a collection.
Naming is literal, not clever. If you cannot tell what a variable holds or what a function does at a glance, the name is wrong. No abbreviations, no vague nouns. CommentsEvery function has a doc comment in the language-native format: docstring (Python), JSDoc (TypeScript), Doxygen (C++). The comment carries a description when the name alone does not fully convey intent. If the name says everything, the doc comment can be a single line; it is still required so tooling and agents have a consistent anchor. Function size and responsibilityA function does one thing. This repo is built for reuse, and functions that bundle multiple actions cannot be reused, only copied. Target: 10 lines or fewer per function. A function pushing past that is a signal it is doing more than one thing and should be decomposed. Promise handling (TypeScript)Prefer resolving each promise through a callout function that returns either a response or an error, so resolution is handled per async call. Avoid wrapping several awaits in one try/catch that swallows them all under a single generic handler. Each async operation owns its own success and failure path. ReadabilityCode reads top to bottom, left to right, like prose. A reader should follow the flow without jumping around to understand what a line is doing. Clarity at a glance is the bar. If a reader has to stop and decode, the code is wrong even if it runs. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Over the past few months
rocketride-serverhas grown fast, with a diverse set of contributors landing changes across the C++ engine, Python SDK/tools, and the TypeScript VS Code extension. That growth has been great for velocity — but our code standards have diverged significantly. Formatting, naming, error-handling patterns, and structural conventions now vary widely from file to file and contributor to contributor.This discussion is a call to agree, as a community, on a shared set of coding standards and then make them enforceable and machine-consumable.
Why now
What we want to decide
We're not trying to impose taste from the top down — we want to capture what we collectively value and write it down. Topics to align on:
Callout.call()wrapper, always throwAppError,logger.*overconsole.log). Do we keep, extend, or revise these?Proposed deliverables
Once we agree, we implement the standard so it's both human- and agent-readable:
CLAUDE.md(and sibling agent files —AGENTS.md,GEMINI.md) capturing the standards for coding agents to consume..claude/rules/*.mdfor focused topic rules (architecture, testing, language conventions).ruff.toml/pyproject.tomlfor Python.prettierrc+ eslint config for TypeScript.clang-formatfor C++CONTRIBUTING.mdlinking it all together.How to participate
Please weigh in with:
Once discussion settles, we'll open tracking issues per deliverable and land the configs + agent files incrementally to avoid one giant reformatting PR.
Beta Was this translation helpful? Give feedback.
All reactions