Agent skill · Design & Presentation

tool-design-pattern

Automatically applies when creating AI tool functions. Ensures proper schema design, input validation, error handling, context access, and comprehensive testing.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill tool-design-pattern --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 11 KB
Bundled scripts: none
Path: skills/agent/tool-design-pattern/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# AI Tool Design Pattern Enforcer When creating tools for AI agents (LangChain, function calling, etc.), follow these design patterns. ## ✅ Standard Tool Pattern ```python from langchain.tools import tool from pydantic import BaseModel, Field from typing import Optional import logging logger = logging.getLogger(__name__) # 1. Define input schema class SearchInput(BaseModel): """Input schema for search tool.""" query: str = Field(..., description="Search query string") max_results: int = Field( default=10, ge=1, le=100, description="Maximum number of results to return" ) filter_type: Optional[str] = Field( None, description="Optional filter type (e.g., 'recent', 'popular')" ) # 2. Implement tool function @tool(args_schema=SearchInput) def search_database(query: str, max_results: int = 10, filter_type: Optional[str] = None) -> str: """ Search database for relevant information. Use this tool when user asks to find, search, or look up information. Returns JSON string with search results. Args: query: Search query string max_results: Maximum number of results (1-100) filter_type: Optional filter (recent, popular) Returns: JSON string with results or error message """ request_id = str(uu

What's inside
Steps it walks through
  1. ✅ Standard Tool Pattern
  2. Tool Schema Design
  3. Error Handling Pattern
  4. Context Access Pattern
  5. Async Tool Pattern
  6. Testing Tools
  7. ❌ Anti-Patterns
  8. Best Practices Checklist
  9. Auto-Apply
  10. Related Skills
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the tool-design-pattern skill do?

Automatically applies when creating AI tool functions. Ensures proper schema design, input validation, error handling, context access, and comprehensive testing.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill tool-design-pattern --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going