home / skills / andrelandgraf / fullstackrecipes / custom-durable-agent

custom-durable-agent skill

/.agents/skills/custom-durable-agent

This skill helps you design and operate a custom durable AI agent with full control over streamText options, configs, and tool loops.

npx playbooks add skill andrelandgraf/fullstackrecipes --skill custom-durable-agent

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
552 B
---
name: custom-durable-agent
description: Build a custom durable AI agent with full control over streamText options, provider configs, and tool loops. Compatible with the Workflow Development Kit.
---

# Custom Durable Agent

To set up Custom Durable Agent, refer to the fullstackrecipes MCP server resource:

**Resource URI:** `recipe://fullstackrecipes.com/custom-durable-agent`

If the MCP server is not configured, fetch the recipe directly:

```bash
curl -H "Accept: text/plain" https://fullstackrecipes.com/api/recipes/custom-durable-agent
```

Overview

This skill lets you build a custom durable AI agent with full control over streaming text behavior, provider configurations, and tool execution loops. It is compatible with the Workflow Development Kit so you can embed durable agent patterns into production web AI apps. The skill focuses on predictable, repeatable agent lifecycles and easy integration with existing backends and provider stacks.

How this skill works

You define an agent recipe that controls streamText options (chunking, timing, partial updates) and provider settings (API keys, timeouts, model selection). The agent runs durable workflows that persist state and orchestrate tool loops, allowing tools to be invoked repeatedly until goals are met. Recipes can be loaded from a centralized MCP server or fetched directly from a public recipe endpoint for local use.

When to use it

  • You need a stateful AI agent that survives restarts and continues long-running tasks.
  • You require fine-grained control over streaming text behavior for better UX or latency control.
  • You want to orchestrate multiple tools with loop logic until a success condition is reached.
  • You must integrate custom provider configs (different models, credentials, or regions).
  • You are building production-ready full stack web AI features using the Workflow Development Kit.

Best practices

  • Design clear success and failure conditions for tool loops to avoid infinite execution.
  • Tune streamText chunk size and intervals to balance responsiveness and cost.
  • Keep provider credentials and timeouts configurable per-environment for safer deployments.
  • Persist minimal agent state required to resume workflows and avoid excessive storage.
  • Test recipes in a staging environment before production to validate durability behavior.

Example use cases

  • A customer support agent that continues a multi-step resolution process across sessions.
  • An autonomous data processing pipeline that retries external tools until data quality checks pass.
  • A content generation system that streams partial drafts to a web client while iterating with editing tools.
  • A research assistant that queries multiple knowledge tools and aggregates results in durable state.

FAQ

How do I obtain the agent recipe if the MCP server is not configured?

Fetch the recipe directly from the public recipe endpoint provided by the project to download the agent definition and import it into your environment.

Is this compatible with my existing Workflow Development Kit projects?

Yes. Recipes are designed to integrate with the Workflow Development Kit so you can plug durable agents into existing workflows and UI layers.