TV Show Data Validator
This skill helps validate TV show data against FanHub's domain rules and business logic. It ensures data integrity across the shows, characters, episodes, and quotes that make up the FanHub application.
When to Use This Skill
Use this skill when:
- Creating or updating TV show data
- Validating data imports or migrations
- Writing tests that need valid test data
- Reviewing data integrity issues
- Building features that work with the TV show domain model
FanHub Data Model
Entity Relationships
Shows (1) ─────────────────────────> (N) Seasons
│ │
│ v
│─────────────────────────────────> (N) Episodes
│ │
│ │
└─────> (N) Characters <────────────────┘
│ (many-to-many)
│
v
(N) Quotes ─────────────> Episodes
Core Entities
Shows
- Required fields:
title, start_year
- Optional fields:
end_year, genre, description, network, status
- Constraints:
title must be unique
start_year must be between 1950 and current year
end_year must be >= start_year (if provided)
status must be: 'running', 'ended', 'cancelled', or 'upcoming'
Characters
- Required fields:
name, show_id
- Optional fields:
actor_name, status, bio, is_main_character
- Constraints:
name + show_id must be unique (no duplicate characters per show)
status must be: 'alive', 'deceased', or 'unknown'
bio should not exceed 2000 characters
show_id must reference an existing show
Episodes
- Required fields:
title, show_id, season_number, episode_number
- Optional fields:
air_date, synopsis, runtime_minutes, director, writer
- Constraints:
show_id + season_number + episode_number must be unique
season_number must be >= 1
episode_number must be >= 1
runtime_minutes should be between 1 and 300
air_date should not be in the future (unless show status is 'upcoming')
Quotes
- Required fields:
quote_text, show_id
- Optional fields:
character_id, episode_id, speaker_context
- Constraints:
character_id must reference an existing character (if provided)
episode_id must reference an existing episode (if provided)
quote_text should not exceed 1000 characters
- If
character_id is provided, character must belong to the same show
Validation Rules
Cross-Entity Validation
Character-Show Consistency
INVALID: Character references show_id=5, but that show doesn't exist
VALID: Character's show_id matches an existing show
Quote-Character Consistency
INVALID: Quote has show_id=1 but character_id references character from show_id=2
VALID: Quote's character belongs to the same show as the quote
Episode-Season Consistency
INVALID: Episode references season_number=3 but show only has 2 seasons
VALID: Episode's season exists for that show
No Duplicate Characters Per Show
INVALID: Two characters named "Walter White" in Breaking Bad
VALID: "Walter White" in Breaking Bad and "Walter White" in a different show
Data Quality Rules
Related Characters
- Related characters should never include duplicates from the same show
- A character cannot be related to themselves
- Related character relationships should be bidirectional
Episode Ordering
- Episodes within a season use sequential episode numbers
- No gaps in episode numbering (1, 2, 3... not 1, 3, 5)
- Season numbers should be sequential (1, 2, 3... not 1, 3)
Quote Attribution
- Quotes with
character_id require proper attribution
- Quotes without
character_id require speaker_context for context
- Famous quotes should be verified for accuracy
Validation Examples
Valid Data
{
"show": {
"title": "Breaking Bad",
"start_year": 2008,
"end_year": 2013,
"status": "ended",
"genre": "Drama"
},
"character": {
"name": "Walter White",
"show_id": 1,
"actor_name": "Bryan Cranston",
"status": "deceased",
"is_main_character": true
},
"episode": {
"title": "Pilot",
"show_id": 1,
"season_number": 1,
"episode_number": 1,
"air_date": "2008-01-20",
"runtime_minutes": 58
},
"quote": {
"quote_text": "I am the one who knocks!",
"show_id": 1,
"character_id": 1,
"episode_id": 35
}
}
Invalid Data (with explanations)
{
"character": {
"name": "Jesse Pinkman",
"show_id": 1,
"status": "retired" // ❌ Invalid status - must be alive/deceased/unknown
},
"episode": {
"title": "Future Episode",
"show_id": 1,
"season_number": 1,
"episode_number": 1,
"air_date": "2099-01-01" // ❌ Future date for ended show
},
"quote": {
"quote_text": "Famous quote",
"show_id": 1,
"character_id": 999 // ❌ References non-existent character
}
}
Common Validation Scenarios
Scenario 1: Importing Show Data
When importing TV show data from external sources:
- Validate show exists or create it first
- Create seasons in order
- Create episodes with valid season references
- Create characters with valid show references
- Create quotes with valid character AND episode references
Scenario 2: Character Detail Feature
When building character detail pages:
- Verify character exists and belongs to valid show
- Related characters should not include duplicates
- Related characters must belong to the same show
- All linked quotes must reference valid episodes
- Episode appearances should be in chronological order
Scenario 3: Episode Detail Feature
When building episode detail pages:
- Verify episode exists with valid show/season
- Character appearances must all belong to the episode's show
- Quotes must reference this specific episode
- Previous/next episode links must be valid
Integration with Other Skills
This skill works alongside:
- bug-reproduction-test-generator: Provides schema knowledge for writing valid test data
- feature-requirements: Ensures features respect data model constraints
- effort-estimator: Understanding data complexity informs effort estimates
When NOT to Use This Skill
Don't use this skill for:
- General code style or formatting questions
- Non-FanHub domain data validation
- Authentication or authorization logic
- Performance optimization
1---2name: tv-show-data-validator3description: Validates TV show data against FanHub's domain rules. Use when working with show, character, episode, or quote data to ensure data integrity and business rule compliance.4---56# TV Show Data Validator78This skill helps validate TV show data against FanHub's domain rules and business logic. It ensures data integrity across the shows, characters, episodes, and quotes that make up the FanHub application.910## When to Use This Skill1112Use this skill when:1314- Creating or updating TV show data15- Validating data imports or migrations16- Writing tests that need valid test data17- Reviewing data integrity issues18- Building features that work with the TV show domain model1920## FanHub Data Model2122### Entity Relationships2324```25Shows (1) ─────────────────────────> (N) Seasons26 │ │27 │ v28 │─────────────────────────────────> (N) Episodes29 │ │30 │ │31 └─────> (N) Characters <────────────────┘32 │ (many-to-many)33 │34 v35 (N) Quotes ─────────────> Episodes36```3738### Core Entities3940#### Shows4142- **Required fields**: `title`, `start_year`43- **Optional fields**: `end_year`, `genre`, `description`, `network`, `status`44- **Constraints**:45 - `title` must be unique46 - `start_year` must be between 1950 and current year47 - `end_year` must be >= `start_year` (if provided)48 - `status` must be: 'running', 'ended', 'cancelled', or 'upcoming'4950#### Characters5152- **Required fields**: `name`, `show_id`53- **Optional fields**: `actor_name`, `status`, `bio`, `is_main_character`54- **Constraints**:55 - `name` + `show_id` must be unique (no duplicate characters per show)56 - `status` must be: 'alive', 'deceased', or 'unknown'57 - `bio` should not exceed 2000 characters58 - `show_id` must reference an existing show5960#### Episodes6162- **Required fields**: `title`, `show_id`, `season_number`, `episode_number`63- **Optional fields**: `air_date`, `synopsis`, `runtime_minutes`, `director`, `writer`64- **Constraints**:65 - `show_id` + `season_number` + `episode_number` must be unique66 - `season_number` must be >= 167 - `episode_number` must be >= 168 - `runtime_minutes` should be between 1 and 30069 - `air_date` should not be in the future (unless show status is 'upcoming')7071#### Quotes7273- **Required fields**: `quote_text`, `show_id`74- **Optional fields**: `character_id`, `episode_id`, `speaker_context`75- **Constraints**:76 - `character_id` must reference an existing character (if provided)77 - `episode_id` must reference an existing episode (if provided)78 - `quote_text` should not exceed 1000 characters79 - If `character_id` is provided, character must belong to the same show8081## Validation Rules8283### Cross-Entity Validation84851. **Character-Show Consistency**8687 ```88 INVALID: Character references show_id=5, but that show doesn't exist89 VALID: Character's show_id matches an existing show90 ```91922. **Quote-Character Consistency**9394 ```95 INVALID: Quote has show_id=1 but character_id references character from show_id=296 VALID: Quote's character belongs to the same show as the quote97 ```98993. **Episode-Season Consistency**100101 ```102 INVALID: Episode references season_number=3 but show only has 2 seasons103 VALID: Episode's season exists for that show104 ```1051064. **No Duplicate Characters Per Show**107 ```108 INVALID: Two characters named "Walter White" in Breaking Bad109 VALID: "Walter White" in Breaking Bad and "Walter White" in a different show110 ```111112### Data Quality Rules1131141. **Related Characters**115 - Related characters should never include duplicates from the same show116 - A character cannot be related to themselves117 - Related character relationships should be bidirectional1181192. **Episode Ordering**120 - Episodes within a season use sequential episode numbers121 - No gaps in episode numbering (1, 2, 3... not 1, 3, 5)122 - Season numbers should be sequential (1, 2, 3... not 1, 3)1231243. **Quote Attribution**125 - Quotes with `character_id` require proper attribution126 - Quotes without `character_id` require `speaker_context` for context127 - Famous quotes should be verified for accuracy128129## Validation Examples130131### Valid Data132133```json134{135 "show": {136 "title": "Breaking Bad",137 "start_year": 2008,138 "end_year": 2013,139 "status": "ended",140 "genre": "Drama"141 },142 "character": {143 "name": "Walter White",144 "show_id": 1,145 "actor_name": "Bryan Cranston",146 "status": "deceased",147 "is_main_character": true148 },149 "episode": {150 "title": "Pilot",151 "show_id": 1,152 "season_number": 1,153 "episode_number": 1,154 "air_date": "2008-01-20",155 "runtime_minutes": 58156 },157 "quote": {158 "quote_text": "I am the one who knocks!",159 "show_id": 1,160 "character_id": 1,161 "episode_id": 35162 }163}164```165166### Invalid Data (with explanations)167168```json169{170 "character": {171 "name": "Jesse Pinkman",172 "show_id": 1,173 "status": "retired" // ❌ Invalid status - must be alive/deceased/unknown174 },175 "episode": {176 "title": "Future Episode",177 "show_id": 1,178 "season_number": 1,179 "episode_number": 1,180 "air_date": "2099-01-01" // ❌ Future date for ended show181 },182 "quote": {183 "quote_text": "Famous quote",184 "show_id": 1,185 "character_id": 999 // ❌ References non-existent character186 }187}188```189190## Common Validation Scenarios191192### Scenario 1: Importing Show Data193194When importing TV show data from external sources:1951961. Validate show exists or create it first1972. Create seasons in order1983. Create episodes with valid season references1994. Create characters with valid show references2005. Create quotes with valid character AND episode references201202### Scenario 2: Character Detail Feature203204When building character detail pages:2052061. Verify character exists and belongs to valid show2072. Related characters should not include duplicates2083. Related characters must belong to the same show2094. All linked quotes must reference valid episodes2105. Episode appearances should be in chronological order211212### Scenario 3: Episode Detail Feature213214When building episode detail pages:2152161. Verify episode exists with valid show/season2172. Character appearances must all belong to the episode's show2183. Quotes must reference this specific episode2194. Previous/next episode links must be valid220221## Integration with Other Skills222223This skill works alongside:224225- **bug-reproduction-test-generator**: Provides schema knowledge for writing valid test data226- **feature-requirements**: Ensures features respect data model constraints227- **effort-estimator**: Understanding data complexity informs effort estimates228229## When NOT to Use This Skill230231Don't use this skill for:232233- General code style or formatting questions234- Non-FanHub domain data validation235- Authentication or authorization logic236- Performance optimization