Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

write-api-route

Skill by ryokun6

Explains how to create or modify ryOS backend API routes under api/ using the apiHandler wrapper, auth, Redis, rate limiting, and CORS conventions. Aimed at developers adding endpoints to the ryOS project.

  • Score 78
  • 1.3k stars
  • AGPL-3.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install write-api-route

Built from the published package, never by AI.

git clone --depth 1 https://github.com/ryokun6/ryos /tmp/ryos && mkdir -p ~/.claude/skills && cp -r /tmp/ryos/.cursor/skills/write-api-route ~/.claude/skills/write-api-route

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install write-api-route in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill is a practical checklist for writing and changing backend API routes in the ryOS project. Routes live under the api/ directory as Node-style handlers and are served by the standalone Bun server at scripts/api-standalone-server.ts. It points to docs/8.10-api-design-guide.md as the full contract, and it covers file and naming conventions for collection, item, and nested routes.

The skill shows how to wrap handlers in apiHandler with auth modes (none, optional, required, admin), Zod body validation, rate limiting, shared Redis key prefixes, and explicit JSON error shapes. It also covers manual handlers for cases like multipart uploads, SSE streaming, and integration tests. It is for developers who add or change endpoints in ryOS.

Written from the project's SKILL.md and checked against it.

What it can do

  • Scaffold apiHandler routesWraps a route in apiHandler with methods, auth, and an optional Zod bodySchema.
  • Configure request authSets auth to none, optional, required, or admin using request-auth helpers.
  • Add rate limitingApplies per-IP counter limits with Retry-After headers and 429 responses.
  • Validate inputValidates request bodies with Zod or the shared _validation.ts helpers.
  • Use shared Redis keysKeys Redis entries with REDIS_PREFIXES and shared TTL values from constants.
  • Write manual handlersMirrors CORS, origin checks, and auth for routes that cannot use apiHandler.
  • Stream responses over SSEUses the _sse.ts helpers to emit start, line, complete, and error events.
  • Write API integration testsAdds suites under tests/integration/api/ using the shared test helpers.

What you need

  • Bun runtime
  • Redis (Upstash REST or standard Redis backend)
  • The ryOS repository

Try asking

  • Create a POST endpoint under api/ that requires auth and validates the body with Zod
  • Add a public rate-limited GET route that returns a list of items
  • Write an integration test for my new api/notes route

Good to know

  • API integration tests need the standalone server running with bun run dev:api
  • Shared module imports must use the .js extension
  • Multipart routes such as /api/audio-transcribe use manual handlers instead of apiHandler

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .cursor/skills/write-api-route/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to write-api-route

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

write-api-route: common questions

Which wrapper should new API endpoints use?

The skill says to prefer apiHandler for all new JSON endpoints. It handles CORS, method checks, auth, body validation, and a 500 fallback.

How does request authentication work for these routes?

Auth is handled by _utils/request-auth.ts with the auth option set to none, optional, required, or admin. Required auth needs both a Bearer token and an X-Username header.

How do I run API tests for ryOS routes?

Start the standalone server with bun run dev:api in one terminal, then run bun run test:api in another.

How do I install write-api-route?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is write-api-route free?

The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.

Is write-api-route safe to use?

It scores 78 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to write-api-route?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

write-api-route Install

Add to stack

Loading.