api-design-rest
API Design REST
Scope Boundaries
- Use when REST resources, URI structures, and HTTP behavior are being designed or changed.
- Use proactively when route, method, status, or schema diffs appear in specs, manifests, or source.
- Use when request-response transport options are being compared and REST is a candidate.
- Do not use for GraphQL-first schema work; use
api-design-graphql. - Do not use for storage internals; use
db-*.
Goal
Deliver REST contracts that are stable, predictable, and operationally safe.
Shared API Contract (Canonical)
- Use
references/api-governance-contract.mdas the primary reference for recommended structure. - Optional consistency checks (only if your repository enforces manifest validation):
python3 scripts/validate_api_contract.py --manifest <path/to/manifest.json>
- Start from valid templates in
assets/. - Use transport decision reference:
references/transport-selection-matrix.md
- Use threshold derivation reference:
references/threshold-derivation-framework.md
- Do not define alternate ID formats, lifecycle states, or compatibility policies locally.
Implementation Templates
- REST OpenAPI template:
assets/openapi-rest-template.yaml
- Queue/event API template:
assets/asyncapi-queue-template.yaml
- WebSocket contract template:
assets/websocket-message-contract-template.yaml
- SSE contract template:
assets/sse-event-contract-template.yaml
Inputs
- Product behavior and consumer integration requirements
- Resource model candidates and domain invariants
- Security, compliance, and SLO constraints
- Interaction model candidates (
sync,async,streaming,bidirectional_realtime) - Transport options (
rest,graphql,grpc,websocket,sse,queue)
Outputs
- Resource map and endpoint matrix (
method,path,status,error) - Request/response schema contract including pagination and filtering rules
- Authorization, rate-limit, idempotency, and observability decisions
Workflow
- Model resources as nouns and define stable identifiers before endpoint naming.
- Select interaction mode and primary transport with explicit rationale and rejected alternatives.
- Define method semantics with explicit idempotency strategy for retry-sensitive writes.
- Fix status and error semantics so clients can branch without string parsing.
- Define naming conventions for paths, fields, and error codes.
- Define authz scope, rate-limit policy, and trace/log fields for every operation class.
- Derive threshold types and methods (latency, timeout, capacity, concurrency, retry, delivery).
- Validate backward compatibility and publish deprecation/migration notes when behavior changes.
- Validate the artifact against the canonical API contract before approval.
Quality Gates
- URI and method choices follow resource-oriented conventions and HTTP semantics.
- Contract is backward compatible or includes approved version transition evidence.
- Error contract is machine-actionable and trace-correlated.
- Authz, rate-limit, and runbook updates are complete and reviewable.
- Decision context captures internal/external audience and sync/async/real-time transport rationale.
- Threshold derivation methods are explicit and tied to SLO/risk evidence.
Failure Handling
- Stop when URI design leaks internal implementation or method semantics are inconsistent.
- Stop when compatibility impact is unknown.
- Escalate when required approvers or compliance evidence are missing.
More from kentoshimizu/sw-agent-skills
graph-algorithms
Graph algorithm workflow for modeling entities/relations and selecting traversal, path, ordering, or flow strategies. Use when correctness or performance depends on graph representation and algorithm choice; do not use for schema-only modeling or deployment topology planning.
14bash-style-guide
Style, review, and refactoring standards for Bash shell scripting. Trigger when `.sh` files, files with `#!/usr/bin/env bash` or `#!/bin/bash`, or CI workflow blocks with `shell: bash` are created, modified, or reviewed and Bash-specific quality controls (quoting safety, error handling, portability, readability) must be enforced. Do not use for generic POSIX `sh`, PowerShell, or language-specific application style rules. In multi-language pull requests, run together with other applicable `*-style-guide` skills.
11architecture-clean-architecture
Clean Architecture workflow for enforcing dependency direction, stable domain boundaries, and use-case-centered application design. Use when teams must separate business rules from frameworks and delivery mechanisms; do not use for isolated module cleanup without boundary implications.
11powershell-style-guide
Style, review, and refactoring standards for PowerShell scripting. Trigger when `.ps1`, `.psm1`, `.psd1` files, or CI workflow blocks with `shell: pwsh` or `shell: powershell` are created, modified, or reviewed and PowerShell-specific quality controls (error handling, parameter validation, readability, operational safety) must be enforced. Do not use for Bash, generic POSIX `sh`, or language-specific application style rules. In multi-language pull requests, run together with other applicable `*-style-guide` skills.
10github-codeowners-management
Govern CODEOWNERS rules so review routing reflects real ownership and risk boundaries on GitHub. Use when repository ownership mapping or mandatory reviewer rules must be defined, updated, or audited; do not use for non-GitHub runtime architecture or data-layer design.
9security-authentication
Security workflow for authentication architecture, credential lifecycle, and session/token assurance. Use when login, identity proofing, MFA, or session security decisions are required; do not use for authorization policy design or non-security quality tuning.
9