← Back to Skills Marketplace
jamesnation

Briefed

by jamesnation · GitHub ↗ · v1.1.2
cross-platform ✓ Security Clean
438
Downloads
1
Stars
1
Active Installs
4
Versions
Install in OpenClaw
/install briefed
Description
Set up and run a personal AI newsletter intelligence system called Briefed. Fetches Gmail newsletters daily, uses Claude Haiku to extract article summaries,...
README (SKILL.md)

Briefed

A daily newsletter digest pipeline + local web reader. Gmail → Haiku summaries → web app → notification ping.

Architecture

[Gmail]
   ↓  pre-fetch.py (fetches, filters, extracts compact metadata)
[newsletter-inbox.json]
   ↓  Haiku cron agent (reads compact JSON, writes AI summaries)
[newsletter-today.json]
   ↓  fetch-bodies.py (adds full HTML email bodies)
[newsletter-today.json + bodies]
   ↓  Express web reader (default port 3001)
[Notification ping → user opens reader]

Why split fetch/summarise? Raw Gmail API JSON overflows Haiku's context. Python handles data wrangling; Haiku handles cognition.

Security & Scope

  • Gmail access is read-only (gmail.readonly).
  • OAuth token is stored locally at ~/.openclaw/workspace/briefed-gmail-token.json (or BRIEFED_GMAIL_TOKEN_FILE).
  • The workflow should only read/write the following workspace files:
    • newsletter-inbox.json
    • newsletter-today.json
    • newsletter-interests.json
    • newsletter-notes.json
    • reading-list.md
  • Do not send newsletter content to external endpoints other than the configured model provider and user-selected notification channel.

Prerequisites

  • Python 3.9+
  • Python deps for Gmail API (google-api-python-client, google-auth, google-auth-oauthlib)
  • A Google OAuth Desktop client JSON file (for Gmail read-only auth)
  • Node.js ≥18 (for the reader web app)
  • claude-haiku-4-5 on the OpenClaw models allowlist
  • A notification channel configured in OpenClaw (Telegram, Discord, etc.)

Setup

1. Install Python dependencies

cd ~/.openclaw/workspace/briefed
python3 -m pip install -r scripts/requirements.txt

2. Configure Gmail OAuth

Create a Google Cloud OAuth Desktop app and download the client JSON, then set:

export BRIEFED_GMAIL_CLIENT_SECRET=~/client_secret.json

On first script run, Briefed opens a browser OAuth flow and stores a reusable token at:

~/.openclaw/workspace/briefed-gmail-token.json

3. Deploy the reader app

# Copy the reader to the workspace
cp -r assets/reader/ ~/.openclaw/workspace/briefed/
cd ~/.openclaw/workspace/briefed
npm install

4. Configure Gmail token paths (optional)

Defaults (works for most users):

  • Token file: ~/.openclaw/workspace/briefed-gmail-token.json
  • Client secret: ~/client_secret.json

Override via env vars if needed:

export BRIEFED_GMAIL_CLIENT_SECRET=~/path/to/client_secret.json
export BRIEFED_GMAIL_TOKEN_FILE=~/.openclaw/workspace/briefed-gmail-token.json

5. Configure interests

Create ~/.openclaw/workspace/newsletter-interests.json (or let it be auto-created on first run):

{
  "version": 1,
  "topics": { "ai": 0.9, "startups": 0.8, "design": 0.75 },
  "signals": [],
  "sources": {}
}

6. Start the reader

Run manually if you prefer no persistence. LaunchAgent is optional convenience for auto-start.

# Quick test
node ~/.openclaw/workspace/briefed/server.js

# Persistent — create ~/Library/LaunchAgents/ai.openclaw.briefed.plist

LaunchAgent plist template:

\x3C?xml version="1.0" encoding="UTF-8"?>
\x3C!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
\x3Cplist version="1.0">\x3Cdict>
  \x3Ckey>Label\x3C/key>\x3Cstring>ai.openclaw.briefed\x3C/string>
  \x3Ckey>ProgramArguments\x3C/key>\x3Carray>
    \x3Cstring>/usr/local/bin/node\x3C/string>
    \x3Cstring>/Users/YOUR_USER/.openclaw/workspace/briefed/server.js\x3C/string>
  \x3C/array>
  \x3Ckey>EnvironmentVariables\x3C/key>\x3Cdict>
    \x3Ckey>BRIEFED_GMAIL_CLIENT_SECRET\x3C/key>\x3Cstring>/Users/YOUR_USER/client_secret.json\x3C/string>
    \x3Ckey>BRIEFED_GMAIL_TOKEN_FILE\x3C/key>\x3Cstring>/Users/YOUR_USER/.openclaw/workspace/briefed-gmail-token.json\x3C/string>
  \x3C/dict>
  \x3Ckey>RunAtLoad\x3C/key>\x3Ctrue/>
  \x3Ckey>KeepAlive\x3C/key>\x3Ctrue/>
  \x3Ckey>WorkingDirectory\x3C/key>\x3Cstring>/Users/YOUR_USER/.openclaw/workspace/briefed\x3C/string>
  \x3Ckey>StandardOutPath\x3C/key>\x3Cstring>/tmp/briefed.log\x3C/string>
  \x3Ckey>StandardErrorPath\x3C/key>\x3Cstring>/tmp/briefed.log\x3C/string>
\x3C/dict>\x3C/plist>
launchctl load ~/Library/LaunchAgents/ai.openclaw.briefed.plist

7. Create the daily cron job

Use the OpenClaw cron tool with this agent prompt (fill in the placeholders):

Run my daily newsletter digest. Follow these steps exactly:

## Step 1 — Pre-fetch emails
Run: python3 ~/.openclaw/workspace/briefed/scripts/pre-fetch.py

## Step 2 — Read the compact inbox
Read: ~/.openclaw/workspace/newsletter-inbox.json

## Step 3 — Write newsletter-today.json with AI summaries
For each newsletter, write to **only** this file: ~/.openclaw/workspace/newsletter-today.json.
Do not modify any other files in this step.
Use the snippet field to write real summaries — do NOT just repeat the subject line.
Score by interest: (adjust topics and weights to match your interests)
  ai/ml=0.9, startups=0.85, design=0.8, finance=0.75, general=0.6

Schema per story:
{ "id", "rank", "source", "subject", "headline", "summary", "bullets": [], "threadId", "gmailUrl", "score", "body": "" }

## Step 4 — Fetch HTML bodies
Run: python3 ~/.openclaw/workspace/briefed/scripts/fetch-bodies.py

## Step 5 — Send notification
Send (via your configured channel):
"📬 Today's digest is ready — \x3CN> stories waiting.\
→ http://YOUR_HOST:3001"

## Step 6 — Final reply
📬 *Briefed — [DD Mon YYYY]* · \x3CN> stories
*\x3Crank>. \x3CSource>* — \x3CHeadline>
\x3COne sentence summary>
(repeat for all stories)
_Open the reader → http://YOUR_HOST:3001_

Before enabling cron, run this once manually to complete OAuth in a browser:

python3 ~/.openclaw/workspace/briefed/scripts/pre-fetch.py

Cron schedule: 0 7 * * * (7am daily), model: anthropic/claude-haiku-4-5, delivery: announce.

Data Files

All data files live in ~/.openclaw/workspace/:

File Purpose
newsletter-inbox.json Compact pre-fetched email metadata (ephemeral)
newsletter-today.json Today's stories with summaries + HTML bodies
newsletter-interests.json Topic weights + vote/open signals
newsletter-notes.json Per-story user notes
reading-list.md Saved/bookmarked stories

Reader API

Endpoint Method Purpose
/api/today GET All stories (bodies stripped)
/api/story/:id GET Single story with full HTML body
/api/vote POST { storyId, vote: "up"|"down"|"open" }
/api/save POST { storyId } — adds to reading-list.md
/api/note POST { storyId, note }
/api/notes GET All notes

Filtering Transactional Email

scripts/pre-fetch.py has two tunable lists near the top:

  • SKIP_SUBJECT_PATTERNS — subject substrings that flag an email as transactional
  • SKIP_SENDERS — sender names that are always transactional (e.g. banks, shops)

Tune these when transactional emails slip through.

Branding

The reader shows "Briefed" with a blue "B" logo by default. To customise, edit public/index.html and public/icon.svg.

Usage Guidance
This package appears to be what it says: a local newsletter fetcher + reader. Before installing, consider: 1) The BRIEFED_GMAIL_CLIENT_SECRET points to your Google OAuth client JSON and the first run will produce a reusable token file (default ~/.openclaw/workspace/briefed-gmail-token.json). That token grants read access to your Gmail (gmail.readonly) until revoked—ensure you trust the environment and restrict file permissions. 2) The skill recommends (but does not automatically create) persistent launch (LaunchAgent / cron). Only enable those if you want automatic daily access. 3) The skill relies on OpenClaw's model provider (claude-haiku) to summarise content; check your OpenClaw / model provider privacy policy because newsletter content will be sent to the configured model provider. 4) The bundle contains duplicated scripts (in assets/reader/scripts and top-level scripts); review the scripts if you want extra assurance. 5) If you have sensitive newsletters, consider running this against a separate Gmail account or carefully inspect and restrict the OAuth client scopes. If you want, revoke the refresh token from Google or delete the token file to stop future access.
Capability Analysis
Type: OpenClaw Skill Name: briefed Version: 1.1.2 The skill is designed to set up a personal AI newsletter intelligence system, fetching read-only Gmail data, summarizing it with an AI model, and serving a local web reader. All file operations are confined to the OpenClaw workspace, and Gmail access is strictly `gmail.readonly`. The `SKILL.md` instructions for the AI agent are highly prescriptive and include explicit negative constraints (e.g., "Do not modify any other files"), showing no signs of prompt injection. Python scripts include HTML cleaning to remove script tags and tracking pixels, and the Node.js server uses markdown escaping and URL sanitization when writing to files, and the client-side JavaScript uses `escapeHtml` and sandboxed iframes to mitigate XSS risks. There is no evidence of data exfiltration, unauthorized execution, or other malicious intent.
Capability Assessment
Purpose & Capability
The skill asks only for a Google OAuth client secret (BRIEFED_GMAIL_CLIENT_SECRET) and optionally a token file and account name—all appropriate for a Gmail-readonly newsletter fetcher. Node/Python runtime requirements and the included scripts match the described functionality. The README's mention of a separate 'gog' CLI is an incidental recommendation, not a required secret.
Instruction Scope
SKILL.md instructs the agent to run the included Python fetchers, write/read a small set of workspace JSON/MD files, and run the local Express reader. The instructions explicitly limit external endpoints (model provider and a user-chosen notification channel). The code implements only Gmail API calls and local file operations; there are no unexpected network calls or instructions to read unrelated system files.
Install Mechanism
There is no remote download or opaque install step; the skill is instruction-only and ships its code in the skill bundle. Dependencies are installed with pip/npm locally per SKILL.md. No suspicious external URLs, shorteners, or extraction from arbitrary servers are used.
Credentials
Only BRIEFED_GMAIL_CLIENT_SECRET is required, with BRIEFED_GMAIL_TOKEN_FILE and NEWSLETTER_ACCOUNT optional—this is proportional to needing Gmail OAuth. The token file used is stored locally under the workspace. No unrelated credentials (AWS, other API keys, secrets) are requested.
Persistence & Privilege
The skill does not set always:true and does not auto-enable persistent system-wide privileges. However, SKILL.md documents optional persistence (macOS LaunchAgent and a daily cron via OpenClaw). If the user enables those, the stored OAuth token will allow ongoing Gmail read access until revoked. This is expected for a persistently running newsletter fetcher but worth explicit user attention.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install briefed
  3. After installation, invoke the skill by name or use /briefed
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.2
v1.1.2: Hardened reading-list markdown output by escaping user-controlled fields and sanitizing links to http/https only. Clarified LaunchAgent is optional (manual run supported).
v1.1.1
v1.1.1: Added explicit credential/env metadata and a Security & Scope section. Clarified read-only Gmail access, local token storage, allowed file paths, and tightened write-scope instructions in Step 3.
v1.1.0
v1.1.0: Replaced gog subprocess calls with native Gmail API OAuth, added Python requirements, and updated setup docs. This reduces shell-out dependency and improves security scanner posture.
v1.0.0
Initial release. Gmail newsletter fetching, Claude Haiku summarisation, local web reader with voting, notes, and interest tracking.
Metadata
Slug briefed
Version 1.1.2
License
All-time Installs 1
Active Installs 1
Total Versions 4
Frequently Asked Questions

What is Briefed?

Set up and run a personal AI newsletter intelligence system called Briefed. Fetches Gmail newsletters daily, uses Claude Haiku to extract article summaries,... It is an AI Agent Skill for Claude Code / OpenClaw, with 438 downloads so far.

How do I install Briefed?

Run "/install briefed" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Briefed free?

Yes, Briefed is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Briefed support?

Briefed is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Briefed?

It is built and maintained by jamesnation (@jamesnation); the current version is v1.1.2.

💬 Comments