| name | morning |
| description | Daily 06:30 BKK compile — ingest yesterday's raw, research flagged links, write daily summary, conditionally weekly/monthly, push Telegram digest, open PR. |
AgenticWiki — Morning Skill
Single skill that does the entire morning compile. Invoked by the Cowork
Routine morning-routine. Runs once per day at 06:30 Asia/Bangkok.
Hard rules:
- Read
CLAUDE.md first — it is the schema for how the wiki must be maintained.
- Never auto-merge any PR.
- Never edit
raw/, wiki/log.md past entries, or files in followups/done/.
- If a step fails, log the failure in the PR body and continue with the rest.
Step 1 — Date scope (Asia/Bangkok)
Compute now:
TODAY = today's date YYYY-MM-DD
YESTERDAY = TODAY - 1 day
IS_SUNDAY = today's weekday is Sunday
IS_MONTH_END = (today + 1 day) is in a different month — i.e. today is
the last day of its month
Cite these values in the PR body so the human reviewer sees what you assumed.
Step 2 — Ingest yesterday's raw
Read everything created or modified yesterday:
raw/sessions/{YESTERDAY}/ — Telegram bot dumps (text, voice, link)
raw/voice/{YESTERDAY}.md — LINE voice log (if exists)
Special file: raw/sessions/{YESTERDAY}/daily-log-{YESTERDAY}.md — if the
operator typed /eod to close out the day, this marker file exists. Treat
its ## Note section (if present) as the operator's own bottom-line for the
day, and incorporate it as the seed for the daily summary in Step 4.
Session grouping: every dump file has frontmatter fields session
(e.g. s-12345) and seq (1, 2, 3, …). Files sharing the same session
were sent within 5 minutes of each other and almost always reference each
other linguistically (e.g. one starts with "อ่อแล้วก็…" or just continues
the previous thought). When extracting entities or quoting, read the
entire session in seq order before deciding what's a coherent thought
vs. a separate one. Treat a session as one continuous brain-dump split
across multiple Telegram messages.
For each entity mentioned (person, company, product, concept, event):
- If a
wiki/ page exists → propose update (add facts, citations, [[wikilinks]])
- If not → create a stub with frontmatter + 1-paragraph summary + sources
- Connect new content with
[[wikilinks]] to existing pages
Append one block to wiki/log.md (append-only, never edit prior entries):
## {TODAY} 06:30 — Morning routine
- Read: raw/sessions/{YESTERDAY}/*, raw/voice/{YESTERDAY}.md
- Created: wiki/...
- Updated: wiki/...
- Followups extracted: N
For lines tagged "อยากดูต่อ" / "น่าสนใจ" / "ต้อง research" / forwarded
articles / URLs → create one file per item under followups/pending/{slug}.md
with the question + source citation.
Step 3 — Research flagged items
For every entry in:
raw/sessions/{YESTERDAY}/*-link.md (URLs)
followups/pending/*.md (open questions)
do this:
- Web fetch the URL (or web search if it's a question, not a URL)
- Synthesize a clear, easy-to-read article in Thai — 3–6 paragraphs, the
tone of a reflective tech blogger explaining to a smart friend:
- Define jargon when first introduced
- No hype, no marketing voice
- Always cite the source URL
- Save the article:
- If it's a new entity →
wiki/{type}/{slug}.md (concepts, people,
companies, events)
- If the topic already has a wiki page → append a new section there with
today's date as a subheading
- Move the followup file
followups/pending/{slug}.md →
followups/done/{slug}.md and add researched: {TODAY} to its frontmatter
Step 4 — Daily summary
Write a reflective first-person Thai recap to outputs/daily/{YESTERDAY}.md.
Address the operator directly ("เมื่อวาน คุณ..."). Tone: warm, honest,
unhurried — like a journal entry written by someone who actually knows them.
Length: 4–8 paragraphs. Use these exact subheadings:
- บันทึกของเมื่อวาน — what you actually said in voice/text, paraphrased
- Wiki ที่งอกเพิ่ม — N pages created, M updated, top 3 most-connected
- Research ที่ส่งให้แล้ว — links you flagged → tl;dr of each, with
inline link to the wiki page
- TODO health check — read
todos/open/*.md. Report:
- counts by tag (HMN N · ENB M · PERS K)
- overdue (
due_at past today): list with original date
- coming up next 24h: list with
due_at
- completed yesterday (from
todos/done/*.md with completed_at matching
YESTERDAY): count by tag
- Stale flag: any open TODO with
created more than 7 days ago →
surface with note "consider /done or /cancel_todo"
- Patterns ที่สังเกตเห็น — recurring themes, what you obsessed over
- Seed สำหรับวันนี้ — 1–2 questions worth following up today
Step 5 — Conditional: weekly summary
If IS_SUNDAY, generate outputs/weekly/{YYYY-WW}.md covering the past 7
days (Mon–Sun ending yesterday). Sections per CLAUDE.md "Weekly report
format":
- What happened in your wiki this week
- Industry moves you noted
- What you were curious about
- Contradictions surfaced (if any)
- Narrative — 2–3 paragraphs on the shape of your thinking this week
Step 6 — Conditional: monthly summary
If IS_MONTH_END, generate outputs/monthly/{YYYY-MM}.md for the current
month. Reflective + analytical:
- Themes that defined the month
- "What you changed your mind about" — explicit list with old → new
- Drift — topics you used to pay attention to but stopped
- Top 5 wiki pages by inbound links
- One paragraph: where you're heading
Step 7 — PR + Telegram digest
7a. Open Pull Request
Commit all changes onto a new branch morning/{TODAY} and open a PR titled:
morning: {TODAY} — N pages, M research[, weekly][, monthly]
PR body:
- Punch list of all created/updated/moved files (grouped by section)
- The date assumptions from Step 1
- Any failures or skipped sub-steps with reason
Do not auto-merge. Operator reviews on mobile and merges manually.
7b. Telegram digest push
Send a SHORT message to the operator's Telegram (≤ 4000 chars). Format:
📅 *Morning brief — {TODAY}*
📝 เมื่อวาน:
{2–3 sentence paraphrase of yesterday's bottom-line — what stood out}
📚 Wiki: {N} new, {M} updated
🔍 Research: {K} items delivered
{if IS_SUNDAY: 📊 Weekly summary ready}
{if IS_MONTH_END: 🗓️ Monthly summary ready}
PR: {pr_url}
อ่านเต็ม: outputs/daily/{YESTERDAY}.md
Send via Telegram Bot API. Use whichever HTTP/code-execution tool you have.
Equivalent of:
curl -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage" \
--data-urlencode "chat_id=${TELEGRAM_OWNER_CHAT_ID}" \
--data-urlencode "parse_mode=Markdown" \
--data-urlencode "text=$MESSAGE"
Verify the response is {"ok": true, ...}. If false, log to PR body but
don't fail the run.
Done
End the routine.