一键导入
library-api-design
React library public API design principles. Use when designing hooks, components, or utility APIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
React library public API design principles. Use when designing hooks, components, or utility APIs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design React APIs and abstractions in a React-like way. Covers declarative interfaces, lifecycle-safe abstractions, minimal surfaces, zero-dependency bias, type safety, and documentation.
Review React hooks against design philosophy. Checks return values, SSR safety, state design, effect usage, TypeScript patterns, and performance.
Write React hooks following design philosophy. Covers naming, return values, SSR safety, state design, effect patterns, TypeScript, and performance.
Create branches following repo conventions. Use when creating branches, starting new features.
PR/code review. 100% coverage, SSR safety, JSDoc validation. Use when reviewing code, checking PRs.
Create commits following repo conventions. Use when committing changes, creating commit messages.
| name | library-api-design |
| description | React library public API design principles. Use when designing hooks, components, or utility APIs. |
| allowed-tools | Read, Glob, Grep |
// Single value
function useDebounce<T>(value: T, delay: number): T;
// Tuple (state + action)
function useToggle(init = false): [boolean, () => void];
// Object (3 or more fields)
function usePagination(): { page; nextPage; prevPage };
// Required first, optional last
function useDebounce<T>(
value: T, // required
delay: number, // required
options?: {...} // optional
): T
// ✅ SSR-safe
export function useMediaQuery(query: string): boolean {
const [matches, setMatches] = useState(() => {
if (typeof window === 'undefined') return false;
return window.matchMedia(query).matches;
});
}
// ✅ Named exports only
export { useDebounce } from './useDebounce';
// ❌ Default export
export default useDebounce;