본문으로 건너뛰기
cccskills
무료GitHub에 공개

context-assignment

Context and scope-tagging UI. Use when adding a context picker to a surface, tagging an entity to scopes, setting or filtering by the active (working) context, showing per-entity context status, prompting for context on upload, or editing context-assignment/**, active-context/**, or appContextSlice.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md8.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Context assignment — picking the right component

The mental model (read this or you WILL wire it wrong)

  1. Membership, not ownership. A person belongs to MULTIPLE organizations, all equal (no personal or business type — common-docs/policies/access-ladder.md). Never assume one org per user. Every project and task belongs to exactly one organization (organization_id NOT NULL, live); a SCOPE assignment on them can be empty ("unassigned"), and that is normal, not an error.
  2. The hierarchy: organization → scope types (the org's custom dimensions, e.g. Clients, Matters) → scopes (instances, e.g. "Acme Corp") → context items (typed fields per scope). Tasks may live in projects but DON'T have to; projects may live in orgs but DON'T have to.
  3. A scope NEVER implies its organization. Org is an independent context dimension — it is part of a selection only when explicitly checked. Display follows the same rule (ContextSummaryChips enforces it).
  4. Three runtime layers — NEVER conflate them (full table: ../common-docs/systems/data/scopes-context/STATE.md → "Runtime context — three layers"):
    • Layer A — Active (working/passive) context = "what I'm doing right now"; ephemeral; lives in appContextSlice; feeds every agent run automatically (execute-instance stamps it). MULTI-scope (keyed by scope id since 2026-06-12), single org/project/task, plus independent active scope types (active_scope_type_ids, 2026-06-30 — "whole dimension in play, no instance chosen"). Writers MUST be Surface A (ESLint-gated; the write actions include setActiveScopeTypes).
    • Layer B — Reference tree = what exists (org→type→scope→item). Cache only; fetched once at boot. Being consolidated onto the hierarchy owner — read scope data via hierarchy selectors, do NOT reach for the fragmented scopeTypes/scopes/… fan-out slices in new code.
    • Layer C — Durable object assignment = "this entity belongs to these"; persisted in canonical platform.associations via the setEntityScopes chokepoint, from the user's explicit UI selection. (The legacy ctx_scope_assignments table is RETIRED — FE cut over 2026-06, zero DB functions reference it; never write to or read from it.)
    • A user ACTION (Layer C) must read the explicit selection, never Layer A just because it's loaded. A successful write that sourced Layer A is worse than a failure — it silently mis-binds. Never auto-convert active → durable (suggest only). The condemned agent_surface binding service (features/surfaces) is the cautionary example of doing this wrong.

Component selection table

You need…UseMode/notes
Tag an entity (file/note/agent/…) inline on a pageContextAssignmentFieldmode="assignment", pass subject; use dimensions={["scopes"]} when the surface is scope-only (no project/task FK intent)
Same, without blocking the pageContextAssignmentPopovertrigger = your button
Same, as an explicit modal stepContextAssignmentDialogcontrolled open
Same, floating/draggableContextAssignmentWindowinline-controlled
Set the WORKING context anywhere (header, toolbar, rail, composer)ActiveContextLensChipTHE one scope control; iconOnly for rails, attention for "needs a scope", fill for sidebars, onOpenPreview adds the preview eye
Same field inside a tab panel / drawer (no trigger)ActiveContextPanelcomposes ContextAssignmentField mode="active"; default checkboxVariant="standard"; used by RunControlsMenu Context tab
Clear working context (rose Eraser + "Context", app-wide)ClearContextButtondispatches clearContext; wired into every Surface A control
Show context status per entity (amber/green nudge)ContextStatusButtonpass knownScopeCount on list rows (bulk!), omit on single-entity surfaces
Display a selection readablyContextSummaryChipscompact chips for headers; org only if explicit
Labeled active/filter breakdown in the field footerContextSelectionSummaryOrg · Scope Types (group) · per-type scopes · Projects · Tasks
Prompt for context during an uploadUploadContextPromptSave awaits awaitFileIds() — handles both races
Filter a list by context (no saving!)ContextAssignmentField mode="filter"emits via onSelectionChange; zero save-side effects

All in features/scopes/components/context-assignment/ except ActiveContextLensChip + ActiveContextPanel (features/scopes/components/active-context/ — Surface A writers MUST live there; ESLint + FEATURE.md enforce it).

Hard rules

  • Fetch discipline. The org/type/scope tree is fetched ONCE at boot into Redux (ensureScopeTree → state.scopesTree) and refreshed only by scopeTreeInvalidationMiddleware on structural mutations. Components NEVER refetch it. It is durably warm-cached across hard reload by the sync engine (scopesTreePolicy in features/scopes/redux/scopesSlice.ts): a warm boot rehydrates the tree before paint and ensureScopeTree() skips the network entirely (no staleAfter/remote.fetch — the tree changes rarely). Projects/tasks/items go through context-assignment/data.ts (60s TTL + in-flight dedup). List surfaces use getEntityScopesBulk/primeEntityScopes — N rows must never mean N requests. Add new reads to data.ts, never to a component.
  • Write paths. Scopes → useEntityScopes().setScopes / setEntityScopes thunk only. Active context → dispatch from active-context/ components only. Entity FKs (e.g. a note's project_id) → that feature's save pipeline, applied from onSaved's selection (see features/notes/components/NoteContextSection.tsx as the template).
  • Dimension gating. Pass dimensions={["scopes"]} (or any subset of "scopes" | "projects" | "tasks") to hide sections that do not apply — e.g. project settings (scope tagging only) vs notes (scopes + project/task FK intent). Default is all three. Org dropdown (assignment) and org rows (active/filter) are independent of dimensions.
  • Org default-but-changeable. Assignment mode defaults to "All organizations" (ALL_ORGS sentinel — nothing filtered, scope sections grouped per org, selection.organizationId = null). Surfaces that "enforce" an org pass initialOrganizationId to override that starting selection; the user can always switch (including back to All).
  • No layout shift. Fixed section heights; fixed-size check targets; status icons swap glyphs, never dimensions.
  • Mobile = one bottom sheet. Every wrapper (ContextAssignmentPopover, ContextAssignmentDialog, ContextAssignmentWindow, UploadContextPrompt, ActiveContextLensChip) switches to ContextSheet on useIsMobile() — never a desktop popover/dialog/window on a phone. ContextSheet (built on the BottomSheet primitive) hosts the body with fill, which makes the field's own section list the single scroll area and pins the footer. Never set a fixed sectionHeight inside a sheet (that re-introduces nested scrolling) — pass fill instead. The field's org-of-record row stacks (flex-col sm:flex-row) so it never overflows a narrow screen.
  • Project/task durable links are LIVE via associationsService.setTargets (platform.associations, replace-semantics) — the field's live save path and UploadContextPrompt both write them. Never reintroduce a log-and-toast stub.
  • Active context is MULTI-SCOPE — never radio. Any number of scopes per scope type (Arman, 2026-07-07). Toggle with addActiveScope / removeActiveScope (additive/surgical); never evict same-type siblings, and never read a scope_selections KEY as a scope_type_id — use selectActiveScopeIdsByType.

Live references

  • Design surface / every variant demoed: /demos/scopes/context-lab (app/(dev)/demos/scopes/context-lab/page.dev.tsx).
  • Real integrations to copy from: files table cell (features/files/components/surfaces/desktop/FileContextCell.tsx), upload prompt host (features/files/components/surfaces/PageShell.tsx), note adapter (NoteContextSection.tsx), header button (ChatRunHeader.tsx), run-controls tab (RunControlsMenu.tsx Context tab → ActiveContextPanel).
  • Current state: features/scopes/FEATURE.md (the live SOR for scope/context on the FE).

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Admin debug system wiring for the floating AdminIndicator's live debug data and Copy Full Context. Use when adding debug visibility to a route or feature, wiring useDebugContext or the debug panel, capturing console errors, or enabling the copy-context workflow for a page.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

armanisadeghi/ai-matrx32026년 10월 19일 업데이트

Compact two-icon Copy / Copy-for-AI controls (components/agent-copy). Use when adding copy buttons to a row, card, list, or record; merging duplicate Copy/JSON/AI controls; continuing the copy rollout; or writing a Copy-for-AI payload. NOT for markdown content actions (use rich-document-actions).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

armanisadeghi/ai-matrx32026년 10월 19일 업데이트

Disclosing a surface's existing fixed AI jobs in the shell's top Agents menu. Use when a page, panel, overlay, or window already runs a mandate behind a button, assist, automatic action, or mode; when the agent-disclosure guard names a file; or during a surface check.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

armanisadeghi/ai-matrx32026년 10월 19일 업데이트

The watch-fix-rerun method for making an existing platform agent or automated process efficient and correct: baseline its ledger, run one unit yourself, fix the class behind every wasted call, rerun, record. Use when asked to improve, optimize, watch, or 'make efficient' an agent, a sandbox session, a sync job, or any recurring automated process.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

armanisadeghi/ai-matrx32026년 10월 19일 업데이트

Redux state for agent execution and firing agent shortcuts. Use when editing features/agents/redux/, building agent UI, creating a conversation, touching assembleRequest or NDJSON stream state, wiring agent-state selectors, adding a per-conversation capability, or triggering a shortcut from a button, menu, or code (useShortcutTrigger, launchAgentExecution).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

armanisadeghi/ai-matrx32026년 10월 19일 업데이트

The provision for a call site: the exhaustive menu of values that place in the code can realistically produce. Use before creating or fixing a mandate or agent that reasons about more than its own input, when deciding whether an agent can answer at all with what it is sent, or when its output 'looks right' but nobody checked it could be. NOT for building the agent (use create-agent).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

armanisadeghi/ai-matrx32026년 10월 19일 업데이트

armanisadeghi의 스킬 모두 보기

이 스킬의 문제 신고