Maintain UIKitPlus View Composition
Use this LOCAL contributor skill for built-in composition/runtime source work.
Load the smallest decision-complete context
- Start from UIKitPlus
AGENTS.mdandSKILL_INDEX.md. - Use
VIEW_COMPOSITION.mdas the primary owner. - Add only the supporting contract the change needs:
RUNTIME_MODEL.mdfor insertion/update lifecycle;MUTATION_MODEL.mdfor subscriptions/diff callbacks;FLUENT_CHAIN_CONTRACT.mdfor changed public composition APIs.
- Use
SOURCE_MAP.mdbefore broad source discovery.
Plan checklist
- Identify affected composition entrypoints such as
body,addItem,add(views:at:), stack add paths, orForEach. - Classify the impact as DSL, runtime, or cross-layer.
- Identify subscription/diff handling changes and repeated-setup listener risk.
- Preserve explicit insertion/removal ordering and object identity.
Implementation rules
- Preserve reference/object identity; do not introduce value-view copy semantics.
- Keep insertion ordering explicit and consistent with current composition ownership.
- If changing
ForEachsubscriptions, keep begin/listener/end update flow and listener ownership explicit. - Treat diff
modificationshandling as explicit policy; do not imply support that is not implemented. - Do not add a second composition/runtime model to compensate for one local edge case.
Audit
Verify:
- fluent composition-facing chain continuity remains intact;
ForEachinsertions/deletions and any intentionally supported modifications remain safe;- no hidden lifecycle regression appears in view/stack insertion/removal;
- repeated setup does not silently accumulate listeners/subscriptions;
- runtime docs change only if durable update timing/ownership actually changed;
- unrelated source/governance remains untouched.
Stop and re-plan if the work requires a new composition ownership/lifecycle mechanism rather than an implementation inside current UIKitPlus architecture.