swift-development

A guide for writing non-visual Swift 6 and later code, including data models, business logic, concurrency, and tests.

In plain words
What is it for?
Use it for ViewModels, services, repositories, algorithms, JSON models, network code, macros, unit tests, and fixing concurrency warnings or data races.
Why use it?
It helps avoid unsafe data sharing, unclear errors, and inconsistent approaches when building Swift application code.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/projanvil/mindforge/swift-development
Any agent
npx skills add ProjAnvil/MindForge --skill swift-development
Clone the repo
git clone --depth 1 https://github.com/ProjAnvil/MindForge

Made for: Claude Code, Codex.

Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 686 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00059 $0.00686
Opus 5 $0.00030 $0.00343
Sonnet 5 $0.00012 $0.00137
Haiku 4.5 $0.00006 $0.00069

Measured yesterday against content hash e9ae75bd9429, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

swift-development 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 yesterday.

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/en/swift-development/SKILL.md · 82 lines

How it starts

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

Swift 6 Development Skill

Instructions

Follow this guide when working on non-UI Swift code, business logic, algorithms, or the data layer. Your goal is to write high-performance, thread-safe, and expressive Swift code.

What This Skill Does

  • Concurrent Programming: Write safe concurrent code using Actors, async/await, Task, and TaskGroup.
  • Type Safety: Define Sendable types and use Typed Throws for precise error handling.
  • Testing: Write modern unit tests using the Swift Testing framework.
  • Data Processing: Write Codable models and encapsulate JSON parsing and network requests.
  • Macros: Use or create macros to reduce boilerplate.

When to Use This Skill

  • When writing ViewModel, Service, or Repository layer code.
  • When defining data models (structs, enums).
  • When implementing algorithms or utility functions.
  • When writing unit tests.
  • When fixing concurrency warnings or data races.

Examples

Example 1: Defining a Safe Actor Service

/// A thread-safe user data service
actor UserService {
    private var cache: [String: User] = [:]
    
    // Use typed throws to specify the error type explicitly
    func fetchUser(id: String) async throws(NetworkError) -> User {
        if let cached = cache[id] {
            return cached
        }
        
        // Simulate network request
        let user = try await NetworkClient.shared.get("/users/\(id)", as: User.self)
        cache[id] = user
        return user
    }
}

Example 2: Testing with Swift Testing

import Testing
@testable import MyApp

@Test("User parsing should succeed")
func userParsing() async throws {
    let json = """
    { "id": "1", "name": "Alice" }
    """.data(using: .utf8)!
    
    let user = try JSONDecoder().decode(User.self, from: json)
    
    #expect(user.name == "Alice")
    #expect(user.id == "1")
}

Best Practices

  • Conform to Sendable: Any type passed between concurrency domains must conform to the Sendable protocol.
  • Avoid Global Mutable State: Avoid global variables unless protected by an Actor.
  • Implicitly Unwrapped Optionals: Strictly forbidden (the force unwrap operator), except where unavoidable in initializers (very rare).
  • Use let over var: Default to constants; use variables only when necessary.
  • Error Handling: Prefer throws and do-catch over returning Optional or Result types (throws is more natural in async contexts).

Read the full file on GitHub · 82 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. yesterday First seen · 82 lines · 59 tokens per session scan A e9ae75bd9429

Subscribe to this mod's changes

swift-development is a skill published in the GitHub repository ProjAnvil/MindForge (3 stars, last pushed 5mo ago), licensed MIT. It adds 59 tokens to every session and 686 once invoked, about $0.0003 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

opik-diagnose

Surface the Opik traces worth a developer's attention, ranked by signal — errors, failed tool calls, latency, regressions, and low online-eval scores — plus Diagnostics issues. Reads live/production traces via the SDK (searchtraces and agentinsights) and works with no MCP; uses the MCP issue entity when connected.…

comet-ml/opik-mcp · 147 tokens

client-scripts

Write ServiceNow client scripts (onLoad/onChange/onSubmit/onCellEdit) using gform, guser, GlideAjax, field visibility/mandatory toggles, and validation with debounced server calls.

serac-labs/serac · 45 tokens

agoragentic-transaction-assurance

Prepare, evaluate, and reconcile autonomous agent transactions without self-granting payment or owner authority. Use when an agent must bind principal authority, seller terms, payment evidence, execution, delivered outcome, and reconciliation; handle paid retries safely; or prepare an authority request for owner…

rhein1/agoragentic-integrations · 65 tokens

linkding

Manage bookmarks with Linkding. Use when the user asks to "save a bookmark", "add link", "search bookmarks", "list my bookmarks", "find saved links", "tag a bookmark", "archive bookmark", "check if URL is saved", "list tags", "create bundle", or mentions Linkding bookmark management.

jmagar/claude-homelab · 69 tokens

debugging-mutations

Verify what changed on a ServiceNow instance after a tool call — sysaudit inspection, syslog/transaction logs, session context, Flow Designer execution logs, outbound HTTP traces.

serac-labs/serac · 41 tokens

maya-shot-export

Pipeline stage — shot-level export: frame ranges, cameras, FBX / Alembic packaging for editorial. Use when packaging shot data for downstream departments. Not for full pipeline publish (maya-pipeline) or scene assembly (maya-scene-assembly).

dcc-mcp/dcc-mcp-maya · 60 tokens