i18n/zh-TW/slack-gif-creator/SKILL.md
建立針對 Slack 最佳化的動畫 GIF 的知識和工具。提供限制條件、驗證工具和動畫概念。當使用者要求為 Slack 建立動畫 GIF 時使用,例如「幫我做一個 X 做 Y 的 Slack GIF」。
npx skillsauth add tai-ch0802/skills-bundle slack-gif-creatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
提供用於建立針對 Slack 最佳化的動畫 GIF 的工具和知識。
尺寸:
參數:
from core.gif_builder import GIFBuilder
from PIL import Image, ImageDraw
# 1. 建立建構器
builder = GIFBuilder(width=128, height=128, fps=10)
# 2. 生成影格
for i in range(12):
frame = Image.new('RGB', (128, 128), (240, 248, 255))
draw = ImageDraw.Draw(frame)
# 使用 PIL 繪圖基本元素繪製你的動畫
# (圓形、多邊形、線條等)
builder.add_frame(frame)
# 3. 儲存並最佳化
builder.save('output.gif', num_colors=48, optimize_for_emoji=True)
如果使用者上傳圖片,考慮他們是否想要:
使用 PIL 載入並處理圖片:
from PIL import Image
uploaded = Image.open('file.png')
# 直接使用,或僅作為色彩/風格的參考
從頭繪製圖形時,使用 PIL ImageDraw 基本元素:
from PIL import ImageDraw
draw = ImageDraw.Draw(frame)
# 圓形/橢圓
draw.ellipse([x1, y1, x2, y2], fill=(r, g, b), outline=(r, g, b), width=3)
# 星形、三角形、任何多邊形
points = [(x1, y1), (x2, y2), (x3, y3), ...]
draw.polygon(points, fill=(r, g, b), outline=(r, g, b), width=3)
# 線條
draw.line([(x1, y1), (x2, y2)], fill=(r, g, b), width=5)
# 矩形
draw.rectangle([x1, y1, x2, y2], fill=(r, g, b), outline=(r, g, b), width=3)
不要使用: Emoji 字體(跨平台不可靠)或假設此技能中存在預製圖形。
圖形應該看起來精緻且有創意,而非基本。方法如下:
使用較粗的線條 - 輪廓和線條始終設定 width=2 或更高。細線(width=1)看起來粗糙且業餘。
添加視覺深度:
create_gradient_background)讓形狀更有趣:
注意色彩:
複雜形狀(愛心、雪花等):
要有創意和細節!好的 Slack GIF 應該看起來精緻,而非像佔位符圖形。
core.gif_builder)組裝影格並針對 Slack 最佳化:
builder = GIFBuilder(width=128, height=128, fps=10)
builder.add_frame(frame) # 添加 PIL Image
builder.add_frames(frames) # 添加影格清單
builder.save('out.gif', num_colors=48, optimize_for_emoji=True, remove_duplicates=True)
core.validators)檢查 GIF 是否符合 Slack 需求:
from core.validators import validate_gif, is_slack_ready
# 詳細驗證
passes, info = validate_gif('my.gif', is_emoji=True, verbose=True)
# 快速檢查
if is_slack_ready('my.gif'):
print("Ready!")
core.easing)平滑動作而非線性:
from core.easing import interpolate
# 從 0.0 到 1.0 的進度
t = i / (num_frames - 1)
# 套用緩動
y = interpolate(start=0, end=400, t=t, easing='ease_out')
# 可用:linear, ease_in, ease_out, ease_in_out,
# bounce_out, elastic_out, back_out
core.frame_composer)常見需求的便利函數:
from core.frame_composer import (
create_blank_frame, # 純色背景
create_gradient_background, # 垂直漸層
draw_circle, # 圓形輔助
draw_text, # 簡單文字渲染
draw_star # 五角星
)
用振盪偏移物件位置:
math.sin() 或 math.cos() 搭配影格索引有節奏地縮放物件大小:
math.sin(t * frequency * 2 * math.pi) 進行平滑脈動物件墜落並彈跳:
interpolate() 搭配 easing='bounce_out' 進行著陸easing='ease_in' 進行墜落(加速)物件繞中心旋轉:
image.rotate(angle, resample=Image.BICUBIC)逐漸出現或消失:
Image.blend(image1, image2, alpha)物件從螢幕外移動到位置:
interpolate() 搭配 easing='ease_out' 進行平滑停止easing='back_out'縮放和定位以產生縮放效果:
建立向外輻射的粒子:
x += vx、y += vyvy += gravity_constant僅在被要求使檔案大小更小時,實施以下幾種方法:
num_colors=48 而非 128remove_duplicates=Trueoptimize_for_emoji=True 自動最佳化# Emoji 的最大最佳化
builder.save(
'emoji.gif',
num_colors=48,
optimize_for_emoji=True,
remove_duplicates=True
)
此技能提供:
此技能不提供:
關於使用者上傳的注意事項:此技能不包含預製圖形,但如果使用者上傳圖片,使用 PIL 載入並處理 — 根據他們的請求判斷是要直接使用還是僅作為靈感。
發揮創意!組合多種概念(彈跳 + 旋轉、脈動 + 滑動等)並充分利用 PIL 的全部功能。
pip install pillow imageio numpy
development
Unified testing skill — TDD workflow, unit/integration patterns, E2E/Playwright strategies. Replaces tdd-workflow + testing-patterns + webapp-testing.
testing
Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
development
Spec-Driven Development (SDD): A structured workflow (Requirement -> Analysis -> Implementation) enforcing explicit documentation before coding.
development
Methodologies for System Analysis (SA), focusing on technical architecture, data flow modeling, and API design.