monkilabs/opencastle/api-patterns
Claude Code and agent skill by monkilabs/opencastle
- community
Checking that the SKILL.md file is still in the repository.
Conventions for HTTP endpoints, server actions and calls to external APIs: the contract, input validation, error shapes, status codes, versioning, pagination, retries and caching. Use when adding or changing an endpoint or server action, or wiring an external API.
Install
npx vskill@latest install monkilabs/opencastle/api-patternsSKILL.md
The same SKILL.md was published earlier as monkilabs/opencastle/api-patterns.
API Patterns
The project's endpoints and where they live: .opencastle/stack/api-config.md when it has one, and the skill bound to the framework slot. Match what the existing endpoints do; where they disagree, follow the majority and say so, rather than add a third way.
Contract first
Decide the request, the response, the status codes and the error cases before you write the handler. Writing the handler first is how inconsistent APIs happen.
- Validate every input with a schema at the top of the handler (Zod, Pydantic, the framework's validator): 400 or 422 on failure, naming the field.
- One error shape, such as
{ "error": { "code": "VALIDATION_ERROR", "message": "...", "details": [...] } }, with no stack trace or query in it. The status says what happened: 400, 401, 403, 404, 409, 422, 429, 500. - Lists are paginated, with a cursor when the data changes under the reader, and
limitcapped on the server. - Changes are additive. Add fields; never remove or rename one a client may use without a new version and a deprecation period.
Writes and side effects
- A mutation a client may retry is idempotent: an idempotency key, or an upsert on a natural key.
- Authorization is checked on the server for every call (security-hardening).
External APIs
- A timeout on every call. Retry only what is safe to repeat, at most twice, with backoff.
- Map their errors to your error shape, and log the upstream detail on the server.
Limits and caching
Rate-limit public endpoints. Set Cache-Control, and an ETag on responses clients poll.
Smoke-test a new endpoint against the dev server with curl -fsS before you call it done.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/orchestrator/skills/api-patterns/SKILL.md
Popularity
- Repository stars
- 61
- Repository forks
- 12
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/monkilabs/opencastle/api-patterns)