About fetch-meta-from-kb
This skill retrieves recent journal metadata from a configured database and writes records as JSON with only DOI, title, abstract, and date. It is intended for workflows that need a date-bounded selection of journal entries.
Key features
- 01Filter journal records by age in days
- 02Sort by creation time, newest first
- 03Read database settings from environment variables
- 04Write UTF-8 JSON with fixed fields
Use cases
- 01Export metadata from the past week
- 02Prepare abstract records for a later workflow
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ tiangong-ai/ agent-skills --skill fetch-meta-from-kbAfter installing, type/fetch-meta-from-kbin Claude Code to confirm it loaded.
Details
From the project READMEFetch Meta from KB
Workflow
- Read DB env vars from
.envor process env:KB_DB_HOST,KB_DB_PORT,KB_DB_NAME,KB_DB_USER,KB_DB_PASSWORD. - Query
journalswherecreated_at >= now_utc - DAYS, ordered bycreated_at DESC, selecting onlydoi,title,abstract,date. - Return/write JSON array records with exactly these fields:
doi,title,abstract,date.
Script
Run:
cd fetch-meta-from-kb
python3 scripts/fetch_meta_from_kb.py --days 7 --output selected-abstract.json
Env example:
KB_DB_HOST=<HOST>
KB_DB_PORT=5432
KB_DB_NAME=<DATABASE>
KB_DB_USER=<USER>
KB_DB_PASSWORD=<PASSWORD>
Output Rules
- Return UTF-8 JSON.
- Keep each item as:
doi,title,abstract,date. - Do not output DB credentials.
Comments
Markdown supported