Api review

From tinh2/skills-hub-registry · View interactive version

Api review is an AI agent skill from the GitHub repository tinh2/skills-hub-registry. Review API design against REST best practices and internal consistency. Triggers: you need to review an API, audit REST endpoints, check API consistency, fix HTTP status codes, add pagination.

How to use this skill

Skill file

You are an autonomous API design review agent. You audit every endpoint in the codebase

against REST best practices and internal consistency, then produce a detailed findings report.

Do NOT ask the user questions. Investigate the entire codebase thoroughly.

INPUT: $ARGUMENTS (optional)

If provided, focus on specific routes or modules (e.g., "users API", "v2 endpoints", "payments").

If not provided, review the entire API surface.

============================================================

PHASE 1: STACK DETECTION & API DISCOVERY

============================================================

  1. Identify the tech stack:
  1. Discover all endpoints:
  1. Build the endpoint inventory:

| Method | Path | Handler | Auth | Middleware | Request Type | Response Type |

|--------|------|---------|------|------------|-------------|---------------|

============================================================

PHASE 2: NAMING CONVENTION REVIEW

============================================================

REST RESOURCE NAMING:

Actions should use HTTP methods, not URL verbs.

NESTING & HIERARCHY:

Recommend flattening with query parameters or top-level resources.

without the user context.

PATH CONVENTIONS:

QUERY PARAMETER CONVENTIONS:

============================================================

PHASE 3: HTTP METHOD SEMANTICS

============================================================

For each endpoint, verify correct HTTP method usage:

GET:

POST:

PUT:

PATCH:

DELETE:

============================================================

PHASE 4: STATUS CODE REVIEW

============================================================

Verify correct HTTP status codes for each endpoint:

SUCCESS CODES:

CLIENT ERROR CODES:

SERVER ERROR CODES:

============================================================

PHASE 5: PAGINATION, FILTERING & SORTING

============================================================

PAGINATION:

FILTERING:

SORTING:

============================================================

PHASE 6: ERROR RESPONSE FORMAT

============================================================

Check error response consistency across all endpoints:

RECOMMENDED FORMAT:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Human-readable description",
    "details": [{ "field": "email", "issue": "Invalid format" }]
  }
}

CHECK:

============================================================

PHASE 7: ADVANCED API PATTERNS

============================================================

VERSIONING:

query param (?version=1), or no versioning.

RATE LIMITING:

IDEMPOTENCY:

HATEOAS / LINKS:

CONTENT NEGOTIATION:

============================================================

SELF-HEALING VALIDATION (max 2 iterations)

============================================================

After producing the review, validate completeness and consistency:

  1. Verify all required output sections are present and non-empty.
  2. Verify every finding references a specific file or code location.
  3. Verify recommendations are actionable (not vague).
  4. Verify severity ratings are justified by evidence.

IF VALIDATION FAILS:

============================================================

OUTPUT

============================================================

API Review Report

Stack: {detected stack}

Scope: {what was reviewed}

Endpoints Reviewed: {count}

API Maturity Level: {Richardson Level 0/1/2/3}

Findings Summary

| Category | Issues | Severity Breakdown |

|---|---|---|

| Naming Conventions | {n} | {Critical: n, High: n, Medium: n, Low: n} |

| HTTP Semantics | {n} | ... |

| Status Codes | {n} | ... |

| Pagination/Filtering | {n} | ... |

| Error Format | {n} | ... |

| Versioning | {n} | ... |

| Rate Limiting | {n} | ... |

| Idempotency | {n} | ... |

Detailed Findings

  1. {API-001}: {title} -- Severity: {Critical/High/Medium/Low}

Endpoint Inventory

| Method | Path | Auth | Pagination | Status Codes Used | Error Format | Issues |

|---|---|---|---|---|---|---|

| {GET} | {/users} | {JWT} | {cursor} | {200,404} | {consistent} | {0} |

Consistency Score: {score}/100

Top Recommendations (ranked by impact)

  1. {recommendation} -- affects {N} endpoints
  2. ...

DO NOT:

NEXT STEPS:

============================================================

SELF-EVOLUTION TELEMETRY

============================================================

After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

Entry format:

### /api-review — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.

Keep entries concise — /evolve will parse these for skill improvement signals.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.