Agent Skills
› github/replica
› routing
routing
GitHub提供基于 React Router v7 的单页应用路由配置规范,指导如何编辑 routes.ts、添加或修改路由路径及导航结构。
Trigger Scenarios
编辑 app/routes.ts 文件
添加或删除路由
更改应用导航逻辑
Install
npx skills add github/replica --skill routing -g -y
SKILL.md
Frontmatter
{
"name": "routing",
"description": "React Router v7 routing conventions for this SPA. USE WHEN: editing `app\/routes.ts`, adding\/removing a route, or changing navigation."
}
Routing
Paths below are relative to this app's directory.
- This app disables runtime SSR (
ssr: false) and renders routes client-side. React Router still generates the SPA HTML shell during the build. - Routes are defined in
app/routes.tsusing React Router v7 config (the "framework" style).
General Structure
- Main navigation structure:
- Home:
index("routes/home.tsx")at/ - Discover section:
/discover/models,/discover/tools - Build section:
/build/agents,/build/tools - Operate section:
/operate/dashboard,/operate/agents - Docs:
/docs
- Home:
- Layout wrapper:
app/components/shell/NavLayout.tsxprovides top/left nav - Export
topNavRoutesandgetLeftNavRoutes(pathname)fromapp/routes.tsfor navigation components - Type-safe routes via auto-generated types in
.react-router/types/
Adding a Route
- Create the file in
app/routes/ - Add it to
app/routes.tsconfig array - Use type-safe route imports:
import type { Route } from "./+types/routeName" - Run
npm run type-checkfrom this app's directory to regenerate route types and check TypeScript.
Version History
- f19c050 Current 2026-11-07 08:51


