umbraco-repository-pattern

Guide repository-based data operations in the Umbraco backoffice with OpenAPI clients.

4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/albanistrefi/umbraco_CLI --skill umbraco-repository-pattern-albanistrefi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: umbraco-repository-pattern
Source: https://github.com/albanistrefi/umbraco_CLI/tree/main/skills/foundation/umbraco-repository-pattern
Command: npx skills add https://github.com/albanistrefi/umbraco_CLI --skill umbraco-repository-pattern-albanistrefi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the confusion and maintenance risk of mixing backoffice UI logic with direct data access by giving you a consistent repository/data-source structure.

Core Features & Use Cases

  • Clean separation of concerns: isolate business operations in a repository while delegating actual I/O to a data source.
  • Scalable integration patterns: plug repositories into server, offline, store, and Signal-R backed approaches without changing consumers.
  • Auth-safe API access guidance: provides a hard rule to avoid raw fetch calls and use the generated OpenAPI client with Umbraco auth context.

Use case examples:

  • Implement a CRUD repository for a custom backoffice feature that needs predictable data operations and small, context-window-friendly responses.
  • Create a tree repository that exposes root items, children, and ancestors while hiding the underlying data mechanism.
  • Coordinate repository + data source + store + context so UI components only observe state changes.

Quick Start

Use the umbraco-repository-pattern skill to design a repository, data source, and context for your custom backoffice data model, following the provided documentation links and the rule to use the generated OpenAPI client for authenticated calls.

Frequently Asked Questions about umbraco-repository-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure data access in the Umbraco backoffice without mixing UI logic?

Use the repository pattern to isolate business operations in a repository while delegating I/O to a data source, ensuring Umbraco backoffice UI components interact only through standardized repository methods.

Why should I use the OpenAPI client instead of raw fetch for Umbraco backoffice data?

Using the generated OpenAPI client ensures authenticated API access within the Umbraco auth context, avoiding the security risks and maintenance issues associated with raw fetch calls.

How do I build a tree repository for a custom Umbraco backoffice feature?

Create a tree repository that exposes root items, children, and ancestors while hiding the underlying data mechanism, coordinating the repository with its data source and state context.

Does the Umbraco repository pattern support offline and SignalR backed data sources?

Yes, the repository pattern allows plugging repositories into server, offline, store, and SignalR backed data sources without changing the consumers that observe state changes.

What is the best way to coordinate repository, data source, and store in Umbraco?

Coordinate repository, data source, store, and context so UI components only observe state changes, providing clean separation of concerns and scalable integration patterns for custom features.