002-project-technical-details

002-project-technical-details is a cursor rule for Cursor from passionmuse16/food-tracker. It costs 2,221 tokens per session, scanned A, original, MIT.

Project instructions for building a Next.js application on Cloudflare Workers, a platform for running code at the network edge. They also describe Cloudflare storage services such as D1, KV, and R2.

In plain words
What is it for?
Use them when adding features, storage, or configuration to this Cloudflare-based Next.js project.
Why use it?
They keep development choices consistent with the project's existing Cloudflare setup, package manager, database process, and generated types.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when adding features, storage, or configuration to this Cloudflare-based Next.js project.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/passionmuse16/food-tracker/002-project-technical-details
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/passionmuse16/food-tracker

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 002-project-technical-details

README.md
[![agentmods](https://agentmods.dev/badge/rules/passionmuse16/food-tracker/002-project-technical-details.svg)](https://agentmods.dev/rules/passionmuse16/food-tracker/002-project-technical-details)
Your own site
<a href="https://agentmods.dev/rules/passionmuse16/food-tracker/002-project-technical-details"><img src="https://agentmods.dev/badge/rules/passionmuse16/food-tracker/002-project-technical-details.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,221 This file is loaded in full into every session.
When invoked 2,221 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02221 $0.02221
Opus 5 $0.01111 $0.01111
Sonnet 5 $0.00444 $0.00444
Haiku 4.5 $0.00222 $0.00222

Measured 8d ago against content hash cacb3dbb1081, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

002-project-technical-details scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/002-project-technical-details.mdc · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Project Technical Details

Note: This project is based on an open source Next.js SaaS template for Cloudflare Workers. You can find the original template at: https://github.com/LubomirGeorgiev/cloudflare-workers-nextjs-saas-template

Cloudflare Stack

You are also excellent at Cloudflare Workers and other tools like D1 serverless database and KV. You can suggest usage of new tools (changes in wrangler.jsonc file) to add more primitives like:

  • R2: File storage
  • KV: Key-value storage
    • Always use the existing KV namespace in wrangler.jsonc don't ever create new ones.
  • AI: AI multimodal inference
  • others primitives in wrangler.jsonc
  • After adding a new primitive to wrangler.jsonc, always run pnpm run cf-typegen to generate the new types.

Package Management

In the terminal, you are also an expert at suggesting wrangler commands

  • Always use pnpm to install dependencies.

Migration Commands

Never generate SQL migration files. Instead after making changes to ./src/db/migrations you should run pnpm db:generate [MIGRATION_NAME] to generate the migrations.

Tech Stack Overview

Frontend

  • Next.js 15 (App Router)
  • React Server Components
  • TypeScript
  • Tailwind CSS
  • Shadcn UI (Built on Radix UI)
  • Lucide Icons
  • NUQS for URL state management
  • Zustand for client state

Backend (Cloudflare Workers with OpenNext)

  • DrizzleORM
  • Cloudflare D1 (SQLite Database)
  • Cloudflare KV (Session/Cache Storage)
  • Cloudflare R2 (File Storage)
  • OpenNext for SSR/Edge deployment

Authentication & Authorization

  • Lucia Auth (User Management)
  • KV-based session management
  • CUID2 for ID generation
  • Team-based multi-tenancy

Project Structure

├── src/                          # Source directory
│   ├── actions/                  # Server actions
│   │   ├── credits.action.ts
│   │   ├── sign-out.action.ts
│   │   ├── team-actions.ts
│   │   ├── team-membership-actions.ts
│   │   └── team-role-actions.ts
│   ├── app/                      # Next.js App Router
│   │   ├── (admin)/              # Admin routes
│   │   │   └── admin/
│   │   │       ├── _actions/     # Admin-specific actions
│   │   │       ├── _components/  # Admin-specific components
│   │   │       └── users/        # User management
│   │   ├── (auth)/               # Auth-related routes
│   │   │   ├── _components/      # Auth components (SSO buttons, etc.)
│   │   │   ├── sign-in/          # Sign in functionality
│   │   │   ├── sign-up/          # Sign up functionality
│   │   │   ├── forgot-password/  # Password reset request
│   │   │   ├── reset-password/   # Password reset completion
│   │   │   ├── passkey/          # Passkey/WebAuthn authentication
│   │   │   ├── sso/              # SSO authentication
│   │   │   │   └── google/       # Google OAuth
│   │   │   ├── team-invite/      # Team invitation acceptance
│   │   │   └── verify-email/     # Email verification
│   │   ├── (dashboard)/          # Dashboard and app features
│   │   │   ├── dashboard/        # Main dashboard
│   │   │   └── layout.tsx
│   │   ├── (legal)/              # Legal pages (terms, privacy)
│   │   ├── (marketing)/          # Landing pages and marketing
│   │   ├── (settings)/           # User settings pages
│   │   │   └── settings/
│   │   │       ├── profile/      # Profile settings
│   │   │       └── sessions/     # Session management
│   │   ├── teams/                # Team management
│   │   │   ├── [teamSlug]/       # Team-specific routes (dynamic)
│   │   │   │   ├── members/      # Team member management
│   │   │   │   ├── settings/     # Team settings
│   │   │   │   └── billing/      # Team billing
│   │   │   └── create/           # Team creation
│   │   ├── dashboard/            # Additional dashboard routes
│   │   │   └── billing/          # User billing
│   │   ├── api/                  # API routes
│   │   │   ├── auth/             # Auth API endpoints
│   │   │   └── get-session/      # Session retrieval
│   │   └── globals.css           # Global styles
│   ├── components/               # React components
│   │   ├── landing/              # Landing page components
│   │   ├── teams/                # Team-related components
│   │   └── ui/                   # Shadcn UI components
│   ├── db/                       # Database related code
│   │   ├── migrations/           # Database migrations
│   │   └── schema.ts             # DrizzleORM schema
│   ├── hooks/                    # Custom React hooks
│   │   ├── useMediaQuery.ts
│   │   └── useSignOut.ts
│   ├── icons/                    # Custom icon components
│   ├── layouts/                  # Layout components
│   ├── lib/                      # Library utilities
│   │   ├── sso/                  # SSO integrations
│   │   ├── stripe.ts             # Stripe integration
│   │   ├── try-catch.ts          # Error handling utilities
│   │   └── utils.ts              # General utilities
│   ├── react-email/              # Email templates with react-email
│   │   ├── reset-password.tsx
│   │   ├── verify-email.tsx
│   │   └── team-invite.tsx
│   ├── schemas/                  # Zod validation schemas
│   ├── server/                   # Server-side utilities
│   │   ├── team-members.ts
│   │   ├── team-roles.ts
│   │   └── teams.ts
│   ├── state/                    # Client state management (Zustand)
│   │   ├── config.ts
│   │   ├── nav.ts
│   │   ├── session.ts
│   │   └── transaction.ts
│   ├── utils/                    # Core utilities
│   │   ├── auth.ts               # Authentication logic
│   │   ├── auth-utils.ts         # Auth helper utilities
│   │   ├── credits.ts            # Credit system utilities
│   │   ├── email.tsx             # Email sending utilities
│   │   ├── kv-session.ts         # Session handling with KV
│   │   ├── team-auth.ts          # Team authorization utilities
│   │   ├── rate-limit.ts         # Rate limiting
│   │   ├── webauthn.ts           # WebAuthn/Passkey utilities
│   │   └── with-kv-cache.ts      # KV caching utilities
│   ├── constants.ts              # Application constants
│   ├── flags.ts                  # Feature flags
│   └── types.ts                  # Type definitions
├── public/                       # Static assets
├── scripts/                      # Build and deployment scripts
└── .wrangler/                    # Cloudflare Workers config

Read the full file on GitHub · 226 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 226 lines · 2,221 tokens per session scan A cacb3dbb1081

Subscribe to this mod's changes

002-project-technical-details is a cursor rule published in the GitHub repository passionmuse16/food-tracker (2 stars, last pushed 10mo ago), licensed MIT. It adds 2,221 tokens to every session, about $0.0111 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.