rasa-writing-custom-actions

rasa-writing-custom-actions is a skill for Claude Code, Codex from RasaHQ/rasa-agent-skills. It costs 49 tokens per session (2,477 once invoked), scanned A, original, Apache-2.0.

A guide for writing Python custom actions in Rasa CALM, a framework for building conversational assistants. Custom actions perform work such as calling an external service, querying a database, calculating a result, or validating information collected from the user.

In plain words
What is it for?
Use it to create or edit Rasa action files, connect flows to APIs and databases, validate slots, build dynamic questions, and return results to conversation flows.
Why use it?
It separates conversation flow from the code that performs outside work. This makes each action easier to understand and prevents simple flow logic from becoming unnecessary Python code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create or edit Rasa action files, connect flows to APIs and databases, validate slots, build dynamic questions, and return results to conversation flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rasahq/rasa-agent-skills/rasa-writing-custom-actions
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add RasaHQ/rasa-agent-skills --skill rasa-writing-custom-actions
Clone the repo
git clone --depth 1 https://github.com/RasaHQ/rasa-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rasa-writing-custom-actions

README.md
[![agentmods](https://agentmods.dev/badge/skills/rasahq/rasa-agent-skills/rasa-writing-custom-actions/github.svg)](https://agentmods.dev/skills/rasahq/rasa-agent-skills/rasa-writing-custom-actions)
Your own site
<a href="https://agentmods.dev/skills/rasahq/rasa-agent-skills/rasa-writing-custom-actions"><img src="https://agentmods.dev/badge/skills/rasahq/rasa-agent-skills/rasa-writing-custom-actions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rasa-writing-custom-actions

Your own site · 80×15
<a href="https://agentmods.dev/skills/rasahq/rasa-agent-skills/rasa-writing-custom-actions"><img src="https://agentmods.dev/badge/skills/rasahq/rasa-agent-skills/rasa-writing-custom-actions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,477 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00049 $0.02477
Opus 5 $0.00024 $0.01239
Sonnet 5 $0.00010 $0.00495
Haiku 4.5 $0.00005 $0.00248

Measured 12d ago against content hash 9132134e627a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

rasa-writing-custom-actions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/rasa-writing-custom-actions/SKILL.md · 269 lines

How it starts

The opening of the file, as written. The whole thing — 269 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Writing Custom Actions in Rasa

Custom actions run Python code when a flow reaches an action step — for example, calling an external API, querying a database, or computing a value. They execute on an action server that communicates with the Rasa server via HTTP or gRPC.

Key principle: keep business logic in flows, not in actions. Flows define how the conversation proceeds (branching, conditions, collect steps). Actions do the raw work (fetch data, call APIs, query databases) and return results via SlotSet events for flows to use. Keep each action focused on one responsibility — action_search_products searches, action_place_order places an order.

If all you need is a simple API call with slot-based input/output mappings and the API is available on an MCP server, consider using an MCP tool call instead — see rasa-calling-mcp-tools-from-flows.

Workflow

  1. Identify what raw work the flow needs — API call, database query, computation. If the task can be handled with set_slots or flow logic alone, don't create an action.
  2. Review existing actions, slots, and responses — reuse before creating new ones.
  3. Create or open the Python file under actions/ (see "File organization").
  4. Name the action with a verb after action_ (see "Naming conventions").
  5. Define the action class: name() returns the action name, run() does the work (see "Action class structure").
  6. Read slot values from tracker.get_slot(), call external services, handle errors, then return SlotSet events for the flow to branch on (see "Working with the tracker", "Error handling", and "Returning events").
  7. Register the action in the domain file under actions: (see "Domain registration").
  8. Validate the project.

File organization

Before creating new files, check the existing project layout. If the project already uses a different convention, follow that convention instead.

By default, the action server looks for actions in a file called actions.py or a package directory called actions/. Use --actions my_module when running the action server to specify a different module.

Read the full file on GitHub · 269 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 269 lines · 49 tokens per session scan A 9132134e627a

Subscribe to this mod's changes

rasa-writing-custom-actions is a skill published in the GitHub repository RasaHQ/rasa-agent-skills (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 49 tokens to every session and 2,477 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.