agentleFS
valtterimelkkovaltterimelkko/agent-workflow-skills/skills/web-asset-generator/CLAUDE.md

agent-workflow-skills / web-asset-generator

CLAUDE.md2 starsChanged 44 days agoMITView on GitHub

This is a Claude Skill project. Skills are model-invoked capabilities that Claude automatically triggers based on the description in SKILL.md frontmatter. From Emoji (NEW): Both scripts support --validate flag to check file sizes, dimensions, formats, and accessibility: What gets validated: - File sizes: Checks against platform limits (FB <8MB, Twitter <5MB, favicons <100KB) - Dimensions: Verifies sizes match platform specs and aspect ratios - Format: Ensures PNG/JPG/JPEG compatibility - Contrast (OG only): WCAG AA/AAA compliance for text-based images

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this CLAUDE.md into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep description under 200 chars (triggers skill invocation)

    line 125
  2. Distinctive:

    Keep body under 500 lines for optimal performance

    line 126
  3. Distinctive:

    Test with various user prompts: "create a favicon", "make social sharing images", "generate Open Graph images"

    line 131
  4. Distinctive:

    Verify skill triggers automatically based on description match

    line 132

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Type: Claude Skill

This is a Claude Skill project. Skills are model-invoked capabilities that Claude automatically triggers based on the description in SKILL.md frontmatter.

How This Skill Works

  • Entry point: SKILL.md with YAML frontmatter (name + description)
  • Trigger: Claude reads the description at startup and invokes this skill when users request favicons, app icons, or social media images
  • Execution: Claude reads SKILL.md instructions and runs the Python scripts in scripts/
  • Output: Generated image assets + HTML meta tags

Skill Structure

web-asset-generator/
├── SKILL.md              # Entry point (name, description, workflows)
├── scripts/
│   ├── generate_favicons.py    # Favicon/app icon generator
│   ├── generate_og_images.py   # Open Graph image generator
│   ├── emoji_utils.py          # Emoji suggestion and rendering
│   └── lib/
│       ├── __init__.py
│       └── validators.py       # Validation utilities (NEW)
└── references/
    └── specifications.md   # Platform specs (FB, Twitter, etc.)

Core Commands

Generate Favicons/App Icons

From Image:

python scripts/generate_favicons.py <source_image> <output_dir> [icon_type]
# icon_type: 'favicon', 'app', or 'all' (default)

From Emoji (NEW):

# Get emoji suggestions
python scripts/generate_favicons.py --suggest "project description" <output_dir> [icon_type]

# Generate from emoji
python scripts/generate_favicons.py --emoji "🚀" <output_dir> [icon_type] [--emoji-bg COLOR]

Generate Social Media Images

From logo:

python scripts/generate_og_images.py <output_dir> --image <source_image>

From text:

python scripts/generate_og_images.py <output_dir> --text "Your text" [--logo path] [--bg-color '#4F46E5']

Validation (NEW)

Both scripts support --validate flag to check file sizes, dimensions, formats, and accessibility:

# Validate OG images
python scripts/generate_og_images.py output/ --text "My Site" --validate

# Validate favicons
python scripts/generate_favicons.py logo.png output/ all --validate

What gets validated:

  • File sizes: Checks against platform limits (FB <8MB, Twitter <5MB, favicons <100KB)
  • Dimensions: Verifies sizes match platform specs and aspect ratios
  • Format: Ensures PNG/JPG/JPEG compatibility
  • Contrast (OG only): WCAG AA/AAA compliance for text-based images

Dependencies

  • Python 3.6+
  • Pillow: pip install Pillow --break-system-packages
  • Font path: /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf (falls back to default)
  • Pilmoji (for emoji rendering): pip install pilmoji (optional)
  • emoji (for emoji suggestions): pip install 'emoji<2.0.0' (optional, must use version <2.0.0 for pilmoji compatibility)

Implementation Architecture

generate_favicons.py

  • Image mode: Converts source to RGBA for transparency, LANCZOS resampling
  • Emoji mode (NEW): Renders emoji using Pilmoji library, auto-scales to fit icon sizes
  • Outputs: favicon.ico (multi-res) + PNGs at 16x16, 32x32, 96x96, 180x180, 192x192, 512x512
  • Returns HTML <link> tags
  • Background: Transparent for favicons, solid (white default) for app icons when using emoji

emoji_utils.py (NEW)

  • suggest_emojis(description, count=4): Returns 4 emoji suggestions based on keyword matching
  • generate_emoji_icon(emoji, size, bg_color): Renders emoji to PIL Image using Pilmoji
  • Emoji database: 60+ curated emojis with keywords across 10 categories (tech, business, food, health, etc.)
  • Scoring algorithm: Keyword matching with category diversity for better suggestions

generate_og_images.py

  • Two modes: text-based (creates images) or image-based (resizes existing)
  • Outputs: og-image.png (1200x630), twitter-image.png (1200x675), og-square.png (1200x1200)
  • Text rendering (line 45): Dynamic font sizing (120-144px), wraps at 85% width, logo at 15% from top (max 20% height)
  • Dynamic font sizing (line 19): Automatically adjusts based on text length (short=144px, medium=120px, long=102px, very long=84px)
  • Image resizing (line 138): 'cover' mode with center-crop, LANCZOS resampling
  • Validation (with --validate): File size, dimensions, format, and contrast ratio checks
  • Returns HTML <meta> tags for Open Graph and Twitter

lib/validators.py (NEW)

  • Platform requirements: Defines specs for Facebook, Twitter, LinkedIn, WhatsApp
  • validate_file_size(): Checks against platform limits (8MB for FB, 5MB for Twitter)
  • validate_dimensions(): Verifies image sizes and aspect ratios
  • validate_format(): Ensures compatible formats (PNG, JPG, JPEG, WebP)
  • calculate_contrast_ratio(): WCAG 2.0 contrast calculation using relative luminance
  • validate_contrast(): Checks WCAG AA (4.5:1) and AAA (7.0:1) compliance
  • ValidationResult class: Structured results with passed/message/level (success/warning/error)

Skill Development Notes

Editing SKILL.md

  • Keep description under 200 chars (triggers skill invocation)
  • Keep body under 500 lines for optimal performance
  • YAML frontmatter: name must match directory name in hyphen-case

Testing the Skill

  • Install locally in Claude's skills directory
  • Test with various user prompts: "create a favicon", "make social sharing images", "generate Open Graph images"
  • Verify skill triggers automatically based on description match

Reference Files

  • references/specifications.md: Detailed platform specs, aspect ratios, file size limits
  • SKILL.md already references this file; Claude reads it when needed

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.