🔧 load live API contract skill in Claude Code
Browse files at this commitc830147abd14f6d94f36a122be46fe421a85aa83Parent: c89242e- chore
- 🔧 load live API contract skill in Claude Code
3 changed files +46 -2
- .claude/skills/check-api-contract/SKILL.md +38 -0
- AGENTS.md +4 -1
- CLAUDE.md +4 -1
.claude/skills/check-api-contract/SKILL.mdadded+38 -0
| @@ -0,0 +1,38 @@ | |||
| 1 | +--- | ||
| 2 | +name: check-api-contract | ||
| 3 | +description: "Check Hezarfen's live Swagger/OpenAPI contract against the frontend when Burak says 'API'ler güncellendi', 'yeni API geldi', 'Swagger'a bakalım', asks what changed in the backend API, or asks to check API drift. Use for inspection and compatibility checks; do not implement frontend changes unless requested." | ||
| 4 | +--- | ||
| 5 | + | ||
| 6 | +# Check the live API contract | ||
| 7 | + | ||
| 8 | +Treat the deployed OpenAPI document as the primary contract: | ||
| 9 | + | ||
| 10 | +- Swagger UI: `https://hezarfen.dizey.sh/swagger/` | ||
| 11 | +- OpenAPI JSON: `https://hezarfen.dizey.sh/api-docs/openapi.json` | ||
| 12 | + | ||
| 13 | +Fetch the machine-readable document directly with `curl -fsSL` and use `jq` | ||
| 14 | +to keep output focused. Do not clone or inspect the private backend repository | ||
| 15 | +while the live OpenAPI document is reachable, unless Burak explicitly asks for | ||
| 16 | +source-level investigation. | ||
| 17 | + | ||
| 18 | +## Workflow | ||
| 19 | + | ||
| 20 | +1. Confirm the health endpoint and OpenAPI JSON are reachable. Report HTTP or | ||
| 21 | + access failures plainly; never infer a contract from an unavailable service. | ||
| 22 | +2. Narrow the inspection to the domain or endpoint Burak named. If none was | ||
| 23 | + named, compare the live path/method set and relevant request/response schemas | ||
| 24 | + with `src/api/`, its domain exports, and `src/api/__tests__/`. | ||
| 25 | +3. Check more than route existence: compare HTTP method, path/query parameters, | ||
| 26 | + request bodies, response status codes, response unions, and referenced | ||
| 27 | + schemas. Pay special attention to authentication/session flow changes. | ||
| 28 | +4. Lead with concrete compatibility findings and link the affected frontend | ||
| 29 | + files. Separate confirmed mismatches from items that still need runtime | ||
| 30 | + verification. | ||
| 31 | +5. Do not edit code when the request is only to inspect, compare, or report. | ||
| 32 | + When Burak asks to implement the update, load `.claude/skills/api-layer/SKILL.md` | ||
| 33 | + before changing endpoint files and follow its required test workflow. Also | ||
| 34 | + load `solidjs-pitfalls` before changing SolidJS components. | ||
| 35 | + | ||
| 36 | +Use the shared `web-research` skill only if the documented Swagger/OpenAPI URL | ||
| 37 | +moves or public discovery is otherwise needed. Never send credentials, cookies, | ||
| 38 | +private URLs, or tokenized URLs to a hosted scraper. | ||
AGENTS.mdmodified+4 -1
| @@ -26,6 +26,9 @@ Bilingual codebase: Turkish UI labels, English code + commits. | |||
| 26 | ## Skills | 26 | ## Skills |
| 27 | 27 | ||
| 28 | Load on demand by area — `solidjs-pitfalls` | `ui-conventions` | `api-layer` | | 28 | Load on demand by area — `solidjs-pitfalls` | `ui-conventions` | `api-layer` | |
| 29 | -`commit-workflow` | `dashboard-design`. Source of truth: `.claude/skills/<name>/SKILL.md`. | 29 | +`commit-workflow` | `dashboard-design` | |
| 30 | +`check-api-contract` (live Swagger/OpenAPI vs `src/api/`; check it before | ||
| 31 | +saying an endpoint does or does not exist — the backend repo is not local). | ||
| 32 | +Source of truth: `.claude/skills/<name>/SKILL.md`. | ||
| 30 | 33 | ||
| 31 | Deeper docs by area: `docs/ui/` · `docs/auth/` · `docs/frontend/` · `docs/backend/`. | 34 | Deeper docs by area: `docs/ui/` · `docs/auth/` · `docs/frontend/` · `docs/backend/`. |
CLAUDE.mdmodified+4 -1
| @@ -25,6 +25,9 @@ Bilingual codebase: Turkish UI labels, English code + commits. | |||
| 25 | ## Skills | 25 | ## Skills |
| 26 | 26 | ||
| 27 | Load on demand by area — `solidjs-pitfalls` | `ui-conventions` | `api-layer` | | 27 | Load on demand by area — `solidjs-pitfalls` | `ui-conventions` | `api-layer` | |
| 28 | -`commit-workflow` | `dashboard-design`. Source of truth: `.claude/skills/<name>/SKILL.md`. | 28 | +`commit-workflow` | `dashboard-design` | |
| 29 | +`check-api-contract` (live Swagger/OpenAPI vs `src/api/`; check it before | ||
| 30 | +saying an endpoint does or does not exist — the backend repo is not local). | ||
| 31 | +Source of truth: `.claude/skills/<name>/SKILL.md`. | ||
| 29 | 32 | ||
| 30 | Deeper docs by area: `docs/ui/` · `docs/auth/` · `docs/frontend/` · `docs/backend/`. | 33 | Deeper docs by area: `docs/ui/` · `docs/auth/` · `docs/frontend/` · `docs/backend/`. |