coding-standards

coding-standards is a skill for Claude Code, Codex from xu-xiang/everything-claude-code-zh. It costs 30 tokens per session (3,315 once invoked), scanned A, original, MIT.

A set of coding guidelines for TypeScript, JavaScript, React, and Node.js projects. It covers naming, simple design, avoiding repeated code, and adding only what is needed.

In plain words
What is it for?
Starting projects, reviewing or refactoring code, setting up linting, formatting, and type checks, and teaching contributors the project’s coding conventions.
Why use it?
It helps teams make code easier to read, review, and maintain. It also reduces disagreements about formatting, structure, and common programming practices.

Skill for Claude CodeCodex

Part of the everything-claude-code-zh plugin — 17 skills, 26 commands, 13 agents shipped together

About the project

everything-claude-code-zh is a Chinese translation of a collection of configurations for Claude Code and other AI coding agents. It provides agents, skills, hooks, commands, rules, and MCP configurations intended to support development workflows such as memory persistence, security scanning, evaluation, and research-first work. The catalogue includes commands, skills, agents, instructions, and a plugin from this configuration set.

xu-xiang/everything-claude-code-zh · 1,929 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xu-xiang/everything-claude-code-zh/coding-standards
Any agent
npx skills add xu-xiang/everything-claude-code-zh --skill coding-standards
Clone the repo
git clone --depth 1 https://github.com/xu-xiang/everything-claude-code-zh

Made for: Claude Code, Codex.

Or install everything-claude-code-zh, the plugin that ships this one along with the rest of its 17 skills, 26 commands, 13 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coding-standards

README.md
[![agentmods](https://agentmods.dev/badge/skills/xu-xiang/everything-claude-code-zh/coding-standards.svg)](https://agentmods.dev/skills/xu-xiang/everything-claude-code-zh/coding-standards)
Your own site
<a href="https://agentmods.dev/skills/xu-xiang/everything-claude-code-zh/coding-standards"><img src="https://agentmods.dev/badge/skills/xu-xiang/everything-claude-code-zh/coding-standards.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,315 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.03315
Opus 5 $0.00015 $0.01657
Sonnet 5 $0.00006 $0.00663
Haiku 4.5 $0.00003 $0.00331

Measured 5d ago against content hash a4ab35d8c777, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

coding-standards scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(url)
.agents/skills/coding-standards/SKILL.md · 531 lines

How it starts

The opening of the file, as written. The whole thing — 531 lines — stays where its author put it; the contents beside it link to each section on GitHub.

编码标准与最佳实践

适用于所有项目的通用编码标准。

何时激活

  • 开始新项目或模块时
  • 进行代码质量与可维护性审查时
  • 为了遵循约定而重构现有代码时
  • 强制执行命名、格式或结构的一致性时
  • 设置 Lint、格式化或类型检查规则时
  • 引导新贡献者了解编码约定时

代码质量原则

1. 可读性优先

  • 代码被阅读的次数远多于编写的次数
  • 变量和函数命名应清晰明确
  • 优先选择自描述代码而非注释
  • 保持一致的格式

2. KISS (Keep It Simple, Stupid - 保持简单)

  • 采用最简单的可行方案
  • 避免过度工程(Over-engineering)
  • 不要进行过早优化
  • 易于理解胜过奇技淫巧

3. DRY (Don't Repeat Yourself - 不要重复自己)

  • 将公共逻辑提取到函数中
  • 创建可复用的组件
  • 在模块间共享工具函数
  • 避免“复制粘贴式”编程

4. YAGNI (You Aren't Gonna Need It - 你不会需要它)

  • 不要在功能被需要之前就构建它
  • 避免投机性的通用设计
  • 仅在必要时增加复杂度
  • 从简单开始,在需要时重构

TypeScript/JavaScript 标准

变量命名

// ✅ 推荐:描述性名称
const marketSearchQuery = 'election'
const isUserAuthenticated = true
const totalRevenue = 1000

// ❌ 不推荐:命名不清晰
const q = 'election'
const flag = true
const x = 1000

函数命名

// ✅ 推荐:动词-名词模式
async function fetchMarketData(marketId: string) { }
function calculateSimilarity(a: number[], b: number[]) { }
function isValidEmail(email: string): boolean { }

// ❌ 不推荐:不清晰或仅用名词
async function market(id: string) { }
function similarity(a, b) { }
function email(e) { }

不可变模式 (Immutability Pattern)(至关重要)

// ✅ 始终使用展开运算符 (Spread Operator)
const updatedUser = {
  ...user,
  name: 'New Name'
}

const updatedArray = [...items, newItem]

// ❌ 严禁直接修改 (Mutate)
user.name = 'New Name'  // 错误
items.push(newItem)     // 错误

错误处理

// ✅ 推荐:全面的错误处理
async function fetchData(url: string) {
  try {
    const response = await fetch(url)

    if (!response.ok) {
      throw new Error(`HTTP ${response.status}: ${response.statusText}`)
    }

    return await response.json()
  } catch (error) {
    console.error('Fetch failed:', error)
    throw new Error('Failed to fetch data')
  }
}

// ❌ 不推荐:没有错误处理
async function fetchData(url) {
  const response = await fetch(url)
  return response.json()
}

Async/Await 最佳实践

// ✅ 推荐:尽可能并行执行
const [users, markets, stats] = await Promise.all([
  fetchUsers(),
  fetchMarkets(),
  fetchStats()
])

// ❌ 不推荐:不必要的顺序执行
const users = await fetchUsers()
const markets = await fetchMarkets()
const stats = await fetchStats()

Read the full file on GitHub · 531 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 531 lines · 30 tokens per session scan A a4ab35d8c777

Subscribe to this mod's changes

coding-standards is a skill published in the GitHub repository xu-xiang/everything-claude-code-zh (1,929 stars, last pushed 6mo ago), licensed MIT. It adds 30 tokens to every session and 3,315 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.