$ loading_
为 TypeScript、JavaScript、React 与 Node.js 开发提供通用编码规范与最佳实践指导。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "coding-standards" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/docs/ko-KR/skills/coding-standards/SKILL.md 2. 保存为 ~/.claude/skills/coding-standards/SKILL.md 3. 装好后重载技能,告诉我可以用了
请为一个使用 TypeScript、React 和 Node.js 的中型项目制定编码规范,涵盖命名约定、目录结构、组件设计、错误处理、异步代码、日志与代码审查要求,并给出可执行示例。
一份结构清晰的项目编码规范文档,包含规则说明、推荐做法与示例代码。
请根据 TypeScript 和 React 最佳实践审查下面这段代码,指出可读性、可维护性和潜在错误处理方面的问题,并给出重构后的版本与修改理由。
一份代码审查结果,列出问题清单、优化建议以及改进后的代码示例。
请总结一套适用于 JavaScript/Node.js 团队的最佳实践清单,重点包括模块设计、依赖管理、测试策略、性能考虑和安全注意事项,适合团队 onboarding 使用。
一份适合团队共享的最佳实践清单,可用于新人培训与日常开发对齐。
모든 프로젝트에 적용 가능한 범용 코딩 표준.
// 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
}
function getMarket(id: string): Promise<Market> {
// Implementation
}
// FAIL: BAD: Using 'any'
function getMarket(id: any): Promise<any> {
// Implementation
}
// PASS: GOOD: Functional component with types
interface ButtonProps {
children: React.ReactNode
onClick: () => void
disabled?: boolean
variant?: 'primary' | 'secondary'
}
export function Button({
children,
onClick,
disabled = false,
variant = 'primary'
}: ButtonProps) {
return (
<button
onClick={onClick}
disabled={disabled}
className={`btn btn-${variant}`}
>
{children}
</button>
)
}
// FAIL: BAD: No types, unclear structure
export function Button(props) {
return <button onClick={props.onClick}>{props.children}</button>
}
// PASS: GOOD: Reusable custom hook
export function useDebounce<T>(value: T, delay: number): T {
const [debouncedValue, setDebouncedValue] = useState<T>(value)
useEffect(() => {
const handler = setTimeout(() => {
setDebouncedValue(value)
}, delay)
return () => clearTimeout(handler)
}, [value, delay])
return debouncedValue
}
// Usage
const debouncedQuery = useDebounce(searchQuery, 500)
// PASS: GOOD: Proper state updates
const [count, setCount] = useState(0)
// Functional update for state based on previous state
…
帮助开发者为代码代理配置性能优化、安全防护与研究优先工作流。
提供数据库迁移、回滚与零停机发布的最佳实践指导,适用于多种 ORM 与 SQL 数据库。
通过双评审智能体对结果进行对抗式校验,提升输出发布前的可靠性
帮助你掌握地道 Rust 模式、所有权与并发实践,编写安全高性能应用。
基于 C++ Core Guidelines 编写、审查并重构更安全现代的 C++ 代码。
为 Claude Code 会话提供系统化校验流程,帮助检查结果正确性与质量。
为 TypeScript、JavaScript、React 与 Node.js 提供统一编码规范与最佳实践建议
提供适用于 TypeScript、JavaScript、React 与 Node.js 的通用编码规范与最佳实践。
为 Node.js 与 Next.js 项目提供后端架构、API 设计与数据库优化建议。
帮助用户掌握 React 与 Next.js 前端架构、状态管理和性能优化模式。
帮助你梳理 React 与 Next.js 前端模式、状态管理及性能优化最佳实践
提供 React 与 Next.js 前端开发模式,优化状态管理、性能与界面实践。