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…
от dmccreary★ 38 звёзд на GitHubОб этом скилле
Case Study Generator
Overview
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.
Workflow
Step 1: Gather Repository Information
Extract the following from the GitHub repository:
- Repository URL - The full GitHub URL provided by the user
- Repository name - Extract from URL (e.g.,
dmccreary/geometry-course) - GitHub Pages URL - Derive from repo:
https://{username}.github.io/{repo-name} - Project title - Check for a clear title in README.md or use repo name
- Description - Extract from README.md (first paragraph or project description)
- Metrics — ALWAYS check for
{BOOK_BASE}/docs/learning-graph/book-metrics.jsonfirst, in every repo, whether you're adding a brand-new case study or refreshing an existing one. Do not re-count by hand if this file exists.Canonical source:
docs/learning-graph/book-metrics.json(produced by the book-metrics tool, validated againstbook-metrics.schema.json). Itsmetricsobject is the single source of truth shared with the README and LinkedIn skills, so the case-study card shows identical numbers:# After cloning/locating the repo for analysis: python3 -c "import json; m=json.load(open('docs/learning-graph/book-metrics.json'))['metrics']; \ print(m['concepts'], m['chapters'], m['microsims'], m['glossaryTerms'], m['faqs'], m['words'])"Available keys include
concepts,chapters,microsims,stories,glossaryTerms,faqs,quizQuestions,references,diagrams,equations,words,links,equivalentPages,developmentStage.If working from a local workspace clone (
~/Documents/ws/{repo-name}), check whether it's behindorigin/mainbefore trusting this file — a stale checkout reports stale metrics:git rev-list --left-right --count HEAD...origin/main # "0 N" = N commits behindIf it's behind and the working tree is clean, just
git pull. If there are uncommitted local changes, don't discard them —git stash push -u, pull, readbook-metrics.json, thengit stash popto restore the local work exactly as it was.When updating an already-listed case study, re-read this file rather than reusing the numbers already on the card — the file exists precisely because a book's metrics change between visits, so treat the existing card's numbers as stale until confirmed otherwise.
Fallback only if
book-metrics.jsonis absent:- File count:
find docs -type f -name "*.md" | wc -l - Word count:
find docs -type f -name "*.md" -exec cat {} \; | wc -w - MicroSim count: Count directories in
docs/sims/ - Glossary term count: Parse
docs/glossary.mdif exists
- File count:
Use 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
Step 2: Obtain or Generate Thumbnail Image
Check for existing thumbnail options in priority order:
- Existing social card image - Check
docs/img/forsocial-card.pngor similar - README banner image - Parse README.md for header images
- Custom image provided by user - User may specify an image path
- Generate with AI - If no image exists, suggest generating one with an AI image tool
Place the source image in docs/case-studies/img/ with a filename matching the repo name:
- Use kebab-case:
geometry-course.jpg,deep-learning-course.jpg
Step 3: Compress Thumbnail Image
Compress the thumbnail to approximately 70KB for fast page loading.
For Initial Compression
Run the thumbnail compression script:
python3 src/compress-thumbnails.py docs/case-studies/img 70
This script:
- Targets 70KB file size
- Maintains minimum 400px width
- Preserves aspect ratio
- Creates
.backupfiles for safety
For PNG to JPEG Conversion (if needed)
If PNG compression cannot achieve 70KB target, convert to JPEG:
python3 src/convert-png-to-jpg.py docs/case-studies/img 70
This script:
- Converts PNG to JPEG format
- Fills transparent areas with white background
- Achieves better compression for photographic images
- Removes original PNG after successful conversion
Manual Single-Image Compression
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)
Установить case-study-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 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, thumbnail generation/compression, and markdown entry formatting.
Как установить скилл case-study-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл case-study-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic