You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Less Code is Better** - Prioritize simplicity, readability, and maintainability over cleverness. Every line of code is a liability that must be justified.
6
+
7
+
## Critical Review Checklist
8
+
9
+
### 🔍 Code Quality & Minimalism
10
+
11
+
-**Necessity Check**: Is this code absolutely necessary? Can existing functionality be reused?
12
+
-**Single Responsibility**: Does each function/class do exactly one thing well?
13
+
-**DRY Violations**: Any repeated logic that should be extracted into shared utilities?
14
+
-**Cognitive Load**: Can a new developer understand this change with less cognitive load?
15
+
-**Magic Numbers/Strings**: All constants properly defined and named in @application_sdk/constants.py
16
+
-**Spell Check**: No typos in code, comments, docstrings, or documentation
17
+
-**Exception Handling Standards**: All exception handling must follow these principles. See detailed guidelines in [exception-handling.mdc](mdc:.cursor/rules/exception-handling.mdc).
-**Test Naming**: Test names clearly describe the scenario being tested
40
+
41
+
### 🔒 Security & Performance
42
+
43
+
-**Input Validation**: All external inputs validated and sanitized
44
+
-**Secrets Management**: No secrets in code; proper credential handling
45
+
-**SQL Injection**: Parameterized queries used for all SQL operations
46
+
-**Performance Standards**: All performance considerations must follow these principles. See detailed guidelines in [performance.mdc](mdc:.cursor/rules/performance.mdc).
47
+
-**Memory Management**: Resources properly closed, large datasets processed in chunks
48
+
-**DataFrame Optimization**: Appropriate dtypes, avoid unnecessary copies, use chunked processing
49
+
-**SQL Query Efficiency**: Use LIMIT, specific columns, proper WHERE clauses, connection pooling
50
+
-**Serialization Performance**: Use orjson for large datasets, implement compression
51
+
-**Algorithm Efficiency**: Use appropriate data structures, avoid O(n²) when O(n) alternatives exist
52
+
-**Caching Strategy**: Cache expensive operations and database queries
53
+
-**Async Usage**: Use async for I/O operations, sync for CPU-bound tasks
54
+
55
+
### 📊 Observability & Logging
56
+
57
+
-**Logging Standards**: logging standards are defined in [logging.mdc](mdc:.cursor/rules/logging.mdc)
58
+
-**Metrics**: Key operations include appropriate metrics
59
+
-**Error Context**: Error logs include sufficient context for debugging
60
+
-**Trace Information**: Critical paths include trace information
**Default Behavior: Re-raise Exceptions** - Exceptions should be re-raised by default unless explicitly handled for a specific reason. Silent exception swallowing is not allowed.
10
+
11
+
## Critical Rules
12
+
13
+
### **Exception Propagation**
14
+
- **Rule**: Always re-raise exceptions after logging unless in non-critical operations
15
+
- **Anti-pattern**: `except Exception as e: logger.error(f"Error: {e}")` - This swallows exceptions
16
+
- **Correct pattern**: `except Exception as e: logger.error(f"Error: {e}"); raise`
17
+
18
+
### **Specific Exception Types**
19
+
- **Use specific exception types** instead of generic `Exception`
0 commit comments