skills/refine-email-drafts/SKILL.md
Process change requests on InboxMate email drafts. Reads drafts with pending change requests from the notification service API, applies the requested changes to the email HTML, and updates the drafts. Run after adding change requests via the admin UI.
npx skillsauth add psquared-development/psquared-skills refine-email-draftsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Announce:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Email Draft Refinement started. Checking environment... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The notification service at notifications.psquared.dev stores email drafts that are reviewed before sending. Admins can attach "change requests" to drafts (e.g., "make this per du", "shorten the intro", "add a line about their pricing page"). This skill picks up those change requests, reads each draft's current HTML, applies the changes, and saves the updated version.
The drafts are InboxMate outreach emails — personalized cold emails sent to Austrian/German businesses to show them an AI chatbot demo we built for their company. Each email has:
Important: The email HTML is the final rendered output. When you edit it, you're editing raw HTML — preserve all styling, tags, and structure. Only change the text content as requested.
Read .env using the Read tool (do NOT source it). Extract:
EMAIL_DRAFT_ONLY_BEARER — bearer token for the notification service draft API. This token can read, create, and update drafts but cannot send, schedule, or delete them. Sending is human-only via the admin UI.The notification service base URL is https://notifications.psquared.dev.
Once verified:
Environment OK. Finding drafts with change requests...
Query the notification service API for DRAFT-status emails with change requests:
curl -s -X GET "https://notifications.psquared.dev/drafts?status=DRAFT&hasChangeRequest=true&pageSize=50" \
-H "Authorization: Bearer $EMAIL_DRAFT_ONLY_BEARER"
This returns { success: true, data: { data: [...], total: N } }. Each draft object contains:
id — draft UUIDsubject — email subjecthtml_body — full rendered HTMLtext_body — plain text versionchange_request — the requested change (string)recipient_email — recipientcrm_company_name — company namelocale — de or enIf none found (empty array or total=0), announce "No drafts with change requests" and stop.
Announce:
Found [N] drafts with change requests: 1. [Company] — "[change request]" 2. [Company] — "[change request]"
For each draft with a change request:
The html_body contains the full rendered email. Parse it to understand the current text content. The structure is:
{{greeting}} → first <p> after the header divider{{bodyParagraph1}} → second <p>{{bodyParagraph2}} → third <p> (optional){{bodyParagraph3}} → fourth <p> (optional)<a> with background-color:#10b981<p> inside the green #ecfdf5 div (optional)<p> in the green div<p> after the green div<p> with color:#10b981 and font-style:italicRead the change_request text and apply it. Common requests:
After making changes:
Update the draft via the notification service API:
curl -s -X PUT "https://notifications.psquared.dev/drafts/[draftId]" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $EMAIL_DRAFT_ONLY_BEARER" \
-d '{"html_body": "[updated HTML]", "change_request": null}'
Important: Set change_request to null after applying — this marks it as processed.
If the change request also affects the subject:
curl -s -X PUT "https://notifications.psquared.dev/drafts/[draftId]" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $EMAIL_DRAFT_ONLY_BEARER" \
-d '{"html_body": "[updated HTML]", "subject": "[new subject]", "change_request": null}'
Announce after each:
Refined: [Company] — applied "[change request]"
Announce:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Email Draft Refinement complete. Refined: [N] - [Company A] — "per du" applied - [Company B] — "shorten intro" applied Next step: Review refined drafts at → notifications.psquared.dev/drafts ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
tools
Generate a polished psquared client offer as a multi-page PDF (title, project description, screenshots, Angebot/pricing, AGB). Walks the user through gathering inputs (or accepts a JSON config), renders branded HTML templates with Playwright in two passes (title page edge-to-edge + body pages with margins and pagination), then merges with pdf-lib.
data-ai
Create email drafts for approved InboxMate demos. Verifies all demos are ready, pulls contacts from CRM, creates CRM tasks, and creates draft emails via the notification service. Run after /review-demos has processed all pending demos.
development
Audit or fix SEO issues for a single website or page. Checks meta tags, structured data, technical SEO, content quality, i18n, and AI readiness using only WebFetch — no external APIs. Pass a URL and mode (audit or fix) as parameters.
development
Run SEO audit or fix across all psquared websites autonomously. Dispatches parallel agents for psquared.dev, inboxmate.psquared.dev, ki-linz.at, and agenthub.psquared.dev, then presents a combined report. Pass mode (audit or fix) as parameter.