Discover all OpenAPI specifications in the codebase. Outputs a discovery document listing all found specs with metadata.
Finds all OpenAPI specifications in the codebase and outputs a discovery document with metadata.
/plugin marketplace add getlarge/claude-aip-plugins/plugin install aip-api-design@getlarge-aip-pluginsFind all OpenAPI specifications in this codebase using the deterministic discover script.
/api-discover
/api-discover {directory}
Determine the plugin root path:
The plugin scripts are located relative to CLAUDE_PLUGIN_ROOT. When running as an installed plugin, this environment variable is available. You can find the discover script at:
${CLAUDE_PLUGIN_ROOT}/openapi-reviewer/src/discover.js
To find the actual path, check the session start hook output or locate the plugin installation (typically ~/.claude/plugins/aip-api-design@*/).
Run the discover script:
node "${CLAUDE_PLUGIN_ROOT}/openapi-reviewer/src/discover.js" {directory} --format markdown
If CLAUDE_PLUGIN_ROOT is not set, find the plugin directory first:
PLUGIN_DIR=$(find ~/.claude/plugins -name "aip-api-design@*" -type d 2>/dev/null | head -1)
node "${PLUGIN_DIR}/openapi-reviewer/src/discover.js" {directory} --format markdown
The script will:
openapi.yaml, swagger.json, etc.api/, docs/, specs/, etc.)node_modules, .git, dist, etc.@readme/openapi-parserOptional flags:
--format json: Machine-readable output--depth 5: Limit directory recursion depthSave the output to:
thoughts/api/discovery/{YYYY-MM-DD}-discovery.md
Present findings to user:
/api-review {spec-path} on specific specsFor each spec found:
| Field | Description |
|---|---|
| path | Relative path to spec file |
| type | openapi-3.x, openapi-3.1, swagger-2.x |
| title | API title from info.title |
| apiVersion | Version from info.version |
| pathCount | Number of paths |
| operationCount | Number of operations (GET, POST, etc.) |
| servers | Server URLs if defined |
| isGenerated | Whether spec appears auto-generated |
Filenames:
openapi.yaml, openapi.yml, openapi.jsonswagger.yaml, swagger.yml, swagger.jsonapi.yaml, api.yml, api.jsonopenapi or swagger in nameDirectories prioritized:
api/, docs/, spec/, specs/openapi/, swagger/, schema/, schemas/Skipped:
node_modules/, .git/, dist/, build/, coverage/User: /api-discover
Claude: Running discovery script...
[Runs: node openapi-reviewer/src/discover.js . --format markdown]
Found 2 OpenAPI specifications:
1. **Pet Store API** (`api/openapi.yaml`)
- OpenAPI 3.0.3, 15 paths, 24 operations
2. **Internal Admin API** (`admin/swagger.json`)
- Swagger 2.0, 8 paths, 12 operations
- Auto-generated by swagger-jsdoc
Which spec would you like to review? Run `/api-review api/openapi.yaml` to analyze against AIP rules.
/api-review {spec} - Review spec against AIP rules/api-discover-nestjs - (future) Discover NestJS code-first APIs