action-mailer-coder
Use when creating or refactoring Action Mailer emails. Applies Rails 7.1+ conventions, parameterized mailers, preview workflows, background delivery, and email design best practices.
Best use case
action-mailer-coder is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when creating or refactoring Action Mailer emails. Applies Rails 7.1+ conventions, parameterized mailers, preview workflows, background delivery, and email design best practices.
Teams using action-mailer-coder should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/action-mailer-coder/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How action-mailer-coder Compares
| Feature / Agent | action-mailer-coder | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when creating or refactoring Action Mailer emails. Applies Rails 7.1+ conventions, parameterized mailers, preview workflows, background delivery, and email design best practices.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# Action Mailer Coder
You are a senior Rails developer specializing in email delivery architecture.
## Mailer Design Principles
### Group Related Emails
```ruby
class NotificationMailer < ApplicationMailer
def comment_reply(user, comment)
@user = user
@comment = comment
mail(to: @user.email, subject: "New reply to your comment")
end
def mentioned(user, mention)
@user = user
@mention = mention
mail(to: @user.email, subject: "You were mentioned")
end
end
```
### Parameterized Mailers
```ruby
class NotificationMailer < ApplicationMailer
before_action { @user = params.fetch(:user) }
before_action { @account = params.fetch(:account) }
def comment_reply
@comment = params.fetch(:comment)
mail(to: @user.email, subject: "New reply on #{@account.name}")
end
end
# Calling the mailer
NotificationMailer.with(user: user, account: account, comment: comment).comment_reply.deliver_later
```
### Dynamic Defaults with Inheritance
```ruby
class AccountMailer < ApplicationMailer
default from: -> { build_from_address }
before_action { @account = params.fetch(:account) }
private
def build_from_address
@account.custom_email_sender? ?
email_address_with_name(@account.custom_email_address, @account.custom_email_name) :
email_address_with_name("hello@example.com", @account.name)
end
end
```
## Background Delivery
```ruby
UserMailer.with(user: user).welcome.deliver_later # Immediate queue
UserMailer.with(user: user).welcome.deliver_later(wait: 1.hour) # Delayed
UserMailer.with(user: user).digest.deliver_later(wait_until: Date.tomorrow.morning) # Scheduled
```
## Email Previews
```ruby
# test/mailers/previews/notification_mailer_preview.rb
class NotificationMailerPreview < ActionMailer::Preview
def comment_reply
NotificationMailer.with(
user: User.first,
account: Account.first,
comment: Comment.first
).comment_reply
end
end
```
Access at: `http://localhost:3000/rails/mailers`
## Internationalization
```ruby
def welcome
@user = params.fetch(:user)
I18n.with_locale(@user.locale) do
mail(to: @user.email, subject: t(".subject", name: @user.name))
end
end
```
## Attachments
```ruby
def invoice(order)
attachments.inline["logo.png"] = File.read("app/assets/images/logo.png")
attachments["invoice.pdf"] = generate_pdf(order)
mail(to: order.email, subject: "Your Invoice ##{order.number}")
end
```
## Testing (RSpec)
```ruby
RSpec.describe NotificationMailer, type: :mailer do
describe "#comment_reply" do
let(:mail) { described_class.with(user: user, comment: comment).comment_reply }
it "renders the headers" do
expect(mail.subject).to match(/New reply/)
expect(mail.to).to eq([user.email])
end
it "delivers later" do
expect { mail.deliver_later }.to have_enqueued_job(ActionMailer::MailDeliveryJob)
end
end
end
```
## Anti-Patterns
| Anti-Pattern | Problem | Solution |
|--------------|---------|----------|
| One mailer per email | Hard to navigate | Group related emails |
| Skipping `.with()` | Implicit dependencies | Use parameterized mailers |
| `deliver_now` | Blocks request | Use `deliver_later` |
| Missing previews | Can't visually test | Create preview classes |
## Output Format
When creating mailers, provide:
1. **Mailer Class** - The complete implementation
2. **Views** - HTML and text templates
3. **Preview** - Preview class for visual testing
4. **Tests** - Example test casesRelated Skills
adr-decision-extraction
Extract architectural decisions from conversations. Identifies problem-solution pairs, trade-off discussions, and explicit choices. Use when analyzing session transcripts for ADR generation.
add-ws-action
Add a new outgoing WebSocket action with typed payload and API exposure
add-reaction
Slack メッセージにリアクションを追加する。「リアクション追加」「リアクションつけて」「👍つけて」「絵文字で反応」「リアクションで返信」「いいねして」「リアクション送って」などで起動。User Token があればユーザーとしてリアクション、なければ Bot としてリアクション。
github-actions
Create and configure GitHub Actions. Use when building custom actions, setting up runners, implementing security practices, or publishing to the marketplace.
actions-pattern
Garante que novas Actions sigam o padrão de classes actions reutilizáveis do Easy Budget.
actions-debugger
GitHub Actions のワークフロー実行エラーを調査し、原因を特定して解決策を提案する。「Actions エラー」「ワークフロー失敗」「CI が落ちた」「ビルド失敗」「テスト失敗」「Actions を調べて」「CI のエラーを見て」などで起動。失敗したジョブのログを分析し、具体的な修正方法を提示。
actions-cicd-practices
GitHub Actions and CI/CD best practices for automated testing, building, and deployment.
actionbook
This skill should be used when the user needs to automate multi-step website tasks. Activates for browser automation, web scraping, UI testing, or building AI agents. Provides complete action manuals with step-by-step instructions and verified selectors.
actionable-review-format-standards
Standardized output format for code reviews with severity labels, file:line references, and fix code snippets. Use when generating review reports that need consistent, actionable feedback structure.
actionable-alerting-runbook-design
Designing effective alerts and runbooks for incident response. PROACTIVELY activate for: (1) Creating alerting rules, (2) Writing runbooks, (3) Reducing alert fatigue, (4) On-call escalation setup, (5) Incident response procedures. Triggers: "alerting", "runbook", "on-call", "pagerduty", "incident", "alert fatigue", "escalation", "playbook"
action
Execute a small batch of conditional actions only after verifying they are safe and unused.
action-queue
Sims-inspired task scheduling — queue actions, execute in order