diff --git a/PROJECT_GUIDELINES.md b/PROJECT_GUIDELINES.md index 35794ba..f8eeea8 100644 --- a/PROJECT_GUIDELINES.md +++ b/PROJECT_GUIDELINES.md @@ -155,6 +155,12 @@ VERIFY → Compile successfully - ✅ Place new files in **contextually appropriate directories** - ✅ Follow **KISS**, **DRY**, and **YAGNI** principles - ✅ Use **multiple, logical git commits** with clear messages +- ❌ **NEVER duplicate types between handlers and templates** - define data types in handlers, reuse directly in templates +- ✅ **DO share handler types with templates** - templates should use handlers.CollectionData, handlers.BookInfo, etc. directly +- ❌ **NEVER create parallel type systems** - no templates.XxxData types for data that originates from handlers +- ✅ **DO enhance handler types with template-specific fields** when needed (e.g., add Icon, FormattedDate fields to handlers structs) +- ✅ **DO keep template-only types in templates package** - PageData, UnsafeHTML, and template-specific utilities are appropriate +- ❌ **NEVER create conversion helper functions** to map between handler and template types - use handler types directly ### Configuration & Environment - ✅ If **.env is missing**, auto-generate secure values