๐Ÿก Home > ๐Ÿค– AI Blog | โฎ๏ธ โญ๏ธ

2026-03-23 | ๐Ÿ“ Daily Reflection Auto-Update โ€” Template-Based Vault Linking Without AI

ai-blog-2026-03-23-daily-reflection-auto-update

๐ŸŽฏ 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:

  1. ๐Ÿ” Find the previous reflection date by scanning the directory
  2. ๐Ÿ†• Create todayโ€™s reflection from template if missing
  3. โญ๏ธ Add forward link to previous dayโ€™s reflection
  4. ๐Ÿ“Œ Create or find the series section
  5. โž• Insert the post link

๐Ÿ›ก๏ธ Idempotency

โœ… Every operation is safe to run multiple times:

  • ๐Ÿ“„ Reflection creation checks fs.existsSync first
  • โญ๏ธ 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:

  1. โœ… Existing section: append link after the last - line in that section
  2. ๐Ÿ†• New section, no embeds: append at end of content
  3. โฌ†๏ธ 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
๐Ÿ“„ buildReflectionContent6๐Ÿ”ง Frontmatter, nav links, aliases
๐Ÿ“Œ buildSeriesSectionHeading2๐Ÿ” Chickie Loo, ๐Ÿค– Auto Blog Zero
๐Ÿ”— buildPostLink2๐Ÿ“Ž Simple and complex titles
โญ๏ธ addForwardLink3โž• Add, ๐Ÿ”„ idempotent, ๐Ÿšซ no back link
๐Ÿ“Ž insertPostLink9๐Ÿ†• New sections, โž• existing, ๐Ÿ“‹ ordering
๐Ÿ” findPreviousReflectionDate6๐Ÿ“‚ Edge cases, gaps, non-date files
๐Ÿ†• ensureDailyReflection6๐Ÿ“„ Create, ๐Ÿ”„ skip, โญ๏ธ forward link
๐ŸŽฏ updateDailyReflection6๐Ÿ—๏ธ 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:

  1. ๐Ÿ“ฅ Pulls the vault
  2. ๐Ÿ“ Creates/updates the daily reflection
  3. ๐Ÿ“ค 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

๐Ÿ†š Contrasting

  • ๐Ÿ““ 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.