Aggregate incomplete tasks from Daily notes within a specified date range in the Obsidian vault (- [ ]), and output them grouped by date to the current Daily note.
Workflow
1. Determine the date range
Parse the date range according to the user's request:
- "last 1 week" → the past 7 days
- "last 1 month" → the past 30 days
- "from YYYY-MM-DD to YYYY-MM-DD" → specified range
- Not specified → defaults to the last 1 month
2. Locate Daily notes
Daily notes path format:
Calendar/Daily notes/YYYY/YYYY-MM-DD.md
Only match date files in the standard format (YYYY-MM-DD.md), ignoring other notes.
3. Extract incomplete tasks
Search pattern:- [ ](unchecked checkbox)
Use the Grep tool for batch searching:
# 搜索指定目录下的未完成任务
Grep pattern="- \[ \]" path="Calendar/Daily notes/2025/" output_mode="content"
4. Aggregate and output
Output format:
## 近X天/周/月未完成任务汇总(起始日期 ~ 结束日期)
### YYYY-MM-DD
- [ ] 任务1
- [ ] 任务2
### YYYY-MM-DD
- [ ] 任务3
---
**统计:共 N 项未完成任务**
5. Write to the target file
Insert the aggregated content at the beginning of the current Daily note (after the frontmatter).
Notes
- Preserve wikilinks in tasks (such as
[[笔记名]]) - Merge nested subtasks into their parent task (maintain indentation)
- Remove duplicate tasks (the same task may appear on multiple days)
- Skip empty lines and invalid formats