google-javascript-style

Applies Google's JavaScript style rules for formatting, naming, modules, and JSDoc to existing code.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/chughtapan/google-guide-skills --skill google-javascript-style-chughtapan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-javascript-style
Source: https://github.com/chughtapan/google-guide-skills/tree/main/skills/google-javascript-style
Command: npx skills add https://github.com/chughtapan/google-guide-skills --skill google-javascript-style-chughtapan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Maintaining legacy JavaScript codebases consistently is hard when contributors apply different formatting, naming, and module conventions. This Skill gives an agent the authoritative Google JavaScript Style Guide rules so it can write and review code that matches Google's conventions without guessing. ## Core Features & Use Cases - Formatting and structure rules: Enforces 80-column limits, 2-space indentation, required semicolons and braces, trailing commas, and line-wrapping conventions. - Module and language-feature guidance: Covers ES modules vs goog.module, named exports, import path extensions, const/let usage, arrow functions, and forbidden features like eval and prototype manipulation. - Naming and JSDoc conventions: Defines UpperCamelCase, lowerCamelCase, and CONSTANT_CASE naming plus JSDoc type annotations, nullability modifiers, and visibility annotations. - Use Case: When refactoring an old JavaScript file in a repository that follows Google style, ask the agent to update the code so declarations, imports, and JSDoc comments all comply with the guide. ## Quick Start Review this JavaScript file and rewrite it to comply with the Google JavaScript Style Guide, fixing formatting, naming, and JSDoc annotations.

Frequently Asked Questions about google-javascript-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format JavaScript code according to the Google style guide?

Google JavaScript style requires 2-space indentation, an 80-column limit, semicolons on every statement, braces on all control structures, and single quotes for strings. Continuation lines are indented at least +4 spaces, and trailing commas are used when a line break precedes the closing bracket.

What naming conventions does the Google JavaScript style guide use?

Classes use UpperCamelCase, methods and local variables use lowerCamelCase, and constants use CONSTANT_CASE with underscores. Private methods may optionally end with a trailing underscore, and identifiers use only ASCII letters and digits.

Should I use this guide for TypeScript or new JavaScript projects?

No. The upstream Google JavaScript guide is no longer updated, and TypeScript code should use the google-typescript-style guide instead. This guide is intended for maintaining existing JavaScript codebases that already follow Google conventions.

Does Google JavaScript style allow default exports in ES modules?

No. The guide requires named exports in all code and forbids default exports, because importing modules must assign names to default exports, which leads to inconsistent naming across modules.

When should existing code be reformatted to Google style?

Reformatting existing code is optional and traded off against churn, but files undergoing significant changes are expected to meet Google style. Brand new files must always use Google style regardless of neighboring files.