agentleFS
nisarthnisarth/claude-skills-store/skills/devtools/agent-development/SKILL.md

Agent Development

Skill1 starsChanged 7 months agoMITView on GitHub

Build AI agents using the Claude Agent SDK. Design multi-step workflows, orchestrate tool usage, manage state across turns, and implement robust error recovery patterns. Trigger phrases: "build an agent", "create an agent", "agent development", "agent SDK", "multi-step agent", "tool orchestration", "agentic workflow"

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use Command Development, MCP Integration and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • DanservfinnSkill

    Command Development

    This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.

    Also in 7 projects that use this

  • Clay-HHKSkill

    MCP Integration

    This 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 Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.

    Also in 6 projects that use this

  • DanservfinnSkill

    Writing Hookify Rules

    This skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.

    Also in 3 projects that use this

  • BrainDAOSkill

    Plugin Settings

    This skill should be used when the user asks about "plugin settings", "store plugin configuration", "user-configurable plugin", ".local.md files", "plugin state files", "read YAML frontmatter", "per-project plugin settings", or wants to make plugin behavior configurable. Documents the .claude/plugin-name.local.md pattern for storing plugin-specific configuration with YAML frontmatter and markdown content.

    Also in 4 projects that use this

  • dean9703111Skill

    Skill Development

    This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.

    Also in 5 projects that use this

  • Clay-HHKSkill

    Plugin Structure

    This skill should be used when the user asks to "create a plugin", "scaffold a plugin", "understand plugin structure", "organize plugin components", "set up plugin.json", "use ${CLAUDE_PLUGIN_ROOT}", "add commands/agents/skills/hooks", "configure auto-discovery", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices.

    Also in 5 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 13 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Description: - when and why the agent should use this tool

    line 43
  2. Distinctive:

    Add timeout handling for external tool calls

    line 74
  3. Distinctive:

    Write a system prompt that guides agent behavior:

    line 78
  4. Distinctive:

    Escalation criteria: - when to ask the user for help

    line 85
  5. Distinctive:

    Use structured objects, not free-form strings

    line 99
  6. Distinctive:

    Add state validation before each agent step

    line 102
  7. Distinctive:

    User escalation: - ask for help when the agent is stuck

    line 111
  8. Distinctive:

    Test suite covering key scenarios

    line 133
  9. Distinctive:

    Action: Create an agent with tools for web search, page reading, and note taking.

    line 142
  10. Distinctive:

    Action: Create an agent with tools for log querying, metrics checking, service restarting, and notification sending.

    line 148
  11. Distinctive:

    Action: Create an agent with tools for file reading, schema validation, data transformation, and database writing.

    line 154
  12. Distinctive:

    Test the system prompt separately: - verify it produces good tool selection

    line 164
  13. Distinctive:

    Keep state minimal: - only persist what the agent genuinely needs

    line 167

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent Development

Build reliable AI agents that execute multi-step workflows, orchestrate tools, maintain state, and recover from errors using the Claude Agent SDK.

Prerequisites

  • Claude API access with appropriate model permissions
  • Python 3.10+ or Node.js 18+ environment
  • Understanding of the agent's domain and available tools
  • Familiarity with async programming patterns

Workflow

Step 1: Define the Agent's Purpose

Establish the agent scope:

  1. Mission - single sentence describing what the agent accomplishes
  2. Capabilities - list of actions the agent can take
  3. Boundaries - what the agent should refuse or escalate
  4. Tools - external services and APIs the agent will call
  5. State requirements - what information persists across steps
  6. Success criteria - how to determine the agent completed its task

Step 2: Design the Tool Set

For each tool the agent will use:

  1. Name - descriptive snake_case identifier
  2. Description - when and why the agent should use this tool
  3. Parameters - input schema with types and validation
  4. Return type - what the tool returns on success
  5. Error modes - what can go wrong and how to signal it
  6. Side effects - does the tool modify external state

Group tools by category:

  • Read tools - gather information without side effects
  • Write tools - modify external state (require confirmation patterns)
  • Compute tools - transform data locally

Step 3: Implement the Agent Loop

Build the core agent execution cycle:

1. Receive user input or task description
2. Plan the approach (system prompt guides strategy)
3. Select and call appropriate tool
4. Process tool result
5. Decide: task complete, need more tools, or error
6. If not complete, return to step 3
7. Return final result to user

Key implementation details:

  • Set a maximum iteration limit to prevent infinite loops
  • Log each tool call and result for debugging
  • Implement checkpoints for long-running tasks
  • Add timeout handling for external tool calls

Step 4: Design the System Prompt

Write a system prompt that guides agent behavior:

  1. Role definition - what the agent is and its expertise
  2. Available tools - summary of each tool and when to use it
  3. Decision framework - how to choose between tools
  4. Output standards - format and quality requirements
  5. Error handling rules - what to do when tools fail
  6. Escalation criteria - when to ask the user for help

Step 5: Implement State Management

Design the state that persists across agent turns:

  1. Conversation history - messages exchanged with the model
  2. Tool call log - record of all tool invocations and results
  3. Task state - progress tracking for multi-step workflows
  4. Working memory - intermediate results the agent needs later
  5. Error state - failed attempts and retry counts

State management patterns:

  • Use structured objects, not free-form strings
  • Serialize state for persistence across sessions
  • Implement state cleanup to prevent context overflow
  • Add state validation before each agent step

Step 6: Add Error Recovery

Implement resilient error handling:

  1. Retry with backoff - transient failures get 2-3 retries
  2. Fallback tools - alternative approaches when primary tool fails
  3. Graceful degradation - partial results when full completion is impossible
  4. User escalation - ask for help when the agent is stuck
  5. State rollback - undo partial changes on failure

Step 7: Test the Agent

Validate agent behavior systematically:

  1. Happy path tests - standard inputs produce correct outputs
  2. Tool failure tests - agent recovers from individual tool errors
  3. Timeout tests - agent handles slow tools gracefully
  4. Edge case tests - unusual inputs do not crash the agent
  5. Loop detection tests - agent does not repeat the same failed action
  6. State tests - agent maintains correct state across many steps

Output Format

The skill produces:

  • Agent implementation with tool definitions
  • System prompt for agent behavior
  • State management module
  • Error recovery handlers
  • Test suite covering key scenarios
  • Configuration for deployment

Examples

Example 1: Research Agent

User: "Build an agent that researches a topic and writes a summary"

Action: Create an agent with tools for web search, page reading, and note taking. The agent plans its research, gathers sources, synthesizes findings, and produces a structured summary.

Example 2: DevOps Agent

User: "Create an agent that monitors and fixes deployment issues"

Action: Create an agent with tools for log querying, metrics checking, service restarting, and notification sending. Implements escalation when automated fixes fail.

Example 3: Data Pipeline Agent

User: "Build an agent that ingests, transforms, and validates data"

Action: Create an agent with tools for file reading, schema validation, data transformation, and database writing. Implements checkpoints and rollback on validation failure.

Best Practices

  1. Limit tool breadth - agents with fewer, well-defined tools outperform those with many
  2. Make tools idempotent - safe to retry without side effects
  3. Log everything - tool calls, decisions, and state changes
  4. Set hard limits - maximum iterations, timeout, and token budget
  5. Fail fast on invalid input - validate before starting the agent loop
  6. Use structured output - parse tool results into typed objects
  7. Test the system prompt separately - verify it produces good tool selection
  8. Monitor in production - track success rate, latency, and cost per task
  9. Version your tools - changing tool schemas requires updating the system prompt
  10. Keep state minimal - only persist what the agent genuinely needs

Error Handling

ErrorCauseRecovery
Infinite loopAgent repeats same actionDetect repeated tool calls, break after threshold
Context overflowToo much state accumulatedSummarize old state, prune conversation history
Tool timeoutExternal service unresponsiveApply timeout, retry once, then escalate
Invalid tool callAgent sends wrong parametersValidate parameters before execution, return clear error
State corruptionInconsistent state after failureValidate state at each step, rollback on detection
Budget exceededToo many API calls or tokensSet hard budget limits, stop gracefully when reached

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.