.agents/skills/debug-oas/SKILL.md
Use node ./scripts/validate_oas_docs.js to validate Kibana OAS, but always scope output with --path so developers can focus on the API area they are actively changing.
Use this skill when the developer needs issue breakdown, categorization, or representative examples. For quick pass/fail only, use validate-oas first.
If results look stale or surprising, refresh generated OAS first using the environment setup flow in validate-oas. Treat stale oas_docs as a setup problem, not a debugging conclusion.
The validator can surface two broad categories of issues:
structural: invalid OAS problems that usually block correctness, such as schema violations, invalid shapes, unresolved references, or mismatches between path definitions and the spec structure.quality: documentation completeness problems such as missing description, summary, example, or examples.When reporting results, always separate these categories. Lead with structural issues first.
/api/fleet/agent_policies).validate-oas.--path filters.structural vs quality.Do not skip questions (1) and (2) unless the developer already provided the API paths.
Use normal route-style API paths for --path (human-readable):
/api/fleet/agent_policies/internal/fleet/outputsDo not manually convert to JSON pointers. The CLI handles conversion for error filtering internally.
Multiple path filters are supported:
node ./scripts/validate_oas_docs.js \
--path /api/fleet/agent_policies \
--path /internal/fleet/outputs
Default scoped validation:
node ./scripts/validate_oas_docs.js --only traditional --path <api_route_prefix>
Scope to one offering when requested:
node ./scripts/validate_oas_docs.js --only traditional --path <api_route_prefix>
node ./scripts/validate_oas_docs.js --only serverless --path <api_route_prefix>
Default behavior:
--only traditional so validation runs against a single OAS output file.--only traditional by default because it matches the common local debugging path and keeps output narrower.--only serverless only when the developer explicitly asks for it.Optional structural-only summary when the raw output is noisy:
node ./scripts/validate_oas_docs.js --only traditional --path <api_route_prefix> 2>&1 \
| node .agents/skills/debug-oas/scripts/extract_structural_oas_issues.js
If the developer wants to keep documentation issues in that helper output:
node ./scripts/validate_oas_docs.js --only traditional --path <api_route_prefix> 2>&1 \
| node .agents/skills/debug-oas/scripts/extract_structural_oas_issues.js --include-docs
Only use the helper summary as a supplement. Keep the raw validator output available for exact debugging.
Classify issues using these defaults:
quality:
descriptionsummaryexampleexamplesstructural:
Heuristic:
description, summary, example, or examples, treat it as quality.structural unless the developer explicitly asks for a finer split.Severity guidance:
structural = blocking invalid OASquality = docs completeness or polish problemsIf a run mixes both categories, report structural counts first, then quality counts.
If the initial scope is noisy, narrow in this order:
/api/fleet/api/fleet/epm/api/fleet/epm/packagesSuggest narrower scopes when one area dominates the structural issues.
Found N errors in ... as the source of truth for issue count.--path scope.Structural issues (invalid OAS): ...Quality issues (docs gaps): ...--skip-printing-issues) when debugging.--path prefix.When summarizing, use this shape:
Total issues: N
Structural issues: X
Quality issues: Y