Create Email Draft
3
Check what's already provided in requirements. Only ask for what's missing:
- to: recipient email (skip if already known)
- subject: what it's about (skip if already known)
- content: what to say (skip if already known)
If all are provided, proceed directly to composing.
4
Compose the email body matching the user's gmail writing style from
Writing Style.
Show the draft to user for approval:
"Here's your draft:
To: [recipient]
Subject: [subject]
[body]
Save this as a draft?"
Make edits if requested. Only proceed when user confirms.
6
Check the result. If successful:
"Draft saved. Open Gmail to review and send when ready."
If failed, explain the error.
To run this task you must have the following required information:
> to (email address, optional if unknown), subject (optional), content or intent (what to say, can be rough notes), threadId (optional, for replies)
If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.
---
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
Add all steps to your todo list now and begin executing.
## Steps
1. [Read Email Drafting Guidelines]: Read the documentation in: `./skills/sauna/[skill_id]/resources/context/gmail.draft.rules.md` (Guidelines for drafting emails)
2. [Read Writing Style]: Read the file at `./documents/user/writing_style.md` and analyze its contents (User's gmail writing style to match)
3. Check what's already provided in requirements. Only ask for what's missing:
- to: recipient email (skip if already known)
- subject: what it's about (skip if already known)
- content: what to say (skip if already known)
If all are provided, proceed directly to composing.
4. Compose the email body matching the user's gmail writing style from `./documents/user/writing_style.md`.
Show the draft to user for approval:
"Here's your draft:
To: [recipient]
Subject: [subject]
[body]
Save this as a draft?"
Make edits if requested. Only proceed when user confirms.
5. [Gather Arguments: Create Gmail Draft] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `to`: {{to}}
- `subject`: {{subject}}
- `body`: {{body}}
- `threadId`: {{threadId}}
- `outputPath` (default: "session/draft-result.json"): ./session/draft-result.json
6. [Run Code: Create Gmail Draft]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/gmail.draft.create/preview,
"args": [
"to",
"subject",
"body",
"threadId",
"outputPath"
]
},
"packages": null
}
```
7. Check the result. If successful:
"Draft saved. Open Gmail to review and send when ready."
If failed, explain the error.