export const editModuleWorkflow = { id: "edit_module", name: "Edit Module", description: "Modify an existing HTML module: update code, styles, variables, or structure.", steps: [ { step: 1, action: "Get current module code", description: "Read the current HTML, CSS, JS, and PHP of the module.", tool: "get_module", critical: "ALWAYS read the current code before modifying. Understand existing variables, structure, and styling." }, { step: 2, action: "Check where it's used", description: "Find all pages and records using this module to understand impact.", tool: "check_module_usage", critical: "Know the blast radius of your changes — how many live pages will be affected." }, { step: 3, action: "Make changes", description: "Update the module code with the required modifications.", tool: "save_module", critical: "Pass the module 'id' parameter to update (not create). save_module REPLACES the entire module — include ALL html/css/js, not just the changed parts." }, { step: 4, action: "Update example data if needed", description: "If you added or renamed variables, update the example data to match.", tool: "set_module_example_data", critical: "Call get_module first to discover new variable names. Fill ALL variables, including new ones." }, { step: 5, action: "Verify rendering", description: "Test the modified module with variable values to confirm changes work.", tool: "check_module", critical: "Test with realistic values. Compare rendering before and after changes." } ], context: { builder_vars: "data-field-type attribute on elements creates editable fields. Types: textfield, headfield, textbox, wysiwyg, link, upload, uploadBackground, uploadMulti, list, multiv2.", component_syntax: "c-if='varname' shows/hides element. c-for='item in items' loops. c-hidden='true' invisible config. c-else after c-if.", save_behavior: "save_module with 'id' parameter = UPDATE. Without 'id' = CREATE new. The tool replaces the ENTIRE module code, not a diff." }, rules: [ "ALWAYS include the full html/css/js when saving — save_module replaces everything", "Pass the 'id' parameter to update an existing module", "Variable names: lowercase, no spaces, no accents", "Labels must be UNIQUE across the module", "Upload fields are ALWAYS arrays — access with [0].urlPath" ], warnings: [ "DO NOT remove existing variables without checking usage — they may have data on live pages", "DO NOT rename variables — it breaks existing data bindings. Add new ones instead if needed", "DO NOT save partial code (just HTML without CSS) — save_module replaces ALL sections", "DO NOT forget to update example data when adding new variables" ], resources: [ "acai://resources/guia-builder-vars", "acai://resources/guia-atributos-acai" ] };