Token导航 LogoToken导航TokenDH.com
开发规范只读github未标认证来源可访问许可证需确认审计通过

coding-best-practices编码最佳实践

Agent Skill

coding-best-practices 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

198

周安装

8

GitHub Stars

公开资料未说明

下载量

62
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:coding-best-practices(编码最佳实践)
来源仓库:https://github.com/heykvnzhao/dotfiles
仓库路径:skills/coding-best-practices
安装命令:
npx skills add https://github.com/heykvnzhao/dotfiles --skill coding-best-practices
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/heykvnzhao/dotfiles --skill coding-best-practices

简介

coding-best-practices 记录任务执行中的错误、用户反馈与能力短板,推动 Agent 持续改进与知识沉淀。

  • 聚焦根因修复、简化逻辑与提升可维护性,倡导小步迭代与高质量输出。
  • 每次变更需更新测试覆盖、清理调试日志,并保持代码整洁度优于初始状态。
  • 建议定期回顾 memory 文件以同步个人偏好,确保后续交互符合用户修正后的实践标准。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Coding Best Practices

Core Principles

Fix Root Causes

  • Fix from first principles; find the source instead of applying bandaids
  • If a fix feels like a workaround, it probably is—dig deeper

Simplicity

  • Write idiomatic, simple, maintainable code
  • Prefer the most straightforward solution to the problem
  • Prefer small helpers or state-driven flow to keep cyclomatic complexity low

Quality Bar

  • Update tests (or add coverage) when behavior changes
  • Handle errors intentionally; avoid silent failures
  • Remove unintended debug logs; keep logs actionable and low-noise

Clean Up Ruthlessly

  • Leave each repo better than you found it
  • Delete unused code immediately—don't let junk linger (but keep cleanup local to what you touched unless the user asks for a wider refactor)
  • If a function no longer needs a parameter, remove it and update callers
  • If a helper is dead, delete it

No Breadcrumbs

  • When deleting or moving code, do not leave comments in the old location
  • No // moved to X, no // relocated—just remove it
  • Describe changes in your response, not in the code

Scope Control

  • Prefer small, reviewable changes over sweeping refactors
  • Avoid “drive-by” rewrites in unrelated areas
  • If a larger refactor is warranted, propose it explicitly and ask before proceeding

Code Organization

File Length

  • Use judgment based on complexity rather than strict line limits
  • Split files when they become difficult to navigate or understand
  • If a file has multiple distinct concerns, split it
  • Aim for files that can be read and understood in a single sitting

UI Component Files

  • For React: keep one primary component per file
  • Small helper components (variants, icon sets, button sizes) can coexist if they're tightly coupled
  • Group related components into folder structures (e.g., components/ for primary, components/Button/ with sub-components)

Separation Principles

  • Separate concerns when they can be used independently or tested in isolation
  • Types/interfaces that are shared across multiple files → types/ or @types
  • Utility functions used in multiple places → utils/ organized by domain
  • Custom hooks used by multiple components → hooks/
  • Constants and config → config/ or constants/
  • Keep things together that change together

Directory Structure

  • Organize by feature/domain, not by file type (e.g., auth/ not components/auth/, hooks/auth/)
  • Flatten directories when possible—avoid deep nesting
  • Use index/barrel files only when the repo already uses them and they don’t introduce dependency cycles or tooling issues

Dependencies

Before adding a new dependency:

  • Quick health check: recent releases/commits?
  • Reasonable adoption/community?
  • Actively maintained?
  • Does it solve a problem we can't easily solve ourselves?

When Unsure

  1. Read more code, documents, or files
  2. If still stuck, ask with short options
  3. If there are conflicts or ambiguity, call them out and take the safer path

Context Awareness

  • If project or repo-specific guidance conflicts with these rules, follow project guidance first
  • Assume other agents or the user might land commits mid-run; refresh context before summarizing or editing
  • If changes look unrecognized and continuing is problematic, stop and ask

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

32.51%
按下载量换算20

Claude

30.91%
按下载量换算19

Cursor

17.82%
按下载量换算11

Gemini CLI

9.05%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills