follow-amazon-daily
Generate a daily Amazon seller intelligence digest. Default language is Chinese.
This skill is split into two stages, like follow-builders:
scripts/prepare-digest.jsfetches sources deterministically and prints a single JSON blob (raw items + prompts + config). It does not write the final digest.- You, the agent, read that JSON and remix it into a real editorial digest
following
prompts/daily-digest.mdandprompts/translate.md. You writedigest/<date>.mdand optionally deliver it viascripts/deliver.js.
The point of the split: summaries and translation are written by you from the
raw excerpt/body, never by a hardcoded phrase dictionary. Every item gets
its own specific summary.
Hard Rules
- Public sources are the default. Authenticated WeAreSellers and Billion Dollar
Sellers content is optional and only enabled when
WEARESELLERS_COOKIEorBDS_COOKIEis present. - Never ask for or store account passwords. Only use cookie/session env vars or a local logged-in browser workflow the user adds later.
- Authenticated full text is ephemeral. Use it to derive short insights only.
Never write raw HTML, raw article text, or full subscriber/community posts to
data/feed-amazon.jsonordigest/<date>.md.privateItemsare stdout-only. - WeAreSellers is a community pain-signal source, not policy authority. Confirm policy claims with official sources.
- Billion Dollar Sellers is industry opinion unless confirmed elsewhere.
- No auto-publishing to social platforms (Notion, Xiaohongshu, LinkedIn, X,
Instagram). Delivery is limited to what the user explicitly configures in
config.delivery(stdoutdefault, or their own Telegram / Email / Feishu). Never ask the user to paste a secret in chat — write it to their env file. - Follow
config.languageexactly. Seeprompts/translate.md. - Never fabricate or speculate. Every digest item must carry its original link;
no link → exclude it. See
prompts/daily-digest.md.
Outputs
data/feed-amazon.json # deterministic raw public feed (script-written)
digest/YYYY-MM-DD.md # editorial digest (agent-written, no private items)
stdout # full JSON blob from the script (for the agent)
state-feed.json # per-install cross-run dedup state — LOCAL ONLY
state-feed.json is gitignored runtime state. Never commit it and never ship
it: a populated state would pre-mark every item "seen" and make a fresh user's
first digest empty. A clean install has no state file, so the first run shows
everything (the welcome digest works).
First Run — Onboarding
Gate: if config/sources.json does not have onboardingComplete: true, run
this flow before anything else. Drive it conversationally — you edit the
config and env files for the user; never make them hand-edit JSON, and never
ask them to paste a secret into the chat.
Step 1 — Intro
One or two lines: this is a daily Amazon-seller intelligence digest covering
Official / Policy, Seller Ops, Community Pain Signals, Podcast / Video
Playbooks, and Newsletter / Analyst Signals. Read config/sources.json and tell
them the actual source names and count. One line on the two-stage model (a
script fetches raw content; you remix it into a real digest).
Step 2 — Language
Ask: Chinese (default), English, or bilingual → set config.language.
Step 3 — Frequency, time, timezone
Ask cadence: daily (default) or weekly; the local time (HH:MM); their IANA
timezone (e.g. America/Los_Angeles, Asia/Shanghai); and the weekday if
weekly. Set frequency, deliveryTime, timezone, weeklyDay.
Step 4 — Delivery method
Present four options. For every keyed option, the secret rule is absolute: the
user gets the secret from the provider, and you write it into their env file
(~/.follow-amazon-daily.env, which the cron sources) — they never paste it
into chat, and you never echo it back.
- In-chat / stdout (default) — just show the digest here. No keys.
- Telegram — guide: open @BotFather →
/newbot→ copy the bot token; send the new bot any message; thencurl -s "https://api.telegram.org/bot<TOKEN>/getUpdates"to readchat.id. You putTELEGRAM_BOT_TOKENin the env file anddelivery.chatIdin config. - Email — sign up at resend.com (free), create an API key. You put
RESEND_API_KEYin the env file and the recipient indelivery.email. - Feishu (飞书 / Lark) — in the target Feishu group: 设置 → 群机器人 →
添加机器人 → 自定义机器人 → copy the Webhook URL. Optional: enable 签名校验
and copy the secret. You put
FEISHU_WEBHOOK(andFEISHU_WEBHOOK_SECRETif signed) in the env file. The target is whichever group the bot is in — no chatId needed. Setdelivery.method: "feishu".
When writing the env file, create/append ~/.follow-amazon-daily.env with
export KEY=value lines and tell the user the file path only.
Step 5 — Save config
Write all choices into config/sources.json (language, frequency,
deliveryTime, timezone, weeklyDay, delivery.method + chatId/email
as needed) and set onboardingComplete: true. Show a short plain-language
summary of what you saved.
Step 6 — Schedule (system crontab)
Skip for stdout/on-demand. For telegram/email/feishu, install a crontab entry
that runs scripts/run-daily.sh (it does prepare → agent remix → deliver, with
a labelled raw fallback if the Claude CLI is unavailable on the cron run):
CRON_TZ=<their IANA tz>
<min> <hour> * * <*|weekday> /abs/path/to/skill/scripts/run-daily.sh
If CRON_TZ is unsupported on their cron, convert their local time to UTC for
the schedule instead. Then verify by running scripts/run-daily.sh once and
confirming the message actually arrived in their channel. Be honest about the
raw-fallback caveat (no agent in the cron environment = structured feed, clearly
labelled, not the full editorial digest).
Step 7 — Welcome digest
Immediately run the full pipeline once now (prepare-digest → you remix per the
prompts → deliver via their chosen method → node scripts/mark-seen.js so the
first scheduled run won't repeat today's items) so they see real output today.
Then ask for feedback — length, focus, tone — and apply it (edit the relevant
prompts/ file or config), and confirm what changed.
Step 8 — Reconfigure-by-chat reminder
Tell them everything is changeable by just asking: "switch to English / make it weekly / change time to 8am ET / send it to Feishu instead / make summaries shorter / show my settings". You edit config or prompts for them — and when the time/timezone/frequency changes, you also update the crontab entry.
Daily Workflow
From the repo root:
node scripts/prepare-digest.js # prints JSON blob to stdout
Then:
- Parse the JSON blob (
config,items,privateItems,prompts,stats,errors). - If
stats.publicItemsis 0, tell the user no public signal was captured and stop. - Remix into the digest following
blob.prompts.dailyDigest. Translate perblob.prompts.translateandblob.config.language. Base each summary on the itembodyfirst, thenexcerpt. Never reuse a sentence across items. - Write the public digest to
digest/<date>.md(must contain noprivateItemscontent). - Deliver: if
config.delivery.methodistelegram/email/feishu, pipe the digest tonode scripts/deliver.js --file digest/<date>.md. Otherwise (stdout) show it here. - Only after the digest is written and delivered, run
node scripts/mark-seen.jsso the next run excludes these items.prepare-digest.jsfilters against dedup state read-only and never persists it — if you skip this step (or the run fails) the items simply reappear next time rather than being silently lost. Skip mark-seen if you ran with--ignore-state.
For scheduled runs this whole flow (including mark-seen, only on