source-intelligence
Guide for agents to help users extract OpenAPI specs from source code using NightVision Source Intelligence.
Skill by nvsecurity
Chalk Labs
Need help deploying source-intelligence?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/nvsecurity-source-intelligence
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/source-intelligence
Tools it pre-approves 1
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash
What's inside
- Skill name
source-intelligence- Description
- 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.
- License
- Apache-2.0
- Allowed tools
- Bash
- Instructions
- 196 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves any shell command
Files (2)
- SKILL.md
- framework-support.md · references/
SKILL.md (first lines)
# NightVision Source Intelligence
Use this skill when helping users generate OpenAPI specifications from their source code using `nightvision openapi extract`. Source Intelligence performs static analysis — no running application or compilation needed — 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.
## Agent workflow
When a user asks to extract or document their API:
1. **Check prerequisites** — verify the NightVision CLI is available (`nightvision --help`)
2. **Examine the repo** — identify the backend languages and web frameworks and check them against the support matrix (see [references/framework-support.md](references/framework-support.md)). The CLI detects project roots and languages on its own; pass `--lang` only to restrict a run to one language
3. **Run extraction** — execute `nightvision openapi extract` with the appropriate flags, using `--no-target` if the user has no target yet (see [Choosing where the spec goes](#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`)
4. **Review the output** — read the generated spec to check completeness. Handle unresolved variables if the run created `nv.config`
5. **Compare coverage** — if the user has an existing spec, run `nightvision openapi diff` to show what was discovered vs. what was documented
6. **Upload to target** — attach the spec to a NightVision target for scanning
**Related skills:** Use `scan-configuration` for target/auth setup, `ci-cd-integration` for pipeline integration, `scan-triage` for interpreting scan results.
## Supported languages and frameworks
`--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 |
|----------|----------------|------------|
| Python | `python` | Django, Django REST Framework, Flask, Flask-RESTful, FastAPI, Starlette, Connexion |
| Java | `java` | Spring Boot/MVC/Data REST, JAX-RS/Jersey, Micronaut |
| JavaScript/TypeScript | `js` | Express, Fastify, NestJS |
| C# | `csharp` | ASP.NET Core MVC, minimal APIs, legacy ASP.NET MVC, Web API 2 |
| Go | `go` | net/http, Gin, Echo, Fiber v2, chi, gorilla/mux, httprouter |
| PHP | `php` | Laravel |
| Ruby | `ruby` | Rails, Grape |
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`/`.mjs` files are not read. See [references/framework-support.md](references/framework-support.md) for component coverage per framework and the [Framework Support Index](https://docs.nightviz.ai/source-intelligence/frameworks/) for the published matrix.
## Running extraction
```bash
# 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
```
### Choosing where the spec goes
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 fallback for CI
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.
```bash
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
```
## Handling unresolved variables
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:**
1. Run extraction — if unresolved variables exist, `nv.config` is created in the first detected project root, which need not be the spec's directory
2. Open `nv.config` — find the `replacements` object with `null` values
3. Replace `null` with the actual values (check the app's config files, environment vars, etc.)
4. Re-run extraction — the tool reads `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`
```json
// 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`.
## Comparing API specs
Use `openapi diff` to measure coverage or detect breaking changes:From nvsecurity/nightvision-skills, Apache-2.0.
More from nvsecurity/nightvision-skills
- 0.609score
ci-cd-integration
nvsecurity
Guide for agents to help users integrate NightVision DAST scanning into CI/CD pipelines.
SkillAFreshness: A★ 3Claude Code +9 - 0.609score
scan-triage
nvsecurity
Guide for agents to help users interpret and act on NightVision DAST scan results.
SkillAFreshness: A★ 3Claude Code +9 - 0.604score
app-security-scan
nvsecurity
DAST-first NightVision scan for an app you just built or changed.
SkillAFreshness: A★ 3Claude Code +9 - 0.604score
scan-configuration
nvsecurity
Guide for agents to help users configure NightVision DAST scans.
SkillAFreshness: A★ 3Claude Code +9 - 0.604score
scan-report
nvsecurity
Generate a shareable NightVision security report as a PDF - an executive summary for AppSec and leadership plus a findings appendix for developers - for one…
SkillAFreshness: A★ 3Claude Code +9 - 0.596score
api-discovery
nvsecurity
Former name of the source-intelligence skill, kept so that invoking api-discovery still works.
SkillAFreshness: A★ 3Claude Code +9
Signals
- Stars
- 3
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 8, 2026 (22 days ago)
- Last release
- Oct 8, 2026 (22 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/nvsecurity/nightvision-skills
- Website
- nightviz.ai
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from nvsecurity
- 0.609score
ci-cd-integration
nvsecurity
Guide for agents to help users integrate NightVision DAST scanning into CI/CD pipelines.
SkillAFreshness: A★ 3Claude Code +9 - 0.609score
scan-triage
nvsecurity
Guide for agents to help users interpret and act on NightVision DAST scan results.
SkillAFreshness: A★ 3Claude Code +9 - 0.604score
app-security-scan
nvsecurity
DAST-first NightVision scan for an app you just built or changed.
SkillAFreshness: A★ 3Claude Code +9 - 0.604score
scan-configuration
nvsecurity
Guide for agents to help users configure NightVision DAST scans.
SkillAFreshness: A★ 3Claude Code +9 - 0.604score
scan-report
nvsecurity
Generate a shareable NightVision security report as a PDF - an executive summary for AppSec and leadership plus a findings appendix for developers - for one…
SkillAFreshness: A★ 3Claude Code +9 - 0.596score
api-discovery
nvsecurity
Former name of the source-intelligence skill, kept so that invoking api-discovery still works.
SkillAFreshness: A★ 3Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get source-intelligence running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
source-intelligence skill. Agent Mart. https://agentmart.dev/skills/nvsecurity-source-intelligence (last updated 2026-10-24)