$ loading_
Baseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-specific patterns.
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "coding-standards" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/coding-standards/SKILL.md 2. 保存为 ~/.claude/skills/coding-standards/SKILL.md 3. 装好后重载技能,告诉我可以用了
Baseline coding conventions applicable across projects.
This skill is the shared floor, not the detailed framework playbook.
frontend-patterns for React, state, forms, rendering, and UI architecture.backend-patterns or api-design for repository/service layers, endpoint design, validation, and server-specific concerns.rules/common/coding-style.md when you need the shortest reusable rule layer instead of a full skill walkthrough.Activate this skill for:
Do not use this skill as the primary source for:
// PASS: GOOD: Descriptive names
const marketSearchQuery = 'election'
const isUserAuthenticated = true
const totalRevenue = 1000
// FAIL: BAD: Unclear names
const q = 'election'
const flag = true
const x = 1000
// PASS: GOOD: Verb-noun pattern
async function fetchMarketData(marketId: string) { }
function calculateSimilarity(a: number[], b: number[]) { }
function isValidEmail(email: string): boolean { }
// FAIL: BAD: Unclear or noun-only
async function market(id: string) { }
function similarity(a, b) { }
function email(e) { }
// PASS: ALWAYS use spread operator
const updatedUser = {
...user,
name: 'New Name'
}
const updatedArray = [...items, newItem]
// FAIL: NEVER mutate directly
user.name = 'New Name' // BAD
items.push(newItem) // BAD
// PASS: GOOD: Comprehensive error handling
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')
}
}
// FAIL: BAD: No error handling
async function fetchData(url) {
const response = await fetch(url)
return response.json()
}
// PASS: GOOD: Parallel execution when possible
const [users, markets, stats] = await Promise.all([
fetchUsers(),
fetchMarkets(),
fetchStats()
])
// FAIL: BAD: Sequential when unnecessary
const users = await fetchUsers()
const markets = await fetchMarkets()
const stats = await fetchStats()
// PASS: GOOD: Proper types
interface Market {
id: string
name: string
status: 'active' | 'resolved' | 'closed'
created_at: Date
}
…
提供 PostgreSQL 查询优化、模式设计、索引与安全实践建议
提供 FastAPI 项目结构、鉴权、事务分层与测试的最佳实践指导
提供地道 Go 语言模式与最佳实践,帮助构建健壮高效且易维护的应用
用于仓库命令执行、CI排障与小范围修复,并提供可核验执行证据。
用于 Laravel 项目的环境检查、测试、安全扫描与发布验收
帮助你判断解析结构化文本时何时用正则、何时引入大模型兜底。