Communitygithub.com

alfathafp/portofolio-web-design

React Native 和 Expo 建構高效能行動應用的最佳實務。用於建構 React Native 元件、優化列表效能、實作動畫或處理原生模組。觸發於涉及 React Native、Expo、行動效能或原生平台 API 的任務。

portofolio-web-design 是什麼?

這是一套針對 React Native 與 Expo 應用程式的全面性最佳實務指南,涵蓋效能、動畫、UI 模式及平台特定優化等多個類別。該技能由 alfathafp 於 GitHub 上提供,主要適用於 Claude Code 等 AI 代理開發工具。其核心價值在於透過結構化的規則系統,幫助開發者建立高效能的行動應用,特別是在列表效能(使用 FlashList)、動畫(僅變換 transform 和 opacity)及導航(使用原生導航器)等關鍵領域。技能按照優先級與影響程度將規則分為八個類別,從關鍵的列表效能到低優先級的配置設定,每個規則都包含詳細的解釋、錯誤與正確的程式碼範例,開發者可直接套用於專案中。整體而言,這套技能提供了一條清晰的脈絡,從根本上提升 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 實作動畫
  • 處理圖片與多媒體
  • 配置原生模組或字型
  • 建構包含原生相依項目的 monorepo 專案

按優先級分類的規則類別

優先級類別影響前綴
1列表效能關鍵list-performance-
2動畫高animation-
3導航高navigation-
4UI 模式高ui-
5狀態管理中react-state-
6渲染中rendering-
7Monorepo中monorepo-
8配置低fonts-, imports-

快速參考

1. 列表效能 (關鍵)

  • list-performance-virtualize - 對大型列表使用 FlashList
  • list-performance-item-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 - 對回呼使用 dispatcher 模式
  • react-state-fallback - 在首次渲染時顯示備用內容
  • react-compiler-destructure-functions - 為 React Compiler 進行解構
  • react-compiler-reanimated-shared-values - 使用 Compiler 處理共享值

6. 渲染 (中)

  • rendering-text-in-text-component - 在 Text 元件中包裹文字
  • rendering-no-falsy-and - 避免使用 falsy && 進行條件渲染

7. Monorepo (中)

  • 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.

相關技能