Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .recurseml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rules: .rules/
17 changes: 17 additions & 0 deletions .rules/anti_dry.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Don't DRY Your Code Prematurely
globs: "**/*.{js,ts,py,go,java,rb,cs}"
alwaysApply: false
---

Reference: https://testing.googleblog.com/2024/05/dont-dry-your-code-prematurely.html

Consider carefully if code duplication is truly redundant or just superficially similar before applying DRY principles. Functions or classes may look the same but serve different contexts and business requirements that evolve differently over time.

Key principles to follow:
- Avoid premature abstractions that couple behaviors which may need to evolve separately
- When in doubt, keep behaviors separate until enough common patterns emerge over time that justify the coupling
- Think about long-term evolution, not just making code shorter
- Apply YAGNI principle - tolerate a little duplication in early development stages
- Wait to abstract until clear patterns emerge

17 changes: 17 additions & 0 deletions .rules/effective_comments.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Effective Code Comments - Explain WHY not WHAT
globs: "**/*.{js,ts,py,go,java,rb,cs}"
alwaysApply: true
---


For more context read: https://blog.codinghorror.com/code-tells-you-how-comments-tell-you-why/

- Explain WHY the code does something, not WHAT it does
- Document complex business logic and clarify non-obvious implementations
- Warn about gotchas and provide context for future maintainers
- Use proper documentation comment format for functions and methods
- Keep TODO comments specific with assignees when possible
- Always update comments when the underlying code changes
- Focus on business context, edge cases, and implementation decisions that aren't obvious from reading the code

Loading