xiaohongshu
xiaohongshu
managing-fighter-images
Use this skill when working with UFC fighter images including downloading from multiple sources (Wikimedia, Sherdog, Bing), detecting and replacing placeholder images, handling duplicates, normalizing image sizes, validating image quality, syncing filesystem to database, or running the complete i...
Full skill instructions
You are an expert at managing the UFC Pokedex fighter image pipeline, which involves downloading, validating, normalizing, and maintaining fighter photos from multiple sources.
The image pipeline supports multiple sources with priority ordering:
Wikimedia Commons (legal, ~20% coverage)
↓ (if not found)
Sherdog (high UFC coverage, requires mapping)
↓ (if not found)
Bing Image Search (fallback)
↓
Database update → Normalization → Validation
Invoke this skill when the user wants to:
Coverage: ~20% of UFC fighters Legal Status: ✅ Public domain / Creative Commons Quality: High (official UFC or press photos)
Use for:
Coverage: High for UFC fighters Legal Status: ⚠️ Fair use (third-party site) Quality: Variable, includes placeholders
Note: Requires fighter ID mapping in data/sherdog_id_mapping.json
Known issue: ~266+ placeholder images (generic silhouette)
Coverage: Universal fallback Legal Status: ⚠️ Varies by source Quality: Variable
Use for:
Complete workflow for downloading images from Sherdog.
Command:
make sherdog-workflow
Interactive steps:
Expected duration: 30-60 minutes (manual review required)
Output:
data/sherdog_id_mapping.json - Fighter to Sherdog ID mappingdata/images/fighters/*.jpg - Downloaded imagesTries multiple sources automatically in priority order.
Command:
make scrape-images-orchestrator
What it does:
Best for: Bulk image acquisition with automatic fallback
Command:
make scrape-images-wikimedia
What it does:
Use when:
Command:
make update-fighter-images
What it does:
Prerequisite: Sherdog mapping must exist (data/sherdog_id_mapping.json)
Sherdog uses generic placeholder images for some fighters.
Command:
make detect-placeholders
What it does:
Output: List of fighter IDs with placeholder images
Replace Sherdog placeholders with Bing image search results.
Command options:
# Replace batch of 50 placeholders
make replace-placeholders
# Replace ALL placeholders (may take 1+ hours)
make replace-placeholders-all
What it does:
Use when:
After replacing placeholders, verify the new images.
Command:
make verify-replacement
What it does:
Some fighters may have duplicate/similar images.
Command:
make review-duplicates
What it does:
Use when:
Standardize all images to consistent format and size.
Command options:
# Preview normalization (dry-run)
make normalize-images-dry-run
# Apply normalization
make normalize-images
What it does:
Use when:
Run quality checks on all fighter images.
Command:
make validate-images
What it does:
Use when:
Sync filesystem images with database records.
Command:
make sync-images-to-db
What it does:
data/images/fighters/ directoryUse when:
Preview recently downloaded images.
Command:
make review-recent-images
What it does:
Use when:
Remove specific images and reset database records.
Command:
make remove-bad-images
⚠️ WARNING: This command requires manual editing of the script first!
What it does:
Use when:
Important: Edit scripts/remove_bad_images.py to specify fighter IDs before running!
Use this to maximize image coverage from all sources.
Steps:
# 1. Check current status
PGPASSWORD=ufc_pokedex psql -h localhost -U ufc_pokedex -d ufc_pokedex -c \
"SELECT
COUNT(*) FILTER (WHERE image_url IS NOT NULL) as with_images,
COUNT(*) FILTER (WHERE image_url IS NULL) as without_images,
COUNT(*) as total
FROM fighters;"
# 2. Try Wikimedia first (legal, high-quality)
make scrape-images-wikimedia
# 3. Run multi-source orchestrator for remainder
make scrape-images-orchestrator
# 4. If still have gaps, run Sherdog workflow
make sherdog-workflow
# 5. Detect and replace Sherdog placeholders
make detect-placeholders
make replace-placeholders-all
# 6. Normalize all images to consistent format
make normalize-images-dry-run # Preview first
make normalize-images # Apply
# 7. Validate everything
make validate-images
# 8. Sync to database
make sync-images-to-db
# 9. Review recent downloads
make review-recent-images
# 10. Check final status
PGPASSWORD=ufc_pokedex psql -h localhost -U ufc_pokedex -d ufc_pokedex -c \
"SELECT
COUNT(*) FILTER (WHERE image_url IS NOT NULL) as with_images,
COUNT(*) FILTER (WHERE image_url IS NULL) as without_images,
ROUND(100.0 * COUNT(*) FILTER (WHERE image_url IS NOT NULL) / COUNT(*), 1) as coverage_percent
FROM fighters;"
Expected duration: 2-4 hours total Expected coverage: 80-95% of fighters
Use this to improve image quality after initial scraping.
Steps:
# 1. Detect Sherdog placeholders
make detect-placeholders
# 2. Review report
cat data/placeholder_report.json # or wherever report is saved
# 3. Replace placeholders (batch of 50)
make replace-placeholders
# 4. Verify replacements
make verify-replacement
# 5. Repeat until all placeholders replaced
make replace-placeholders-all
# 6. Normalize replaced images
make normalize-images
# 7. Validate quality
make validate-images
Use this for maintenance and quality improvement.
Steps:
# 1. Find and review duplicates
make review-duplicates
# 2. Validate all images
make validate-images
# 3. Normalize inconsistent images
make normalize-images-dry-run # Check what will change
make normalize-images # Apply changes
# 4. Sync database to match filesystem
make sync-images-to-db
# 5. Remove any bad images (edit script first!)
# Edit scripts/remove_bad_images.py with fighter IDs
make remove-bad-images
# 6. Re-download removed images
make scrape-images-orchestrator
Location: data/images/fighters/
Naming convention: {fighter_id}.jpg
Format requirements:
Database field: fighters.image_url stores relative path (e.g., /images/fighters/{id}.jpg)
SELECT
COUNT(*) FILTER (WHERE image_url IS NOT NULL) as with_images,
COUNT(*) FILTER (WHERE image_url IS NULL) as without_images,
ROUND(100.0 * COUNT(*) FILTER (WHERE image_url IS NOT NULL) / COUNT(*), 1) as coverage_percent
FROM fighters;
SELECT id, name, nickname, division
FROM fighters
WHERE image_url IS NULL
ORDER BY name
LIMIT 20;
SELECT id, name, image_url
FROM fighters
WHERE image_url IS NOT NULL
ORDER BY created_at DESC
LIMIT 20;
SELECT id, name, image_url
FROM fighters
WHERE image_url LIKE '%placeholder%';
Solution: Run the Sherdog workflow first to create the mapping:
make sherdog-workflow
Expected: Only ~20% coverage from Wikimedia Solution: This is normal. Use multi-source orchestrator or Sherdog workflow for better coverage.
Solution: Replace placeholders with Bing search:
make detect-placeholders
make replace-placeholders-all
Solution: Normalize all images to 300x300:
make normalize-images
Solution: Sync database to filesystem:
make sync-images-to-db
Solution:
scripts/remove_bad_images.py with fighter IDmake remove-bad-imagesmake scrape-images-orchestratorSolution:
make review-duplicates
# Follow interactive prompts to remove duplicates
Solution:
# Check validation report
make validate-images
# Remove invalid images (edit script first)
# Edit scripts/remove_bad_images.py
make remove-bad-images
# Re-download
make scrape-images-orchestrator
✅ Clear face visible ✅ Official UFC photo or press photo ✅ Professional quality ✅ Good lighting ✅ At least 300x300 resolution ✅ JPEG format
❌ Blurry or low resolution ❌ Face obscured or cut off ❌ Action shots where face not clear ❌ Wrong person ❌ Generic placeholder ❌ Copyright watermarks ❌ Non-square aspect ratio (before normalization)
# Watch image count grow
watch -n 5 'ls data/images/fighters/*.jpg 2>/dev/null | wc -l'
# Check database count
watch -n 5 'psql -U ufc_pokedex -d ufc_pokedex -tAc "SELECT COUNT(*) FROM fighters WHERE image_url IS NOT NULL;"'
Most scripts output progress to console. Watch for:
# Complete image pipeline
make scrape-images-wikimedia && \
make scrape-images-orchestrator && \
make detect-placeholders && \
make replace-placeholders-all && \
make normalize-images && \
make validate-images && \
make sync-images-to-db
# Check coverage
psql -U ufc_pokedex -d ufc_pokedex -c "SELECT COUNT(*) FILTER (WHERE image_url IS NOT NULL) * 100.0 / COUNT(*) as coverage_pct FROM fighters;"
# Quick status
ls data/images/fighters/*.jpg | wc -l # File count
scraping-data-pipeline skill for scraping fighter datamanaging-dev-environment skill for database setupxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience