Files
hms/.claude/skills/design-handoff/rules/interaction-rules.yml
iven 6151fde7c4 fix(skills): 修复 design-handoff 医生端原型输出质量
- match-tokens: alias 增加值条件映射,支持 doctor/patient variant 自动检测
- parse-prototype: 支持 IosFrame label prop 提取(JSX 属性模式)
- interaction-rules: login-cta 增加 exclude_patterns 避免"立即关注"误报
- tokens.yml: T.pri/T.priL/T.priD alias 改为数组格式,按值匹配 variant

验证: 患者端 T.pri→--tk-pri 确认,医生端 T.pri→--tk-pri.doctor 确认
2026-05-18 01:00:20 +08:00

115 lines
2.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: 1
updated: "2026-05-17"
# ============================================================================
# 交互推断规则
# patterns 使用正则表达式,匹配 HTML/JS 源码中的实际代码模式
# require_all: true 表示所有 pattern 必须同时匹配(默认 false任一匹配即可
# ============================================================================
rules:
- id: swiper-autoplay
name: "自动轮播 + 手动滑动"
patterns:
- "linear-gradient"
- "width.*24.*width.*8"
require_all: false
infer:
component: "Swiper"
props: "autoplay circular indicatorDots"
behavior: "自动轮播3-5秒切换"
confidence: high
- id: card-tap
name: "卡片点击跳转"
patterns:
- "\\.map\\("
require_all: false
infer:
component: "ContentCard"
props: "activeFeedback onPress"
behavior: "卡片可点击,带触控反馈"
confidence: medium
- id: form-submit
name: "表单提交"
patterns:
- "<input"
- "<button"
require_all: false
infer:
component: "FormInput + PrimaryButton"
props: ""
behavior: "表单输入+提交按钮"
confidence: high
- id: list-scroll
name: "列表滚动"
patterns:
- "overflow.*auto|scroll"
- "\\.map\\(.*\\.map\\(.*\\.map\\("
require_all: false
infer:
component: "ScrollView"
props: "scrollY onScrollToLower"
behavior: "可滚动列表,支持上拉加载"
confidence: medium
- id: tab-switch
name: "标签页切换"
patterns:
- "tab"
- "segment"
- "filter"
require_all: false
infer:
component: "TabFilter"
props: "tabs onChange"
behavior: "标签页切换筛选"
confidence: medium
- id: static-decoration
name: "纯装饰无交互"
patterns:
- "position.*absolute"
- "opacity.*0\\."
require_all: true
infer:
component: null
props: ""
behavior: "纯装饰性元素,无交互"
confidence: high
- id: login-cta
name: "登录/注册触发"
patterns:
- "登录"
- "注册"
- "微信登录"
- "立即登录"
exclude_patterns:
- "立即关注"
- "立即处理"
- "立即查看"
- "需要立即"
require_all: false
infer:
component: "PrimaryButton"
props: "onClick"
behavior: "登录/注册引导按钮"
confidence: high
- id: empty-fallback
name: "空数据降级"
patterns:
- "\\.length > 0"
- "\\.length === 0"
- "暂无"
- "没有"
require_all: false
infer:
component: null
props: ""
behavior: "条件渲染:有数据显示列表,无数据显示空状态"
confidence: medium