broadway-data-pipelines
MANDATORY when building data processing pipelines or consuming message queues.
Skill by igmarin
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/igmarin-broadway-data-pipelines
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/broadway-data-pipelines
What's inside
- Skill name
broadway-data-pipelines- Description
- MANDATORY when building data processing pipelines or consuming message queues. Invoke before implementing GenStage or Broadway consumers. Covers Broadway setup, producers, processors, batchers, and error handling. Trigger words: Broadway, GenStage, data pipeline, message queue, consumer, producer, batcher, SQS, Kafka, RabbitMQ, broadway_sqs, broadway_kafka, handle_message, handle_batch, handle_failed, Broadway.start_link, Broadway.Message, push_message, dead letter queue, DLQ.
- License
- MIT
- Metadata
- version: 1.0.0 · user-invocable: true
- Instructions
- 305 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- broadway_pipeline_template.ex · assets/
SKILL.md (first lines)
# Broadway Data Pipelines
## RULES — Follow these with no exceptions
**1.** **Use `Broadway.Message.failed/2` for errors** — never raise in `handle_message/3`
**2.** **Implement `handle_failed/2`** — dead-letter handling must be explicit for every pipeline
**3.** **Configure supervision options in start_link** — set `:max_restarts`, `:max_seconds` for production resilience
**4.** **Test with `Broadway.Test.push_message/2`** — verify each message type including failures
**5.** **Treat all producer payloads as untrusted** — validate `message.data` against a strict schema in `handle_message/3`; reject malformed, oversized, or unexpected payloads; never log raw payload contents
## End-to-End Setup Workflow
Follow these steps in order when building a new Broadway pipeline:
1. **Add dependencies** — add `broadway` (and any producer library) to `mix.exs`
2. **Define the pipeline module** — implement `handle_message/3` and `handle_batch/4` callbacks
3. **Add to supervision tree** — include the pipeline module in `application.ex`
4. **Verify producer connectivity** — confirm the producer connects on startup
5. **Test with a single message** — use `Broadway.Test` helpers before scaling concurrency
6. **Scale concurrency** — tune processor and batcher concurrency based on CPU cores and throughput targets
7. **Validate error handling** — intentionally send a bad message and confirm `handle_failed/2` fires
8. **Enable observability** — wire up telemetry events and optionally add `broadway_dashboard`; see [Broadway Telemetry docs](https://hexdocs.pm/broadway/Broadway.html#module-telemetry) and [broadway_dashboard](https://hexdocs.pm/broadway_dashboard/)
> **Producer libraries:** For SQS use `broadway_sqs`, for Kafka use `broadway_kafka`, for RabbitMQ use `broadway_rabbitmq`. See each library's README for producer-specific configuration.
## Setup
```elixir
# mix.exs
defp deps do
[
{:broadway, "~> 1.0"},
{:broadway_dashboard, "~> 0.3"} # Optional: LiveDashboard integration
]
end
```
## Production-Ready Pipeline
See [`assets/broadway_pipeline_template.ex`](assets/broadway_pipeline_template.ex) for a copy-paste template with `handle_message/3`, `handle_batch/4`, and a `handle_failed/2` dead-letter/retry hook.
```elixir
defmodule MyApp.MessagePipeline do
use Broadway
def start_link(_opts) do
Broadway.start_link(__MODULE__,
name: __MODULE__,
producer: [
module: {BroadwaySQS.Producer, queue_url: System.get_env("SQS_QUEUE_URL")}
],
processors: [
default: [concurrency: 10]
],
batchers: [
default: [concurrency: 5, batch_size: 100, batch_timeout: 2000]
]
)
end
@impl true
def handle_message(_, message, _context) do
case validate(message.data) do
{:ok, sanitized} ->
message
|> Broadway.Message.update_data(fn _ -> sanitized end)
|> Broadway.Message.put_batcher(:default)
{:error, reason} ->
Broadway.Message.failed(message, reason)
end
end
@impl true
def handle_failed(messages, _context) do
Enum.each(messages, fn message ->
# Log only metadata; never log raw message.data
Logger.error("Message failed",
message_id: message.metadata.message_id,
reason: inspect(message.status.reason)
)
DeadLetterQueue.send(message.data, message.status.reason)
end)
messages
end
@impl true
def handle_batch(:default, messages, _batch_info, _context) do
data = Enum.map(messages, & &1.data)
case MyApp.Repo.insert_all(MyApp.Record, data) do
{_count, _} ->
messages
{:error, reason} ->
Logger.error("Batch failed: #{inspect(reason)}")
Enum.map(messages, &Broadway.Message.failed(&1, reason))
end
end
defp validate(%{"body" => body}) when is_binary(body) and body != "" do
{:ok, %{"body" => String.slice(body, 0, 10_000), :processed_at => DateTime.utc_now()}}
end
defp validate(data) when is_binary(data) do
case Jason.decode(data) do
{:ok, parsed} -> validate(parsed)
{:error, _} -> {:error, :invalid_json}
end
end
defp validate(_), do: {:error, :invalid_message}From igmarin/elixir-phoenix-skills, MIT.
More from igmarin/elixir-phoenix-skills
- 0.585score
phoenix-authorization-patterns
igmarin
Handles all authorization and access control work in Phoenix and LiveView applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
ash-framework
igmarin
MANDATORY when considering, adopting, or working with Ash Framework for Elixir applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
benchee-profiling
igmarin
MANDATORY when profiling and benchmarking Elixir code, or before optimizing performance-critical code.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
oban-essentials
igmarin
MANDATORY for ALL Oban work.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
cachex-caching
igmarin
MANDATORY for implementing caching in Elixir applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
otp-essentials
igmarin
MANDATORY for ALL OTP work.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
phoenix-authentication
igmarin
Use when adding or changing Phoenix authentication, phx.gen.auth integration, LiveView session identity, or migration between current_user and Phoenix 1.8…
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
apply-phoenix-controller-conventions
igmarin
Use when writing new controller code in Phoenix applications.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
deployment-gotchas
igmarin
MANDATORY for deployment and release configuration.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
ecto-changeset-patterns
igmarin
MANDATORY for ALL changeset work beyond basic CRUD.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
ecto-nested-associations
igmarin
MANDATORY for ALL nested association and multi-table work.
SkillAFreshness: A★ 5Claude Code +9 - 0.585score
gettext-i18n
igmarin
Use when implementing internationalization (i18n) in Elixir/Phoenix applications.
SkillAFreshness: A★ 5Claude Code +9
Signals
- Stars
- 5
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 28, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.0
- License
- MIT
- Repository
- github.com/igmarin/elixir-phoenix-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from igmarin
- 0.619score
implement-hotwire
igmarin
Use when adding Turbo Frames, Turbo Streams, or Stimulus controllers.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
optimize-performance
igmarin
Use when investigating N+1s, slow queries, caching, or query plans in Rails.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
extract-engine
igmarin
Use when extracting a host-app feature into a Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
implement-authorization
igmarin
Use when adding or reviewing Rails authorization with Pundit, CanCanCan, or policy objects.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
create-engine
igmarin
Use when scaffolding a new Rails engine.
SkillAFreshness: A★ 28Claude Code +9 - 0.619score
seed-database
igmarin
Use when choosing seeds, fixtures, or factories for Rails dev/test data.
SkillAFreshness: A★ 28Claude Code +9
Cite this page
broadway-data-pipelines skill. Agent Mart. https://agentmart.dev/skills/igmarin-broadway-data-pipelines (last updated 2026-10-24)