agentleFS
its-shitzuits-shitzu/AgentStack/.claude/skills/add-email-template/SKILL.md

add-email-template

Skill1 starsChanged 5 months agoMITView on GitHub

Generate a new transactional email (React Email component) and wire its send call into the right trigger point. Use when the user asks for a new transactional/notification email (e.g. "add an email when an invoice is overdue", "send a password-changed notification").

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. fpindej/netrock★ 234same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add a send<Name>Email({...}) function to src/lib/email.ts: guard on resend being configured (same

    line 22
  2. Very specific:

    Never send email directly with the Resend SDK from a route/action — always go through a named function in lib/email.ts.

    line 28
  3. Very specific:

    Keep templates self-contained (no shared layout component yet) — if asked to add a third+ template that shares structure, propose …

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

add-email-template

Creates a React Email template and registers a typed sender function, then asks for (or infers) where it should be triggered. Read AGENTS.md for project-wide conventions.

Reference files (read these before generating anything)

  • src/emails/welcome-email.tsx — canonical template structure (Html/Head/Preview/Body/Container/Heading/Text from @react-email/components, inline styles, typed props interface, default export).
  • src/emails/subscription-confirmation-email.tsx — second example, shows multiple props.
  • src/lib/email.ts — the single place that owns the Resend client and exposes one send<X>Email() function per template. Every template must have a corresponding function here, not be sent ad hoc from call sites.
  • src/lib/auth.ts (databaseHooks.user.create.after) — example of a trigger point calling sendWelcomeEmail(...) after a DB write.
  • src/app/api/stripe/webhook/route.ts (notifyOrganizationOwner) — example of a trigger point inside a webhook handler.

Steps

  1. Name the template in PascalCase ending in Email (e.g. InvoiceOverdueEmail) and the file in kebab-case (e.g. invoice-overdue-email.tsx) under src/emails/.
  2. Build the component following the exact structure of welcome-email.tsx: typed props interface, Html/Head/Preview/Body/Container wrapper, plain inline style objects (no Tailwind — React Email clients don't reliably support it), default export.
  3. Add a send<Name>Email({...}) function to src/lib/email.ts: guard on resend being configured (same if (!resend) { console.warn(...); return; } pattern as the existing functions), call resend.emails.send({ from: FROM_ADDRESS, to, subject, react: <Component {...props} /> }).
  4. Determine the trigger point. Ask the user if it's ambiguous; otherwise infer from context (e.g. "after a user is created" → lib/auth.ts hook; "after a Stripe event" → the relevant case in api/stripe/webhook/route.ts; "after a CRUD action" → the relevant server action in that resource's actions.ts). Insert the await send<Name>Email(...) call at that exact point, after the triggering DB write succeeds.
  5. State explicitly in your final summary: which file holds the template, which function sends it, and which file/line now triggers it — so the user can verify the wiring at a glance.

Conventions to enforce

  • Never send email directly with the Resend SDK from a route/action — always go through a named function in lib/email.ts.
  • Keep templates self-contained (no shared layout component yet) — if asked to add a third+ template that shares structure, propose extracting a shared EmailLayout rather than copy-pasting, but only after confirming with the user.
  • Subject lines are set where the email is sent (in lib/email.ts), not inside the component.

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.