build-feature

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Build Feature with ShipSwift

使用ShipSwift构建功能

Build production-ready iOS features by combining ShipSwift recipes -- copy-paste-ready SwiftUI implementations covering animations, charts, UI components, and full-stack modules.
通过组合ShipSwift模板构建可用于生产环境的iOS功能——这些模板是可直接复制粘贴的SwiftUI实现,涵盖动画、图表、UI组件和全栈模块。

Prerequisites Check

前置检查

Before starting, verify the ShipSwift recipe server is available by calling
listRecipes
.
If the recipe tools are not available, help the user set up:
  1. Install Skills:
    bash
    npx skills add signerlabs/shipswift-skills
  2. Connect the recipe server — the AI tool needs MCP access to fetch recipes:
    • Claude Code:
      claude mcp add --transport http shipswift https://api.shipswift.app/mcp
    • Cursor — add to
      .cursor/mcp.json
      :
      {"mcpServers":{"shipswift":{"type":"streamableHttp","url":"https://api.shipswift.app/mcp"}}}
    • VS Code Copilot — add to
      .vscode/mcp.json
      :
      {"servers":{"shipswift":{"type":"http","url":"https://api.shipswift.app/mcp"}}}
    • Other tools: See shipswift.app for setup guides
  3. Restart the AI tool, then try again.
开始之前,请调用
listRecipes
验证ShipSwift模板服务器是否可用。
如果模板工具不可用,请帮助用户完成设置:
  1. 安装Skills:
    bash
    npx skills add signerlabs/shipswift-skills
  2. 连接模板服务器 —— AI工具需要MCP权限来获取模板:
    • Claude Code
      claude mcp add --transport http shipswift https://api.shipswift.app/mcp
    • Cursor —— 添加到
      .cursor/mcp.json
      {"mcpServers":{"shipswift":{"type":"streamableHttp","url":"https://api.shipswift.app/mcp"}}}
    • VS Code Copilot —— 添加到
      .vscode/mcp.json
      {"servers":{"shipswift":{"type":"http","url":"https://api.shipswift.app/mcp"}}}
    • 其他工具:请查看shipswift.app获取设置指南
  3. 重启AI工具,然后重试。

Workflow

工作流程

  1. Analyze the request: Break down the user's feature request into discrete components (UI, data, navigation, backend integration).
  2. Search for recipes: Use
    searchRecipes
    with relevant keywords to find matching ShipSwift recipes. Try multiple search terms if the first query returns few results.
  3. Fetch full implementations: Use
    getRecipe
    for each relevant recipe to get the complete source code, architecture explanation, and integration checklist.
  4. Present an integration plan: Before writing code, show the user:
    • Which recipes will be used
    • How they connect together
    • What customizations are needed for their specific use case
  5. Generate code: Adapt the recipe patterns to the user's project structure. Combine multiple recipes when the feature spans several areas (e.g., a chart view with shimmer loading animation).
  6. Provide integration checklist: List any required dependencies, Info.plist entries, or environment setup from the recipe documentation.
  1. 分析请求:将用户的功能请求拆解为独立组件(UI、数据、导航、后端集成)。
  2. 搜索模板:使用
    searchRecipes
    和相关关键词查找匹配的ShipSwift模板。如果首次查询结果较少,尝试多个搜索词。
  3. 获取完整实现:对每个相关模板使用
    getRecipe
    ,获取完整源代码、架构说明和集成清单。
  4. 提供集成方案:在编写代码之前,向用户展示:
    • 将使用哪些模板
    • 这些模板如何关联
    • 针对用户的特定用例需要哪些自定义修改
  5. 生成代码:调整模板模式以适配用户的项目结构。当功能涉及多个领域时(例如,带有微光加载动画的图表视图),组合多个模板。
  6. 提供集成清单:列出模板文档中提到的所有必需依赖项、Info.plist条目或环境设置。

Guidelines

指南

  • Always search recipes before writing code from scratch -- ShipSwift likely has a ready-made solution.
  • Combine multiple recipes when the feature spans several areas.
  • Use
    SW
    -prefixed naming conventions for ShipSwift components (e.g.,
    SWShimmer
    ,
    SWDonutChart
    ).
  • View modifier methods use
    .sw
    lowercase prefix (e.g.,
    .swShimmer()
    ,
    .swGlowScan()
    ).
  • Keep Views lightweight; extract complex logic into ViewModels.
  • Support Dark Mode and Dynamic Type by default.
  • Prefer SwiftUI-native APIs over UIKit wrappers.
  • 编写代码前务必先搜索模板——ShipSwift很可能已有现成解决方案。
  • 当功能涉及多个领域时,组合多个模板。
  • 对ShipSwift组件使用
    SW
    前缀的命名约定(例如
    SWShimmer
    SWDonutChart
    )。
  • 视图修饰符方法使用
    .sw
    小写前缀(例如
    .swShimmer()
    .swGlowScan()
    )。
  • 保持视图轻量化;将复杂逻辑提取到ViewModel中。
  • 默认支持深色模式和动态字体。
  • 优先使用SwiftUI原生API而非UIKit包装器。

Pro Recipes

专业版模板

Some recipes require ShipSwift Pro. When a recipe returns a purchase prompt instead of full code:
  1. Show the user the recipe preview (title, description, and architecture overview).
  2. Let them know: "This is a Pro recipe. Get lifetime access to all Pro recipes at shipswift.app/pricing ($89, one-time payment)."
  3. If they already have a Pro key, guide them to set the
    SHIPSWIFT_API_KEY
    environment variable:
    bash
    # Add to ~/.zshrc or ~/.bashrc
    export SHIPSWIFT_API_KEY=sk_live_xxxxx
    Then restart their AI tool for the key to take effect.
部分模板需要ShipSwift Pro权限。当模板返回购买提示而非完整代码时:
  1. 向用户展示模板预览(标题、描述和架构概述)。
  2. 告知用户:“这是专业版模板。只需一次性支付89美元,即可在shipswift.app/pricing获取所有专业版模板的终身使用权。”
  3. 如果用户已有专业版密钥,指导他们设置
    SHIPSWIFT_API_KEY
    环境变量:
    bash
    # 添加到~/.zshrc或~/.bashrc
    export SHIPSWIFT_API_KEY=sk_live_xxxxx
    然后重启AI工具使密钥生效。