Skip to main content

collab-surface-core

Use when adding collaborative markdown, notes, or descriptions to a feature with collab surfaces. Covers parent entities, service entry points, authorization, content storage, and lifecycle.

소스 정보

저장소
macro-inc/macro
최근 소스 활동
2026년 10월 5일 22:50
감지된 SKILL.md 언어
영어
스타
4,713
포크
460

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
collab-surface-core
description
Use when adding collaborative markdown, notes, or descriptions to a feature with collab surfaces. Covers parent entities, service entry points, authorization, content storage, and lifecycle.
# Collab surface core Use collab surfaces for collaborative markdown within a feature. Each surface has its own Loro session in sync-service and can exist without a `Document` row. The surface is a child resource of an app entity: product names, owners, sharing, and discovery belong to the parent. ## Choose the entry point - **A field managed by its parent domain**, such as an initiative description: use `OwnedSurfaceService` through the feature's domain port. The owning domain authorizes callers and chooses the surface id before calling `ensure_owned_surface`, `owned_surface_markdown`, or `retire_surface`. - **A surface managed through the public API**, such as a channel's shared input: use `CollabSurfaceService` with an access receipt for the parent. Surface reads, connection tokens, and deletion derive their permissions from that parent. Check `surface_ownership` and the parent's access resolution when adding a new parent type. Parents marked `ParentDomain` use their domain's creation and retirement paths; the public API still provides connection tokens. Keep the trusted `OwnedSurfaceService` behind domain authorization, with adapters supplied by the composition root. ## Keep content and lifecycle with their owners - The Loro session is the source of truth for content. `collab_surfaces` records the id, parent, initialization state, timestamps, and soft deletion. - Use application-generated UUIDv7 ids and the service's ensure operation. It handles namespace collisions and retries initialization from `pending` to `ready`. The id also names the sync session and must never be recycled. - Initial markdown seeds a new session. Ensuring an existing surface preserves its content; subsequent edits go through the collaborative session. - Wire retirement into the owning feature's cleanup. The parent reference is polymorphic and has no foreign-key cascade. Retirement blocks new connection tokens; it does not reclaim the sync-service session. Read the [domain ports](../../../crates/collab_surface/src/domain/ports.rs) and [parent policy](../../../crates/collab_surface/src/domain/models.rs) before wiring a consumer. The [initiative adapter](../../../crates/initiative_description/src/lib.rs) shows how a feature reuses the service through its own domain port.
GitHub에서 보기