🎯 What we’ll build
The morning routine is a scheduled task (the one that runs automatically at a set time, without you having to open anything — covered in depth in module 6.2) that runs every morning, for example at 7h. When it runs, the agent checks what matters for your day — important emails, calendar appointments, or a summary of news/data you're interested in — and leaves a summary ready for you to read as soon as you wake up, without having to hunt for information in three different places.
The interesting part isn’t just "running every morning" — any alarm clock can do that. What makes this routine a A real build is that it improves on its own: uses the status file (the same pattern as module 6.4, "the routine that learns") to remember what it showed yesterday and avoid repeating it, and to adjust what it prioritizes based on what you found useful.
Caption: the cycle closes in a loop — the routine doesn’t just run; it records what it did so the next run can start smarter, without repeating what you’ve already seen.
💡 Main Concept
A complete morning routine has 4 parts you already know separately — here they come together:
- •Trigger: scheduled task at 7 a.m. (module 6.2).
- •Memory: status file that learns (module 6.4).
- •Security: restrictive permissions, never delete (module 6.6).
- •Delivery: notification with the summary ready (module 6.6).
📄 Design the routine status file
New here? O status file is a plain text file (format JSON — an organized way to store information in "key: value" pairs, easy for both you and the agent to read) that keeps track of what happened in recent runs. It's the routine's "short-term memory" — without it, every morning would be the first morning all over again.
Three things this file needs to store: last run (date and time, to know how much time has passed), what has already been shown (so it doesn’t repeat the same email or news story two days in a row), and learned preferences (what you tend to ignore and what you tend to pay attention to).
Objective: asking the agent to create the file rotina-matinal-status.json with the initial structure, inside your project folder.
Crie o arquivo rotina-matinal-status.json na raiz deste projeto com esta estrutura inicial:
{
"ultima_execucao": null,
"mostrado_recentemente": [],
"preferencias_aprendidas": {
"prioriza": [""],
"ignora": []
},
"fontes": [""]
}
Depois de criar, me explique em 2 frases o que cada campo vai guardar.
How to verify: open the created file—it should exist in the project root, contain valid JSON (with no syntax errors), and have the 4 fields above.
🔍 Inside
- "mostra...recentemente": a short list (the last 3–5 days) — prevents repetition without turning into a huge file.
- "learned_preferences": the field that topic 6 on this page will teach you to update automatically.
⏰ Step by step: create the scheduled task
With the status file ready, the next step is the trigger: the scheduled task itself. It needs a time (e.g., 7 a.m.), a frequency (every day, or only weekdays), and a clear instruction for what to do when it triggers — including an explicit request to read and update the status file.
Choose the time and frequency
7 a.m. every day (or just Monday through Friday, if you prefer to keep it separate from your personal life). Review module 6.2 if you want a refresher on how scheduling works under the hood.
Write the complete instruction
“Check my email” isn’t enough — the instruction needs to say what to read, what to prioritize, and where to save the result. See the copy-run block below.
Save it and confirm the schedule
The scheduling tool confirms the next run — note the expected date/time so you can check later.
Objective: requesting the scheduled task itself, pointing to the status file and the selected sources.
Agende uma tarefa recorrente todo dia às 07:00 ()
chamada "rotina-matinal". Quando ela rodar, ela deve:
1. Ler rotina-matinal-status.json
2. Checar
3. Ignorar tudo que já esteja em "mostrado_recentemente"
4. Priorizar de acordo com "preferencias_aprendidas"
5. Escrever um resumo curto (até 8 linhas) em resumo-do-dia.md
6. Atualizar rotina-matinal-status.json com a nova execução
Antes de salvar a tarefa agendada, me mostre o texto final da instrução pra eu revisar.
How to verify: ask the agent to list the active scheduled tasks — "rotina-matinal" should appear with the correct time. Also confirm that it showed you the instructions before saving (it should not act without that confirmation).
🔔 Step by step: notifications and restrictive permissions
New here? Restrictive permission (covered in depth in module 6.6) means giving the agent only the access needed for the task — in this case, reading email/calendar and writing to the summary file, but never delete anything. A routine that runs on its own every day needs this safeguard: if one day it "misunderstands" what to do, the worst-case scenario is a bad summary — never a lost file.
A notification it’s how you find out that the routine ran—without
having to open the terminal every morning. It could be an email, a message on your phone, or simply the
file resumo-do-dia.md waiting for you in the folder — the important thing is that the
notification reaches you in a way you'll actually see.
✓ Secure configuration
- ✓Permission to read email/calendar, write only to the summary file and status
- ✓No permission to delete files or automatically send messages on your behalf
- ✓The notification arrives even if the check doesn’t find much (“it’s quiet today”)
✗ Risky configuration
- ✗Grant full access to the inbox "so you don't have to configure it again"
- ✗Let the agent delete “read” emails to keep the inbox clean
- ✗Routine runs silently without any notification — you only find out if you open it manually
Objective: restrict what the "rotina-matinal" task can do and make sure you receive a notification when it finishes.
Ajuste a tarefa agendada "rotina-matinal" para rodar com permissões restritivas:
- Permitido: ler e-mail/agenda, escrever em resumo-do-dia.md e rotina-matinal-status.json
- Proibido: apagar ou mover qualquer arquivo, enviar e-mail/mensagem em meu nome
Ao final da execução, envie uma notificação para
com o título "Resumo de hoje pronto" e o conteúdo de resumo-do-dia.md.
Se não houver nada relevante, envie mesmo assim avisando "sem novidades hoje".
How to verify: ask the agent to list the permissions configured for this task — "delete file" and "send on your behalf" should not appear as allowed. Confirm the notification destination too.
💡 Practical Tip
Start with a simple notification (a local file) before connecting external channels like email or a phone—this way, you can validate the summary before “publishing” it somewhere else.
✅ Run the first execution and verify
Don’t wait until tomorrow morning to find out if it worked. Ask the agent to run the task now, once, manually — most scheduling tools have an “run now” option for testing without waiting for the scheduled time. That’s more useful than any theory: you’ll see the actual result in minutes.
Caption: each day, the routine gets a little more precise — not because the model “got smarter,” but because the status file has accumulated more signals about what you use and what you ignore.
📋 First-run verification checklist
- 1.Open
resumo-do-dia.md— does the content make sense and is it short enough to read in 1 minute? - 2.Open
rotina-matinal-status.json— was the "ultima_execucao" field updated with the actual time? - 3.Check "mostrado_recentemente"—did today's summary items make it into the list?
- 4.Did the notification arrive in the right channel (email/phone/file)?
- 5.No files were deleted or moved — only created or updated?
🧠 Make the routine learn + common mistakes + final exercise
“Learning” here isn’t magic—it’s the same cycle as Module 6.4: every time it runs, the agent checks the sources and also looks at whether you engaged with what it showed you yesterday (e.g., you never open the news section, but always read the agenda section). Based on that, it updates preferencias_aprendidas
— add to "prioritize" the things you use; add to "ignore" the things you never touch. In practice, after
a week the summary gets shorter and more relevant, without you needing to reconfigure anything.
Objective: add the learning rule to the scheduled task instructions so it can keep the status file up to date with what you use and ignore.
Atualize a instrução da tarefa "rotina-matinal" para incluir esta regra de aprendizado:
Antes de montar o resumo de hoje, leia "preferencias_aprendidas" em rotina-matinal-status.json.
Depois de montar, se uma seção (ex.: ) não recebeu
nenhuma interação nos últimos 5 dias, adicione essa seção em "ignora" e reduza o espaço dela
no próximo resumo. Se uma seção for consistentemente a mais lida, adicione em "prioriza" e
mostre-a primeiro. Sempre registre essa decisão em "mostrado_recentemente" com a data.
How to verify: after a few days, compare the "preferencias_aprendidas" from the beginning of the week with the one from the end — it should have changed based on what you actually used.
✓ Ready to keep running on its own
- ✓Ran it manually at least once, and the result made sense
- ✓Restrictive permissions confirmed (no deleting, no sending on your behalf)
- ✓The notification arrives in the channel you actually check
✗ Common mistakes when setting up this Build
- ✗Too vague an instruction ("let me know about important things") — the agent doesn't know what's "important" without the status file to guide it
- ✗Forget to test manually before trusting the scheduled time
- ✗Let “mostrado_recentemente” grow without limit — it becomes a huge, slow file
💡 Practical Tip
Review the routine summary every week, not just every morning — a weekly look reveals patterns that a single day doesn’t (e.g., “this section hasn’t had anything relevant in 5 days; is it worth keeping?”).
🎯 Final Exercise
Add one more information source to your morning routine (e.g., the weather forecast, a quote for something you follow, or a second email). Ask the agent to update the task instructions and the "sources" field in the status file — then run it manually again to check that the new source appears in the summary without breaking anything else.
Quick check (optional): what makes this routine “improve itself” over time?