spectral
Use when configuring Spectral for API linting, creating custom rulesets, and validating OpenAPI or AsyncAPI specifications
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when configuring Spectral for API linting, creating custom rulesets, and validating OpenAPI or AsyncAPI specifications
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when writing Vague (.vague) files that need realistic test data using faker generators for names, emails, addresses, dates, and more
Use when writing Vague (.vague) files - a declarative language for generating realistic test data with superposition, constraints, and cross-references
Use when working with JSON Schema for validation, including draft-07, 2019-09, and 2020-12 specifications
Use when adding syntax highlighting for custom languages to Prism.js, used by Docusaurus and many documentation sites
Use when developing TypeScript npm packages including tsconfig, package.json exports, dual CJS/ESM builds, and publishing
Use when writing or modifying Vitest tests to follow best practices for test structure, assertions, mocking, and coverage
| name | spectral |
| description | Use when configuring Spectral for API linting, creating custom rulesets, and validating OpenAPI or AsyncAPI specifications |
# .spectral.yaml
extends: spectral:oas
rules:
operation-operationId: error
info-contact: warn
oas3-api-servers: off
spectral:oas, spectral:asyncapi)error, warn, info, hint, or off to disablerules:
must-have-description:
description: All operations must have descriptions
given: $.paths[*][get,post,put,patch,delete]
severity: error
then:
field: description
function: truthy
path-must-be-kebab-case:
given: $.paths[*]~
then:
function: pattern
functionOptions:
match: "^(/[a-z0-9-]+)+$"
truthy / falsy - Value exists / is emptypattern - Regex matchinglength - String/array length constraintsenumeration - Value in allowed listschema - Validate against JSON Schemaalphabetical - Keys in orderundefined - Property must not existspectral lint openapi.yaml
spectral lint openapi.yaml --ruleset .spectral.yaml
spectral lint openapi.yaml -f json # JSON output