Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

2.2 KB
Raw Blame

name: api-design-review description: "Use when adding or changing an HTTP / RPC API: check naming, validation, errors, pagination, compatibility and security." metadata: pibot-name: "API design review" pibot-params: "[{"name":"endpoint","description":"Endpoint path or name, or the related files"}]"

API design review

Endpoint: {endpoint}

1. Write down the contract first

Use this format, then review against it:

METHOD path / name:
Purpose: one sentence
Request: field | type | required | meaning | allowed values
Response: field | type | meaning
Errors: code | when it happens | what the caller should do

2. Check each item

  • Naming: consistent with the project's existing APIs (paths, casing, plurals).
  • Input validation: types, lengths, ranges and enums validated at the boundary; unknown fields rejected or explicitly ignored.
  • Errors: expected failures have clear codes and messages; internal exceptions, stack traces and SQL never reach the caller.
  • Lists: always paginated (cursor or limit + cursor) with a maximum; stable ordering.
  • Idempotency and concurrency: what happens on a duplicate submit or concurrent edits to the same resource? Add an idempotency key or version when needed.
  • Timeouts and cancellation: long operations have timeouts and can be cancelled.
  • Authorisation: who may call it, and can they only touch data they own (check ownership, not just sign-in)?
  • Data: parameterised queries; transactions for multi-step writes; indexes for common filters.
  • Compatibility: when changing an existing API, do old callers break? Are new fields optional?
  • Sensitive data: no passwords, tokens or full ID numbers in responses or logs.

3. Output

**Contract**: (the table above)
**Findings**:
1. [Must fix / Should fix] problem — reason — suggestion
**Compatibility impact**: …

Scope

Use supplied information first; user requirements on count, format, and scope override this default template. Current capabilities govern permissions, primary/read-only workplaces, Plan mode, and budget; do not switch tools to bypass a refusal. This skill supplies a method, not authority to write, run commands, pay, send, commit, or publish. Identify unperformed or unverified steps.