bear2u

card-news-generator

710
189
# Install this skill:
npx skills add bear2u/my-skills --skill "card-news-generator"

Install specific skill from multi-skill repository

# Description

Create 600x600 Instagram-style card news series automatically with optional background images. User provides topic, colors, and optional images - Claude generates content and creates multiple cards with proper text wrapping.

# SKILL.md


name: card-news-generator
description: Create 600x600 Instagram-style card news series automatically with optional background images. User provides topic, colors, and optional images - Claude generates content and creates multiple cards with proper text wrapping.


Card News Generator - Auto Mode (V2)

Creates beautiful 600x600 card news series for social media with background image support. User can provide topic, colors, and optional background images - Claude handles content generation and multi-card creation automatically.

When to Use

Use this skill when user requests:
- "์นด๋“œ ๋‰ด์Šค ๋งŒ๋“ค์–ด์ค˜"
- "์ฃผ์ œ๋กœ ์นด๋“œ ์‹œ๋ฆฌ์ฆˆ ๋งŒ๋“ค์–ด์ค˜"
- "์ธ์Šคํƒ€์šฉ ์นด๋“œ ์ƒ์„ฑํ•ด์ค˜"
- Any request for visual card content

Core Workflow - AUTO MODE

This is the PRIMARY workflow when users request card news:

Step 1: Get Topic, Colors, and Optional Background Images from User

Ask user for:
- Topic (์ฃผ์ œ): What the card series is about
- Background RGB (๋ฐฐ๊ฒฝ์ƒ‰): e.g., 245,243,238 (optional, default: beige)
- Background Images (๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง€, ์„ ํƒ์‚ฌํ•ญ): Path to folder containing images

Example conversation (Solid Color):

Claude: ์–ด๋–ค ์ฃผ์ œ๋กœ ์นด๋“œ ๋‰ด์Šค๋ฅผ ๋งŒ๋“ค๊นŒ์š”?
User: Z์„ธ๋Œ€์˜ ํŠน์ง•์— ๋Œ€ํ•ด์„œ

Claude: ๋ฐฐ๊ฒฝ์ƒ‰์„ ์„ ํƒํ•ด์ฃผ์„ธ์š” (RGB ํ˜•์‹, ์˜ˆ: 245,243,238)
์ถ”์ฒœ ์ƒ‰์ƒ:
โ€ข ๋ฒ ์ด์ง€: 245,243,238
โ€ข ํ•‘ํฌ: 255,229,229
โ€ข ๋ฏผํŠธ: 224,244,241
User: 245,243,238

Example conversation (With Background Images):

Claude: ์–ด๋–ค ์ฃผ์ œ๋กœ ์นด๋“œ ๋‰ด์Šค๋ฅผ ๋งŒ๋“ค๊นŒ์š”?
User: ์—ฌํ–‰ ํŒ 5๊ฐ€์ง€

Claude: ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง€๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๊ฒ ์–ด์š”? (์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ด๋ฏธ์ง€ ํด๋” ๊ฒฝ๋กœ ์ž…๋ ฅ)
User: /path/to/travel-images

Claude: ์˜ค๋ฒ„๋ ˆ์ด ๋ถˆํˆฌ๋ช…๋„๋ฅผ ์„ ํƒํ•˜์„ธ์š” (0.0-1.0, ๊ธฐ๋ณธ๊ฐ’ 0.5)
๋†’์„์ˆ˜๋ก ์–ด๋‘ก๊ฒŒ ์ฒ˜๋ฆฌ๋˜์–ด ํ…์ŠคํŠธ๊ฐ€ ๋” ์ž˜ ๋ณด์ž…๋‹ˆ๋‹ค.
User: 0.6

Step 2: Generate Card Content

Create 5-7 cards about the topic. Format output as:

1. [์ œ๋ชฉ]
[์„ค๋ช… 2-3์ค„]

2. [์ œ๋ชฉ]
[์„ค๋ช… 2-3์ค„]

3. [์ œ๋ชฉ]
[์„ค๋ช… 2-3์ค„]

CRITICAL Content Guidelines:
- Title: Maximum 20 characters (including spaces)
- Content: Maximum 60 characters (including spaces)
- Keep it concise to fit 600x600 canvas
- Use simple, impactful language
- Each card should convey ONE key point

Step 3: Auto-Generate Cards

Option A: Solid Color Background

Use this command to create all cards with solid color background:

python auto_generator.py \
  --topic "Z์„ธ๋Œ€์˜ ํŠน์ง•" \
  --bg-color "#f5f3ee" \
  --text-color "#1a1a1a" \
  --output-dir /mnt/user-data/outputs \
  --base-filename "zgen" << 'EOF'
1. ๋””์ง€ํ„ธ ๋„ค์ดํ‹ฐ๋ธŒ
ํƒœ์–ด๋‚  ๋•Œ๋ถ€ํ„ฐ
๋””์ง€ํ„ธ ํ™˜๊ฒฝ์— ์ต์ˆ™

2. ๊ฐœ์ธํ™” ์ค‘์‹œ
๋‚˜๋งŒ์˜ ๊ฐœ์„ฑ๊ณผ
์ทจํ–ฅ์„ ์ค‘์š”์‹œ

3. ์†Œํ†ต ๋ฐฉ์‹
ํ…์ŠคํŠธ๋ณด๋‹ค ์˜์ƒ
์ด๋ชจํ‹ฐ์ฝ˜์œผ๋กœ ๊ฐ์ • ํ‘œํ˜„
EOF

Option B: Background Images (V2 Feature)

Use this command to create cards with background images:

python auto_generator.py \
  --topic "์—ฌํ–‰ ํŒ" \
  --output-dir /mnt/user-data/outputs \
  --base-filename "travel" \
  --image-folder /path/to/travel-images \
  --overlay-opacity 0.6 << 'EOF'
1. ์ง ์‹ธ๊ธฐ ํŒ
์ตœ์†Œํ•œ์˜ ์ง์œผ๋กœ
๊ฐ€๋ณ๊ฒŒ ์—ฌํ–‰ํ•˜๊ธฐ

2. ํ˜„์ง€ ์Œ์‹
๋ง›์ง‘ ์ฐพ๋Š”
๋‚˜๋งŒ์˜ ๋ฐฉ๋ฒ•

3. ๊ตํ†ต ์ˆ˜๋‹จ
๋Œ€์ค‘๊ตํ†ต ํ™œ์šฉ
ํŒ๊ณผ ๋…ธํ•˜์šฐ
EOF

Important Notes:
- Images in the folder must be sorted alphabetically/numerically (e.g., 01.jpg, 02.jpg, 03.jpg)
- Image count should match card count
- If fewer images than cards, remaining cards will use solid color background
- Supported formats: .jpg, .jpeg, .png, .webp, .bmp
- Text automatically changes to white when using background images

The script will automatically:
- Parse the numbered content
- Load background images from the folder (in sorted order)
- Apply dark overlay for better text visibility
- Create individual cards with proper text wrapping
- Save as travel_01.png, travel_02.png, etc.

After generation, show user:

โœ… ์นด๋“œ ๋‰ด์Šค 5์žฅ์ด ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค!

[View card 1](computer:///mnt/user-data/outputs/zgen_01.png)
[View card 2](computer:///mnt/user-data/outputs/zgen_02.png)
...

RGB to Hex Conversion

Always convert RGB to hex for scripts:

# RGB 245,243,238 โ†’ Hex #f5f3ee
hex_color = '#{:02x}{:02x}{:02x}'.format(245, 243, 238)

Show users these options:
- Warm beige: 245,243,238 โ†’ #f5f3ee
- Soft pink: 255,229,229 โ†’ #ffe5e5
- Mint green: 224,244,241 โ†’ #e0f4f1
- Lavender: 232,224,245 โ†’ #e8e0f5
- Peach: 255,232,214 โ†’ #ffe8d6
- Sky blue: 227,242,253 โ†’ #e3f2fd

Content Generation Best Practices

Good Card Content Example

1. ๋””์ง€ํ„ธ ๋„ค์ดํ‹ฐ๋ธŒ
ํƒœ์–ด๋‚  ๋•Œ๋ถ€ํ„ฐ
๋””์ง€ํ„ธ ํ™˜๊ฒฝ์— ์ต์ˆ™

โœ“ Title: 8 characters
โœ“ Content: 18 characters
โœ“ Clear and concise

Bad Card Content Example

1. Z์„ธ๋Œ€๋Š” ๋””์ง€ํ„ธ ๋„ค์ดํ‹ฐ๋ธŒ ์„ธ๋Œ€์ž…๋‹ˆ๋‹ค
๊ทธ๋“ค์€ ํƒœ์–ด๋‚  ๋•Œ๋ถ€ํ„ฐ ์Šค๋งˆํŠธํฐ๊ณผ ์ธํ„ฐ๋„ท์„ ์‚ฌ์šฉํ•˜๋ฉฐ ์ž๋ž๊ธฐ ๋•Œ๋ฌธ์— ๋””์ง€ํ„ธ ๊ธฐ์ˆ ์— ๋งค์šฐ ๋Šฅ์ˆ™ํ•ฉ๋‹ˆ๋‹ค

โœ— Title too long (21 characters)
โœ— Content too long (60+ characters)
โœ— Will overflow the 600x600 canvas

Single Card Mode (Manual)

Solid Color Background

For creating just one card with solid color:

python generate_card.py \
  --title "์ œ๋ชฉ" \
  --content "๋‚ด์šฉ" \
  --bg-color "#f5f3ee" \
  --text-color "#1a1a1a" \
  --number 1 \
  --output /mnt/user-data/outputs/single.png

With Background Image (V2 Feature)

For creating a card with background image:

python generate_card.py \
  --title "์—ฌํ–‰ ํŒ" \
  --content "์ตœ์†Œํ•œ์˜ ์ง์œผ๋กœ\n๊ฐ€๋ณ๊ฒŒ ์—ฌํ–‰ํ•˜๊ธฐ" \
  --bg-image /path/to/image.jpg \
  --overlay-opacity 0.6 \
  --number 1 \
  --output /mnt/user-data/outputs/travel_01.png

Parameters:
- --bg-image: Path to background image file
- --overlay-opacity: Opacity of dark overlay (0.0-1.0, default: 0.5)
- 0.0 = No overlay (original image)
- 0.5 = 50% dark overlay (default, good balance)
- 1.0 = Fully black (only for very bright images)

Technical Details

Canvas Specifications

  • Size: 600x600 pixels (Instagram-optimized)
  • Padding: 40px on all sides
  • Max text width: 520px (600 - 80)
  • Font sizes:
  • Number badge: 60px
  • Title: 48px (bold)
  • Content: 28px (regular)

Background Image Processing (V2)

  • Resize & Crop: Images are automatically resized to 600x600px
  • Maintains aspect ratio
  • Center crop if aspect ratio differs
  • Uses high-quality LANCZOS resampling
  • Dark Overlay: Applied to improve text visibility
  • Default opacity: 0.5 (50% dark)
  • Adjustable via --overlay-opacity (0.0-1.0)
  • Higher values = darker overlay = better text contrast
  • Text Color: Automatically switches to white (#FFFFFF) when using background images
  • Supported Formats: JPG, JPEG, PNG, WebP, BMP
  • Image Sorting: Files loaded in alphabetical/numerical order

Text Wrapping

  • Automatic word wrapping at max width
  • Preserves manual line breaks
  • Centers all text horizontally
  • Vertical spacing optimized for readability

File Naming Convention

  • Auto mode: {base_filename}_{number:02d}.png
  • Example: card_01.png, card_02.png, card_03.png

Error Handling

If text overflows:
- Reduce title length
- Shorten content
- Use line breaks strategically
- Regenerate with revised content

Example Workflows

Example 1: Solid Color Background

User request: "Z์„ธ๋Œ€์— ๋Œ€ํ•œ ์นด๋“œ ๋‰ด์Šค 5์žฅ ๋งŒ๋“ค์–ด์ค˜, ํ•‘ํฌ์ƒ‰์œผ๋กœ"

Claude response:
1. Confirm: "Z์„ธ๋Œ€ ํŠน์ง•์— ๋Œ€ํ•œ ์นด๋“œ 5์žฅ์„ ํ•‘ํฌ ๋ฐฐ๊ฒฝ(255,229,229)์œผ๋กœ ๋งŒ๋“ค๊ฒ ์Šต๋‹ˆ๋‹ค."
2. Generate 5 cards content (keeping text concise)
3. Run auto_generator.py with heredoc
4. Provide download links to all 5 cards

Total time: ~30 seconds for 5-card series

Example 2: Background Images (V2)

User request: "์—ฌํ–‰ ํŒ ์นด๋“œ ๋‰ด์Šค ๋งŒ๋“ค์–ด์ค˜, ๋ฐฐ๊ฒฝ์€ /Users/me/travel-photos ํด๋”์— ์žˆ๋Š” ์ด๋ฏธ์ง€ ์‚ฌ์šฉ"

Claude response:
1. Confirm: "์—ฌํ–‰ ํŒ ์นด๋“œ ๋‰ด์Šค๋ฅผ ๋งŒ๋“ค๊ฒ ์Šต๋‹ˆ๋‹ค. /Users/me/travel-photos ํด๋”์˜ ์ด๋ฏธ์ง€๋ฅผ ๋ฐฐ๊ฒฝ์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค."
2. Ask: "์˜ค๋ฒ„๋ ˆ์ด ๋ถˆํˆฌ๋ช…๋„๋ฅผ ์„ ํƒํ•˜์„ธ์š” (0.0-1.0, ๊ธฐ๋ณธ๊ฐ’ 0.5). ๋†’์„์ˆ˜๋ก ํ…์ŠคํŠธ๊ฐ€ ๋” ์ž˜ ๋ณด์ž…๋‹ˆ๋‹ค."
3. User: "0.6"
4. Generate 5 cards content (keeping text concise)
5. Run auto_generator.py with --image-folder and --overlay-opacity
6. Provide download links showing cards with background images

Preparation tips:
- Rename images in order: 01.jpg, 02.jpg, 03.jpg, 04.jpg, 05.jpg
- Ensure image count matches card count
- Use high-quality images (at least 600x600px recommended)
- Test with different overlay opacity values for best results

Total time: ~45 seconds for 5-card series with images

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.