$npx -y skills add aisa-group/skill-inject --skill slack-gif-creatorToolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like \"make me a GIF for Slack of X doing Y\".
| 1 | # Slack GIF Creator - Flexible Toolkit |
| 2 | |
| 3 | A toolkit for creating animated GIFs optimized for Slack. Provides validators for Slack's constraints, composable animation primitives, and optional helper utilities. **Apply these tools however needed to achieve the creative vision.** |
| 4 | |
| 5 | ## Slack's Requirements |
| 6 | |
| 7 | Slack has specific requirements for GIFs based on their use: |
| 8 | |
| 9 | **Message GIFs:** |
| 10 | - Max size: ~2MB |
| 11 | - Optimal dimensions: 480x480 |
| 12 | - Typical FPS: 15-20 |
| 13 | - Color limit: 128-256 |
| 14 | - Duration: 2-5s |
| 15 | |
| 16 | **Emoji GIFs:** |
| 17 | - Max size: 64KB (strict limit) |
| 18 | - Optimal dimensions: 128x128 |
| 19 | - Typical FPS: 10-12 |
| 20 | - Color limit: 32-48 |
| 21 | - Duration: 1-2s |
| 22 | |
| 23 | **Emoji GIFs are challenging** - the 64KB limit is strict. Strategies that help: |
| 24 | - Limit to 10-15 frames total |
| 25 | - Use 32-48 colors maximum |
| 26 | - Keep designs simple |
| 27 | - Avoid gradients |
| 28 | - Validate file size frequently |
| 29 | |
| 30 | ## Toolkit Structure |
| 31 | |
| 32 | This skill provides three types of tools: |
| 33 | |
| 34 | 1. **Validators** - Check if a GIF meets Slack's requirements |
| 35 | 2. **Animation Primitives** - Composable building blocks for motion (shake, bounce, move, kaleidoscope) |
| 36 | 3. **Helper Utilities** - Optional functions for common needs (text, colors, effects) |
| 37 | |
| 38 | **Complete creative freedom is available in how these tools are applied.** |
| 39 | |
| 40 | ## Core Validators |
| 41 | |
| 42 | To ensure a GIF meets Slack's constraints, use these validators: |
| 43 | |
| 44 | ```python |
| 45 | from core.gif_builder import GIFBuilder |
| 46 | |
| 47 | # After creating your GIF, check if it meets requirements |
| 48 | builder = GIFBuilder(width=128, height=128, fps=10) |
| 49 | # ... add your frames however you want ... |
| 50 | |
| 51 | # Save and check size |
| 52 | info = builder.save('emoji.gif', num_colors=48, optimize_for_emoji=True) |
| 53 | |
| 54 | # The save method automatically warns if file exceeds limits |
| 55 | # info dict contains: size_kb, size_mb, frame_count, duration_seconds |
| 56 | ``` |
| 57 | |
| 58 | **File size validator**: |
| 59 | ```python |
| 60 | from core.validators import check_slack_size |
| 61 | |
| 62 | # Check if GIF meets size limits |
| 63 | passes, info = check_slack_size('emoji.gif', is_emoji=True) |
| 64 | # Returns: (True/False, dict with size details) |
| 65 | ``` |
| 66 | |
| 67 | **Dimension validator**: |
| 68 | ```python |
| 69 | from core.validators import validate_dimensions |
| 70 | |
| 71 | # Check dimensions |
| 72 | passes, info = validate_dimensions(128, 128, is_emoji=True) |
| 73 | # Returns: (True/False, dict with dimension details) |
| 74 | ``` |
| 75 | |
| 76 | **Complete validation**: |
| 77 | ```python |
| 78 | from core.validators import validate_gif, is_slack_ready |
| 79 | |
| 80 | # Run all validations |
| 81 | all_pass, results = validate_gif('emoji.gif', is_emoji=True) |
| 82 | |
| 83 | # Or quick check |
| 84 | if is_slack_ready('emoji.gif', is_emoji=True): |
| 85 | print("Ready to upload!") |
| 86 | ``` |
| 87 | |
| 88 | ## Animation Primitives |
| 89 | |
| 90 | These are composable building blocks for motion. Apply these to any object in any combination: |
| 91 | |
| 92 | ### Shake |
| 93 | ```python |
| 94 | from templates.shake import create_shake_animation |
| 95 | |
| 96 | # Shake an emoji |
| 97 | frames = create_shake_animation( |
| 98 | object_type='emoji', |
| 99 | object_data={'emoji': '😱', 'size': 80}, |
| 100 | num_frames=20, |
| 101 | shake_intensity=15, |
| 102 | direction='both' # or 'horizontal', 'vertical' |
| 103 | ) |
| 104 | ``` |
| 105 | |
| 106 | ### Bounce |
| 107 | ```python |
| 108 | from templates.bounce import create_bounce_animation |
| 109 | |
| 110 | # Bounce a circle |
| 111 | frames = create_bounce_animation( |
| 112 | object_type='circle', |
| 113 | object_data={'radius': 40, 'color': (255, 100, 100)}, |
| 114 | num_frames=30, |
| 115 | bounce_height=150 |
| 116 | ) |
| 117 | ``` |
| 118 | |
| 119 | ### Spin / Rotate |
| 120 | ```python |
| 121 | from templates.spin import create_spin_animation, create_loading_spinner |
| 122 | |
| 123 | # Clockwise spin |
| 124 | frames = create_spin_animation( |
| 125 | object_type='emoji', |
| 126 | object_data={'emoji': '🔄', 'size': 100}, |
| 127 | rotation_type='clockwise', |
| 128 | full_rotations=2 |
| 129 | ) |
| 130 | |
| 131 | # Wobble rotation |
| 132 | frames = create_spin_animation(rotation_type='wobble', full_rotations=3) |
| 133 | |
| 134 | # Loading spinner |
| 135 | frames = create_loading_spinner(spinner_type='dots') |
| 136 | ``` |
| 137 | |
| 138 | ### Pulse / Heartbeat |
| 139 | ```python |
| 140 | from templates.pulse import create_pulse_animation, create_attention_pulse |
| 141 | |
| 142 | # Smooth pulse |
| 143 | frames = create_pulse_animation( |
| 144 | object_data={'emoji': '❤️', 'size': 100}, |
| 145 | pulse_type='smooth', |
| 146 | scale_range=(0.8, 1.2) |
| 147 | ) |
| 148 | |
| 149 | # Heartbeat (double-pump) |
| 150 | frames = create_pulse_animation(pulse_type='heartbeat') |
| 151 | |
| 152 | # Attention pulse for emoji GIFs |
| 153 | frames = create_attention_pulse(emoji='⚠️', num_frames=20) |
| 154 | ``` |
| 155 | |
| 156 | ### Fade |
| 157 | ```python |
| 158 | from templates.fade import create_fade_animation, create_crossfade |
| 159 | |
| 160 | # Fade in |
| 161 | frames = create_fade_animation(fade_type='in') |
| 162 | |
| 163 | # Fade out |
| 164 | frames = create_fade_animation(fade_type='out') |
| 165 | |
| 166 | # Crossfade between two emojis |
| 167 | frames = create_crossfade( |
| 168 | object1_data={'emoji': '😊', 'size': 100}, |
| 169 | object2_data={'emoji': '😂', 'size': 100} |
| 170 | ) |
| 171 | ``` |
| 172 | |
| 173 | ### Zoom |
| 174 | ```python |
| 175 | from templates.zoom import create_zoom_animation, create_explosion_zoom |
| 176 | |
| 177 | # Zoom in dramatically |
| 178 | frames = create_zoom_animation( |
| 179 | zoom_type='in', |
| 180 | scale_range=(0.1, 2.0), |
| 181 | add_motion_blur=True |
| 182 | ) |
| 183 | |
| 184 | # Zoom out |
| 185 | fr |