agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-email/SKILL.md

shadow-email

Skill1 starsChanged 7 days agoMITView on GitHub

Use when fixing SMTP/MIME, OTP spam, SPF, DKIM, DMARC, bounces, bulk unsubscribe, or ESP failover. Not for REST webhooks (/shadow-integrate).

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill whenever the Monarch designs, builds, hardens, tests, or troubleshoots transactional email pipelines (OTP, password reset, …

    line 8
  2. Very specific:

    Run offline checks (L0/L1) before claiming VERIFIED-LOCAL:

    line 20
  3. Distinctive:

    Do not load unrelated references unnecessarily.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Shadow Email (/shadow-email) — Email Infrastructure & Deliverability Engineering

Use this skill whenever the Monarch designs, builds, hardens, tests, or troubleshoots transactional email pipelines (OTP, password reset, invoices, receipts), subscribed/marketing campaigns, DNS authentication, deliverability incidents, or ESP migrations.

1. Core Engineering Principles & Non-Negotiables

  1. Stream & Reputation Isolation: Separate critical transactional mail (auth.example.com / tx.example.com) from marketing/digest streams (news.example.com) with distinct subdomains, DKIM keys, and IP pools so marketing complaints never block OTPs.
  2. End-to-End Authentication & Alignment: Enforce SPF (<= 10 DNS lookups), 2048-bit DKIM, DMARC (p=none -> quarantine -> reject + rua), valid PTR/rDNS, and TLS / MTA-STS with From: alignment.
  3. Contextual RFC 8058 Unsubscribe: Include DKIM-signed List-Unsubscribe + List-Unsubscribe-Post: List-Unsubscribe=One-Click (honored <= 2 days) for bulk marketing and subscribed messages — do NOT attach marketing one-click unsubscribe headers to essential security transactional mail (OTP, password reset, fraud alerts).
  4. Durable Outbox, Safe Failover & Erasure-Safe Suppression: Persist email intents in a transactional outbox with idempotency keys, suppress hard bounces (5.x.x) and FBL complaints using keyed HMAC-SHA256 tombstones compatible with UU PDP/GDPR erasure, and never blindly fail over after an ambiguous post-submit timeout.
  5. Security & Zero Staging Leakage: Strip \r\n\0 from headers, build action links strictly from static APP_CANONICAL_ORIGIN, verify webhook HMAC/RSA signatures over raw bytes, and enforce a hard recipient allowlist/Mailpit sink in non-production environments.

2. Deterministic Verification CLI & Scenario Benchmarks

Run offline checks (L0/L1) before claiming VERIFIED-LOCAL:

python "shadow-email/scripts/email_deliverability_verifier.py" --self-test
python "shadow-email/scripts/email_deliverability_verifier.py" --check-dns path/to/dns.json
python "shadow-email/scripts/email_deliverability_verifier.py" --check-headers path/to/headers.json
python "shadow-email/scripts/email_deliverability_verifier.py" --check-template path/to/template.html
python -m unittest discover -s "shadow-email/tests" -v

Graded specialist scenarios live in evaluations.md (9 scenarios covering DNS alignment, RFC 8058 transactional vs bulk distinction, Outlook VML/dark mode, DSN 4.x.x/5.x.x, CRLF injection, failover safety, and 250 OK missing-in-inbox RCA).

Reference Guide

Load only the 1–2 modules matching the active subtask (never load all 11 at once):

Task / ScenarioTierLoad Reference
SMTP/ESMTP handshake, MIME multipart/alternative, RFC 5321/5322 headers, DSN codes (2.x/4.x/5.x)COREreferences/01-email-protocol-fundamentals.md
SPF (<= 10 lookups), 2048-bit DKIM, DMARC alignment & rollout, PTR/rDNS, MTA-STS, TLS-RPT, BIMICOREreferences/02-authentication-and-domain-security.md
EmailProviderPort, React Email/MJML architecture, idempotency keys, stream isolation, template versioningCOREreferences/03-transactional-email-architecture.md
Outlook Classic Word/VML buttons, Gmail 102 KB clipping, dark-mode CSS contrast, email accessibilityCOREreferences/04-rendering-and-client-compatibility.md
Transactional outbox, BullMQ/SQS priority queues, exponential backoff, DLQ replay, per-domain rate limitsCOREreferences/05-queue-and-reliability-engineering.md
IP/domain reputation, warm-up schedules, hard/soft bounce & complaint thresholds (< 0.1%), throttlingADVANCEDreferences/06-deliverability-engineering.md
Consent ledger, RFC 8058 marketing vs OTP exception, GET/POST unsubscribe safety, HMAC suppressionCOREreferences/07-consent-and-subscription-management.md
CRLF header injection, OTP bombing rate limits, Host header poisoning, signed webhook replay protectionADVANCEDreferences/08-email-security-and-abuse-prevention.md
Amazon SES vs Resend vs Postmark vs SendGrid, safe multi-ESP circuit-breaker failover, suppression syncSPECIALISTreferences/09-esp-integration-and-failover.md
Delivery funnel SLIs, Google Postmaster/SNDS/DMARC rua alerts, 250 OK inbox-missing incident runbooksOPERATIONALreferences/10-observability-and-incident-response.md
Mailpit local E2E, staging recipient allowlist sink, CI gates, SES simulator & production launch checklistOPERATIONALreferences/11-testing-and-production-readiness.md

Do not load unrelated references unnecessarily.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.