add-pubsub-python

add-pubsub-python is a skill for Claude Code from diagrid-labs/dapr-skills. It costs 134 tokens per session (3,542 once invoked), scanned A, original, MIT.

A procedure for adding Dapr pub/sub to an existing Python FastAPI application. It connects the application to message publishing and receiving while preserving the subscription style already in use.

In plain words
What is it for?
It adds the needed dependencies, Dapr configuration, publisher and subscriber code, and documentation for a chosen message type and topic. It supports declarative, programmatic, or streaming subscriptions and does not change Git state.
Why use it?
It avoids broad rewrites by inspecting the existing app, getting approval for a plan, making small changes, and checking compilation, imports, and tests after each step.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the dapr-skills plugin — 29 skills shipped together

Good fit It adds the needed dependencies, Dapr configuration, publisher and subscriber code, and documentation for a chosen message type and topic. It supports declarative, programmatic, or streaming subscriptions and does not change Git state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/diagrid-labs/dapr-skills/add-pubsub-python
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 diagrid-labs/dapr-skills --skill add-pubsub-python
Clone the repo
git clone --depth 1 https://github.com/diagrid-labs/dapr-skills

Made for: Claude Code.

Or install dapr-skills, the plugin that ships this one along with the rest of its 29 skills.

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 add-pubsub-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/diagrid-labs/dapr-skills/add-pubsub-python/github.svg)](https://agentmods.dev/skills/diagrid-labs/dapr-skills/add-pubsub-python)
Your own site
<a href="https://agentmods.dev/skills/diagrid-labs/dapr-skills/add-pubsub-python"><img src="https://agentmods.dev/badge/skills/diagrid-labs/dapr-skills/add-pubsub-python/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 add-pubsub-python

Your own site · 80×15
<a href="https://agentmods.dev/skills/diagrid-labs/dapr-skills/add-pubsub-python"><img src="https://agentmods.dev/badge/skills/diagrid-labs/dapr-skills/add-pubsub-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,542 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.00134 $0.03542
Opus 5.5 $0.00054 $0.01417
Sonnet 5.5 $0.00027 $0.00708
Haiku 4.5 $0.00013 $0.00354

Measured yesterday against content hash 1f60b9eb1139, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

add-pubsub-python 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 yesterday.

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/add-pubsub-python/SKILL.md · 121 lines

How it starts

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

Add Dapr pub/sub to an existing Python FastAPI app

Overview

This skill adds Dapr pub/sub (publisher, subscriber or both) to a FastAPI app that already exists. It changes nothing before the user approves a written plan, edits existing files with the smallest possible change, follows the project's own conventions, checks that the code still compiles and imports after every step and runs the existing tests at the end. It never changes git state.

Execution Order

You MUST follow these phases in strict order:

  1. Resolve target — read-only inspection of the project.
  2. Check specification — role, subscription type, topic, message type, optional features.
  3. Check optional tools — Diagrid Dapr Dev Dashboard check; never stops the skill.
  4. Plan and approval — show the Add Pub/Sub Plan with its two questions (package updates, publishing from an existing endpoint) and wait for approval.
  5. Apply — one step at a time, checking after each.
  6. Final verification — compile, import and test.
  7. Write the run doc — DAPR-PUBSUB.md at the project root.
  8. Show final message — your output MUST end with EXACTLY the message in ## Show final message followed by the Dev Dashboard recommendation. No other text after it.

Prerequisites

The user must have installed:

  • Python 3.10 or later (the project's own interpreter) and the package manager the project uses: uv, or pip with a requirements.txt or a pyproject.toml.
  • Docker or Podman
  • Dapr CLI 1.18+ (not needed to check the code; needed to run)
  • Optional: the Diagrid Dapr Dev Dashboard. The skill only checks whether it is installed; it never installs it and never stops without it.

Phase 1: Resolve target

Read-only. Follow Detection in REFERENCE.md. Determine and remember:

Read the full file on GitHub · 121 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday Changed · +1 lines 1f60b9eb1139
  2. 3d ago First seen · 120 lines · 134 tokens per session scan A e869f34cb04d

Subscribe to this mod's changes

add-pubsub-python is a skill published in the GitHub repository diagrid-labs/dapr-skills (13 stars, last pushed yesterday), licensed MIT. It adds 134 tokens to every session and 3,542 once invoked, about $0.0005 per session on Opus 5.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-10-14.

Related

Other skills, from other repositories