swiftui-component

swiftui-component is a skill for Claude Code, Codex from jeremieb/swift-unit-test-instructions. It costs 81 tokens per session (1,626 once invoked), scanned A, original, MIT.

A SwiftUI component builder that creates screens and views with a separate view model, the object that holds screen state and actions. It includes previews, accessibility support, and loading and error states.

In plain words
What is it for?
Use it to build SwiftUI lists, details, forms, modals, navigation screens, or reusable components with local or fetched data and user interactions.
Why use it?
It helps keep SwiftUI view code focused on display while giving data and behavior a clear home. It also makes common screen states and supported iOS versions explicit.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build SwiftUI lists, details, forms, modals, navigation screens, or reusable components with local or fetched data and user interactions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jeremieb/swift-unit-test-instructions/swiftui-component
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jeremieb/swift-unit-test-instructions --skill swiftui-component
Clone the repo
git clone --depth 1 https://github.com/jeremieb/swift-unit-test-instructions

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swiftui-component

README.md
[![agentmods](https://agentmods.dev/badge/skills/jeremieb/swift-unit-test-instructions/swiftui-component.svg)](https://agentmods.dev/skills/jeremieb/swift-unit-test-instructions/swiftui-component)
Your own site
<a href="https://agentmods.dev/skills/jeremieb/swift-unit-test-instructions/swiftui-component"><img src="https://agentmods.dev/badge/skills/jeremieb/swift-unit-test-instructions/swiftui-component.svg" alt="Measured on agentmods" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,626 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.01626
Opus 5 $0.00041 $0.00813
Sonnet 5 $0.00016 $0.00325
Haiku 4.5 $0.00008 $0.00163

Measured 8d ago against content hash 110db97fa4c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

swiftui-component scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/swiftui-component/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SwiftUI Component Creator

Instructions

Step 1: Clarify Requirements

Ask if not already provided:

  • What does the view display? (list, detail, form, modal, etc.)
  • What user interactions does it support? (tap, swipe, input, navigation)
  • What data does it need? (local state, fetched from API, passed in)
  • Any navigation behavior? (NavigationLink, sheet, fullScreenCover)
  • Min iOS version? (affects @Observable vs ObservableObject)

Step 2: Choose the State Pattern

iOS Target Pattern
iOS 17+ @Observable macro on ViewModel, @State private var viewModel in View
iOS 16 and below ObservableObject + @Published, @StateObject in View

Step 3: Generate the Files

Always generate two files: one View, one ViewModel.

View template (iOS 17+ / @Observable):

// Features/[Name]/[Name]View.swift
import SwiftUI

struct [Name]View: View {
    @State private var viewModel: [Name]ViewModel

    init(viewModel: [Name]ViewModel = [Name]ViewModel()) {
        _viewModel = State(initialValue: viewModel)
    }

    var body: some View {
        content
            .task { await viewModel.onAppear() }
            .alert("Error", isPresented: .constant(viewModel.error != nil)) {
                Button("OK") { viewModel.dismissError() }
            } message: {
                Text(viewModel.error?.localizedDescription ?? "")
            }
    }

    @ViewBuilder
    private var content: some View {
        if viewModel.isLoading {
            ProgressView()
        } else {
            mainContent
        }
    }

    private var mainContent: some View {
        // Primary UI here
        Text(viewModel.title)
            .accessibilityLabel(viewModel.title)
    }
}

#Preview {
    [Name]View(viewModel: [Name]ViewModel())
}

View template (iOS 16 / ObservableObject):

// Features/[Name]/[Name]View.swift
import SwiftUI

struct [Name]View: View {
    @StateObject private var viewModel: [Name]ViewModel

    init(viewModel: [Name]ViewModel = [Name]ViewModel()) {
        _viewModel = StateObject(wrappedValue: viewModel)
    }

    var body: some View {
        // same structure as above
    }
}

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 228 lines · 81 tokens per session scan A 110db97fa4c3

Subscribe to this mod's changes

swiftui-component is a skill published in the GitHub repository jeremieb/swift-unit-test-instructions (5 stars, last pushed 6mo ago), licensed MIT. It adds 81 tokens to every session and 1,626 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

react-mastery

Expert-level React development including React 19, Server Components, hooks composition, state management, and performance optimization. Trigger when the user asks to build, debug, or optimize React components, implement custom hooks, manage complex state, work with RSC/Suspense/streaming, or fix React performance…

FutureJJ/claude-skills · 81 tokens

nextjs-architect

Next.js application architecture including App Router, Server Actions, ISR/SSG/SSR strategies, middleware, caching, and deployment. Trigger when users ask about Next.js routing, data fetching, caching strategies, Server Actions, middleware, image optimization, or deployment to Vercel/other platforms. Also trigger for…

FutureJJ/claude-skills · 77 tokens

performance-tuner

Application performance optimization including profiling, caching strategies, lazy loading, CDN configuration, and Core Web Vitals. Trigger when users have slow applications, need caching advice, want to improve page load times, or optimize API response times.

FutureJJ/claude-skills · 49 tokens

css-craftsman

Modern CSS including Grid, Subgrid, container queries, CSS custom properties, animations, and CSS architecture patterns. Trigger for complex CSS layouts, animation design, responsive patterns, or CSS architecture decisions.

FutureJJ/claude-skills · 44 tokens

tailwind-master

Tailwind CSS including design systems, custom plugins, responsive patterns, dark mode, and component styling. Trigger for Tailwind configuration, custom utility creation, or Tailwind-based UI development.

FutureJJ/claude-skills · 41 tokens

vue-specialist

Vue.js development including Composition API, Pinia, Nuxt 3, Vue Router, and reactivity system patterns. Trigger when users build Vue applications or need help with Vue-specific patterns.

FutureJJ/claude-skills · 42 tokens