ワンクリックで
client-react-router
Use when adding or changing routes in apps/client.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when adding or changing routes in apps/client.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Use when adding, changing, extracting, or reusing client components, including Storybook stories and controls.
Use when adding or changing forms in apps/client.
Use when changing GitHub OAuth, session cookies, SessionGuard, logout, or authenticated API request identity.
Use when adding or changing client state, React Query data flow, immutable context values, or Zustand stores.
Use when styling apps/client with Tailwind CSS v4.
Use when adding or changing client API query or mutation hooks.
| name | client-react-router |
| description | Use when adding or changing routes in apps/client. |
Generated from ai/registry.json. Do not edit manually.
Canonical skill: ../../../ai/skills/client-react-router.md.
Referenced context:
../../../ai/rules/client-routing-rules.md../../../ai/rules/client-component-rules.md../../../ai/architecture/client-app.mdThis file is compiled from canonical AI knowledge files. Edit canonical files under ai, then run npm run ai:sync.
ai/skills/client-react-router.mdUse this skill when adding or changing routing in apps/client.
Add or change routes without breaking provider ownership, direct URL loading, or page/component boundaries.
ai/rules/client-routing-rules.mdai/rules/client-component-rules.mdai/architecture/client-app.mdsrc/main.tsx, src/router.tsx, and the target page before editing.src/router.tsx.src/pages and route layout wrappers under src/layouts.src/components only when it is shared or clarifies composition.npm --workspace @capture-flag/client run build./ and every new route from a cold page load when feasible.ai/rules/client-routing-rules.mdRules for route changes in apps/client.
src/main.tsx.src/router.tsx.lazyRoute() helper in src/router.tsx.<Outlet /> rendering in src/layouts.src/pages.index.ts named exports for multi-file pages; simple one-file pages may stay as direct page files.Link and NavLink for internal navigation.QueryClientProvider outside the router so routes share one React Query client.src/routing/routePaths.ts.src/routing/useRouteContext.ts to compose route params, search params, and server state for selected organization/project/config/environment resources.src/components.src/pages; reserve src/pages for final route screens./ to /organizations and catch-all * to /.useRouteContext helper covers it.npm --workspace @capture-flag/client run build after route changes./ and every new route from a cold page load when feasible.ai/rules/client-component-rules.mdRules for React component boundaries in apps/client.
src/components.src/core/<category>/<name>.ts, with one exported function or hook per file.src/layouts/<LayoutName>.src/pages.src/pages/<PageName> when they are not shared outside that page.src/core utilities and hooks from their direct alias file path such as @core/json/formatJson; do not add index.ts barrels under src/core.@components/Button; do not assume a central src/components/index.ts barrel exists.apps/client at or below 400 lines; when touching larger existing files, prefer splitting real UI responsibilities instead of expanding them further.children for layout wrappers such as cards, shells, and empty states.className, aria-invalid, and ref.apps/client.stories/ child folder next to the component folder they cover, using *.stories.tsx; route/panel grouping stories belong in the owning route folder's stories/ folder.src/components/stories and member component stories in src/components/members/stories.src/layouts/<LayoutName>/stories.src/pages/<PageName>/stories or src/pages/<PageName>/<section>/stories.src/pages/stories.src/stories; do not put component stories there.src/core.args and argTypes updates.*.stories.tsx beside component files when a nearby stories/ folder is available..map() when rendering API data, dynamic collections, long repeated groups, or lists whose members are not all known at author time.src/core/date, src/core/json, src/core/strings, src/core/validation, or src/core/hooks only for helpers that are independent of Capture Flag domain context.src/core/<category>/__tests__/<name>.test.ts.@core/json/formatJson over barrels or grouped core imports.*.stories.tsx file per component or cohesive route grouping.src/stories/mockData.ts when stories need realistic Capture Flag data..storybook/preview.tsx for route and panel stories that call client API hooks.parameters.router.initialEntries when a story depends on React Router params.parameters.layout = "fullscreen" for route, layout, shell, and panel stories that need app-width context.npm --workspace @capture-flag/client run storybook:build after Storybook, component, or story changes.npm --workspace @capture-flag/client run build after component moves.ai/architecture/client-app.mdapps/client is a Vite React application for the Capture Flag platform UI.
src/main.tsx owns top-level providers.src/router.tsx owns React Router route definitions.lazyRoute() helper and should expose named exports.src/layouts contains route layout wrappers that render shared shells, navigation, headers, and nested <Outlet /> regions.src/pages contains route-level screens. Multi-file route screens use folder modules with index.ts named exports; simple one-file screens may stay as direct page files.src/components contains shared UI used by multiple pages or sections.src/core contains context-independent client utilities and reusable hooks organized by category.src/api contains client request functions, React Query hooks, operation barrels, domain barrels, and domain query keys.src/routing contains route path and route context helpers shared by pages and layouts.src/stories contains shared Storybook fixtures and API mocks, not component stories.src/test contains shared Vitest and Testing Library helpers.PlatformLayout owns the authenticated shell, navigation frame, sidebar/header state, logout flow, and nested route outlet.useRouteContext, not stored in a mutable layout context./: redirects to /organizations./login: GitHub login screen./account: authenticated user account details and display name editing./organizations and /organizations/:organizationId: organization selection and organization members./organizations/:organizationId/projects and /organizations/:organizationId/projects/:projectId: project selection and project members./organizations/:organizationId/projects/:projectId/environments: environments for the selected project./organizations/:organizationId/projects/:projectId/configs and /organizations/:organizationId/projects/:projectId/configs/:configId: configs and public Config JSON preview./organizations/:organizationId/projects/:projectId/configs/:configId/flags: feature flags and remote config values./organizations/:organizationId/projects/:projectId/configs/:configId/segments: reusable targeting segments./organizations/:organizationId/projects/:projectId/sdk-keys: SDK key lifecycle for project configs/environments, with selected config/environment in ?configId= and ?environmentId= when needed./organizations/:organizationId/audit-logs: organization/project audit log timeline, with selected project in ?projectId= when needed.*: redirects to /.src/api/<domain>/<operation>.useQuery or useInfiniteQuery according to the API shape.useRouteContext for selected resources and redirect-safe navigation paths.src/layouts/<LayoutName> until reused by another layout or page.src/components and are imported directly through aliases such as @components/Button.components/members primitives with page-specific role options.stories/ child folder beside the source area they cover.src/pages/stories.src/stories and are reused by stories and page tests.src/core/<category>/<name>.ts.date, json, strings, validation, and hooks.src/core/date/toDate.index.ts barrels under src/core; multiple helpers require multiple explicit imports.src/core/<category>/__tests__/<name>.test.ts next to the category they cover.__tests__/ child folders beside the source area they cover, mirroring Storybook stories/ folders.src/test and provide Testing Library render helpers, React Query providers, and fetch response mocks.npm --workspace @capture-flag/client run test:coverage and should stay at 90% or higher for configured client targets.src/api/__tests__ and cover operation behavior through mocked fetch responses.src/components/__tests__; member component tests live in src/components/members/__tests__.src/pages/<PageName>/__tests__ when they cover one page folder.src/pages/<PageName>/<section>/__tests__ when they cover colocated page internals such as feature flags or segments.src/__tests__ only for source files owned directly by src, such as permissions.ts.src/components/stories; member component stories live in src/components/members/stories.src/layouts/<LayoutName>/stories.stories/ child folder.src/pages/stories and use route parameters plus shared mock data to render realistic page states.src/stories; that folder is reserved for shared Storybook data, routes, and API mocks.