본문으로 건너뛰기
cccskills
무료GitHub에 공개

api-contract-openapi

Use when you add or change any HTTP endpoint's request or response shape (Go or Java) — implement the task's contract exactly, evolve additively, keep the OpenAPI document in sync, and detect breaking changes before hand-off

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

OpenAPI & API Contracts

Overview

The API contract is a promise the web and mobile clients depend on. A silent shape change (renamed field, changed type, removed endpoint) compiles fine on the backend and breaks every consumer at runtime.

Core principle: the contract is the annotation + DTO in code. Implement the task's contract exactly, evolve it additively, and never edit a consumer yourself.

Your task's contract is already copied into the consumer tasks

Your task's Interfaces / contract block is already copied, word for word, into the consumer tasks (the architect writes it once and copies it to the frontend and mobile tasks, which are blocked_by and deploy_depends_on yours). Implement it exactly: path, method, field names and casing, types, status codes. A shape you think is better is a comment on your task, not a change.

Consumers are not yours to edit. Find them with list_links (direction in) and grep_code for the path or field. Another component's or repository's client code belongs to its own task, and cross-repository actions are refused. Keep your change additive. When a breaking change is truly required, add_task_comment naming every consumer task or component and what each must change, and stop short of the break.

Detect the spec source

SignalTooling
//@Summary///@Router commentsswaggo (swag init; v1 emits Swagger 2.0 only)
openapi.yaml/.json + generated server stubsoapi-codegen (spec-first, go generate ./...)
Go struct tags driving a schema, no annotationshuma or ogen
@Operation/@Schema on JAX-RS resourcesspringdoc-openapi / quarkus-smallrye-openapi — spec is generated at runtime; snapshot it at /q/openapi or /v3/api-docs
A hand-maintained openapi.yaml with no generatoredit it directly

Keep the document's existing OpenAPI version (3.0/3.1/3.2 all current); upgrading the spec version is never part of a feature task.

Additive vs breaking

ChangeTypeAction
Add optional fieldAdditiveSafe; document it
Add required request fieldBreakingCoordinate via the task's contract, never edit callers yourself
Rename fieldBreakingPrefer add-new + deprecate-old
Change field typeBreakingNew field or coordinated cutover
Remove endpoint/fieldBreakingDeprecate first, remove later

Breaking-change check

Diff the spec against the merge base before you finish:

mkdir -p /tmp/tt-<task key> && git show "$(git merge-base HEAD origin/HEAD)":api/openapi.yaml > /tmp/tt-<task key>/base.yaml
go run github.com/oasdiff/oasdiff@latest breaking /tmp/tt-<task key>/base.yaml api/openapi.yaml

It must print nothing unless the task is the planned break. Lint with npx --yes @redocly/cli lint api/openapi.yaml when the repo has no linter already wired in.

Every endpoint documented

Request/response schema, every status code it can return (including the error shape — see api-design-conventions), and pagination parameters where the endpoint lists anything.

Worked Example

Task's contract: POST /tasks returns {id, title, status}. A later task wants to rename title to name for a different repository's consumer.

Wrong: rename the DTO field and ship — every client reading title breaks, and your task has no authority to touch their code.

Right (additive cutover):

  1. Add name alongside title in the response; populate both. Document title as deprecated in the spec.
  2. add_task_comment naming the consumer task(s)/component(s) that must switch to name.
  3. In a later task — once the architect confirms no consumer reads title — remove it with a contract note.

Each step keeps every consumer green and respects task boundaries.

Common Mistakes

  • Implementing a shape you think is cleaner instead of the task's Interfaces block verbatim.
  • Editing a consumer's client code because it was easy to find.
  • A required new request field added with no coordinated consumer task.
  • Spec left stale after a handler change, or oasdiff never run.

Red Flags

  • A DTO field renamed or removed with oasdiff breaking printing output.
  • A diff that touches files outside your component/repository to "fix" a client.
  • A consumer reading a field the backend just removed, with no deprecation step.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when writing acceptance criteria for a task - express each as an observable Given/When/Then that QA can execute, including negative cases

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

makifbaysal/tasktrooper1172026년 10월 20일 업데이트

Use when the diff adds or changes an endpoint, resolver, RPC, job or query that takes an object id, a role check, a request binding or a tenant filter - BOLA/IDOR, function-level authorization, mass assignment and tenant scoping

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

makifbaysal/tasktrooper1172026년 10월 20일 업데이트

Use on every UI change - semantic HTML, labels for controls, keyboard-navigable dialogs/menus, visible focus, and never color as the only signal

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

makifbaysal/tasktrooper1172026년 10월 20일 업데이트

Use when a task changes any screen, form, dialog, menu or control - Lighthouse/axe scan of the changed screens, a keyboard walk, and the thresholds that fail a task

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

makifbaysal/tasktrooper1172026년 10월 20일 업데이트

How to work a task returned with review, QA or UAT findings. Use when a task is in need_revision or PR review comments are in your context.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

makifbaysal/tasktrooper1172026년 10월 20일 업데이트

Use when the repository keeps its alerting in code, or a person asks for alerts outside TaskTrooper - PrometheusRule YAML, a Cloud Monitoring alert policy in Terraform, a Datadog monitor, each routed to TaskTrooper's alert ingest URL so it opens an incident here

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

makifbaysal/tasktrooper1172026년 10월 20일 업데이트

makifbaysal의 스킬 모두 보기

이 스킬의 문제 신고