task icon Task

Create Bedtime Story

Generate a personalized bedtime story with preview for audio conversion

Requirements
Child's name and age. Optionally: theme preferences, favorite animals/interests.
4

FIRST: If the user already provided a name in their request, use it. Check the profile for that child's age, or ask age only if not in profile. If no name was provided, check profile for a '## Children' section - if children found, confirm which one. If no children in profile, ask name and age. ONLY reference children actually in the profile - never invent. STOP and wait.

5

If new child, save to stateUser Profile Facts (file: personal.md) under '## Children'. Check stateGenerated Audio (category: bedtime-stories) for this child's stories (filenames have dates). Make a natural suggestion based on what you find: if there's a recent story (last night, yesterday), offer to continue it ('I see we did The Hedgehog Cartographer last night - want to see what Cartwright's up to, or something new?'). If there's a pattern in themes, suggest a variation ('You've done a lot of animal stories - elephant, hedgehog... how about a llama tonight?'). If no stories yet, just ask what they'd like. Keep it casual, one suggestion. STOP and wait.

6

Check profile for saved narrator voice. If none, ask ONLY: 'Who should narrate? a) Rachel - warm b) Charlotte - British c) Adam - deeper'. Save choice to profile. STOP and wait.

7

Propose a 2-3 sentence outline: title idea, the setup, and how it ends peacefully. Include a length suggestion based on context - short (3 min) for younger kids or if it's late, medium (5 min) as default, longer (~8 min) for older kids or weekend nights. Frame naturally: 'This would be a cozy 5-minute one - how does that sound?' Wait for approval or tweaks.

9

Once approved, generate the full story following sliceBedtime Story Guide. Use the agreed length. If continuing a previous story, read that story file first and create a sequel - bring back the same characters, reference past events ('Remember when...'), and continue their world. Match vocabulary to age. Weave their name naturally (2-3 mentions).

12

Write the story to stateStory Draft with _action frontmatter. The file creates a preview card with a "Convert to audio" button.


_action:
label: "Convert to audio"
prompt: "Run taskConvert Story to Audio to generate audio narration for this story"
isComplete: false

[Story Title]

[Full story text]


For [Name], age [age]

                    To run this task you must have the following required information:

> Child's name and age. Optionally: theme preferences, favorite animals/interests.

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 CONSECUTIVE read steps in a row, read them all at once (in parallel). Otherwise, do not read a file until you reach that step.

Add all steps to your todo list now and begin executing.

## Steps

1. [Read Bedtime Story Guide]: Read the documentation in: `skills/sauna/[skill_id]/references/bedtime.story.guide.md` (Load creative guidance for story generation)

2. [Read User Profile Facts]: Discover relevant information in the user's filesystem at `documents/user/profile/[file=personal|goals|interests|ideology].md`. (Check for known children (names, ages) in file: personal.md)

3. [Read Generated Audio]: Discover relevant information in the user's filesystem at `documents/media/audio/[category]/**/*`. (Check category: bedtime-stories for previous stories)

4. FIRST: If the user already provided a name in their request, use it. Check the profile for that child's age, or ask age only if not in profile. If no name was provided, check profile for a '## Children' section - if children found, confirm which one. If no children in profile, ask name and age. ONLY reference children actually in the profile - never invent. STOP and wait.

5. If new child, save to `documents/user/profile/[file=personal|goals|interests|ideology].md` (file: personal.md) under '## Children'. Check `documents/media/audio/[category]/**/*` (category: bedtime-stories) for this child's stories (filenames have dates). Make a natural suggestion based on what you find: if there's a recent story (last night, yesterday), offer to continue it ('I see we did The Hedgehog Cartographer last night - want to see what Cartwright's up to, or something new?'). If there's a pattern in themes, suggest a variation ('You've done a lot of animal stories - elephant, hedgehog... how about a llama tonight?'). If no stories yet, just ask what they'd like. Keep it casual, one suggestion. STOP and wait.

6. Check profile for saved narrator voice. If none, ask ONLY: 'Who should narrate? a) Rachel - warm b) Charlotte - British c) Adam - deeper'. Save choice to profile. STOP and wait.

7. Propose a 2-3 sentence outline: title idea, the setup, and how it ends peacefully. Include a length suggestion based on context - short (~3 min) for younger kids or if it's late, medium (~5 min) as default, longer (~8 min) for older kids or weekend nights. Frame naturally: 'This would be a cozy 5-minute one - how does that sound?' Wait for approval or tweaks.

8. [Read Invisible AI Writing]: Read the documentation in: `skills/sauna/[skill_id]/references/writing.human.invisible.md` (Natural prose patterns for storytelling)

9. Once approved, generate the full story following `skills/sauna/[skill_id]/references/bedtime.story.guide.md`. Use the agreed length. If continuing a previous story, read that story file first and create a sequel - bring back the same characters, reference past events ('Remember when...'), and continue their world. Match vocabulary to age. Weave their name naturally (2-3 mentions).

10. [Read External Actions Guide]: Read the documentation in: `skills/sauna/[skill_id]/references/sauna.actions.external.md` (Load the _action preview pattern)

11. [Read Story Draft]: Discover relevant information in the user's filesystem at `session/bedtime-story-draft/*.md`. (Get the session file path for the draft)

12. Write the story to `session/bedtime-story-draft/*.md` with _action frontmatter. The file creates a preview card with a "Convert to audio" button.

---
_action:
  label: "Convert to audio"
  prompt: "Run `skills/sauna/[skill_id]/references/recipes/bedtime.story.convert.md` to generate audio narration for this story"
  isComplete: false
---

# [Story Title]

[Full story text]

---
*For [Name], age [age]*