Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

rn-skia斯基亚

Agent Skill

rn-skia 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

713

周安装

51

GitHub Stars

1

下载量

420
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rn-skia(斯基亚)
来源仓库:https://github.com/imfa-solutions/skills
仓库路径:skills/rn-skia
安装命令:
npx skills add https://github.com/imfa-solutions/skills --skill rn-skia
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/imfa-solutions/skills --skill rn-skia

简介

用于处理 GitHub 仓库和代码协作相关信息。

  • 适合围绕 Issue、Pull Request 进行状态整理。
  • 可协助分析代码变更和仓库维护情况。rn-skia 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 安装前建议确认是否会触发网络请求或文件操作。
  • 需结合项目实际协作流程验证使用方式。

SKILL.md

React Native Skia — Best Practices & Performance Guide

@shopify/react-native-skia 2.x / React Native >= 0.79 / React >= 19 / Reanimated v3+

Critical Rules

  1. Never read .value in JSX render — pass shared values directly as props: <Circle cx={x} /> not <Circle cx={x.value} />.
  2. Never create Skia objects in render — use useMemo for Paint, Path, PictureRecorder, RuntimeEffect.
  3. Always mark worklet functions with "worklet" directive in useDerivedValue callbacks.
  4. Animate properties, not structure — keep the component tree static; only animate numeric/color props.
  5. Use Atlas for 10+ similar elements — single draw call beats N individual components.
  6. Reuse Paint and PictureRecorder objects — creating per frame causes GC pressure and frame drops.
  7. Prefer retained mode for UI animations (near-zero FFI cost); use immediate mode (Picture API) only for variable draw command counts (particles, generative art, games).
  8. Use BlurMask over Blur for simple shapes — it's cheaper.
  9. Order filters cheapest-first — MatrixColorFilter before Blur.
  10. Load fonts/images at component level with useFont/useImage — handle null loading state before rendering.

Version Compatibility

React Native SkiaReact NativeReactiOSAndroid
2.x>= 0.79>= 19>= 14API >= 21
1.12.4<= 0.78<= 18>= 14API >= 21

Android API 26+ required for video support.

Installation

npm install @shopify/react-native-skia
# Postinstall downloads prebuilt Skia binaries — must run
# Bun: bun add --trust @shopify/react-native-skia
# pnpm v10+: add to pnpm.onlyBuiltDependencies in package.json

iOS: cd ios && pod install. Android ProGuard: add -keep class com.shopify.reactnative.skia.** {*;}.

Essential Imports

import {
  Canvas, Circle, Rect, RoundedRect, Line, Path, Group, Fill,
  Text, Paragraph, Image, ImageSVG,
  LinearGradient, RadialGradient, SweepGradient,
  Blur, BlurMask, Shadow, BackdropBlur, MatrixColorFilter,
  RuntimeShader, FractalNoise, Turbulence, ImageShader,
  Atlas, Picture, Vertices, Patch, DiffRect, FitBox, Box,
  useFont, useImage, useSVG, useCanvasRef,
  Skia, vec, rect, rrect, drawAsImage,
  usePathInterpolation, useRSXformBuffer, useRectBuffer, useClock,
  interpolateColors,
} from "@shopify/react-native-skia";

import {
  useSharedValue, useDerivedValue, withTiming, withSpring,
  withRepeat, withSequence, withDelay, withDecay, cancelAnimation,
} from "react-native-reanimated";

Core Pattern — Retained Mode Animation

const x = useSharedValue(0);
const scale = useSharedValue(1);

useEffect(() => {
  x.value = withSpring(200);
  scale.value = withSpring(1.5);
}, []);

return (
  <Canvas style={{ flex: 1 }}>
    <Group transform={[{ translateX: x }, { scale }]}>
      <Circle cx={0} cy={100} r={50} color="cyan" />
    </Group>
  </Canvas>
);

Rendering Mode Selection

ScenarioModeWhy
UI animationsRetainedNear-zero FFI, display list cached
Charts & graphsRetainedStatic structure, animated props
Particle systemsImmediateVariable draw command count
GamesImmediateFull control per frame
Generative artImmediateUnpredictable scene changes
MixedBothPicture for particles + Group for UI

Performance Quick Reference

Fastest (use freely):      Circle, Rect, Line, Group transforms, MatrixColorFilter
Fast (use moderately):     Path (simple), BlurMask, LinearGradient
Slow (use sparingly):      BackdropBlur, RuntimeShader, DisplacementMap, Blur (large radius)

Targets: 60fps = 16.67ms budget, 120fps = 8.33ms budget. Memory < 100MB. JS thread < 50%.

Anti-Patterns to Fix on Sight

Anti-PatternFix
cx={x.value} in JSXcx={x} — pass shared value directly
Skia.Paint() in render bodyWrap in useMemo(() => Skia.Paint(), [])
Skia.Path.Make() in render bodyWrap in useMemo
{items.map(i => <Circle.../>)} for 10+ itemsUse Atlas with useRSXformBuffer
<Blur blur={0} />Remove — no-op filter wastes cycles
Dynamic component list changing every frameUse immediate mode (Picture API)
useState driving Skia animationsUse useSharedValue
Missing "worklet" in useDerivedValueAdd directive as first statement
Font/image not null-checkedGuard with if (!font) return null
<BackdropBlur> wrapping large areasLimit clip area or use BlurMask

Code Review Action

When asked to review/audit/check Skia code:

  1. Scan all files importing @shopify/react-native-skia.
  2. Check against Critical Rules and Anti-Patterns table.
  3. Report in table: | File | Line | Issue | Severity | Fix |
  4. Severity: CRITICAL (crash/broken render), HIGH (frame drops), MEDIUM (sub-optimal), LOW (style).
  5. Fix all issues if confirmed, then re-scan to verify zero violations.

Reference Files

Read these as needed for detailed API docs, examples, and patterns:

  • Getting Started: Installation (npm/yarn/Expo/Bun/pnpm), platform setup (iOS/Android/Web), postinstall scripts, Hello World, Canvas component, Skia object API, project structure, troubleshooting build errors, bundle size.
  • Canvas & Rendering Modes: Retained mode (declarative components, display list, near-zero FFI), immediate mode (Picture API, PictureRecorder, direct draw commands), combining both modes, offscreen/headless rendering, canvas snapshots, custom renderers, platform considerations.
  • Shapes & Drawing: All shape components (Circle, Rect, RoundedRect, Oval, Line, Points, Fill, Path with SVG notation, Atlas/RSXform sprite batching, Vertices, Patch, DiffRect), Group transforms/blend modes/clipping, Paint component, FitBox, Box with shadow, path trimming animation.
  • Animations: Reanimated v3 integration (shared values as direct props), animation types (timing/spring/decay/repeat/sequence), derived values, Skia hooks (usePathInterpolation, usePathValue, useClock, useRectBuffer, useRSXformBuffer), color animations (interpolateColors), gesture integration (pan/pinch/rotation/multi-touch), complete examples (pulsing button, spinner, bouncing ball).
  • Shaders & Gradients: Linear/Radial/Sweep/TwoPointConical gradients, animated gradients, FractalNoise/Turbulence, custom SkSL runtime shaders (wave distortion, chromatic aberration, glow, aurora, water ripple), ShaderLib functions, ImageShader texturing, shader composition, performance (half precision, cache programs).
  • Filters & Effects: Image filters (Blur, Offset, Morphology, DisplacementMap, Shadow, RuntimeShader), mask filters (BlurMask styles: normal/solid/outer/inner), color filters (MatrixColorFilter with grayscale/sepia/invert/brightness/contrast matrices, BlendColor, LumaColorFilter, Lerp), path effects (Discrete, Dash, Corner, Path1D, Path2D, Line2D, Sum), BackdropBlur/BackdropFilter, Mask (alpha/luminance), frosted glass/neon glow/vintage photo examples.
  • Text & Fonts: Text component (baseline positioning), useFont hook, system fonts, matchFont, Paragraph builder (rich text, styles, alignment), TextPath (text along curves), TextBlob, Glyphs, font metrics/measurement, animated text (position, font size), marquee/typewriter/shadow examples.
  • Images & Media: useImage hook (require/URL/bundle), Image component (fit modes, sampling), programmatic image creation (base64, raw pixels, drawAsImage), image manipulation (resize, encode, read pixels), AnimatedImage (GIF/WebP), SVG (useSVG, ImageSVG, from string), Video playback (useVideo, controls), Skottie/Lottie (animation, dynamic properties, slots), canvas snapshots, image effects.
  • Performance Optimization: Rendering pipeline (JS→UI→GPU), 60fps/120fps frame budgets, retained vs immediate mode characteristics, animation performance (shared values, derived values, batching, worklets), component structure optimization (flat trees, Groups, static Pictures), memory management (reuse objects, dispose images, resize), Atlas for high-perf rendering, filter cost hierarchy, platform-specific tips (iOS Metal, Android OpenGL/androidWarmup, Web CanvasKit), profiling (useFrameCallback FPS counter, React DevTools, native profilers), common pitfalls checklist.
  • Advanced Patterns: Architecture (component composition, DrawingContext, atomic/molecular components, custom hooks, render props), real-world examples (interactive bar chart, particle system with Atlas, drawing canvas with gestures, progress ring, waveform visualizer), design system integration (theme provider with Skia colors), testing (unit tests, visual regression), debugging (visual grid overlay, performance monitor), common patterns (skeleton loading, ripple effect, confetti).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.92%
按下载量换算155

Claude

28.36%
按下载量换算119

Cursor

18.6%
按下载量换算78

Gemini CLI

9.5%
按下载量换算40

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills