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. 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.