
tv-show-data-validator
by MSBart2
repo for training labs/exercises/walk-throughs
SKILL.md
name: tv-show-data-validator description: 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. level: 2
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:
titlemust be uniquestart_yearmust be between 1950 and current yearend_yearmust be >=start_year(if provided)statusmust be: 'running', 'ended', 'cancelled', or 'upcoming'
Characters
- Required fields:
name,show_id - Optional fields:
actor_name,status,bio,is_main_character - Constraints:
name+show_idmust be unique (no duplicate characters per show)statusmust be: 'alive', 'deceased', or 'unknown'bioshould not exceed 2000 charactersshow_idmust 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_numbermust be uniqueseason_numbermust be >= 1episode_numbermust be >= 1runtime_minutesshould be between 1 and 300air_dateshould 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_idmust reference an existing character (if provided)episode_idmust reference an existing episode (if provided)quote_textshould not exceed 1000 characters- If
character_idis 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 should have 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_idshould have proper attribution - Quotes without
character_idshould havespeaker_contextfor context - Famous quotes should be verified for accuracy
- Quotes with
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
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon