[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AD7TK49J6N05D257PWKRAQ":3,"skill-same:01M6AD7TK49J6N05D257PWKRAQ":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":42,"repositoryHtmlUrl":43,"repositoryHomepageUrl":17,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6AD7TK49J6N05D257PWKRAQ","features-variants","功能变体系统应用","Definitive guide to the app-local prototype feature\u002Fvariant system: configuration, `useFeature()`, URL params, and anti-patterns. USE WHEN: editing `app\u002Ffeatures.json`, using `useFeature()` in routes, creating design alternatives, A\u002FB comparisons, layout options, alternate versions, or switching between design proposals. Trigger keywords: feature, variant, version, option, alternate, prototype, design option, A\u002FB, comparison, switch between, try a different, another way, layout option, explore, side by side.","应用本地原型功能\u002F变体系统的权威指南：配置、`useFeature()`、URL 参数及反模式。适用场景：编辑 `app\u002Ffeatures.json`、在路由中使用 `useFeature()`、创建设计备选方案、A\u002FB 对比、布局选项、替代版本，或在多个设计方案之间切换。触发关键词：功能、变体、版本、选项、替代、原型、设计方案、A\u002FB、对比、切换、换种方案、换种方式、布局选项、探索、并排比较。","github\u002Freplica","github","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9919?v=4","01M6AC83DS133TPXFSP1DHNCC6","GitHub","01M6AD7D93S1YD5K71F61E6ASB",273,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fcoreai\u002F.agents\u002Fskills\u002Ffeatures-variants\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现","SCENARIO","使用场景",[31,32,33],"features variants","design","prototype","2026-11-10 10:12:30",false,"---\nname: features-variants\ndescription: 'Definitive guide to the app-local prototype feature\u002Fvariant system: configuration, `useFeature()`, URL params, and anti-patterns. USE WHEN: editing `app\u002Ffeatures.json`, using `useFeature()` in routes, creating design alternatives, A\u002FB comparisons, layout options, alternate versions, or switching between design proposals. Trigger keywords: feature, variant, version, option, alternate, prototype, design option, A\u002FB, comparison, switch between, try a different, another way, layout option, explore, side by side.'\n---\n\n# Feature & Variant System Instructions\n\nPaths below are relative to this app's directory.\n\n## What Is the Feature System?\n\nCoreAI Sandbox has a **built-in feature\u002Fvariant system** for tracking prototyped features and presenting multiple UI alternatives on the same page. It uses a neutral floating selector with small, elevated tab links and a brand-colored Prototype InteractionTag menu trigger to distinguish itself from the designs being prototyped.\n\nA **feature** represents a prototyped change from main. A feature may:\n\n- Have **variants** — multiple design alternatives that can be switched between (e.g., different layouts)\n- Be **variant-less** — a single prototyped change with no alternatives (just a link to the location of the change)\n\n**Multiple features can be active simultaneously** on the same page, each with their own independent variant selection.\n\n**You MUST use this system** whenever a user asks to:\n\n- Try a different layout, design, or approach for a page or section\n- Create an \"option B\" or \"version 2\" of something\n- Compare two or more designs side by side\n- Add an A\u002FB test or design alternative\n- Explore an alternate version of a feature\n\n**Do NOT** build a custom toggle, tab switcher, or parallel component tree. The feature system already handles all of this.\n\n> For a guided walk-through tailored to designer-style requests, invoke the `new-variant` skill.\n\n---\n\n## How It Works (Summary)\n\n1. **Features** are defined in `app\u002Ffeatures.json`. Each feature may have variant options. The registry is currently empty; add definitions to its top-level `features` array.\n2. Active variants are encoded in the URL as repeated `?variant=feature-id--variant-id` params — every combination is a shareable deep link.\n3. When a user navigates to a page with applicable features, the system **automatically populates** selections from valid URL values, then remembered client-navigation selections, then the first configured variant.\n4. A **draggable floating switcher strip** appears bottom-center by default showing each feature's variants as small, elevated router-backed tab links, when applicable variants exist and **Show feature selector** is enabled in the Prototype menu.\n5. Route components use the `useFeature(featureId)` hook to conditionally render based on the active variant.\n6. **Multiple features** can be active on the same page simultaneously with independent variant selections.\n\n---\n\n## Architecture — Key Files\n\n| File                                            | Purpose                                                                |\n| ----------------------------------------------- | ---------------------------------------------------------------------- |\n| `app\u002Ffeatures.json`                             | App configuration: all features, routes, and variant labels            |\n| `app\u002Ffeatures\u002FfeatureConfig.ts`                 | Feature schema, configuration validation, and route\u002FURL helpers        |\n| `app\u002Ffeatures\u002FFeatureContext.ts`                | Feature context and public context types                               |\n| `app\u002Ffeatures\u002FFeatureProvider.tsx`              | URL state, route matching, defaults, and floating selector composition |\n| `app\u002Ffeatures\u002FFeatureContext.ts` (`useFeature`) | Public hook for reading the active variant                             |\n| `app\u002Ffeatures\u002FFeatureFloatingUI.tsx`            | Floating variant selector                                              |\n| `app\u002Ffeatures\u002FFeatureMenu.tsx`                  | Prototype feature menu used by the app shell                           |\n\n---\n\n## URL Structure\n\nVariants are encoded as repeated `variant` query params:\n\n```\n# Single feature with one variant active\n?variant=agent-playground-layout--accordion\n\n# Two features active simultaneously\n?variant=agent-playground-layout--accordion&variant=code-tab--visible\n\n# Variant-less features have no variant query param (they apply only on matching routes)\n```\n\nEach `variant` param is a `feature-id--variant-id` pair using kebab-case string identifiers.\n\n---\n\n## Step-by-Step: Adding a New Variant to an Existing Feature\n\nIf a feature already exists in `app\u002Ffeatures.json` and has variants, add a new variant:\n\n### 1. Update `app\u002Ffeatures.json`\n\nAdd a new entry to the `variants` array of the existing feature:\n\n```json\n{\n  \"id\": \"your-new-variant\",\n  \"label\": \"Your New Design Name\"\n}\n```\n\nVariant `id` values are **kebab-case strings**. Choose a descriptive, URL-friendly name.\n\n### 2. Update the Route Component\n\nIn the route component that uses this feature, add a conditional branch for the new variant:\n\n```tsx\nimport { useFeature } from '~\u002Ffeatures\u002FFeatureContext';\n\nfunction MyPage() {\n  const variant = useFeature('agent-playground-layout');\n\n  if (variant === 'accordion') return \u003CAccordionLayout \u002F>;\n  if (variant === 'your-new-variant') return \u003CYourNewDesign \u002F>; \u002F\u002F ← new\n  return \u003CDefaultLayout \u002F>; \u002F\u002F first variant or null\n}\n```\n\nThat's it. The floating UI automatically shows the new tab link when the selector is visible on an applicable route.\n\n---\n\n## Step-by-Step: Creating a New Feature\n\n### Feature WITH Variants\n\nWhen the feature explores multiple design alternatives:\n\n#### 1. Add the feature to `app\u002Ffeatures.json`\n\nAdd this object to the registry's top-level `features` array:\n\n```json\n{\n  \"id\": \"agent-playground-layout\",\n  \"label\": \"Agent Playground Layout\",\n  \"notes\": \"What design question this feature explores.\",\n  \"defaultRoute\": \"\u002Fbuild\u002Fagents\u002F:agent\u002Fplayground\",\n  \"defaultParams\": { \"agent\": \"agent-001\" },\n  \"routes\": [\"\u002Fbuild\u002Fagents\u002F:agent\u002Fplayground\"],\n  \"variants\": [\n    { \"id\": \"side-panel\", \"label\": \"Side Panel (Current)\" },\n    { \"id\": \"accordion\", \"label\": \"Accordion Layout\" }\n  ]\n}\n```\n\n#### 2. Add `useFeature()` to the Route Component\n\n```tsx\nimport { useFeature } from '~\u002Ffeatures\u002FFeatureContext';\n\nfunction MyPage() {\n  const variant = useFeature('agent-playground-layout');\n\n  if (variant === 'accordion') return \u003CAccordionLayout \u002F>;\n  return \u003CDefaultLayout \u002F>; \u002F\u002F 'side-panel' or null\n}\n```\n\n### Feature WITHOUT Variants\n\nWhen the feature is a single prototyped change with no alternatives:\n\n#### 1. Add the feature to `app\u002Ffeatures.json`\n\nAdd this object to the registry's top-level `features` array:\n\n```json\n{\n  \"id\": \"dark-mode-revamp\",\n  \"label\": \"Dark Mode Revamp\",\n  \"notes\": \"Updated dark mode colors across settings page.\",\n  \"defaultRoute\": \"\u002Fsettings\u002Fappearance\",\n  \"routes\": [\"\u002Fsettings\u002Fappearance\"]\n}\n```\n\nNo `variants` array needed. The feature appears in the Prototype InteractionTag menu as a navigation link. No `useFeature()` call is needed in the route component.\n\n---\n\n**Field reference:**\n\n| Field           | Required | Description                                                                                                                    |\n| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| `id`            | Yes      | Kebab-case string identifier (used in URL params)                                                                              |\n| `label`         | Yes      | Human-readable name shown in the floating UI                                                                                   |\n| `notes`         | Yes      | Design context — what question does this feature explore?                                                                      |\n| `defaultRoute`  | Yes      | The primary route to navigate to from the Prototype menu; must be in `routes`                                                  |\n| `defaultParams` | No       | Fallback values for `:param` segments (e.g., `{ \"agent\": \"agent-001\" }`); required when `defaultRoute` has required parameters |\n| `routes`        | Yes      | Route patterns this feature applies to. Supports `:param` wildcards                                                            |\n| `variants`      | No       | Array of `{ id: string, label: string }`. Omit for variant-less features                                                       |\n\n**Route pattern matching:** A pattern like `\u002Fbuild\u002Fagents\u002F:agent\u002Fplayground` matches any URL of that shape. The `:param` segments are wildcards matched segment-by-segment.\n\n---\n\n## `useFeature()` Return Values\n\n```tsx\nconst result = useFeature('feature-id');\n\u002F\u002F Returns:\n\u002F\u002F   string  — active variant id (e.g., 'accordion') if feature has variants\n\u002F\u002F   true    — if feature is variant-less and applies to current route\n\u002F\u002F   null    — if feature doesn't apply to current route\n```\n\n---\n\n## Multi-Feature Pages\n\nA single page can have **multiple features** active simultaneously. Each component on the page calls `useFeature()` with its own feature ID independently.\n\n```tsx\nconst layout = useFeature('agent-playground-layout');\nconst codeTab = useFeature('code-tab-visibility');\n\n\u002F\u002F Both return their own variant independently\n\u002F\u002F URL: ?variant=agent-playground-layout--accordion&variant=code-tab-visibility--visible\n```\n\nThe floating strip shows variant tab links for all applicable features with variants, separated by dividers.\n\n---\n\n## Variant Scope — What Can Change?\n\nA variant can change **anything** within its route component:\n\n- **Full page replacement**: Return entirely different component trees per variant\n- **Section swap**: Replace just one panel, card, or section\n- **Prop changes**: Same component with different props\n- **Style changes**: Different CSS classes per variant\n- **Data presentation**: Same data shown in different formats\n- **Conditional features**: Show\u002Fhide features like buttons, tabs, or panels\n\n### Example — Small Change (text variant)\n\n```tsx\nconst variant = useFeature('hero-text');\nreturn (\n  \u003CText preset=\"heading2\" foreground={1}>\n    {variant === 'version-b'\n      ? 'Start Building with AI'\n      : variant === 'version-c'\n        ? 'Your AI Development Platform'\n        : 'Welcome to CoreAI Sandbox'}\n  \u003C\u002FText>\n);\n```\n\n### Example — Full Layout Swap\n\n```tsx\nconst variant = useFeature('playground-layout');\nif (variant === 'accordion') return \u003CAccordionLayout \u002F>;\nif (variant === 'dialog') return \u003CDialogLayout \u002F>;\nreturn \u003CSidePanelLayout \u002F>;\n```\n\n---\n\n## Variant-Exclusive Routes\n\nSome variants introduce routes that only exist for that variant (e.g., a \"Code\" tab route that only exists when `go-to-code--tab` is active). If a user lands on a variant-exclusive route with the wrong variant selected, the route component should redirect:\n\n```tsx\nconst variant = useFeature('go-to-code');\n\n\u002F\u002F This route only exists for the \"tab\" variant — redirect otherwise\nif (variant !== 'tab') return \u003CNavigate to=\"..\u002Fplayground\" replace \u002F>;\n```\n\nKeep this guard **in the route component itself**, colocated with the route that knows it's conditional. Do not add redirect logic to `FeatureProvider.tsx`.\n\n---\n\n## Anti-Patterns — Do NOT Do These\n\n| ❌ Don't                                                                                                                             | ✅ Do Instead                                               |\n| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------- |\n| Build a custom toggle\u002Fswitch for design alternatives                                                                                 | Use `useFeature()` + `app\u002Ffeatures.json`                    |\n| Store variant state in localStorage or React state                                                                                   | URL query params (`?variant=...`) handle everything         |\n| Create separate routes for each design alternative                                                                                   | One route, conditional rendering via `useFeature()`         |\n| Import feature implementation internals from `app\u002Ffeatures\u002FfeatureConfig.ts` or `app\u002Ffeatures\u002FFeatureProvider.tsx` in app components | Use `useFeature()` from `~\u002Ffeatures\u002FFeatureContext`         |\n| Hard-code variant IDs as numbers                                                                                                     | Feature and variant IDs are **kebab-case strings**          |\n| Add a new variant switching UI element into the product design                                                                       | The floating tab-link UI is the switcher — it's meta-UI     |\n| Modify app-local feature-system internals for an app feature                                                                         | Only modify `app\u002Ffeatures.json` and the consuming component |\n\n---\n\n## Troubleshooting\n\n**Floating strip doesn't appear on my page:**\n\n- Check that the route pattern in `app\u002Ffeatures.json` matches your page's URL exactly (segment-by-segment)\n- `:param` segments match any value, but the number of segments must match\n- Ensure the applicable feature has variants and **Show feature selector** is enabled in the Prototype menu\n- Check browser console for errors\n\n**`useFeature()` returns null:**\n\n- Verify you're passing the **feature ID** (string), not the variant ID\n- Verify the feature's `routes` array includes a pattern matching the current page\n\n**Variant tab links show but clicking doesn't change anything:**\n\n- Ensure your component reads `useFeature()` and conditionally renders based on it\n- Make sure you're checking the correct variant IDs (kebab-case strings)\n\n**URL params get cleared when navigating:**\n\n- This is expected for off-route `variant` params: they are removed. When returning during client navigation, valid URL selections take priority, then remembered selections, then the first configured variant. A reload uses the URL or the first variant, not remembered client-navigation state. Unrelated query params are preserved.\n","# Feature & Variant System Instructions\n\nPaths below are relative to this app's directory.\n\n## What Is the Feature System?\n\nCoreAI Sandbox has a **built-in feature\u002Fvariant system** for tracking prototyped features and presenting multiple UI alternatives on the same page. It uses a neutral floating selector with small, elevated tab links and a brand-colored Prototype InteractionTag menu trigger to distinguish itself from the designs being prototyped.\n\nA **feature** represents a prototyped change from main. A feature may:\n\n- Have **variants** — multiple design alternatives that can be switched between (e.g., different layouts)\n- Be **variant-less** — a single prototyped change with no alternatives (just a link to the location of the change)\n\n**Multiple features can be active simultaneously** on the same page, each with their own independent variant selection.\n\n**You MUST use this system** whenever a user asks to:\n\n- Try a different layout, design, or approach for a page or section\n- Create an \"option B\" or \"version 2\" of something\n- Compare two or more designs side by side\n- Add an A\u002FB test or design alternative\n- Explore an alternate version of a feature\n\n**Do NOT** build a custom toggle, tab switcher, or parallel component tree. The feature system already handles all of this.\n\n> For a guided walk-through tailored to designer-style requests, invoke the `new-variant` skill.\n\n---\n\n## How It Works (Summary)\n\n1. **Features** are defined in `app\u002Ffeatures.json`. Each feature may have variant options. The registry is currently empty; add definitions to its top-level `features` array.\n2. Active variants are encoded in the URL as repeated `?variant=feature-id--variant-id` params — every combination is a shareable deep link.\n3. When a user navigates to a page with applicable features, the system **automatically populates** selections from valid URL values, then remembered client-navigation selections, then the first configured variant.\n4. A **draggable floating switcher strip** appears bottom-center by default showing each feature's variants as small, elevated router-backed tab links, when applicable variants exist and **Show feature selector** is enabled in the Prototype menu.\n5. Route components use the `useFeature(featureId)` hook to conditionally render based on the active variant.\n6. **Multiple features** can be active on the same page simultaneously with independent variant selections.\n\n---\n\n## Architecture — Key Files\n\n| File                                            | Purpose                                                                |\n| ----------------------------------------------- | ---------------------------------------------------------------------- |\n| `app\u002Ffeatures.json`                             | App configuration: all features, routes, and variant labels            |\n| `app\u002Ffeatures\u002FfeatureConfig.ts`                 | Feature schema, configuration validation, and route\u002FURL helpers        |\n| `app\u002Ffeatures\u002FFeatureContext.ts`                | Feature context and public context types                               |\n| `app\u002Ffeatures\u002FFeatureProvider.tsx`              | URL state, route matching, defaults, and floating selector composition |\n| `app\u002Ffeatures\u002FFeatureContext.ts` (`useFeature`) | Public hook for reading the active variant                             |\n| `app\u002Ffeatures\u002FFeatureFloatingUI.tsx`            | Floating variant selector                                              |\n| `app\u002Ffeatures\u002FFeatureMenu.tsx`                  | Prototype feature menu used by the app shell                           |\n\n---\n\n## URL Structure\n\nVariants are encoded as repeated `variant` query params:\n\n```\n# Single feature with one variant active\n?variant=agent-playground-layout--accordion\n\n# Two features active simultaneously\n?variant=agent-playground-layout--accordion&variant=code-tab--visible\n\n# Variant-less features have no variant query param (they apply only on matching routes)\n```\n\nEach `variant` param is a `feature-id--variant-id` pair using kebab-case string identifiers.\n\n---\n\n## Step-by-Step: Adding a New Variant to an Existing Feature\n\nIf a feature already exists in `app\u002Ffeatures.json` and has variants, add a new variant:\n\n### 1. Update `app\u002Ffeatures.json`\n\nAdd a new entry to the `variants` array of the existing feature:\n\n```json\n{\n  \"id\": \"your-new-variant\",\n  \"label\": \"Your New Design Name\"\n}\n```\n\nVariant `id` values are **kebab-case strings**. Choose a descriptive, URL-friendly name.\n\n### 2. Update the Route Component\n\nIn the route component that uses this feature, add a conditional branch for the new variant:\n\n```tsx\nimport { useFeature } from '~\u002Ffeatures\u002FFeatureContext';\n\nfunction MyPage() {\n  const variant = useFeature('agent-playground-layout');\n\n  if (variant === 'accordion') return \u003CAccordionLayout \u002F>;\n  if (variant === 'your-new-variant') return \u003CYourNewDesign \u002F>; \u002F\u002F ← new\n  return \u003CDefaultLayout \u002F>; \u002F\u002F first variant or null\n}\n```\n\nThat's it. The floating UI automatically shows the new tab link when the selector is visible on an applicable route.\n\n---\n\n## Step-by-Step: Creating a New Feature\n\n### Feature WITH Variants\n\nWhen the feature explores multiple design alternatives:\n\n#### 1. Add the feature to `app\u002Ffeatures.json`\n\nAdd this object to the registry's top-level `features` array:\n\n```json\n{\n  \"id\": \"agent-playground-layout\",\n  \"label\": \"Agent Playground Layout\",\n  \"notes\": \"What design question this feature explores.\",\n  \"defaultRoute\": \"\u002Fbuild\u002Fagents\u002F:agent\u002Fplayground\",\n  \"defaultParams\": { \"agent\": \"agent-001\" },\n  \"routes\": [\"\u002Fbuild\u002Fagents\u002F:agent\u002Fplayground\"],\n  \"variants\": [\n    { \"id\": \"side-panel\", \"label\": \"Side Panel (Current)\" },\n    { \"id\": \"accordion\", \"label\": \"Accordion Layout\" }\n  ]\n}\n```\n\n#### 2. Add `useFeature()` to the Route Component\n\n```tsx\nimport { useFeature } from '~\u002Ffeatures\u002FFeatureContext';\n\nfunction MyPage() {\n  const variant = useFeature('agent-playground-layout');\n\n  if (variant === 'accordion') return \u003CAccordionLayout \u002F>;\n  return \u003CDefaultLayout \u002F>; \u002F\u002F 'side-panel' or null\n}\n```\n\n### Feature WITHOUT Variants\n\nWhen the feature is a single prototyped change with no alternatives:\n\n#### 1. Add the feature to `app\u002Ffeatures.json`\n\nAdd this object to the registry's top-level `features` array:\n\n```json\n{\n  \"id\": \"dark-mode-revamp\",\n  \"label\": \"Dark Mode Revamp\",\n  \"notes\": \"Updated dark mode colors across settings page.\",\n  \"defaultRoute\": \"\u002Fsettings\u002Fappearance\",\n  \"routes\": [\"\u002Fsettings\u002Fappearance\"]\n}\n```\n\nNo `variants` array needed. The feature appears in the Prototype InteractionTag menu as a navigation link. No `useFeature()` call is needed in the route component.\n\n---\n\n**Field reference:**\n\n| Field           | Required | Description                                                                                                                    |\n| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| `id`            | Yes      | Kebab-case string identifier (used in URL params)                                                                              |\n| `label`         | Yes      | Human-readable name shown in the floating UI                                                                                   |\n| `notes`         | Yes      | Design context — what question does this feature explore?                                                                      |\n| `defaultRoute`  | Yes      | The primary route to navigate to from the Prototype menu; must be in `routes`                                                  |\n| `defaultParams` | No       | Fallback values for `:param` segments (e.g., `{ \"agent\": \"agent-001\" }`); required when `defaultRoute` has required parameters |\n| `routes`        | Yes      | Route patterns this feature applies to. Supports `:param` wildcards                                                            |\n| `variants`      | No       | Array of `{ id: string, label: string }`. Omit for variant-less features                                                       |\n\n**Route pattern matching:** A pattern like `\u002Fbuild\u002Fagents\u002F:agent\u002Fplayground` matches any URL of that shape. The `:param` segments are wildcards matched segment-by-segment.\n\n---\n\n## `useFeature()` Return Values\n\n```tsx\nconst result = useFeature('feature-id');\n\u002F\u002F Returns:\n\u002F\u002F   string  — active variant id (e.g., 'accordion') if feature has variants\n\u002F\u002F   true    — if feature is variant-less and applies to current route\n\u002F\u002F   null    — if feature doesn't apply to current route\n```\n\n---\n\n## Multi-Feature Pages\n\nA single page can have **multiple features** active simultaneously. Each component on the page calls `useFeature()` with its own feature ID independently.\n\n```tsx\nconst layout = useFeature('agent-playground-layout');\nconst codeTab = useFeature('code-tab-visibility');\n\n\u002F\u002F Both return their own variant independently\n\u002F\u002F URL: ?variant=agent-playground-layout--accordion&variant=code-tab-visibility--visible\n```\n\nThe floating strip shows variant tab links for all applicable features with variants, separated by dividers.\n\n---\n\n## Variant Scope — What Can Change?\n\nA variant can change **anything** within its route component:\n\n- **Full page replacement**: Return entirely different component trees per variant\n- **Section swap**: Replace just one panel, card, or section\n- **Prop changes**: Same component with different props\n- **Style changes**: Different CSS classes per variant\n- **Data presentation**: Same data shown in different formats\n- **Conditional features**: Show\u002Fhide features like buttons, tabs, or panels\n\n### Example — Small Change (text variant)\n\n```tsx\nconst variant = useFeature('hero-text');\nreturn (\n  \u003CText preset=\"heading2\" foreground={1}>\n    {variant === 'version-b'\n      ? 'Start Building with AI'\n      : variant === 'version-c'\n        ? 'Your AI Development Platform'\n        : 'Welcome to CoreAI Sandbox'}\n  \u003C\u002FText>\n);\n```\n\n### Example — Full Layout Swap\n\n```tsx\nconst variant = useFeature('playground-layout');\nif (variant === 'accordion') return \u003CAccordionLayout \u002F>;\nif (variant === 'dialog') return \u003CDialogLayout \u002F>;\nreturn \u003CSidePanelLayout \u002F>;\n```\n\n---\n\n## Variant-Exclusive Routes\n\nSome variants introduce routes that only exist for that variant (e.g., a \"Code\" tab route that only exists when `go-to-code--tab` is active). If a user lands on a variant-exclusive route with the wrong variant selected, the route component should redirect:\n\n```tsx\nconst variant = useFeature('go-to-code');\n\n\u002F\u002F This route only exists for the \"tab\" variant — redirect otherwise\nif (variant !== 'tab') return \u003CNavigate to=\"..\u002Fplayground\" replace \u002F>;\n```\n\nKeep this guard **in the route component itself**, colocated with the route that knows it's conditional. Do not add redirect logic to `FeatureProvider.tsx`.\n\n---\n\n## Anti-Patterns — Do NOT Do These\n\n| ❌ Don't                                                                                                                             | ✅ Do Instead                                               |\n| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------- |\n| Build a custom toggle\u002Fswitch for design alternatives                                                                                 | Use `useFeature()` + `app\u002Ffeatures.json`                    |\n| Store variant state in localStorage or React state                                                                                   | URL query params (`?variant=...`) handle everything         |\n| Create separate routes for each design alternative                                                                                   | One route, conditional rendering via `useFeature()`         |\n| Import feature implementation internals from `app\u002Ffeatures\u002FfeatureConfig.ts` or `app\u002Ffeatures\u002FFeatureProvider.tsx` in app components | Use `useFeature()` from `~\u002Ffeatures\u002FFeatureContext`         |\n| Hard-code variant IDs as numbers                                                                                                     | Feature and variant IDs are **kebab-case strings**          |\n| Add a new variant switching UI element into the product design                                                                       | The floating tab-link UI is the switcher — it's meta-UI     |\n| Modify app-local feature-system internals for an app feature                                                                         | Only modify `app\u002Ffeatures.json` and the consuming component |\n\n---\n\n## Troubleshooting\n\n**Floating strip doesn't appear on my page:**\n\n- Check that the route pattern in `app\u002Ffeatures.json` matches your page's URL exactly (segment-by-segment)\n- `:param` segments match any value, but the number of segments must match\n- Ensure the applicable feature has variants and **Show feature selector** is enabled in the Prototype menu\n- Check browser console for errors\n\n**`useFeature()` returns null:**\n\n- Verify you're passing the **feature ID** (string), not the variant ID\n- Verify the feature's `routes` array includes a pattern matching the current page\n\n**Variant tab links show but clicking doesn't change anything:**\n\n- Ensure your component reads `useFeature()` and conditionally renders based on it\n- Make sure you're checking the correct variant IDs (kebab-case strings)\n\n**URL params get cleared when navigating:**\n\n- This is expected for off-route `variant` params: they are removed. When returning during client navigation, valid URL selections take priority, then remembered selections, then the first configured variant. A reload uses the URL or the first variant, not remembered client-navigation state. Unrelated query params are preserved.\n",{"name":5,"description":7},"main","0e8bdbd952ce0d93c8976876fa59e9f119614ae8","starters\u002Fcoreai\u002F.agents\u002Fskills\u002Ffeatures-variants",35,"https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica","https:\u002F\u002Fgithub.com\u002Fgithub","https:\u002F\u002Fgithub.com\u002Fabout","How people build software.","2026-11-15 01:22:55",{"source":9,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add github\u002Freplica --skill features-variants",{"tool":54,"command":55},"bunx","bunx skills add github\u002Freplica --skill features-variants",{"tool":57,"command":58},"pnpm","pnpm dlx skills add github\u002Freplica --skill features-variants","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fcoreai\u002F.agents\u002Fskills\u002Ffeatures-variants\u002FSKILL.md",true,[],[63,71,92,113,127,142],{"skillNo":64,"name":65,"nameZh":17,"description":66,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7BGR5MA12JFGWQSF7CDXPD5","create-prototype-from-production","Use when asked to copy, clone, replicate or recreate a live production website or web app as a Replica prototype from its URL, such as \"create a prototype from https:\u002F\u002Fexample.com\" or \"replicate this site for a demo\". Do not use for building a new design from a brief, or for changing an existing prototype.","https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fminimal\u002F.agents\u002Fskills\u002Fcreate-prototype-from-production\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":72,"name":73,"nameZh":74,"description":75,"descriptionZh":76,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":77,"categories":78,"keywords":85,"publishedAt":34},"01M6AD93V99PC60JK4VK50HKXB","visual-design-review","页面视觉设计评审","Reviews page hierarchy, grouping, density, actions and state design using consumer-owned product and design-system guidance. Use when asked for a visual design review, page critique or whether a new page communicates its task clearly.","依据使用方自有的产品与设计系统指南，审查页面层级、分组、密度、操作及状态设计。当用户要求视觉设计评审、页面点评，或询问新页面是否清晰传达其任务时使用。","https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fshared\u002F.agents\u002Fskills\u002Fvisual-design-review\u002FSKILL.md",[79,82],{"categoryNo":80,"categoryName":81,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TKC3WYCB32755485KS6","视觉设计",{"categoryNo":83,"categoryName":84,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQMKHSMFVQHR2KYAEVN","界面设计师",[86,87,32,88,89,90,91],"review","design review","visual design review","actions","product","state",{"skillNo":93,"name":94,"nameZh":95,"description":96,"descriptionZh":97,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":98,"categories":99,"keywords":106,"publishedAt":34},"01M6AD91PX2VVM9NCAEHVTV12J","setup-skills","技能共享源配置与上下文起草","Configures shared sources and drafts context with independent writers. Plain\u002Ffresh setup offers installation of user-named packages and reuses built-in browser capabilities, adding browser tooling only for an evidenced required-check gap. Use for setup, source repair, writing context or refreshing drafts. Configure-only skips tooling and authoring; installations and activation require separate approval.","配置共享源，并使用独立的 writer 起草上下文。普通\u002F全新设置会提供用户指定包的安装，并复用内置浏览器能力，仅在确有证据表明必要检查存在缺口时才添加浏览器工具。适用于设置、源修复、编写上下文或刷新草稿。仅配置模式会跳过工具安装和编写；安装和激活需要单独批准。","https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fshared\u002F.agents\u002Fskills\u002Fsetup-skills\u002FSKILL.md",[100,103],{"categoryNo":101,"categoryName":102,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRN0CV1NMDZ5TEJX1GVM29","插件与技能管理",{"categoryNo":104,"categoryName":105,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师",[107,108,109,110,111,112],"setup","setup skills","browser","capabilities","writing","packages",{"skillNo":114,"name":115,"nameZh":116,"description":117,"descriptionZh":118,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":119,"categories":120,"keywords":125,"publishedAt":34},"01M6AD907YGYR4MJXMYKWF384R","review-hub-feedback","Hub 反馈设计主题提炼","Review Hub feedback for reusable design themes through discovery, independent judging and synthesis. No diagnosis or optimization.","通过发现、独立判断和综合归纳，审查 Hub 反馈以提炼可复用的设计主题。不进行诊断或优化。","https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fshared\u002F.agents\u002Fskills\u002Freview-hub-feedback\u002FSKILL.md",[121,122],{"categoryNo":83,"categoryName":84,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":123,"categoryName":124,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BV6DNANVDR10RQWB4XV2V6","用户反馈处理",[86,126,32],"review hub feedback",{"skillNo":128,"name":129,"nameZh":130,"description":131,"descriptionZh":132,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":133,"categories":134,"keywords":137,"publishedAt":34},"01M6AD8YR85DPBCPRAW8S112RD","responsive-audit","UI 响应式布局审计","Audits UI layout, overflow and navigation across product-defined viewports using consumer context and browser tools. Use when asked to check responsiveness, test mobile layout or audit breakpoint behavior.","使用使用者上下文和浏览器工具，跨产品定义的视口审查 UI 布局、溢出和导航。当用户要求检查响应式、测试移动端布局或审查断点行为时使用。","https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fshared\u002F.agents\u002Fskills\u002Fresponsive-audit\u002FSKILL.md",[135,136],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[138,139,90,140,141,109],"responsive audit","audit","ui","test",{"skillNo":143,"name":144,"nameZh":145,"description":146,"descriptionZh":147,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":148,"categories":149,"keywords":154,"publishedAt":34},"01M6AD8WA6KSR3GQ57WJ0T6M0D","prototype-controls","Replica 原型控件创建与绑定","Create and wire Replica prototype controls. Use when asked to add or change dropdowns, sliders, input fields, toggles or action buttons that configure variants, scenarios, visible UI, app state or data sources, even without canvas terminology. Covers declarations, typed bindings, defaults, conditions, resets and actions. Product UI form fields and filters alone belong to create-prototype.","创建并连接 Replica 原型控件。当用户要求添加或修改下拉框、滑块、输入框、切换开关或操作按钮（用于配置变体、场景、可见 UI、应用状态或数据源）时使用，即使未使用画布术语也一样。涵盖声明、类型化绑定、默认值、条件、重置和动作。仅涉及产品 UI 表单字段和筛选器时，应使用 create-prototype。","https:\u002F\u002Fgithub.com\u002Fgithub\u002Freplica\u002Fblob\u002Fmain\u002Fstarters\u002Fshared\u002F.agents\u002Fskills\u002Fprototype-controls\u002FSKILL.md",[150,151],{"categoryNo":83,"categoryName":84,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":152,"categoryName":153,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BWKS60NTYJHFE9FQSXGDKS","低代码应用开发",[155,33,91,156,157,140,90,89,158],"prototype controls","create","change","canvas"]