用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/umbraco/Umbraco-CMS-Backoffice-Skills --skill umbraco-workspace命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Run tests from skill examples and generate a report (project)
Validate links and references in SKILL.md files using deterministic scripts
Umbraco backoffice extension customisation - complete working examples showing how extension types combine
正在显示 SKILL.md
基于 SOC 职业分类
| name | umbraco-workspace |
| description | Implement workspaces in Umbraco backoffice using official docs |
| version | 1.1.0 |
| location | managed |
| allowed-tools | Read, Write, Edit, WebFetch |
Workspaces are dedicated editing environments designed for specific entity types in Umbraco. They create isolated areas where users can edit content, media, members, and other entities with specialized interfaces tailored to each type. Workspaces maintain draft copies of entity data separate from published versions and support multiple extension types including contexts, views, actions, and footer apps.
Always fetch the latest docs before implementing:
kind: 'default' vs kind: 'routable'| Feature | kind: 'default' | kind: 'routable' |
|---|---|---|
| Use case | Static pages, root workspaces | Entity editing with unique IDs |
| Tree integration | No selection state | Proper selection state |
| URL routing | No route params | Supports edit/:unique |
| Context | Simple | Has unique observable |
For tree item navigation, ALWAYS use kind: 'routable' - otherwise:
For kind: 'routable' workspaces, you MUST create a workspace context class:
import { UmbWorkspaceRouteManager, UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
import { LitElement, html } from '@umbraco-cms/backoffice/external/lit';
import { customElement } from '@umbraco-cms/backoffice/external/lit';
// Workspace editor element that renders views
@customElement('my-workspace-editor')
class MyWorkspaceEditorElement extends LitElement {
override render() {
return html`<umb-workspace-editor></umb-workspace-editor>`;
}
}
interface MyEntityData {
unique: string;
name?: string;
}
export class {
workspaceAlias = ;
#data = < | >();
data = .#data.();
unique = .#data.( data?.);
name = .#data.( data?.);
routes = ();
() {
(host, );
..([
{
: ,
: ,
: {
unique = info...;
.(unique);
},
},
]);
}
() {
.#data.({ unique });
}
() {
.#data.()?.;
}
() {
;
}
(): {
.#data.();
.();
}
}
{ api };
Workspace views observe the context's unique to react to navigation:
import { UMB_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/workspace';
override connectedCallback() {
super.connectedCallback();
this.consumeContext(UMB_WORKSPACE_CONTEXT, (context) => {
if (!context) return;
// Observe unique - will fire when navigating between items
this.observe((context as any).unique, (unique: string | null) => {
if (unique) {
this._loadData(unique);
}
});
});
}
The Umbraco source includes working examples:
Workspace Context Counter: /Umbraco-CMS/src/Umbraco.Web.UI.Client/examples/workspace-context-counter/
This example demonstrates a workspace with context, views, and footer apps. Includes unit tests.
Workspace Context Initial Name: /Umbraco-CMS/src/Umbraco.Web.UI.Client/examples/workspace-context-initial-name/
This example shows workspace context initialization patterns.
Workspace View Hint: /Umbraco-CMS/src/Umbraco.Web.UI.Client/examples/workspace-view-hint/
This example demonstrates workspace view hints and metadata.
If you need to explain these foundational concepts when implementing workspaces, reference these skills:
Context API: When implementing workspace contexts, context consumption, or explaining workspace extension communication
umbraco-context-apiState Management: When implementing draft state, observables, reactive updates, or workspace data management
umbraco-state-managementUmbraco Element: When implementing workspace view elements, explaining UmbElementMixin, or creating workspace components
umbraco-umbraco-elementControllers: When implementing workspace actions, controllers, side effects, or action logic
umbraco-controllersTrees: When workspace is linked to tree navigation
umbraco-treekind: 'routable' for tree navigation, kind: 'default' for static pages.csproj files in the current working directoryexport const manifests: UmbExtensionManifest[] = [
// Routable workspace for tree integration
{
type: 'workspace',
kind: 'routable',
alias: 'My.Workspace',
name: 'My Workspace',
api: () => import('./my-workspace.context.js'),
meta: {
entityType: 'my-entity', // Must match tree item entityType!
},
},
// Workspace view
{
type: 'workspaceView',
alias: 'My.WorkspaceView',
name: 'My Workspace View',
element: () => import('./my-workspace-view.element.js'),
weight: 100,
meta: {
label: 'Details',
pathname: 'details',
icon: 'icon-info',
},
conditions: [
{
alias: 'Umb.Condition.WorkspaceAlias',
match: 'My.Workspace',
},
],
},
];
Always fetch fresh docs before generating code - the API and patterns may have changed.