global-coding-style

coreyja 的头像作者 coreyja

使用自动化工具和明确的标准在整个代码库中保持一致的代码格式、命名约定和结构。在任何语言或框架中编写代码时使用此技能。命名变量、函数、类或文件时。使用适当的缩进和换行格式化代码时。重构代码以删除重复或提取可重用函数时。运行linters或格式化程序以确保一致性时。删除死代码、未使用的导入或注释掉的代码块时。应用DRY原则以避免代码重复时。此技能普遍适用于所有编程任务。

📖 中文导读:使用自动化工具和明确的标准在整个代码库中保持一致的代码格式、命名约定和结构。在任何语言或框架中编写代码时使用此技能。命名变量、函数、类或文件时。使用适当的缩进和换行格式化代码时。重构代码以删除重复或提取可重用函数时。运行linters或格式化程序以确保一致性时。删除死代码、未使用的导入或注释掉的代码块时。应用DRY原则以避免代码重复时。此技能普遍适用于所有编程任务。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: Global Coding Style description: Maintain consistent code formatting, naming conventions, and structure across the entire codebase with automated tools and clear standards. Use this skill when writing any code in any language or framework. When naming variables, functions, classes, or files. When formatting code with proper indentation and line breaks. When refactoring code to remove duplication or extract reusable functions. When running linters or formatters to ensure consistency. When removing dead code, unused imports, or commented-out blocks. When applying DRY principles to avoid code duplication. This skill applies universally to all programming tasks.

Global Coding Style

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.

When to use this skill

  • When writing any code in any programming language or framework
  • When naming variables, functions, classes, methods, or files
  • When formatting code with proper indentation, spacing, and line breaks
  • When running automated formatters (Prettier, Black, rustfmt, gofmt, etc.)
  • When running linters (ESLint, Pylint, Clippy, etc.) to enforce code standards
  • When refactoring code to extract common logic into reusable functions
  • When removing dead code, unused variables, or commented-out blocks
  • When keeping functions small and focused on a single responsibility
  • When applying the DRY (Don't Repeat Yourself) principle
  • When writing meaningful, descriptive names that reveal intent

Instructions

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