agentleFS
tiangong-aitiangong-ai/agent-skills/fetch-meta-to-kb/SKILL.md

fetch-meta-to-kb

Skill11 starsChanged 3 months agoMITView on GitHub

Fetch journal articles from Crossref published after a user-specified date and insert them into PostgreSQL `journals` with DOI deduplication. Use when incrementally ingesting journal metadata from `journals_issn` into `journals`.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read ISSN seed rows from journals_issn (journal, issn1).

    line 10
  2. Very specific:

    Keep the implementation aligned with fetch_meta_to_kb.py.

    line 12
  3. Distinctive:

    Run incremental fetch with a required date:

    line 23
  4. Very specific:

    If executing through an exec tool call, set timeout to 1800 seconds (30 minutes).

    line 29
  5. Very specific:

    Prefer RUN_SUMMARY_JSON emitted by fetch_meta_to_kb.py.

    line 35
  6. Very specific:

    If JSON is unavailable, parse only this run's ${KB_LOG_DIR}/fetch-meta-to-kb-YYYYMMDD-HHMMSS.log.

    line 36
  7. Very specific:

    Keep only items whose container-title equals target journal title (case-insensitive).

    line 42
  8. Very specific:

    Do not compute announcement counts via database-wide or time-window SQL such as WHERE date >= ....

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fetch Meta to KB

Core Goal

  • Pull journal-article records from Crossref after a given --from-date.
  • Read ISSN seed rows from journals_issn (journal, issn1).
  • Insert rows into journals with ON CONFLICT (doi) DO NOTHING.
  • Keep the implementation aligned with fetch_meta_to_kb.py.

Run Workflow

  1. Set database connection env vars (user-managed keys prefixed with KB_):
  • KB_DB_HOST
  • KB_DB_PORT
  • KB_DB_NAME
  • KB_DB_USER
  • KB_DB_PASSWORD
  • KB_LOG_DIR (required, log output directory)
  1. Run incremental fetch with a required date:
python3 scripts/fetch_meta_to_kb.py --from-date 2024-05-01
  • If executing through an exec tool call, set timeout to 1800 seconds (30 minutes).
  1. Check logs in:
  • ${KB_LOG_DIR}/fetch-meta-to-kb-YYYYMMDD-HHMMSS.log (UTC timestamp, one file per run)
  1. Build user-facing summary strictly from the current run output:
  • Prefer RUN_SUMMARY_JSON emitted by fetch_meta_to_kb.py.
  • If JSON is unavailable, parse only this run's ${KB_LOG_DIR}/fetch-meta-to-kb-YYYYMMDD-HHMMSS.log.
  • total_inserted must mean rows inserted in this run (after DOI dedup), not cumulative rows in table.

Behavior Contract

  • Query Crossref endpoint: https://api.crossref.org/journals/{issn}/works.
  • Filter with type:journal-article,from-pub-date:<from-date>.
  • Keep only items whose container-title equals target journal title (case-insensitive).
  • Continue pagination with cursor until no matching items remain.
  • Store fields in journals: title, doi, journal, authors, date, abstract (nullable when Crossref has no abstract).
  • Reporting/announcement metrics must use current-run log/summary only.
  • Do not compute announcement counts via database-wide or time-window SQL such as WHERE date >= ....

Scope Boundary

  • Implement only Crossref incremental fetch + insert into journals.

Script

  • scripts/fetch_meta_to_kb.py

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.