Compétences cc-skill-coding-standards
📦

cc-skill-coding-standards

Sûr

在整个代码库中执行编码标准

不一致的代码质量会导致错误和技术债务。此技能为 TypeScript、JavaScript、React 和 Node.js 开发提供通用编码标准、最佳实践和模式,帮助您编写清晰、可维护的代码。

Prend en charge: Claude Codex Code(CC)
🥉 72 Bronze
1

Télécharger le ZIP du skill

2

Importer dans Claude

Allez dans Paramètres → Capacités → Skills → Importer un skill

3

Activez et commencez à utiliser

Tester

Utilisation de "cc-skill-coding-standards". 审查此函数的编码标准合规性:function get(u) { return fetch(u).then(d=>d.json()) }

Résultat attendu:

此函数违反多项标准:命名不清晰(get、u、d)、无错误处理、无类型安全性、返回数据前未检查 response.ok。重构版本包括:描述性名称(fetchMarketData)、适当的 TypeScript 类型、带 try/catch 的全面错误处理以及响应验证。

Utilisation de "cc-skill-coding-standards". 根据标准生成一个 React 按钮组件

Résultat attendu:

带有 TypeScript 接口(ButtonProps)的函数式组件、适当的属性类型(children、onClick、disabled、variant)、可选属性的默认值以及语义化 HTML 结构。包括属性展开和 className 组合。

Utilisation de "cc-skill-coding-standards". 检查此代码是否遵循不可变模式:user.name = 'New Name'; items.push(newItem);

Résultat attendu:

此代码违反了不可变性原则。直接修改对象和数组会导致意外的副作用。正确方法:对对象使用展开运算符({...user, name: 'New Name'})和对数组使用([...items, newItem])来创建新引用而不是修改现有引用。

Audit de sécurité

Sûr
v1 • 2/25/2026

All 73 static analysis findings are false positives. The detected patterns (backtick execution, weak crypto, system reconnaissance) are Markdown code blocks and documentation examples, not executable code. This is a pure documentation skill with no executable functionality. No security risks identified.

1
Fichiers analysés
528
Lignes analysées
3
résultats
1
Total des audits
Problèmes à risque faible (3)
Documentation Code Examples Trigger Static Scanner
The static scanner detected 53 instances of 'Ruby/shell backtick execution' patterns. These are Markdown code blocks (```typescript) used for documentation, not actual shell execution. The skill contains only code examples and best practices documentation.
Fetch API Examples in Documentation
Detected 2 instances of fetch() calls at lines 92 and 107. These are documentation examples showing proper async/await error handling patterns, not actual network requests made by the skill.
Dynamic Import for React Lazy Loading Example
Detected dynamic import() at line 409. This is a documentation example showing React's lazy() pattern for code splitting, not actual dynamic imports executed by the skill.
Audité par: claude

Score de qualité

38
Architecture
90
Maintenabilité
87
Contenu
50
Communauté
99
Sécurité
87
Conformité aux spécifications

Ce que vous pouvez construire

代码审查助手

在代码审查期间使用此技能验证拉取请求是否遵循已建立的编码标准和最佳实践。

新开发人员入职

通过提供一致的示例和模式,帮助新团队成员了解您的代码库标准和约定。

代码质量改进

在重构遗留代码时应用这些标准,以提高可维护性并减少技术债务。

Essayez ces prompts

根据标准审查代码
根据 cc-skill-coding-standards 技能中定义的编码标准和最佳实践审查此代码。识别任何违规行为并提出改进建议。
重构以实现最佳实践
重构此代码以遵循 cc-skill-coding-standards 技能中的 TypeScript 和 React 最佳实践。重点关注不可变性、错误处理和组件结构。
生成符合标准的代码
生成一个遵循 cc-skill-coding-standards 编码标准的 [component/function/module]。包括适当的类型、错误处理和文档。
解释标准违规行为
解释此代码为何违反 cc-skill-coding-standards 中的编码标准。引用特定原则如 KISS、DRY 或 YAGNI。

Bonnes pratiques

  • 始终使用描述性的变量和函数名称来解释意图,而不是缩写形式
  • 一致地应用不可变模式,使用展开运算符而不是直接修改
  • 使用 try/catch 块和响应验证为异步操作实现全面的错误处理
  • 使用 TypeScript 类型和接口而不是 'any' 以保持类型安全性

Éviter

  • 避免直接修改对象和数组 - 使用展开运算符或不可变更新模式
  • 不要在 TypeScript 中使用 'any' 类型 - 始终定义适当的接口和类型注解
  • 永远不要在异步函数中省略错误处理 - 始终包含带适当错误消息的 try/catch
  • 避免深度嵌套的条件语句 - 使用提前返回和守卫子句以提高清晰度

Foire aux questions

这些编码标准对所有项目都是强制性的吗?
不,这些是推荐的最佳实践。根据您团队的具体需求和现有约定进行调整。这些标准为一致、高质量的代码提供了基础。
我可以在 TypeScript 和 JavaScript 以外的语言中使用这些标准吗?
虽然许多原则如 KISS、DRY 和 YAGNI 普遍适用,但具体示例针对 TypeScript 和 JavaScript 生态系统。将这些概念adapt到您的语言选择中。
我如何在团队中执行这些标准?
将这些标准与 linting 工具(ESLint、Prettier)、pre-commit hooks 和代码审查清单结合起来。在审查期间使用此技能尽早发现违规行为。
如果标准与我现有的代码库冲突怎么办?
渐进式地应用标准。在重构时优先考虑新代码和高风险区域。渐进式采用比尝试完全重写更好。
这些标准是否取代了代码审查的需求?
不,这些标准是对代码审查的补充。它们提供客观的评估标准,但审查也捕获特定上下文的决策和架构考虑。
我应该多久更新一次这些标准?
每季度或在采用新框架时审查和更新标准。在稳定性和演进之间取得平衡 - 抵制频繁更改,但adapt生态系统中的新最佳实践。

Détails du développeur

Structure de fichiers

📄 SKILL.md