-
No arguments guard: If $0 is empty or not provided, display the following help and stop — do NOT proceed with any other step:
Usage: /mail <mode> <type> <subject>
Modes ($0):
token Authenticate and cache Graph API token (run once, lasts ~90 days)
owa Save HTML for copy-paste into Outlook Web (Linux)
mac Open draft in Outlook via AppleScript with native signature (macOS)
graph Send directly via Microsoft Graph API with inline signature (any OS)
Types ($1) — not required for token mode:
delivery Service/version delivery email
generic Generic email with configurable sections
Subject ($ARGUMENTS) — everything after type; not required for token mode
Examples:
/mail token
/mail owa delivery kabat-authorization-service
/mail mac generic cambio de configuración Kafka
/mail graph generic decisión técnica WebSocket
/mail graph delivery kabat-notification-service
-
Read the full CoT: Load and follow ~/rules/cot/mail.md from line 1 to end
-
Read the rules: Load ~/rules/rulesets/MAIL.md for HTML constraints and color palette
-
Select template based on $1:
delivery → read and use ~/rules/templates/mail/delivery_template.html
generic → read and use ~/rules/templates/mail/generic_template.html
-
Generate filename: YYYY-MM-DD-{subject-as-slug}.html (date in CST)
-
Ask the user for the missing data:
- For delivery: service name, prefix, version, recipient email, base branch, description
- For generic: title, recipient email, sections content, box types needed
-
Generate the HTML replacing all placeholders with real data
-
Select accent color for the H1 border based on email purpose:
- Delivery/OK →
#3498db (blue)
- Fix/change →
#e67e22 (orange)
- Critical alert →
#e74c3c (red)
- Technical decision →
#0066cc (dark blue)
-
Handle signature based on mode ($0):
-
Validate OWA rules:
- Every colored
<td> has BOTH bgcolor attribute AND background-color in style
- No
<style> blocks, no CSS classes
- Code blocks use
<td white-space:pre-wrap>, not <pre>
- Table row striping uses inline style, not
nth-child
-
Deliver based on mode ($0):