best-practices
Transforms vague prompts into optimized Claude Code prompts. Adds verification, specific context, constraints, and proper phasing. Invoke with /best-practices.
от MoizIbnYousaf★ 1 163 звезды на GitHub
Установить best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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:
- Transform directly — "I'll apply best practices and output an improved version"
- 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
| Agent | Mission | Returns |
|---|---|---|
| task-intent-analyzer | Understand what user is trying to do | Task type, gaps, edge cases, transformation guidance |
| best-practices-referencer | Find relevant patterns from references/ | Matching examples, anti-patterns to avoid, transformation rules |
| codebase-context-builder | Explore THIS codebase | Specific file paths, similar implementations, conventions |
After Agents Return
- Synthesize findings — Combine intent + best practices + codebase context
- Apply matching patterns — Use examples from best-practices-referencer as templates
- Ground in codebase — Add specific file paths from codebase-context-builder
- Transform the prompt — Apply the 5 principles with all gathered context
- 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 casesagents/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):
- Identify what's missing — Check against the 5 principles below
- Add missing elements — Verification, context, constraints, phases, rich content
- Output the improved prompt — In a code block, ready to copy-paste
- 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.
| Missing | Add |
|---|---|
| No success criteria | Test 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: [email protected] → true,
invalid → false, [email protected] → 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.
| Vague | Specific |
|---|---|
| "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:
| Strategy | Example |
|---|---|
| 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 tha
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- agents/best-practices-referencer.md
- agents/codebase-context-builder.md
- agents/task-intent-analyzer.md
- references/anti-patterns.md
- references/before-after-examples.md
- references/best-practices-guide.md
- references/common-workflows.md
- references/prompt-patterns.md
FAQ
Что делает скилл best-practices?
Transforms vague prompts into optimized Claude Code prompts. Adds verification, specific context, constraints, and proper phasing. Invoke with /best-practices.
Как установить скилл best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…