AGENT SKILL

cloudflare-hono-architect

Prevents Node.js module hallucinations in Cloudflare Worker (V8 isolate) edge environments. Use when writing Hono routes deployed to Workers — prefer Web APIs (Fetch, Web Crypto) over Node built-ins (`fs`, `path`, `child_process`, `crypto`), and access bindings via Hono's `c.env`.

License 许可
MIT
最近更新
2026-05-27
Stars
★ 0
Forks
0

01 前言 Front Matter

name
cloudflare-hono-architect
vendor
cloudflare
description
Prevents Node.js module hallucinations in Cloudflare Worker (V8 isolate) edge environments. Use when writing Hono routes deployed to Workers — prefer Web APIs (Fetch, Web Crypto) over Node built-ins (`fs`, `path`, `child_process`, `crypto`), and access bindings via Hono's `c.env`.

02 资源文件 1

03 SKILL.md 正文

Cloudflare Worker & Hono Architect

Policy Capsule

  • Never import Node.js built-ins (fs, path, child_process, Node's crypto) in Worker code — they do not exist in the V8 isolate runtime.
  • Use the Web Crypto API for hashing, signing, and random bytes; do not reach for node:crypto.
  • Access bindings (env vars, R2 buckets, KV, Queues, D1) only through Hono's context (c.env), never through process.env.
  • Prefer Web platform APIs (fetch, Request, Response, URLPattern) over Node-flavored equivalents.
  • Treat any import that resolves to a Node-only polyfill as a hallucination — surface and remove it.

Description: Prevents Node.js module hallucinations in edge environments.

Instruction: The API is built with Hono and deployed to Cloudflare Workers (V8 Isolates).

  • YOU MUST NOT use standard Node.js built-ins (e.g., fs, path, child_process).
  • If cryptography is needed, use the standard Web Crypto API, not Node's crypto.
  • Access all environment variables, R2 buckets, and Queues strictly through the Hono Context bindings (c.env).

04 同仓库更多 Skills

chrisbarrantes
chrisbarrantes/mandrel

no-capsule-skill

Fixture without a Policy Capsule section.

★ 0
chrisbarrantes
chrisbarrantes/mandrel

backend-security-patterns

Combined backend protocols for authentication (Clerk JWT verification) and PII-safe observability. Use when handling auth on the server, verifying Clerk webhooks via `svix`, scoping metadata via `publicMetadata`/ `privateMetadata`, or sanitizing logs to keep emails, tokens, and request bodies out of telemetry.

★ 0
chrisbarrantes
chrisbarrantes/mandrel

vitest

Writes fast, isolated unit and integration tests with Vitest. Use when each test must run on file-save without shared state — `vi.mock()` for external deps, `vi.spyOn()` for call monitoring, AAA structure, and edge-case coverage for null/undefined/boundary inputs.

★ 0
chrisbarrantes
chrisbarrantes/mandrel

playwright

Robust E2E browser testing with Playwright. Use when writing browser-driven tests — leverage auto-waiting (no `waitForTimeout`), prefer user-visible locators (`getByRole`, `getByText`, `getByLabel`) over CSS/XPath, reuse `storageState` for auth, and enable trace-on-first-retry for CI debugging.

★ 0
chrisbarrantes
chrisbarrantes/mandrel

playwright-bdd

Wires Gherkin `.feature` files to Playwright via the `playwright-bdd` library. Use when running BDD scenarios on a Playwright runtime — pairs with the `gherkin-authoring` skill (scenario prose) and the `playwright` skill (browser conventions). Drives execution by tag expression with trace-first debugging and Playwright-native sharding.

★ 0
chrisbarrantes
chrisbarrantes/mandrel

lighthouse-baseline

Codifies the capture-and-check baseline pattern for long-running quality signals (Lighthouse scores, bundle size, p95 latency, runtime memory). Use when wiring a new metric that needs a baseline file, paired :capture / :check npm scripts, a tolerance-bounded gate, and a weekly refresh cadence — the goal is a hard CI signal that ratchets only with intent.

★ 0