Code generation and menus
This page explains how to have an Agent generate frontend call code from datasets, SQL, or page requirements, and align page entry points, menus, and live assets. You don't assemble generation or sync commands by hand — just state the business capability to integrate, the target file, and how you'll accept the result.
Tasks to hand to the Agent
- Generate TypeScript call snippets from dataset operations.
- Generate call snippets for saved SQL, for the frontend or for use inside BFF.
- Place the generated call code into a designated file or page.
- Check whether your local page has appeared in the platform menu.
- Update the JS/CSS asset URLs referenced by live menus.
Prerequisites
- You know the dataset operation, SQL name, or page feature to call.
- You've decided which directory, file, or component the code goes into.
- If live menus or assets are affected, require the Agent to preview the impact first.
Common prompts
Generate a dataset call snippet
请根据「客户」数据集的「列表查询」生成 TypeScript 调用片段。
调用场景是:客户列表页按客户等级、负责人和最近跟进时间筛选客户。
请先确认入参和返回字段,再把代码放到「src/pages/customer/CustomerList.tsx」。
不要改无关业务逻辑,完成后告诉我如何验证。The AI may call: rabetbase api pull, rabetbase dataset operations, rabetbase codegen sdk.
Generate a SQL call snippet
请根据已保存的「客户活跃度统计」生成调用代码。
目标调用方是「前端页面 / BFF 脚本」。
请说明需要传哪些参数、返回哪些字段,并把代码放到「src/pages/customer/CustomerDashboard.tsx」。The AI may call: rabetbase sql detail, rabetbase codegen sql.
Wire it into a page
请把「客户活跃度统计 SQL」的调用接入到「客户列表页顶部统计区」里。
页面需要展示高价值客户数、沉默客户数、待跟进客户数,筛选条件包括负责人、客户等级和统计时间范围。
请保持现有交互不变,只补齐数据获取和错误处理。The AI may call: rabetbase dataset operations, rabetbase sql detail, rabetbase codegen sdk, rabetbase codegen sql.
Sync the page menu
我新增了页面「客户列表页 /crm/customers」。
请检查它是否已经出现在平台菜单中。
如果没有,请先预览将新增或调整的菜单项,确认无误后再同步。The AI may call: rabetbase menu sync.
Update live asset references
本次客户列表页构建产物地址是:
JS:https://cdn.example.com/crm/customers/index.js
CSS:https://cdn.example.com/crm/customers/index.css
请帮我更新平台菜单引用的线上资源,并只影响「客户列表页」菜单项。
执行前先预览会影响哪些菜单,执行后告诉我更新结果和验证入口。The AI may call: rabetbase menu update.
What to add to your prompt
- Call source: a dataset operation, saved SQL, or an existing BFF.
- Target location: file path, component name, page route, or menu name.
- Interaction requirements: filtering, pagination, empty states, error messages, loading states.
- Release constraints: preview menu changes first, update assets only, don't overwrite business extension config.
Completion checks
- The generated code is in the designated location and importable by the project.
- Input parameters, returned fields, and error handling are explained.
- Menu sync or asset updates were previewed before execution.
- The page opens and shows data — or there's a clear next step to verify.
Next step: if the data structures behind the call aren't clear yet, go back to "APIs and datasets: pull config, see your data clearly". If the query isn't yet saved as platform SQL, start with "Custom SQL: from writing to execution".