global-coding-style

遵循已建立的命名约定、格式规则和DRY原则在所有文件中编写干净、一致的代码。在编写任何文件的任何代码、命名变量和函数、构建代码逻辑、使用一致的缩进格式代码、选择揭示意图的描述性名称、保持函数小而专注、移除死代码和未使用的import、提取通用逻辑到可重用函数、在整个代码库中保持一致的代码风格、配置linter和formatter或重构代码以获得更好的可读性时使用此技能。在所有编码任务中普遍应用此技能以确保代码质量、可维护性和与项目标准的一致性。此技能应适用于所有文件类型,包括TypeScript、JavaScript、Python、Ruby、Java、Go和其他编程语言。

📖 中文导读:遵循已建立的命名约定、格式规则和DRY原则在所有文件中编写干净、一致的代码。在编写任何文件的任何代码、命名变量和函数、构建代码逻辑、使用一致的缩进格式代码、选择揭示意图的描述性名称、保持函数小而专注、移除死代码和未使用的import、提取通用逻辑到可重用函数、在整个代码库中保持一致的代码风格、配置linter和formatter或重构代码以获得更好的可读性时使用此技能。在所有编码任务中普遍应用此技能以确保代码质量、可维护性和与项目标准的一致性。此技能应适用于所有文件类型,包括TypeScript、JavaScript、Python、Ruby、Java、Go和其他编程语言。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: Global Coding Style description: Write clean, consistent code following established naming conventions, formatting rules, and the DRY principle across all files. Use this skill when writing any code in any file, naming variables and functions, structuring code logic, formatting code with consistent indentation, choosing descriptive names that reveal intent, keeping functions small and focused, removing dead code and unused imports, extracting common logic into reusable functions, maintaining consistent code style across the codebase, configuring linters and formatters, or refactoring code for better readability. Apply this skill universally across all coding tasks to ensure code quality, maintainability, and consistency with project standards. This skill should be active for all file types including TypeScript, JavaScript, Python, Ruby, Java, Go, and other programming languages.

Global Coding Style

When to use this skill

  • When writing or modifying any code file (*.ts, *.js, *.tsx, *.jsx, *.py, *.rb, *.java, *.go, etc.)
  • When naming variables, functions, classes, or files
  • When structuring code logic and organizing functions
  • When formatting code with proper indentation and line breaks
  • When choosing descriptive names that clearly reveal intent
  • When keeping functions small and focused on a single task
  • When removing dead code, commented-out blocks, or unused imports
  • When extracting common logic to avoid duplication (DRY principle)
  • When configuring or using linters and formatters (ESLint, Prettier, etc.)
  • When refactoring code for better readability and maintainability
  • When reviewing code for consistency with team conventions
  • When deciding whether backward compatibility logic is needed

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to how it should handle global coding style.

Instructions

For details, refer to the information provided in this file: global coding style