Index of every page on this site: llms.txt
All skills
theprimeagen avatar

/cloudflare-project

@fa570dd
by theprimeagentheprimeagen/skills237 stars
8
Run it yourself

Cloudflare Hono TypeScript project rules

  • 1 file
  • 2.4 KB
  • Updated 9 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/theprimeagen/skills/cloudflare-project

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈15 tokens for metadata: the name and description. ≈588 when used: this file.

SKILL.md has missing or invalid fields
  • The name in the SKILL.md header is missing or is not text.
Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Cloudflare Project (Hono + TypeScript)

Rules

  1. Bootstrap every new project with Cloudflare C3 via npx, using TypeScript and Hono: npx create-cloudflare@latest <project-name> --framework=hono --lang=ts.
  2. Use wrangler.jsonc as the Wrangler config file (not TOML), and keep bindings plus compatibility settings as the source of truth there.
  3. Keep TypeScript at strictest settings: extend @tsconfig/strictest/tsconfig.json (or equivalent strictest flags) and do not relax strict options.
  4. Generate runtime and binding types with npx wrangler types; include ./worker-configuration.d.ts in tsconfig.json and rerun after any wrangler.jsonc change.
  5. Do not define routes inline in the worker entrypoint; each route must be a named function in route modules grouped by domain (for example src/routes/auth.ts) and then mounted from src/index.ts.
  6. If the project includes a UI framework, use Rsbuild to build the frontend artifact.
  7. Use Oxlint for both prettier-style formatting checks and lint checks.
  8. Use tsgo for type checking.

Example 1: Bootstrap + strict typing + Wrangler types

npx create-cloudflare@latest my-api --framework=hono --lang=ts
cd my-api
npm i -D @tsconfig/strictest
npx wrangler types
// tsconfig.json
{
  "extends": "@tsconfig/strictest/tsconfig.json",
  "compilerOptions": {
    "types": ["./worker-configuration.d.ts"]
  }
}

Example 2: Grouped route functions (routes/auth.ts)

// src/routes/auth.ts
import { Hono } from "hono";
import type { Context } from "hono";

type AppEnv = { Bindings: Env };

const auth = new Hono<AppEnv>();

async function login(c: Context<AppEnv>) {
  return c.json({ ok: true });
}

async function logout(c: Context<AppEnv>) {
  return c.json({ ok: true });
}

auth.post("/login", login);
auth.post("/logout", logout);

export function registerAuthRoutes(app: Hono<AppEnv>) {
  app.route("/auth", auth);
}
// src/index.ts
import { Hono } from "hono";
import { registerAuthRoutes } from "./routes/auth";

const app = new Hono<{ Bindings: Env }>();

registerAuthRoutes(app);

export default app;

Example 3: Rsbuild + Oxlint + tsgo scripts

// package.json
{
  "scripts": {
    "build:ui": "rsbuild build",
    "lint": "oxlint .",
    "format:check": "oxlint .",
    "typecheck": "tsgo"
  }
}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at fa570dd. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Dormantupdated 9 months ago
globs
src/**/*.ts
alwaysApply
false

README badge

README badge for theprimeagen/skills/cloudflare-project