dev-workflow

作者: contentstack

分支、CI、建置/測試/lint、PR 期待、覆蓋率——Contentstack Utils Swift 的標準工作流程。

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

Development workflow – Contentstack Utils Swift

When to use

  • Setting up locally, opening a PR, or aligning with CI.
  • Answering “how do we run tests?” or “which branch targets master?”

Branches

  • Use feature branches (e.g. feat/..., fix/..., ticket branches).
  • CI runs on push to master and on pull requests targeting master or next (.github/workflows/ci.yml).
  • Merges into master may be gated: PRs whose base is master are often expected to come from staging; other heads may fail the check-branch workflow (.github/workflows/check-branch.yml). Confirm with your team before opening PRs to master.

Running tests and build

  • SPM: swift build, swift test
  • CI-style Xcode (iOS Simulator):
    xcodebuild -project "ContentstackUtils.xcodeproj" -scheme "ContentstackUtils-Package" -destination "OS=13.4.1,name=iPhone 11 Pro" test
    Adjust -destination for your local Xcode/Simulator.

Run tests before opening a PR. Default tests use offline mocks and fixtures—no .env or live stack credentials.

Lint

  • SwiftLint: swiftlint (.swiftlint.yml)

Pull requests

  • Build passes: swift build and swift test (and xcodebuild if you touch Xcode-specific paths).
  • Follow the code-review skill (skills/code-review/SKILL.md) before merge.
  • Prefer backward-compatible public API; call out breaking changes and semver.
  • Describe behavior and update CHANGELOG.md / version metadata (ContentstackUtils.podspec, tags) when releasing—per team process.
  • Security/policy scans may run in CI (e.g. .github/workflows/sca-scan.yml, policy-scan.yml).

Optional: TDD

If the team uses TDD: RED → GREEN → REFACTOR. Test structure is in skills/testing/SKILL.md.

Coverage

  • Slather (.slather.yml, scheme ContentstackUtils-Package): use after tests to inspect Sources/ContentstackUtils/ coverage.

References

  • skills/testing/SKILL.md
  • skills/code-review/SKILL.md

來自 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中設計角色、權限、團隊和Token存取權限的建議。解釋內建角色、自訂角色、權限合併等。
cms-taxonomy
contentstack
為開發人員提供關於使用 Contentstack Taxonomy 進行結構化、階層式內容分類及傳遞端篩選的建議。涵蓋 taxonomy 與 tags 的比較,…
cms-tokens-authentication
contentstack
為開發人員提供建議,協助他們為前端、後端、自動化及第三方應用程式使用情境選擇正確的Contentstack驗證方法與權杖類型。…