majiayu000/agent-design
Guidelines for designing tools and action spaces for AI agents. Use when building agent harnesses, designing tool interfaces, creating elicitation mechanisms, or optimizing agent-tool interactions. Covers progressive disclosure, tool design patterns, and lessons from Claude Code development.
npx skills add https://github.com/majiayu000/claude-skill-registry --skill agent-design
Designing tools for AI agents is as much art as science. The key principle: give agents tools shaped to their own abilities — which you discover by paying attention to their outputs.
Imagine being given a difficult math problem. What tools would you want?
| Tool | Limitation |
|------|------------|
| Paper only | Limited by manual calculations |
| Calculator | Better, but requires knowledge to operate |
| Computer | Most powerful, but requires coding skills |
The right tool depends on your own abilities. Same for agents — design tools that match what the model can actually do well.
Even the best designed tool doesn't work if Claude doesn't understand how to call it.
As models improve:
Example: TodoWrite reminders helped older models but made newer ones think they couldn't modify the list.
Instead of stuffing everything in the system prompt:
More tools = more options to think about = cognitive overhead.
Problem: Claude asking questions in plain text was slow and unstructured.
Failed Attempts:
Solution: Dedicated tool with:
Key insight: Claude "liked" calling this tool — the interface matched how it naturally thinks about asking questions.
Evolution from TodoWrite:
When to use: When multiple agents need to coordinate on shared state.
Evolution:
Key insight: As models get smarter, they become better at building their own context if given the right tools.
Problem: Claude didn't know about itself (MCP, slash commands, etc.)
Failed approach: Put docs in system prompt → context rot
Solution: Claude Code Guide subagent
Before adding a tool, ask:
# BAD: Asking for plan AND questions in same tool
ExitPlanTool(plan: string, questions: Question[])
# GOOD: Separate tools for separate purposes
ExitPlanTool(plan: string)
AskUserQuestion(questions: Question[])
# BAD: Hoping model outputs specific format
"Output questions in this format: - Question [Option A | Option B]"
# GOOD: Structured tool input
AskUserQuestionTool({
questions: [{
question: "...",
options: ["A", "B"]
}]
})
# BAD: Everything in system prompt
"You have access to MCP servers, here's how to configure them..."
# GOOD: Progressive disclosure
"You can call the claude-code-guide agent to learn about Claude Code features"
The first design rarely works. Expect:
What works for Claude 3.5 may not work for Claude 4:
Source: Claude Code Team Learnings
Related Concepts:
Take majiayu000/agent-design from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.