$git clone https://github.com/TheSethRose/DevRulesA comprehensive collection of AI prompt engineering rules designed to enhance AI-assisted development workflows.
| 1 | # DevRules |
| 2 | |
| 3 | A comprehensive collection of AI prompt engineering rules designed to enhance AI-assisted development workflows. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | DevRules is a structured set of rule files that help AI tools better understand your codebase, project structure, and development preferences. These rules guide AI in providing more contextually relevant, accurate, and helpful responses for various development tasks. |
| 8 | |
| 9 | ## Structure |
| 10 | |
| 11 | The rules are organized in `.cursor/rules/` with a clear organizational structure: |
| 12 | |
| 13 | - **Core rules**: Foundation files that define AI behavior and project context (`00-*`, `01-*`, `02-*`, `03-*`). |
| 14 | - **Tasks (`tasks/`)**: Task-specific rules defining specialized AI behaviors (e.g., `Refactor-Code.mdc`). |
| 15 | - **Language rules**: Best practices and patterns for specific programming languages in the `languages/` directory. |
| 16 | - **Technology rules**: Best practices for specific frameworks, libraries, or tools in the `technologies/` directory. |
| 17 | |
| 18 | ``` |
| 19 | .cursor/rules/ |
| 20 | ├── 00-core-agent.mdc # Core AI instructions |
| 21 | ├── 01-project-context.mdc # Project-specific details (customize!) |
| 22 | ├── 02-common-errors.mdc # Common mistakes to avoid (customize!) |
| 23 | ├── 03-mcp-configuration.mdc# MCP server capabilities (populate!) |
| 24 | ├── tasks/ # Task-specific behavior rules (e.g., Refactor-Code.mdc) |
| 25 | │ └── ... |
| 26 | ├── languages/ # Language-specific best practices (e.g., Python3.mdc) |
| 27 | │ └── ... |
| 28 | └── technologies/ # Framework/library rules (e.g., React19.mdc, NodeExpress.mdc) |
| 29 | └── ... |
| 30 | ``` |
| 31 | |
| 32 | ## Key Features |
| 33 | |
| 34 | - **Consistent AI assistance** across your entire development workflow |
| 35 | - **Task-specific guidance** for different development activities |
| 36 | - **Language-specific guidance** for coding best practices |
| 37 | - **Technology-specific guidance** for frameworks and libraries |
| 38 | - **Project-specific context** for more relevant suggestions |
| 39 | - **Error prevention** through common mistake documentation |
| 40 | - **Reduced repetition** of instructions to AI tools |
| 41 | |
| 42 | ## Getting Started |
| 43 | |
| 44 | 1. Install DevRules with a single command: |
| 45 | |
| 46 | ```bash |
| 47 | curl -fsSL https://raw.githubusercontent.com/TheSethRose/DevRules/main/install.sh | sh |
| 48 | ``` |
| 49 | |
| 50 | 2. Customize the core configuration files to match your project needs: |
| 51 | - `01-project-context.mdc`: Add your tech stack, project structure, and conventions. |
| 52 | - `02-common-errors.mdc`: Document project-specific pitfalls to avoid. |
| 53 | 3. **(Recommended)** Populate `03-mcp-configuration.mdc` to inform the AI about your available MCP tools: |
| 54 | a. Open Cursor Settings (Cmd+, or Ctrl+,). |
| 55 | b. Navigate to the 'MCP' section. |
| 56 | c. Click the button/link to open your global `~/.cursor/mcp.json` file. |
| 57 | d. Ensure `mcp.json` is the active/focused file in your editor. |
| 58 | e. Return to the AI chat and ask it: "Please populate `.cursor/rules/03-mcp-configuration.mdc` based on the attached `mcp.json` context." |
| 59 | 4. Use with compatible AI development assistants (e.g., Cursor). |
| 60 | |
| 61 | ### Updating |
| 62 | |
| 63 | To update the standard `tasks/`, `languages/`, `technologies/` rules and the core `00-core-agent.mdc`, while preserving your customized `01-project-context.mdc` and `02-common-errors.mdc`: |
| 64 | |
| 65 | ```bash |
| 66 | curl -fsSL https://raw.githubusercontent.com/TheSethRose/DevRules/main/install.sh | sh -s -- --upgrade |
| 67 | ``` |
| 68 | *Note: The upgrade process preserves `03-mcp-configuration.mdc`. If new standard MCP servers are added to DevRules in the future, you may need to manually update your `03-mcp-configuration.mdc` or ask the AI to regenerate it.* |
| 69 | |
| 70 | ## Usage Examples |
| 71 | |
| 72 | ### Activating a Task Rule |
| 73 | |
| 74 | You can explicitly request a specific task rule: |
| 75 | |
| 76 | ``` |
| 77 | Please refactor this code using @tasks/Refactor-Code.mdc |
| 78 | ``` |
| 79 | |
| 80 | Or the AI might activate a task rule semantically based on your request. |
| 81 | |
| 82 | ### Providing Project Context |
| 83 | |
| 84 | For new projects, you should update the project context file: |
| 85 | |
| 86 | ``` |
| 87 | Please update the project context with our React/Node.js stack and component structure. |
| 88 | ``` |
| 89 | |
| 90 | ### Documenting Common Errors |
| 91 | |
| 92 | Add project-specific patterns to avoid: |
| 93 | |
| 94 | ``` |
| 95 | Please add a common erro |