moizibnyousaf/ai-agent-skills/best-practices
Claude Code and agent skill by moizibnyousaf/ai-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Transforms vague prompts into optimized Claude Code prompts. Adds verification, specific context, constraints, and proper phasing. Invoke with /best-practices.
Install
npx vskill@latest install moizibnyousaf/ai-agent-skills/best-practicesSKILL.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:
- 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:
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" |
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 that apply
3. Add Constraints
Tell Claude what NOT to do. Prevents over-engineering and unwanted changes.
| Constraint Type | Examples | |
|---|---|---|
| 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" |
4. Structure Complex Tasks in Phases
For larger tasks, separate exploration from implementation.
The 4-Phase Pattern:
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
5. Include Rich Content
Provide supporting materials that Claude can use directly.
| Content Type | How to Provide | ||
|---|---|---|---|
| Files | Use @filename to reference files | ||
| Images | Paste screenshots directly | ||
| Errors | Paste actual error messages, not descriptions | ||
| Logs | Pipe with `cat error.log \ | claude` | |
| URLs | Link to relevant documentation |
Output Format
When transforming a prompt, output:
[transformed prompt in code block]
Quick Transformation Examples
Bug Fix
Feature Implementation
Refactoring
Testing
Debugging
UI Changes
Exploration
Migration
With Verification Report
Transformation Checklist
Before outputting, verify the improved prompt has:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/best-practices/SKILL.md
Popularity
- Repository stars
- 937
- Repository forks
- 104
- Repository npm downloads, 7 days
- 480
- 7-day trend score
- 49
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 18 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/moizibnyousaf/ai-agent-skills/best-practices)