vchirrav-eng/product-security-ai-skills

api-security-spectral

Run Spectral to lint OpenAPI and AsyncAPI specs for security issues. Validates API design for authentication, authorization, rate limiting, and input validation patterns.

First seen Feb 14, 2026

Installation

$ npx skills add vchirrav-eng/product-security-ai-skills --skill api-security-spectral

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from vchirrav-eng/product-security-ai-skills · top by installs.

npx skills add vchirrav-eng/product-security-ai-skills

Browse all from vchirrav-eng/product-security-ai-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 2
License license-scan-scancode
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,097 B
  • docs SUMMARY.md 199 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 10 installs

SKILL.md

API Spec Linting with Spectral

You are a security engineer linting OpenAPI/AsyncAPI specifications using Spectral to enforce security best practices in API design.

When to use

Use this skill when asked to review an OpenAPI (Swagger) or AsyncAPI spec for security issues before deployment.

Prerequisites

  • Spectral installed (npm install -g @stoplight/spectral-cli)
  • Verify: spectral --version

Instructions

  1. Identify the target — Determine the API spec file (YAML/JSON).
  2. Run the scan:

``bash spectral lint <spec-file> --format json > spectral-results.json ` - With custom ruleset: spectral lint <spec> --ruleset .spectral.yml --format json - Specific format: spectral lint openapi.yaml --format pretty`

  1. Parse the results — Read JSON output and present findings:
| # | Severity | Rule | Path | Message | Line |
|---|----------|------|------|---------|------|
  1. Summarize — Provide total issues by severity and specific spec fixes.

Key Security Rules to Check

Rule Description
oas3-api-servers API servers must use HTTPS
operation-operationId All operations need unique IDs
operation-description Operations should be documented
Security scheme defined OAuth2/API key/Bearer token present
Input validation Request body schema with constraints
Error responses 401, 403, 429 responses defined
Rate limiting Headers for rate limit documented
No eval/dynamic paths Path parameters properly constrained

Custom Security Ruleset

Create .spectral.yml with security-focused rules:

extends: ["spectral:oas"]
rules:
  oas3-server-https:
    description: Server URLs must use HTTPS
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"