From 27848a3db26282d989a5693c6b39291f4154e08f Mon Sep 17 00:00:00 2001 From: "ai-coding-guardrails-maxi-sandbox[bot]" <208989322+ai-coding-guardrails-maxi-sandbox[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 17:53:30 +0000 Subject: [PATCH] Refine AI context files --- CLAUDE.md | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b3e1adc..c59d1a6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -81,32 +81,11 @@ Common cookiecutter variables: ## Error Patterns to Avoid -```python -# BAD: Using os.path -import os -file_path = os.path.join(os.getcwd(), "file.txt") - -# GOOD: Using pathlib -from pathlib import Path -file_path = Path.cwd() / "file.txt" - -# BAD: Print for logging -print(f"Error: {error}") - -# GOOD: Proper logging -import logging -logger = logging.getLogger(__name__) -logger.error(f"Operation failed: {error}") - -# BAD: Generic exceptions -except Exception: - pass - -# GOOD: Specific handling -except FileNotFoundError as e: - logger.error(f"Configuration file not found: {e}") - raise -``` +| BAD | GOOD | +|-----|------| +| `os.path.join(os.getcwd(), "file.txt")` | `Path.cwd() / "file.txt"` (use `pathlib`) | +| `print(f"Error: {error}")` | `logger.error(f"Operation failed: {error}")` (use `logging`) | +| `except Exception: pass` | `except FileNotFoundError as e: logger.error(...); raise` | ## Testing Guidelines