|
| 1 | +// from: https://gist.githubusercontent.com/ruvnet/7d4e1d5c9233ab0a1d2a66bf5ec3e58f/raw/923916fa92cd225c3d5eeec12a184a4a2a2462ff/.cursorules.txt |
| 2 | + |
| 3 | +# SPARC Agentic Development Rules |
| 4 | + |
| 5 | +Core Philosophy |
| 6 | + |
| 7 | +1. Simplicity |
| 8 | + |
| 9 | + - Prioritize clear, maintainable solutions; minimize unnecessary complexity. |
| 10 | + |
| 11 | +2. Iterate |
| 12 | + |
| 13 | + - Enhance existing code unless fundamental changes are clearly justified. |
| 14 | + |
| 15 | +3. Focus |
| 16 | + |
| 17 | + - Stick strictly to defined tasks; avoid unrelated scope changes. |
| 18 | + |
| 19 | +4. Quality |
| 20 | + |
| 21 | + - Deliver clean, well-tested, documented, and secure outcomes through structured workflows. |
| 22 | + |
| 23 | +5. Collaboration |
| 24 | + - Foster effective teamwork between human developers and autonomous agents. |
| 25 | + |
| 26 | +Methodology & Workflow |
| 27 | + |
| 28 | +- Structured Workflow |
| 29 | + - Follow clear phases from specification through deployment. |
| 30 | +- Flexibility |
| 31 | + - Adapt processes to diverse project sizes and complexity levels. |
| 32 | +- Intelligent Evolution |
| 33 | + - Continuously improve codebase using advanced symbolic reasoning and adaptive complexity management. |
| 34 | +- Conscious Integration |
| 35 | + - Incorporate reflective awareness at each development stage. |
| 36 | + |
| 37 | +Agentic Integration with Cline and Cursor |
| 38 | + |
| 39 | +- Cline Configuration (.clinerules) |
| 40 | + |
| 41 | + - Embed concise, project-specific rules to guide autonomous behaviors, prompt designs, and contextual decisions. |
| 42 | + |
| 43 | +- Cursor Configuration (.cursorrules) |
| 44 | + - Clearly define repository-specific standards for code style, consistency, testing practices, and symbolic reasoning integration points. |
| 45 | + |
| 46 | +Memory Bank Integration |
| 47 | + |
| 48 | +- Persistent Context |
| 49 | + - Continuously retain relevant context across development stages to ensure coherent long-term planning and decision-making. |
| 50 | +- Reference Prior Decisions |
| 51 | + - Regularly review past decisions stored in memory to maintain consistency and reduce redundancy. |
| 52 | +- Adaptive Learning |
| 53 | + - Utilize historical data and previous solutions to adaptively refine new implementations. |
| 54 | + |
| 55 | +General Guidelines for Programming Languages |
| 56 | + |
| 57 | +1. Clarity and Readability |
| 58 | + |
| 59 | + - Favor straightforward, self-explanatory code structures across all languages. |
| 60 | + - Include descriptive comments to clarify complex logic. |
| 61 | + |
| 62 | +2. Language-Specific Best Practices |
| 63 | + |
| 64 | + - Adhere to established community and project-specific best practices for each language (Python, JavaScript, Java, etc.). |
| 65 | + - Regularly review language documentation and style guides. |
| 66 | + |
| 67 | +3. Consistency Across Codebases |
| 68 | + - Maintain uniform coding conventions and naming schemes across all languages used within a project. |
| 69 | + |
| 70 | +Project Context & Understanding |
| 71 | + |
| 72 | +1. Documentation First |
| 73 | + |
| 74 | + - Review essential documentation before implementation: |
| 75 | + - Product Requirements Documents (PRDs) |
| 76 | + - README.md |
| 77 | + - docs/architecture.md |
| 78 | + - docs/technical.md |
| 79 | + - tasks/tasks.md |
| 80 | + - Request clarification immediately if documentation is incomplete or ambiguous. |
| 81 | + |
| 82 | +2. Architecture Adherence |
| 83 | + |
| 84 | + - Follow established module boundaries and architectural designs. |
| 85 | + - Validate architectural decisions using symbolic reasoning; propose justified alternatives when necessary. |
| 86 | + |
| 87 | +3. Pattern & Tech Stack Awareness |
| 88 | + - Utilize documented technologies and established patterns; introduce new elements only after clear justification. |
| 89 | + |
| 90 | +Task Execution & Workflow |
| 91 | + |
| 92 | +Task Definition & Steps |
| 93 | + |
| 94 | +1. Specification |
| 95 | + |
| 96 | + - Define clear objectives, detailed requirements, user scenarios, and UI/UX standards. |
| 97 | + - Use advanced symbolic reasoning to analyze complex scenarios. |
| 98 | + |
| 99 | +2. Pseudocode |
| 100 | + |
| 101 | + - Clearly map out logical implementation pathways before coding. |
| 102 | + |
| 103 | +3. Architecture |
| 104 | + |
| 105 | + - Design modular, maintainable system components using appropriate technology stacks. |
| 106 | + - Ensure integration points are clearly defined for autonomous decision-making. |
| 107 | + |
| 108 | +4. Refinement |
| 109 | + |
| 110 | + - Iteratively optimize code using autonomous feedback loops and stakeholder inputs. |
| 111 | + |
| 112 | +5. Completion |
| 113 | + - Conduct rigorous testing, finalize comprehensive documentation, and deploy structured monitoring strategies. |
| 114 | + |
| 115 | +AI Collaboration & Prompting |
| 116 | + |
| 117 | +1. Clear Instructions |
| 118 | + |
| 119 | + - Provide explicit directives with defined outcomes, constraints, and contextual information. |
| 120 | + |
| 121 | +2. Context Referencing |
| 122 | + |
| 123 | + - Regularly reference previous stages and decisions stored in the memory bank. |
| 124 | + |
| 125 | +3. Suggest vs. Apply |
| 126 | + |
| 127 | + - Clearly indicate whether AI should propose ("Suggestion:") or directly implement changes ("Applying fix:"). |
| 128 | + |
| 129 | +4. Critical Evaluation |
| 130 | + |
| 131 | + - Thoroughly review all agentic outputs for accuracy and logical coherence. |
| 132 | + |
| 133 | +5. Focused Interaction |
| 134 | + |
| 135 | + - Assign specific, clearly defined tasks to AI agents to maintain clarity. |
| 136 | + |
| 137 | +6. Leverage Agent Strengths |
| 138 | + |
| 139 | + - Utilize AI for refactoring, symbolic reasoning, adaptive optimization, and test generation; human oversight remains on core logic and strategic architecture. |
| 140 | + |
| 141 | +7. Incremental Progress |
| 142 | + |
| 143 | + - Break complex tasks into incremental, reviewable sub-steps. |
| 144 | + |
| 145 | +8. Standard Check-in |
| 146 | + - Example: "Confirming understanding: Reviewed [context], goal is [goal], proceeding with [step]." |
| 147 | + |
| 148 | +Advanced Coding Capabilities |
| 149 | + |
| 150 | +- Emergent Intelligence |
| 151 | + - AI autonomously maintains internal state models, supporting continuous refinement. |
| 152 | +- Pattern Recognition |
| 153 | + - Autonomous agents perform advanced pattern analysis for effective optimization. |
| 154 | +- Adaptive Optimization |
| 155 | + - Continuously evolving feedback loops refine the development process. |
| 156 | + |
| 157 | +Symbolic Reasoning Integration |
| 158 | + |
| 159 | +- Symbolic Logic Integration |
| 160 | + - Combine symbolic logic with complexity analysis for robust decision-making. |
| 161 | +- Information Integration |
| 162 | + - Utilize symbolic mathematics and established software patterns for coherent implementations. |
| 163 | +- Coherent Documentation |
| 164 | + - Maintain clear, semantically accurate documentation through symbolic reasoning. |
| 165 | + |
| 166 | +Code Quality & Style |
| 167 | + |
| 168 | +1. TypeScript Guidelines |
| 169 | + |
| 170 | + - Use strict types, and clearly document logic with JSDoc. |
| 171 | + |
| 172 | +2. Maintainability |
| 173 | + |
| 174 | + - Write modular, scalable code optimized for clarity and maintenance. |
| 175 | + |
| 176 | +3. Concise Components |
| 177 | + |
| 178 | + - Keep files concise (under 300 lines) and proactively refactor. |
| 179 | + |
| 180 | +4. Avoid Duplication (DRY) |
| 181 | + |
| 182 | + - Use symbolic reasoning to systematically identify redundancy. |
| 183 | + |
| 184 | +5. Linting/Formatting |
| 185 | + |
| 186 | + - Consistently adhere to ESLint/Prettier configurations. |
| 187 | + |
| 188 | +6. File Naming |
| 189 | + |
| 190 | + - Use descriptive, permanent, and standardized naming conventions. |
| 191 | + |
| 192 | +7. No One-Time Scripts |
| 193 | + - Avoid committing temporary utility scripts to production repositories. |
| 194 | + |
| 195 | +Refactoring |
| 196 | + |
| 197 | +1. Purposeful Changes |
| 198 | + |
| 199 | + - Refactor with clear objectives: improve readability, reduce redundancy, and meet architecture guidelines. |
| 200 | + |
| 201 | +2. Holistic Approach |
| 202 | + |
| 203 | + - Consolidate similar components through symbolic analysis. |
| 204 | + |
| 205 | +3. Direct Modification |
| 206 | + |
| 207 | + - Directly modify existing code rather than duplicating or creating temporary versions. |
| 208 | + |
| 209 | +4. Integration Verification |
| 210 | + - Verify and validate all integrations after changes. |
| 211 | + |
| 212 | +Testing & Validation |
| 213 | + |
| 214 | +1. Test-Driven Development |
| 215 | + |
| 216 | + - Define and write tests before implementing features or fixes. |
| 217 | + |
| 218 | +2. Comprehensive Coverage |
| 219 | + |
| 220 | + - Provide thorough test coverage for critical paths and edge cases. |
| 221 | + |
| 222 | +3. Mandatory Passing |
| 223 | + |
| 224 | + - Immediately address any failing tests to maintain high-quality standards. |
| 225 | + |
| 226 | +4. Manual Verification |
| 227 | + - Complement automated tests with structured manual checks. |
| 228 | + |
| 229 | +Debugging & Troubleshooting |
| 230 | + |
| 231 | +1. Root Cause Resolution |
| 232 | + |
| 233 | + - Employ symbolic reasoning to identify underlying causes of issues. |
| 234 | + |
| 235 | +2. Targeted Logging |
| 236 | + |
| 237 | + - Integrate precise logging for efficient debugging. |
| 238 | + |
| 239 | +3. Research Tools |
| 240 | + - Use advanced agentic tools (Perplexity, AIDER.chat, Firecrawl) to resolve complex issues efficiently. |
| 241 | + |
| 242 | +Security |
| 243 | + |
| 244 | +1. Server-Side Authority |
| 245 | + |
| 246 | + - Maintain sensitive logic and data processing strictly server-side. |
| 247 | + |
| 248 | +2. Input Sanitization |
| 249 | + |
| 250 | + - Enforce rigorous server-side input validation. |
| 251 | + |
| 252 | +3. Credential Management |
| 253 | + - Securely manage credentials via environment variables; avoid any hardcoding. |
| 254 | + |
| 255 | +Version Control & Environment |
| 256 | + |
| 257 | +1. Git Hygiene |
| 258 | + |
| 259 | + - Commit frequently with clear and descriptive messages. |
| 260 | + |
| 261 | +2. Branching Strategy |
| 262 | + |
| 263 | + - Adhere strictly to defined branching guidelines. |
| 264 | + |
| 265 | +3. Environment Management |
| 266 | + |
| 267 | + - Ensure code consistency and compatibility across all environments. |
| 268 | + |
| 269 | +4. Server Management |
| 270 | + - Systematically restart servers following updates or configuration changes. |
| 271 | + |
| 272 | +Documentation Maintenance |
| 273 | + |
| 274 | +1. Reflective Documentation |
| 275 | + |
| 276 | + - Keep comprehensive, accurate, and logically structured documentation updated through symbolic reasoning. |
| 277 | + |
| 278 | +2. Continuous Updates |
| 279 | + - Regularly revisit and refine guidelines to reflect evolving practices and accumulated project knowledge. |
0 commit comments