原型交互技能 prototype-interaction

原型交互技能是一款用于定义和规范数字产品原型交互行为的工具。它能够映射用户点击、轻触等操作,配置页面间的过渡动画效果,设置交互热点区域,并生成可用于设计交接的详细交互规范文档。支持导出为Figma、InVision等主流原型工具格式。关键词:原型设计、交互设计、用户体验、UI设计、Figma原型、设计规范、过渡动画、热点区域、设计交接。

前端开发 0 次安装 0 次浏览 更新于 2/26/2026

name: prototype-interaction description: 定义和记录原型交互、过渡效果和热点区域 allowed-tools:

  • Read
  • Write
  • Edit
  • Bash
  • Glob
  • Grep

原型交互技能

目的

定义原型交互,映射点击/轻触操作,配置过渡动画,并为设计交接生成交互规范文档。

能力

  • 将点击/轻触交互映射到目标页面
  • 定义过渡动画类型和时序
  • 设置交互式热点区域
  • 生成交互规范文档
  • 导出为Figma原型格式
  • 创建交互矩阵

目标流程

  • hifi-prototyping.js
  • wireframing.js (interactivePrototypeTask)

集成点

  • Figma Prototype API
  • InVision API
  • ProtoPie 规范

输入模式

{
  "type": "object",
  "properties": {
    "screens": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "imagePath": { "type": "string" }
        }
      }
    },
    "interactions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sourceScreen": { "type": "string" },
          "hotspot": {
            "type": "object",
            "properties": {
              "x": { "type": "number" },
              "y": { "type": "number" },
              "width": { "type": "number" },
              "height": { "type": "number" }
            }
          },
          "trigger": {
            "type": "string",
            "enum": ["tap", "click", "hover", "drag", "swipe"]
          },
          "targetScreen": { "type": "string" },
          "transition": {
            "type": "object",
            "properties": {
              "type": { "type": "string" },
              "duration": { "type": "number" },
              "easing": { "type": "string" }
            }
          }
        }
      }
    },
    "outputFormat": {
      "type": "string",
      "enum": ["json", "figma", "invision", "markdown"],
      "default": "json"
    }
  },
  "required": ["screens", "interactions"]
}

输出模式

{
  "type": "object",
  "properties": {
    "interactionSpec": {
      "type": "object",
      "description": "完整的交互规范"
    },
    "interactionMatrix": {
      "type": "array",
      "description": "页面到页面的交互矩阵"
    },
    "transitionGuide": {
      "type": "object",
      "description": "过渡动画时序和缓动效果指南"
    },
    "hotspotOverlays": {
      "type": "array",
      "description": "可视化热点区域叠加层数据"
    },
    "exportPath": {
      "type": "string",
      "description": "导出规范文件的路径"
    }
  }
}

使用示例

const result = await skill.execute({
  screens: [
    { id: 'home', name: '首页', imagePath: './screens/home.png' },
    { id: 'detail', name: '详情页', imagePath: './screens/detail.png' }
  ],
  interactions: [
    {
      sourceScreen: 'home',
      hotspot: { x: 100, y: 200, width: 150, height: 50 },
      trigger: 'tap',
      targetScreen: 'detail',
      transition: { type: 'slide-left', duration: 300, easing: 'ease-out' }
    }
  ],
  outputFormat: 'markdown'
});