swift-style

Enforce Swift naming, organization, and spacing conventions across codebases.

4|Updated Dec 11, 2022
One-click install
npx skills add https://github.com/namuan/namuan --skill swift-style-namuan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-style
Source: https://github.com/namuan/namuan/tree/main/agents/skills/swift-style
Command: npx skills add https://github.com/namuan/namuan --skill swift-style-namuan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Swift code style conventions for clean, readable Swift code, providing explicit guidance on naming, organization, and idiomatic patterns to improve maintainability and collaboration.

Core Features & Use Cases

  • Naming conventions: UpperCamelCase for types and protocols; lowerCamelCase for everything else; avoid abbreviations except universal URLs, IDs.
  • Code organization: Use extensions and MARK comments to structure code; keep the happy path clear and minimize nesting.
  • Spacing & style: Consistent brace placement, single blank lines between methods, and clear colon spacing to reduce cognitive load.

Quick Start

Apply these conventions to your Swift files to produce consistent, idiomatic code.

Frequently Asked Questions about swift-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to enforce consistent Swift code style across a project?

Consistent Swift code style is enforced by applying explicit rules for naming, file organization, and spacing. Using extensions and MARK comments to structure files ensures clean, readable code that improves maintainability and team collaboration.

How do I organize Swift files to minimize nesting and keep the happy path clear?

To organize Swift files, use extensions and MARK comments to structure code logically. Keep the happy path clear and minimize nesting by applying these idiomatic patterns, which improves code readability and reduces cognitive load for developers.

What naming conventions should I use for types, protocols, and variables in Swift?

For Swift naming conventions, use UpperCamelCase for types and protocols, and lowerCamelCase for everything else. Avoid abbreviations except for universal terms like URLs and IDs to ensure consistent, readable code.

Does idiomatic Swift style require specific rules for access control and memory management?

Idiomatic Swift style specifies concrete rules for access control, memory management, and comments. Applying these standardized patterns during development prevents common pitfalls and ensures consistent code behavior across the codebase.

Why does consistent brace placement and spacing matter in Swift projects?

Consistent brace placement and spacing matter in Swift because they reduce cognitive load. Enforcing single blank lines between methods and clear colon spacing produces clean, standardized code that is easier for teams to maintain and collaborate on.