code-review

PR checklist—API stability, docs, errors, compatibility, dependencies/SCA, tests, vendored code; Blocker/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

Mehr Skills von contentstack

brand-kit-assistant
contentstack
Advise users on Contentstack Brand Kit concepts, setup, governance, and on-brand AI generation. Route API-specific tasks to the right Brand Kit capability or…
official
cms-assets
contentstack
Advise developers on organizing, delivering, and transforming assets in Contentstack. Cover folder structure, Image Delivery API transformations, publishing…
official
cms-branches-aliases
contentstack
Advise developers on using Contentstack branches for isolated content development and aliases for zero-downtime content deployments. Cover branch strategy,…
official
cms-data-modeling-best-practices
contentstack
Guide developers to model content in Contentstack using the simplest reusable structure. The skill explains when to use content types, references, global…
official
cms-entries
contentstack
Advise developers on querying, localizing, versioning, publishing, and structuring Contentstack entries for efficient delivery. Focus on CDA usage, reference…
official
cms-environments-publishing
contentstack
Advise developers on configuring environments, publishing content, using delivery and preview tokens, leveraging the Sync API, and understanding CDN and…
official
cms-live-preview-visual-builder-support-assistant
contentstack
Diagnose and guide Contentstack Live Preview and Visual Builder implementations. Trace preview context, identify the broken contract, and recommend the…
official
cms-localization
contentstack
Advise developers on Contentstack localization: language setup, fallback chains, localized vs unlocalized entries, non-localizable fields, and multi-locale…
official