Skip to content

把 Little Bird 的计划/复盘能力搬进 Notch(daily/weekly plan & review + Routines + 日历) - #1

Open
chloe4ai wants to merge 2 commits into
mainfrom
feat/littlebird-plan-review-routines
Open

chloe4ai wants to merge 2 commits into
mainfrom
feat/littlebird-plan-review-routines

Conversation

@chloe4ai

Copy link
Copy Markdown
Owner

研究了 https://littlebird.ai/ 后,把它「前瞻型」的那一半搬进了 Notch。原来 Notch 只「记录过去」(追踪 → 总结 → 问答),这个 PR 补上「规划未来」,覆盖你点名要的四件事,并加上 Little Bird 的 Routines(主动)和系统集成(日历)思路。零新依赖,没 API key / 没接日历也都能用(自动退化成本地草稿)。

新增能力

  • 每日计划 — AI 起草当天 3–5 个重点,锚定昨天遗留、日历、本周重点、goals.md;可勾选,手动加的条目在「重新生成」时会保留。
  • 每日复盘 — 晚间「计划 vs 实际」,用真实活动追踪做底。
  • 每周计划 / 每周复盘 — 主题 + 本周重点;周复盘汇总一周的每日复盘与时间投入,看进展与模式。
  • Routines 引擎(Little Bird 的核心)— 到点自动产出上面这些,并推送到「动态(feed)」;每条可单独开关 / 立即运行。
  • 日历集成 — 只读 ICS(CALENDAR_ICS_URL),免 OAuth,Google/Apple 通用,让计划锚定真实日程。
  • goals.md — 一个手写的长期上下文文件,每次生成计划都会读它 —— Notch 版的「了解你的世界」,一个文件代替十几个集成。

UI

三个标签页:今天 / 本周 / Bird·助理。新增 markdown 渲染、可交互勾选清单、日历列表、Routine 开关、动态卡片。原有的随手记 / 计时 / 问答 / 活动追踪完全不变。

代码

文件 作用
`server/llm.js` 共享的 Anthropic 调用
`server/calendar.js` 零依赖 ICS 抓取+解析,按天/周过滤
`server/context.js` 汇总 活动+日历+goals+历史
`server/planner.js` 四个生成器 + 结构化解析 + 本地回退
`server/routines.js` 主动调度 + feed
`server/storage.js` day.plan/review、weeks/*.json、routines.json、feed.json、ISO 周计算
`server/index.js` plan/review/week/calendar/routines/feed 端点
`public/index.html` Tab 化前端

测试

本地起服务全流程跑通:四类计划/复盘生成、勾选、手动加项、Routine 开关与 run-now、feed、日历未接时的优雅降级,三个标签页均正常渲染。

🤖 Generated with Claude Code

chloe4ai and others added 2 commits June 28, 2026 01:05
…utines, calendar

Notch was capture-only (track → summarize → ask). This adds the forward-looking
half so it covers what Little Bird does for planning, all zero-dependency and
fully working offline (deterministic drafts when no ANTHROPIC_API_KEY).

New capabilities
- Daily plan: AI drafts the day's 3–5 focus items, grounded in yesterday's
  unfinished items, the calendar, weekly priorities, and goals.md. Checkable;
  hand-added items survive regeneration.
- Daily review: evening plan-vs-actual using tracked activity as ground truth.
- Weekly plan & weekly review: theme + priorities; review rolls up the week's
  daily reviews + tracked time into progress and patterns.
- Routines engine (Little Bird's "Routines"): time-of-day triggers that
  auto-generate the above and post a card to a proactive feed; per-routine
  enable/disable + run-now.
- Calendar integration via read-only ICS (CALENDAR_ICS_URL) — no OAuth, works
  with Google/Apple. Plans anchor to real meetings.
- goals.md: hand-written long-horizon context every plan reads — a lightweight
  take on "knowing your work" without a dozen integrations.

Implementation
- server/llm.js        shared Anthropic helper
- server/calendar.js   zero-dep ICS fetch+parse, per-day/week filtering
- server/context.js    gathers activity + calendar + goals + history
- server/planner.js    the four generators with structured parse + fallbacks
- server/routines.js   proactive scheduler + feed
- storage.js           day.plan/day.review, weeks/*.json, routines.json, feed.json,
                       ISO-week helpers; regeneration preserves manual items
- index.js             plan/review/week/calendar/routines/feed endpoints
- public/index.html    tabbed UI (今天 / 本周 / Bird) + markdown renderer,
                       interactive checklists, calendar lists, routine toggles, feed

Existing capture/summary/ask/tracking behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8tdhu5NoQ3KMPmyxpKtGN
The "ask" chat only ever loaded today's file, so "上周做了什么 / 这个月的进展 /
周二干了啥" had no data to answer from. Now it resolves a time range out of the
question and feeds the model a compact history digest spanning it.

- server/history.js: resolveRange() parses 今天/昨天/前天/这周/上周/上上周/这个月/
  上个月/最近N天/最近N周/单个星期几/具体日期(YYYY-MM-DD)/"最近" (EN equivalents too),
  defaulting to today so existing behavior is untouched. renderHistoryForChat()
  builds a compact per-day + weekly digest (reviews > summaries > raw task/app
  totals) that stays small even over a month; capped at 92 days.
- summarizer.ask(): takes { historyContext, rangeLabel }; appends an EARLIER
  section to the system prompt and bumps max_tokens for range answers. CHAT_SYSTEM
  now covers multi-day synthesis. No-key fallback returns the digest directly.
- index.js /api/ask: resolves the range, loads the days (+weeks when relevant),
  builds the digest, returns the resolved range alongside the answer.
- Frontend: card retitled "问问 Notch · 可跨天跨周", new range chips (这周/上周/
  这个月), and each answer shows the resolved 📅 range.

Tested: range resolver across 13 phrasings; end-to-end "这周/上周/过去一小时".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L8tdhu5NoQ3KMPmyxpKtGN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant