Files
Open_Ultra_SAST/.kiro/settings/templates/steering-custom/api-standards.md
T
Marius CiepluchandClaude Opus 4.8 6699f1f8f9 chore: add kiro spec-driven tooling and steering docs
Add the Kiro-style agentic SDLC tooling used to drive this project: the
.opencode/skills/kiro-* skill set (discovery, spec init/requirements/design/
tasks, validation, implementation, review, steering), the .kiro/settings
templates, and AGENTS.md describing the workflow. Update the spec docs
(assessment/design/requirements/tasks) to current state.

Scope tests/test_opencode_skills.py to the project's own openultrasast-*
skills so the third-party kiro-* tooling (which uses a different frontmatter
convention) no longer breaks the frontmatter check.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-21 14:28:19 +02:00

1.6 KiB

API Standards

[Purpose: consistent API patterns for naming, structure, auth, versioning, and errors]

Philosophy

  • Prefer predictable, resource-oriented design
  • Be explicit in contracts; minimize breaking changes
  • Secure by default (auth first, least privilege)

Endpoint Pattern

/{version}/{resource}[/{id}][/{sub-resource}]

Examples:

  • /api/v1/users
  • /api/v1/users/:id
  • /api/v1/users/:id/posts

HTTP verbs:

  • GET (read, safe, idempotent)
  • POST (create)
  • PUT/PATCH (update)
  • DELETE (remove, idempotent)

Request/Response

Request (typical):

{ "data": { ... }, "metadata": { "requestId": "..." } }

Success:

{ "data": { ... }, "meta": { "timestamp": "...", "version": "..." } }

Error:

{ "error": { "code": "ERROR_CODE", "message": "...", "field": "optional" } }

(See error-handling for rules.)

Status Codes (pattern)

  • 2xx: Success (200 read, 201 create, 204 delete)
  • 4xx: Client issues (400 validation, 401/403 auth, 404 missing)
  • 5xx: Server issues (500 generic, 503 unavailable) Choose the status that best reflects the outcome.

Authentication

  • Credentials in standard location
Authorization: Bearer {token}
  • Reject unauthenticated before business logic

Versioning

  • Version via URL/header/media-type
  • Breaking change → new version
  • Non-breaking → same version
  • Provide deprecation window and comms

Pagination/Filtering (if applicable)

  • Pagination: page, pageSize or cursor-based
  • Filtering: explicit query params
  • Sorting: sort=field:asc|desc Return pagination metadata in meta.

Focus on patterns and decisions, not endpoint catalogs.