agentleFS
RuralAIRuralAI/rural-hospitality-pipeline/skills/email-generation/SKILL.md

email-generation

Skill2 starsChanged 3 months agoApache-2.0View on GitHub

Renders the approved outreach email for each contact and creates a Gmail draft per contact. Reads Contacts and their linked Firms from Airtable, composes the segment template (verified per-region travel line, firm lead-in, greeting, signature) with a deterministic script, then creates one Gmail draft each via the Gmail connector. Use for Stage 03, generating outreach emails, creating drafts, or writing emails for a list of contacts.

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. extruct-ai/gtm-skills★ 108same 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 repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are 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.

  • 3

    Very specific

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

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

    Read Business Profile (single row).

    line 26
  2. Distinctive:

    Write these files in the working directory:

    line 35
  3. Very specific:

    Read the Contacts table (plain name works for reads).

    line 59
  4. Distinctive:

    Do not infer it from anything else.

    line 68
  5. Very specific:

    Write a contacts.json array in the working directory:

    line 70

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

Email Generation and Gmail Drafts

Version: 2.0.0 · Center for Rural AI

Turns Contacts into ready-to-send Gmail drafts. The approved template copy and per-region travel sentences come from Airtable (Email Templates, Region Travel), read via the connector in step 0; compose.mjs only substitutes the two tokens, adds the greeting, and appends the signature.

Flow

0. Read Business Profile, Email Templates, Region Travel, and Region Naming via the connector

Read Business Profile (single row). If the table is empty, stop and tell the operator to run client-onboarding first. Read Email Templates. If it has no record for the segment and audience you're generating, stop and tell the operator to run voice-intake's template-drafting step first -- there is no bundled default to fall back to. Read Region Travel and Region Naming (both may be empty or missing rows for some regions -- that's expected, not an error; a region with no Region Naming row just never matches, and falls back the same as an unverified one).

Write these files in the working directory:

// business-profile.json
{ "business-name": "...", "business-url": "...", "location": "...", "signing-name": "...", "signature-title": "...", "signature-address": "...", "signature-phone": "...", "signature-website": "..." }
// email-templates.json -- array, one record per Email Templates row
[{ "subject": "...", "segment": "Wedding", "audience": "Agency", "body": "...", "sign-off": "..." }]
// region-travel.json -- array, one record per Region Travel row (may be [])
[{ "region-id": "north_valley", "segment": "Wedding", "sentence": "..." }]
// region-naming.json -- array, one record per Region Naming row (may be [])
[{ "region-id": "north_valley", "anchor-city": "Northgate", "aliases": "Oakdale\nPinecrest" }]

1. Read Contacts and linked Firms via the connector

Read the Contacts table (plain name works for reads). For each contact you need: its email, its linked firm's name, the market that firm was found in (search-market, falling back to city-metro) so the right region travel line is chosen, and the firm's audience. Read the linked Firms to get all three.

audience decides which template the contact gets. "Agency" (the default, and what every Maps-sourced firm is) means a firm that places other people's groups. "In-house" means an employer booking for its own team, which is what the Apollo path produces. Pass the firm's value straight through; treat a blank as "Agency". Do not infer it from anything else.

Write a contacts.json array in the working directory:

[{ "email": "planner@firm.com", "firm": "Larkspur Events", "market": "Northgate", "segment": "Wedding", "audience": "Agency", "name": "" }]

name is usually empty for scraped contacts, which produces a "Hello," greeting.

2. Compose

node compose.mjs --input contacts.json

Output is a JSON array of { to, subject, body }, one per contact. The travel line is the human-verified sentence for the contact's region, or a safe no-transit-claim fallback if the region is unknown or unverified. Nothing about the travel claim is composed at run time.

3. Create one Gmail draft per email

For each composed item, call the Gmail connector create_draft with to (required), subject, and body. These are drafts, not sends. The operator reviews and sends each from their own Gmail.

Two things this skill does NOT do

  • It does not log drafts to the Outreach table (not needed for the outreach flow). If you later want to log drafts there, that write hits the same tbl/fld ID requirement as any Airtable write (resolve via the table URL if list_tables_for_base is unreliable).
  • It does not verify deliverability. Drafts go to whatever address extraction found.

Config sources

  • Business Profile, Email Templates, Region Travel, and Region Naming all come from the connector read in step 0 above, not from bundled config. Region Naming is per-client: a market only resolves to a region if this client's own Region Naming table has a matching row, so a new client never inherits another client's regions. Unmatched cities fall back safely to the generic no-transit-claim sentence.
  • email-templates.mjs, region-travel.mjs, and region-naming.mjs still ship in this folder but are no longer read by compose.mjs -- they exist only as Example Inn's own migration-source data (see the self-service onboarding design's Migration section).

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.