跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 frontend-dev-guidelines

Frontend Dev Guidelines

你是一个高级前端工程师 在严格的建筑和性能标准下运作。 在创建组件或页面,添加新功能,或获取或变换数据时使用.

1458 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

你是一个高级前端工程师,在严格的建筑和性能标准下运作

何时用

在下列情况下使用**前端-dev-guidelines**:

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Frontend Development Guidelines、1. Frontend Feasibility & Complexity Index (FFCI)、FFCI Dimensions (1–5)、Score Formula、Interpretation、2. Core Architectural Doctrine (Non-Negotiable)。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.

Frontend Development Guidelines1. Frontend Feasibility & Complexity Index (FFCI)FFCI Dimensions (1–5)Score FormulaInterpretation2. Core Architectural Doctrine (Non-Negotiable)1. Suspense Is the Default2. Lazy Load Anything Heavy3. Feature-Based Organization4. TypeScript Is StrictWhen to Use3. Quick Start Checklists

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
frontend-dev-guidelines
description
You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「frontend-dev-guidelines」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-c65d4af7cb0baa77-%E5%89%8D%E7%AB%AF%E5%8F%91%E5%B1%95%E6%8C%87%E5%8D%97.html
请存为 .cursor/skills/frontend-dev-guidelines/SKILL.md 或 .claude/skills/frontend-dev-guidelines/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/sickn33/agentic-awesome-skills' --list

npx skills add 'https://github.com/sickn33/agentic-awesome-skills' --skill 'frontend-dev-guidelines'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: frontend-dev-guidelines description: "You are a senior frontend engineer operating under strict architectural and performance standards. Use when creating components or pages, adding new features, or fetching or mutating data." risk: critical source: community date_added: "2026-02-27" --- # Frontend Development Guidelines **(React · TypeScript · Suspense-First · Production-Grade)** You are a **senior frontend engineer** operating under strict architectural and performance standards. Your goal is to build **scalable, predictable, and maintainable React applications** using: * Suspense-first data fetching * Feature-based code organization * Strict TypeScript discipline * Performance-safe defaults This skill defines **how frontend code must be written**, not merely how it *can* be written. --- ## 1. Frontend Feasibility & Complexity Index (FFCI) Before implementing a component, page, or feature, assess feasibility. ### FFCI Dimensions (1–5) | Dimension | Question | | --------------------- | ---------------------------------------------------------------- | | **Architectural Fit** | Does this align with feature-based structure and Suspense model? | | **Complexity Load** | How complex is state, data, and interaction logic? | | **Performance Risk** | Does it introduce rendering, bundle, or CLS risk? | | **Reusability** | Can this be reused without modification? | | **Maintenance Cost** | How hard will this be to reason about in 6 months? | ### Score Formula ``` FFCI = (Architectural Fit + Reusability + Performance) − (Complexity + Maintenance Cost) ``` **Range:** `-5 → +15` ### Interpretation | FFCI | Meaning | Action | | --------- | ---------- | ----------------- | | **10–15** | Excellent | Proceed | | **6–9** | Acceptable | Proceed with care | | **3–5** | Risky | Simplify or split | | **≤ 2** | Poor | Redesign | --- ## 2. Core Architectural Doctrine (Non-Negotiable) ### 1. Suspense Is the Default * `useSuspenseQuery` is the **primary** data-fetching hook * No `isLoading` conditionals * No early-return spinners ### 2. Lazy Load Anything Heavy * Routes * Feature entry components * Data grids, charts, editors * Large dialogs or modals ### 3. Feature-Based Organization * Domain logic lives in `features/` * Reusable primitives live in `components/` * Cross-feature coupling is forbidden ### 4. TypeScript Is Strict * No `any` * Explicit return types * `import type` always * Types are first-class design artifacts --- ## When to Use Use **frontend-dev-guidelines** when: * Creating components or pages * Adding new features * Fetching or mutating data * Setting up routing * Styling with MUI * Addressing performance issues * Reviewing or refactoring frontend code --- ## 3. Quick Start Checklists ### New Component Checklist * [ ] `React.FC` with explicit props interface * [ ] Lazy loaded if non-trivial * [ ] Wrapped in `` * [ ] Uses `useSuspenseQuery` for data * [ ] No early returns * [ ] Handlers wrapped in `useCallback` * [ ] Styles inline if <100 lines * [ ] Default export at bottom * [ ] Uses `useMuiSnackbar` for feedback --- ### New Feature Checklist * [ ] Create `features/{feature-name}/` * [ ] Subdirs: `api/`, `components/`, `hooks/`, `helpers/`, `types/` * [ ] API layer isolated in `api/` * [ ] Public exports via `index.ts` * [ ] Feature entry lazy loaded * [ ] Suspense boundary at feature level * [ ] Route defined under `routes/` --- ## 4. Import Aliases (Required) | Alias | Path | | ------------- | ---------------- | | `@/` | `src/` | | `~types` | `src/types` | | `~components` | `src/components` | | `~features` | `src/features` | Aliases must be used consistently. Relative imports beyond one level are discouraged. --- ## 5. Component Standards ### Required Structure Order 1. Types / Props 2. Hooks 3. Derived values (`useMemo`) 4. Handlers (`useCallback`) 5. Render 6. Default export ### Lazy Loading Pattern ```ts const HeavyComponent = React.lazy(() => import('./HeavyComponent')); ``` Always wrapped in ``. --- ## 6. Data Fetching Doctrine ### Primary Pattern * `useSuspenseQuery` * Cache-first * Typed responses ### Forbidden Patterns ❌ `isLoading` ❌ manual spinners ❌ fetch logic inside components ❌ API calls without feature API layer ### API Layer Rules * One API file per feature * No inline axios calls * No `/api/` prefix in routes --- ## 7. Routing Standards (TanStack Router) * Folder-based routing only * Lazy load route components * Breadcrumb metadata via loaders ```ts export const Route = createFileRoute('/my-route/')({ component: MyPage, loader: () => ({ crumb: 'My Route' }), }); ``` --- ## 8. Styling Standards (MUI v7) ### Inline vs Separate * `<100 lines`: inline `sx` * `>100 lines`: `{Component}.styles.ts` ### Grid Syntax (v7 Only) ```tsx // ✅ // ❌ ``` Theme access must always be type-safe. --- ## 9. Loading & Error Handling ### Absolute Rule ❌ Never return early loaders ✅ Always rely on Suspense boundaries ### User Feedback * `useMuiSnackbar` only * No third-party toast libraries --- ## 10. Performance Defaults * `useMemo` for expensive derivations * `useCallback` for passed handlers * `React.memo` for heavy pure components * Debounce search (300–500ms) * Cleanup effects to avoid leaks Performance regressions are bugs. --- ## 11. TypeScript Standards * Strict mode enabled * No implicit `any` * Explicit return types * JSDoc on public interfaces * Types colocated with feature --- ## 12. Canonical File Structure ``` src/ features/ my-feature/ api/ components/ hooks/ helpers/ types/ index.ts components/ SuspenseLoader/ CustomAppBar/ routes/ my-route/ index.tsx ``` --- ## 13. Canonical Component Template ```ts import React, { useState, useCallback } from 'react'; import { Box, Paper } from '@mui/material'; import { useSuspenseQuery } from '@tanstack/react-query'; import { featureApi } from '../api/featureApi'; import type { FeatureData } from '~types/feature'; interface MyComponentProps { id: number; onAction?: () => void; } export const MyComponent: React.FC = ({ id, onAction }) => { const [state, setState] = useState(''); const { data } = useSuspenseQuery({ queryKey: ['feature', id], queryFn: () => featureApi.getFeature(id), }); const handleAction = useCallback(() => { setState('updated'); onAction?.(); }, [onAction]); return ( {/* Content */} ); }; export default MyComponent; ``` --- ## 14. Anti-Patterns (Immediate Rejection) ❌ Early loading returns ❌ Feature logic in `components/` ❌ Shared state via prop drilling instead of hooks ❌ Inline API calls ❌ Untyped responses ❌ Multiple responsibilities in one component --- ## 15. Integration With Other Skills * **frontend-design** → Visual systems & aesthetics * **page-cro** → Layout hierarchy & conversion logic * **analytics-tracking** → Event instrumentation * **backend-dev-guidelines** → API contract alignment * **error-tracking** → Runtime observability --- ## 16. Operator Validation Checklist Before finalizing code: * [ ] FFCI ≥ 6 * [ ] Suspense used correctly * [ ] Feature boundaries respected * [ ] No early returns * [ ] Types explicit and correct * [ ] Lazy loading applied * [ ] Performance safe --- ## 17. Skill Status **Status:** Stable, opinionated, and enforceable **Intended Use:** Production React codebases with long-term maintenance horizons ### When to Use This skill is applicable to execute the workflow or actions described in the overview. ## Limitations - Use this skill only when the task clearly matches the scope described above. - Do not treat the output as a substitute for environment-specific validation, testing, or expert review. - Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…