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 GitHubmelodic-software/claude-code-plugins
content-management-system
plugins/content-management-system/skills/content-relationships/SKILL.md
January 21, 2026
Select agents to install to:
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-relationshipsInstallation paths:
.claude/skills/content-relationships/# 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; }