/dapr-skills:create-agent-pythonfrom dapr-skills
Scaffolds a durable AI agent app in Python using the Dapr Agents SDK or diagrid wrappers for LangGraph, CrewAI, and other frameworks. Supports single agents and coordinator-plus-specialist topologies.
Ships in dapr-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill describes how to create a durable AI agent application in Python. Two paths are supported:
dapr-agents SDK. This is the Dapr Agents framework proper; it is Python-only. Its DurableAgent runs on Dapr Workflow, reaches the LLM through a Dapr conversation component, and keeps the conversation of each run in a Dapr state store.diagrid distribution, which runs an agent you have already written in another framework (LangGraph, CrewAI, Strands, …) on Dapr Workflow so that each node / LLM call / tool call becomes a durable activity. One distribution, one extra per framework. diagrid is BUSL-1.1 licensed (with an Additional Use Grant, converting to Apache-2.0 on its Change Date) and its runners send one anonymous usage event per process; the generated README says both (see REFERENCE.md). dapr-agents is Apache-2.0.Single agent or coordinator + specialists, either way. With wrappers, the coordinator is a native dapr-agents agent that dispatches to wrapper specialists through the agent registry (a mixed project); wrappers that only exchange events over pub/sub are the event-driven variant.
You MUST follow these phases in strict order:
## Show final message section: the closing sentence followed by the Dev Dashboard recommendation. Do NOT add any other text, summary, or commentary.If you don't have enough context what to build, ask the user the following clarifying questions one by one using an interview style:
role and instructions.dapr-agents (native, the default) or one of the diagrid wrapper extras. Resolve the wrapper list at this point rather than reciting one — see "Resolving the framework list" below.dapr-agents AND Q2 selected single-agent): augmented-llm (default), prompt-chaining, routing, parallelization, orchestrator-workers, or evaluator-optimizer. Skip this question entirely if the user picked a wrapper extra — those frameworks define their own agent loop and the pattern concept does not apply.dapr-agents routes this through a Dapr conversation component; wrappers let the wrapped framework call the provider directly with an API key from the environment, and most extras bundle only an OpenAI client (see "LLM provider (wrappers)" in REFERENCE.md).The wrapper extras live in one place — the [project.optional-dependencies] table of diagridio/python-ai's pyproject.toml — and PyPI republishes that table verbatim as the distribution's provides_extra metadata. Read it instead of hardcoding it:
curl -s https://pypi.org/pypi/diagrid/json | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['info']['version']); print('\n'.join(e for e in d['info']['provides_extra'] if e not in ('agent-core','all','identity','holmesgpt')))"
Offer the user the extras that command prints. agent-core is the shared base every extra pulls in, all is a meta-extra and identity is a runtime helper — none is a framework choice. holmesgpt is filtered out because diagrid[holmesgpt] does not resolve from PyPI; if the user asks for HolmesGPT, tell them it is not supported for scaffolding and offer another framework.
If the command fails (no network), fall back to the snapshot in REFERENCE.md and tell the user it is a snapshot with a date on it, so a missing framework is understood as staleness rather than as unsupported.
The following must be installed by the user before this skill can run:
>=3.11,<3.14 — the bound both dapr-agents and diagrid declareOPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY) or a local Ollama instanceAdditional runtime dependencies (handled during project setup):
dapr-agents>=1.0.9 (native, and the coordinator of a mixed project) or diagrid[<extra>]>=0.5.3 (wrappers). These are floors, not pins — the exact resolved set is captured in uv.lock during Verify. See REFERENCE.md.Optional, for inspecting workflow runs locally:
## Check optional tools); it never installs it and never stops without it.Check once whether the optional Diagrid Dapr Dev Dashboard is installed by following the Check section of ../dapr-shared/dev-dashboard.md (diagrid-dev-dashboard --version). Remember the result (DevDashboardInstalled) for the final message. This check never stops the skill: do not ask the user about it, do not install anything, and continue with the next step whether or not the dashboard is installed.
Create the project root folder inside the current location where the terminal is open:
mkdir <ProjectRoot>
cd <ProjectRoot>
The should start with the and end with -agent: -agent.
<ProjectRoot>/
├── .gitignore
├── dapr.yaml
├── local.http
├── docker-compose.observability.yaml # (if observability enabled)
├── observability/ # (if observability enabled)
├── resources/
│ ├── agent-workflow.yaml
│ ├── llm-provider.yaml # (native only — see "Resources per flavor")
│ └── tracing.yaml # (if observability enabled)
└── <ProjectName>/
├── pyproject.toml
├── main.py
├── tools.py
└── logging_config.py # (if observability enabled)
<ProjectRoot>/
├── .gitignore
├── dapr.yaml
├── local.http
├── docker-compose.observability.yaml # (if observability enabled)
├── observability/ # (if observability enabled)
├── resources/
│ ├── agent-workflow.yaml
│ ├── agent-pubsub.yaml # (native only — see "Resources per flavor")
│ ├── agent-registry.yaml
│ ├── llm-provider.yaml # (native and mixed — see "Resources per flavor")
│ └── tracing.yaml # (if observability enabled)
├── coordinator/ # native dapr-agents, also in a mixed project
│ ├── pyproject.toml
│ ├── main.py
│ ├── tools.py
│ └── logging_config.py # (if observability enabled)
└── <specialist-N>/ # native, or a diagrid wrapper in a mixed project
├── pyproject.toml
├── main.py
├── tools.py
└── logging_config.py # (if observability enabled)
Generate only the components the chosen flavor uses:
File in resources/ | native dapr-agents | diagrid[<extra>] wrapper | mixed (native coordinator + wrapper specialists) |
|---|---|---|---|
agent-workflow.yaml | always — workflow state and, in dapr-agents 1.0.9, conversation memory | always — the runner executes on Dapr Workflow | always |
llm-provider.yaml | always — DaprChatClient(component_name="llm-provider") | omit — the wrapped framework calls the provider directly | always — for the coordinator |
agent-registry.yaml | multi-agent only | omit | always — the coordinator finds the specialists here |
agent-pubsub.yaml | multi-agent only | event-driven variant only | omit — dispatch does not use pub/sub |
tracing.yaml | observability on (Zipkin) | observability on (OTLP) | observability on (OTLP) |
Do not generate agent-memory.yaml: native memory is written to the state= store, and wrapper runners do not read or write conversation history through a state store (see "Memory" in REFERENCE.md). Add it, or another store, only when the generated code uses a framework memory helper that names it. In the README, list the components that were generated, not this whole table.
Python .gitignore file in the project root. See REFERENCE.md.
Multi-app run file. Single-agent: see ../dapr-shared/agent-dapr-yaml-single.md. Multi-agent: see ../dapr-shared/agent-dapr-yaml-multi.md.
Workflow state store (actor-enabled); native agents also keep conversation memory in it. See ../dapr-shared/agent-statestore-workflow.md.
Pub/sub component for agent topics and the team broadcast. See ../dapr-shared/agent-pubsub-redis.md.
Agent discovery state store; the coordinator dispatches to the agents registered here. See ../dapr-shared/agent-statestore-registry.md.
Dapr Conversation component, matching the provider from the specification. Pick one: OpenAI | Anthropic | Google AI (Gemini) | Ollama. Wrapper apps do not use this file; they read the provider's API key env var (OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY) and may need the provider package in pyproject.toml (see REFERENCE.md).
Dapr Configuration with tracing enabled. Native: ../dapr-shared/agent-tracing-zipkin.md. Wrapper and mixed: ../dapr-shared/agent-tracing-otlp.md, because the wrapper runners export app spans over OTLP gRPC and one receiver should take both. Wrapper apps also get OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_SERVICE_NAME in their dapr.yaml env: block; native apps get agent_observability= in main.py (see REFERENCE.md).
Local Zipkin (native) or Jaeger (wrapper and mixed) + Prometheus + Grafana. See ../dapr-shared/agent-observability-stack.md.
Python config file. Dependencies depend on the framework choice — see REFERENCE.md.
Agent entrypoint. See REFERENCE.md for the native template, the wrapper shape and runner table, and the mixed topology.
Tool definitions. See ../dapr-shared/agent-tools-python.md; tools for a wrapper project are defined with the wrapped framework's own decorator, not with dapr_agents.tool.
Structured logging. See ../dapr-shared/agent-logging-python.md.
HTTP request file for testing the agent endpoints. Native: POST /agent/run returns an instance_id at once, status at GET /agent/instances/{instance_id}. Wrapper: POST /agent/run with {"task": ...} returns when the run is finished, status at GET /agent/run/{workflow_id}. See REFERENCE.md.
IMPORTANT: After Project Setup you MUST run these exact verification instructions:
uv venv in each <ProjectName> folder to create a virtual environment.uv sync in each <ProjectName> folder to resolve and install dependencies. This writes uv.lock next to pyproject.toml.uv.lock exists and instruct the user to commit it — the >= floors in pyproject.toml keep the project on supported versions, and uv.lock is what makes a checkout reproduce byte-for-byte.uv run python -m compileall -q <ProjectName> in each project folder. It must exit with code 0; fix any error and re-run.__pycache__ folders the compile step created.uv venv / uv sync fails with a path-length error (path longer than allowed, os error 206, os error 87, or a DLL that will not load from .venv), the project folder is too deep for the 260-character Windows limit. Do not work around it by mapping drives (subst), creating virtual environments outside the project, or running uv from another folder — those leave files behind on the user's machine. Stop, tell the user that Verify did not complete and why, and suggest either moving the project to a shorter path (for example C:\src\<ProjectRoot>) or enabling long paths (Windows LongPathsEnabled), then re-running uv sync. Never report the build as verified when uv.lock was not written.IMPORTANT: After Verify you MUST run these instructions:
Create a README.md file inside the folder.
The README contains the following sections:
dapr run -f .).local.http.docker compose -f docker-compose.observability.yaml up -d), the trace UI URL (Zipkin http://localhost:9411 for native, Jaeger http://localhost:16686 for wrapper and mixed), Grafana URL (http://localhost:3000), and Prometheus URL (http://localhost:9099). The Diagrid Dapr Dev Dashboard gets its own section (item 10); it is not part of dapr init or of the compose stack.diagrid licence note and the usage analytics note with the opt-out variables (DO_NOT_TRACK, SCARF_NO_ANALYTICS, DIAGRID_NO_ANALYTICS); do not set an opt-out in the generated files. Mixed projects also get the "verify this end to end" note for the coordinator → specialist dispatch. Text for all three is in REFERENCE.md.../dapr-shared/running-with-catalyst.md. For wrapper projects, also mention diagridpy init as an alternative (see REFERENCE.md).../dapr-shared/dev-dashboard.md: why it is useful, the install command for each OS (macOS / Linux and Windows) and the run command (diagrid-dev-dashboard, http://localhost:9090).review-agent-tools, review-agent-memory, review-agent-orchestration and review-agent-observability skills to audit the generated agent.See REFERENCE.md for the pyproject.toml templates, the native main.py, the wrapper entry-point table, the multi-agent topologies, tool patterns, and observability wiring.
IMPORTANT: This is the LAST step. After Create README.md, your final output MUST be ONLY the message below followed by the Dev Dashboard recommendation — no preamble, no summary, no additional commentary, only replace the with the actual value:
The agent application is created. Open the README.md file in the folder for a summary and instructions for running locally.
Then add, as a separate paragraph, the block from the Final recommendation section of ../dapr-shared/dev-dashboard.md that matches DevDashboardInstalled (installed → start it; not installed → install it). Use it as written, including the link and the commands. Nothing may follow it.
What SKILL.md sets; muted values are Claude Code's defaults
33 skills in this plugin
/add-pubsub-dotnetAdds Dapr pub/sub to an existing .NET (ASP.NET Core, plain or Aspire) project. Edits only after you approve a plan. Use for "add pub/sub to my .NET project" or "subscribe this ASP.NET app to a topic". For a new project use create-pubsub-dotnet./add-pubsub-pythonAdds Dapr pub/sub to an existing Python FastAPI app. Edits only after you approve a plan. Use for "add pub/sub to my FastAPI app" or "make this Python service subscribe to a Dapr topic". For a new app use create-pubsub-python./add-workflow-dotnetAdds Dapr Workflow, activities and management endpoints to an existing .NET (ASP.NET Core, plain or Aspire) project after you approve a plan. Use for "add a workflow to my .NET project" or "make this process a durable workflow". For a new project use create-workflow-dotnet. For Diagrid use the diagrid plugin./check-prereq-agent-dotnetChecks prerequisites for durable AI agents in .NET with Microsoft Agent Framework on Dapr Workflow. Use for "check prerequisites for .NET agents" or "verify .NET agent environment"./check-prereq-agent-pythonChecks prerequisites for durable AI agents in Python with the Dapr Agents SDK or diagrid package framework wrappers. Use for "check prerequisites for Python agents" or "verify Python agent environment"./check-prereq-aspireChecks prerequisites for Dapr Workflow apps with .NET Aspire. Use for "check prerequisites for Aspire" or "verify Aspire environment".npx claudepluginhub diagrid-labs/dapr-skills --plugin dapr-skillsOther plugins' skills for the same job