<< All versions
Skill v1.0.0
LLM-judged scan95/100einargudnig/dotfiles/backfill-daily-notes
──Details
PublishedOctober 7, 2026 at 11:03 PM
Content Hashsha256:e8349b9aa06a5891...
Git SHA
──Files
Files (1 file, 2.8 KB)
SKILL.md2.8 KBactive
SKILL.md · 44 lines · 2.8 KB
name: backfill-daily-notes description: Create and link missing Obsidian periodic notes (daily/weekly/monthly) for past dates.
Backfill Periodic Notes
Fills gaps in the daily, weekly, and monthly note chains in the second-brain vault (~/personal/obsidian/second-brain/30 planner).
How it works
The bundled script (backfill.ts, in this skill's directory):
- Reads the vault's own config —
.obsidian/daily-notes.jsonfor dailies,.obsidian/plugins/periodic-notes/data.jsonfor weeklies/monthlies — to find each folder and Templater template. Stale template paths missing the50folder prefix are resolved automatically. - Scans each folder recursively for its naming pattern (
YYYY-MM-DD.md,YYYY-Wnn.md,YYYY-MM.md; year subfolders included). - For every period from the earliest existing note to today with no file, renders the template — substituting
tp.file.creation_date(...)/tp.date.yesterday(...)/tp.date.tomorrow(...)for the target period's anchor date (the day, the week's Monday, the month's 1st). - Placement follows the vault convention: year subfolder if it exists (archived years), otherwise the folder root (current year).
- Linking per type:
- daily — the template's
« [[Yesterday]] | [[Tomorrow]] »line links the chain; neighbors resolve once the file exists. - weekly — inserts
[[YYYY-MM-DD]]under each## Monday…## Sundayheading. - monthly — inserts
[[YYYY-Wnn]]under each## Week Nheading for every ISO week overlapping the month, adding## Week 5/## Week 6sections before## Reviewwhen the month outgrows the template's 4 headings (matches the manual convention in existing monthly notes).
Usage
Always dry-run first, show the user the list, then write:
bash
node ~/.claude/skills/backfill-daily-notes/backfill.ts # dry run, all typesnode ~/.claude/skills/backfill-daily-notes/backfill.ts --write # create notes
Flags:
--type daily|weekly|monthly— restrict to one note type (default: all)--from YYYY-MM-DD— only backfill periods starting on/after this date (default: earliest existing note per type)--mark— settype: backfillin daily-note frontmatter (off by default; weekly/monthly templates have no frontmatter)
Notes
- The script is TypeScript run directly via Node's native type stripping — requires Node >= 23.6 (no build step, no dependencies).
- The script never overwrites: it writes with the
wxflag and skips existing files. - If a template gains a Templater expression the script doesn't know, it warns and leaves the raw placeholder in place — update
renderTemplate()inbackfill.ts. - Backfilled daily notes use
00:00as the creation time in the info callout. - Yearly notes (
30 planner/years/) are not handled — the year template is bespoke and a missing year is a deliberate signal, not a gap.