backend-worker

Implement Cloudflare Workers API features with test-first vitest workflows.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/otography/otography-app --skill backend-worker-otography
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-worker
Source: https://github.com/otography/otography-app/tree/main/.agents/skills/backend-worker
Command: npx skills add https://github.com/otography/otography-app --skill backend-worker-otography

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implements a structured workflow for adding API features to a Cloudflare Workers project using test-driven development with vitest and the pool workers library.

Core Features & Use Cases

  • API feature implementation in apps/api/src including new route handlers (Hono), shared utilities (auth, Firebase, middleware), and database operations (Drizzle ORM).
  • Enforced test-first workflow with unit and integration tests using vitest and @cloudflare/vitest-pool-workers, plus test scaffolding patterns from existing tests.
  • Guidelines for startup and cleanup are delegated to the worker-base framework, ensuring predictable lifecycle management.

Quick Start

Create a new API feature by writing tests first and then implementing the route handlers and utilities in apps/api/src.

Frequently Asked Questions about backend-worker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement TDD for Cloudflare Workers API routes?

To implement TDD for Cloudflare Workers API routes, you write unit and integration tests first using vitest and the @cloudflare/vitest-pool-workers library. You then create route handlers with Hono and database operations with Drizzle ORM to pass those tests.

What is the errore error handling convention for Cloudflare Workers?

The errore error handling convention requires route handlers and shared utilities to return Error objects instead of throwing them. This approach manages exceptions predictably within your Cloudflare Workers API logic without disrupting execution flow.

Does this TDD workflow support Drizzle ORM and Hono in Cloudflare Workers?

Yes, this TDD workflow supports Drizzle ORM for database operations and Hono for route handlers within Cloudflare Workers. It provides a structured test-first approach for building APIs using these specific frameworks in apps/api/src.

How do I validate runtime data in Cloudflare Workers using arktype?

You validate runtime data in Cloudflare Workers using arktype alongside your test-driven development workflow. It enforces runtime validation for API requests and responses within your Hono route handlers before processing operations with Drizzle ORM.

Can I use existing Firebase and auth middleware with vitest-pool-workers?

Yes, you can use existing session-cookie, refresh-token, and firebase-admin modules with vitest-pool-workers. The test-driven workflow integrates these shared utilities and middleware seamlessly into your API integration tests.

Why does my Cloudflare Workers API test need the vitest-pool-workers library?

Your Cloudflare Workers API test needs the @cloudflare/vitest-pool-workers library to accurately simulate the Workers runtime environment during test-driven development. It ensures your unit and integration tests for Hono routes and Drizzle ORM operations execute with correct lifecycle management.