Command Palette

Search for a command to run...

Назад к скиллам
скилл № 06698

verifying-with-storybook

Use when building or modifying SwiftUI views and need to visually verify the implementation matches requirements. Especially useful when implementing design…

БесплатноБез исполняемых скриптов
aj-bartocciот aj-bartocci★ 43 звезды на GitHub9 установок в других каталогах

Установить verifying-with-storybook в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Verifying with Storybook

Overview

Storybook-SwiftUI enables instant visual verification of SwiftUI views during development. Tag views with unique identifiers, launch the app directly to Storybook, and automatically navigate to the specific view being developed.

Core principle: Visual verification should be as fast as running a test - tag it, launch it, see it.

When to Use

Use this workflow when:

  • Implementing new SwiftUI views or components
  • Fixing UI bugs that require visual verification
  • Iterating on design implementations
  • Need to verify view appears correctly across different states

Don't use when:

  • Pure logic changes with no UI impact
  • Working on backend/API code
  • Unit testing is sufficient for verification

Setup: Launch Arguments

To enable direct launch to Storybook, configure your app's launch arguments:

1. Add Launch Argument Handler

In your app's entry point or SceneDelegate:

import Storybook
import SwiftUI

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            if ProcessInfo.processInfo.arguments.contains("--storybook") {
                Storybook.render()
            } else {
                ContentView()
            }
        }
    }
}

2. Configure Xcode Scheme

Edit Scheme → Run → Arguments → Arguments Passed On Launch:

  • Add: --storybook
  • Leave unchecked by default
  • Check when you want to launch directly to Storybook

Tip: Create a separate scheme called "Storybook" with this argument always enabled.

Tagging for Navigation

Use Unique Tags for Development

When creating or modifying a view, add a unique tag using a UUID:

extension Storybook {
    @objc static let myButton = StorybookPage(
        folder: "/Design System/Buttons",
        views: [
            PrimaryButton()
                .storybookTitle("Primary")
                .storybookTags("dev-12a34b56")  // Unique tag for this session
        ]
    )
}

Why UUIDs work well:

  • Guaranteed unique across all views
  • Easy to search (no conflicts)
  • Can be temporary (remove after verification)
  • Auto-navigate works (single result)

Generate UUID

# macOS/Linux
uuidgen | tr '[:upper:]' '[:lower:]' | cut -c1-8
# Example: 3f1b16a2

# Or in code
UUID().uuidString.lowercased().prefix(8)

Verification Workflow

Standard Flow

digraph verification_flow {
    "Add unique tag to view" [shape=box];
    "Build and run with --storybook" [shape=box];
    "Search for tag" [shape=box];
    "Auto-navigate?" [shape=diamond];
    "View opens automatically" [shape=box];
    "Tap result to open" [shape=box];
    "Verify visually" [shape=box];
    "Make changes" [shape=box];
    "Hot reload or rebuild" [shape=box];
    "Done?" [shape=diamond];
    "Remove dev tag" [shape=box];
    "Complete" [shape=box];

    "Add unique tag to view" -> "Build and run with --storybook";
    "Build and run with --storybook" -> "Search for tag";
    "Search for tag" -> "Auto-navigate?";
    "Auto-navigate?" -> "View opens automatically" [label="single result"];
    "Auto-navigate?" -> "Tap result to open" [label="multiple"];
    "View opens automatically" -> "Verify visually";
    "Tap result to open" -> "Verify visually";
    "Verify visually" -> "Done?";
    "Done?" -> "Remove dev tag" [label="yes"];
    "Done?" -> "Make changes" [label="no"];
    "Make changes" -> "Hot reload or rebuild";
    "Hot reload or rebuild" -> "Verify visually";
    "Remove dev tag" -> "Complete";
}

Quick Reference

Step Command/Action Example
Generate tag uuidgen | tr '[:upper:]' '[:lower:]' | cut -c1-8 dev-3f1b16a2
Add to view .storybookTags("dev-{uuid}") .storybookTags("dev-3f1b16a2")
Launch Enable --storybook argument and run Xcode Run ▶
Navigate Search #{tag} in Storybook #dev-3f1b16a2
Verify View opens automatically if unique Visual inspection
Clean up Remove dev tag before commit Delete .storybookTags() line

Complete Example

Scenario: Building a new profile card component

// 1. Create the view
struct ProfileCard: View {
    let name: String
    let avatar: String

    var body: some View {
        HStack {
            Image(systemName: avatar)
                .font(.largeTitle)
            Text(name)
                .font(.headline)
        }
        .padding()
        .background(Color.gray.opacity(0.1))
        .cornerRadius(8)
    }
}

// 2. Add to Storybook with unique dev tag
extension Storybook {
    @objc static let profileCard = StorybookPage(
        folder: "/Components/Profile",
        views: [
            ProfileCard(name: "John Doe", avatar: "person.circle")
                .storybookTitle("Default State")
                .storybookTags("dev-a7c8f3e1"),  // ← Unique tag
            ProfileCard(name: "Jane Smith", avatar: "person.circle.fill")
                .storybookTitle("Filled Avatar")
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл verifying-with-storybook?

Use when building or modifying SwiftUI views and need to visually verify the implementation matches requirements. Especially useful when implementing design specs, fixing UI bugs, or creating new components where visual correctness is critical.

Как установить скилл verifying-with-storybook?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл verifying-with-storybook запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить verifying-with-storybook с