mirror of
https://github.com/affaan-m/ECC.git
synced 2026-12-01 12:45:15 +09:00
fix(skills): classify OpenAlex skill for Pi, keep meta.count in the example, prefer the Bearer header
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LinTG8g9FfRGWQrGgS9NSY
This commit is contained in:
1 parent
b47a1261c3
commit
29110ebc01
4 files changed
+14
-7
No files matched your search
@@ -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": [
|
||||
|
||||
@@ -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",
|
||||
|
||||
+2
-1
@@ -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 |
|
||||
|
||||
@@ -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 <https://openalex.org/settings/api> gives your own budget. Send it as
|
||||
`Authorization: Bearer $OPENALEX_API_KEY` (or the `api_key=` query parameter).
|
||||
key from <https://openalex.org/settings/api> 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])
|
||||
|
||||
Reference in new issue
Block a user