design-api

Run the api-contract-design skill as a full API contract journey before implementation.

SKILL.md

GitHub
<!-- Generated by mstack from Misbah's Build Like This workflow. Regenerate instead of editing. -->

design-api

Run the api-contract-design skill. The backend-engineer leads and delegates database, security, and independent contract-test lanes so clients and servers share one validated contract before implementation.

This prompt follows Misbah Khursheed's Build Like This workflow: establish the user outcome and reasoning before generating implementation, then preserve that reasoning in contracts, boundaries, tests, and documentation.

Project identity and sources of truth

The repository where this prompt is installed is the host project being built. Build Like This is the engineering method used to build it, while mstack only installs and reconciles the method's resources. Do not mistake mstack or Build Like This for the host product unless project-owned sources explicitly say this repository develops mstack itself.

Project-owned docs/, decisions, executable code, and tests are the sources of truth. .mstack/templates/ are reference scaffolds that may be copied and adapted into project-owned documents; they are not requirements and do not replace docs/.

Treat the invocation arguments and current repository state as task input. Discover local instructions and relevant product, architecture, decision, contract, and test context before making material assumptions.

Method

  1. Load and follow the api-contract-design skill as the method source of truth; do not invent a parallel process.
  2. Restate the user operation, actors, resource ownership, invariants, and state transitions in domain language.
  3. Produce runtime-validatable schemas, resource-level authorization, stable errors, examples, and compatibility notes.
  4. Define idempotency, concurrency, pagination, and rate limits where the operation needs them.
  5. Hand off contract tests and implementation notes; stop before writing production handlers unless explicitly asked.

Deliverables

  • Operation table with actor, permission, request, response, state effect, and errors.
  • Runtime-validatable schema or equivalent contract plus representative examples.
  • Compatibility, idempotency/concurrency, rate-limit, security, and contract-test notes.

Constraints

  • Do not leak database models, internal exceptions, secrets, or provider payloads.
  • Do not rely on client validation for server invariants.
  • Do not introduce breaking changes without a migration/deprecation path.

Delegation and parallel safety

  • For a material lifecycle task, the active lead must delegate at least one bounded specialist lane when subagents are available; prefer two or more concurrent lanes only when their evidence or file ownership is independent.
  • The active lead owns acceptance criteria and final integration. Supporting agents must not recursively delegate unless explicitly promoted to lead a named lane.
  • Give each delegate distinct inputs, outputs, and ownership. Serialize shared documents, contracts, schemas, migrations, deployments, external writes, and overlapping file edits.
  • If subagents are unavailable, perform the named specialist passes sequentially and report the limitation; do not imply parallel verification.
  • Delegation does not authorize outreach, paid resources, destructive changes, consequential external writes, or production deployment.

Finish with what changed or was decided, exact verification evidence, remaining risks, and the next decision only if one is genuinely required.

User arguments: $ARGUMENTS