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

cms-surfaces

Use when adding/changing a CMS surface manifest, the site_structure/html_pages_structure framing XML, a CMS context menu/extraSections wiring, or the cms-authoring platform skill. Also use when a new CMS route/tab needs an agent entry point.

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

설치 방법 보기

포함된 파일(70)

  • SKILL.md6.5 KB
  • accessGateTokens.test.ts1.3 KB
  • accessGateTokens.ts1.8 KB
  • actions/buildCmsPageMenu.ts3.5 KB
  • agent-context/buildCmsComponentContextData.ts3.9 KB
  • agent-context/buildCmsHubContextData.ts2.7 KB
  • agent-context/buildCmsPageContextData.ts9.3 KB
  • agent-context/buildCmsSiteContextData.ts9.5 KB
  • agent-context/cmsComponentContextMenuProps.ts216 B
  • agent-context/cmsComponentExtraSections.ts1.5 KB
  • agent-context/cmsHubContextMenuProps.ts196 B
  • agent-context/cmsHubExtraSections.ts1.0 KB
  • agent-context/cmsPageContextMenuProps.ts201 B
  • agent-context/cmsPageExtraSections.ts3.0 KB
  • agent-context/cmsSiteContextMenuProps.ts201 B
  • agent-context/cmsSiteExtraSections.ts1.5 KB
  • collections/collection-ordering-rules.json7.8 KB
  • collections/collection-validation-rules.json85.7 KB
  • collections/column-filter-parity.fixture.json5.2 KB
  • collections/column-filter-parity.test.ts1.4 KB
  • collections/ordering.ts6.0 KB
  • collections/validateItem.ts17.9 KB
  • components/admin/ActivityFeedPanel.tsx9.5 KB
  • components/admin/AssetsPanel.tsx21.0 KB
  • components/admin/CmsAgentsAdminClient.tsx6.5 KB
  • components/admin/PolicyEditorPanel.tsx5.8 KB
  • components/admin/SitePageTreePanel.tsx7.9 KB
  • components/CmsHubHeader.tsx826 B
  • components/CmsPageAiActionDialog.tsx16.1 KB
  • components/collections/CollectionEditorDialog.tsx27.7 KB
  • components/collections/CollectionItemEditorDialog.tsx15.3 KB
  • components/measure/CmsPageMeasure.tsx4.0 KB
  • components/measure/CmsPageMeasureLazy.tsx756 B
  • components/PageEditor.tsx59.9 KB
  • components/PageListView.tsx16.5 KB
  • components/PagePlanTab.tsx14.1 KB
  • components/PageSeoPlanSection.tsx4.6 KB
  • components/ResearchLineagePanel.tsx2.8 KB
  • components/settings/SiteAdvancedSettings.tsx37.7 KB
  • components/settings/SiteDomainSettings.tsx10.6 KB
  • copy.ts2.4 KB
  • FEATURE.md97.5 KB
  • hooks/useCmsAdminActivity.ts1.6 KB
  • hooks/useCmsComponentSurfaceScope.ts1.9 KB
  • hooks/useCmsHubSurfaceScope.ts1.2 KB
  • hooks/useCmsPagePlanContext.ts4.6 KB
  • hooks/useCmsPages.ts8.4 KB
  • hooks/useCmsPageSurfaceScope.ts4.2 KB
  • hooks/useCmsResearchLineage.ts12.4 KB
  • hooks/useCmsSites.ts3.3 KB
  • hooks/useCmsSiteSurfaceScope.ts2.8 KB
  • hooks/useCmsVersions.ts1.8 KB
  • services/cmsAccessRequests.ts4.1 KB
  • services/cmsService.ts29.6 KB
  • services/cmsWriteNotices.test.ts1.6 KB
  • services/starterKitClient.ts3.3 KB
  • types.ts20.6 KB
  • utils/__tests__/cmsDocumentMetadata.test.ts875 B
  • utils/__tests__/cmsPageAi.test.ts2.6 KB
  • utils/__tests__/contentVolume.test.ts1.8 KB
  • utils/__tests__/pageUrls.test.ts7.1 KB
  • utils/__tests__/url-rules.json14.5 KB
  • utils/buildSiteStructureXml.ts4.7 KB
  • utils/cmsDocumentMetadata.ts839 B
  • utils/cmsPageAi.ts1.7 KB
  • utils/cmsRoutes.ts1.2 KB
  • utils/contentVolume.ts3.6 KB
  • utils/pageUrls.ts9.5 KB
  • utils/pageVersionContent.ts1.1 KB
  • utils/siteSlug.ts2.7 KB

SKILL.md(원문)

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

CMS Surfaces — Skill

This skill is the builder checklist for the CMS's Surface Values layer (manifests + framing XML + menus). Read FEATURE.md first for the data model / API surface; this file is only about how CMS surfaces expose themselves to agents. Full plan and rationale: .cursor/plans/cms_surfaces_rollout_74296af4.plan.md (do not edit — historical record).


The five surfaces (registry: features/surfaces/manifests/registry.ts)

SurfaceManifestRoute
matrx-user/cmscms.manifest.ts/cms (hub)
matrx-user/cms-sitecms-site.manifest.ts/cms/[siteId]
matrx-user/cms-pagecms-page.manifest.ts/cms/[siteId]/pages/[pageId]
matrx-user/cms-componentcms-component.manifest.ts/cms/[siteId]/components
matrx-user/html-pagehtml-page.manifest.ts/cms/html-pages/[pageId]

Each exports a createXxxScope(values) helper — always build scope through it, never hand-roll a SurfaceScopePayload object at a call site.

The framing idea — read this before adding a value

Every website surface (all four except the hub) emits the same site_structure XML — features/cms/utils/buildSiteStructureXml.ts. It's the "big picture": site id/slug/policy/URLs, every page's routing+status flags, every shared component. The node the user is on gets current="true". Standalone pages emit the smaller sibling html_pages_structure (features/html-pages/utils/buildHtmlPagesStructureXml.ts) instead — never the site tree.

Consequence: local surface values should stay narrow (identity + active content), not re-describe the whole site. If you're tempted to add "sibling pages list" or "site name" as a new per-surface value, check whether site_structure already carries it first.

Both builders are pure, size-capped (MAX_XML_CHARS), and degrade by dropping title from non-current pages before ever truncating — never emit an unbounded string.

Where the cache comes from

app/(core)/cms/[siteId]/SiteLayoutClient.tsx's SiteContext owns pages/components for the whole site subtree (fetched once on site enter) plus buildStructureXml(current). Every route under /cms/[siteId]/** reads pages/components from useSiteContext() — never re-fetch the full list locally. After any create/update/delete/publish/discard/rollback, call refreshPages()/refreshComponents() so the next site_structure build reflects it; skipping this means agents see stale flags (e.g. has_draft="false" right after a draft save).


Adding a new surface value

  1. Add the SurfaceValue to the manifest's surfaceSpecific array (features/surfaces/manifests/*.ts). Pick a sortOrder band consistent with neighbors (see the block comments in cms-page.manifest.ts — 200s framing, 250s identity, 400s editor, 450s SEO).
  2. Add the field to createXxxScope's values parameter type (required if alwaysAvailable: true, optional otherwise).
  3. Run npx tsx scripts/emit-surface-sync-sql.ts and copy the regenerated rows for your surface into a new migration (pattern: migrations/cms_surfaces_seed.sql) — apply via Supabase MCP apply_migration, then verify live with execute_sql, then record the ledger row (public._schema_migrations, source='matrx-frontend').
  4. Run pnpm check:surface-drift — must be clean before moving on.

Wiring a new mount point (menu + Pro inputs)

Follow surface-authoring (existing-surface runtime rollout) + context-menu-v3 for the mechanics. CMS-specific notes:

  • Use v3 (EditableContextMenu/NonEditableContextMenu from @ai-matrx/context-menu) — the only context menu (v2 was deleted 2026-07-19).
  • getApplicationScope is a plain function (no useCallback) that calls buildApplicationScopeFromMenuContext with a live createXxxScope(...) built from current component state + useSiteContext().
  • extraSections handlers must be the route's real save/publish/discard/preview/rollback callbacks — never toast stubs.
  • Monaco-based editors (HtmlPageEditor's HTML tab) have no HTMLTextAreaElement ref — pass contextData.htmlContent and skip getTextarea; Copy/AI actions still work through the content-based fallback.
  • ProTextarea/ProInput replace plain Textarea/Input wherever the field is bindable content (HTML/CSS/JS bodies, SEO fields) — pass surfaceName + getApplicationScope.

Verifying end to end

  1. pnpm check:surface-drift — manifests vs. DB rows.
  2. Type-check touched files (npx tsc --noEmit).
  3. Manual: right-click a wired region → confirm the v3 menu opens, the surface footer/inspector shows populated values (especially site_structure/html_pages_structure — should be compact XML, not empty), and any extraSections action (Save Draft, Publish, etc.) actually performs the mutation.

The cms-authoring platform skill (agent-facing, not this file)

Separate artifact — a row in skill.definition (skill_id: cms-authoring), applied via migrations/cms_surfaces_seed.sql. Teaches agents the two-content-system model, draft/publish twins, URL rules, the agent_write_policy gate, and the aidream CMS tool map (cms_page/cms_site/cms_component/cms_find_page/cms_inspect/html_page/cms_verify). It is opt-in via skill_config.included on CMS system agents — never auto-attach it to every agent. Update its body in a new migration (same NOT-EXISTS-guard pattern) if the model changes; do not hand-edit the DB row directly.


Forbidden

  • New Surface Values manifest outside features/surfaces/manifests/ or a createXxxScope bypass (hand-built scope object).
  • Re-fetching the full page/component list inside a child route instead of reading useSiteContext().
  • Any bespoke or non-v3 context menu on a CMS surface.
  • Stuffing "big picture" data (site name, sibling pages, policy) into a new narrow value when site_structure/html_pages_structure already carries it.
  • Skipping refreshPages()/refreshComponents() after a mutation — causes stale site_structure.
  • Auto-attaching cms-authoring to agents outside CMS system agents.

Change-log expectations

After any non-trivial change to a CMS surface: update FEATURE.md's entry points / invariants + change log, and re-run pnpm check:surface-drift before considering the change done.

리뷰

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

댓글

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

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

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. 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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

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월 20일 업데이트

armanisadeghi의 스킬 모두 보기

이 스킬의 문제 신고