/google-engineering:google-stylefrom google-engineering
Google's language style guides — TypeScript, JavaScript, HTML/CSS, Python, Shell, Go, Java, C++, C#, Objective-C — as the authority on formatting, naming, comments, and language-feature use. Use before writing or editing code in any of these languages, when reviewing style in a diff, when naming things, when deciding whether a language feature is allowed, or when a style disagreement needs an authority. Carries the full text of each guide in references/.
Ships in google-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The style guide is the absolute authority on style questions. Anything the guide requires, follow. Anything it merely recommends is a judgment call between the guide and local convention — bias toward the guide unless local inconsistency would confuse. Anything the guide doesn't cover is personal preference: match the surrounding file, then the surrounding directory, then accept the author's choice.
RFC 2119 terms apply: must / must not are absolute, should / should not (= prefer / avoid) admit judgment, may is permission.
Read the matching file in references/ before writing non-trivial code in that language. Each is the guide's full text.
| Language | File |
|---|---|
| TypeScript / TSX | references/typescript.md |
| JavaScript | references/javascript.md |
| HTML / CSS | references/html-css.md |
| Python | references/python.md |
| Shell / Bash | references/shell.md |
| Go | references/go-guide.md (core), go-decisions.md (style decisions), go-best-practices.md |
| Java | references/java.md |
| C++ | references/cpp.md |
| C# | references/csharp.md |
| Objective-C | references/objective-c.md |
Not covered by any Google guide: Rust, SQL, Swift, Kotlin, React/JSX component idioms. For those, follow the project's existing conventions and the user's global instructions.
These carry across every guide and are the ones most often violated.
Names are descriptive and unabbreviated. Long enough to communicate what the thing is or does, short enough to read. Never abbreviate by deleting letters. Never use an abbreviation only your team knows. Never encode the type in the name — the type system already says it.
errorCount dnsConnectionIndex referrerUrl customerId
n nErr nCompConns wgcConnections pcReader cstmrId kSecondsPerDay
Exception: variables in scope for ~10 lines or fewer may be short.
Comments explain why, not what. If code needs a comment to say what it's doing, simplify the code instead. Exceptions where "what" comments earn their place: regular expressions and complex algorithms. Documentation of a class/module/function is a different thing from a comment — it states purpose, usage, and behavior.
No comments boxed in asterisks or drawn banners.
Consistency. Brand-new files use Google style regardless of what neighboring files do. When adding to a non-conforming file, prefer reformatting it first if the change is significant; otherwise stay consistent with the file without violating the guide. Never let opportunistic style fixes muddle a functional change — split them out.
The rules that come up constantly. Full detail in references/typescript.md.
Modules
namespace, no require(), no /// <reference>. ES modules only.../../../ depth.import * as x) when pulling many symbols from a large API.import type {…} when a symbol is only used as a type; export type {…} when re-exporting a type.export let — mutable exports are banned. Use an explicit getter.Variables and literals
const by default, let when reassigned, never var. One variable per declaration.Array(), no Object(), no new String/Boolean/Number.===/!== always. Exception: == null to catch null-and-undefined together.Types
interface over type-alias object literals. T[] over Array<T> for simple types; Array<T> for complex ones.any — provide a real type, or use unknown. If any is genuinely right (mocks in tests), suppress the lint and document why.{} — use unknown, Record<string, T>, or object.|null/|undefined; add it where actually used.foo?:) over |undefined.x as T) and non-null assertions (y!) are unsafe — prefer a real runtime check. When you must assert, comment why. as syntax only, never <T>x.: Foo, don't assert them as Foo — annotation catches renamed fields.@ts-ignore / @ts-expect-error / @ts-nocheck.Functions and classes
function expressions.#private fields — use private. Never public except on non-readonly parameter properties. readonly on anything not reassigned after construction.constructor(private readonly foo: Foo) {}) over manual plumbing. Initialize non-parameter fields at declaration.this in static contexts. No prototype manipulation.Error or subclasses — including Promise.reject. new Error(...), never bare Error(...).switch has a default. No fallthrough from non-empty cases.if.Naming
| Style | Applies to |
|---|---|
UpperCamelCase | class, interface, type, enum, decorator, type parameters, TSX component functions |
lowerCamelCase | variable, parameter, function, method, property, module alias |
CONSTANT_CASE | module-level constants and enum values only |
No _ prefix or suffix, ever, including bare _ for unused. Treat acronyms as words: loadHttpUrl, customerId — not loadHTTPURL, customerID. Don't mark interfaces IFoo.
Comments
/** JSDoc */ for documentation aimed at users of the code; // for implementation notes.//, not /* */.@param/@return only when they add information.Google's guide predates and doesn't cover these frameworks. Framework requirements win; note the deviation and move on.
page.tsx, layout.tsx, route.ts, error.tsx, loading.tsx, middleware.ts require default exports. Next.js routing depends on it. Use named exports everywhere else.next/dynamic, React.lazy, and some library entry points need default exports.this binding, which doesn't apply to function components.Style comments that aren't backed by a guide rule get prefixed Nit: and never block. Style violations that are in the guide are ordinary review comments. Never bundle a large reformat with a functional change.
references/cpp.md (opens in a new tab)references/csharp.md (opens in a new tab)references/go-best-practices.md (opens in a new tab)references/go-decisions.md (opens in a new tab)references/go-guide.md (opens in a new tab)references/html-css.md (opens in a new tab)references/java.md (opens in a new tab)references/javascript.md (opens in a new tab)references/objective-c.md (opens in a new tab)references/python.md (opens in a new tab)references/shell.md (opens in a new tab)references/typescript.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub fishnos/claude-config --plugin google-engineering5 skills in this plugin
/git-workflowIndustry-standard version control — atomic commits, commit message anatomy, Conventional Commits, git trailers, branching models, rebase vs merge, PR hygiene, SemVer, changelogs, tags, signing, and history-recovery. Use before writing any commit message, when splitting work into commits, when choosing a branch strategy or merge method, when versioning or releasing, when a rebase/merge/force-push decision comes up, or when history needs repairing. Carries the Conventional Commits, SemVer, and Keep a Changelog specs in references/./google-cl-authorAuthor changes the way Google expects them — one self-contained change per commit/PR, tests in the same change, a description that says what and why, and collaborative responses to review feedback. Use when planning how to split work into commits or PRs, writing a commit message or PR description, deciding whether a change is too big, or responding to review comments. Encodes google/eng-practices CL author guide./google-code-reviewReview code the way Google reviews a CL — design first, then functionality, complexity, tests, naming, comments, style, consistency, documentation, every line. Use whenever reviewing a diff, PR, branch, or file someone (including you) just wrote; whenever asked to "review", "check", "look over", "critique", or "audit" code; and as a self-review pass before reporting any implementation as done. Encodes google/eng-practices reviewer guide./google-testingGoogle's testing discipline — test sizes and scopes, the 80/15/5 mix, testing behaviors not methods, DAMP over DRY, preferring real implementations over mocks, and avoiding brittle change-detector tests. Use when writing or reviewing any test, deciding what to test or at what level, choosing between a real object, a fake, and a mock, debugging a flaky or brittle test, or judging whether a change has adequate test coverage. From Software Engineering at Google and Testing on the Toilet.