AGENT SKILL

页面设计变体创建

new-variant

使用内置的功能/变体系统为页面创建新的设计变体或备选方案。使用时机:设计师想尝试不同的布局、创建“方案 B”或“版本 2”、并排比较设计、添加 A/B 备选方案,或探索替代版本。不要构建自定义的切换方案。

适用职业界面设计师
使用场景用户体验设计
License 许可
MIT
所属仓库
github/replica
最近更新
2026-11-15
Stars
★ 273
Forks
35

01 前言 Front Matter

name
new-variant
description
Create a new design variant or alternative for a page using the built-in feature/variant system. USE WHEN: a designer wants to try a different layout, create an "option B" or "version 2", compare designs side by side, add an A/B alternative, or explore an alternate version. Do NOT build a custom toggle solution.
argument-hint
Optional: route or feature name the variant targets

03 SKILL.md 正文

New Design Variant

You are helping a designer create a new design variant using CoreAI Sandbox's built-in feature/variant system. The designer may have no coding knowledge — they will describe what they want in plain language.

Paths below are relative to this app's directory.

Before You Start

  1. Invoke the features-variants skill — it is the definitive guide to the feature system (schemas, code patterns, field references, anti-patterns). Do not duplicate that information here — refer to it.
  2. Read app/features.json — understand what features already exist.
  3. Invoke the react-components skill — you will need to write .tsx code.
  4. Invoke the css-styling skill — if you need to write styles.

Workflow

Step 1: Understand the Designer's Request

Identify from the user's message:

  • What page or feature they want to change (e.g., "the playground", "the homepage hero", "the agent list")
  • What they want to try (e.g., "a different layout", "move the config panel to a dialog", "bigger hero text")
  • How it differs from the current design (the "current" design is always the first variant)

If the request is unclear, ask one focused question. Do not ask multiple questions — infer reasonable defaults.

Step 2: Determine the Route

Read app/routes.ts to discover the current route structure. Map the designer's description to a route file and its URL pattern. Routes are defined using React Router v7 config — index(), route(), and layout() calls show the path segments and corresponding file paths.

Step 3: Check for Existing Features

Read app/features.json and check if a feature already exists for this route.

  • If a feature exists: Add a new variant to the existing feature. Follow the "Adding a New Variant to an Existing Feature" section in the features-variants skill.
  • If no feature exists: Create a new feature. Follow the "Creating a New Feature" section in the features-variants skill.

Step 4: Implement

  1. Update app/features.json following the schema in the features-variants skill.
  2. Read the route component file identified in Step 2 — understand its structure before editing.
  3. Import useFeature from ~/features/FeatureContext and add conditional rendering to the route component, following the patterns in the features-variants skill.

Implementation sizing guidance:

  • For small changes (text, colors, visibility) — use inline conditionals within the existing JSX
  • For medium changes (rearranging sections, swapping a panel) — extract the variant-specific section into a local component or conditional block
  • For large changes (completely different page layout) — create the new layout inline in the same file or as a separate component in the same route folder

Step 5: Start the App and Verify

If the dev server is not already running, invoke the start-app skill.

Use the repository's browser validation workflow to:

  1. Navigate to the page
  2. Confirm the floating feature strip appears with the correct feature name and variant tab links; if hidden, enable Show feature selector in the Prototype menu
  3. Click each variant to verify switching works
  4. Take a screenshot to show the designer the result

Step 6: Report to the Designer

Tell the designer:

  • What you built and which variant it is
  • The URL they can use to see each variant (include ?variant=feature-id--variant-id)
  • How to switch between variants using the elevated tab links in the draggable floating strip (bottom-center by default)

04 同仓库更多 Skills

github
github/replica

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://example.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.

★ 273
github
github/replica

页面视觉设计评审

visual-design-review

依据使用方自有的产品与设计系统指南,审查页面层级、分组、密度、操作及状态设计。当用户要求视觉设计评审、页面点评,或询问新页面是否清晰传达其任务时使用。

界面设计师视觉设计
★ 273
github
github/replica

技能共享源配置与上下文起草

setup-skills

配置共享源,并使用独立的 writer 起草上下文。普通/全新设置会提供用户指定包的安装,并复用内置浏览器能力,仅在确有证据表明必要检查存在缺口时才添加浏览器工具。适用于设置、源修复、编写上下文或刷新草稿。仅配置模式会跳过工具安装和编写;安装和激活需要单独批准。

AI 工程师插件与技能管理
★ 273
github
github/replica

Hub 反馈设计主题提炼

review-hub-feedback

通过发现、独立判断和综合归纳,审查 Hub 反馈以提炼可复用的设计主题。不进行诊断或优化。

界面设计师用户反馈处理
★ 273
github
github/replica

UI 响应式布局审计

responsive-audit

使用使用者上下文和浏览器工具,跨产品定义的视口审查 UI 布局、溢出和导航。当用户要求检查响应式、测试移动端布局或审查断点行为时使用。

软件开发工程师前端开发与界面实现
★ 273
github
github/replica

Replica 原型控件创建与绑定

prototype-controls

创建并连接 Replica 原型控件。当用户要求添加或修改下拉框、滑块、输入框、切换开关或操作按钮(用于配置变体、场景、可见 UI、应用状态或数据源)时使用,即使未使用画布术语也一样。涵盖声明、类型化绑定、默认值、条件、重置和动作。仅涉及产品 UI 表单字段和筛选器时,应使用 create-prototype。

界面设计师低代码应用开发
★ 273