# Combine

> Combine — Foundations Skill

- Skill: `caglarbaranbora/combine` (Agent Skill)
- Install (CLI): `npx skillmds@latest add caglarbaranbora/combine`
- Raw SKILL.md: https://api.skillmd.com/api/skills/caglarbaranbora/combine/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: caglarbaranbora (https://skillmd.com/u/caglarbaranbora)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/caglarbaranbora/combine

---


# Combine — Foundations Skill

## Purpose

Route Combine implementation tasks to the minimum required Combine
Knowledge Contracts. v1 scope is the `Publisher`/`Subscriber`/`sink`/
`AnyCancellable` subscription contract, `@Published`/`ObservableObject`,
`PassthroughSubject`/`CurrentValueSubject`, the core transforming/
combining operators, and `assign(to:on:)`/`assign(to:)` with cancellable
lifetime management -- not async/await interop, custom conformances,
backpressure, or SwiftData/Core Data interop.

## Routing

Load only the contracts relevant to the task. All paths relative to
knowledge/combine/.

-   Subscribing with `sink(receiveCompletion:receiveValue:)` or
    `sink(receiveValue:)`; asking whether `Failure == Never` applies;
    or reasoning about retaining/discarding an `AnyCancellable` ->
    publishers-and-subscribers.md
-   Declaring `@Published var x`; accessing `$x`; conforming to
    `ObservableObject`; or asking what `objectWillChange` does and when
    it fires -> published-and-observableobject.md
-   Choosing `PassthroughSubject` vs. `CurrentValueSubject`; reading or
    writing `.value`; or calling `send(_:)`/`send(completion:)` ->
    subjects.md
-   Applying `map`/`filter`/`removeDuplicates`/`debounce(for:scheduler:)`;
    or combining multiple publishers with `combineLatest`/`merge`/`zip`
    and asking what shape the output takes -> operators-transforming-and-combining.md
-   Writing a publisher's output into a property with `assign(to:on:)`
    or into a `@Published` property with `assign(to:)`; diagnosing a
    retain-cycle risk; or calling `.store(in:)` -> assign-and-memory-management.md

Never load more than the contracts relevant to the specific question.

## Stop Conditions

Stop and report if the requested topic has no matching Knowledge
Contract in knowledge/combine/ — do not guess or fall back to general
knowledge. Combine-to-async/await interop (`Publisher.values`,
`AsyncPublisher`/`AsyncThrowingPublisher`) is out of scope entirely --
do not fabricate a bridging pattern. Writing a custom `Publisher` or
`Subscriber` conformance is out of scope entirely -- route only to the
built-in publishers/operators these contracts cover. Backpressure and
`Subscribers.Demand` reasoning is out of scope entirely -- do not
fabricate demand-management guidance. Combine integration with
SwiftData or Core Data is out of scope entirely -- report the boundary
rather than answer from a persistence domain. `Timer.publish`/
`NotificationCenter.publisher` have no dedicated contract -- they may
appear only as an example inside another contract's Compliant Example,
never as their own routing target.

