[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CYEAA4W4Y2HFFNQE0CWA7P":3,"skill-same:01M7CYEAA4W4Y2HFFNQE0CWA7P":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7CYEAA4W4Y2HFFNQE0CWA7P","umbraco-backoffice-conventions",null,"Conventions for a Lit + UUI Umbraco backoffice package: compiler setup, local vs. exported components and the public API surface, OpenAPI-generated clients, observable and extension lifecycles, localization keys, build output and cache busting, and multi-package builds. Use when setting up or structuring a backoffice frontend, changing what imports what across its entry points, or adding a library or a call to the package's own API. Not for individual extension points or state management, which the official Backoffice Skills plugin covers.","mattbrailsford\u002Fumbraco-devkit","mattbrailsford","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F527305?v=4","01M7CY974D4XX1P90YSXQC1T39","Matt Brailsford","01M7CY9751PSRA3EHBH03G936J",3,"MIT","https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-backoffice-conventions\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: umbraco-backoffice-conventions\ndescription: >-\n  Conventions for a Lit + UUI Umbraco backoffice package: compiler setup, local vs. exported\n  components and the public API surface, OpenAPI-generated clients, observable and extension\n  lifecycles, localization keys, build output and cache busting, and multi-package builds.\n  Use when setting up or structuring a backoffice frontend, changing what imports what\n  across its entry points, or adding a library or a call to the package's own API. Not for\n  individual extension points or state management, which the official Backoffice Skills\n  plugin covers.\n\n---\n\n# Umbraco backoffice frontend conventions\n\nThe official Umbraco Backoffice Skills plugin covers extension-point patterns (dashboards,\ntrees, property editors, modals, workspace context, manifest registration syntax). Defer to it\nfor those. This skill covers only the structure *around and between* extension points: how a\npackage's frontend source is organized, how components are registered and exported, and how a\nmulti-package frontend workspace builds.\n\nThese patterns match the Umbraco backoffice client itself. **Be flexible about the exact\nmechanism, not about the underlying principle**: a smaller package can simplify the\nmechanism, as noted below.\n\n## *🎯 Why: Design for Change*\n\nOne structure means \"is this component loaded, and is it meant for use outside this\npackage?\" always has one obvious answer, instead of each contributor re-deriving it from code.\n\n## Compiler setup this ecosystem requires\n\nWith `strict: true` as the baseline, a Lit + UUI backoffice package's `tsconfig.json` needs\nthese settings. They are required, not style choices:\n\n```json\n{\n  \"compilerOptions\": {\n    \"moduleResolution\": \"bundler\",\n    \"experimentalDecorators\": true,\n    \"types\": [\"@umbraco-cms\u002Fbackoffice\u002Fextension-types\"]\n  }\n}\n```\n\n**`experimentalDecorators: true`** is required for Lit's `@customElement`\u002F`@property`\ndecorators; without it, decorated classes silently fail to register or observe attributes.\n**`moduleResolution: \"bundler\"`** matches the backoffice's Vite build.\n**`types: [\"@umbraco-cms\u002Fbackoffice\u002Fextension-types\"]`** brings in the ambient\nmanifest\u002Fextension types the backoffice expects a package to declare against.\n\n## Local vs. global components\n\nTwo folder names, per sub-feature:\n\n- **`local-components\u002F`**: elements used only within that sub-feature. Never exported.\n  Import them directly where they're rendered (usually the one parent element whose template\n  uses them). No separate registration step.\n- **`global-components\u002F`**: elements reusable by other packages. Registered as custom\n  elements and exported from the module's `index.ts`.\n\n```ts\n\u002F\u002F local-components\u002Fthing-card\u002Fthing-card.element.ts — never exported, imported directly\n\u002F\u002F by whatever template renders it\n```\n\n```ts\n\u002F\u002F global-components\u002Ffeature-card\u002Ffeature-card.element.ts\n@customElement(\"umb-feature-card\")\nexport class UmbFeatureCardElement extends UmbLitElement { \u002F* ... *\u002F }\n\n\u002F\u002F re-exported from the module's index.ts\nexport { UmbFeatureCardElement } from \".\u002Fglobal-components\u002Ffeature-card\u002Ffeature-card.element.js\";\n```\n\nDefault to this for a new package. A larger package may instead chain per-feature barrels\ninto a single top-level entry point that registers every element, to confirm everything\nregisters exactly once. That is a variant, not a different rule. Pick one scheme per package;\ndon't mix both.\n\n**Duplicate registration.** The browser loads a module once per full URL, query string\nincluded. From 17.6 and 18.1 Umbraco adds `?umb__rnd=\u003Cversion>` to every `\u002FApp_Plugins` URL\nit loads by address: import map targets and the `js`, `element` and `api` files named in\n`umbraco-package.json`. A relative import inside your bundle (`.\u002Fentry.js`, `..\u002Findex.js`)\nresolves to the same file without that query string, so the browser loads a second copy.\nIts `customElements.define` calls throw, and any state in it (a promise, a configured\nclient) is split between the two copies.\n\n- **Nothing imports a manifest or import map file by relative path.** Entry files import\n  from ordinary modules; no module imports an entry file back. A value that both an entry\n  file and another module need (a \"ready\" promise, a configured client) goes in its own\n  module that both import.\n- **Watch for cycles.** An entry file that re-exports a module which imports the entry file\n  back is the same mistake one step removed. The bundler then emits a relative import of the\n  entry file from a shared chunk.\n- **Check the build output:** grep it for relative imports of any file named in\n  `umbraco-package.json`.\n\nDon't fix it with `allowCacheBusting: false` or your own `?v=` on the URLs: both turn\nUmbraco's cache busting off for the package.\n\nThe other way to register a tag twice is two *different* modules defining the *same tag\nname*, usually from workspace-linking\u002Fdependency duplication (see the build-order gotcha\nbelow). Add a duplicate-class-name build check once a package grows past a handful of\ncomponents; don't rely on catching it by eye.\n\n## What actually gates your public API: `package.json` exports, not any one file\n\nOnly symbols reachable through a subpath in `package.json`'s `exports` field are public API.\nA module's `index.ts` becomes a public contract only once its path is added there; until\nthen it is free to change.\n\n- **A small, single-purpose package** can have just one export path (its main `index.ts`, or\n  a dedicated `exports.ts` re-exported from it). No need for many subpaths on day one.\n- **A larger package** with separable feature areas can expose one subpath per area\n  (`\".\u002Fwidgets\"`, `\".\u002Freporting\"`), each backed by its own module `index.ts`, as the Umbraco\n  backoffice does.\n\nEither way: **before treating a rename or removal as breaking, check whether the symbol was\nactually reachable through an exported path**. If not, it isn't breaking. Removing or\nreshaping something that *is* exported (dropped export, changed constructor signature,\nremoved `@property()` field) is breaking for every importer. Apply the `[Obsolete]`-proxy\ndiscipline `umbraco-package-conventions` describes for the backend, adapted to TypeScript:\nkeep the old export working or ship a major version bump, and add a JSDoc `@deprecated` tag\nand a runtime warning. Both name the removal version, picked the same way as the backend\n`[Obsolete]` target. **Manifests are never exported from `index.ts`**; they register\nthrough the package's bundle mechanism, so a manifest array changing shape isn't a\npublic-API concern.\n\n## A renamed manifest `alias` is a silent breaking change\n\nManifest `alias` values (property editors, dashboards, sections, conditions) are referenced\nby **string**, in your own manifests and possibly in other packages' condition\u002Foverwrite\nconfigs. The compiler won't catch a rename; the old string just silently stops matching.\nTreat any manifest `alias:` rename as breaking: keep the old alias registered as a deprecated\nalternative, or call it out explicitly as an intentional breaking change. A green build does\nnot mean it is safe.\n\n**Reduce the risk at the source:** export any alias used in more than one place as a named\nconstant, `UMB_{DOMAIN}_{TYPE}_ALIAS`, all caps. A rename then causes a compiler error\ninstead of a silent runtime mismatch:\n\n```ts\nexport const MY_WIDGET_WORKSPACE_ALIAS = \"MyCompany.Workspace.Widget\";\n```\n\n## Localization keys: your own sections, each phrase once\n\nHow backoffice localization works (`localization` manifests, `this.localize.term()`,\n`\u003Cumb-localize>`, `#` keys in manifests) is in the official Backoffice Skills plugin's\n`umbraco-localization` skill. This section covers how a package organizes its keys.\n\nEvery `localization` manifest for a culture merges into one flat dictionary, keyed\n`section_key`. A key that another package, or the backoffice itself, also defines collides,\nand only one of them shows.\n\n- **Name every section after your package**: `myPackageActions`, `myPackageOrders`, never\n  `actions` or `orders`. That keeps your keys out of Umbraco's sections and other packages'.\n- **Group shared phrases by topic, like Umbraco does.** A phrase used on more than one screen\n  goes once in a shared section named for what kind of text it is: `myPackageActions` (\"Sync\n  now\"), `myPackageLabels` (\"Order number\"), `myPackagePlaceholders`,\n  `myPackageNotifications`. Don't repeat it under each screen's section, and don't put it in\n  one `myPackageGeneral` that every shared phrase lands in: a catch-all section grows until\n  nobody can find what's already there, and duplicates come back. Name the key after what the\n  text says, not where it appears: `myPackageLabels_orderNumber`, not\n  `myPackageOrdersTable_orderNumberColumn`.\n- **Before adding a key, check what exists, in this order:**\n  1. **Your package's shared sections.** They hold the package's own terms, in the\n     package's own sense, so they win over a similar Umbraco key.\n  2. **Umbraco's keys.** The backoffice already has keys for most common text, not just\n     single words: buttons and actions, placeholders, empty states, confirmations,\n     notification messages. They're all in the CMS repo's\n     `src\u002FUmbraco.Web.UI.Client\u002Fsrc\u002Fassets\u002Flang\u002Fen.ts`, grouped into sections like `general`,\n     `actions`, `buttons`, `placeholders` and `speechBubbles`. If one says what you need, in\n     the same sense, use it: it's already translated into every language the backoffice\n     ships, and it matches the wording the editor sees everywhere else. Adding\n     `myPackageOrders_save` gives every translator one more \"Save\" to do.\n\n  Only add a new key when neither has one. If more than one screen will use it, add it to\n  the shared section for its topic.\n- **Use arguments for values that change.** One `'{0} orders'` key, or a function key for\n  plurals, instead of one key per count or name.\n- **Reuse whole phrases, never fragments.** Don't build a sentence from several keys\n  (`term('myPackageActions_delete') + ' ' + term('myPackageLabels_order')`): word order and\n  grammar change between languages, so the joined text reads wrong once translated. One key\n  per full sentence or label.\n- **Keep two keys when the meaning differs**, even if the English is the same. \"Order\" the\n  noun and \"Order\" the verb, or \"Open\" the state and \"Open\" the action, translate differently\n  in many languages.\n\nIn review, look for a new key whose English text matches an existing key in the package's\nshared sections or Umbraco's, and for shared phrases piling up in one catch-all section.\nReuse a matching key unless the meaning differs.\n\n## Components are lazy-loaded per manifest, by default\n\nIn the Umbraco backoffice, components and API classes load mainly through a dynamic import\non the manifest that needs them, not an eager barrel:\n\n```ts\n{\n  type: \"dashboard\",\n  alias: \"MyCompany.Dashboard.Analytics\",\n  name: \"Analytics Dashboard\",\n  element: () => import(\".\u002Fanalytics-dashboard.element.js\"),\n}\n```\n\nVite code-splits at that `import()`, so the component loads only when its manifest\nactivates. Use this first for anything registered directly on a manifest (`element`, `api`,\n`js`). The local\u002Fglobal-components split above is for components that *aren't*\nmanifest-registered, only referenced by tag name inside another component's template.\n\n## Build output: externalise the backoffice, version every release\n\nThe backoffice already loads `@umbraco-cms\u002Fbackoffice` and Lit. A package that bundles its own\ncopy ships both twice, and a second Lit runtime breaks in subtle ways. Keep them out of the\nbundle:\n\n```typescript\n\u002F\u002F vite.config.ts\nbuild: {\n  rollupOptions: {\n    external: [\u002F^@umbraco\u002F], \u002F\u002F provided by the backoffice at runtime\n  },\n},\n```\n\n```typescript\n\u002F\u002F WRONG — bundles a second copy of Lit\nimport { html, css } from \"lit\";\n\n\u002F\u002F RIGHT — uses the backoffice's Lit\nimport { html, css } from \"@umbraco-cms\u002Fbackoffice\u002Fexternal\u002Flit\";\n```\n\nThe same goes for every library the backoffice ships under `external\u002F*`. In 17 and 18 that's\n`dompurify`, `lit`, `luxon`, `marked`, `monaco-editor`, `rxjs`, `signalr` and `uui`. Before\nadding one of these from npm, or copying a bare import from a file next to yours, import it\nfrom `@umbraco-cms\u002Fbackoffice\u002Fexternal\u002F\u003Cname>` instead. `umbraco-dependencies`' npm section\nhas how to find bare imports that slip through.\n\n**Bump `version` in `umbraco-package.json` for every release that changes frontend assets.**\nFrom 17.6 and 18.1, Umbraco appends that version to the manifest's entry points and import map\nURLs, so it's the browser's cache key. An unchanged version means editors keep running the\nold files. Code-split chunks don't get the version, so keep Vite's default content-hashed\nfile names for them. The appended version is also why a manifest file must never be imported\nby relative path; see \"Duplicate registration\" above.\n\nSource: [Vite package setup](https:\u002F\u002Fdocs.umbraco.com\u002Fumbraco-cms\u002Fextend-your-project\u002Fbackoffice-extensions\u002Fdevelopment-flow\u002Fvite-package-setup),\n[umbraco-package.json](https:\u002F\u002Fdocs.umbraco.com\u002Fumbraco-cms\u002Fextend-your-project\u002Fbackoffice-extensions\u002Fumbraco-package),\n\"The version is your cache key\" and \"Bundle your assets\".\n\n## Generating a typed API client from your Management API\n\nIf your package ships a Management API with an OpenAPI\u002FSwagger spec, generate a typed\nTypeScript client from it (e.g. `@hey-api\u002Fopenapi-ts`) instead of hand-writing `fetch` calls\nand DTO types. Use one consistent generation script name per package.\n\n```bash\nnpm run generate-client -- https:\u002F\u002Flocalhost:$(git wdp-port)\u002Fumbraco\u002Fswagger\u002Fmy-package\u002Fswagger.json\n```\n\nDon't hardcode the demo site's port. With `Umbraco.Community.WorktreeDevPort` (set up by\n`project-init`'s \"Demo site ports\" step), `git wdp-port` gives the current worktree's port, and a\nNode script can use `getPort()` from `worktree-dev-port`.\n\nBuild the backend first so the spec is current, and regenerate the client whenever the API\nsurface changes. For how its requests authenticate, see `umbraco-security`. Treat generated output as build output: if a generated type is wrong, fix\nthe request\u002Fresponse model on the server, not the generated file.\n\n**Never call the generated client directly from a component or a context.** Only one layer (a\ndata source) imports generated types or calls generated services, and maps them to your\npackage's own domain models. A generated type in a component or context means the mapping\nlayer is missing, so generated-client changes (renamed field, new required parameter) leak\ninto UI code instead of stopping at one boundary.\n\n**Data sources return `{ data, error }` and never throw.** That's the backoffice's own shape\n(`UmbDataSourceResponse`), so repositories and contexts built on yours handle failure the\nsame way they do for core data. Wrap each generated call in `tryExecute(this, promise)` from\n`@umbraco-cms\u002Fbackoffice\u002Fresources`. It returns `{ data, error }` instead of throwing, and\nshows the user an error notification unless you pass `disableNotifications: true`.\n\n**`tryExecute` only notifies when the call throws.** A hey-api client resolves a failed\nrequest to `{ error }` unless it's configured with `throwOnError: true`, so `tryExecute`\nreturns the error without showing anything. Umbraco's own client sets it; the\n`umbraco-extension` template doesn't. Set it on the `@hey-api\u002Fclient-fetch` plugin in the\ngeneration config, so it survives regeneration, or with\n`client.setConfig({ throwOnError: true })` after `authContext.configureClient(client)`\n(`setConfig` merges, so the auth settings stay):\n\n```ts\nimport { tryExecute } from '@umbraco-cms\u002Fbackoffice\u002Fresources';\n\nasync requestById(id: string) {\n\tconst { data, error } = await tryExecute(this.#host, getConnection({ path: { id } }));\n\tif (error || !data) return { error };\n\treturn { data: mapConnection(data) };\n}\n```\n\n## Workspace\u002Fmonorepo frontend builds\n\nIn a monorepo where frontend packages depend on each other (a core package consumed by\nadd-on packages), build in dependency order. A core package that exposes types via a\nrolled-up `.d.ts` (e.g. api-extractor) needs that rollup built at least once before\ndependents type-check. Otherwise a dependent fails with a confusing `Cannot find module`\nerror that cascades into unrelated-looking `{}`-inferred type errors:\n\n```bash\nnpm run build:core   # build the dependency's rollup first\nnpm run build:addon  # then the package that consumes it\n```\n\nRestore\u002Finstall dependencies from the workspace root, not a package's frontend subfolder. A\nnested `node_modules` can resolve its own, possibly stale, copy of a workspace-linked local\npackage.\n\n## Observable subscriptions: use `this.observe()`, not raw `.subscribe()`\n\nUmbraco state\u002Fcontext observables (pattern covered by the official Backoffice Skills\nplugin's `umbraco-state-management`) can be subscribed via the element's `this.observe()`\n(from `UmbLitElement`\u002F`UmbControllerHostElementMixin`) or RxJS's raw `.subscribe()`. Only\n`this.observe()` is safe by default.\n\n```typescript\n\u002F\u002F WRONG — a raw subscription outlives the component if you forget to unsubscribe\nconnectedCallback() {\n  super.connectedCallback();\n  this._context.myValue.subscribe((value) => { this._value = value; }); \u002F\u002F leaks on disconnect\n}\n\n\u002F\u002F RIGHT — this.observe() ties the subscription's lifecycle to the element automatically\nconstructor() {\n  super();\n  this.observe(this._context.myValue, (value) => { this._value = value; });\n}\n```\n\n`this.observe()` registers the subscription as a controller on the host, so it's torn down\non `disconnectedCallback`: no manual `unsubscribe()`, no callback after the component is\ngone. In review, treat any raw `.subscribe()` in a Lit component as suspect; it usually\nshould be `this.observe()`.\n\n## Extension APIs you create are yours to destroy\n\n`createExtensionApi` and `createExtensionApiByAlias` connect the new API to the host you\npass, but don't clean up an API you created earlier. Code that creates one on every\n`connectedCallback`, property change or route change keeps every old instance alive, with\nits context listeners. Editors notice after a few dozen navigations.\n\n```typescript\n\u002F\u002F WRONG — a new API on every value change, none destroyed\noverride updated() {\n  createExtensionApiByAlias\u003CMyApi>(this, this.alias).then((api) => (this.#api = api));\n}\n\n\u002F\u002F RIGHT — destroy the previous instance before replacing it\nasync #load(alias: string) {\n  this.#api?.destroy();\n  this.#api = await createExtensionApiByAlias\u003CMyApi>(this, alias);\n}\n```\n\nPrefer creating it once, in the constructor. To run every extension of a manifest type, use\n`UmbExtensionsApiInitializer` (or `UmbExtensionApiInitializer` for one), which creates and\ndestroys the APIs as extensions come and go.\n\nSource: CMS issue [#21828](https:\u002F\u002Fgithub.com\u002Fumbraco\u002FUmbraco-CMS\u002Fissues\u002F21828) and\nPR [#24083](https:\u002F\u002Fgithub.com\u002Fumbraco\u002FUmbraco-CMS\u002Fpull\u002F24083).\n","# Umbraco backoffice frontend conventions\n\nThe official Umbraco Backoffice Skills plugin covers extension-point patterns (dashboards,\ntrees, property editors, modals, workspace context, manifest registration syntax). Defer to it\nfor those. This skill covers only the structure *around and between* extension points: how a\npackage's frontend source is organized, how components are registered and exported, and how a\nmulti-package frontend workspace builds.\n\nThese patterns match the Umbraco backoffice client itself. **Be flexible about the exact\nmechanism, not about the underlying principle**: a smaller package can simplify the\nmechanism, as noted below.\n\n## *🎯 Why: Design for Change*\n\nOne structure means \"is this component loaded, and is it meant for use outside this\npackage?\" always has one obvious answer, instead of each contributor re-deriving it from code.\n\n## Compiler setup this ecosystem requires\n\nWith `strict: true` as the baseline, a Lit + UUI backoffice package's `tsconfig.json` needs\nthese settings. They are required, not style choices:\n\n```json\n{\n  \"compilerOptions\": {\n    \"moduleResolution\": \"bundler\",\n    \"experimentalDecorators\": true,\n    \"types\": [\"@umbraco-cms\u002Fbackoffice\u002Fextension-types\"]\n  }\n}\n```\n\n**`experimentalDecorators: true`** is required for Lit's `@customElement`\u002F`@property`\ndecorators; without it, decorated classes silently fail to register or observe attributes.\n**`moduleResolution: \"bundler\"`** matches the backoffice's Vite build.\n**`types: [\"@umbraco-cms\u002Fbackoffice\u002Fextension-types\"]`** brings in the ambient\nmanifest\u002Fextension types the backoffice expects a package to declare against.\n\n## Local vs. global components\n\nTwo folder names, per sub-feature:\n\n- **`local-components\u002F`**: elements used only within that sub-feature. Never exported.\n  Import them directly where they're rendered (usually the one parent element whose template\n  uses them). No separate registration step.\n- **`global-components\u002F`**: elements reusable by other packages. Registered as custom\n  elements and exported from the module's `index.ts`.\n\n```ts\n\u002F\u002F local-components\u002Fthing-card\u002Fthing-card.element.ts — never exported, imported directly\n\u002F\u002F by whatever template renders it\n```\n\n```ts\n\u002F\u002F global-components\u002Ffeature-card\u002Ffeature-card.element.ts\n@customElement(\"umb-feature-card\")\nexport class UmbFeatureCardElement extends UmbLitElement { \u002F* ... *\u002F }\n\n\u002F\u002F re-exported from the module's index.ts\nexport { UmbFeatureCardElement } from \".\u002Fglobal-components\u002Ffeature-card\u002Ffeature-card.element.js\";\n```\n\nDefault to this for a new package. A larger package may instead chain per-feature barrels\ninto a single top-level entry point that registers every element, to confirm everything\nregisters exactly once. That is a variant, not a different rule. Pick one scheme per package;\ndon't mix both.\n\n**Duplicate registration.** The browser loads a module once per full URL, query string\nincluded. From 17.6 and 18.1 Umbraco adds `?umb__rnd=\u003Cversion>` to every `\u002FApp_Plugins` URL\nit loads by address: import map targets and the `js`, `element` and `api` files named in\n`umbraco-package.json`. A relative import inside your bundle (`.\u002Fentry.js`, `..\u002Findex.js`)\nresolves to the same file without that query string, so the browser loads a second copy.\nIts `customElements.define` calls throw, and any state in it (a promise, a configured\nclient) is split between the two copies.\n\n- **Nothing imports a manifest or import map file by relative path.** Entry files import\n  from ordinary modules; no module imports an entry file back. A value that both an entry\n  file and another module need (a \"ready\" promise, a configured client) goes in its own\n  module that both import.\n- **Watch for cycles.** An entry file that re-exports a module which imports the entry file\n  back is the same mistake one step removed. The bundler then emits a relative import of the\n  entry file from a shared chunk.\n- **Check the build output:** grep it for relative imports of any file named in\n  `umbraco-package.json`.\n\nDon't fix it with `allowCacheBusting: false` or your own `?v=` on the URLs: both turn\nUmbraco's cache busting off for the package.\n\nThe other way to register a tag twice is two *different* modules defining the *same tag\nname*, usually from workspace-linking\u002Fdependency duplication (see the build-order gotcha\nbelow). Add a duplicate-class-name build check once a package grows past a handful of\ncomponents; don't rely on catching it by eye.\n\n## What actually gates your public API: `package.json` exports, not any one file\n\nOnly symbols reachable through a subpath in `package.json`'s `exports` field are public API.\nA module's `index.ts` becomes a public contract only once its path is added there; until\nthen it is free to change.\n\n- **A small, single-purpose package** can have just one export path (its main `index.ts`, or\n  a dedicated `exports.ts` re-exported from it). No need for many subpaths on day one.\n- **A larger package** with separable feature areas can expose one subpath per area\n  (`\".\u002Fwidgets\"`, `\".\u002Freporting\"`), each backed by its own module `index.ts`, as the Umbraco\n  backoffice does.\n\nEither way: **before treating a rename or removal as breaking, check whether the symbol was\nactually reachable through an exported path**. If not, it isn't breaking. Removing or\nreshaping something that *is* exported (dropped export, changed constructor signature,\nremoved `@property()` field) is breaking for every importer. Apply the `[Obsolete]`-proxy\ndiscipline `umbraco-package-conventions` describes for the backend, adapted to TypeScript:\nkeep the old export working or ship a major version bump, and add a JSDoc `@deprecated` tag\nand a runtime warning. Both name the removal version, picked the same way as the backend\n`[Obsolete]` target. **Manifests are never exported from `index.ts`**; they register\nthrough the package's bundle mechanism, so a manifest array changing shape isn't a\npublic-API concern.\n\n## A renamed manifest `alias` is a silent breaking change\n\nManifest `alias` values (property editors, dashboards, sections, conditions) are referenced\nby **string**, in your own manifests and possibly in other packages' condition\u002Foverwrite\nconfigs. The compiler won't catch a rename; the old string just silently stops matching.\nTreat any manifest `alias:` rename as breaking: keep the old alias registered as a deprecated\nalternative, or call it out explicitly as an intentional breaking change. A green build does\nnot mean it is safe.\n\n**Reduce the risk at the source:** export any alias used in more than one place as a named\nconstant, `UMB_{DOMAIN}_{TYPE}_ALIAS`, all caps. A rename then causes a compiler error\ninstead of a silent runtime mismatch:\n\n```ts\nexport const MY_WIDGET_WORKSPACE_ALIAS = \"MyCompany.Workspace.Widget\";\n```\n\n## Localization keys: your own sections, each phrase once\n\nHow backoffice localization works (`localization` manifests, `this.localize.term()`,\n`\u003Cumb-localize>`, `#` keys in manifests) is in the official Backoffice Skills plugin's\n`umbraco-localization` skill. This section covers how a package organizes its keys.\n\nEvery `localization` manifest for a culture merges into one flat dictionary, keyed\n`section_key`. A key that another package, or the backoffice itself, also defines collides,\nand only one of them shows.\n\n- **Name every section after your package**: `myPackageActions`, `myPackageOrders`, never\n  `actions` or `orders`. That keeps your keys out of Umbraco's sections and other packages'.\n- **Group shared phrases by topic, like Umbraco does.** A phrase used on more than one screen\n  goes once in a shared section named for what kind of text it is: `myPackageActions` (\"Sync\n  now\"), `myPackageLabels` (\"Order number\"), `myPackagePlaceholders`,\n  `myPackageNotifications`. Don't repeat it under each screen's section, and don't put it in\n  one `myPackageGeneral` that every shared phrase lands in: a catch-all section grows until\n  nobody can find what's already there, and duplicates come back. Name the key after what the\n  text says, not where it appears: `myPackageLabels_orderNumber`, not\n  `myPackageOrdersTable_orderNumberColumn`.\n- **Before adding a key, check what exists, in this order:**\n  1. **Your package's shared sections.** They hold the package's own terms, in the\n     package's own sense, so they win over a similar Umbraco key.\n  2. **Umbraco's keys.** The backoffice already has keys for most common text, not just\n     single words: buttons and actions, placeholders, empty states, confirmations,\n     notification messages. They're all in the CMS repo's\n     `src\u002FUmbraco.Web.UI.Client\u002Fsrc\u002Fassets\u002Flang\u002Fen.ts`, grouped into sections like `general`,\n     `actions`, `buttons`, `placeholders` and `speechBubbles`. If one says what you need, in\n     the same sense, use it: it's already translated into every language the backoffice\n     ships, and it matches the wording the editor sees everywhere else. Adding\n     `myPackageOrders_save` gives every translator one more \"Save\" to do.\n\n  Only add a new key when neither has one. If more than one screen will use it, add it to\n  the shared section for its topic.\n- **Use arguments for values that change.** One `'{0} orders'` key, or a function key for\n  plurals, instead of one key per count or name.\n- **Reuse whole phrases, never fragments.** Don't build a sentence from several keys\n  (`term('myPackageActions_delete') + ' ' + term('myPackageLabels_order')`): word order and\n  grammar change between languages, so the joined text reads wrong once translated. One key\n  per full sentence or label.\n- **Keep two keys when the meaning differs**, even if the English is the same. \"Order\" the\n  noun and \"Order\" the verb, or \"Open\" the state and \"Open\" the action, translate differently\n  in many languages.\n\nIn review, look for a new key whose English text matches an existing key in the package's\nshared sections or Umbraco's, and for shared phrases piling up in one catch-all section.\nReuse a matching key unless the meaning differs.\n\n## Components are lazy-loaded per manifest, by default\n\nIn the Umbraco backoffice, components and API classes load mainly through a dynamic import\non the manifest that needs them, not an eager barrel:\n\n```ts\n{\n  type: \"dashboard\",\n  alias: \"MyCompany.Dashboard.Analytics\",\n  name: \"Analytics Dashboard\",\n  element: () => import(\".\u002Fanalytics-dashboard.element.js\"),\n}\n```\n\nVite code-splits at that `import()`, so the component loads only when its manifest\nactivates. Use this first for anything registered directly on a manifest (`element`, `api`,\n`js`). The local\u002Fglobal-components split above is for components that *aren't*\nmanifest-registered, only referenced by tag name inside another component's template.\n\n## Build output: externalise the backoffice, version every release\n\nThe backoffice already loads `@umbraco-cms\u002Fbackoffice` and Lit. A package that bundles its own\ncopy ships both twice, and a second Lit runtime breaks in subtle ways. Keep them out of the\nbundle:\n\n```typescript\n\u002F\u002F vite.config.ts\nbuild: {\n  rollupOptions: {\n    external: [\u002F^@umbraco\u002F], \u002F\u002F provided by the backoffice at runtime\n  },\n},\n```\n\n```typescript\n\u002F\u002F WRONG — bundles a second copy of Lit\nimport { html, css } from \"lit\";\n\n\u002F\u002F RIGHT — uses the backoffice's Lit\nimport { html, css } from \"@umbraco-cms\u002Fbackoffice\u002Fexternal\u002Flit\";\n```\n\nThe same goes for every library the backoffice ships under `external\u002F*`. In 17 and 18 that's\n`dompurify`, `lit`, `luxon`, `marked`, `monaco-editor`, `rxjs`, `signalr` and `uui`. Before\nadding one of these from npm, or copying a bare import from a file next to yours, import it\nfrom `@umbraco-cms\u002Fbackoffice\u002Fexternal\u002F\u003Cname>` instead. `umbraco-dependencies`' npm section\nhas how to find bare imports that slip through.\n\n**Bump `version` in `umbraco-package.json` for every release that changes frontend assets.**\nFrom 17.6 and 18.1, Umbraco appends that version to the manifest's entry points and import map\nURLs, so it's the browser's cache key. An unchanged version means editors keep running the\nold files. Code-split chunks don't get the version, so keep Vite's default content-hashed\nfile names for them. The appended version is also why a manifest file must never be imported\nby relative path; see \"Duplicate registration\" above.\n\nSource: [Vite package setup](https:\u002F\u002Fdocs.umbraco.com\u002Fumbraco-cms\u002Fextend-your-project\u002Fbackoffice-extensions\u002Fdevelopment-flow\u002Fvite-package-setup),\n[umbraco-package.json](https:\u002F\u002Fdocs.umbraco.com\u002Fumbraco-cms\u002Fextend-your-project\u002Fbackoffice-extensions\u002Fumbraco-package),\n\"The version is your cache key\" and \"Bundle your assets\".\n\n## Generating a typed API client from your Management API\n\nIf your package ships a Management API with an OpenAPI\u002FSwagger spec, generate a typed\nTypeScript client from it (e.g. `@hey-api\u002Fopenapi-ts`) instead of hand-writing `fetch` calls\nand DTO types. Use one consistent generation script name per package.\n\n```bash\nnpm run generate-client -- https:\u002F\u002Flocalhost:$(git wdp-port)\u002Fumbraco\u002Fswagger\u002Fmy-package\u002Fswagger.json\n```\n\nDon't hardcode the demo site's port. With `Umbraco.Community.WorktreeDevPort` (set up by\n`project-init`'s \"Demo site ports\" step), `git wdp-port` gives the current worktree's port, and a\nNode script can use `getPort()` from `worktree-dev-port`.\n\nBuild the backend first so the spec is current, and regenerate the client whenever the API\nsurface changes. For how its requests authenticate, see `umbraco-security`. Treat generated output as build output: if a generated type is wrong, fix\nthe request\u002Fresponse model on the server, not the generated file.\n\n**Never call the generated client directly from a component or a context.** Only one layer (a\ndata source) imports generated types or calls generated services, and maps them to your\npackage's own domain models. A generated type in a component or context means the mapping\nlayer is missing, so generated-client changes (renamed field, new required parameter) leak\ninto UI code instead of stopping at one boundary.\n\n**Data sources return `{ data, error }` and never throw.** That's the backoffice's own shape\n(`UmbDataSourceResponse`), so repositories and contexts built on yours handle failure the\nsame way they do for core data. Wrap each generated call in `tryExecute(this, promise)` from\n`@umbraco-cms\u002Fbackoffice\u002Fresources`. It returns `{ data, error }` instead of throwing, and\nshows the user an error notification unless you pass `disableNotifications: true`.\n\n**`tryExecute` only notifies when the call throws.** A hey-api client resolves a failed\nrequest to `{ error }` unless it's configured with `throwOnError: true`, so `tryExecute`\nreturns the error without showing anything. Umbraco's own client sets it; the\n`umbraco-extension` template doesn't. Set it on the `@hey-api\u002Fclient-fetch` plugin in the\ngeneration config, so it survives regeneration, or with\n`client.setConfig({ throwOnError: true })` after `authContext.configureClient(client)`\n(`setConfig` merges, so the auth settings stay):\n\n```ts\nimport { tryExecute } from '@umbraco-cms\u002Fbackoffice\u002Fresources';\n\nasync requestById(id: string) {\n\tconst { data, error } = await tryExecute(this.#host, getConnection({ path: { id } }));\n\tif (error || !data) return { error };\n\treturn { data: mapConnection(data) };\n}\n```\n\n## Workspace\u002Fmonorepo frontend builds\n\nIn a monorepo where frontend packages depend on each other (a core package consumed by\nadd-on packages), build in dependency order. A core package that exposes types via a\nrolled-up `.d.ts` (e.g. api-extractor) needs that rollup built at least once before\ndependents type-check. Otherwise a dependent fails with a confusing `Cannot find module`\nerror that cascades into unrelated-looking `{}`-inferred type errors:\n\n```bash\nnpm run build:core   # build the dependency's rollup first\nnpm run build:addon  # then the package that consumes it\n```\n\nRestore\u002Finstall dependencies from the workspace root, not a package's frontend subfolder. A\nnested `node_modules` can resolve its own, possibly stale, copy of a workspace-linked local\npackage.\n\n## Observable subscriptions: use `this.observe()`, not raw `.subscribe()`\n\nUmbraco state\u002Fcontext observables (pattern covered by the official Backoffice Skills\nplugin's `umbraco-state-management`) can be subscribed via the element's `this.observe()`\n(from `UmbLitElement`\u002F`UmbControllerHostElementMixin`) or RxJS's raw `.subscribe()`. Only\n`this.observe()` is safe by default.\n\n```typescript\n\u002F\u002F WRONG — a raw subscription outlives the component if you forget to unsubscribe\nconnectedCallback() {\n  super.connectedCallback();\n  this._context.myValue.subscribe((value) => { this._value = value; }); \u002F\u002F leaks on disconnect\n}\n\n\u002F\u002F RIGHT — this.observe() ties the subscription's lifecycle to the element automatically\nconstructor() {\n  super();\n  this.observe(this._context.myValue, (value) => { this._value = value; });\n}\n```\n\n`this.observe()` registers the subscription as a controller on the host, so it's torn down\non `disconnectedCallback`: no manual `unsubscribe()`, no callback after the component is\ngone. In review, treat any raw `.subscribe()` in a Lit component as suspect; it usually\nshould be `this.observe()`.\n\n## Extension APIs you create are yours to destroy\n\n`createExtensionApi` and `createExtensionApiByAlias` connect the new API to the host you\npass, but don't clean up an API you created earlier. Code that creates one on every\n`connectedCallback`, property change or route change keeps every old instance alive, with\nits context listeners. Editors notice after a few dozen navigations.\n\n```typescript\n\u002F\u002F WRONG — a new API on every value change, none destroyed\noverride updated() {\n  createExtensionApiByAlias\u003CMyApi>(this, this.alias).then((api) => (this.#api = api));\n}\n\n\u002F\u002F RIGHT — destroy the previous instance before replacing it\nasync #load(alias: string) {\n  this.#api?.destroy();\n  this.#api = await createExtensionApiByAlias\u003CMyApi>(this, alias);\n}\n```\n\nPrefer creating it once, in the constructor. To run every extension of a manifest type, use\n`UmbExtensionsApiInitializer` (or `UmbExtensionApiInitializer` for one), which creates and\ndestroys the APIs as extensions come and go.\n\nSource: CMS issue [#21828](https:\u002F\u002Fgithub.com\u002Fumbraco\u002FUmbraco-CMS\u002Fissues\u002F21828) and\nPR [#24083](https:\u002F\u002Fgithub.com\u002Fumbraco\u002FUmbraco-CMS\u002Fpull\u002F24083).\n",{"name":5,"description":7},"main","a2f9c28bc56802b4e6db01e03972e497b30ad001","plugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-backoffice-conventions",1,"https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit","https:\u002F\u002Fgithub.com\u002Fmattbrailsford","https:\u002F\u002Fmattbrailsford.dev","AI Staff Engineer @umbraco ","2026-11-12 18:33:53",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add mattbrailsford\u002Fumbraco-devkit --skill umbraco-backoffice-conventions",{"tool":39,"command":40},"bunx","bunx skills add mattbrailsford\u002Fumbraco-devkit --skill umbraco-backoffice-conventions",{"tool":42,"command":43},"pnpm","pnpm dlx skills add mattbrailsford\u002Fumbraco-devkit --skill umbraco-backoffice-conventions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-backoffice-conventions\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7CYGRPVNP8H9YNHGMZ6CP3C","user-stories","Writes, splits and refines user stories with Given\u002FWhen\u002FThen acceptance criteria in STORIES.md, feeding bdd-specs. Use when turning a feature request or a vague ask into a testable backlog entry.","https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fuser-stories\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7CYGJB26N83DXKMDEKY2X48","umbraco-security","What Umbraco provides for keeping a package secure, on the server and in the backoffice: Management API authorization and policies, settings that hold secrets, endpoints outside the Management API, sanitizeHTML and escapeHTML, DOMPurify rules for custom elements, and umbHttpClient instead of handling tokens in the browser. Use when writing or reviewing a Management API controller, a secret setting, a custom endpoint, a backoffice template that uses unsafeHTML, or frontend code that calls an API.","https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-security\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7CYGBEZ2Q4AXDDNADWW4Q9H","umbraco-performance","Keeping a package fast on the sites that install it: the published cache over the services layer, tree traversal, caching lookups and clearing them, data type config and converter cache levels, output cache eviction, light hot paths, and backoffice screens that don't over-fetch. Use when writing, changing or reviewing code that runs per request, per save, per indexed item or at startup (property value converters, notification handlers, indexing), code that loops over every content item (a full rebuild, an import, a sync), or a list or search screen. Not for a site's own templates.","https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-performance\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7CYG59CZN1K2KERB0SSDGSY","umbraco-package-conventions","Backend conventions for an Umbraco package: async naming, internal by default, Attempt-based results for routine failures, public-API backwards compatibility, and where extension methods live. Use when naming a method, choosing visibility, shaping a service's result, changing a public signature (including adding a dependency to a public class's constructor), or organizing extension methods. For extension mechanisms, see `umbraco-extensibility`.","https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-package-conventions\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7CYG0J10QH8J2GS825WTTET","umbraco-marketplace","Gets a finished package listed on the Umbraco Marketplace: the NuGet tag, the dependency Marketplace reads version support from, the v14+ compatibility gotcha, and umbraco-marketplace.json. Use when a package is ready to publish, or when reviewing its packaging.","https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-marketplace\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7CYFT7MSYW4GRDSQRDPG020","umbraco-extensibility","Umbraco's extension mechanisms (Composers, collection builders, notification handlers, attribute discovery) and a catalogue of backend CMS extension points: property value converters, Management API endpoints, content finders, health checks, search indexing, package migrations, background jobs, and more. Use when making a feature extensible or choosing which extension point fits. Not for property editor UI, dashboards, sections or trees, which the official Backoffice Skills plugin covers.","https:\u002F\u002Fgithub.com\u002Fmattbrailsford\u002Fumbraco-devkit\u002Fblob\u002Fmain\u002Fplugins\u002Fumbraco-devkit\u002Fskills\u002Fumbraco-extensibility\u002FSKILL.md",[],[]]