umbraco-cms-source
How to read Umbraco CMS source at the release tag the project targets, from a local clone of umbraco/Umbraco-CMS or from GitHub through `gh`. Use when you need to see how the CMS implements something: a base class, an extension point's contract, a backoffice element, a service's behavior.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- umbraco-cms-source
- description
- How to read Umbraco CMS source at the release tag the project targets, from a local clone of umbraco/Umbraco-CMS or from GitHub through `gh`. Use when you need to see how the CMS implements something: a base class, an extension point's contract, a backoffice element, a service's behavior.
03 SKILL.md 正文
umbraco-cms-source
The CMS source is the ground truth for how Umbraco behaves. Reading it from a local clone is
much faster than fetching files one at a time from GitHub, and git grep searches a whole
release in one call. Read it at the release the project actually targets: code on main or a
newer major can have APIs, names, or layouts the project's version doesn't.
Find the clone
The clone's path lives in the project's CLAUDE.local.md (personal, gitignored, set up by
project-init), on a line like:
- Umbraco CMS source: /Users/jane/Code/Umbraco-CMS
Use that path as $CMS in the commands below. If it starts with ~, expand it to the full
home-folder path first: inside quotes, ~ isn't expanded and git can't find the folder. If there's no such line, or the path isn't a
git repo, use the GitHub fallback below. Don't clone it yourself from here; project-init offers
that, with the user's yes.
Then find the remote that points at umbraco/Umbraco-CMS. In a direct clone it's origin;
in a clone of someone's fork it's usually upstream. Check once per session:
REMOTE=$(git -C "$CMS" remote -v | awk 'tolower($2) ~ /[\/:]umbraco\/umbraco-cms(\.git)?$/ {print $1; exit}')
If $REMOTE comes back empty, no remote points at Umbraco's repo: use the GitHub fallback below.
Pick the tag
- Get the exact CMS version the project targets: the
Umbraco.Cms.*package version inDirectory.Packages.propsor the.csproj.CLAUDE.md's Stack section has the major if the exact version isn't pinned. - The tag is
release-<version>, e.g.release-17.6.1. For a major-only target, take the newest tag in that major:git -C "$CMS" tag -l "release-17.*" --sort=-v:refname | head -1 - If the tag isn't there, fetch the major's tags, then look again:
Fetch only the tags you need. A plaingit -C "$CMS" fetch --quiet "$REMOTE" "refs/tags/release-17.*:refs/tags/release-17.*"fetch --tagsalso updates every branch ref, and one stale ref in the user's clone can make it fail. - If the project supports more than one CMS major, check each major's tag. Behavior that differs between them is a multi-version finding, not a detail to average out.
Read, search, list
Read straight from the tag. These commands never touch the clone's working tree or current branch:
# Read one file
git -C "$CMS" show "${tag}:src/Umbraco.Core/Services/ContentService.cs"
# Search the whole release (narrow with a pathspec when you can)
git -C "$CMS" grep -n -w "class ContentService" "${tag}" -- 'src/*.cs'
# List files under a folder
git -C "$CMS" ls-tree -r --name-only "${tag}" -- src/Umbraco.Web.UI.Client/src/packages/core/
Write "${tag}:path" with braces. In zsh, $tag:s is read as a modifier on $tag. Match
whole words with -w, not \b: macOS git grep -E has no \b and matches nothing,
with no error.
Where to look: from release-17.1.0, the CMS has its own CLAUDE.md at the repo root and in each
project under src/ (src/Umbraco.Core/CLAUDE.md, src/Umbraco.Web.UI.Client/CLAUDE.md, and
so on). Read the one for the area you need, at the same tag, before searching. It maps that
project's folders and names its conventions. Older tags don't have them; list the folder
instead. For a backoffice extension, each feature package's
manifests.ts under src/Umbraco.Web.UI.Client/src/packages/ shows how a built-in extension
of the same type is registered.
Rules
- Never change the clone. No
checkout,switch,pull,reset, or edits. It may be the user's own working copy. Fetching tags is the only write, and it only adds tags. - Quote the tag you read. When a design, review finding, or decision relies on CMS
source, name the file and tag (
release-17.6.1:src/...) so the claim can be checked. - Source beats memory and docs. If what you remember about a CMS API, or what the docs
(
umbraco-docs) say, differs from the source at the project's tag, the source wins.
No clone: GitHub fallback
Use gh against umbraco/Umbraco-CMS at the same tag:
gh api "repos/umbraco/Umbraco-CMS/contents/src/Umbraco.Core/Services/ContentService.cs?ref=${tag}" \
-H "Accept: application/vnd.github.raw"
gh search code "class ContentService" --repo umbraco/Umbraco-CMS
gh search code only searches the default branch, not a tag. Confirm anything it finds by
reading the file at the project's tag before relying on it.
Without a signed-in gh, read the same file over plain HTTPS at the tag:
https://raw.githubusercontent.com/umbraco/Umbraco-CMS/${tag}/src/Umbraco.Core/Services/ContentService.cs.
There's no search this way, so find the path first (the docs, a stack trace, or the
namespace).
04 同仓库更多 Skills
user-stories
Writes, splits and refines user stories with Given/When/Then acceptance criteria in STORIES.md, feeding bdd-specs. Use when turning a feature request or a vague ask into a testable backlog entry.
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.
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.
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`.
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.
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.