frontend-patterns
构建更好的 React 前端
前端团队经常在组件、状态和性能决策上重复摸索,缺少共享参考。此技能提供简洁的 React 和 Next.js 模式,用于指导一致的实现方式。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "frontend-patterns" from https://skillstore.io/skills/sickn33-frontend-patterns.md and its manifest at https://skillstore.io/api/skills/sickn33-frontend-patterns/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“frontend-patterns”。 我需要一个可复用的仪表板标签页界面。
预期结果:
推荐复合组件模式,定义主要职责,并解释共享状态应如何通过 context 流动。
正在使用“frontend-patterns”。 我的市场列表有数千行,滚动很慢。
预期结果:
建议使用虚拟化、稳定的行高、overscan 和 memoized 条目组件来减少渲染工作。
正在使用“frontend-patterns”。 我需要一个无障碍的模态框模式。
预期结果:
将动画、焦点管理、Escape 处理和 dialog 属性整合为一份简洁的实现检查清单。
安全审计
安全Reviewed all 44 static findings in SKILL.md. They are false positives from Markdown code fences, TypeScript template literals, React lazy imports, local fetch examples, key event handling, and callback names. No prompt injection, command execution, credential access, or data exfiltration intent was found.
风险因素
⚡ 包含脚本 (2)
⚙️ 外部命令 (33)
🌐 网络访问 (2)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/sickn33-frontend-patterns/audits/4?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/sickn33-frontend-patterns?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/sickn33-frontend-patterns?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-frontend-patterns/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/sickn33-frontend-patterns.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
affaan-m. (2026). frontend-patterns security audit report (audit version 4) [Author version 1.0]. Skillstore. https://skillstore.io/skills/sickn33-frontend-patterns/audits/4BibTeX 引用
@techreport{affaan-m-sickn33-frontend-patterns-2026,
author = {affaan-m},
title = {frontend-patterns security audit report (audit version 4)},
institution = {Skillstore},
year = {2026},
number = {4},
url = {https://skillstore.io/skills/sickn33-frontend-patterns/audits/4},
note = {Author version 1.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "frontend-patterns security audit report (audit version 4)"
version: "1.0"
type: report
authors:
- name: "affaan-m"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/sickn33-frontend-patterns/audits/4"
identifiers:
- type: other
value: "skillstore:sickn33-frontend-patterns:audit:4"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
标准化 React 组件
使用组合和复合组件示例,在整个产品中创建可预测的组件 API。
提升界面性能
应用 memoization、lazy loading 和虚拟化模式,减少复杂页面中的缓慢渲染。
审查 UI 无障碍模式
在设计模态框、下拉菜单和交互控件时,使用键盘导航和焦点管理示例。
试试这些提示
请从此技能中为 [problem] 展示一个前端模式。说明何时使用它,以及需要检查哪些权衡。
使用组合和复合组件模式来设计 [component]。保持 API 简洁,并列出必需的 props。
审查这个 React 视图,找出 memoization、lazy loading 和虚拟化机会。使用技能模式提出具体修改建议。
为 [feature] 创建一个前端计划,使用组件组合、自定义 hooks、context reducers、表单、错误处理、动画和无障碍模式。
最佳实践
- 选择与功能复杂度和团队维护需求相匹配的模式。
- 保持可复用组件 API 小巧、类型明确,并在相似组件之间保持一致。
- 在实现前后结合测量来配套进行性能修改。
避免
- 不要为仅由一个组件拥有的本地状态添加 context 或 reducers。
- 不要在没有明确渲染成本或稳定性需求的情况下 memoize 每个值。
- 不要直接复制示例而不根据最终 UI 调整无障碍行为。