Openapi spec reviewer
Skill hmcts/apim-claude-template/skills/openapi-spec-reviewer/skills/openapi-spec-reviewer
Use when the user wants to review, audit, or check an OpenAPI v3 spec — applies HMCTS data-sharing policy (UK GDPR/DPA 2018), infrastructure SLA (Azure APIM/AKS), API standards, and security standards (OAuth 2, TLS, input validation). Returns a scored report with Critical/Warning/Info findings.From its SKILL.md
npx -y skills add hmcts/apim-claude-template --skill openapi-spec-reviewerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.7 KB, as published. Nobody here has run it
Skill: OpenAPI Spec Reviewer
Trigger
Invoke this skill when a user provides an OpenAPI v3.x specification (YAML or JSON) and asks for a review, audit, or policy check.
Invocation command: /openapi-spec-reviewer
Prerequisites
Before beginning the review, load and internalise the following knowledge documents as active review lenses. They define the policy constraints against which the spec will be assessed.
Paths are relative from the invoking repo root (repos are siblings of apim-claude-template):
../../apim-claude-template/skills/openapi-spec-reviewer/knowledge/data-sharing-policy.md../../apim-claude-template/skills/openapi-spec-reviewer/knowledge/infrastructure-sla.md../../apim-claude-template/skills/openapi-spec-reviewer/knowledge/api-standards.md../../apim-claude-template/skills/openapi-spec-reviewer/knowledge/security-standards.md
Input Handling
Version Guard
Check the openapi field at the root of the document.
-
If the version is
2.x(i.e. a Swagger/OAS2 spec), stop immediately and respond:Unsupported specification version. This skill only supports OpenAPI 3.x and higher. The provided specification declares
openapi: <detected-version>, which is OpenAPI v2 (Swagger). Please upgrade your spec to OpenAPI 3.0.x or 3.1.x before requesting a review. -
If the
openapifield is absent or the document cannot be parsed, respond:Parse error. The provided input could not be read as a valid OpenAPI document. Please check that:
- The document is valid YAML or JSON
- The root-level
openapifield is present (e.g.openapi: "3.0.3") - All
$refvalues point to resolvable locations
Paste the corrected spec and re-run
/openapi-spec-reviewer. -
If the document is structurally parseable but incomplete (e.g. missing
info,paths, orcomponents), continue the review but flag each missing section as a Critical finding under the relevant lens.
Review Process
Apply each of the four lenses in sequence. For every issue found, record a finding using the structure defined in the Output Format section below.
Lens 1 — Data Sharing Policy
Source: knowledge/data-sharing-policy.md
Review the spec for:
- Presence and correctness of data classification markers in descriptions
- Exposure of personally identifiable information (PII) or sensitive case data in path parameters, query parameters, request bodies, or response schemas
- Missing or inadequate descriptions on fields that carry personal data
- Absence of consent or lawful basis statements where required by policy
- Use of
additionalProperties: trueon schemas that may leak sensitive fields - Logging or tracing fields that could inadvertently capture PII
Lens 2 — Infrastructure SLA
Source: knowledge/infrastructure-sla.md
Review the spec for:
- Declared or missing timeout values relative to SLA targets per endpoint category
- Rate limiting headers (
X-RateLimit-*,Retry-After) absent from responses - Missing
429 Too Many Requestsand503 Service Unavailableresponse definitions on endpoints subject to SLA constraints - Response time expectations not communicated via documentation or extensions
- Bulk or streaming endpoints that lack pagination or chunking controls which could breach SLA targets under load
Lens 3 — HMCTS API Standards
Source: knowledge/api-standards.md
Review the spec for:
info.title,info.version, andinfo.contact.emailcompleteness- API versioning approach: version in media type (
application/vnd.hmcts.*+json;version=N) rather than in the URL path - Endpoint naming: lowercase, hyphen-separated, noun-based, no verbs in paths
operationIdvalues: present, unique, camelCase, descriptive- HTTP method semantics: correct use of GET/POST/PUT/PATCH/DELETE
- Consistent error response schema across all
4xx/5xxresponses - Pagination patterns on collection endpoints (
GET /resources) - Required response codes present for each operation (at minimum: success +
400+500) - Tag usage: all operations tagged; tags correspond to resource domains
$refusage: shared schemas extracted tocomponents/schemas
Lens 4 — Security Standards
Source: knowledge/security-standards.md
Review the spec for:
- Presence of a
securitySchemesdefinition incomponents - Global or per-operation
securitydeclarations — flag any operation with no security applied unless explicitly justified (e.g. health check) - Use of OAuth 2.0 / OIDC flows appropriate to the HMCTS context
- Absence of API key schemes passed as query parameters (must use headers)
- HTTPS enforced in all
servers[*].urlentries — flaghttp://URLs - Sensitive data (tokens, credentials, case references) not present in path parameters where they would be logged by infrastructure
- Input validation:
pattern,minLength/maxLength,minimum/maximumconstraints present on fields that accept user-supplied data - Missing
401 Unauthorizedand403 Forbiddenresponses on secured operations
Output Format
Structure the report as follows:
OpenAPI Spec Review Report
Spec title: <info.title>
Spec version: <info.version>
OpenAPI version: <openapi field value>
Review date: <today's date>
Lens 1: Data Sharing Policy
| Severity | Location | Issue | Recommended Fix |
|---|---|---|---|
| Critical / Warning / Info | paths./example/{id}.get > parameters[0] | Description of issue | What to change |
(Repeat rows for each finding. If no issues: "No issues found.")
Lens 2: Infrastructure SLA
| Severity | Location | Issue | Recommended Fix |
|---|---|---|---|
| ... | ... | ... | ... |
Lens 3: HMCTS API Standards
| Severity | Location | Issue | Recommended Fix |
|---|---|---|---|
| ... | ... | ... | ... |
Lens 4: Security Standards
| Severity | Location | Issue | Recommended Fix |
|---|---|---|---|
| ... | ... | ... | ... |
Summary
| Lens | Verdict | Critical | Warning | Info |
|---|---|---|---|---|
| Data Sharing Policy | PASS / FAIL | N | N | N |
| Infrastructure SLA | PASS / FAIL | N | N | N |
| HMCTS API Standards | PASS / FAIL | N | N | N |
| Security Standards | PASS / FAIL | N | N | N |
Overall Readiness Score: XX / 100
Score calculation:
- Start at 100
- Deduct 10 points per Critical finding
- Deduct 3 points per Warning finding
- Deduct 1 point per Info finding
- Minimum score is 0
A lens is PASS if it has zero Critical findings. A lens is FAIL if it has one or more Critical findings.
Next Steps
List the top three highest-priority actions the API author should take before this spec is considered ready for publication, based on the findings above.
Severity Definitions
| Severity | Meaning |
|---|---|
| Critical | Blocks publication. Violates a mandatory policy, security requirement, or HMCTS standard. Must be resolved before the spec is approved. |
| Warning | Should be resolved before publication. Indicates a gap in policy compliance or best-practice deviation that carries meaningful risk. |
| Info | Improvement opportunity. Does not block publication but would improve quality, consistency, or future maintainability. |