원클릭으로
update-openapi
Keep the OpenAPI spec in sync with route changes by diffing spec against actual route definitions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Keep the OpenAPI spec in sync with route changes by diffing spec against actual route definitions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run deep browser UI tests against the admin panels (global and project-level) using MCP Playwright.
Run deep browser UI tests against the SlateFlow Kanban board using MCP Playwright — covers board load, card CRUD, DnD lane transitions, card modal tabs, task checklists, filters, and lane management.
Run interactive browser UI tests against the running SlateFlow dev server using MCP Playwright.
Create a GitHub issue from a bug or problem description found during testing.
Audit recent changes and verify that README.md, ROADMAP.md, and CLAUDE.md were all updated.
Reset and re-seed slateflow.db with realistic test data for local dev and demos.
| name | update-openapi |
| description | Keep the OpenAPI spec in sync with route changes by diffing spec against actual route definitions. |
SlateFlow's OpenAPI spec lives in server/src/lib/openapi/ as plain TypeScript objects (no code generation). This skill helps keep the spec synchronized with route changes.
The OpenAPI spec is organized by domain:
server/src/lib/openapi/index.ts — assembles the spec from domain filesserver/src/lib/openapi/shared.ts — reusable schemas (Request/Response envelopes, Error, Card, etc.)server/src/lib/openapi/domains/*.ts — endpoint paths grouped by domain (cards, sprints, users, etc.)When you add or modify a route in server/src/routes/, you must also update the matching domain spec file. This skill guides you through that process.
First, determine which route file(s) you modified:
git diff --name-only
Common route files:
server/src/routes/cards.ts → spec domain: domains/cards.tsserver/src/routes/sprints.ts → spec domain: domains/sprints.tsserver/src/routes/users.ts → spec domain: domains/users.tsRead the route file to understand the new/changed endpoint:
# Example: if you modified server/src/routes/cards.ts
cat server/src/routes/cards.ts | grep -A 20 "router.post"
Note:
/api/cards/:id)# Example: for cards, read the spec domain file
cat server/src/lib/openapi/domains/cardsPaths.ts
Understand the structure:
cardsPaths (or similar)/api/cards/{id} uses {id} not :id200, 400, 401, 404, etc.requestBody keyBased on the route and existing spec pattern, draft the addition or modification.
Example: If you added POST /api/cards/:id/assign, the spec entry might be:
'/api/cards/{id}/assign': {
post: {
summary: 'Assign card to user',
description: 'Assign a card to a team member. Requires auth.',
tags: ['Cards'],
parameters: [
{
name: 'id',
in: 'path',
required: true,
schema: { type: 'integer' },
},
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
properties: {
assigned_to: { type: 'integer', description: 'User ID' },
},
required: ['assigned_to'],
},
},
},
},
responses: {
200: {
description: 'Card assigned successfully',
content: {
'application/json': {
schema: { $ref: '#/components/schemas/DataResponse' },
},
},
},
401: { $ref: '#/components/responses/Unauthorized' },
404: { $ref: '#/components/responses/NotFound' },
},
},
},
Using the Edit tool, add your drafted spec entry to the correct domain file.
File location: server/src/lib/openapi/domains/<domain>Paths.ts
Ensure:
{id} not :id$ref: '#/components/schemas/...' (avoid inline duplication)shared.ts where possibleindex.ts (e.g., cardsPaths, sprintsPaths)Load the live Swagger UI to verify the update appears:
npm run dev
Then visit http://localhost:3000/api/docs in your browser and search for your new endpoint. The spec should render without errors.
Alternatively, fetch the raw OpenAPI JSON:
curl http://localhost:3000/api/openapi.json | jq '.paths."/api/cards/{id}/assign"'
Use curl or the Swagger UI "Try it out" button to verify the endpoint works as documented:
# Example: assign a card
curl -X POST http://localhost:3000/api/cards/1/assign \
-H "Content-Type: application/json" \
-H "Cookie: sf_token=..." \
-d '{"assigned_to": 2}'
The response should match the 200 schema you documented.
Most endpoints return:
{ "data": { ...payload... } }
or on error:
{ "error": { "code": "...", "message": "..." } }
Use the DataResponse and ErrorResponse schemas from shared.ts:
200: {
description: 'Success',
content: {
'application/json': {
schema: { $ref: '#/components/schemas/DataResponse' },
},
},
},
400: { $ref: '#/components/responses/BadRequest' },
Always extract and document them:
parameters: [
{
name: 'id',
in: 'path',
required: true,
schema: { type: 'integer', description: 'Card ID' },
},
],
For filtering/pagination:
parameters: [
{
name: 'sprint_id',
in: 'query',
required: false,
schema: { type: 'integer' },
},
],
Inline small payloads; reference reusable schemas:
requestBody: {
required: true,
content: {
'application/json': {
schema: {
type: 'object',
properties: {
title: { type: 'string' },
description: { type: 'string' },
},
required: ['title'],
},
},
},
},
| Problem | Solution |
|---|---|
| Swagger UI shows "Invalid Spec" | Check JSON syntax in the domain file; use a JSON validator. Ensure all $ref paths match schema names in shared.ts. |
| Endpoint doesn't appear in docs | Verify the domain file is imported and re-exported in server/src/lib/openapi/index.ts. Check the path key format (/api/... not api/...). |
| Parameter shows as optional but should be required | Add required: true to the parameter; for request bodies, add to the required array. |
| Type mismatch between spec and actual response | Run the endpoint via curl and compare. Update the schema to match actual data structure. |
If the change is:
/api/)Then skip the spec update. Otherwise, keep it in sync as part of the same PR.