swift-style

작성자: contentstack

SwiftLint, Sources 레이아웃, Kanna/libxml2, 플랫폼, 네이밍, 이 저장소의 모든 Swift에 대한 접근 제어.

npx skills add https://github.com/contentstack/contentstack-utils-swift --skill swift-style

Swift style and repo layout – Contentstack Utils Swift

When to use

  • Editing any Swift under Sources/ or Tests/.
  • Adding files or changing platform/deployment assumptions.

Tooling

  • Run SwiftLint with .swiftlint.yml. Do not relax rules for new code without team agreement.
  • Sources/Kanna/ is excluded from SwiftLint—do not copy patterns into Sources/ContentstackUtils/ that would fail lint there.

Package layout

  • Library code: Sources/ContentstackUtils/.
  • Vendored Kanna: Sources/Kanna/—treat as third-party unless you are deliberately upgrading the vendored copy; prefer fixes in ContentstackUtils or documented Kanna upgrades.

Platforms and libxml2

  • Deployment targets: macOS 10.13+, iOS/tvOS 11+, watchOS 4+ (Package.swift). Avoid newer SDK-only APIs without availability checks or a deliberate target bump.
  • libxml2: Apple platforms use system libxml where applicable; Linux uses the libxml2 system target and pkg-config. Keep Modules/ and Package.swift conditionals in sync when changing platform support.

Naming and API surface

  • Swift conventions: types UpperCamelCase, members lowerCamelCase.
  • Preserve established public names even when imperfect (e.g. historical typos) unless doing a semver-major cleanup with maintainer agreement.

Imports and access control

  • import Foundation as needed; HTML parsing follows existing Kanna usage in this package.
  • Mark public / open intentionally; keep implementation internal or private unless tests use established @testable patterns.

References

  • skills/framework/SKILL.md (SPM, podspec, CI)
  • skills/testing/SKILL.md (lint exclusions in tests)

contentstack의 다른 스킬

cms-assets
contentstack
개발자에게 Contentstack에서 자산을 구성, 전달, 변환하는 방법에 대해 조언합니다. 폴더 구조, Image Delivery API 변환, 게시를 다룹니다...
cms-branches-aliases
contentstack
개발자에게 콘텐츠 개발 격리를 위한 Contentstack 브랜치와 무중단 콘텐츠 배포를 위한 별칭 사용에 대해 조언합니다. 브랜치 전략, …
cms-data-modeling-best-practices
contentstack
개발자들이 Contentstack에서 가장 간단하고 재사용 가능한 구조로 콘텐츠를 모델링하도록 안내합니다. 이 스킬은 콘텐츠 유형, 참조, 전역 필드를 언제 사용해야 하는지 설명합니다.
cms-live-preview-visual-builder-support-assistant
contentstack
Contentstack Live Preview 및 Visual Builder 구현을 진단하고 안내합니다. 미리보기 컨텍스트를 추적하고, 손상된 계약을 식별하며, 다음을 권장합니다…
cms-releases
contentstack
개발자들이 Contentstack Releases를 사용하여 조정되고 원자적인 콘텐츠 배포를 수행하는 방법에 대해 조언합니다. 릴리스 생성, 항목 관리, 단계적 배포 등을 다룹니다. …
cms-roles-permissions
contentstack
개발자들에게 Contentstack에서 역할, 권한, 팀, 토큰 액세스를 설계하는 방법을 조언합니다. 기본 제공 역할, 사용자 지정 역할, 권한 병합 등을 설명합니다.
cms-taxonomy
contentstack
개발자들에게 Contentstack Taxonomy를 구조화되고 계층적인 콘텐츠 분류 및 전달 측 필터링에 사용하는 방법에 대해 조언합니다. 분류 체계와 태그의 차이 등을 다룹니다…
cms-tokens-authentication
contentstack
개발자에게 프론트엔드, 백엔드, 자동화, 타사 앱 사용 사례에 적합한 Contentstack 인증 방법과 토큰 유형 선택에 대해 조언합니다.…