permission-sync

Synchronizes roles, menu authorizations, and action permission codes via MCP tools.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing roles, assigning menus to roles, and wiring action-button permission codes across a backend admin system and frontend code is error-prone and manual. This Skill chains the full permission workflow—role creation, role-to-menu authorization, action button registration, and data.ts permission field wiring—into one auditable, confirmation-gated process. ## Core Features & Use Cases - Role Management (role-manage): Query and create roles idempotently by code, with preview and planHash confirmation before any write. - Role Authorization (role-assign): Query assignable menus, merge existing menuIds to avoid the backend's full-overwrite behavior, and assign menus with explicit confirmFullReplace confirmation. - Action Attachment (action-attach): Register type=A action buttons (e.g., add/edit/remove/export) to page menus and add matching permission arrays to ActionButtonDesc entries in data.ts, with no template changes required. - Use Case: After generating a customer list page, ask the AI to attach add/edit/delete/export buttons; it registers the permission codes on the backend and updates the toolbar config so BaseToolbar enforces visibility automatically. ## Quick Start Ask the AI to create a role, assign menus to a role, or attach action buttons with permission codes to a specific page menu.

Frequently Asked Questions about permission-sync

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

FAQPage Schema
How do I assign menus to a role without losing existing permissions?

The backend saveRoleMenus API performs a full overwrite, so you must first query the role's current menuIds, merge in the new ones, and submit the complete list with confirmFullReplace: true and a planHash. The MCP tool rejects submissions missing this confirmation.

How do I add permission codes to toolbar buttons in a Vue admin page?

Add a permission array field to each ActionButtonDesc entry in the page's data.ts file, matching the codes registered on the backend. BaseToolbar reads this field internally to control button visibility, so no template changes or v-permission directives are needed.

What naming convention should permission codes follow?

Prefer the project's existing style. If none exists, use the short form {resource}_{action} such as customer_add or customer_remove. The long form {module}:{resource}:{action} like mmwr:customer:add is also supported.

Can I delete roles or action buttons with this workflow?

No. The upsert tools only add items, deduplicating by unique keys, and never delete. Deletions must be performed manually through the backend admin interface to prevent accidental mass loss of permissions.

What happens when the MCP tools are unavailable or fail?

Follow the shared guardrail playbook: help the user fix the token or gatewayPath in env.local.json and retry the MCP tool. Bypassing MCP with curl or hand-built HTTP requests is explicitly forbidden.

Are writes allowed against a production environment?

Production writes are blocked by default when the environment is production or the gateway indicates prod. They are only possible after release approval by explicitly setting allowProductionWrites: true locally.