請 Claude Code 針對你預先設定的一份 PubMed 期刊清單,彙整過去 7 天內刊出的文章
SaferSkills independently audited pubmed-weekly-digest (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A Claude Code skill: searches the past 7 days on PubMed across a configurable list of journals, refills missing abstracts via CrossRef, writes a TL;DR and a one-line Hot Take per article, and renders a Markdown digest to a local output directory. Committing or publishing the digest is up to you.
Edit these values before running the skill in a new vault:
| Key | Default | Notes |
|---|---|---|
OUTPUT_DIR | output/ (inside this skill folder) | Where {week_label}.md is written |
JOURNALS | See Step 1 table | The list of [Journal] queries — customise freely |
CROSSREF_MAILTO | [email protected] | CrossRef polite-pool identifier (any valid email) |
CROSSREF_MAILTO can also be supplied via an environment variable UNPAYWALL_EMAIL if you prefer not to bake it into the file. If neither is set, CrossRef calls still go out (some endpoints just rate-limit harder).
See README.md (same folder) for setup details and a step-by-step guide to swapping the journal list.
This skill runs at the start of a week and covers the just-ended week.
from datetime import date, timedelta
today = date.today()
# Search window: past 7 days (excluding today)
date_to = today - timedelta(days=1) # yesterday
date_from = today - timedelta(days=7) # 7 days ago
# Week label: use the ISO week of the just-ended week, NOT today's week
target_date = today - timedelta(days=7)
iso_year, iso_week, _ = target_date.isocalendar()
week_label = f"{iso_year}-W{iso_week:02d}" # e.g. 2026-W19
filepath = f"{OUTPUT_DIR}/{week_label}.md"Example: today is 2026-05-11 (W20) → week_label = 2026-W19, search range 2026-05-04 to 2026-05-10.
Pitfall: do NOT use today.isocalendar() for the label — that mis-labels W19 content as W20.Call mcp__PubMed__search_articles (datetype=edat) in parallel for each journal. The default list is six ID/haematology journals; replace freely:
| Query string | max_results |
|---|---|
Clin Infect Dis[Journal] | 50 |
Emerg Infect Dis[Journal] | 50 |
MMWR Morb Mortal Wkly Rep[Journal] | 30 |
Transpl Infect Dis[Journal] | 50 |
Blood[Journal] | 50 |
N Engl J Med[Journal] | 50 |
date_from = date_from (YYYY/MM/DD), date_to = date_to (YYYY/MM/DD)
PubMed query caveats — these apply to every entry in the table:
mycobacteri* → INVALID_PARAMETERS).Expand with OR instead: mycobacterium OR tuberculosis.
(a OR b OR ... OR u)fails; split into two parallel queries if needed.
AND (term1 OR term2) to high-volume generals,e.g. N Engl J Med[Journal] AND (infection OR sepsis OR antimicrobial).
If search fails (MCP error or 0 articles for all journals): stop and report.
Call mcp__PubMed__get_article_metadata in parallel batches (one batch per journal). Each batch is ≤ 20 PMIDs — the MCP silently truncates beyond that.
Scan all articles. If abstract is empty (or "[Abstract not available]", which PubMed sometimes returns as a string) and a doi is present, query CrossRef:
https://api.crossref.org/works/{urlencoded_doi}?mailto={CROSSREF_MAILTO}pubmed-weekly-digest/1.0message.abstract is present in the response: strip JATS/HTML tags andcollapse whitespace, then write back to the article's abstract field.
do NOT abort. Keep the article in a "still missing abstract" list.
Articles still missing abstracts after CrossRef:
the user to paste in abstracts manually, then continue. If the user says skip, leave TL;DR blank and note (no abstract) in the final output.
TL;DR blank for those articles and list thePMIDs in the final report so the user can backfill on a future run.
Drop articles where article_types contains:
"Erratum" or "Published Erratum""Editorial" or "Comment" (no abstract → no meaningful annotation)A section with zero surviving articles is fine — show a placeholder in Step 5.
The default config includes an example for N Engl J Med where only Original Articles and Reviews are kept:
article_types contains "Journal Article" but NOT "Case Reports","Editorial", "Comment", "Letter", "News", "Biography", "Historical Article", "Portrait", "Interview", "Personal Narrative" → treat as Original Article
article_types contains "Review" or "Systematic Review"→ treat as Review Article
Adjust or remove this block for your own journal mix.
For each surviving article:
findings, and clinical implications. Keep drug names and pathogen names (bacterial / viral / fungal) in their canonical form; do not translate the article title.
that fits the content:
(excited / cheerful tone)
problems with no new answers (deadpan / self-aware tone, not cruel)
If abstract was never filled in, leave both fields blank.
Change the output language: this step is pure prompting. Replace "English" above with "Traditional Chinese", "Spanish", "Japanese", or whatever you prefer — Claude will translate the source abstracts on the fly. The rest of the skill is language-agnostic; only Step 4 needs to be edited.
Write the digest to {OUTPUT_DIR}/{week_label}.md.
Read {SKILL_DIR}/template.md for the output scaffold.
Expand journal sections: for each journal in your Step 1 list, replace a ## {Journal N} stub with the real ## {Abbreviation} section using the article-block format in the template. Add extra sections if you have more journals than stubs; remove extras if fewer. Fill {journal_list} in the intro line with a comma-separated list of your journals.
Formatting rules:
{first_author} et al.PMID: {pmid} instead of the DOI line> No matching articles this week.---The Markdown file lives at {OUTPUT_DIR}/{week_label}.md. Stop here unless the user explicitly asks to commit/push — this fork intentionally does not assume a publish target.
If the user wants the file committed to their vault:
git add {OUTPUT_DIR}/{week_label}.md
git commit -m "weekly journal digest {week_label}"If they want to push to a public site repo, that's their choice — add the relevant git remote / gh pr / API call as a follow-up step.
| Situation | Action |
|---|---|
| Step 1 search fails entirely | Report and stop |
| One journal returns 0 articles | Continue; that section shows a placeholder |
| CrossRef refill fails | Continue; affected articles have blank TL;DR |
| Output file already exists | Overwrite (the week label disambiguates) |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.