Newsletter Digest Builder
This skill takes a folder of saved articles and newsletters (.txt or .md files) and returns a structured weekly digest: articles scored by relevance to your role, grouped by topic, with a "Read This Week" shortlist at the top.
Input:
- A folder path (or list of files) containing .txt/.md articles — one article per file
- Your role or current focus area (stated in 1–2 sentences in your message)
Output:
- Markdown digest with a "Read This Week" shortlist (5–7 items), full list grouped by topic, and a "Can Skip This Week" section
Language Detection
Detect the user's language from their message:
- If Russian (or contains Cyrillic): respond in Russian
- If English (or other Latin-script language): respond in English
- If ambiguous: respond in the language of the trigger phrase used
Instructions
Step 1: Validate Input
Check that files have been provided (folder path, uploaded files, or pasted list)
- If no files provided: stop and return — "Please provide a folder path or upload your saved article files (.txt or .md). I need at least 1 article to build a digest."
- Accepted formats: .txt files, .md files, pasted markdown list
Check that the user's role or focus area is stated in their message
- If missing: ask once before proceeding — "What's your current role or focus area? (e.g., 'PM focused on AI product launches' or 'Marketer working on B2B demand generation')"
- Do not guess or assign a generic role — prioritization depends on it
Validate files: skip empty or unreadable files; note count at end of output
- If all files are empty or unreadable: stop with — "No readable article files found. Check that files contain article text."
Step 2: Extract Articles
For each file, extract:
- Title: first H1 heading, first bold line, or filename (as fallback)
- Source domain: from URLs in the file if present (e.g.,
hbr.org, lenny.substack.com)
- Body text: first 200–300 words for topic detection and relevance scoring
Build a working list: [title, source, body_excerpt] per article
Skip binary, code, or non-article files silently; note count at end if any skipped
Edge Cases:
- Files contain only a URL with no body text: extract domain and URL path as title; flag in output "digest based on URL metadata only"
- Very large folder (50+ files): process all; cap shortlist at 7; note total count
- Files in mixed languages (EN + RU): process both; group by topic regardless of language; respond in user's message language
Step 3: Detect Topics
Analyze all article titles and body excerpts to identify 3–6 topic clusters
- Use title keywords and source domain signals:
hbr.org, mckinsey.com → Leadership/Strategy
lenny.substack.com, svpg.com → Product Management
nngroup.com, smashingmagazine.com → UX/Design
techcrunch.com, theverge.com, wired.com → Tech/Industry News
towardsdatascience.com, arxiv.org → AI/Data
- Marketing/growth newsletters → Growth/Marketing
- For unknown sources: use title keywords to assign topic
- Articles that don't fit any cluster: assign to "General"
Aim for 3–6 distinct groups; if folder is small (< 6 files), use 2–3 groups
Edge Cases:
- All articles from a single domain: group by subtopic using title keywords; note "All items from one source — grouped by subtopic"
- Only 1–2 articles total: skip topic grouping; output flat list with labels; note "Too few files for grouping"
Step 4: Score Relevance by Role
For each article, score relevance to the user's stated role and focus area:
- [Must Read]: Directly relevant — topic matches stated role/focus, or title addresses a specific problem the user likely faces
- [Useful]: Broadly relevant — adjacent topic, useful background, or industry context
- [Optional]: Low relevance — interesting but tangential to stated role and focus
Apply scoring across all articles before ranking
Role-specific scoring signals (examples):
- PM / Product Manager: prioritize product strategy, user research, metrics, AI product, B2B SaaS topics
- Marketer / Marketing: prioritize growth, SEO, content strategy, demand gen, social, copywriting topics
- Custom role: score based on keywords in the stated description
Within each topic group, sort: Must Read → Useful → Optional
Step 5: Build "Read This Week" Shortlist
Exception — 1–2 articles total: Skip the "Read This Week" shortlist heading entirely. Output a flat list of all articles with relevance labels only. Add note: "Too few files for grouping — showing all items." Go directly to Step 6 with flat-list format (omit shortlist and topic group sections).
Select top 5–7 articles overall:
- Prefer [Must Read] items from the widest topic variety (max 2 per topic in shortlist)
- If fewer than 5 [Must Read] items: include top [Useful] items
For each shortlisted item, add a 1-sentence relevance note explaining why it's recommended for this role
Cap at 7 items regardless of folder size
Step 6: Format and Output
- Build the output markdown (see Output Format section below)
- Include all articles from input in the full grouped list — no items silently dropped
- Add footer with count of skipped files (if any)
Negative Cases
- No files provided: Stop — "Please provide a folder path or upload your saved article files (.txt or .md)."
- All files empty: Stop — "No readable content found. Files appear empty or contain no article text."
- Role not provided: Ask once — do not produce output without it (prioritization is meaningless without role context)
- Non-article files only (code, spreadsheets, binary): Stop — "No readable article files found. Expected .txt or .md files with article content."
Output Format
## Weekly Digest — [YYYY-MM-DD]
**Role:** [user-stated role and focus]
**Articles processed:** X | **Skipped:** Y (omit if 0)
---
### Read This Week (Top 5–7)
1. **[Title]** — [Topic] · [1-sentence relevance note for this role]
2. **[Title]** — [Topic] · [1-sentence relevance note for this role]
...
---
### Full List by Topic
#### [Topic 1 name]
- [Must Read] **[Title]** — [source domain or filename]
- [Useful] **[Title]** — [source domain or filename]
- [Optional] **[Title]** — [source domain or filename]
#### [Topic 2 name]
...
---
### Can Skip This Week
- [Optional] **[Title]** — [brief reason: low relevance to stated focus]
...
Field rules:
- Relevance labels: always one of [Must Read] / [Useful] / [Optional]
- "Read This Week" items always include a 1-sentence relevance note
- "Can Skip This Week": only [Optional] items; include brief reason if non-obvious
- If all items are [Must Read]: omit "Can Skip This Week" section
- Filename used as title fallback when no title detected in file
1---2name: newsletter-digest-builder3description: Build a structured weekly digest from a folder of saved articles and newsletters. Prioritizes by role (PM, marketer, or custom). Triggers: 'build newsletter digest', 'newsletter digest', 'summarize my saved articles', 'I have too many newsletters to read', 'собери дайджест из рассылок', 'дайджест из статей', 'сделай еженедельный дайджест', 'у меня накопилось много статей'.4---56# Newsletter Digest Builder78This skill takes a folder of saved articles and newsletters (.txt or .md files) and returns a structured weekly digest: articles scored by relevance to your role, grouped by topic, with a "Read This Week" shortlist at the top.910**Input:**11- A folder path (or list of files) containing .txt/.md articles — one article per file12- Your role or current focus area (stated in 1–2 sentences in your message)1314**Output:**15- Markdown digest with a "Read This Week" shortlist (5–7 items), full list grouped by topic, and a "Can Skip This Week" section1617---1819## Language Detection2021Detect the user's language from their message:22- If Russian (or contains Cyrillic): respond in Russian23- If English (or other Latin-script language): respond in English24- If ambiguous: respond in the language of the trigger phrase used2526---2728## Instructions2930### Step 1: Validate Input31321. Check that files have been provided (folder path, uploaded files, or pasted list)33 - If no files provided: stop and return — "Please provide a folder path or upload your saved article files (.txt or .md). I need at least 1 article to build a digest."34 - Accepted formats: .txt files, .md files, pasted markdown list35362. Check that the user's role or focus area is stated in their message37 - If missing: ask once before proceeding — "What's your current role or focus area? (e.g., 'PM focused on AI product launches' or 'Marketer working on B2B demand generation')"38 - Do not guess or assign a generic role — prioritization depends on it39403. Validate files: skip empty or unreadable files; note count at end of output41 - If all files are empty or unreadable: stop with — "No readable article files found. Check that files contain article text."4243### Step 2: Extract Articles44451. For each file, extract:46 - **Title**: first H1 heading, first bold line, or filename (as fallback)47 - **Source domain**: from URLs in the file if present (e.g., `hbr.org`, `lenny.substack.com`)48 - **Body text**: first 200–300 words for topic detection and relevance scoring49502. Build a working list: `[title, source, body_excerpt]` per article51523. Skip binary, code, or non-article files silently; note count at end if any skipped5354**Edge Cases:**55- Files contain only a URL with no body text: extract domain and URL path as title; flag in output "digest based on URL metadata only"56- Very large folder (50+ files): process all; cap shortlist at 7; note total count57- Files in mixed languages (EN + RU): process both; group by topic regardless of language; respond in user's message language5859### Step 3: Detect Topics60611. Analyze all article titles and body excerpts to identify 3–6 topic clusters62 - Use title keywords and source domain signals:63 - `hbr.org`, `mckinsey.com` → Leadership/Strategy64 - `lenny.substack.com`, `svpg.com` → Product Management65 - `nngroup.com`, `smashingmagazine.com` → UX/Design66 - `techcrunch.com`, `theverge.com`, `wired.com` → Tech/Industry News67 - `towardsdatascience.com`, `arxiv.org` → AI/Data68 - Marketing/growth newsletters → Growth/Marketing69 - For unknown sources: use title keywords to assign topic70 - Articles that don't fit any cluster: assign to "General"71722. Aim for 3–6 distinct groups; if folder is small (< 6 files), use 2–3 groups7374**Edge Cases:**75- All articles from a single domain: group by subtopic using title keywords; note "All items from one source — grouped by subtopic"76- Only 1–2 articles total: skip topic grouping; output flat list with labels; note "Too few files for grouping"7778### Step 4: Score Relevance by Role79801. For each article, score relevance to the user's stated role and focus area:81 - **[Must Read]**: Directly relevant — topic matches stated role/focus, or title addresses a specific problem the user likely faces82 - **[Useful]**: Broadly relevant — adjacent topic, useful background, or industry context83 - **[Optional]**: Low relevance — interesting but tangential to stated role and focus84852. Apply scoring across all articles before ranking86873. Role-specific scoring signals (examples):88 - **PM / Product Manager**: prioritize product strategy, user research, metrics, AI product, B2B SaaS topics89 - **Marketer / Marketing**: prioritize growth, SEO, content strategy, demand gen, social, copywriting topics90 - **Custom role**: score based on keywords in the stated description91924. Within each topic group, sort: Must Read → Useful → Optional9394### Step 5: Build "Read This Week" Shortlist9596**Exception — 1–2 articles total:** Skip the "Read This Week" shortlist heading entirely. Output a flat list of all articles with relevance labels only. Add note: "Too few files for grouping — showing all items." Go directly to Step 6 with flat-list format (omit shortlist and topic group sections).97981. Select top 5–7 articles overall:99 - Prefer [Must Read] items from the widest topic variety (max 2 per topic in shortlist)100 - If fewer than 5 [Must Read] items: include top [Useful] items1011022. For each shortlisted item, add a 1-sentence relevance note explaining why it's recommended for this role1031043. Cap at 7 items regardless of folder size105106### Step 6: Format and Output1071081. Build the output markdown (see Output Format section below)1092. Include all articles from input in the full grouped list — no items silently dropped1103. Add footer with count of skipped files (if any)111112---113114## Negative Cases115116- **No files provided**: Stop — "Please provide a folder path or upload your saved article files (.txt or .md)."117- **All files empty**: Stop — "No readable content found. Files appear empty or contain no article text."118- **Role not provided**: Ask once — do not produce output without it (prioritization is meaningless without role context)119- **Non-article files only (code, spreadsheets, binary)**: Stop — "No readable article files found. Expected .txt or .md files with article content."120121---122123## Output Format124125```126## Weekly Digest — [YYYY-MM-DD]127**Role:** [user-stated role and focus]128**Articles processed:** X | **Skipped:** Y (omit if 0)129130---131132### Read This Week (Top 5–7)1331. **[Title]** — [Topic] · [1-sentence relevance note for this role]1342. **[Title]** — [Topic] · [1-sentence relevance note for this role]135...136137---138139### Full List by Topic140141#### [Topic 1 name]142- [Must Read] **[Title]** — [source domain or filename]143- [Useful] **[Title]** — [source domain or filename]144- [Optional] **[Title]** — [source domain or filename]145146#### [Topic 2 name]147...148149---150151### Can Skip This Week152- [Optional] **[Title]** — [brief reason: low relevance to stated focus]153...154```155156**Field rules:**157- Relevance labels: always one of [Must Read] / [Useful] / [Optional]158- "Read This Week" items always include a 1-sentence relevance note159- "Can Skip This Week": only [Optional] items; include brief reason if non-obvious160- If all items are [Must Read]: omit "Can Skip This Week" section161- Filename used as title fallback when no title detected in file