api-audit
4
总安装量
4
周安装量
#50285
全站排名
安装命令
npx skills add https://github.com/acedergren/agentic-tools --skill api-audit
Agent 安装分布
amp
4
gemini-cli
4
claude-code
4
github-copilot
4
codex
4
kimi-cli
4
Skill 文档
API Route & Type Audit Skill
Scan API routes and plugins, catalog every endpoint, and cross-reference against type definitions to find mismatches. Read-only â do not modify any files.
Steps
1. Scan Route Files
Scan your routes directory recursively. For each route registration, extract:
- HTTP method (GET, POST, PUT, PATCH, DELETE)
- Path (e.g.,
/api/users,/api/admin/settings) - Auth requirements (public, session-required, RBAC permissions)
- Request schema (Zod/validation schema name, if defined)
- Response schema (Zod/validation schema name, if defined)
Look for framework-specific patterns (e.g., Fastify schema objects, Express middleware chains, Next.js route handlers).
2. Scan Plugin/Middleware Files
Scan middleware or plugin directories for:
- Auth middleware registration (which routes get auth protection)
- Permission mappings
- Rate limiting configurations per route
- Any route-level decorators or hooks
3. Catalog Shared Types
Scan type definition directories for:
- Validation schemas used as request/response validators
- TypeScript interfaces/types that correspond to API payloads
- Exported schema names and their shapes
4. Cross-Reference and Detect Mismatches
| Category | What to check |
|---|---|
| Missing schemas | Routes without request/response validation |
| Type drift | Route handler using a type that differs from the shared schema |
| Orphan types | Schemas in types package not referenced by any route |
| Auth gaps | Routes missing auth hooks that should have them (e.g., /admin/*) |
5. Report Findings
Output a markdown table grouped by severity:
- Critical: Auth gaps, missing validation on mutation endpoints
- Warning: Type drift, missing response schemas
- Info: Orphan types, routes with inline schemas that could use shared ones
Include summary counts: total routes, full coverage, partial coverage, no validation, mismatches.
Arguments
$ARGUMENTS: Optional scope filter- Example:
/api-audit adminâ only audit admin routes - If empty, audit all routes
- Example:
Execution Strategy
Use two parallel Explore agents for speed:
- Agent A: Scan routes + plugins â catalog all endpoints
- Agent B: Scan types directories â catalog all shared schemas
Then synthesize their findings into the cross-reference table.
Key Rules
- Read-only â do not create, modify, or delete any files
- Be specific â report exact file paths and line numbers
- No false positives â only report genuine mismatches
- Include context â show the relevant type/schema snippet for each mismatch