๐ก Home > ๐ค AI Blog | โฎ๏ธ โญ๏ธ
2026-03-23 | ๐ Daily Reflection Auto-Update โ Template-Based Vault Linking Without AI

๐ฏ The Problem
โ๏ธ Every day, after the automated blog post generation workflows run, a manual step remained: linking the new posts from the daily reflection note in Obsidian.
๐ The daily reflection serves as the hub for each dayโs content โ books, blog series, videos, articles, and social media embeds all get linked here.
๐ค While the blog posts themselves are generated by AI, the reflection linking is pure bookkeeping โ deterministic pattern matching that shouldnโt require any intelligence at all.
๐ฌ The Approach
๐ง Three plans were considered, then refined through iteration:
| ๐ Plan | โ Pros | โ Cons |
|---|---|---|
| ๐ Library + CLI + Separate Workflow Step | ๐งช Testable, ๐ explicit | ๐ Extra step, ๐ filename passing between steps |
| ๐ง Integrate into generate-blog-post.ts | ๐ฏ Single step, ๐ filename already in variable | ๐งฉ Needs vault credentials |
| ๐ช Hook into sync-file-to-obsidian.ts | ๐คซ Implicit | ๐งช Hard to test, ๐ violates SRP |
๐ The winning approach combines the best of Plans 1 and 2: the library stays separate for testability, but the orchestration is integrated directly into generate-blog-post.ts โ the one place that already knows the exact filename, title, and series config.
๐๏ธ The Implementation
๐ Reverse Engineering the Template
๐ The Obsidian Templater template was reverse-engineered to understand the reflection format:
๐ Frontmatter: Standard YAML with share, aliases, title, URL, Author, and tags fields.
๐งญ Navigation: Wiki-link breadcrumbs with previous/next day links using โฎ๏ธ and โญ๏ธ emojis.
๐ Sections: Each blog series gets a ## [[series/index|icon name]] heading with - [[series/file|title]] links beneath.
๐ง Pure Functions
๐ง Six pure functions handle all string manipulation without touching the filesystem:
- ๐
buildReflectionContentโ generates the full reflection markdown from a date and optional previous date - ๐
buildSeriesSectionHeadingโ creates the wiki-link section heading from series config - ๐
buildPostLinkโ creates the dash-prefixed wiki-link for a post - โญ๏ธ
addForwardLinkโ splices a forward navigation link into existing content - ๐
insertPostLinkโ the workhorse: finds or creates sections, respects embed ordering
๐พ I/O Orchestration
๐ฏ updateDailyReflection ties it all together:
- ๐ Find the previous reflection date by scanning the directory
- ๐ Create todayโs reflection from template if missing
- โญ๏ธ Add forward link to previous dayโs reflection
- ๐ Create or find the series section
- โ Insert the post link
๐ก๏ธ Idempotency
โ Every operation is safe to run multiple times:
- ๐ Reflection creation checks
fs.existsSyncfirst - โญ๏ธ Forward linking checks for existing
โญ๏ธemoji - ๐ Post linking checks for existing
[[series/filename|substring - ๐ Section creation only fires when heading is absent
๐ Section Insertion Rules
๐ฏ The trickiest part was inserting new sections in the right place:
- โ
Existing section: append link after the last
-line in that section - ๐ New section, no embeds: append at end of content
- โฌ๏ธ New section, with embeds: insert before the first social media embed section (
## ๐ฆ Tweet,## ๐ฆ Bluesky,## ๐ Mastodon)
๐งฉ This preserves the convention where social media embeds always appear at the bottom of the reflection.
๐งช Testing
๐ฌ 40 tests across 8 suites cover every function:
| ๐งช Suite | ๐ Tests | ๐ Coverage |
|---|---|---|
| ๐ buildReflectionContent | 6 | ๐ง Frontmatter, nav links, aliases |
| ๐ buildSeriesSectionHeading | 2 | ๐ Chickie Loo, ๐ค Auto Blog Zero |
| ๐ buildPostLink | 2 | ๐ Simple and complex titles |
| โญ๏ธ addForwardLink | 3 | โ Add, ๐ idempotent, ๐ซ no back link |
| ๐ insertPostLink | 9 | ๐ New sections, โ existing, ๐ ordering |
| ๐ findPreviousReflectionDate | 6 | ๐ Edge cases, gaps, non-date files |
| ๐ ensureDailyReflection | 6 | ๐ Create, ๐ skip, โญ๏ธ forward link |
| ๐ฏ updateDailyReflection | 6 | ๐๏ธ Full orchestration, ๐ idempotent |
โ๏ธ Workflow Integration
๐ The daily reflection update is integrated directly into generate-blog-post.ts โ no separate workflow step needed.
๐ฏ When Obsidian vault credentials (OBSIDIAN_AUTH_TOKEN, OBSIDIAN_VAULT_NAME) are available as environment variables, the script automatically:
- ๐ฅ Pulls the vault
- ๐ Creates/updates the daily reflection
- ๐ค Pushes changes back
๐ซ When credentials are absent (e.g. local development, dry runs), the reflection update is silently skipped.
๐ The script also writes the exact post path to $GITHUB_OUTPUT โ no filename guessing via glob patterns โ so downstream steps (image generation, vault sync) reference the precise file that was generated.
๐ Chickie Loo runs at 3 PM PT โ it creates the reflection and adds its section.
๐ค Auto Blog Zero runs at 4 PM PT โ it finds the existing reflection and appends its section.
๐ Adding a new blog series requires just two changes: add a config entry to blog-series-config.ts and create a workflow file โ the reflection update comes for free.
๐ Results
๐ Zero manual linking required โ the reflection is automatically populated as blog posts are generated.
๐ Navigation between days is maintained โ forward links are inserted when new reflections are created.
๐ก๏ธ Safe for re-runs โ idempotent operations prevent duplicate entries.
๐งฉ Extensible โ adding a new blog series requires only adding it to blog-series-config.ts; the reflection logic handles it automatically.
๐ Book Recommendations
โ๏ธ Similar
- ๐ง Designing Data-Intensive Applications by Martin Kleppmann explores the principles behind reliable, scalable systems โ the same philosophy of idempotent, deterministic operations that drives this reflection pipeline.
- ๐ ๐งฉ๐งฑโ๏ธโค๏ธ Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans provides the foundational thinking on modeling domain concepts as code โ exactly what we did by encoding the reflection template as pure functions.
๐ Contrasting
- ๐ค ๐คโ๏ธ๐ Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications by Chip Huyen covers when and how to use ML in production โ a useful counterpoint for knowing when deterministic logic is the better choice over AI.
- ๐๏ธ Building Microservices by Sam Newman advocates for service decomposition โ contrasting our monolithic workflow approach where simplicity wins over distributed complexity.
๐จ Creatively Related
- ๐ How to Take Smart Notes by Sรถnke Ahrens introduces the Zettelkasten method of interconnected notes โ the same philosophy that makes Obsidianโs wiki-links and daily reflections so powerful.
- ๐ง ๐งโ๐ป๐ The Pragmatic Programmer: Your Journey to Mastery by David Thomas and Andrew Hunt emphasizes automation of repetitive tasks โ the exact motivation behind eliminating manual daily reflection linking.