Update the Go dashboard server HTTP contract in TypeSpec, regenerate OpenAPI 3.1 and JSON Schemas, and keep the implementation conformant.
Install
npx skillscat add githubnext/gh-aw-cao/update-server-api-specs Install via the SkillsCat registry.
SKILL.md
Update server API specs
Use this skill when adding or changing the dashboard server's HTTP API. Readserver/spec/README.md first for the contract's scope and writer workflow.server/spec/*.tsp is the editable API contract; server/spec/generated/ contains
committed output, not hand-edited source. Do not specify MCP internals.
Procedure
- Identify the affected HTTP operation in
server/spec/and its registered
handler inserver/internal/server/server.go. Read the handler, its Go
request/response types, and relevant callers. For Dashboard Language queries,
consultserver/internal/query/types.goandspecs/dashboard-data.md. - Edit the appropriate domain
.tspfile first (query, health, auth, canonical,
memory, or operations); share reusable models incommon.tsp. Import a new
domain frommain.tsprather than putting all routes in one file. Specify
method, path, headers, body, statuses, and examples. Describe deployment
differences: local bearer capability; hosted GitHub OAuth session andX-CSRF-Tokenon protected mutations; public health/readiness; and signed
GitHub webhooks. Never expose OAuth tokens, Redis details, or secrets. - Bring the Go handler and any client into conformance with the edited spec.
When changing routes or structured payloads, extend the relevant checks inserver/spec/contract.test.mjs. Preserve the existing API unless the change
explicitly calls for a breaking change. - Install the pinned compiler/emitters with
npm --prefix server/spec ci.
From the repository root, runnpm run dashboard:server:specto regenerateserver/spec/generated/openapi.jsonand the selected JSON Schemas. Inspect
the generated diff for unintended routes, security requirements, payload
changes, and sensitive example data. Do not edit generated files manually. - Run
npm --prefix server/spec run checkto verify the generated artifacts
match the TypeSpec source and Go route/field contract. If implementation
changed, also rungo -C server test ./...and the applicable lint checks.
Commit the.tsp, implementation, tests, and generated artifacts together.
If a desired behavior cannot be represented faithfully in the current spec,
report the discrepancy rather than claiming the generated contract is
authoritative for behavior it does not describe.