/elastic-docs-skills:docs-check-kibana-oas <pr-number-or-url>from elastic-docs-skills
Reviews a Kibana PR for OpenAPI Spec (OAS) and API docs compliance against Elastic guidelines. Checks availability, summaries, parameters, examples, tags, deprecation, and generated YAML correctness.
Ships in elastic-docs-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are reviewing a Kibana PR from elastic/kibana against the Elastic API docs checklist, core guidelines, and Kibana quickstart. Output a concrete action list. Every item names the file and line to change.
$ARGUMENTS is a PR number or URL. Extract the PR number. Examples:
/docs-check-kibana-oas 289719/docs-check-kibana-oas https://github.com/elastic/kibana/pull/289719/docs-check-kibana-oas https://github.com/elastic/kibana/pull/289719/changesIf no PR number is given, ask for one.
The files under oas_docs/output/ (kibana.yaml, kibana.serverless.yaml) are auto-generated from TypeScript route definitions. CI regenerates them on push. Use the YAML diff to detect problems (missing x-state, wrong stability label, empty values), but every action you output must point at the TypeScript source that generates it. Never suggest manually editing the YAML.
gh pr diff <PR_NUMBER> --repo elastic/kibana
gh pr view <PR_NUMBER> --repo elastic/kibana --json title,body,files,headRefName
Save the full diff. You will scan it multiple times.
Find a local Kibana clone. Check, in order:
kibana repo)~/elastic/kibanaThen check out the PR branch:
cd <KIBANA_DIR> && gh pr checkout <PR_NUMBER>
If no local clone is found at either location, tell the user and ask them for the path to their Kibana checkout.
Read the actual source files from this checkout for exact line numbers. Never compute line numbers from diff hunk headers.
From the diff, sort changed files into:
.ts files under server/routes/ registering router.versioned.* endpoints.ts files with schema.object / schema.maybe / etc. used in route validationoas_docs/output/ — scan for diagnostic signals onlyroutes/examples/Apply every rule from the rules section below against the diff. Use the generated YAML as a cross-check signal. If the YAML looks wrong (missing x-state, empty x-state, wrong label), trace it back to the TypeScript source to find the root cause.
For every finding, read the actual file from the checked-out branch to confirm the exact line number. Point at the line where the developer needs to make the change.
When the PR adds a new route to an existing resource, read the existing routes from the checked-out branch to compare conventions. Look for patterns like narrative doc links, tag usage, or example files that siblings use but the new route does not.
Print a flat action list, then a summary. Be terse. No diagnosis essays.
Every file reference must be a clickable markdown link into the PR's "Files changed" view:
https://github.com/elastic/kibana/pull/<PR_NUMBER>/files#diff-<SHA256_OF_PATH>
Compute the anchor:
echo -n "<full-repo-relative-path>" | shasum -a 256 | cut -c1-64
Link like: [agents.ts:689](https://github.com/elastic/kibana/pull/290353/files#diff-<hash>)
If you cannot compute the hash, link to the PR files page with the bare path.
## OAS review — PR #<NUMBER>
**<PR title>**
### Actions
1. ❌ **Add `stability` to availability** — [agents.ts:689](<link>)
`availability: { since: '9.5.0' }` → `availability: { stability: 'experimental', since: '9.5.0' }`
2. ❌ **Add description for `user_id` path param** — [agents.ts:140](<link>)
Path parameters must have `meta: { description: '...' }`.
3. ❌ **Add narrative doc link** — [attachments.ts:105](<link>)
Sibling conversation routes link to the agent chat docs. Consider adding a similar link.
4. ❌ **Summary exceeds 45 characters** — [agents.ts:684](<link>)
`'Get all agent builder conversation attachments for a user'` → shorten to ~40 chars.
### Passes
- ✅ `summary` and `description` present — [agents.ts:684](<link>)
- ✅ Path params have `meta.description` — [agents.ts:700](<link>)
- ✅ Tags include `oas-tag` — [agents.ts:680](<link>)
- ✅ Example file referenced — [agents_get.yaml](<link>)
### Verdict
**N actions** (X required, Y suggested)
Rules:
These rules come from the Elastic API docs checklist, the core guidelines, the organize and annotate guide, and the Kibana quickstart. They also incorporate conventions observed across existing Kibana routes.
Every new route MUST have availability in its options block with both stability and since. This powers the version badges and tech preview labels in the published API docs.
Valid stability values and their rendered labels:
| Value | Rendered label | Meaning |
|---|---|---|
'experimental' | Experimental | Can change or be removed in future versions |
'tech_preview' | Technical preview | Pre-release, may change |
'stable' | Generally available | Stable for production use (default if omitted, but be explicit) |
since is a version string like '9.2.0'. It marks the version when the API first shipped. It appears in Elastic Stack docs and is omitted from serverless docs.
Correct pattern:
router.versioned.get({
path: '...',
options: {
tags: ['...', 'oas-tag:Agent builder'],
availability: {
stability: 'experimental',
since: '9.6.0',
},
},
})
What to flag:
availability block missing entirelystability missing from availabilitysince missing from availabilitystability has an invalid valueEvery new route MUST have a summary. Summaries appear in IDEs, search results, and documentation overviews.
Summary guidelines:
What to flag:
summary missingEvery new route MUST have a description. Descriptions support markdown formatting and should cover:
A good description adds detail beyond the summary. A bad description just restates it.
Good: 'Create a new conversation with an agent. The conversation persists across sessions and can be shared with other users via access control. To learn more, refer to the [agent chat documentation](https://www.elastic.co/docs/...).'
Bad: 'Creates a conversation.' (restates the summary, adds nothing)
What to flag:
description missingRoute descriptions should include a trailing sentence linking to the relevant narrative docs page. This is a convention observed across existing Kibana routes. It is most important when sibling routes on the same resource already include such a link.
Pattern:
description:
'List all conversations. To learn more, refer to the [agent chat documentation](https://www.elastic.co/docs/...).',
How to check: compare against sibling routes. If other routes on the same resource include a "To learn more..." or "refer to the docs" link and the new route does not, flag it.
What to flag:
Routes MUST have at least one oas-tag: entry in their tags array. Tags group APIs by feature in the published docs.
Tag guidelines:
'oas-tag:Agent builder' not 'oas-tag:agent builder'oas-tag per route for clean navigationWhat to flag:
oas-tag:* in the tags arrayoas-tag: entries on a single routeEvery path parameter MUST have meta: { description: '...' } in its schema definition.
Correct pattern:
params: schema.object({
conversation_id: schema.string({
meta: { description: 'The unique identifier of the conversation.' },
}),
}),
What to flag:
meta or no description inside metaEvery new request body, query, or response property MUST have meta: { description: '...' }.
A good property description explains what the value controls, its format, and any constraints:
'The page size.' — vague, no constraints, no default'The maximum number of results to return. Must be between 1 and 1000. Defaults to 20.'What to flag:
meta at allmeta exists but has no description'The name.' on a property called name)When a property uses schema.oneOf or schema.literal to define a fixed set of values, each value should be described, either in the property description or in the individual schema options.
Skip documenting values that are self-explanatory:
true / false, asc / desc, enabled / disabled — obvious from the nameread / write / admin — not obvious; what does admin grant beyond write?low / medium / high — not obvious; what concretely changes at each level?What to flag:
Optional parameters and properties should document their defaults. In Kibana route schemas, this means using schema.maybe(schema.string({ defaultValue: '...' })) or documenting the server-side default in the description.
Correct pattern:
page_size: schema.maybe(
schema.number({
defaultValue: 20,
meta: { description: 'Number of results per page. Defaults to 20.' },
})
),
When the default is set server-side (not in the schema), document it in the description instead: 'Sort order. The server defaults to descending if not specified.'
How to check: compare against sibling routes on the same resource. If a sibling documents its page_size default but the new route does not, flag it.
What to flag:
When a new property is added to an existing route's schema, and that property ships in a later version than the route itself, the property MUST have its own meta.availability with stability and since.
How to detect: look for added schema.maybe(...) or schema.object(...) fields inside an existing route's validation block. If the route has since: '9.2.0' and the new property ships in '9.6.0', the property needs its own availability.
Correct pattern:
new_field: schema.maybe(
schema.string({
meta: {
availability: { stability: 'experimental', since: '9.6.0' },
description: 'Description of the new field.',
},
})
),
What to flag:
meta.availabilityavailability but is missing stability or sinceDeprecated routes or properties should be marked. In Kibana, the route's options supports a deprecated flag, and property descriptions should explain the deprecation.
What to flag:
deprecated: true markerNew routes SHOULD have an example file referenced via oasOperationObject. Examples significantly improve API documentation usability.
Inline TypeScript examples (type-checked at dev time):
.addVersion({
version: '2023-10-31',
options: {
oasOperationObject: () => ({
requestBody: {
content: {
'application/json': {
examples: {
example1: {
summary: 'An example request',
value: { name: 'Example' } as MyType,
},
},
},
},
},
}),
},
})
YAML file examples:
import path from 'node:path';
.addVersion({
version: '2023-10-31',
options: {
oasOperationObject: () => path.join(__dirname, 'examples/my_route.yaml'),
},
})
Example YAML structure (in server/routes/examples/):
requestBody:
content:
application/json:
examples:
example1:
summary: Example request
description: An example of creating a resource
value:
name: 'Example'
responses:
200:
content:
application/json:
examples:
success:
summary: Successful response
value:
id: '12345'
name: 'Example'
Example guidelines:
x-codeSamples for cURL and Console examplesWhat to flag:
oasOperationObject reference (warning — strongly recommended)Public routes can optionally set an explicit operationId. SDK and CLI generators use this ID as the method/command name; if omitted, the generator derives one from the method and path (for example, post-foo), which is often unclear.
Correct pattern:
router.versioned.post({
path: '/api/foo',
access: 'public',
summary: 'Create a foo resource',
operationId: 'create-foo',
options: { ... },
});
Guidelines:
verb-resource names, for example create-foo, get-foo, delete-foo.This is a suggestion, not a compliance rule — do not add it to the ❌ Actions list or count it against the verdict. Only raise it as a one-line side note ("Consider adding an explicit operationId") when the user specifically asks about SDK/CLI generation, operation IDs, or when a route in the diff already sets one inconsistently with the kebab-case verb-resource convention.
The YAML files under oas_docs/output/ are auto-generated. Never suggest editing the YAML directly. Every fix goes in the TypeScript source.
Use the YAML x-state values to detect problems:
YAML x-state | TypeScript meaning |
|---|---|
Experimental; added in 9.6.0 | availability: { stability: 'experimental', since: '9.6.0' } |
Technical Preview; added in 9.2.0 | availability: { stability: 'tech_preview', since: '9.2.0' } |
added in 9.0.0 (no label) | availability: { stability: 'stable', since: '9.0.0' } |
Experimental (no version) | Normal for kibana.serverless.yaml — serverless omits added in |
'' (empty string) | Missing stability in the TypeScript availability |
| Missing entirely | Missing availability block in the TypeScript |
What to flag (always pointing at the TypeScript file):
x-state → trace to the TS route and flag missing availability or stabilityadded in is expected, not a findingWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub elastic/elastic-docs-skills --plugin elastic-docs-skills25 skills in this plugin
/docs-applies-to-taggingValidate and generate applies_to tags in Elastic documentation, including for cumulative docs across versions and deployment types. Use when writing new docs pages, reviewing existing pages for correct applies_to usage, deciding whether to preserve or replace existing version-scoped content, or when content changes lifecycle state (experimental, preview, beta, GA, deprecated, removed)./docs-check-contradictionsCheck whether newly written or updated documentation contradicts existing content elsewhere in the docs — procedures, concepts, prerequisites, values, names, recommendations, or cross-references — both in the local repo and across all published Elastic docs. Use when the user asks for a contradiction or consistency check on a docs change, or when a docs review runs. Do not trigger on ordinary drafting or editing./docs-check-styleCheck documentation for Elastic style guide compliance using Vale linter output and style rules. Use when the user asks to check, lint, or review docs for voice, tone, grammar, formatting, accessibility, or word choice issues, or when a docs review runs. Do not trigger on ordinary drafting or editing./docs-content-type-checkerCheck a docs-content page against Elastic content type guidelines (overview, how-to, tutorial, troubleshooting, changelog), or classify a proposed page idea against the content types before drafting. Use when the user asks to check content type compliance, validate page structure, review a doc against content type standards, or decide which content type a planned page should use./docs-draft-feature-docsDraft Elastic documentation for any feature or feature area, from a doc issue, a product pull request, or raw notes. Enforces the docs-content baseline on every draft — verify against product source at HEAD, find the canonical home, place content once, scope it cumulatively — and reads per-area reference files for local conventions when they exist. Use when picking up a doc issue, documenting a shipped or upcoming feature, or turning engineering notes into a page./docs-draft-workflow-docsDraft or update Elastic Workflows documentation pages in explore-analyze/workflows/ — step references, use cases, how-tos, concepts, and overviews. Use when writing Workflows docs, documenting a step type, turning workflow YAML into documentation, drafting from a doc issue in docs-content or docs-content-internal, or creating a new page under the Workflows docset.Other plugins' skills for the same job