AgentSkillsCN

Global Coding Style

编写整洁、易读的代码,采用一致的命名规范、恰当的格式、小型专注函数和DRY原则。适用于项目中任何语言或框架的代码编写时。适用于变量、函数、类或文件命名时。适用于函数结构、决定其大小和作用域时。适用于移除死代码、未使用的导入或注释掉的代码块时。适用于应用DRY原则提取公共逻辑时。适用于确保整个代码库缩进和格式一致时。

SKILL.md
--- frontmatter
name: Global Coding Style
description: Write clean, readable code with consistent naming conventions, proper formatting, small focused functions, and DRY principles. Use this skill when writing ANY code in the project regardless of language or framework. When naming variables, functions, classes, or files. When structuring functions and deciding on their size and scope. When removing dead code, unused imports, or commented-out blocks. When applying the DRY principle to extract common logic. When ensuring consistent indentation and formatting across the codebase.

When to use this skill:

  • When writing any new code in the project
  • When modifying existing code files
  • When naming variables, functions, classes, constants, or files
  • When deciding how to structure a function or method
  • When a function is getting too long and needs to be split
  • When removing dead code, unused variables, or imports
  • When deleting commented-out code blocks
  • When extracting duplicate logic into reusable functions
  • When applying consistent indentation (spaces or tabs)
  • When formatting code for readability
  • When reviewing code for style consistency
  • When choosing descriptive names that reveal intent

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.

Instructions

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