Skip to content

Latest commit

 

History

History
606 lines (441 loc) · 38.9 KB

CLAUDE.md

File metadata and controls

606 lines (441 loc) · 38.9 KB

CLAUDE.md

Repository Structure

Monorepo for Umbraco.AI and add-on packages. Each product has its own .slnx, CLAUDE.md, and builds independently.

Product Location Category
Umbraco.AI Umbraco.AI/ Core
Umbraco.AI.Agent Umbraco.AI.Agent/ Add-on
Umbraco.AI.Agent.UI Umbraco.AI.Agent.UI/ Add-on (chat UI library)
Umbraco.AI.Agent.Copilot Umbraco.AI.Agent.Copilot/ Add-on (frontend-only)
Umbraco.AI.Agent.Copilot.Workspace Umbraco.AI.Agent.Copilot.Workspace/ Add-on (persisted chat + projects)
Umbraco.AI.Prompt Umbraco.AI.Prompt/ Add-on
Umbraco.AI.Search Umbraco.AI.Search/ Add-on
Umbraco.AI.Deploy Umbraco.AI.Deploy/ Deploy
Umbraco.AI.Prompt.Deploy Umbraco.AI.Prompt.Deploy/ Deploy
Umbraco.AI.Agent.Deploy Umbraco.AI.Agent.Deploy/ Deploy
Umbraco.AI.Automate Umbraco.AI.Automate/ Automate
Umbraco.AI.OpenAI Umbraco.AI.OpenAI/ Provider
Umbraco.AI.Anthropic Umbraco.AI.Anthropic/ Provider
Umbraco.AI.Amazon Umbraco.AI.Amazon/ Provider
Umbraco.AI.Google Umbraco.AI.Google/ Provider
Umbraco.AI.MicrosoftFoundry Umbraco.AI.MicrosoftFoundry/ Provider
Umbraco.AI.Mistral Umbraco.AI.Mistral/ Provider
Umbraco.AI.DeepSeek Umbraco.AI.DeepSeek/ Provider
Umbraco.AI.HuggingFace Umbraco.AI.HuggingFace/ Provider
Umbraco.AI.FireworksAI Umbraco.AI.FireworksAI/ Provider
Umbraco.AI.TogetherAI Umbraco.AI.TogetherAI/ Provider
Umbraco.AI.TypeSafe Umbraco.AI.TypeSafe/ Provider
Umbraco.AI.Cloudflare Umbraco.AI.Cloudflare/ Provider
Umbraco.AI.Alibaba Umbraco.AI.Alibaba/ Provider
Umbraco.AI.Moonshot Umbraco.AI.Moonshot/ Provider
Umbraco.AI.OpenRouter Umbraco.AI.OpenRouter/ Provider
Umbraco.AI.ZAI Umbraco.AI.ZAI/ Provider

Dependency Tree

Umbraco.AI (Core)
├── Providers: OpenAI, Anthropic, Amazon, Google, MicrosoftFoundry,
│              Mistral, DeepSeek, HuggingFace, FireworksAI, TogetherAI,
│              TypeSafe, Cloudflare, Alibaba, Moonshot, OpenRouter, ZAI
├── Umbraco.AI.Prompt → Prompt.Deploy (depends on Prompt + Deploy)
├── Umbraco.AI.Agent → Agent.UI → Agent.Copilot
│                     → Agent.Copilot.Workspace (depends on Agent + Umbraco.AI)
│                     → Agent.Deploy (depends on Agent + Deploy)
│                     → Automate (depends on Agent + Automate.Core)
├── Umbraco.AI.Search
└── Umbraco.AI.Deploy

Project Structure Patterns

Core/Add-on packages (Umbraco.AI, Agent, Prompt):

ProductName/
├── src/
│   ├── ProductName.Core/              # Domain models, services, interfaces
│   ├── ProductName.Web/               # Management API
│   ├── ProductName.Web.StaticAssets/Client/  # TypeScript/Lit frontend
│   ├── ProductName.Persistence/       # EF Core DbContext, repositories
│   ├── ProductName.Persistence.SqlServer/   # SQL Server migrations
│   ├── ProductName.Persistence.Sqlite/      # SQLite migrations
│   ├── ProductName.Startup/           # Umbraco Composer for DI
│   └── ProductName/                   # Meta-package
├── tests/ (Unit, Integration, Common)
├── ProductName.slnx
└── CLAUDE.md

Search package (Umbraco.AI.Search) uses Db, Db.SqlServer, Db.Sqlite instead of Persistence.* — these are IAIVectorStore implementations, not domain entity persistence.

Provider packages: Single src/ProviderName/ project + tests/ProviderName.Tests.Unit/.

Core Concepts

  • Providers - AI service plugins (OpenAI, Anthropic, etc.)
  • Connections - API keys and provider settings
  • Profiles - Connection + model settings for use cases
  • Capabilities - Chat, Embedding, etc.

Built on Microsoft.Extensions.AI (M.E.AI), "thin wrapper" philosophy.

Development Environment

Setup

/repo-setup  # First-time: git hooks, demo site, dependencies, build

New worktrees: scripts/worktree-setup.sh copies local, gitignored files (demo site, appsettings.*, .env*, local settings) listed in .worktreeinclude from the main checkout into a worktree. Claude Code's WorktreeCreate hook runs it for you. If another tool made the worktree (e.g. Orca, plain git worktree add), run scripts/worktree-setup.sh from inside the new worktree, then npm install.

Demo Site

Location: demos/vN/Umbraco.AI.DemoSite/ (N = major from Umbraco.Cms.Core lower bound in Directory.Packages.props) | Credentials: admin@example.com / password1234

If demos/vN/ doesn't exist, generate it with scripts/install-demo-site.{sh,ps1} (auto-detects the version from your branch) or run /repo-setup. Do not create demo files by hand.

/demo-site-management start|stop|open|generate-client|status
/demo-site-automation login|navigate-to-connections|create-connection [provider]
  • Path convention: demo sites live under demos/vN/ — one directory per CMS major version line (e.g. demos/v18/, demos/v17/). Never the old top-level demo/. The whole demos/ tree is gitignored and generated per-developer.
  • One DemoSite profile for everyone — each worktree gets its own stable port, assigned once by the Umbraco.Community.WorktreeDevPort NuGet package and stored in a wdp-port file in that worktree's own git dir (git never copies it into new worktrees). The main checkout gets the familiar 44355 when free; other worktrees get the next free port from the pool
  • Port lookup: git wdp-port (the package adds this git alias on first start; empty until the site has run in this worktree)

Worktrees

Skills that make or remove a worktree do it the way this section says, so a different setup only needs changing here.

  • Make one: the EnterWorktree tool. It runs .claude/hooks/worktree-create.sh, which names the branch (vN/topic/<name>; pass v17/<name> to pick a version line), bases it on that line's origin/vN/dev, creates it from the main checkout under .claude/worktrees/, and copies the local files .worktreeinclude lists.
  • Leave or remove one this session entered: the ExitWorktree tool (action: "remove" to delete it). It only works for a worktree this session made with EnterWorktree.
  • Already started inside a worktree made for this work (made by hand, a script or another tool; its branch is named for the work): use it. Don't make another, and don't delete the folder the session runs in. Leave removing it to whatever made it.

Testing provider: Anthropic

When testing against a real AI provider (demo site smoke tests, live checks, Copilot/agent/prompt runs), default to Anthropic unless the task is about a different provider. OpenAI (the openai-demo connection, key Umbraco:AI:Secrets:OpenAIApiKey) is fine as a second provider to cross-check behavior, e.g. to tell a provider-specific bug from a general one, but Anthropic comes first.

  • API keys live only in .NET user secrets, under the demo site's fixed UserSecretsId (d4e8f2a1-6b3c-4e5f-9a8b-7c2d1e4f3a6b, set by scripts/install-demo-site.*). Every demo site and version line shares it, so one key works everywhere.
  • Connections point at the secret with a $ reference, e.g. $Umbraco:AI:Secrets:AnthropicApiKey. Never type, paste or commit a real key.
  • The seed data (scripts/templates/UmbracoAISeedData.cs) creates an anthropic-demo connection on every start if it's missing. Fresh sites use it for the default-chat profile; older sites get an anthropic-chat profile unless they already have a chat profile on that connection. OpenAI stays for embeddings and speech to text.
  • If Anthropic isn't set up, check dotnet user-secrets list --id d4e8f2a1-6b3c-4e5f-9a8b-7c2d1e4f3a6b (look at key names only, never print values). If Umbraco:AI:Secrets:AnthropicApiKey is missing, ask the developer to run dotnet user-secrets set "Umbraco:AI:Secrets:AnthropicApiKey" "<key>" --id d4e8f2a1-6b3c-4e5f-9a8b-7c2d1e4f3a6b. If the connection is missing, restart the demo site so the seed adds it, or create it in the backoffice with the $ reference above.
  • Anything checked in (seed data, scripts, docs) holds only what is safe in an open source repo: secret names, $ references and the UserSecretsId. Never key values.

Package Testing Site

Test deployed packages from different feeds (vs demo site which uses project references):

.\scripts\install-package-test-site.ps1 -Feed nightly|prereleases|release [-SiteName "Name"]
./scripts/install-package-test-site.sh --feed=release --name="Name"  # Linux/Mac

Feeds: nightly (MyGet nightly), prereleases (MyGet pre-release), release (NuGet.org). Sites created in demos/vN/{SiteName} (N = major from Umbraco.Cms.Core lower bound in Directory.Packages.props).

Project Management (Azure DevOps)

Purpose Project Notes
Backlog & Work Items D-Team Tracker AI Team backlog, tag: Umbraco AI
CI/CD Pipelines Umbraco AI

IMPORTANT: Always scope work item searches to AI Team backlog using wit_list_backlog_work_items. The D-Team Tracker project is shared across multiple product teams -- unfiltered searches return cross-product results.

Build Commands

.NET

dotnet build Umbraco.AI.local.slnx          # All products + demo
dotnet build <Product>/<Product>.slnx        # Individual product
dotnet test <Product>/<Product>.slnx         # Run tests

Frontend (npm workspaces)

npm install                  # All workspace dependencies
npm run build                # All frontends (sequential: core -> prompt -> agent -> agent-ui -> copilot)
npm run watch                # All frontends in parallel
npm run generate-client      # OpenAPI clients (requires running demo site)
npm run build:<target>       # Targets: core, prompt, agent, agent-ui, copilot
npm run watch:<target>       # Same targets as build
npm test                     # Vitest, all frontends that have tests
npm run test:<target>        # Targets: core, agent-ui, copilot, copilot-workspace

Add-on packages use workspace:* to reference local core during dev; replaced with actual version on npm pack.

Build core first. @umbraco-ai/core exposes its types via a rollup (types/umbraco-ai-public-types.d.ts) generated by its build:api (api-extractor) step. Until it exists, dependent packages fail to typecheck with TS2307: Cannot find module '@umbraco-ai/core' (cascading into {}-inferred modal types, e.g. TS2339: Property 'selection' does not exist). Always run npm run build:core (or full npm run build) before building/typechecking a dependent package in isolation — these errors mean a stale/missing core rollup, not a code defect.

Restore from the monorepo root, not a nested Client/. Frontend builds resolve deps through npm workspaces. If tsc fails with @umbraco-cms/backoffice type-drift errors (e.g. 'keywords' does not exist in type 'MetaPropertyEditorUi') across many manifest files, suspect stale nested node_modules — run npm install from the repo root to reconcile the workspace before concluding the build is broken. Do not npm install inside an individual src/*/Client/ directory.

Lint & format

Backend follows the root .editorconfig (dotnet format); frontend uses Prettier (.prettierrc). There is no ESLint.

The repo is not clean yet, so check and fix only the files you changed, never the whole repo (a repo-wide reformat clashes with open PRs on every version line):

dotnet format <Product>/<Product>.slnx --verify-no-changes --include <changed files>   # check
dotnet format <Product>/<Product>.slnx --include <changed files>                       # fix
npx prettier --check <changed files>                                                   # check
npx prettier --write <changed files>                                                   # fix

The builder runs the check on its changed files before reporting a task done.

Target Framework & Stack

  • .NET 10.0 (net10.0), Umbraco CMS 18.x, Central Package Management via Directory.Packages.props
  • Frontend: Lit + TypeScript + Vite + @hey-api/openapi-ts
  • Frontend source: src/*/Web.StaticAssets/Client/ -> wwwroot/App_Plugins/
  • Database: SQL Server & SQLite via EF Core; migration prefixes: UmbracoAI_, UmbracoAIPrompt_, UmbracoAIAgent_, UmbracoAISearch_

Key Files

File Purpose
scripts/install-demo-site.{ps1,sh} Create local dev environment
scripts/install-package-test-site.{ps1,sh} Create test site from package feeds
scripts/generate-changelog.{ps1,sh,js} Changelog generation
scripts/generate-release-manifest.{ps1,sh} Release manifest generator
Umbraco.AI.local.slnx Unified solution (generated)
commitlint.config.js Commit validation with dynamic scope loading
release-manifest.json Release pack list (required on vN/release/*, optional on vN/hotfix/*)
<Product>/version.json Per-product version
<Product>/changelog.config.json Per-product scopes for changelog
<Product>/CHANGELOG.md Per-product changelog (auto-generated)

Feature Planning

Each feature gets one folder at docs/plans/<feature-slug>/ — one file per phase (BRIEF.md for the problem/why, ARCHITECTURE.md/SPEC.md for the design, STORIES.md/PLAN.md for the task breakdown, DECISION-LOG.md for dated decisions, BUILD-LOG.md for the build history — use whichever apply). This is a monorepo, but the convention stays flat (no per-product subfolder) — feature slugs are unique enough on their own.

The rest of docs/ is organized by genre, not by product:

Folder Holds
docs/plans/<feature-slug>/ Active feature plans, in the shape above
docs/archive/<feature-slug>/ Plans that are fully shipped, abandoned, or superseded — kept for history, not active work. Each file carries a > **Status:** line explaining why it's archived
docs/reference/ Evergreen concept/how-to docs describing how the system works today (not a plan, nothing to check off)
docs/ideas/ Lightweight, not-yet-scoped ideas — promote to docs/plans/<slug>/BRIEF.md when someone actually starts one

A standing, project-wide architectural decision (an ADR — a call with rejected alternatives and revisit triggers that outlives one feature, e.g. "why we hand-built our own AG-UI protocol") does not get its own docs/ folder — it's a decision-type memory in .claude/memory/ instead. See .claude/memory/README.md for the format.

Multi-Version Support

Umbraco.AI major versions track Umbraco CMS major versions. Multiple versions may be in active support simultaneously, following the Umbraco CMS LTS/EOL policy.

Branch Model

All branches are version-prefixed. The claude/ prefix is exempt (auto-created by Claude Code). There is no separate support/X.x branch — that naming was retired when the repo moved to this vN/-prefixed model (see project_branch_model in memory for the history; a stale reference to support/X.x was found and fixed in the v17 line's copy of this file).

Branch pattern Role
vN/dev Active development for version N
vN/main Last released state for version N
vN/topic/<name> Any work branch (feature, fix, refactor, docs, tooling) targeting version N. vN/feature/<name> is the old name, still accepted for branches opened before the rename
vN/release/<date> Release preparation branch for version N
vN/hotfix/<name> Hotfix branch for version N

Major version cutover: when a new CMS major ships, rename vN/dev → vN/main (archive), then create fresh v(N+1)/dev and v(N+1)/main for the new line.

Support Policy

CMS Phase What to apply
Active support Features + bug fixes
Security phase Security patches only
EOL No updates unless explicitly requested

Current Versions

Check Umbraco CMS LTS/EOL for the latest status.

CMS Version Type Active Support Until AI Branches Current Policy
v18 STS Mar 2027 v18/dev / v18/main Features + bug fixes
v17 LTS Nov 2027 v17/dev / v17/main Features + bug fixes

Keep Active Versions in Sync

A bug fix or feature is developed against one version line but usually applies to every version still in an active phase (see the table above and Umbraco CMS LTS/EOL). Before treating any fix or feature as done, ask whether it should be ported to the other active version(s) and confirm with the user. This applies in both directions — e.g. a fix on v18/dev may need backporting to v17/dev, and a fix on v17/dev may need porting up to v18/dev. Respect each version's phase: security phase → security patches only; EOL → skip unless explicitly requested. Lines are maintained independently (no forward-merge), so port each one via the Backport Workflow below.

This applies to more than code. docs/reference/, docs/ideas/, and .claude/memory/ decisions describe the product's architecture, not the CMS version targeted — they're almost always true on every active line at once. There's no shared/forward-merged copy (same no-forward-merge model as code), so a change to one of these on one line should be treated as a sync candidate too: ask whether it needs porting to the other active line(s), the same as a bug fix. docs/plans/ and docs/archive/ are the exception — feature work is genuinely branch-specific (a feature can ship on one line before the other), so those are expected to differ.

Backport Workflow

Run /umbraco-devkit:change-backport to do a port. It follows the rules below.

When a fix or feature applies to an older supported version:

  1. Branch from vN/dev for the target version line (not from the line you originally fixed), naming it vN/topic/<name> or vN/hotfix/<name>
  2. Apply and commit the change on that branch
  3. Open a PR back into vN/dev (or the relevant vN/release/* branch if it's a hotfix against an in-progress release) — always as a PR, never merged automatically, even when this step is done by an agent
  4. Release via the normal release flow on that branch

Do not forward-merge one version line's branches into another's — each version line is maintained independently. Always create a separate worktree per version line (with an absolute path — see CLAUDE.local.md) rather than reusing one worktree for both; reusing one has caused a worktree to get created nested inside another.

When backporting worktree/tooling config, note that some files hardcode the version line and must be rewritten to the target vN: .worktreeinclude (demo path demos/v18/). Leaving v18 in place makes worktrees use the wrong branch prefix and PRs target the wrong vN/dev base.

Release Management

Skills Overview

Skill Purpose
/release-prepare Full release orchestration: detect changes, recommend bumps, create branch, update versions/manifests/changelogs, commit
/release-manifest-management Generate release-manifest.json only
/changelog-management Generate single product changelog
/release-publish Queue a pipeline run that publishes a pushed branch (release, prerelease or nightly), watch it, confirm tags
/release-cleanup Merge vN/release->vN/main->vN/dev, bump versions on vN/dev, optionally delete branch
/repo-management Interactive menu of all operations

Release Flow

  1. /release-prepare detects changed products since last release tags
  2. Analyzes conventional commits for version bump recommendations
  3. Creates vN/release/YYYY.MM.N branch (calendar-based, N increments per month)
  4. Updates version.json, generates release-manifest.json and CHANGELOG.md files
  5. Commits all changes to release branch
  6. After the push, /release-publish queues the publishing run (prerelease to MyGet to test, then release after approval in Azure)
  7. /release-cleanup merges back and bumps dev versions

Version Bump Logic

BREAKING CHANGE or feat!: -> Major | feat: -> Minor | fix:/perf: -> Patch | docs/chore/refactor only -> Ask user

Major version alignment: Package major versions track the Umbraco CMS major version. All packages ship as 17.x.x for CMS 17, 18.x.x for CMS 18, etc. When preparing a release that spans a CMS major boundary, bump all products to the new major simultaneously — a prep commit on vN/dev sets all version.json files and inter-product ranges in Directory.Packages.props before running /release-prepare.

When bumping Core to new major, the skill checks Directory.Packages.props for dependent add-ons and warns.

Prerelease versioning — always use dotted -{stage}.N

Prerelease identifiers must be dot-separated with a numeric segment: -alpha.1, -beta.1, -rc.1 (→ -beta.2, -beta.10, …).

Never use the non-dotted form (-beta1, -alpha2). NuGet/SemVer treats beta10 as a single alphanumeric identifier and compares it as a string, so it sorts below beta9 ('1' < '9'). The result: a published 1.0.0-beta10 is lower-precedence than 1.0.0-beta9, so --prerelease installs and range resolution silently pick the older build. Dotted -beta.10 compares the 10 numerically and sorts correctly.

Note you cannot retrofit a broken line: -beta.11 (dotted) sorts below an existing non-dotted -beta9 (because identifier beta < beta9). So a line that already shipped non-dotted betas can only be escaped by advancing the stage (-rc.1) or the base version, not by dotifying. Apply the dotted rule to every prerelease line. See [[project_release_tag_sort_prerelease_bug]].

RC / Prerelease Number Bumps

Only advance a prerelease number (-rc.1 → -rc.2, etc.) when a real package was actually published to NuGet.org from that number. Never bump it just because a MyGet nightly build ran, and never skip a number "to be safe." If an RC never went out publicly, reset back to -rc.1 rather than continuing to climb — publishing a gap (e.g. jumping straight to -rc.4) leaves no way to know what -rc.2/-rc.3 were. When in doubt, check whether the specific version actually exists on NuGet.org before bumping.

Release Manifest

On vN/release/* branches, CI requires release-manifest.json:

// Array (legacy): ["Umbraco.AI", "Umbraco.AI.OpenAI"]
// Object (preferred):
{ "include": ["Umbraco.AI"], "exclude": ["Umbraco.AI.Google"] }

CI validates every changed product appears in include or exclude. Unaccounted products fail the build.

On vN/hotfix/* branches: manifest optional (falls back to per-product tag-based change detection).

Hotfix Change Detection

  • Compares each product's folder against its most recent release tag (e.g., Umbraco.AI@1.0.0)
  • Excludes CHANGELOG.md, version.json from diff
  • Falls back to merge-base with vN/main for new products

Post-Release (/release-cleanup)

  1. Merges vN/release/* -> vN/main (no-ff, push), vN/main -> vN/dev (no-ff, push)
  2. Bumps version.json on vN/dev (patch increment, e.g., 1.5.0 -> 1.5.1 so nightlies are 1.5.1--preview.*)
  3. Optionally deletes the release/hotfix branch

CI Artifacts

Artifact Description
all-nuget-packages .nupkg files for NuGet
all-npm-packages .tgz files for npm
pack-manifest Package metadata for git tagging

A push never publishes. To publish, queue the pipeline with "Publish packages to" set (/release-publish): release goes to NuGet.org and npm after approval in the Umbraco AI Release environment, then tags [Product]@[Version] and creates a GitHub release named by publish date. See CONTRIBUTING.md.

Cross-Product Dependency Management

Dependencies managed via Central Package Management (Directory.Packages.props). Always use version ranges for cross-product deps.

Product-level override in <Product>/Directory.Packages.props:

<Project>
  <ItemGroup>
    <PackageVersion Include="Umbraco.AI.Core" Version="[17.0.0, 17.999.999)" />
  </ItemGroup>
</Project>

Format: [min, max) -- inclusive lower, exclusive upper. Use [X.Y.0, X.999.999) to accept all X.x versions from X.Y.0+.

Level File Purpose
Root Directory.Packages.props Default versions for all products
Product <Product>/Directory.Packages.props Override specific ranges
Local dev Project references (UseProjectReferences=true) Bypass NuGet entirely
CI/CD Distribution build (UseProjectReferences=false) Uses NuGet ranges

Rules: Use project refs for local dev. Use [X.Y.0, X.999.999) ranges. Avoid exact versions [X.Y.Z]. Test with UseProjectReferences=false before releasing. When releasing Core with breaking changes, verify dependent products update their minimum.

Pack recompiles against ranges (do not re-add --no-build to ranged packs). The Build stage compiles the whole solution with project references (sibling source). For ranged packs (release/hotfix/main, or packWithNuGetRanges), the shared pack step (devops/monorepo/steps/pack-product-nuget.yml in umbraco/Umbraco.Build) deliberately drops --no-build and recompiles so the shipped binary is validated against the same dependency versions the .nuspec declares — resolved from the LocalCI feed when the dependency was packed in the same run (co-release) or from nuget.org when it was not (solo release). This is what makes a solo release that needs an unpublished dependency API fail the pack instead of silently shipping a binary compiled against a higher version than its declared floor. Project-reference packs (dev previews) keep --no-build since the Build stage already produced those exact binaries.

Intra-Product Dependency Management

Siblings within one product (e.g. Umbraco.AI.Startup → Umbraco.AI.Persistence, or the Umbraco.AI/Umbraco.AI.Agent/Umbraco.AI.Prompt/Umbraco.AI.Search meta-packages → their own *.Startup/*.Web.StaticAssets) always ship from the same version.json, same commit, same release. Unlike cross-product deps, there is never a valid reason for one to resolve to a different version than another — so these need an exact pin, not a range (this is the opposite of the "avoid exact versions" rule above, which is about cross-product deps specifically).

The .csproj files themselves need no special handling — keep using plain <ProjectReference Include="..." /> for siblings, exactly as before. dotnet pack auto-derives a dependency from that ProjectReference, but always as a floor (Version="X" means "X or higher" in a nuspec) — there's no MSBuild/NuGet setting that makes it emit an exact bracket instead. Two mechanisms that look like they'd fix this don't, because a product's whole .slnx (every sibling project) restores and packs in a single dotnet restore/dotnet pack invocation:

  • PackageReference ... VersionOverride="[$(Version)]" — breaks because NuGet restore evaluates VersionOverride before Nerdbank.GitVersioning's version-setting targets run (excluded during restore), so it silently resolves against whatever unrelated package sits at the SDK default 1.0.0 on nuget.org (see dotnet/Nerdbank.GitVersioning#351).
  • Even with the version supplied externally (e.g. -p:Version=...), a real PackageReference to a sibling still can't restore, because that sibling's .nupkg doesn't exist yet — it's part of the same pack invocation that's trying to restore it. Cross-product deps avoid this because they're always satisfied by an earlier pipeline tier that already finished packing; siblings within one product have no such tiering.

The actual fix is a post-pack rewrite: the shared pack stage runs Umbraco.Build's devops/steps/pin-sibling-versions.yml (with projects_dir set to the product's src/) after dotnet pack, which opens each just-packed .nupkg, and for every dependency whose id matches one of this product's own src/* sibling projects, rewrites the already-correct version string from version="X" to version="[X]" directly in the .nuspec entry. The version itself is never recomputed — only its string form changes — so none of the restore-timing or pack-ordering problems above apply.

This gap was found via umbraco/Umbraco.AI#332: before this fix, every intra-product dependency was an implicit NuGet floor (e.g. Umbraco.AI.Startup depending on Umbraco.AI.Persistence >= 17.3.1), so a consumer pinning the outer meta-package while a dependency floor elsewhere pulled a sibling package up produced a half-upgraded install — new server code next to old backoffice JavaScript, or similar mismatches, with no restore warning because no individual rule was technically violated.

Commit Message Format

Conventional Commits: <type>(<scope>): <description>

Rules (enforced by commitlint):

  • Subject must be sentence-case (capitalize first word after scope)
  • Scopes: dynamically loaded from <Product>/changelog.config.json + meta scopes (deps, ci, docs, release). Read commitlint.config.js at runtime -- never use hardcoded lists
  • Multiple comma-separated scopes allowed for unified cross-area changes
  • Body lines max 100 characters
  • To list options: npm run commit-options

Types in changelog: feat, fix, perf, BREAKING CHANGE Types hidden from changelog: refactor, chore, docs, test, ci, build

Commit Type Decision

  1. Breaking API/behavior change? -> feat!: or BREAKING CHANGE: footer
  2. User/developer-visible new feature? -> feat:
  3. User-experienced bug fix? -> fix:
  4. Noticeable performance gain? -> perf:
  5. Code restructuring, no behavior change? -> refactor:
  6. Maintenance (deps, build, tooling)? -> chore:

Batching Guidelines

  • Batch commits that represent one logical feature from user perspective
  • Batch internal steps (DI setup, service integration, tests) into the feature commit
  • Keep separate when changes are logically independent, can be reverted independently, or affect different systems

Generating Changelogs

/release-prepare                    # Generates all changelogs as part of release
/changelog-management                  # Individual product
npm run changelog -- --product=Umbraco.AI --version=1.1.0
npm run changelog -- --product=Umbraco.AI --unreleased

CI validates on release/* and hotfix/*: CHANGELOG.md must exist, be recently updated, and version must match version.json. See CONTRIBUTING.md.

Coding Standards

Async Methods: [Action][Entity]Async

Component Description Examples
Action Verb Get, Create, Update, Delete, Save, Find, List, Validate
Entity Noun Profile, Connection, Prompt, Agent, Context, ChatResponse
Async Suffix Always required

Qualifiers come after entity: GetProfileByAliasAsync, GetAllProfilesAsync, GetPromptsPagedAsync, GetDefaultProfileAsync.

Existence checks: [Entity][Qualifier]ExistsAsync (e.g., ProfileAliasExistsAsync).

Common mistakes to avoid:

  • GetAsync -- missing entity name
  • ProfileExistsAsync -- entity before action
  • GetProfile -- missing Async suffix

Repository Access Pattern

Repositories are internal to their service. Only the entity's own service may access its repository. Other services/controllers must go through the service layer.

Controller/OtherService -> EntityService -> EntityRepository (internal)
  • Services encapsulate business logic, validation, caching
  • Repositories should be internal to persistence assembly

Repository method names use shorter forms (entity implicit): GetByIdAsync, GetByAliasAsync, GetAllAsync, AddAsync, UpdateAsync, DeleteAsync.

Extension Methods

All extension methods in Umbraco.AI.Extensions namespace (or product-specific: Umbraco.AI.Prompt.Extensions).

Public API Backwards Compatibility

Never break a public API. When a new method replaces an old one, keep the old signature and have it proxy to the new method, resolving any new parameters via service locator (e.g. StaticServiceProvider.Instance.GetRequiredService<T>()). Mark the old method [Obsolete] with the message "Will be removed in vX.", where X = highest stable release + 2, the same on every active line (with 18 the highest stable release, that's "Will be removed in v20."; a pre-release major such as a v19 beta doesn't count). Say what replaces it first when there is something ("Use X instead. Will be removed in v20."), and always name a version, never "a future version". If a newer line has already removed the member, name that version instead (the 1.x-era members removed in v19 say "Will be removed in v19." on v17 and v18). This gives consumers at least two major versions to migrate, and keeps a backported obsoletion identical to the original.

Backoffice UI: mirror an existing editor, don't hand-roll

For any create/edit/list/detail surface, use the standard backoffice extension stack — workspaces (<umb-workspace-editor>, workspace views, UmbSubmittableWorkspaceContextBase, UmbSubmitWorkspaceAction), collections, entity actions (UmbEntityActionBase), and umb-property-layout for fields — never hand-rolled editor markup + state. Before writing new editor/list UI, find the nearest existing implementation and mirror it (e.g. the Context/Connection/Profile editors under Umbraco.AI/src/*/Web.StaticAssets/Client/src/**/workspace/). Custom elements are only for genuinely non-standard surfaces (e.g. a chat view) — and even then keep the standard workspace chrome and make only the inner view custom.

Verify, Don't Assert

Before saying a task is done, actually run the relevant build/test command and look at its real output — dotnet build <Product>.slnx for the touched product, or npm run build:<target> for a touched frontend package. Don't report success from reading the diff alone. If a build/test failure looks "unrelated," confirm that by actually running the failing test in isolation or checking it fails the same way on a clean dev checkout — don't wave it away.

Excluded Folders

  • Ref/ - External reference projects
  • Umbraco.AI-entity-snapshot-service/ - Legacy reference

Lessons Learned

  • Never import Lit components by path; export through the barrel chain — see .claude/memory/frontend-entry-points.md for which entry point (app.ts/exports.ts/index.ts/internal-components.ts) a new export belongs in
  • Avoid god objects
  • Provider packages are named after the company (e.g. Umbraco.AI.ZAI, Umbraco.AI.Alibaba), never after the specific model they happen to ship first (e.g. not Umbraco.AI.Qwen) — see the add-provider skill
  • Worktrees pile up because cleanup is easy to forget — ExitWorktree alone does not delete anything (unless given action: "remove"). See CLAUDE.local.md's "Finishing a worktree" section, and actually run /worktree-cleanup or /worktree-merge before considering a worktree task done

Security process

How advisory-fix handles a reported vulnerability in this package.

  • Report a vulnerability to: security@umbraco.dk
  • Reports arrive as: a work item in the InfoSec project on Azure DevOps, which names the GitHub security advisory when there is one
  • Read with: the Azure DevOps MCP server
  • Updates go to: a private Slack channel per advisory, named dxp-security-{ticket}
  • Security team needs: affected and fixed version ranges for each package, and everything gathered for the advisory before release (description and impact, affected and patched versions, workarounds, severity, anything else known); InfoSec uses what they need, including to request the CVE
  • Approves release: the release date is approved in advance; the dev team pushes the release on that date
  • Release timing: InfoSec decides the severity (CVSS 3.1), sometimes asking the team for a view. Critical or High: fix every supported version as soon as possible; a blog post goes out on the Thursday and the release on the following Tuesday, or at once if the issue is under active exploitation. Moderate: fix every supported version within a reasonable time, with a blog post on release day. Low: decide whether to fix; if so, it ships in the next minor, with LTS versions patched the same day, and a short note in the release blog post. If, on a Cloud site with the product installed, the issue could affect Cloud's infrastructure or other sites on the same shared resources, InfoSec invites the Cloud team, who need to know before 14:00 CEST on the Thursday before release.
  • Advisory published by: InfoSec, once the release is out
  • Private fork: GitHub advisory fork

Issue tracker

  • Type: GitHub Issues
  • Location: umbraco/Umbraco.AI (same repo as the source code)
  • Access: gh CLI (e.g. gh issue view <n> --repo umbraco/Umbraco.AI)
  • Triage log: docs/triage/TRIAGE-LOG.md
  • State labels: default (state/needs-investigation, state/needs-info, state/needs-decision, state/blocked, state/ready), plus the team's own state/sprint-candidate
  • Type labels: default
  • Feature requests: GitHub Discussions, Ideas category
  • Needs-info timeout: 30 days

Bugs and user-reported issues go here. The Azure DevOps AI Team backlog (see Project Management above) is for internal planning, not issue triage.

Docs

Where this package's user docs live. major-upgrade reads this to find the pages an upgrade makes wrong.

  • Where: the umbraco/UmbracoDocs repo (never in this repo)
  • Versions: one copy per CMS major, at <major>/ai-in-umbraco/ (e.g. 18/ai-in-umbraco/, 17/ai-in-umbraco/)
  • Submitting: a PR to the docs repo, separate from the code PR

A local clone's path is personal, so it goes in CLAUDE.local.md as Umbraco docs source: <path>.

Feature workflow

This project uses the Umbraco Devkit. Plan, archive and ideas folders follow "Feature Planning" above.

Pipeline: /feature-explore → /feature-design → /feature-plan → /feature-build, then /feature-close once the PR is merged or the plan is dropped.

Branch/worktree per feature: new features start from the vN/dev line they target (v18/dev by default). Plan files stay uncommitted until feature-build starts, which commits them and cuts the worktree. The WorktreeCreate hook in .claude/settings.json picks the real branch name (vN/topic/<name>) and location.

Finding the current plan folder: strip the vN/topic/ (or old vN/feature/) prefix from the branch name and look for a matching docs/plans/<name>/. Ask only if nothing matches.