From 29110ebc01a6829ef5d36ae59d1faa587f374507 Mon Sep 17 00:00:00 2001 From: Jason Priem Date: Fri, 16 Oct 2026 09:48:11 -0500 Subject: [PATCH] fix(skills): classify OpenAlex skill for Pi, keep meta.count in the example, prefer the Bearer header Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LinTG8g9FfRGWQrGgS9NSY --- manifests/context-packs/skill-triggers@1.json | 2 +- manifests/pi-core.json | 1 + pi/core/CURATION.md | 3 ++- skills/scientific-db-openalex-database/SKILL.md | 15 ++++++++++----- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/manifests/context-packs/skill-triggers@1.json b/manifests/context-packs/skill-triggers@1.json index 888e30acc..576fa8c66 100644 --- a/manifests/context-packs/skill-triggers@1.json +++ b/manifests/context-packs/skill-triggers@1.json @@ -10,7 +10,7 @@ "id": "hand-seeded", "source": "manual-curation-pending-regeneration" }, - "registryDigest": "a9a1611c040a44f80e50133e71dba998e06c6a14b44167194a634b702aa7a8cd", + "registryDigest": "62c9c3ca847fc896a5e56d692da0729b6b967332298570d79736ef4ebccd3161", "schemaVersion": 1, "triggers": { "skill:agent-runtime-gateway-smoke-test": [ diff --git a/manifests/pi-core.json b/manifests/pi-core.json index 80f352db7..8eb46a5e3 100644 --- a/manifests/pi-core.json +++ b/manifests/pi-core.json @@ -303,6 +303,7 @@ "rules-distill": "Claude-Code-only rules distillation mechanics", "safety-guard": "Claude-Code-only PreToolUse hooks", "santa-method": "multi-agent adversarial review roster", + "scientific-db-openalex-database": "scientific niche domain pack", "scientific-db-pubmed-database": "scientific niche domain pack", "scientific-db-uspto-database": "scientific niche domain pack", "scientific-pkg-gget": "scientific niche domain pack", diff --git a/pi/core/CURATION.md b/pi/core/CURATION.md index a6e8d3ac0..2f46da285 100644 --- a/pi/core/CURATION.md +++ b/pi/core/CURATION.md @@ -1,6 +1,6 @@ # Curation -pi/core includes 132 of 311 skills and 24 of 97 commands from the root of ECC. +pi/core includes 132 of 312 skills and 24 of 97 commands from the root of ECC. Everything excluded is listed here with its reason. ## Rules @@ -153,6 +153,7 @@ Exclude anything that: | `rules-distill` | Claude-Code-only rules distillation mechanics | | `safety-guard` | Claude-Code-only PreToolUse hooks | | `santa-method` | multi-agent adversarial review roster | +| `scientific-db-openalex-database` | scientific niche domain pack | | `scientific-db-pubmed-database` | scientific niche domain pack | | `scientific-db-uspto-database` | scientific niche domain pack | | `scientific-pkg-gget` | scientific niche domain pack | diff --git a/skills/scientific-db-openalex-database/SKILL.md b/skills/scientific-db-openalex-database/SKILL.md index 4a0080dd7..7f0304c34 100644 --- a/skills/scientific-db-openalex-database/SKILL.md +++ b/skills/scientific-db-openalex-database/SKILL.md @@ -29,8 +29,9 @@ For MeSH-driven biomedical searches, prefer `scientific-db-pubmed-database`. - Base URL: `https://api.openalex.org`. No key is needed to start. - Requests without a key share a small free daily budget per IP address. A free - key from gives your own budget. Send it as - `Authorization: Bearer $OPENALEX_API_KEY` (or the `api_key=` query parameter). + key from gives your own budget. Send it in + the `Authorization: Bearer $OPENALEX_API_KEY` header, which keeps it out of + URLs and logs. - Looking up a single work by ID or DOI is free; searches and lists cost a small amount of the daily budget. - Store keys in environment variables, never in committed files. @@ -97,13 +98,15 @@ def abstract(inverted_index: dict | None) -> str: return " ".join(positions[i] for i in sorted(positions)) -def search_works(query: str, filters: str = "", per_page: int = 25) -> list[dict]: +def search_works(query: str, filters: str = "", per_page: int = 25) -> tuple[int, list[dict]]: + """Return (total matching works, first page of results); log the total.""" params = {"search": query, "per_page": per_page, "select": FIELDS} if filters: params["filter"] = filters response = requests.get(f"{BASE}/works", params=params, headers=headers(), timeout=30) response.raise_for_status() - return response.json()["results"] + data = response.json() + return data["meta"]["count"], data["results"] def get_work_by_doi(doi: str) -> dict | None: @@ -119,7 +122,9 @@ def get_work_by_doi(doi: str) -> dict | None: return response.json() -for work in search_works("kelp forest decline", "publication_year:2020-2026,open_access.is_oa:true", 5): +count, works = search_works("kelp forest decline", "publication_year:2020-2026,open_access.is_oa:true", 5) +print(f"{count} matching works") +for work in works: venue = ((work.get("primary_location") or {}).get("source") or {}).get("display_name") print(work["publication_year"], work["display_name"], venue, work["doi"]) print(abstract(work["abstract_inverted_index"])[:300])