Token导航 LogoToken导航TokenDH.com
开发external-servicegithub未标认证来源可访问许可证需确认审计通过

naming-conventions命名约定

Agent Skill

naming-conventions 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

674

周安装

27

GitHub Stars

8

下载量

218
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:naming-conventions(命名约定)
来源仓库:https://github.com/phrazzld/claude-config
仓库路径:skills/naming-conventions
安装命令:
npx skills add https://github.com/phrazzld/claude-config --skill naming-conventions
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/phrazzld/claude-config --skill naming-conventions

简介

用于处理 GitHub 仓库、Issue、Pull Request 等协作信息,支持代码变更管理。

  • 适用于围绕仓库状态、分支合并或协作事项进行自动化整理与分析的场景。
  • 通过命令执行获取实时数据,输出结构化信息供进一步处理或展示。
  • 安装需确认仓库访问权限,注意可能触发的网络请求与本地文件读写操作。
  • naming-conventions 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Naming Conventions

Universal principles for clear, intention-revealing names. Language-agnostic—applies to TypeScript, Go, Rust, Python, etc.

Core Principle

Names should reveal intent and domain, not implementation.

  • users not userArray (domain, not data structure)
  • calculateTax not doTaxCalculation (clear verb)
  • PaymentProcessor not PaymentManager (specific action, not vague)

Prohibited Patterns

NEVER Use These Names

Manager, Helper, Util

These are Ousterhout red flags — they're vague and don't reveal what the code does.

Bad:

UserManager
PaymentHelper
StringUtil

Good:

UserAuthenticator
PaymentProcessor
StringFormatter

Why: Naming forces design thinking. If you can't name it specifically, you don't understand what it does.

RARELY Use (Context-Dependent)

⚠️ Service, Handler, Processor, Controller

These can work when they're domain-specific or framework patterns, but prefer more specific names.

Bad (vague):

DataService         // What kind of data?
RequestHandler      // What kind of request?

Better (specific):

OrderService        // Domain context: orders
HttpRequestHandler  // Framework pattern: HTTP requests
PaymentProcessor    // Domain action: processing payments

SOMETIMES Acceptable

⚠️ Base, Abstract (prefixes)

Valid for framework/library code, but often hide intent in application code.

Framework (acceptable):

abstract class BaseComponent { ... }
abstract class AbstractRepository { ... }

Application (avoid):

// Better to name by domain
class Component { ... }              // If it's the base, no prefix needed
class Repository<T> { ... }         // Generic is clear without prefix

Always Avoid

Generic containers: Manager, Helper, Util, Misc, Common ❌ Temporal names: step1, phase1, doFirst, doSecond ❌ Single letters: x, y, temp (except loop counters i, j, k) ❌ Vague abbreviations: usr, msg, ctx (except well-known: id, url, api, http)


Positive Patterns

Variables

Pattern: Descriptive nouns

Use domain language, not implementation:

✅ activeUsers       // Domain concept
✅ totalRevenue      // Clear business term
✅ selectedItems     // What they are

❌ userArray         // Implementation detail (array)
❌ rev               // Abbreviation (unclear)
❌ items             // Too vague (items of what?)
❌ data              // Maximally vague

Guidelines:

  • Descriptive, not abbreviated
  • Domain terms, not data structures (users, not userArray)
  • Context matters: count alone is vague, activeUserCount is clear
  • Avoid single-letter names except loop counters (i, j, k)

Functions

Pattern: Verb + noun

Describe the action:

✅ calculateTotal       // Clear action + target
✅ fetchUserData        // Action: fetch, target: user data
✅ isValidEmail         // Question: is valid?
✅ formatCurrency       // Transform: format

❌ total                // Missing verb (noun alone)
❌ getUserData          // Vague verb "get"
❌ validateEmail        // Returns boolean, use "is"
❌ currency             // Missing verb
❌ process              // Vague verb, no target

Guidelines:

  • Start with clear verb (calculate, fetch, format, validate, parse, send, save)
  • Pure functions: describe transformation (format, parse, convert)
  • Side effects: verb implies action (save, send, fetch, update, delete)
  • Boolean returns: use question prefix (is, has, can, should)
  • Avoid vague verbs: get, do, handle, manage, process (without context)

Classes & Types

Pattern: Singular nouns

Use domain concepts:

✅ User                // Domain entity
✅ PaymentProcessor    // Action-specific
✅ OrderRepository     // Pattern adds meaning
✅ EmailNotifier       // Clear purpose

❌ Users               // Plural (unless collection type)
❌ PaymentManager      // Manager anti-pattern
❌ OrderDB             // Implementation leak
❌ EmailHelper         // Helper anti-pattern

Guidelines:

  • Singular nouns (User, Order, Payment, not Users, Orders)
  • Domain terms, not technical terms (Invoice, not BillingDocument)
  • Pattern suffixes acceptable when they add meaning (Repository, Factory, Builder, Strategy)
  • Avoid generic suffixes (Manager, Helper, Util, Handler without context)

Booleans

Pattern: Question prefix (is/has/can/should/will)

Prefix reveals boolean nature:

✅ isActive            // State question
✅ hasPermission       // Possession question
✅ canEdit             // Capability question
✅ shouldRefetch       // Conditional question
✅ willExpire          // Future state question

❌ active              // Ambiguous (could be status string)
❌ permission          // Looks like object
❌ editable            // Unclear (adjective, not question)
❌ enabled             // Past participle (prefer isEnabled)

Prefix meanings:

  • is: State (isActive, isLoading, isValid, isEmpty)
  • has: Possession (hasPermission, hasChildren, hasErrors)
  • can: Capability (canEdit, canDelete, canSubmit)
  • should: Conditional (shouldRefetch, shouldValidate)
  • will: Future (willExpire, willRetry)

Why questions work: Boolean names should read like yes/no questions.

Collections

Pattern: Plural indicates multiple items

Use plural, avoid type suffixes:

✅ users               // Plural indicates collection
✅ selectedItems       // What they are, plural
✅ errorMessages       // Clear and plural
✅ userById            // Keyed collection (by what)

❌ userList            // Redundant type suffix
❌ userArray           // Implementation leak
❌ userCollection      // Redundant suffix
❌ item                // Singular for plural collection

Keyed collections (maps/dictionaries):

✅ userById            // By key type
✅ configByEnv         // By environment
✅ productsByCategory  // Grouped by category

❌ userMap             // Type suffix redundant
❌ users               // Unclear it's keyed (ambiguous)

Context-Aware Exceptions

Some generic names have valid domain justification:

Framework Patterns

When acceptable:

  • EventManager in event-driven system (but EventBus is better)
  • ApiService wrapping external API (but ApiClient is clearer)
  • RequestHandler in HTTP framework (framework convention)
  • BaseComponent in UI framework (inheritance pattern)

Still prefer specific names when possible.

Repository Pattern

Acceptable:

UserRepository
OrderRepository

This is a well-known pattern. The suffix adds meaning.

Factory Pattern

Acceptable:

UserFactory
ComponentFactory

Pattern name clarifies purpose.


Quick Reference

Pattern Templates

Variables: Descriptive nouns

activeUsers, totalCount, selectedItem, currentPage

Functions: Verb + noun

calculateTotal, fetchUser, formatDate, parseJson

Booleans: Question prefix

isActive, hasPermission, canEdit, shouldRefetch

Classes: Singular noun (+ pattern if meaningful)

User, Order, PaymentProcessor, OrderRepository

Collections: Plural nouns

users, items, errors, messages

Examples: Before & After

Example 1: Vague to Clear

Before:

class DataManager
  processData(data)
  getData()

After:

class OrderProcessor
  calculateOrderTotal(order)
  fetchActiveOrders()

Example 2: Implementation to Domain

Before:

userArray = fetchFromDB()
dataList = parseJsonString(response)

After:

users = fetchUsers()
orders = parseOrderResponse(response)

Example 3: Temporal to Functional

Before:

function step1(data)
function step2(data)
function step3(data)

After:

function validateData(data)
function enrichData(data)
function persistData(data)

Philosophy

"If you can't name it, you don't understand it."

Naming is thinking. Bad names indicate unclear thinking. Good names indicate clear understanding.

Naming forces design decisions:

  • Can't name a class? Maybe it's doing too much.
  • Name is vague (Manager/Helper)? Unclear responsibility.
  • Name is long (UserAccountPaymentProcessorManager)? Poor abstraction.

Use domain language:

  • Domain experts should understand your names
  • Names should match business concepts
  • Avoid technical jargon when domain terms exist

Names are for humans, not compilers.

Write names for the person who reads your code in 6 months. That person is future you.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.78%
按下载量换算78

Claude

29.25%
按下载量换算64

Cursor

17.03%
按下载量换算37

Gemini CLI

10.06%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills