brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
emailSend and diagnose transactional email through Twilio SendGrid from a terminal or agent: send messages, check deliverability (bounces and spam reports), and verify Signed Event Webhook signatures (ECDSA P-256) — with a bundled email-cli script that is read-only by default and gates every send behind a --dry-run/--yes confirmation. Use when an agent needs to …
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this skill to send transactional email through Twilio SendGrid and to diagnose delivery: bounces, spam complaints, and the Signed Event Webhook. This is a tool skill for one vendor (SendGrid). Marketing campaigns, template builders, and other providers are out of scope; this skill owns the operational loop for application-triggered email: send it, check it landed, and verify the events claiming so are authentic.
email-cli script makes reads without writing anything.--dry-run preview and --yes confirmation through email-cli. There is no reliable "un-send" for delivered mail.--limit; never page past what the task needs.scripts/email-cli is an agent-first, stdlib-only CLI over the SendGrid v3 API, including a self-contained ECDSA P-256 signature verifier with no third-party crypto dependency.
email/scripts/email-cli --help # no key or network needed
email/scripts/email-cli --json --limit 20 deliverability bounces
email/scripts/email-cli --json --limit 20 deliverability spam-reports
email/scripts/email-cli send --to user@example.com --from no-reply@example.com \
--subject "Password reset" --body "..." --dry-run # preview only
email/scripts/email-cli send --to user@example.com --from no-reply@example.com \
--subject "Password reset" --body "..." --yes # confirmed send
email/scripts/email-cli webhook verify --body-file body.json \
--signature "MEUC..." --timestamp 1712345678 --public-key-file public-key.pem
Exit codes: 0 success, 1 API error or failed verification, 2 usage error. Sends are guarded: without --dry-run or --yes the script refuses with exit 1 and never calls the API. Reads are bounded by --limit (default 20, max 100).
deliverability bounces and deliverability spam-reports to see who failed to receive and why.--dry-run and confirmed with --yes.x-message-id), then later confirm delivery via webhook/API evidence rather than assuming.from), one or more to recipients, subject, plain-text body, and optionally an html body. SendGrid requires the from-address to be a verified sender identity on your account.--dry-run prints the exact from/to/subject/body preview and never calls the API. --yes confirms and posts to POST /v3/mail/send, which returns 202 Accepted with the x-message-id header.GET /suppression/bounces): recipients whose mail bounced, with reason and status. Hard bounces (5.x.x permanent) indicate invalid addresses; repeated bounces hurt sender reputation.GET /suppression/spam_reports): recipients who marked mail as spam. Frequent complaints indicate a content or targeting problem.SendGrid's Signed Event Webhook signs each request with an ECDSA key pair. To verify:
X-Twilio-Email-Event-Webhook-Timestamp is recent (replay protection; email-cli default window 300s, disable with --max-age 0).timestamp + raw body (bytes concatenated, no separator) and verify the ECDSA P-256 signature (X-Twilio-Email-Event-Webhook-Signature, base64-decoded ASN.1 DER) against the webhook public key.email-cli webhook verify --body-file body.json --signature <header> --timestamp <header> --public-key-file public-key.pem runs exactly this check with a stdlib-only P-256 implementation. The public key is shown in the Event Webhook settings when Signed Webhook is enabled; store it as a file, never in code.
| Load when | Reference |
|---|---|
| Sources, refresh procedure | references/00-source-index.md |
| API surface, webhook verification details, deliverability semantics | references/01-sendgrid-operations.md |
scripts/email-cli: bounded, stdlib-only CLI (send, deliverability bounces/spam-reports, webhook verify with self-contained ECDSA P-256; --json; --limit; send gated by --dry-run/--yes).tests/test_email_cli.py: 15 deterministic tests against a stub SendGrid API plus OpenSSL-generated ECDSA webhook vectors (independent cross-check of the verifier).references/: dated source index + SendGrid operations reference.evals/evals.json: six output-quality evaluation cases for agent runs.| Claim | Minimum evidence |
|---|---|
| A message was accepted | email-cli send --yes exits 0 and returns the x-message-id |
| A recipient bounced | email-cli deliverability bounces --json lists the address with reason and status |
| A webhook is authentic | email-cli webhook verify exits 0 with verified: true for the exact body/signature/timestamp |
| Delivery actually happened | Delivery webhook event (verified) or activity feed shows the message as delivered |
--dry-run preview, and --yes confirmation — sent mail is durable, external, and in recipients' inboxes.--limit; never dump full message bodies, API keys, or suppression lists into chat.