diff --git a/CLAUDE.md b/CLAUDE.md index 0446a7bf..0d03f2d3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -319,6 +319,12 @@ navigate(`/trees/${newTree.id}/edit`) **43. Adding new email types:** Add static async method to `EmailService` in `core/email.py`. Pattern: check `settings.email_enabled`, import `resend`, build HTML string, call `resend.Emails.send()`, return `bool`. Always fire-and-forget from endpoints (log errors, don't fail the request). +**44. AI Chat Builder (Flow Assist) is flow-type-aware:** `ai_chat_service.py` dispatches system prompts, response markers, and validation by `flow_type`. Troubleshooting uses `[TREE_UPDATE]` markers + `validate_generated_tree()`. Procedural/maintenance uses `[STEPS_UPDATE]` markers + `validate_generated_procedural_steps()`. Both support `[METADATA]`; procedural also supports `[INTAKE_FORM]`. + +**45. Intake form field schema uses `variable_name` and `field_type`:** NOT `name` and `type`. Pattern: `{"variable_name": "server_name", "label": "Server Name", "field_type": "text", "required": true, "display_order": 1}`. Used in `tree_validation.py` and AI prompt examples. + +**46. `CreateFlowDropdown` navigates directly to Flow Assist:** No `onOpenAIBuilder` callback — it uses `navigate('/ai/chat?type=procedural')` etc. The `AIFlowBuilderModal` is the old wizard modal (separate from the chat-based Flow Assist page at `/ai/chat`). + --- ## RBAC & Permissions