/nightvision:source-intelligencefrom nightvision
Guide for agents to help users extract OpenAPI specs from source code using NightVision Source Intelligence. Use when running openapi extract (also spelled swagger extract), identifying framework support, troubleshooting extraction, handling unresolved variables, comparing API specs, or understanding Code Traceback.
Ships in nightvision. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill when helping users generate OpenAPI specifications from their source code using nightvision openapi extract. Source Intelligence reads the source locally and deterministically (no running application or compilation needed, no source code uploaded, no LLM reads the code) and annotates the spec with source file paths and line numbers (Code Traceback) so that vulnerabilities found during DAST scans trace back to exact code locations.
The nightvision openapi command group needs CLI 0.18.0 or later. On an earlier release (nightvision version), use nightvision swagger in its place; later releases accept both names. --no-target needs CLI 0.19.0 or later; on an earlier release, use --no-upload in its place.
When a user asks to extract or document their API:
nightvision --help)--lang only to restrict a run to one languagenightvision openapi extract with the appropriate flags, using --no-target if the user has no target yet (see Choosing where the spec goes). On success, the CLI prints "OpenAPI file extracted successfully." and writes the spec to the output path (default: openapi-spec.yml)nv.confignightvision openapi diff to show what was discovered vs. what was documentedRelated skills: Use scan-configuration for target/auth setup, ci-cd-integration for pipeline integration, scan-triage for interpreting scan results.
--lang is optional: the CLI detects project roots and languages automatically. Use it only to restrict a run to one language.
| Language | --lang value | Frameworks (verified with CLI 0.22.7 and later) |
|---|---|---|
| Python | python | Django REST Framework, Flask, Flask-RESTful, FastAPI, Starlette, Connexion; Django URLconf (with gaps) |
| Java | java | Spring Boot MVC, Spring Data REST, Spring Boot Actuator, JAX-RS/Jersey (javax and jakarta), Micronaut, Quarkus, Dropwizard; Spring WebFlux annotated controllers |
| JavaScript/TypeScript | js | Express 4 and 5, NestJS, Fastify, Hono; oRPC (with gaps) |
| C# | csharp | ASP.NET Core controllers, Minimal APIs (incl. MapGroup), ASP.NET Web API 2 |
| Go | go | net/http (Go 1.22+ method patterns), Gin, Echo, Fiber v2 and v3, chi, gorilla/mux; httprouter (with gaps) |
| PHP | php | Laravel |
| Ruby | ruby | Rails; Grape (partial) |
Not supported today (0 routes): aiohttp, Sanic, Tornado, Litestar, Quart, Koa, hapi, Restify, AdonisJS, Next.js route handlers, Spring WebFlux functional RouterFunction, Javalin, Vert.x, Struts, NancyFX, ServiceStack, FastEndpoints, Carter, fasthttp, Sinatra, Hanami, Symfony, Slim, Lumen. For these, scan the running app with the crawler, upload an existing spec, or record traffic instead (see scan-configuration).
The CLI also accepts the aliases dotnet (C#) and typescript (JavaScript/TypeScript); the MCP run-source-intelligence tool accepts the same values. Plain Java servlets, Kotlin sources, and .jsx/.tsx files are not read; .mjs, .cjs, .mts and .cts are read alongside .js and .ts. A project needs its normal skeleton to be detected: config/application.rb for Rails, a .csproj for C#, a main.ts with NestFactory for NestJS. See references/framework-support.md for what to check in the output per framework and for component coverage, and the Framework Support Index for the published matrix.
# Try extraction before creating a target (output defaults to openapi-spec.yml);
# languages and project roots are detected automatically
nightvision openapi extract . --no-target
# Restrict a repository with several languages to one of them
nightvision openapi extract . --lang js --no-target
# Specify output file and format
nightvision openapi extract . -o api-spec.json --file-format json --no-target
# Extract and upload directly to a NightVision target
nightvision openapi extract . -t my-api -p my-project --lang python
# Upload nothing, when code-derived files must not leave the machine
nightvision openapi extract . -o openapi-spec.yml --lang java --no-upload
# Scan multiple source directories
nightvision openapi extract ./service-a ./service-b --lang python --no-target
# Extend an existing spec (add discovered endpoints to it)
nightvision openapi extract . --lang python --extend existing-spec.yml --no-target
# Exclude directories from analysis
nightvision openapi extract . --lang python --exclude vendor,generated --no-target
# Include code snippets in the spec (useful for debugging)
nightvision openapi extract . --lang python --dump-code --no-target
Every run needs one of these, or it fails with no target given:
| Flags | Use when |
|---|---|
-t / -T (target name / UUID) | The user has an API target to scan; the spec is uploaded to NightVision and to the target |
--no-target | The user has no target yet, is trying Source Intelligence, or wants to review the spec first |
--no-upload | The user says code-derived files must not leave their machine |
Default to --no-target when there is no target; do not reach for --no-upload just because there is no target. With --no-target the spec is still uploaded to NightVision, just not to a target; --no-upload uploads nothing. --no-target cannot be combined with -t or -T. Without a target, the spec carries a default title and server instead of the target's name and URL.
Extraction exits non-zero when it finds no routes, for example on an unsupported framework, and also when the spec was written but the upload failed. Guard against both in pipelines without hiding the result: fall back to a backup spec only when no spec was written, keep the diagnostics file as a build artifact, and print why the fallback was taken.
if ! nightvision openapi extract . -t $TARGET; then
if [ -e openapi-spec.yml ]; then
echo "Spec extracted but the upload failed; keeping openapi-spec.yml"
else
echo "Source Intelligence produced no spec; see openapi-spec.diagnostics.json"
cp backup-openapi-spec.yml openapi-spec.yml
fi
fi
The same openapi extract run can write two more reports. Both are written beside the spec and are uploaded with it unless --no-upload is given.
# Weak and quantum-vulnerable cryptography: algorithms, modes, key sizes and JWT settings in
# Python and JavaScript code, plus committed keys, certificates and TLS configuration in any language
nightvision openapi extract . -t my-api -p my-project --weak-crypto
# Hardcoded credentials (redacted report: <output>-credentials.json holds no credential value)
nightvision openapi extract . --no-target --credentials
# Seal found credentials to your own public key instead (the sealed file is never uploaded)
nightvision openapi extract . --no-target --credentials-key ./my-public-key.pem
-t), the --weak-crypto report is stored with that target and appears on the target's Quantum readiness tab in the web app next to the runtime findings from scans (CLI 0.22.5 or later; JavaScript code analysis needs CLI 0.22.7 or later).--root-path (set it to the repository's top level), --lang, --exclude and import settings. A narrower run resolves findings it never looked at; a run from another root re-reports everything as new. If quantum readiness is off for the organization, the upload is refused with a message and the extract still succeeds.x-nv-dast-sinks: [llm-query] (and llm-tool-call when tools are passed). When that spec is uploaded to a target, those routes fill the target's LLM Endpoints list automatically, so scans keep ordinary attack payloads off them. See scan-configuration for AI endpoint scanning.When static analysis can't resolve a variable (e.g., an API prefix read from an environment variable), it appears as a literal placeholder in the spec. NightVision generates an nv.config file to fix this.
Steps:
nv.config is created in the first detected project root, which need not be the spec's directorynv.config — find the replacements object with null valuesnull with the actual values (check the app's config files, environment vars, etc.)nv.config and substitutes the values. You can also use -c / --config to explicitly specify the config file path: nightvision openapi extract . --lang python -c path/to/nv.config --no-target// nv.config example
{
"replacements": {
"Microsoft.AspNetCore.Builder.WebApplication.Services...ApiPrefix": null
}
}
The agent should help the user find the actual value by searching their config files (appsettings.json, .env, settings.py, etc.) and updating nv.config.
Use openapi diff to measure coverage or detect breaking changes:
# Summary diff (paths and schemas counts)
nightvision openapi diff original-spec.yml discovered-spec.yml
# Show only path-level changes (endpoints added/removed/modified)
nightvision openapi diff original-spec.yml discovered-spec.yml --paths
# Show only schema changes
nightvision openapi diff original-spec.yml discovered-spec.yml --schemas
# Show the full diff (paths and schemas together, with details)
nightvision openapi diff original-spec.yml discovered-spec.yml --full-diff
# Save diff output to file
nightvision openapi diff original-spec.yml discovered-spec.yml -o diff-report.txt
Common use cases:
openapi detect lists the project roots and languages that extraction would analyze; it does not find existing OpenAPI/Swagger files, so search the filesystem for those. The detect command takes no positional arguments — use -p to specify the root folder:
# Detect project roots in the current directory
nightvision openapi detect
# Detect in a specific directory
nightvision openapi detect -p ./path/to/code
# Save detection results as JSON
nightvision openapi detect -o detection-results.json
The generated spec includes x-source annotations on each endpoint with the file path and line number where the route is declared. When this spec is used for DAST scanning:
This is why using NightVision-generated specs (vs. hand-written ones) significantly improves the triage experience.
Every run that returns analysis results writes a diagnostics file beside the requested output, with the output's extension replaced (openapi-spec.yml gets openapi-spec.diagnostics.json). It is written even when no route was found. Summarize it with openapi diagnose, which runs offline and needs no login:
nightvision openapi diagnose openapi-spec.yml
Read it in this order:
Result and Roots: which project roots and languages were detected, and how many files, entry points and paths each root contributed. no file interpreted: <language> means the language was detected but no source of it was read (for example a Kotlin project detected as Java).Unresolved imports, group framework: imports of a web framework the analyzer does not model. This group is filled for Python, PHP and C#; for the other languages look through third-party for a framework name (for example koa, github.com/kataras/iris, sinatra).Containment: a recovered framework, handler or language-phase failure means part of the result is missing.Losses: discoveries the analyzer knowingly dropped.For C# projects the diagnostics file also lists unmodeledFrameworks, the web packages a project references that the analyzer does not model.
| Issue | Cause | Fix |
|---|---|---|
| No endpoints found | Unsupported framework, a project root that was not detected, or --lang restricting the run to the wrong language | Run nightvision openapi diagnose <output> and check the roots table and the unresolved framework imports; omit --lang to let the CLI detect languages; check the support matrix |
| Unresolved variables in paths | Config values read from env vars without defaults | Fill in nv.config replacements and re-run |
| Incomplete routes | Custom routing, non-standard framework usage | NightVision relies on standard framework patterns; custom routing may not be detected |
| Extraction fails entirely | Syntax errors in source, missing files | Read the CLI log, and the diagnostics file beside the requested output if the run wrote one (the output's extension is replaced, so openapi-spec.yml gets openapi-spec.diagnostics.json); --diagnostics only embeds a summary in a generated spec |
| Spec missing sub-routes | Code in subdirectories not scanned | Pass multiple paths: nightvision openapi extract ./src ./lib --no-target |
For unsupported frameworks or components, contact [email protected].
What SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/api-discoveryFormer name of the source-intelligence skill, kept so that invoking api-discovery still works. Use source-intelligence instead./app-security-scanDAST-first NightVision scan for an app you just built or changed. Use when a user, or a project or org agent-instructions rule, wants a local, private, staging, or internal web app/API security-scanned. Drives the NightVision MCP `run-app-security-scan` harness./authz-reviewReview an app's object-level and function-level access control (BOLA/IDOR, broken function-level authorization, mass assignment) route by route, then write a two-user test the developer can run against their own local or dev app. Use after adding or changing routes that take object IDs, tenant or user identifiers, or admin-only actions, when a user asks "can one user see another user's data", or as part of ship-check./chain-attacksFind and reproduce multi-step business-logic vulnerabilities (vuln chains) in a web app or API, where each request is individually allowed but the ordered combination across steps or sessions breaks a business rule. Use after adding a multi-step flow (checkout, invite/accept, approval/publish, password reset, refund), when a user asks "can a sequence of allowed requests reach a forbidden state", to test business-logic or chained vulnerabilities, or as part of ship-check. Non-destructive and dev-only: it never takes a state-changing action and runs only against an app the developer owns./ci-cd-integrationGuide for agents to help users integrate NightVision DAST scanning into CI/CD pipelines. Use when setting up security scans in GitHub Actions, GitLab CI, Azure DevOps, Jenkins, BitBucket, or JFrog pipelines, configuring NightVision tokens, creating targets, running scans, exporting results as SARIF/CSV, or detecting API breaking changes./fleet-statusRead-only AppSec roll-up of every app in NightVision - which apps exist, when each was last scanned, and where the open Critical and High findings are. Use when a user asks "who is building what", wants scan posture across all apps, asks which apps have never been scanned or have stale scans, or needs an AppSec roll-up for a CISO. It starts no scans and changes nothing.2 plugins ship this exact skill · first indexed Nov 2, 2026
nightvision@nvsecurity is listed by nvsecurity/claude-marketplace — review the source before installing
npx claudepluginhub nvsecurity/claude-marketplace --plugin nightvisionOther plugins' skills for the same job