一键导入
ruby-styleguide
Use when writing, editing, or reviewing Ruby (.rb) source in a dexpace project — enforces the dexpace Ruby styleguide (Sorbet
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when writing, editing, or reviewing Ruby (.rb) source in a dexpace project — enforces the dexpace Ruby styleguide (Sorbet
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when writing, editing, or reviewing TypeScript that runs on Bun (Bun.serve, Hono, Bun.SQL, bun test) in a dexpace project — extends typescript-styleguide with Bun-specific rules (runtime pinning, the tsc typecheck gate, HTTP services, persistence). Use alongside typescript-styleguide, not instead of it.
Use when writing, editing, or reviewing TypeScript (.ts) source in a dexpace project — enforces the dexpace TypeScript styleguide (no any/no enum, erasable syntax, Result unions, zod at boundaries, 70-line function cap). Also use before committing TypeScript, or when asked to review TypeScript against the styleguide.
Use when writing, editing, or reviewing ASP.NET Core code (minimal APIs, DI, EF Core, Kestrel) in a dexpace project — extends csharp-styleguide with ASP.NET Core rules (host/config, DI lifetimes, endpoints, persistence). Use alongside csharp-styleguide, not instead of it.
Use when writing, editing, or reviewing React components (.tsx) in a dexpace project — extends typescript-styleguide with React rules (function components, hooks discipline, server state in TanStack Query, accessibility). Use alongside typescript-styleguide, not instead of it.
Use when writing, editing, or reviewing Kotlin that runs on the JVM (Spring, Ktor, JPA, Gradle) in a dexpace project — extends kotlin-styleguide with JVM-specific rules (Java interop, virtual threads vs coroutines, framework wiring, persistence). Use alongside kotlin-styleguide, not instead of it.
Use when writing, editing, or reviewing C# (.cs) source in a dexpace project — enforces the dexpace C# styleguide (NRT as law, records + pattern matching, async all the way, 70-line method cap). Also use before committing C#, or when asked to review C# against the styleguide.
| name | ruby-styleguide |
| description | Use when writing, editing, or reviewing Ruby (.rb) source in a dexpace project — enforces the dexpace Ruby styleguide (Sorbet |
Extends the Airbnb, Shopify, and rubystyle.guide chain; where they conflict, the higher authority wins, except the deviations below. Ruby 4.0+; additions: mandatory Sorbet # typed: strict with runtime sig checking, find/select/reduce/map naming.
Editing *.rb, or reviewing Ruby. Priority: correctness > performance > developer experience.
Data.define/T::Struct value objects; group behaviour in modules of functions; reserve a stateful class for lifecycle resources; mix in a module instead of inheriting for reuse.method_missing, no define_method magic, no monkey-patching; every dependency is a parameter; a sig makes the type contract explicit; Hash#fetch makes a missing key explicit; pass only what differs through keyword arguments.frozen_string_literal: true everywhere, freeze every constant, Data.define over mutable Struct, frozen collections in public signatures; build new values by transformation, never by mutation.StandardError subclasses per domain, raised with class and message, chained through cause; never rescue Exception, never empty/rescue nil/modifier rescue; rescue => error then handle.< is for Liskov-clean hierarchies and StandardError trees only; closed polymorphism is a T::Enum or case/in; reuse is a mixed-in module.map/select/reduce; reach for each only for effects or early exit; take input, return new output; avoid mutating arguments.sig already states the types, so prose never restates them.sig asserts every argument and return; add explicit pre/postconditions with raise on top — two per method on average; split compound assertions; assert positive and negative space.# typed: strict on every file; a sig on every method (precondition and postcondition in one). T.let/T.cast carry a why-comment; T.must/T.unsafe banned outside declared bridges.&. only where nil is a legitimate documented value; Hash#fetch/Array#fetch over []; never leak nil across a boundary; parse don't validate — one parse-constructor takes raw input, everything downstream takes the typed value object.freeze every mutable constant, attr_reader only on value objects (never attr_writer/attr_accessor), no $globals, no @@class variables.T::Enum, closed hierarchies with sealed!/abstract!; close every case with T.absurd; make illegal states unrepresentable.StandardError; never rescue Exception; no flow-control by exception; implicit begin; never return from ensure; raise class + message as two args; chain cause on rethrow; name the rescue variable error.next over nested block conditionals, public_send over send, pure by default.&:sym, tap/then, case/in, never for, {} single-line and do..end multi-line, no monkey-patching, <<~ heredocs, shorthand symbol hash keys, Time over DateTime, plain literal arrays over %w.async for I/O, Mutex for shared state); bound every pool and queue; never Timeout.timeout — use per-call deadlines; share immutable Data across boundaries.rubocop + rubocop-airbnb is law (2-space, 100-col, double quotes, trailing commas); srb tc is the first suite; Minitest is the second.srb tc # type-check gate; must pass clean
rubocop # must pass clean (rubocop -a to autocorrect)
bundle exec rake test # Minitest; must be green
For a full audit (not a quick edit), read reference/checklist.md in this skill and walk every chapter.