xiaohongshu
xiaohongshu
case-study-generator
This skill generates case study entries for intelligent textbook projects from GitHub repositories. Use this skill when adding a new case study to the case studies index page, when the user provides a GitHub repo URL and wants to create a case study card entry. The skill handles repo analysis, th...
Full skill instructions
This skill automates the creation of case study entries for the intelligent textbooks case studies page. Given a GitHub repository URL, it extracts project information, generates or processes a thumbnail image compressed to ~70KB, and creates a properly formatted markdown entry for docs/case-studies/index.md.
Extract the following from the GitHub repository:
dmccreary/geometry-course)https://{username}.github.io/{repo-name}find docs -type f -name "*.md" | wc -lfind docs -type f -name "*.md" -exec cat {} \; | wc -wdocs/sims/docs/glossary.md if existsUse the gh CLI or direct GitHub API to fetch repository information:
# Get repo description
gh repo view {owner}/{repo} --json description
# Clone repo temporarily for analysis
gh repo clone {owner}/{repo} /tmp/{repo} -- --depth 1
Check for existing thumbnail options in priority order:
docs/img/ for social-card.png or similarPlace the source image in docs/case-studies/img/ with a filename matching the repo name:
geometry-course.jpg, deep-learning-course.jpgCompress the thumbnail to approximately 70KB for fast page loading.
Run the thumbnail compression script:
python3 src/compress-thumbnails.py docs/case-studies/img 70
This script:
.backup files for safetyIf PNG compression cannot achieve 70KB target, convert to JPEG:
python3 src/convert-png-to-jpg.py docs/case-studies/img 70
This script:
For compressing a single new image without affecting others:
from PIL import Image, ImageOps
def compress_single_image(input_path, output_path, target_kb=70, min_width=400):
"""Compress a single image to target size."""
img = Image.open(input_path)
img = ImageOps.exif_transpose(img)
# Convert to RGB for JPEG
if img.mode in ('RGBA', 'LA', 'P'):
background = Image.new('RGB', img.size, (255, 255, 255))
if img.mode == 'P':
img = img.convert('RGBA')
if img.mode in ('RGBA', 'LA'):
background.paste(img, mask=img.split()[-1])
img = background
elif img.mode != 'RGB':
img = img.convert('RGB')
# Calculate resize factor
orig_w, orig_h = img.size
min_factor = min_width / orig_w if orig_w > min_width else 1.0
for factor in [0.5, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15]:
if factor < min_factor:
continue
new_w = int(orig_w * factor)
new_h = int(orig_h * factor)
resized = img.resize((new_w, new_h), Image.Resampling.LANCZOS)
for quality in [85, 80, 75, 70, 65, 60]:
resized.save(output_path, "JPEG", quality=quality, optimize=True)
if os.path.getsize(output_path) / 1024 <= target_kb:
return True
return False
After converting PNG to JPEG, update docs/case-studies/index.md to use the new .jpg extension:
# Before

# After

Create the markdown entry using the format in references/entry-format.md.
- **[Project Title](https://username.github.io/repo-name)**

Brief 1-2 sentence description of the project, its purpose, and target audience.
[:octicons-mark-github-16: Repository](https://github.com/username/repo-name) · XX Files · XXK Words · X MicroSims
·
Insert the new entry into docs/case-studies/index.md in alphabetical order by project title. The entries are inside a <div class="grid cards grid-3-col" markdown> block.
mkdocs serve and check the case studies pagerm docs/case-studies/img/*.backup
rm -rf /tmp/{repo-name}
User request: "Add a case study for https://github.com/dmccreary/systems-thinking"
Process:
docs/case-studies/img/systems-thinking.jpg (~31KB)- **[Systems Thinking in the Age of AI](https://dmccreary.github.io/systems-thinking)**

Interactive resources for teaching systems thinking from high school to executive level. Multiple course descriptions.
[:octicons-mark-github-16: Repository](https://github.com/dmccreary/systems-thinking) · MicroSims included
mkdocs serveThe following scripts are located in the project's src/ directory:
src/compress-thumbnails.py - Compresses images to target KB size with configurable minimum widthsrc/convert-png-to-jpg.py - Converts PNG files to JPEG format for better compressionreferences/entry-format.md - Template and examples for case study entriesxiaohongshu
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