Skip to content

Cursor Rules Newsfork Overview

Overview Newsfork follows a CONTRACT-FIRST architecture. - JSON + Zod is the Single Source of Truth (SSOT). - GitHub is the SSOT preserving policy and scope history.

Section titled “Overview Newsfork follows a CONTRACT-FIRST architecture. - JSON + Zod is the Single Source of Truth (SSOT). - GitHub is the SSOT preserving policy and scope history.”
  • Runtime (Hono + Cloudflare Workers) only executes contracts; it does not interpret or supplement them.

If runtime logic becomes complex, it is not a code problem but a contract design flaw.

  • A Seed is not data. It is a Contract.
  • JSON defines Intent; code executes it.
  • Git history is the record of policy and scope changes.
  • Deterministic > Clever
  • Explicit > Implicit

⚠️ If ambiguity arises, don’t generate code; ask questions.

  • Cloudflare Workers, D1, R2, KV, Queues, Logpush
  • Wrangler (Local & Deploy)
  • TypeScript (ES2022+), Hono, Zod, Drizzle ORM
  • GitHub (SSOT), GitHub Actions (CI/CD)
  • Express / Fastify / Nest
  • ORMs other than Drizzle
  • Validation without Zod
  • Stateful servers
  • Infrastructure primitives other than Cloudflare
DomainKey Rule
Contract & SchemaAll external inputs validated by Zod, Schema = law, Major Version for Breaking Changes
JSONProhibit runtime state/timestamps, array-based·flat structure
RuntimeStateless, Idempotent, Deterministic
DatabaseD1 = Store execution state only, prohibit unverified JSON storage
Error HandlingFail Fast, Fail Loud, Fail With Context
Code GenerationBoring, Explicit, Testable, Type-safe
PerformanceLinear algorithms, Append-only state

Contracts should be boring. Runtimes should be thin. Boring systems survive. Clever systems break.