From 2d352653ffcb52ea16ada07a47622f284cfad207 Mon Sep 17 00:00:00 2001 From: hashem-cruncher <157300929+hashem-cruncher@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:21:12 +0300 Subject: [PATCH 1/2] Add AI Engineering Playbook core rules Added enterprise-grade AI behavior rules and full-stack guidelines to the playbook, focusing on architectural standards, token optimization, and security practices. --- rules/fullstack-ai-engineering-playbook.mdc | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 rules/fullstack-ai-engineering-playbook.mdc diff --git a/rules/fullstack-ai-engineering-playbook.mdc b/rules/fullstack-ai-engineering-playbook.mdc new file mode 100644 index 00000000..414fc3ad --- /dev/null +++ b/rules/fullstack-ai-engineering-playbook.mdc @@ -0,0 +1,33 @@ +--- +description: Enterprise-grade AI behavior rules, token optimization, and full-stack guidelines. Extracts from the Cursor AI Engineering Playbook. +globs: * +alwaysApply: false +--- + +# Cursor AI Engineering Playbook - Core Rules + +This rule enforces enterprise-grade architectural standards, minimizes token waste, and prevents AI hallucinations. + +> **Note:** This is a condensed version. For the complete AI-assisted engineering system, including structured workflows, debugging prompts, and project-start templates, visit the full playbook: +> 🔗 **[Cursor AI Engineering Playbook](https://github.com/hashem-cruncher/cursor-playbook)** + +## 1. Core AI Directives +- **Do Not Guess:** If context is missing, stop and ask the developer. +- **Scope Containment:** NEVER modify files outside the direct scope of the current task. +- **Token Economy:** Do not repeat the entire file in the output. Use precise search/replace blocks. +- **Simplicity Over Complexity:** Always prefer the most readable and straightforward solution. Avoid overengineering. + +## 2. Frontend Boundaries (React / Next.js) +- Build small, single-responsibility components. +- Default to Server Components for data fetching. Use `"use client"` only when interactivity is required. +- Strict TypeScript: No `any` types allowed. + +## 3. Backend Boundaries (FastAPI / Node.js) +- **Clean Architecture:** Strictly separate Routing (Endpoints) -> Service Layer (Business Logic) -> Data Access (Models). +- **Validation:** Validate all incoming requests at the boundary layer. +- **Error Handling:** Never leak internal stack traces to the client. + +## 4. Security +- Never hardcode secrets. Always use environment variables. +- Treat all data originating from the client as malicious. +- Use parameterized database queries or strict ORM methods to prevent injection. From 1bb4a3f8cc7c06668b66fcda8da26f1f79a15557 Mon Sep 17 00:00:00 2001 From: hashem-cruncher <157300929+hashem-cruncher@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:25:30 +0300 Subject: [PATCH 2/2] docs: update README with legacy project onboarding and usage workflows - Added a new 'Project Initialization' section detailing distinct paths for brand new projects (Scenario A) and legacy/existing codebases (Scenario B). - Restructured the 'Daily Operating Workflow' to clearly separate feature development, debugging, and code review phases. - Highlighted token optimization strategies to minimize API costs and prevent context bloat. - Organized the 'System Index' with direct links to all playbook files for faster navigation inside the IDE. - Improved overall readability, visual hierarchy, and formatting. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8204dac5..8b73c958 100644 --- a/README.md +++ b/README.md @@ -248,6 +248,7 @@ By adding selected `.mdc` files to `.cursor/rules/`, you can use these rules dir - [Code Style Consistency](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/code-style-consistency-cursorrules-prompt-file.mdc) - Code development with style consistency integration. - [Embedded MCU / STM32 / HAL](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/embedded-stm32-hal.mdc) - Embedded C/C++ development with STM32 HAL, interrupts, DMA, memory constraints, and hardware-focused testing. - [Engineering Ticket Template](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/engineering-ticket-template-cursorrules-prompt-file.mdc) - Engineering development with ticket template integration. +- [Full-Stack AI Engineering Playbook](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/fullstack-ai-engineering-playbook.mdc) - Enterprise-grade AI behavior rules, token optimization strategies, and full-stack guidelines for structured AI-assisted development. - [GitHub Code Quality](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/github-code-quality-cursorrules-prompt-file.mdc) - GitHub development with code quality integration. - [GitHub Instructions](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/github-cursorrules-prompt-file-instructions.mdc) - GitHub development with instructions integration. - [Git Commit Messages](https://github.com/PatrickJS/awesome-cursorrules/blob/main/rules/git-conventional-commit-messages.mdc) - Git development with conventional commit messages integration.