About fetch-abstract-to-kb
A skill for retrieving DOI candidates from a database and batch-writing abstracts by DOI. It is intended for journal-record maintenance and updates only rows whose abstract is still empty.
Key features
- 01Retrieve qualifying DOI records
- 02Set the fetch row limit
- 03Batch-write abstracts by DOI
- 04Update only empty abstracts
Use cases
- 01Find journal records without abstracts
- 02Fill in abstracts for multiple DOIs
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ tiangong-ai/ agent-skills --skill fetch-abstract-to-kbAfter installing, type/fetch-abstract-to-kbin Claude Code to confirm it loaded.
Details
From the project READMEFetch Abstract to KB
Core Goal
- Provide only two DB operations:
- Fetch DOI candidates from
journals. - Batch update
abstractby DOI.
- Fetch DOI candidates from
Required Environment
KB_DB_HOSTKB_DB_PORTKB_DB_NAMEKB_DB_USERKB_DB_PASSWORD
Workflow
- Fetch DOI list (default 10 rows):
python3 scripts/fetch_abstract_to_kb.py fetch-doi
- Optionally override row limit:
python3 scripts/fetch_abstract_to_kb.py fetch-doi --limit 10
- Prepare JSON input for batch update (one of the two formats):
[
{"doi": "10.1000/a", "abstract": "text A"},
{"doi": "10.1000/b", "abstract": "text B"}
]
or
{
"10.1000/a": "text A",
"10.1000/b": "text B"
}
- Batch write abstract by DOI:
python3 scripts/fetch_abstract_to_kb.py write-abstracts --input abstracts.json
Query/Write Contract
- Fetch filter:
doinot emptyauthornot empty (fall back toauthorswhenauthoris unavailable)abstractempty (NULLor blank)
- Fetch order:
ORDER BY created_at DESC NULLS LAST
- Fetch default limit:
10
- Write guard:
- Update only when target row
abstractis still empty.
- Update only when target row
Script
scripts/fetch_abstract_to_kb.py
Comments
Markdown supported