返回 Skill 列表
extension
分类: 开发与工程无需 API Key

js-google

基于Google官方JavaScript风格指南的JavaScript风格和最佳实践。在编写、审查或重构JavaScript代码时应使用此技能,以确保一致的风格并防止常见错误。触发于涉及JavaScript、ES6、模块、JSDoc、命名约定或代码格式化的任务。

person作者: jakexiaohubgithub

Google JavaScript Best Practices

Comprehensive JavaScript style and best practices guide based on Google's official JavaScript Style Guide, designed for AI agents and LLMs. Contains 47 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

  • Writing new JavaScript or ES6+ code
  • Structuring modules and managing imports/exports
  • Adding JSDoc type annotations and documentation
  • Reviewing code for naming and style consistency
  • Refactoring existing JavaScript code

Rule Categories by Priority

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Module System & Imports | CRITICAL | module- | | 2 | Language Features | CRITICAL | lang- | | 3 | Type Safety & JSDoc | HIGH | type- | | 4 | Naming Conventions | HIGH | naming- | | 5 | Control Flow & Error Handling | MEDIUM-HIGH | control- | | 6 | Functions & Parameters | MEDIUM | func- | | 7 | Objects & Arrays | MEDIUM | data- | | 8 | Formatting & Style | LOW | format- |

Quick Reference

1. Module System & Imports (CRITICAL)

2. Language Features (CRITICAL)

3. Type Safety & JSDoc (HIGH)

4. Naming Conventions (HIGH)

5. Control Flow & Error Handling (MEDIUM-HIGH)

6. Functions & Parameters (MEDIUM)

7. Objects & Arrays (MEDIUM)

8. Formatting & Style (LOW)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

For a complete compiled guide with all rules, see AGENTS.md.

Reference Files

| File | Description | |------|-------------| | AGENTS.md | Complete compiled guide with all rules | | references/_sections.md | Category definitions and ordering | | assets/templates/_template.md | Template for new rules | | metadata.json | Version and reference information |