mcpField
S
swift_style

swift_style

github.com/swiftzillaDevelopment737 installsUpdated 30w ago
Repository

About swift_style

A style guide skill for developers writing idiomatic, maintainable Swift. It organizes guidance around naming, type and protocol choices, access control, and code organization.

Key features

  1. 01Naming conventions
  2. 02Struct, class, and enum selection
  3. 03Protocol-oriented design guidance
  4. 04Access control levels
  5. 05Code organization practices

Use cases

  1. 01Reviewing Swift naming and APIs
  2. 02Choosing types for domain models
  3. 03Structuring access to implementation details

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/swiftzilla/skills --skill swift_style

After installing, type/swift_stylein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
protocols.md
types.md
access_control.md
variables.md
functions.md

Details

From the project README

Swift Style

This skill provides comprehensive style guidelines for writing clean, idiomatic, and maintainable Swift code.

Overview

Swift style guidelines cover naming conventions, access control, type selection, and code organization patterns that make your code more readable and professional.

Available References

Naming & Conventions
Types & Protocols
  • Types - Struct vs Class vs Enum, value vs reference semantics
  • Protocols - Protocol-Oriented Programming (POP), composition, extensions
Code Organization

Quick Reference

Naming Conventions
CategoryCaseExample
Types & ProtocolsUpperCamelCaseString, UIViewController
Variables, FunctionslowerCamelCaseuserID, fetchData()
Boolean Propertiesis, has, shouldisEmpty, hasPermission
ConstantslowerCamelCasemaxConnections
Type Selection Guide
Need identity or reference semantics?
├── YES → Use Class
└── NO → Need inheritance?
    ├── YES → Use Class
    └── NO → Modeling finite states?
        ├── YES → Use Enum
        └── NO → Use Struct (default)
Access Levels
ModifierVisibilityUse When
privateEnclosing declarationStrict encapsulation
fileprivateSame fileFile-local helpers
internal (default)Same moduleImplementation details
publicEverywherePublic API
openEverywhere + subclassableExtensible frameworks

Best Practices

  1. Default to structs - Use simplest type that expresses intent
  2. Use let by default - Only use var when mutation needed
  3. Prefer protocols over inheritance - More flexible composition
  4. Keep functions focused - Single responsibility
  5. Use access control - Expose only what's necessary
  6. Follow naming conventions - Descriptive, Swifty names

For More Information

Each reference file contains detailed information, code examples, and best practices for specific topics. Visit https://swiftzilla.dev for comprehensive Swift documentation.

Comments

Markdown supported