code-review

PR checklist—tính ổn định của API, tài liệu, lỗi, khả năng tương thích, dependency/SCA, kiểm thử, mã được vendor hóa; Block/Major/Minor.

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

Code review – Contentstack Utils Swift

When to use

  • Reviewing a PR, self-review before submit, or automated review prompts.

Instructions

Work through the checklist below. Optionally tag findings: Blocker, Major, Minor.

API design and stability

  • Public API: New or changed public / open types in Sources/ContentstackUtils/ are necessary, semver-conscious, and documented (README.md / CHANGELOG.md when user-visible).
  • Backward compatibility: No breaking changes unless explicitly justified (e.g. major version). Prefer additive behavior and default Option() paths.
  • Naming: Matches existing Utils and RTE terminology (ContentstackUtils, Option, Node, GQL, etc.).

Error handling and robustness

  • Errors: New throws paths use clear domain types (e.g. VariantUtilityError); callers can distinguish invalid input from parsing failures where relevant.
  • Optionals: No force-unwraps on public code paths; document preconditions for non-optional parameters.
  • RTE JSON: Decoding and HTML traversal stay tolerant of documented stack payload shapes; embedded-item regressions are called out.

Dependencies and security

  • Dependencies: Package.swift / ContentstackUtils.podspec changes are justified; versions do not introduce known vulnerabilities.
  • SCA: Address security findings (e.g. Snyk, org scanners) in the PR or via an agreed follow-up.

Testing

  • Coverage: New or modified behavior in Sources/ContentstackUtils/ has tests under Tests/ContentstackUtilsTests/ when feasible.
  • Quality: Tests are readable, deterministic, and follow naming/mocks conventions.

Vendored and native code

  • Kanna / libxml2 / Modules/: Reviewed for upstream parity, licensing, and Apple vs Linux builds.

Severity (optional)

LevelExamples
BlockerBreaking public API without approval; security issue; no tests for new code where tests are practical
MajorInconsistent errors; README examples that do not compile
MinorStyle; minor docs

Detailed review themes (from checklist sections)

  • API: Breaking public/open without semver/CHANGELOG/podspec alignment.
  • Errors: throws changes that confuse callers without a version strategy.
  • README: Examples must match real APIs (jsonToHtml overloads, GQL.jsonToHtml).
  • Dependencies: New packages in Package.swift / podspec need justification.

References

  • skills/testing/SKILL.md
  • skills/contentstack-utils/SKILL.md

Thêm skills từ contentstack

cms-assets
contentstack
Hướng dẫn các nhà phát triển cách tổ chức, phân phối và chuyển đổi tài nguyên trong Contentstack. Bao gồm cấu trúc thư mục, các phép chuyển đổi của Image Delivery API, xuất bản…
cms-branches-aliases
contentstack
Tư vấn cho nhà phát triển về cách sử dụng Contentstack branches để phát triển nội dung độc lập và aliases để triển khai nội dung không gián đoạn. Bao gồm chiến lược branch,…
cms-data-modeling-best-practices
contentstack
Hướng dẫn các nhà phát triển mô hình hóa nội dung trong Contentstack bằng cấu trúc tái sử dụng đơn giản nhất. Kỹ năng này giải thích khi nào nên sử dụng loại nội dung, tham chiếu, toàn cục…
cms-live-preview-visual-builder-support-assistant
contentstack
Chẩn đoán và hướng dẫn triển khai Contentstack Live Preview và Visual Builder. Theo dõi ngữ cảnh xem trước, xác định hợp đồng bị hỏng, và đề xuất…
cms-releases
contentstack
Tư vấn cho nhà phát triển về cách sử dụng Contentstack Releases để triển khai nội dung đồng bộ và nguyên tử. Bao gồm tạo bản phát hành, quản lý mục, triển khai theo giai đoạn,…
cms-roles-permissions
contentstack
Tư vấn cho các nhà phát triển về việc thiết kế vai trò, quyền hạn, nhóm và quyền truy cập token trong Contentstack. Giải thích vai trò tích hợp sẵn, vai trò tùy chỉnh, việc hợp nhất quyền hạn,…
cms-taxonomy
contentstack
Tư vấn cho nhà phát triển về cách sử dụng Contentstack Taxonomy để phân loại nội dung có cấu trúc, phân cấp và lọc phía phân phối. Bao gồm sự khác biệt giữa taxonomy và tags,…
cms-tokens-authentication
contentstack
Tư vấn cho nhà phát triển cách chọn phương thức xác thực Contentstack và loại token phù hợp cho các trường hợp sử dụng frontend, backend, tự động hóa và ứng dụng bên thứ ba.…