email-gazette

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Email Gazette

Email Gazette

Turn an unread inbox into a broadsheet newspaper front page that opens in the browser.
将未读收件箱转换为可在浏览器中打开的大报风格头版。

Overview

概述

This skill fetches unread emails via the Google Workspace CLI (
gws
), reads and categorizes them, enriches key stories with web research, then generates a single self-contained HTML file styled like a classic newspaper (think The New York Times). It opens directly in the browser and is archived for future reference.
该技能通过Google Workspace CLI(
gws
)拉取未读邮件,对邮件进行读取和分类,通过网络搜索补充核心新闻的相关信息,随后生成单个独立的、风格类似经典报纸(参考《纽约时报》)的HTML文件。文件可直接在浏览器中打开,并且会被归档供后续查阅。

Step 0: Prerequisites Check & First-Run Configuration

步骤0:前置条件检查与首次运行配置

Before anything else, verify that the Google Workspace CLI (
gws
) is installed and authenticated. Run:
bash
gws gmail +triage --max 1 --format json
If this fails, stop and tell the user:
"This skill requires the Google Workspace CLI (
gws
) to access your Gmail. You can install it and the related Gmail skills using
npx skills add nicholasgasior/gws
(or however the gws skills are distributed). Once installed, run
gws auth login
to authenticate, then try again."
Do not proceed until
gws
is working.
在执行任何操作前,先验证Google Workspace CLI(
gws
)是否已安装且完成认证。运行以下命令:
bash
gws gmail +triage --max 1 --format json
如果命令执行失败,停止操作并告知用户:
"该技能需要Google Workspace CLI(
gws
)来访问你的Gmail。你可以通过
npx skills add nicholasgasior/gws
安装它以及相关的Gmail技能(或按照gws技能的官方分发方式安装)。安装完成后运行
gws auth login
完成认证,再重试即可。"
gws
可正常运行前不要继续后续操作。

Configuration file

配置文件

All user preferences are stored in a JSON config file at
~/.config/email-gazette/config.json
. This is the single source of truth — check for it on every run.
If
~/.config/email-gazette/config.json
exists
, read it and use those settings. No need to ask the user anything.
If it does not exist, this is a first run. Ask the user to configure their gazette, then save their answers to this file. Create the
~/.config/email-gazette/
directory if needed.
json
{
  "gazette_name": "The Email Gazette",
  "tagline": "All the Email That's Fit to Print",
  "output_dir": "~/Desktop/email-gazette",
  "topics": ["technology", "AI", "business"],
  "email_cap": 50,
  "date_format": "YYYY-MM-DD"
}
Ask these questions during first-run setup:
  1. Gazette name — "What would you like to call your gazette?" (e.g., "The Morning Wire", "Alex's Daily Brief", "The Inbox Times"). This becomes the masthead title.
  2. Tagline — "Want a tagline beneath the masthead?" Suggest a default like "All the Email That's Fit to Print" but let them customize (e.g., "Your inbox, editorialized", "News from the void").
  3. Output directory — "Where should I save past editions?" Suggest
    ~/Desktop/email-gazette/
    as default. Create the directory if it doesn't exist.
  4. Topics of interest — "What topics matter most to you? These get headline treatment." Suggest common categories (technology, AI, business, finance, crypto, health, politics, science) but let them specify anything. Everything else still appears, just in smaller print.
  5. Email cap — "How many unread emails should I process per edition?" Default: 50. More = richer gazette but slower.
  6. Date format for filenames — "How should I name the files?" Default:
    YYYY-MM-DD.html
    (sorts well). Alternative:
    DD-MM-YYYY.html
    .
If the user seems impatient or says something like "just use defaults", use sensible defaults and save them immediately.
The user can reconfigure at any time by saying "reconfigure my gazette" or "change my gazette settings" — in that case, re-ask the questions and overwrite the config file.
所有用户偏好都存储在路径为
~/.config/email-gazette/config.json
的JSON配置文件中,这是唯一的配置来源,每次运行都需要先检查该文件是否存在。
如果
~/.config/email-gazette/config.json
已存在
,读取并使用其中的配置,无需询问用户任何信息。
如果该文件不存在,说明是首次运行。需要询问用户完成gazette配置,随后将用户的答案保存到该文件中。如果
~/.config/email-gazette/
目录不存在则需要先创建。
json
{
  "gazette_name": "The Email Gazette",
  "tagline": "All the Email That's Fit to Print",
  "output_dir": "~/Desktop/email-gazette",
  "topics": ["technology", "AI", "business"],
  "email_cap": 50,
  "date_format": "YYYY-MM-DD"
}
首次运行配置时需要询问用户以下问题:
  1. Gazette名称 — “你想给你的 gazette 起什么名字?”(例如:“早间电讯报”、“Alex的每日简报”、“收件箱时报”),该名称会作为报纸的刊头标题。
  2. 标语 — “需要在刊头下方加一句标语吗?” 建议默认使用“All the Email That's Fit to Print”,但允许用户自定义(例如:“你的专属收件箱编辑版”、“来自虚空的消息”)。
  3. 输出目录 — “我应该把往期版本保存在哪里?” 建议默认路径为
    ~/Desktop/email-gazette/
    ,如果目录不存在则创建。
  4. 感兴趣的主题 — “你最关注哪些主题?这些主题会获得头条展示位。” 建议常见分类(科技、AI、商业、金融、加密货币、健康、政治、科学),但允许用户指定任意内容。其他主题的内容仍然会展示,只是字号更小。
  5. 邮件处理上限 — “每期最多处理多少封未读邮件?” 默认值:50。数量越多gazette内容越丰富,但生成速度越慢。
  6. 文件名的日期格式 — “我应该怎么命名生成的文件?” 默认格式:
    YYYY-MM-DD.html
    (排序友好),可选格式:
    DD-MM-YYYY.html
如果用户看起来没有耐心或者说出“直接用默认设置”之类的话,直接使用合理的默认配置并立即保存即可。
用户随时可以通过说出“重新配置我的gazette”或者“修改我的gazette设置”来重新配置,此时重新询问上述配置问题并覆盖配置文件即可。

Step 1: Fetch Unread Emails

步骤1:拉取未读邮件

Use the
gws
CLI to list unread inbox messages:
bash
gws gmail +triage --max {EMAIL_CAP} --format json
This returns a JSON array with sender, subject, date, and message ID for each unread message.
Requires: The
gws
CLI must be installed and authenticated. If the command fails, let the user know they need to set up the Google Workspace CLI first.
使用
gws
CLI列出未读收件箱消息:
bash
gws gmail +triage --max {EMAIL_CAP} --format json
该命令会返回JSON数组,包含每封未读邮件的发件人、主题、日期和消息ID。
要求: 必须已经安装并认证
gws
CLI。如果命令执行失败,告知用户需要先完成Google Workspace CLI的设置。

Step 2: Read Email Content

步骤2:读取邮件内容

For each email from triage, fetch the full message to understand its content:
bash
gws gmail users messages get --params '{"userId":"me","id":"MESSAGE_ID","format":"metadata","metadataHeaders":"Subject"}' --format json
This returns the email snippet (a preview of the body content). You don't need to fetch every single email in full — use judgment:
  • Full read for emails matching the user's topics of interest, anything that looks like it contains important news, and personal emails that seem urgent
  • Subject-only is fine for obvious marketing, automated notifications, and promotional emails
对分类得到的每封邮件,拉取完整消息以理解其内容:
bash
gws gmail users messages get --params '{"userId":"me","id":"MESSAGE_ID","format":"metadata","metadataHeaders":"Subject"}' --format json
该命令会返回邮件摘要(正文内容的预览)。你不需要拉取每封邮件的完整内容,可以自行判断:
  • 完整读取 匹配用户感兴趣主题的邮件、看起来包含重要新闻的邮件、看起来紧急的私人邮件
  • 仅读取主题 明显是营销内容、自动通知、推广类的邮件就足够

Step 2b: Web Research for Key Topics

步骤2b:核心主题的网络调研

After identifying the major stories (typically 3-6), enrich them with external sources. This turns the gazette from a simple email summary into a genuinely informative briefing.
For each major headline story, use web search to find:
  • X/Twitter posts from notable accounts discussing the topic
  • arXiv papers if the story involves research or a model release
  • Official blog posts from the companies involved
  • News articles from reputable press
Run searches in parallel where possible. For each story, search for:
[topic] [key company/person] [current year]
. Aim for 2-5 external sources per major story.
Important: Subagents may not have web search permissions. If so, run the web searches directly yourself rather than delegating. Don't search for low-priority "In Other News" items — only enrich the stories that matter.
识别出核心报道后(通常3-6篇),通过外部信息补充内容,让gazette从简单的邮件摘要变成真正有价值的简报。
对每个头条报道,使用网络搜索查找以下内容:
  • X/Twitter 知名账号讨论该主题的帖子
  • arXiv论文 如果报道涉及研究或者模型发布
  • 相关公司的官方博客文章
  • 知名媒体的新闻报道
尽可能并行执行搜索。对每个报道,搜索关键词为:
[主题] [核心公司/人物] [当前年份]
,每个核心报道尽量匹配2-5个外部来源。
重要: 子Agent可能没有网络搜索权限,如果是这种情况,你直接自己执行网络搜索,不要委托。不要搜索低优先级的“其他新闻”内容,仅补充重要报道的信息。

Step 3: Categorize

步骤3:分类

Sort every email into one of these tiers, using the user's configured topics of interest to guide what counts as "headline" material:
将所有邮件分到以下层级,用户配置的感兴趣主题是判断“头条”内容的核心依据:

HEADLINE NEWS (top priority, most visual space)

头条新闻(最高优先级,占据最多视觉空间)

  • Newsletters and updates matching the user's topics of interest
  • Breaking or time-sensitive information in those domains
  • Major industry news
  • 匹配用户感兴趣主题的通讯和更新
  • 对应领域的突发或时效性信息
  • 行业重大新闻

CRUCIAL ALERTS (visually prominent, draws immediate attention)

重要提醒(视觉上突出,吸引即时注意力)

  • Emails requiring urgent action
  • Important deadlines or reminders
  • Interview requests, scheduling, or meeting invitations
  • Anything from a real person (not a mailing list) that seems urgent or important
  • 需要紧急处理的邮件
  • 重要截止日期或提醒
  • 面试请求、日程安排、会议邀请
  • 来自真人(不是邮件列表)的紧急或重要邮件

IN OTHER NEWS (small print, side panel, minimal space)

其他新闻(小字号,侧边栏,最小空间)

  • Routine automated notifications
  • Low-value marketing newsletters
  • Social media digests
  • Promotional emails
  • Anything that doesn't need attention
  • 常规自动通知
  • 低价值营销通讯
  • 社交媒体摘要
  • 推广邮件
  • 不需要关注的其他内容

Step 4: Generate the Newspaper HTML

步骤4:生成报纸HTML

Produce a single self-contained HTML file. The aesthetic direction is classic broadsheet newspaper:
生成单个独立的HTML文件,审美方向为经典大报风格

Design Direction

设计方向

Aesthetic: Editorial / classic newspaper with a modern twist. Think The New York Times or The Financial Times meets a beautifully typeset broadsheet.
Typography:
  • Use a distinctive serif font for headlines (e.g., from Google Fonts: Playfair Display, Cormorant Garamond, or similar editorial serif)
  • A clean readable serif or sans-serif for body text (e.g., Source Serif Pro, Libre Baskerville, or similar)
  • The masthead should use the user's configured gazette name, rendered grand and prominent like a real newspaper nameplate
  • Include the current date beneath the masthead, formatted like a newspaper date line (e.g., "Saturday, March 8, 2026")
  • Show the user's configured tagline in italics beneath the name
Layout:
  • Multi-column layout using CSS grid, like a real newspaper
  • HEADLINE NEWS gets the most space: a lead story spanning multiple columns at the top, with supporting stories in a grid
  • CRUCIAL ALERTS get a visually distinct treatment: a bordered box with a red or bold accent, "URGENT" or "BREAKING" style banners
  • IN OTHER NEWS goes at the bottom in noticeably smaller type, compressed like classified ads
  • Add subtle column rules (thin vertical lines between columns) for authenticity
Visual details:
  • Thin horizontal rules to separate sections
  • A subtle paper/cream background color for warmth
  • Drop caps on the lead story's first paragraph
  • Section headers styled like newspaper section labels (derived from the user's topics, e.g., "TECHNOLOGY", "FINANCE", "AI & MACHINE LEARNING")
  • For each article/email summary: a headline (derived from the subject), a brief summary (2-3 sentences), and the source/sender in small italics
  • Stories with particularly important or newsworthy content get larger headlines and more column space
Reference numbering and source links:
Every story and claim should have small superscript reference numbers linking to sources. This is a two-part system:
  1. Email references — Each email that contributed to a story gets a superscript number (e.g.,
    <sup>[1]</sup>
    ) linking to the email in Gmail:
    https://mail.google.com/mail/u/0/#inbox/MESSAGE_ID
  2. Web references — External sources from web research (Step 2b) also get superscript numbers, continuing the sequence. These link directly to the external URL.
At the bottom of each story, render references as a small footnote block. Style in a very small, understated font (academic citation style) so they don't clutter the newspaper aesthetic but are available when needed.
Include a consolidated "Sources" section at the bottom of the gazette (before the footer) listing all references grouped by story — a bibliography for readers who want to dive deeper.
Crucial alerts treatment:
  • Visually prominent: boxed section with distinct background color or border
  • Labels like "URGENT", "ACTION REQUIRED", "REMINDER" as small badges
  • Key details: who it's from, what's needed, any deadline
In Other News treatment:
  • Very small font size, dense compact layout
  • Just sender, subject, and one line of context
  • Each item links to its source email
  • Should feel like the fine print at the bottom of a newspaper page
美学: 编辑风/经典报纸加现代改良,类似《纽约时报》或《金融时报》的精美排版大报风格。
排版:
  • 头条使用有辨识度的衬线字体(例如Google Fonts的Playfair Display、Cormorant Garamond或者类似的编辑风格衬线字体)
  • 正文使用清晰易读的衬线或无衬线字体(例如Source Serif Pro、Libre Baskerville或者类似字体)
  • 刊头要使用用户配置的gazette名称,像真实报纸的刊名一样醒目突出
  • 刊头下方要展示当前日期,格式和报纸的日期行一致(例如:“Saturday, March 8, 2026”)
  • 用户配置的标语以斜体展示在刊名下方
布局:
  • 使用CSS grid实现多列布局,和真实报纸一致
  • 头条新闻占据最多空间:头版头条在顶部跨多列展示,辅助报道以网格布局排列
  • 重要提醒要有明显的视觉区分:带边框的盒子,使用红色或粗体强调,标有“URGENT”或“BREAKING”风格的横幅
  • 其他新闻放在底部,字号明显更小,排版紧凑类似分类广告
  • 添加细的列分隔线(列之间的细竖线)提升真实感
视觉细节:
  • 用细的水平分隔线区分不同板块
  • 使用柔和的纸张/米黄色背景提升温暖感
  • 头版头条第一段使用首字下沉效果
  • 板块标题使用报纸板块标签风格(基于用户的感兴趣主题生成,例如:“TECHNOLOGY”、“FINANCE”、“AI & MACHINE LEARNING”)
  • 每篇报道/邮件摘要包含:标题(从邮件主题衍生)、简短摘要(2-3句话)、小斜体展示的来源/发件人
  • 特别重要或者有新闻价值的报道使用更大的标题,占据更多列空间
参考编号和来源链接:
每篇报道和声明都要有小的上标参考编号链接到来源,分为两类:
  1. 邮件参考 — 每篇贡献到报道的邮件都有上标编号(例如:
    <sup>[1]</sup>
    ),链接到Gmail里的对应邮件:
    https://mail.google.com/mail/u/0/#inbox/MESSAGE_ID
  2. 网络参考 — 网络调研(步骤2b)得到的外部来源也使用上标编号,序号连续,直接链接到外部URL。
每篇报道底部以脚注块的形式展示参考来源,使用非常小的低调字体(学术引用风格),既不会破坏报纸的美学风格,又可以在需要时查阅。
在gazette底部(页脚前)添加统一的“来源”板块,按报道分组列出所有参考来源,供想要深入了解的读者作为参考目录。
重要提醒的处理:
  • 视觉上突出:带边框的板块,使用不同的背景色或边框
  • 带有“URGENT”、“ACTION REQUIRED”、“REMINDER”之类的小标签
  • 核心信息:发件人、需要做的操作、截止日期(如果有)
其他新闻的处理:
  • 非常小的字号,紧凑密集的布局
  • 仅展示发件人、主题和一行上下文
  • 每个条目都链接到对应的来源邮件
  • 视觉上类似报纸底部的小字印刷内容

Technical Requirements

技术要求

  • Single self-contained HTML file (all CSS inline or in a
    <style>
    block)
  • Load fonts from Google Fonts CDN (the only external dependency allowed)
  • Responsive: optimized for desktop but shouldn't break on mobile
  • No JavaScript required unless you want subtle hover effects
  • Save to
    {OUTPUT_DIR}/{DATE}.html
    using the user's configured directory and date format
  • 单个独立HTML文件(所有CSS内联或者放在
    <style>
    块中)
  • 从Google Fonts CDN加载字体(唯一允许的外部依赖)
  • 响应式:针对桌面端优化,但移动端也不能出现布局错乱
  • 不需要JavaScript,除非要实现微妙的悬停效果
  • 使用用户配置的目录和日期格式,保存到
    {OUTPUT_DIR}/{DATE}.html

Step 5: Open in Browser

步骤5:在浏览器中打开

bash
open {OUTPUT_DIR}/{DATE}.html
On Linux, use
xdg-open
instead. On Windows/WSL, use
wslview
or
explorer.exe
.
bash
open {OUTPUT_DIR}/{DATE}.html
Linux系统使用
xdg-open
,Windows/WSL系统使用
wslview
或者
explorer.exe

Important Notes

重要说明

  • Read-only. Never modify, delete, or mark emails as read.
  • Empty inbox? Generate a charming gazette page that says something like "No News is Good News" with a tasteful empty-state design.
  • Group related emails. Multiple emails from the same newsletter or about the same topic should be merged into a single story.
  • Editorial voice. Write summaries in a newspaper editorial voice: concise, informative, slightly formal but engaging. Transform email subjects into proper newspaper-style headlines and ledes.
  • It's a newspaper, not a list. The gazette should feel like a real publication. Editorialize the presentation — the goal is to make reading email feel like reading the morning paper.
  • 只读操作。 绝对不要修改、删除或者将邮件标记为已读。
  • 收件箱为空? 生成一个精美的gazette页面,展示类似“No News is Good News”的内容,搭配优雅的空状态设计。
  • 合并相关邮件。 来自同一通讯或者讨论同一主题的多封邮件需要合并为单篇报道。
  • 编辑语气。 摘要使用报纸编辑的语气:简洁、信息丰富、略微正式但有吸引力。将邮件主题转换为正规的报纸风格标题和导语。
  • 这是报纸,不是列表。 Gazette要给人真实出版物的感觉,对呈现方式做编辑优化,目标是让读邮件像读早报一样有体验感。