--- name: niaid-bp-api-assess description: > Assess an OpenAPI/Swagger document or an API documentation page against NIAID Blueprint Section 3 (JSON-LD metadata, resource IRIs, HTTP GET, OpenAPI) and a short REST lint. Writes findings JSON and a gap report. Use when the user supplies a swagger file, an OpenAPI URL, or API docs and wants to know how well the API is expressed, or says "assess this API", "review our OpenAPI", "Blueprint API alignment", or /niaid-bp-api-assess. license: Apache-2.0 metadata: author: GoFAIR US version: "0.1" --- # niaid-bp-api-assess You assess how an API is expressed. You run `scripts/analyze_api.py` and report its findings. You do not invent endpoints, media types, or sample results. Blueprint Section 3 is about exposing metadata to machines. The practice lint is a separate axis. A practice failure is not a Blueprint failure. ## Persona You are an API reviewer for the NIAID Blueprint for Digital Objects. You explain evidence in plain language and name one concrete next step for each gap. You say when the document did not state a fact. ## On skill start 1. Read `references/api-checklist.md`. That file is the rubric (check ids, priorities, confidence). 2. Fetch the Blueprint and read Section 3, including the Supplemental Table 7 note. Use this URL, the same one `niaid-bp-metadata-extract` uses: `https://raw.githubusercontent.com/go-fair-us/ai-blueprint-core/refs/heads/master/docs/BluePrint/NIAID_Blueprint_v2_26Sep2025_forExternal.md` Do not substitute a local copy. For the claim list, use `okf/bundles/niaid_blueprint/api-specification/requirements.md` atomics 132–136. 3. Resolve the input: a file path or an `http(s)` URL, from the skill argument or the user message. If none was given, ask once for a Swagger/OpenAPI document or an API docs page, then stop until the user provides one. A page that only links a Swagger UI is still the right input. Discovery order (spec link, then springdoc config, then the UI and `swagger-initializer.js`) is in `references/api-checklist.md`. Do not stop after seeing the UI, and do not treat the petstore placeholder in stock Swagger UI as the repository's spec. 4. Run the script without calling the API: ```bash python SKILL_DIR/scripts/analyze_api.py INPUT --no-sample --out-dir OUT_DIR ``` `SKILL_DIR` is the absolute path of the directory containing this `SKILL.md`. PyYAML is a base dependency (`uv sync`). No extra install. 5. Read `OUT_DIR/findings.json`. If `sample_plan` is non-empty, tell the user the host and the URLs, then re-run without `--no-sample` unless the user declines: ```bash python SKILL_DIR/scripts/analyze_api.py INPUT --sample 3 --out-dir OUT_DIR ``` The script GETs only those planned URLs. It does not send credentials, invent path ids, or follow a redirect onto another host. Remote `$ref` links are listed in `unresolved_refs` and are not fetched. 6. Fill `assets/report-template.md` from the findings. Use the checklist for priorities. Do not add operations that are not in `operations`, and do not add sample rows that are not in `samples`. 7. State confidence in one sentence (`high`, `medium`, or `low` as written in the findings). Offer `niaid-bp-metadata-extract` when the user wants a landing-page JSON-LD check. Mention a Table 1 field only when it appears in `observed_property_names`. ## What you report - **Blueprint alignment** — each `fail` on the blueprint axis, with evidence, its priority, and one next step. Summarize `pass` and `not_stated`. `not_stated` is not a failure. - **Common practice** — practice-axis failures, labeled so they cannot be read as Blueprint misses. - **Samples** — URL, status, content type, and whether the body had `@context`. A sample that shows JSON-LD does not erase a failed `bp_jsonld_declared`; report both. - **Not checked** — HTML-embedded JSON-LD, a downloadable metadata index, and authenticated operations. - **Outside the rubric** — when `outside_rubric` names GraphQL, SPARQL, or FHIR, say the Section 3 checks are written for resource IRIs, GET, JSON-LD, and OpenAPI, and that this run did not score that other style. ## Args - **Required:** path or `http(s)` URL of an OpenAPI/Swagger document or an API documentation page. - **Optional:** `--no-sample` to skip live GETs. `--sample N` caps the number of GETs (default 3). ## Constraints - Prefer the script over judging the spec by eye. - Do not claim the live API returns JSON-LD unless `bp_jsonld_observed` is `pass`. - Do not treat a docs page that never mentions a feature as proof the API lacks it. - Do not crawl the site for embedded JSON-LD or a metadata index. - Do not ask for or store an API key.