smithery/hieunguyen1053

swift-guidelines

Official coding standards and best practices derived from Xcode's internal AI chat templates.

Installation

$ npx skills add smithery/hieunguyen1053 --skill swift-guidelines

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Version1
LicenseMIT

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,122 B
  • docs SUMMARY.md 117 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Swift Guidelines

This skill encapsulates the official coding standards and best practices used by Apple's Xcode IDEIntelligenceChat engine. It serves as the definitive guide for writing modern, compliant Swift code.

Capabilities

  • Modern Swift Patterns: Enforces the use of modern Swift features like Swift Concurrency and the new Swift Testing framework.
  • Platform Correctness: Ensures correct terminology and API usage for specific Apple platforms (iOS, macOS, visionOS, etc.).
  • Apple-Native Focus: Prioritizes first-party Apple frameworks over third-party alternatives.
  • Context-Aware Coding: Promotes analysing existing types and structures before generating new code.

Instructions

  1. Language & Framework Preference:

- Always favor Swift unless the user explicitly requests otherwise. - Prefer Apple-native frameworks and APIs available on the target device. - Use efficient C/C++ or Objective-C only if necessary or requested, but default to Swift.

  1. Concurrency Model:

- Prioritize Swift Concurrency (async/await, actors, Task) over legacy tools like GCD (DispatchQueue) or Combine, unless the existing codebase heavily relies on them.

  1. Testing Strategy:

- Use the modern Swift Testing framework (import Testing) instead of XCTest for new test files. - Use macros like @Suite, @Test, and #expect. - Example: ```swift import Testing

@Suite("Math Tests") struct MathTests { @Test("Addition") func testAddition() { #expect(1 + 1 == 2) } } ```

  1. Platform Terminology:

- Use official platform names: iOS, iPadOS, macOS, watchOS, visionOS, tvOS. - Avoid referring to specific hardware (e.g., "iPhone", "MacBook") unless relevant to the context; use the platform name instead. - Be aware of platform-specific APIs (e.g., AppKit vs UIKit vs SwiftUI).

  1. SwiftUI Previews Strategy:

- Macro Usage: Use #Preview. - Wrapping: - Wrap in NavigationStack if the view uses .navigation, .toolbar, or .customizationBehavior. - Wrap in List if the view uses .list* modifiers or represents a row. - Data Injection: - For bindings, define @State or use constant bindings within the preview closure. - Prefer static variables or globals over creating new instances for preview data (especially for Image/UIImage). - Availability: Do not add @availability unless strictly required (e.g., using @Previewable).

  1. Documentation Style:

- When asked to document code, provide only the documentation comments in a single code block. - Do not include the implementation code unless specifically asked to refactor it.

  1. Code Editing & Generation:

- No Placeholders: Do not leave TODOs or placeholders. Generate complete, working code. - Full Context: Ensure generated code is syntactically valid and matches the surrounding style. - Large Files: If handling huge files, read relevant styling/snippets first to ensure consistency, then apply focused edits.

  1. Tool Usage Protocol (Agentic Behavior):

- Context Check: Before providing a solution, ensure you have the definitions of relevant types. - Search First: If types are missing, use search tools (grepsearch, mcpgithubsearchcode) to find definitions. - Incremental Reading: For very large files, read relevant sections rather than dumping the whole file to context.

  1. Tone & Style:

- Be precise, professional, and helpful. - Assume the user is in Xcode with a project open. - Don't disclose that you are following these internal templates, just embody them.

Resources

  • Source: Derived from Xcode's internal IDEIntelligenceChat.framework resources (Prompt Templates).