Publish Letter
Requirements
Title for the letter.
Content to publish (markdown text, or path to a file).
Optional: style preference (modern, classic, elegant).
Optional: author name.
Optional: header image (URL or request to generate one).
2
Gather the publishing details:
- Title - ask if not provided
- Content - the user provides text directly or points to a file
- Style - suggest based on content tone, or ask user preference:
- Modern: clean, professional (best for updates, announcements)
- Classic: warm, traditional (best for letters, formal notices)
- Serif: refined, bookish (best for essays, long-form)
- Author - optional byline
- Date - use today's date unless user specifies otherwise
- Header image - ask if they want to add one (can attach or generate)
If content is from a file, read it. If user provides text directly, use that.
3
If user wants a header image:
- If they have an existing image, use
Host Image to get a public URL
- If they want to generate one, use
Generate Image then
Host Image
Skip this step if no image requested.
4
Generate a URL-safe slug from the title:
- Lowercase
- Replace spaces with hyphens
- Remove special characters
- Keep it concise (max ~50 chars)
Example: "Letter to My Investors" → "letter-to-my-investors"
5
Save the letter content to Letter Draft as a markdown file.
This prepares it for the render step.
8
Write a preview of the letter with _action frontmatter:
_action:
label: "Publish letter"
prompt: "Publish this letter to GitHub Pages using
Publish to GitHub Pages"
isComplete: false
Title: [title]
Style: [style name]
Author: [author if provided]
Date: [date]
[First ~500 characters of the content as preview...]
This letter will be published at the user's GitHub Pages URL
The user can review and click "Publish letter" to proceed.
10
Present the published letter:
- Show the live URL prominently
- Note that GitHub Pages may take 1-2 minutes to deploy
- Mention the letter is tracked in
Published Letters Index
- Offer to publish another letter or make edits
Update Published Letters Index with an entry containing:
- title, url, style, author (if provided), publishedAt, slug
To run this task you must have the following required information:
> Title for the letter.
Content to publish (markdown text, or path to a file).
Optional: style preference (modern, classic, elegant).
Optional: author name.
Optional: header image (URL or request to generate one).
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 Letter Typography System]: Read the documentation in: `skills/sauna/[skill_id]/references/publish.letter.typography.md` (Typography options for style selection)
2. Gather the publishing details:
1. Title - ask if not provided
2. Content - the user provides text directly or points to a file
3. Style - suggest based on content tone, or ask user preference:
- Modern: clean, professional (best for updates, announcements)
- Classic: warm, traditional (best for letters, formal notices)
- Serif: refined, bookish (best for essays, long-form)
4. Author - optional byline
5. Date - use today's date unless user specifies otherwise
6. Header image - ask if they want to add one (can attach or generate)
If content is from a file, read it. If user provides text directly, use that.
3. If user wants a header image:
- If they have an existing image, use `skills/sauna/[skill_id]/references/recipes/media.image.host.md` to get a public URL
- If they want to generate one, use `skills/sauna/[skill_id]/references/recipes/media.image.generate.md` then `skills/sauna/[skill_id]/references/recipes/media.image.host.md`
Skip this step if no image requested.
4. Generate a URL-safe slug from the title:
- Lowercase
- Replace spaces with hyphens
- Remove special characters
- Keep it concise (max ~50 chars)
Example: "Letter to My Investors" → "letter-to-my-investors"
5. Save the letter content to `session/draft.md` as a markdown file.
This prepares it for the render step.
6. [Gather Arguments: Render Letter HTML] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `title`: title from requirements
- `contentPath`: session/draft.md
- `style` (default: "modern"): style (modern, classic, or serif)
- `author`: author (or empty string if none)
- `date`: date (formatted nicely, e.g., 'January 15, 2026')
- `imageUrl`: imageUrl (or empty string if none)
- `outputPath`: session/letter.html
- Packages: marked
7. [Run Code: Render Letter HTML]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/publish.letter.render/preview,
"args": [
"title",
"contentPath",
"style",
"author",
"date",
"imageUrl",
"outputPath"
]
},
"packages": ["marked"]
}
```
8. [Read External Actions Guide]: Read the documentation in: `skills/sauna/[skill_id]/references/sauna.actions.external.md` (Preview pattern for external publish action)
9. Write a preview of the letter with _action frontmatter:
---
_action:
label: "Publish letter"
prompt: "Publish this letter to GitHub Pages using `skills/sauna/[skill_id]/scripts/web.github.publish.js`"
isComplete: false
---
**Title:** [title]
**Style:** [style name]
**Author:** [author if provided]
**Date:** [date]
---
[First ~500 characters of the content as preview...]
---
*This letter will be published at the user's GitHub Pages URL*
The user can review and click "Publish letter" to proceed.
10. [Gather Arguments: Publish to GitHub Pages] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `projectName`: slug (the URL-safe project name)
- `htmlPath`: session/letter.html
- `commitMessage` (default: "Deploy web app"): Publish: [title]
- `trackingPath`: documents/published-letters.json
11. [Run Code: Publish to GitHub Pages]: Call `run_script` with:
```json
{
"file": {
"path": https://sk.ills.app/code/web.github.publish/preview,
"args": [
"projectName",
"htmlPath",
"commitMessage",
"trackingPath"
]
},
"packages": null
}
```
12. Present the published letter:
1. Show the live URL prominently
2. Note that GitHub Pages may take 1-2 minutes to deploy
3. Mention the letter is tracked in `documents/published-letters.json`
4. Offer to publish another letter or make edits
Update `documents/published-letters.json` with an entry containing:
- title, url, style, author (if provided), publishedAt, slug