Communitygithub.com

alfathafp/portofolio-web-design

React Native 和 Expo 构建高性能移动应用的最佳实践。适用于构建 React Native 组件、优化列表性能、实现动画或处理原生模块时。在涉及 React Native、Expo、移动性能或原生平台 API 的任务中触发。

portofolio-web-design 是什么?

该技能提供了一套全面的 React Native 和 Expo 应用开发最佳实践指南,涵盖了性能优化、动画、导航、UI 模式、状态管理、渲染、单体仓库以及配置等多个关键领域。它通过按优先级分类的规则(如列表性能为关键、动画和导航为高优先级)来帮助开发者快速定位并解决特定问题。例如,它推荐使用 FlashList 虚拟化大列表、仅对 transform 和 opacity 进行动画以利用 GPU 优化、使用 expo-image 处理图片,以及采用原生导航栈和标签栏。技能规则以 Markdown 文件形式组织,每个规则包含简要说明、错误与正确代码示例,便于开发者直接应用。此技能适用于 Cursor、Claude Code 等支持自定义规则的 AI 编码工具,能够显著提升 React Native 应用的性能和开发效率。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/vercel-react-native-skills

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

React Native 技能

React Native 和 Expo 应用的全面最佳实践。包含涵盖性能、动画、UI 模式以及平台特定优化的多个类别规则。

何时应用

在以下情况下参考这些指南:

  • 构建 React Native 或 Expo 应用
  • 优化列表和滚动性能
  • 使用 Reanimated 实现动画
  • 处理图片和媒体
  • 配置原生模块或字体
  • 组织包含原生依赖的单体仓库项目

按优先级分类的规则类别

优先级类别影响前缀
1列表性能关键list-performance-
2动画高animation-
3导航高navigation-
4UI 模式高ui-
5状态管理中react-state-
6渲染中rendering-
7单体仓库中monorepo-
8配置低fonts-, imports-

快速参考

1. 列表性能(关键)

  • list-performance-virtualize - 对大列表使用 FlashList
  • list-performance-item-memo - 对列表项组件使用 memo
  • list-performance-callbacks - 稳定回调引用
  • list-performance-inline-objects - 避免内联样式对象
  • list-performance-function-references - 将函数提取到渲染外部
  • list-performance-images - 优化列表中的图片
  • list-performance-item-expensive - 将高开销工作移出列表项
  • list-performance-item-types - 为异构列表使用项目类型

2. 动画(高)

  • animation-gpu-properties - 仅对 transform 和 opacity 进行动画
  • animation-derived-value - 使用 useDerivedValue 处理计算动画
  • animation-gesture-detector-press - 使用 Gesture.Tap 代替 Pressable

3. 导航(高)

  • navigation-native-navigators - 优先使用原生栈和原生标签页,而非 JS 导航器

4. UI 模式(高)

  • ui-expo-image - 对所有图片使用 expo-image
  • ui-image-gallery - 使用 Galeria 实现图片灯箱
  • ui-pressable - 使用 Pressable 代替 TouchableOpacity
  • ui-safe-area-scroll - 在 ScrollView 中处理安全区域
  • ui-scrollview-content-inset - 为头部使用 contentInset
  • ui-menus - 使用原生上下文菜单
  • ui-native-modals - 尽可能使用原生模态框
  • ui-measure-views - 使用 onLayout,而非 measure()
  • ui-styling - 使用 StyleSheet.create 或 Nativewind

5. 状态管理(中)

  • react-state-minimize - 最小化状态订阅
  • react-state-dispatcher - 对回调使用调度器模式
  • react-state-fallback - 首次渲染时显示备用内容
  • react-compiler-destructure-functions - 为 React Compiler 解构函数
  • react-compiler-reanimated-shared-values - 使用编译器处理共享值

6. 渲染(中)

  • rendering-text-in-text-component - 在 Text 组件中包裹文本
  • rendering-no-falsy-and - 避免使用假值 && 进行条件渲染

7. 单体仓库(中)

  • monorepo-native-deps-in-app - 将原生依赖保留在应用包中
  • monorepo-single-dependency-versions - 在包间使用单一版本

8. 配置(低)

  • fonts-config-plugin - 使用配置插件处理自定义字体
  • imports-design-system-folder - 组织设计系统导入
  • js-hoist-intl - 提升 Intl 对象创建

如何使用

阅读各个规则文件以获取详细解释和代码示例:

rules/list-performance-virtualize.md
rules/animation-gpu-properties.md

每个规则文件包含:

  • 为何重要的简要说明
  • 带有解释的错误代码示例
  • 带有解释的正确代码示例
  • 其他背景信息和参考

完整编译文档

查看包含所有规则扩展的完整指南:AGENTS.md

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, splitting uncommitted work in a messy working tree into clean atomic commits, opening or reviewing a pull request (PR), pushing to a remote, or when you need to organize work across multiple parallel streams. Use when cutting a release, choosing a semantic version bump, tagging, or writing a changelog.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

相关技能