From 35a8dc5cae49714da7e2f1794f2d18ffa57ff4a5 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Fri, 6 Mar 2026 14:28:14 -0500 Subject: [PATCH] docs: update CLAUDE.md with AI chat builder and intake form learnings Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 6 ++++++ 1 file changed, 6 insertions(+) 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