بنقرة واحدة
r2mo-ui-route
Frontend: Route tree, guards, and navigation topology from R2MO specs.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Frontend: Route tree, guards, and navigation topology from R2MO specs.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | r2mo-ui-route |
| description | Frontend: Route tree, guards, and navigation topology from R2MO specs. |
This skill targets frontend development. Outputs are Vue/React + TypeScript artifacts (route config, guards, menu projection) driven strictly by R2MO specification documents. You are the "nervous system" of the application: you translate static page-planning specs into a runtime routing tree. You do not build UI components or the container (admin does that); you generate configuration and logic. You must ensure every URL maps to a resource, every transition is guarded, and navigation provides feedback. Route config and menu structure feed the admin layout; you do not implement Rust/WASM code.
All specifications referenced by this skill are carried in .md documents. Each .md includes a YAML front-matter block (note properties) at the top. Before using any spec, parse that document's front-matter and extract the relevant keys. Drive route structure, layout association, guards, and meta strictly from these attributes. Keys most relevant here: spec (design.page, requirement.module), route, route_base, layout, guards, keep_alive, order, title, icon, roles, hidden. Do not rely on specific .md filenames or paths (e.g. do not hardcode .r2mo/design/page).
Even invisible logic affects the feel of the app. Enforce:
() => import(...)).primary from design.system.Do not rely on fixed paths (e.g. .r2mo/design/page, .r2mo/requirements/module). Scan and parse any .md whose front-matter matches the following conditions.
Condition: Front-matter contains spec: design.page or spec: ui.page (or project-equivalent).
Logic: Each such document is a leaf node (page).
Key attributes: route, layout, guards, keep_alive, title, icon, roles, hidden.
Condition: Front-matter contains spec: requirement.module (or project-equivalent).
Logic: Each such document is a branch node (module).
Key attributes: route_base, order, guards.
Logic: Derive from parsed specs: explicit redirect: home or lowest order module. Determine where / redirects.
route prefix with module route_base.layout from each page spec. If a page specifies a main-layout name (e.g. the value corresponding to the shell layout), nest it under the main layout route. If a page specifies a blank/minimal layout, place it at root level (e.g. entry/auth). Do not hardcode "AdminLayout" or "BlankLayout"; use the layout names from parsed front-matter.Inject metadata for admin to consume: title, icon from page spec; keepAlive from keep_alive; roles/permissions into meta.roles; breadcrumb hierarchy into meta.breadcrumb.
Generate router guards (path from project convention, e.g. src/router/guards/index.ts). White-list: allow if page/API spec has auth: false. Auth guard: if route requires auth (default), check token; no token -> redirect to entry route with current path as redirect query. Permission guard: match user roles to meta.roles; mismatch -> redirect to 403.
Generate a utility to transform the router tree into menu structure. Filter out routes with hidden: true. Sort by order from module specs. Output standard structure ({ key, label, icon, children }) for the sidebar (admin consumes this).
routes.ts) and logic (guards.ts), not .vue components. Admin builds the shell and consumes your menu data.In this project, Rust refers to Rust-for-WebAssembly frontend (e.g. Yew, Leptos, wasm-bindgen), not a backend. When the stack includes Rust/WASM: use shared types and JS interop so that route guards and meta that depend on permissions/user data work with both TS and WASM. This skill does not implement Rust/WASM code; it only considers the above when guards consume WASM-derived state. API calls (e.g. permissions) are to an HTTP backend (any language); align with that backend’s contract separately.