Docs: create_module es legacy, acai_write es el flujo estándar

El server compila automáticamente al guardar index-base.tpl via
acai_write — no necesita create_module ni compile_module manual.

- mcp-tools-reference.md: flujo actualizado, create_module marcado legacy
- module-creation-guide.md: paso 2 usa acai_write
- ACAI-CLAUDE.md: key workflows actualizados
- coder.py: system prompt alineado

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jordan Diaz
2026-04-03 13:40:47 +00:00
parent 7bdb943e7f
commit 2712c2fd49
4 changed files with 14 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ Each module lives in `template/estandar/modulos/<moduleId>/` with:
## Creating a Module — Full Workflow
1. **Read style reference** (steps above)
2. **`create_module`** — Creates the directory with index-base.tpl, style.css, script.js and compiles. Use descriptive `moduleId` and clear `label`.
2. **`acai_write`** — Write `index-base.tpl` to `template/estandar/modulos/MODULE_ID/index-base.tpl`. The server automatically creates the directory, compiles and generates all derived files. `create_module` is a legacy alternative.
3. **`add_module_to_record`** — Adds the module to a page. Response includes `sectionId` — use it directly in the next step.
4. **`set_module_config_vars`** — Fill variables with content. Response includes `uploadFields` with `{ fieldName, recordNum }` for each upload variable.
5. **Upload images** — Use `generate_image` then `upload_record_image` with the `recordNum` and `fieldName` from step 4's `uploadFields`. No need to read builder.json or call get_module_config_vars.
@@ -72,6 +72,6 @@ Modules with `MJMLModule: true` in their schema are email modules:
- Use `section_id` variable for unique anchors/scoping
- Use `interno` variable to detect CMS editor vs public view
- Include other modules with: `<module_id :param1="value1"></module_id>`
- After editing `index-base.tpl`, ALWAYS call `compile_module`
- After editing `index-base.tpl` with `acai_write` or `acai_line_replace`, the server compiles automatically — no need to call `compile_module`
- Twig uses filters (with `|`), never functions
- Twig concatenation uses `~`: `'value=' ~ variable`