Correlate AIP review findings with code locations in code-first API projects. Use when creating fix plans for code-generated OpenAPI specs, mapping spec paths to source code, or when user asks to find where an API endpoint is implemented. Works with NestJS, Fastify, and Express projects.
/plugin marketplace add getlarge/claude-aip-plugins/plugin install aip-api-design@getlarge-aip-pluginsThis skill is limited to using the following tools:
diff-templates.mdMap AIP review findings to code locations for code-first API projects.
IMPORTANT: If the mcp__aip-reviewer__aip-correlate tool is available, use it instead of manual correlation. The MCP tool:
aip-reviewUse mcp__aip-reviewer__aip-correlate with:
- reviewId: {review-id-from-aip-review}
- projectRoot: {absolute-path-to-project}
- specPath: {absolute-path-to-spec} (optional, for context extraction)
- framework: "nestjs" | "fastify" | "express" | "unknown" (optional hint)
- correlationLevel: "minimal" | "moderate" | "thorough" (optional, default: "moderate")
The manual process below is a fallback for when MCP tools are not available.
Activate this skill when:
aip-review for a code-first projectaip-review MCP tool or review document)From MCP tool results:
If aip-review was called, use the findings from that response.
From review document:
If working from thoughts/api/reviews/*.md, read the document to get:
spec_path from frontmatterruleId, path, severityParse each finding's path field to extract method and API path:
"GET /users/{id}" → method: GET, path: /users/{id}
"POST /orders" → method: POST, path: /orders
Dedupe by method+path (multiple findings may target same endpoint).
Read package.json in project root:
@nestjs/core → NestJS (decorators: @Controller, @Get, @Post)fastify → Fastify (route methods: .get, .post, app.route)express → Express (router methods: router.get, app.get)For each unique operation, spawn an aip-code-locator agent:
Task: aip-code-locator
Prompt: Find the code that implements this API operation:
- method: GET
- path: /users/{id}
- operationId: getUserById (if available from spec)
- framework: nestjs
- rootDir: /project
Spawn up to 5 agents in parallel for efficiency.
For each finding, build this structure:
{
"finding": {
"ruleId": "naming/plural-resources",
"severity": "warning",
"path": "GET /user/{id}",
"message": "Resource name should be plural",
"suggestion": "Rename to /users/{id}",
"fix": { "type": "rename-path-segment", "..." }
},
"specContext": {
"method": "GET",
"path": "/user/{id}",
"operationId": "getUser",
"summary": "Get a user by ID",
"tags": ["users"]
},
"codeLocations": [
{
"file": "src/users/users.controller.ts",
"line": 42,
"type": "controller",
"confidence": "high",
"snippet": "@Get(':id')\nasync getUser(@Param('id') id: string) { ... }",
"reasoning": "@Get decorator matches, operationId in @ApiOperation"
}
],
"suggestedDiffs": {
"specDiff": "...",
"codeDiffs": [{ "file": "...", "diff": "...", "description": "..." }]
}
}
For deterministic fixes, pre-populate code diffs using templates from diff-templates.md.
| fix.type | Code Diff |
|---|---|
rename-path-segment | Update @Controller('user') → @Controller('users') |
rename-parameter | Update @Param name |
change-status-code | Add/update @HttpCode(201) |
remove-request-body | Remove @Body() parameter |
add-parameter | Partial - provide template |
add-schema | No - too complex, guidance only |
Write to thoughts/api/correlations/{date}-{spec-name}.json:
{
"extendedFindings": [
/* ... */
],
"framework": "nestjs",
"generatedAt": "2024-01-15T10:30:00Z",
"reviewPath": "thoughts/api/reviews/...",
"specPath": "openapi.yaml",
"summary": {
"correlated": 6,
"notFound": 2,
"totalFindings": 8
}
}
Report results to user:
## Correlation Complete
| Operation | Code Location | Confidence |
| --------------- | ---------------------------------- | ---------- |
| GET /users/{id} | src/users/users.controller.ts:42 | high |
| POST /users | src/users/users.controller.ts:28 | high |
| GET /orders | src/orders/orders.controller.ts:15 | medium |
**Not found:** DELETE /admin/cache, GET /health
Correlation saved to: thoughts/api/correlations/2024-01-15-orders-api.json
aip-review: Analyze OpenAPI spec against AIP rules. Returns findings with reviewId.
Call: mcp__aip-reviewer__aip-review with specPath or specUrl
Returns: { reviewId, findings[], summary, findingsPath, findingsUrl }
aip-correlate: Correlate AIP review findings with code locations.
Call: mcp__aip-reviewer__aip-correlate with reviewId, projectRoot, specPath, framework
Returns: { extendedFindings[], framework, summary, correlationPath }
aip-apply-fixes: Apply suggested fixes to spec (after correlation, to fix spec issues).
Call: mcp__aip-reviewer__aip-apply-fixes with reviewId, specPath/specUrl, writeBack, dryRun
Returns: { summary, downloadUrl, modifiedSpec }
aip-code-locator: Find code implementing a single API operation.
| Purpose | Path |
|---|---|
| Review documents | thoughts/api/reviews/*.md |
| Correlation output | thoughts/api/correlations/*.json |
| Code locator agent | plugins/aip-api-design/agents/aip-code-locator.md |
| Diff templates | diff-templates.md |
/api-plan after correlation to create a fix plan/api-validate to verify fixes against the planaip-code-locator agent directly for single operation lookupaip-knowledge skill for AIP rule explanationsCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.