menu-sync

Syncs pages.ts page registrations to the backend menu table via MCP tools.

5|1|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/ChenyCHENYU/wl-skills-kit --skill menu-sync-chenychenyu
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: menu-sync
Source: https://github.com/ChenyCHENYU/wl-skills-kit/tree/main/files/.wl-skills/skills/sync/menu-sync
Command: npx skills add https://github.com/ChenyCHENYU/wl-skills-kit --skill menu-sync-chenychenyu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Newly generated Vue pages registered in pages.ts are unreachable from the UI until matching records exist in the backend menu table. This Skill automates creating and updating those menu records so routes become accessible without manual backend operations. ## Core Features & Use Cases - One-step deterministic sync: Reads SYS_MENU_INFO reports and calls wls_menu_sync_from_report to upsert first-level directories and second-level page menus in order, with plan-hash preview and confirmation before any write. - Manual split workflow: Falls back to wls_menu_query for the domain menu tree, then wls_menu_upsert for directory-then-page creation with deduplication and skip rules. - Field mapping and hidden-page rules: Converts pages.ts entries into menu payloads (camelCase paths, component paths, menuNameCode, orderNum) and marks form/detail/history pages as hidden. - Use Case: After generating seven pages under src/views/produce/aiflow, ask the AI to sync menus; it previews five missing entries, waits for confirmation, writes them, and returns a created/updated/skipped result table. ## Quick Start Tell the AI to sync the newly created pages under a module directory to the system menu and confirm the previewed plan.

Frequently Asked Questions about menu-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync newly created pages to the backend menu?β–Ό

Fill in env.local.json with gatewayPath, sysAppNo, token, parentMenuId, and domainId, then ask the AI to sync menus. It reads the SYS_MENU_INFO report, previews a plan with a planHash, and writes only after you confirm.

Why is my synced menu not visible in the UI?β–Ό

The menu exists in the full domain tree but the current user's role lacks permission. The sync returns a MENU_NOT_VISIBLE warning; grant the permission code to the role via permission-sync or clear the permission field through a previewed update.

What token format does the menu sync configuration require?β–Ό

The token field must contain the pure JWT string without the bearer prefix. Including the prefix produces a doubled Bearer header and 401 errors; copy the authorization header value from browser DevTools and strip the prefix.

Can menu sync update or rename existing menus?β–Ό

Phase 1 only adds without deleting; renaming a page creates a duplicate because matching is by name and path. Full upsert-by-componentPath rename support waits for the backend batchPush endpoint in Phase 2.

Why does menu creation fail with a 4004 error?β–Ό

This happens when the AI bypasses MCP and hand-builds HTTP requests with wrong paths. Confirm the MCP connection exposes wls_menu_sync_from_report, then reissue the sync request so the MCP tools handle the API calls.