logseq-daily-summary

Shitao5's avatarfrom Shitao5

Create and append a <=300 Chinese-character daily summary into LogSeq journals. Use when the user asks to summarize today’s LogSeq journal, analyze a specific day’s journal, or write a daily summary back into LogSeq.

0stars🔀0forks📁View on GitHub🕐Updated Jan 10, 2026

When & Why to Use This Skill

This Claude skill automates the summarization of LogSeq daily journals and integrates AI usage tracking. It intelligently retrieves journal content, calculates Codex CLI token consumption, and appends a concise Chinese summary (under 300 characters) back to the journal page, helping users maintain a streamlined and data-backed record of their daily productivity and thoughts.

Use Cases

  • Automated Daily Reflection: Generate a concise, high-level summary of your daily notes in LogSeq to track personal growth and key insights without manual effort.
  • AI Resource Monitoring: Automatically append Codex CLI token usage statistics to your journals to monitor API consumption and costs associated with your AI workflows.
  • Knowledge Retrieval & Analysis: Quickly analyze and condense specific past journal entries to retrieve historical context and key decisions from your personal knowledge base.
namelogseq-daily-summary
descriptionCreate and append a <=300 Chinese-character daily summary into LogSeq journals. Use when the user asks to summarize today’s LogSeq journal, analyze a specific day’s journal, or write a daily summary back into LogSeq.

Logseq Daily Summary

Overview

Summarize a LogSeq daily journal (today by default, or a specified log) and append a concise <=300 Chinese-character paragraph back into that day’s journal page.

Workflow (LogSeq journal -> usage stats -> summary -> write back)

  1. Determine the target journal page.
  • If the user specifies a log/date/page name, use that.
  • Otherwise use today’s date based on local time. Use list_pages (include journals) and find a page whose title starts with YYYY-MM-DD. LogSeq journal titles may be YYYY-MM-DD DayName (English), YYYY-MM-DD 星期X (Chinese), or just YYYY-MM-DD.
  • If multiple pages match, prefer the one marked [journal], then the one with the longest non-empty content (via get_page_content), then the English weekday variant.
  • If no page matches the date, use search to confirm. If still missing, ask the user for the exact page name before creating a new page.
  1. Read the journal content.
  • Use get_page_content to fetch the page content.
  • If the page does not exist, create it (via create_page or update_page) and note it was empty before summarizing.
  1. Collect today's Codex CLI usage stats and append a usage block.
  • Use the fixed script: scripts/codex_usage_stats.py.
  • Example: python3 /Users/wushitao/.codex/skills/logseq-daily-summary/scripts/codex_usage_stats.py --date YYYY-MM-DD.
  • The script reads ~/.codex/sessions/YYYY/MM/DD/*.jsonl, aggregates the last token_count.total_token_usage per session file, and extracts the local time range for the day (min/max timestamps).
  • Append the script output as its own LogSeq block before the summary block, using the exact format below (no leading "- "):
🤖 Codex CLI 消耗(自动统计)
  ⏱️ 时间段: YYYY-MM-DD HH:MM:SS–HH:MM:SS (+0800)
  🧾 用量: N tokens
  🧠 Token: 输入 A / 输出 B / 缓存输入 C / 推理 D
  1. Write the summary.
  • Produce a single paragraph in Chinese, 300 characters or fewer (do not count the usage block).
  • Focus on “what I was thinking about / investigating today,” derived from the journal content.
  • Avoid lists in the summary paragraph; keep it clean and readable.
  1. Append to the same journal page.
  • Use update_page to append the usage block (if not already present), then use a second update_page call to append the summary block 今日总结: ... (no leading "- ").
  • Ensure the usage block and summary block are separate top-level blocks and never nested, and do not prefix lines with "- ".
  • Do not overwrite existing content.

Output rules

  • Summary length: <=300 Chinese characters (usage block not counted).
  • One paragraph only.
  • Keep it faithful to the journal content; no fabrication.
  • Always include the Codex CLI usage block in the required format (from the fixed script).
  • Usage block and summary block must be separate top-level blocks.

Tools

Use MCP LogSeq tools:

  • search or list_pages to locate the journal page
  • get_page_content to read
  • update_page to append the summary
  • create_page only if necessary
logseq-daily-summary – AI Agent Skills | Claude Skills