Back to Skills

content-relationships

verified

Use when designing references between content items, content picker fields, many-to-many relationships, or bidirectional links. Covers relationship types, reference integrity, eager/lazy loading, and relationship APIs for headless CMS.

View on GitHub

Marketplace

melodic-software

melodic-software/claude-code-plugins

Plugin

content-management-system

Repository
Verified Org

melodic-software/claude-code-plugins
13stars

plugins/content-management-system/skills/content-relationships/SKILL.md

Last Verified

January 21, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/melodic-software/claude-code-plugins/blob/main/plugins/content-management-system/skills/content-relationships/SKILL.md -a claude-code --skill content-relationships

Installation paths:

Claude
.claude/skills/content-relationships/
Powered by add-skill CLI

Instructions

# Content Relationships

Guidance for designing and implementing relationships between content items in headless CMS architectures.

## When to Use This Skill

- Adding content picker fields to content types
- Designing author-article relationships
- Implementing related content features
- Building content hierarchies (parent/child pages)
- Managing bidirectional relationships
- Handling reference integrity on delete

## Relationship Types

### One-to-Many (Parent Reference)

```csharp
// Article has one Author
public class Article
{
    public Guid Id { get; set; }
    public string Title { get; set; } = string.Empty;

    // Foreign key to Author
    public Guid AuthorId { get; set; }
    public Author? Author { get; set; }
}

public class Author
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;

    // Navigation property (inverse)
    public List<Article> Articles { get; set; } = new();
}
```

### Many-to-Many (Junction Table)

```csharp
// Article has many Categories, Category has many Articles
public class Article
{
    public Guid Id { get; set; }
    public string Title { get; set; } = string.Empty;
    public List<ArticleCategory> ArticleCategories { get; set; } = new();
}

public class Category
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public List<ArticleCategory> ArticleCategories { get; set; } = new();
}

public class ArticleCategory
{
    public Guid ArticleId { get; set; }
    public Article Article { get; set; } = null!;

    public Guid CategoryId { get; set; }
    public Category Category { get; set; } = null!;

    // Optional: relationship metadata
    public int Order { get; set; }
    public bool IsPrimary { get; set; }
}

// EF Core configuration
modelBuilder.Entity<ArticleCategory>()
    .HasKey(ac => new { ac.ArticleId, ac.CategoryId });
```

### Self-Referential (Hierarchy)

```csharp
// Page hierarchy
public class Page
{
    public Guid Id { get; set; }

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
8676 chars