From d40c4b3e83501395da005fa6d8be08df4f7ba397 Mon Sep 17 00:00:00 2001 From: oliviacraft Date: Sat, 4 Apr 2026 18:12:08 -0300 Subject: [PATCH 1/4] Add cursor-rules-pack-v2 sample rules --- .../.cursorrules | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 rules/cursor-rules-pack-v2-cursorrules-prompt-file/.cursorrules diff --git a/rules/cursor-rules-pack-v2-cursorrules-prompt-file/.cursorrules b/rules/cursor-rules-pack-v2-cursorrules-prompt-file/.cursorrules new file mode 100644 index 00000000..bda209e0 --- /dev/null +++ b/rules/cursor-rules-pack-v2-cursorrules-prompt-file/.cursorrules @@ -0,0 +1,29 @@ +# Cursor Rules Pack v2 — Sample Rules +# 7 production-tested rules from the full 50-rule pack +# Full pack: https://oliviacraftlat.gumroad.com/l/wyaeil + +## Rule 1 — Dependency Discipline +Before suggesting a new npm package: (1) state what it does in one sentence, (2) check if it's actively maintained (last publish < 6 months), (3) confirm whether we could implement it in < 30 lines without the dependency. Prefer fewer, well-maintained packages. Never add a dependency for a task under 20 lines of code. + +## Rule 2 — Explicit Error Handling +Always wrap async operations in try/catch. Never swallow errors silently. Return typed error objects using a Result pattern or throw typed errors. Log errors with context: logger.error('[FunctionName] description', { error, context }). Always provide user-facing error states in UI components. + +## Rule 3 — Comments Policy +Write self-documenting code first. Add comments only for: (1) non-obvious business logic — explain WHY, not WHAT, (2) workarounds — explain why the workaround exists and link to the issue, (3) complex algorithms — reference the algorithm name. Never comment what the code clearly does. + +## Rule 4 — State Management Hierarchy +Follow this state hierarchy strictly: +- URL state → filters, pagination, search (useSearchParams) +- React state → UI-only, ephemeral (useState) +- Zustand → cross-component app state +- React Query → all server state +Never use Zustand to cache server data — that's React Query's job. Never reach for Redux. + +## Rule 5 — Parallel Data Fetching +Identify and parallelize independent data fetches. Never await sequentially when operations are independent — use Promise.all. When making a sequential await, add a comment explaining the dependency that forces the sequence. + +## Rule 6 — Webhook Security +For incoming webhooks: verify the signature in the first 3 lines of the handler — reject immediately if invalid. Respond with HTTP 200 within 5 seconds — offload processing to a background job. Store the raw webhook event before processing. Implement idempotency using the event ID. + +## Rule 7 — Database Query Safety +Never return full database records to the client — always use select to specify exactly which fields are needed. This prevents accidentally exposing password hashes, reset tokens, internal flags, and other sensitive fields. For queries that could return more than 50 rows, always add pagination (take/skip or cursor-based). From edb122604fbc49e10222d64fcbfd5f9ed42ad6b9 Mon Sep 17 00:00:00 2001 From: oliviacraft Date: Sat, 4 Apr 2026 18:12:09 -0300 Subject: [PATCH 2/4] Add cursor-rules-pack-v2 sample rules --- .../README.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 rules/cursor-rules-pack-v2-cursorrules-prompt-file/README.md diff --git a/rules/cursor-rules-pack-v2-cursorrules-prompt-file/README.md b/rules/cursor-rules-pack-v2-cursorrules-prompt-file/README.md new file mode 100644 index 00000000..977e94a8 --- /dev/null +++ b/rules/cursor-rules-pack-v2-cursorrules-prompt-file/README.md @@ -0,0 +1,25 @@ +# Cursor Rules Pack v2 — Sample + +7 production-tested rules from the [Cursor Rules Pack v2](https://oliviacraftlat.gumroad.com/l/wyaeil). + +These cover dependency management, error handling, comments policy, state management, data fetching, webhook security, and database safety — with before/after examples. + +## Usage + +Copy `.cursorrules` to your project root. Cursor picks it up immediately. + +## Full Pack + +The complete pack includes 50 rules across 5 sections: +- General Coding (10 rules) +- Next.js & React (10 rules) +- Database & Backend (10 rules) +- AI Behavior (10 rules) +- Project-Specific Templates (10 rules) + +→ **[$27 — instant download](https://oliviacraftlat.gumroad.com/l/wyaeil)** + +## Source + +- Author: [@OliviaCraftLat](https://x.com/OliviaCraftLat) +- Sample repo: [github.com/oliviacraft/cursor-rules-pack-sample](https://github.com/oliviacraft/cursor-rules-pack-sample) From 93036d3713f5cd9ca566854810f4e0fc57c7ba33 Mon Sep 17 00:00:00 2001 From: oliviacraft Date: Sat, 4 Apr 2026 18:12:21 -0300 Subject: [PATCH 3/4] Add Cursor Rules Pack v2 to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 63c6a2ff..94a41c2d 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ By creating a `.cursorrules` file in your project's root directory, you can leve - [React Native Expo](./rules/react-native-expo-cursorrules-prompt-file/.cursorrules) - Cursor rules for React Native Expo development. - [SwiftUI Guidelines](./rules/swiftui-guidelines-cursorrules-prompt-file/.cursorrules) - Cursor rules for SwiftUI development guidelines. - [TypeScript (Expo, Jest, Detox)](./rules/typescript-expo-jest-detox-cursorrules-prompt-file/.cursorrules) - Cursor rules for TypeScript development with Expo, Jest, and Detox integration. +- [Cursor Rules Pack v2](https://github.com/oliviacraft/cursor-rules-pack-sample) - 7 sample production-tested rules (dependency discipline, error handling, state management, webhook security, and more). Full pack: 50 rules for $27. - [Android Native (Jetpack Compose)](./rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules) - Cursor rules for Android development with Jetpack Compose integration. - [Flutter Expert](./rules/flutter-app-expert-cursorrules-prompt-file/.cursorrules) - Cursor rules for Flutter development with expert integration. - [UIKit Guidelines](./rules/uikit-guidelines-cursorrules-prompt-file/.cursorrules) - Cursor rules for UIKit development guidelines. From 6fbc5ec4bf1664ce018355b504e753473421f10f Mon Sep 17 00:00:00 2001 From: oliviacraft Date: Mon, 6 Apr 2026 03:44:38 -0400 Subject: [PATCH 4/4] fix: use relative link for Cursor Rules Pack v2, sort Mobile Development alphabetically Addresses CodeRabbit review feedback: - Replace external GitHub link with relative in-repo path - Remove commercial CTA from description - Sort Mobile Development section alphabetically --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 94a41c2d..55290838 100644 --- a/README.md +++ b/README.md @@ -158,14 +158,14 @@ By creating a `.cursorrules` file in your project's root directory, you can leve ### Mobile Development +- [Android Native (Jetpack Compose)](./rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules) - Cursor rules for Android development with Jetpack Compose integration. +- [Cursor Rules Pack v2](./rules/cursor-rules-pack-v2-cursorrules-prompt-file/.cursorrules) - 7 sample production-tested rules (dependency discipline, error handling, state management, webhook security, and more). See the pack README for full-pack details. +- [Flutter Expert](./rules/flutter-app-expert-cursorrules-prompt-file/.cursorrules) - Cursor rules for Flutter development with expert integration. +- [NativeScript](./rules/nativescript-cursorrules-prompt-file/.cursorrules) - Cursor rules for NativeScript development. - [React Native Expo](./rules/react-native-expo-cursorrules-prompt-file/.cursorrules) - Cursor rules for React Native Expo development. - [SwiftUI Guidelines](./rules/swiftui-guidelines-cursorrules-prompt-file/.cursorrules) - Cursor rules for SwiftUI development guidelines. - [TypeScript (Expo, Jest, Detox)](./rules/typescript-expo-jest-detox-cursorrules-prompt-file/.cursorrules) - Cursor rules for TypeScript development with Expo, Jest, and Detox integration. -- [Cursor Rules Pack v2](https://github.com/oliviacraft/cursor-rules-pack-sample) - 7 sample production-tested rules (dependency discipline, error handling, state management, webhook security, and more). Full pack: 50 rules for $27. -- [Android Native (Jetpack Compose)](./rules/android-jetpack-compose-cursorrules-prompt-file/.cursorrules) - Cursor rules for Android development with Jetpack Compose integration. -- [Flutter Expert](./rules/flutter-app-expert-cursorrules-prompt-file/.cursorrules) - Cursor rules for Flutter development with expert integration. - [UIKit Guidelines](./rules/uikit-guidelines-cursorrules-prompt-file/.cursorrules) - Cursor rules for UIKit development guidelines. -- [NativeScript](./rules/nativescript-cursorrules-prompt-file/.cursorrules) - Cursor rules for NativeScript development. ### CSS and Styling