Token导航 LogoToken导航

Agent Skill · 开发规范

best-practices(最佳实践)

best-practices 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

best-practices 是开发规范类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在开发规范类的 1,265 个 Skill 里排第 939。

总安装 324周安装 13GitHub Stars 985下载 105核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/moizibnyousaf/ai-agent-skills --skill best-practices

这个 Skill 是做什么的

开发规范类 Skill 用来统一代码风格、目录结构和评审口径,产出多为检查清单或改写建议。

best-practices 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态或协作事项进行整理。通过 npx skills add 命令从指定仓库安装并使用该技能。

安装前需确认权限范围和维护状态,注意可能触发联网或文件读写操作。建议结合原始 README 进一步核验具体用法和功能边界。

来源仓库内路径:skills/best-practices

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/moizibnyousaf/ai-agent-skills --skill best-pra…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

best-practices 怎么安装?

在终端执行 npx skills add https://github.com/moizibnyousaf/ai-agent-skills --skill best-practices。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

best-practices 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

best-practices 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

best-practices 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

best-practices 用的人多吗?

公开数据是累计安装 324 次,近一周安装 13 次,下载 105 次,GitHub 985 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

best-practices 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发规范类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发规范类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
vercel-react-best-practices

Vercel React 最佳实践 · Codex、Claude

8,490,72025,918操作浏览器MIT通过
web-design-guidelines

网页设计指南 · Codex、Claude

6,686,01625,885需要联网MIT有提醒
remotion-best-practices

Remotion 最佳实践 · Codex、Claude

6,505,6323,027操作浏览器MIT有提醒
supabase-postgres-best-practices

Supabase Postgres 最佳实践 · Codex、Claude

3,175,5232,030需要联网MIT通过
next-best-practices

Next.js 最佳实践 · Codex、Claude

1,848,240841操作浏览器MIT通过
best-practices

最佳实践 · 本页

324985接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Best Practices — Prompt Transformer

Transform prompts by adding what Claude needs to succeed.

Start Here

Based on user's request:

User provides a prompt to transform: → Ask using AskUserQuestion:

  • Question: "How should I improve this prompt?"
  • Header: "Mode"
  • Options:

1. Transform directly — "I'll apply best practices and output an improved version" 2. Build context first — "I'll gather codebase context and intent analysis first"

User asks to learn/understand: → Show the 5 Transformation Principles section

User asks for examples: → Link to references/before-after-examples.md

User asks to evaluate a prompt: → Use the Success Criteria eval rubric at the end of this document


If "Transform directly"

Apply the 5 principles below and output the improved prompt immediately.

If "Build context first"

Launch 3 parallel agents to gather context:

Run these agents IN PARALLEL using the Task tool:

- Task task-intent-analyzer("[user's prompt]")
- Task best-practices-referencer("[user's prompt]")
- Task codebase-context-builder("[user's prompt]")

What Each Agent Returns

AgentMissionReturns
task-intent-analyzerUnderstand what user is trying to doTask type, gaps, edge cases, transformation guidance
best-practices-referencerFind relevant patterns from references/Matching examples, anti-patterns to avoid, transformation rules
codebase-context-builderExplore THIS codebaseSpecific file paths, similar implementations, conventions

After Agents Return

  1. Synthesize findings — Combine intent + best practices + codebase context
  2. Apply matching patterns — Use examples from best-practices-referencer as templates
  3. Ground in codebase — Add specific file paths from codebase-context-builder
  4. Transform the prompt — Apply the 5 principles with all gathered context
  5. Output — Show improved prompt with before/after comparison

Agent Definitions

The agents are defined in agents/:

  • agents/task-intent-analyzer.md — Analyzes intent, gaps, and edge cases
  • agents/best-practices-referencer.md — Finds relevant examples and patterns from references/
  • agents/codebase-context-builder.md — Explores codebase for files and conventions

Transformation Workflow

When transforming (after mode selection):

  1. Identify what's missing — Check against the 5 principles below
  2. Add missing elements — Verification, context, constraints, phases, rich content
  3. Output the improved prompt — In a code block, ready to copy-paste
  4. Show what changed — Brief comparison of before/after

The 5 Transformation Principles

Apply these in order of priority:

1. Add Verification (Highest Priority)

The single highest-leverage improvement. Claude performs dramatically better when it can verify its own work.

MissingAdd
No success criteriaTest cases with expected inputs/outputs
UI changes"take screenshot and compare to design"
Bug fixes"write a failing test, then fix it"
Build issues"verify the build succeeds after fixing"
Refactoring"run the test suite after each change"
No root cause enforcement"address root cause, don't suppress error"
No verification report"summarize what you ran and what passed"
BEFORE: "implement email validation"
AFTER:  "write a validateEmail function. test cases: user@example.com → true,
         invalid → false, user@.com → false. run the tests after implementing"
BEFORE: "fix the API error"
AFTER:  "the /api/orders endpoint returns 500 for large orders. check
         OrderService.ts for the error. address the root cause, don't suppress
         the error. after fixing, run the test suite and summarize what passed
         and what you verified."

2. Provide Specific Context

Replace vague references with precise locations and details.

VagueSpecific
"the code"src/auth/login.ts
"the bug""users report X happens when Y"
"the API""the /api/users endpoint in routes.ts"
"that function"processPayment() on line 142

Four ways to add context:

StrategyExample
Scope the task"write a test for foo.py covering the edge case where user is logged out. avoid mocks."
Point to sources"look through ExecutionFactory's git history and summarize how its API evolved"
Reference patterns"look at HotDogWidget.php and follow that pattern for the calendar widget"
Describe symptoms"users report login fails after session timeout. check src/auth/, especially token refresh"

Respect Project CLAUDE.md:

If the project has a CLAUDE.md, the transformed prompt should:

  • Not contradict project conventions
  • Reference project-specific patterns when relevant
  • Note any project constraints that apply
BEFORE: "add a new API endpoint"
AFTER:  "add a GET /api/products endpoint. check CLAUDE.md for API conventions
         in this project. follow the pattern in routes/users.ts. run the API
         tests after implementing."
BEFORE: "fix the login bug"
AFTER:  "users report login fails after session timeout. check the auth flow
         in src/auth/, especially token refresh. write a failing test that
         reproduces the issue, then fix it"

3. Add Constraints

Tell Claude what NOT to do. Prevents over-engineering and unwanted changes.

Constraint TypeExamples
Dependencies"no new libraries", "only use existing deps"
Testing"avoid mocks", "use real database in tests"
Scope"don't refactor unrelated code", "only touch auth module"
Approach"address root cause, don't suppress error", "keep backward compat"
Patterns"follow existing codebase conventions", "match the style in utils.ts"
BEFORE: "add a calendar widget"
AFTER:  "implement a calendar widget with month selection and year pagination.
         follow the pattern in HotDogWidget.php. build from scratch without
         libraries other than the ones already used in the codebase"

4. Structure Complex Tasks in Phases

For larger tasks, separate exploration from implementation.

The 4-Phase Pattern:

Phase 1: EXPLORE
"read src/auth/ and understand how we handle sessions and login.
 also look at how we manage environment variables for secrets."

Phase 2: PLAN
"I want to add Google OAuth. What files need to change?
 What's the session flow? Create a plan."

Phase 3: IMPLEMENT
"implement the OAuth flow from your plan. write tests for the
 callback handler, run the test suite and fix any failures."

Phase 4: COMMIT
"commit with a descriptive message and open a PR"

When to use phases:

  • Uncertain about the approach
  • Change modifies multiple files
  • Unfamiliar with the code being modified

Skip phases when:

  • Could describe the diff in one sentence
  • Fixing a typo, adding a log line, renaming a variable
BEFORE: "add OAuth"
AFTER:  "read src/auth/ and understand current session handling. create a plan
         for adding OAuth. then implement following the plan. write tests and
         verify they pass"

5. Include Rich Content

Provide supporting materials that Claude can use directly.

Content TypeHow to Provide
FilesUse @filename to reference files
ImagesPaste screenshots directly
ErrorsPaste actual error messages, not descriptions
LogsPipe with `cat error.log \claude`
URLsLink to relevant documentation
BEFORE: "make the dashboard look better"
AFTER:  "[paste screenshot] implement this design for the dashboard.
         take a screenshot of the result and compare it to the original.
         list any differences and fix them. ensure responsive behavior
         at 768px and 1024px breakpoints"
BEFORE: "the build is failing"
AFTER:  "the build fails with this error: [paste actual error]. fix it
         and verify the build succeeds. address the root cause, don't
         suppress the error"

Output Format

When transforming a prompt, output:

**Original:** [their prompt]

**Improved:**

[transformed prompt in code block]

**Added:**
- [what was missing and added]
- [another improvement]
- [etc.]

Quick Transformation Examples

Bug Fix

BEFORE: "fix the login bug"

AFTER: "users report login fails after session timeout. check the auth flow
in src/auth/, especially token refresh. write a failing test that reproduces
the issue, then fix it. verify by running the auth test suite."

ADDED: symptom, location, verification (failing test), success criteria

Feature Implementation

BEFORE: "add a search feature"

AFTER: "implement search for the products page. look at how filtering works
in ProductList.tsx for the pattern. search should filter by name and category.
add tests for: empty query returns all, partial match works, no results shows
message. no external search libraries."

ADDED: location, reference pattern, specific behavior, test cases, constraint

Refactoring

BEFORE: "make the code better"

AFTER: "refactor utils.js to use ES2024 features while maintaining the same
behavior. specifically: convert callbacks to async/await, use optional
chaining, add proper TypeScript types. run the existing test suite after
each change to ensure nothing breaks."

ADDED: specific changes, constraint (same behavior), verification after each step

Testing

BEFORE: "add tests for foo.py"

AFTER: "write tests for foo.py covering the edge case where the user is
logged out. avoid mocks. use the existing test patterns in tests/. test
cases: logged_out_user returns 401, expired_session redirects to login,
invalid_token raises AuthError."

ADDED: specific edge case, constraint (no mocks), pattern reference, test cases

Debugging

BEFORE: "the API is slow"

AFTER: "the /api/orders endpoint takes 3+ seconds. profile the database
queries in OrderService.ts. look for N+1 queries or missing indexes.
fix the performance issue and verify response time is under 500ms."

ADDED: specific endpoint, location, what to look for, measurable success criteria

UI Changes

BEFORE: "fix the button styling"

AFTER: "[paste screenshot of design] update the primary button to match this
design. check Button.tsx and the theme in tailwind.config.js. take a
screenshot after changes and compare to the design. list any differences."

ADDED: design reference, file locations, visual verification

Exploration

BEFORE: "how does auth work?"

AFTER: "read src/auth/ and explain how authentication works in this codebase.
cover: how sessions are created, how tokens are refreshed, where secrets
are stored. summarize in a markdown doc."

ADDED: specific files, specific questions to answer, output format

Migration

BEFORE: "upgrade to React 18"

AFTER: "migrate from React 17 to React 18. first, read the migration guide
at [URL]. then identify all components using deprecated APIs. update one
component at a time, running tests after each. don't change unrelated code."

ADDED: phased approach, reference docs, incremental verification, scope constraint

With Verification Report

BEFORE: "fix the API error"

AFTER: "the /api/orders endpoint returns 500 for large orders. check
OrderService.ts for the error. address the root cause, don't suppress
the error. after fixing, run the test suite and summarize what passed
and what you verified."

ADDED: symptom, location, root cause enforcement, verification report

Transformation Checklist

Before outputting, verify the improved prompt has:

  • Verification — How to know it worked (tests, screenshot, output)
  • Location — Specific files, functions, or areas
  • Constraints — What NOT to do
  • Single task — Not compound (split if needed)
  • Phases — If complex, structured as explore → plan → implement
  • Root cause — For bugs: "address root cause, don't suppress"
  • CLAUDE.md — Respect project conventions if they exist

Quick Prompt Quality Check

Rate the prompt against these dimensions:

Dimension0 (Missing)1 (Partial)2 (Complete)
VerificationNone"test it"Specific test cases + report
Location"the code""auth module"src/auth/login.ts:42
ConstraintsNoneImplied"avoid X, no Y, root cause only"
ScopeVaguePartialSingle clear task

Quick assessment:

  • 0-3: Needs significant work
  • 4-5: Needs some improvements
  • 6-8: Good, minor tweaks

Fallback: If Still Too Vague

If user chose "Transform directly" but the prompt lacks enough context, ask one natural question:

"What would Claude need to know to do this well?"

Don't interrogate — one question is enough. Transform with what you learn.


Common Anti-Patterns to Fix

Anti-PatternProblemFix
"fix the bug"No symptom, no locationAdd what users report + where to look
"add tests"No scope, no casesSpecify edge cases + test patterns
"make it better"No criteria for "better"Define specific improvements
"implement X"No verificationAdd test cases or success criteria
"update the code"No constraintsAdd what to preserve, what to avoid

Success Criteria — Prompt Quality Eval

A well-transformed prompt passes these checks:

Principle 1: Verification ✅

CheckPassFail
Has success criteria"run tests", "screenshot matches"Nothing
Measurable outcome"response < 500ms""make it faster"
Self-verifiableClaude can check its own workRequires human judgment
Root cause enforced"don't suppress error"Silent about approach

Principle 2: Specificity ✅

CheckPassFail
File locationssrc/auth/login.ts"the auth code"
Function/class namesprocessPayment()"that function"
Line numbers (if relevant):42"somewhere in there"
CLAUDE.md respected"check project conventions"Ignores project rules

Principle 3: Constraints ✅

CheckPassFail
What NOT to do"avoid mocks", "no new deps"Open-ended
Scope boundaries"only touch auth module"Unlimited scope
Pattern to follow"match UserService.ts style"No reference

Principle 4: Structure ✅

CheckPassFail
Single taskOne clear objectiveMultiple goals
Phased (if complex)"explore → plan → implement"Jump straight to code
Appropriate depthMatches task complexityOver/under-specified

Principle 5: Rich Content ✅

CheckPassFail
Actual errorsPasted error message"it's broken"
Screenshots (UI)Image attached"the button looks wrong"
File references@filename or path"that file"

Overall Quality Score

ScoreMeaningPrinciples Passed
⭐⭐⭐⭐⭐ExcellentAll 5
⭐⭐⭐⭐Good4 of 5
⭐⭐⭐Acceptable3 of 5
⭐⭐Needs work2 of 5
⭐Poor1 or 0

Target: Every transformed prompt should score ⭐⭐⭐⭐ or ⭐⭐⭐⭐⭐


Reference Files

For more examples and patterns:


Sources

平台分布

Codex

33.83%
按下载量换算36

Claude

31.89%
按下载量换算33

Cursor

20.32%
按下载量换算21

Gemini CLI

9.17%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

继续浏览同类 Skills