What problem does it solve?
The ChatbotX contact filter model is shared across the contacts list, conversations, and broadcast audiences, and a single change touches Zod schemas, UI configs, and SQL query builders in two packages. This Skill guides you through adding filter fields or operators without breaking the critical invariants that keep results correct.
Core Features & Use Cases
- Add filter fields safely: Follow the exact sequence from the
contactFilterFields enum through CONTACT_FILTER_FIELD_DEFINITIONS to the buildConditionWhere SQL case.
- Keep operator rules in sync: Update both
STATIC_OPERATOR_RULES (Zod validation) and staticFieldRules (UI enablement) so the UI never offers an operator the backend rejects.
- Preserve NULL/negation logic: Implement negative and is-empty operators that correctly match NULL rows using three-valued SQL logic and EXISTS subqueries.
- Use Case: You need to add a new "subscription tier" filter for broadcast audiences. The Skill walks you through the enum, definition entry, both operator-rule sources, the SQL case with NULL handling, and the test checklist.
Quick Start
Ask the assistant to add a new contact filter field to the ChatbotX contact filter system following the documented checklist.