用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/aiskillstore/marketplace --skill frontend-developer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Maintain a portable task-state ledger for long, multi-step work. Use when a task spans many files, produces large logs, needs a reliable handoff, or requires traceable evidence without repeatedly loading full outputs. Creates concise state records and private evidence references with explicit limits, redaction checks, and retention guidance.
【收纳储物必看】装修前不会规划收纳,入住半年家变仓库?这个 Skill 内置装修课堂会员版「家居收纳储物方法」152篇原创知识库,专门讲收纳储物——收纳是家的骨架、柜子不是越多越好、收纳本质是把东西藏起来、收纳加勤快缺一不可。问玄关鞋柜怎么装、问厨房9个收纳位置、问衣柜衣帽间怎么做、问小户型怎么榨干每1平米、问收纳避坑和鸡肋神器,全部覆盖。适合正在装修、准备收纳规划、家里东西多总是乱、想做满墙柜/通顶柜/800库的业主。
【儿童房装修必看】家里有小孩、正准备要孩子、或想给儿童房做环保安全装修?这个 Skill 内置装修课堂知识库,专门讲"适童化"——儿童是最易受甲醛伤害的人群,儿童房必须实木/ENF/控总量。问儿童房怎么装环保、问儿童房墙面地面用什么、问儿童家具选实木还是人造板、问孩子学习/游戏专区怎么规划、问有娃家庭怎么防磕碰防污染,全部覆盖。适合家里有娃、备孕婚房、想装出健康儿童房的业主。
基于 SOC 职业分类
正在显示 SKILL.md
| name | frontend-developer |
| description | 前端开发工程师Agent — 从零搭建前端项目、开发UI组件、对接API、状态管理、构建配置、调试优化、测试编写。覆盖前端开发全流程。 |
| agent_created | true |
本技能定义了一个前端开发工程师Agent,能够承担前端开发工程师的日常工作:从零搭建前端项目、开发UI组件、对接后端API、管理状态、配置构建工具、编写测试、调试优化等。覆盖前端开发全流程。
当用户提出以下类型的问题时,应加载本技能:
前端开发工程师Agent具备以下7大核心能力:
前端开发工程师Agent应启用以下工具集:
| 工具 | 用途 |
|---|---|
| terminal | 运行npm/pnpm/yarn命令、启动开发服务器、运行测试、构建项目 |
| read_file / write_file / patch | 读写/编辑前端代码文件 |
| search_files | 搜索代码、查找文件 |
| execute_code | 批量处理、代码生成、数据转换 |
| web_search | 查文档、查API用法、查bug解决方案 |
| delegate_task | 并行任务(同时搭建多个组件、并行测试) |
用户需求
│
▼
┌─────────────────────────────────────┐
│ 1. 需求理解 │
│ - 明确要做什么(组件/页面/功能) │
│ - 确认技术栈(React/Vue/Angular) │
│ - 确认约束(浏览器兼容、响应式等) │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 2. 方案设计 │
│ - 组件拆分与接口设计 │
│ - 数据流设计 │
│ - 目录结构规划 │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 3. 编码实现 │
│ - 创建文件/组件 │
│ - 实现逻辑 │
│ - 编写样式 │
│ - 对接API │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 4. 验证与调试 │
│ - 运行项目验证 │
│ - 修复编译/运行时错误 │
│ - 浏览器调试 │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 5. 测试与质量 │
│ - 编写测试 │
│ - 运行测试验证 │
│ - 代码格式化/检查 │
└─────────────────────────────────────┘
## 场景工作流
### 场景1:从零搭建前端项目
用户需求(项目类型、技术栈偏好) │ ▼ ┌─────────────────────────────────────┐ │ 1. 项目初始化 │ │ - 使用脚手架创建项目 │ │ - 安装核心依赖 │ │ - 配置TypeScript │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 2. 工程化配置 │ │ - ESLint + Prettier │ │ - Husky + lint-staged │ │ - 路径别名(@/) │ │ - 环境变量 │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 3. 目录结构创建 │ │ - src/components/ │ │ - src/pages/ │ │ - src/hooks/ │ │ - src/stores/ │ │ - src/utils/ │ │ - src/types/ │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 4. 核心依赖安装 │ │ - 状态管理(Zustand/Pinia/Redux) │ │ - 路由(React Router/Vue Router) │ │ - UI库(Ant Design/Element Plus) │ │ - HTTP客户端(axios/fetch) │ │ - 样式方案(Tailwind/Sass) │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 5. 验证运行 │ │ - 启动开发服务器 │ │ - 确认无编译错误 │ │ - 确认页面正常渲染 │ └─────────────────────────────────────┘
需求(组件功能、Props接口、交互行为)
│
▼
┌─────────────────────────────────────┐
│ 1. 组件设计 │
│ - 定义Props接口(TypeScript类型) │
│ - 确定组件状态与生命周期 │
│ - 确定样式方案 │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 2. 组件实现 │
│ - 创建组件文件 │
│ - 实现模板/JSX │
│ - 实现样式 │
│ - 实现交互逻辑 │
│ - 处理边界情况(loading/empty/error)│
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 3. 集成验证 │
│ - 在页面中引用组件 │
│ - 启动开发服务器验证 │
│ - 修复编译/运行时错误 │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 4. 测试(可选) │
│ - 编写组件测试 │
│ - 运行测试验证 │
└─────────────────────────────────────┘
### 场景3:对接后端API
需求(API文档、数据模型) │ ▼ ┌─────────────────────────────────────┐ │ 1. 定义数据模型 │ │ - TypeScript接口/类型定义 │ │ - 请求/响应类型 │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 2. 创建API服务层 │ │ - 创建axios/fetch实例 │ │ - 配置拦截器(认证、错误处理) │ │ - 创建API函数 │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 3. 集成到组件 │ │ - 在组件中调用API │ │ - 处理loading/error/empty状态 │ │ - 实现数据缓存/乐观更新 │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 4. 验证 │ │ - 启动开发服务器 │ │ - 确认数据正常加载 │ │ - 确认错误状态处理正确 │ └─────────────────────────────────────┘
Bug报告 / 错误信息
│
▼
┌─────────────────────────────────────┐
│ 1. 问题定位 │
│ - 查看错误信息/堆栈 │
│ - 定位问题文件/组件 │
│ - 复现问题 │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 2. 根因分析 │
│ - 检查相关代码 │
│ - 检查数据流 │
│ - 检查网络请求 │
│ - 检查状态变化 │
└──────────┬──────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 3. 修复 │
│ - 编写修复代码 │
│ - 验证修复 │
│ - 确认无副作用 │
└─────────────────────────────────────┘
### 场景5:性能优化
性能问题 / Lighthouse报告 │ ▼ ┌─────────────────────────────────────┐ │ 1. 性能诊断 │ │ - 分析Lighthouse报告 │ │ - 检查Bundle大小 │ │ - 检查网络请求 │ │ - 检查渲染性能 │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 2. 优化实施 │ │ - 代码分割(dynamic import) │ │ - 图片优化(懒加载、WebP、响应式) │ │ - 组件渲染优化(memo、虚拟列表) │ │ - 缓存策略 │ └──────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────┐ │ 3. 验证效果 │ │ - 重新测量性能指标 │ │ - 确认优化有效 │ └─────────────────────────────────────┘
// src/components/ComponentName/index.tsx
import { FC } from 'react';
interface ComponentNameProps {
title: string;
onClick?: (id: string) => void;
disabled?: boolean;
loading?: boolean;
}
export const ComponentName: FC<ComponentNameProps> = ({
title,
onClick,
disabled = false,
loading = false,
}) => {
if (loading) return <div>加载中...</div>;
return (
<div>
<h2>{title}</h2>
<button onClick={() => onClick?.(id)} disabled={disabled}>点击</button>
</div>
);
};
// src/api/client.ts
import axios from 'axios';
const apiClient = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL,
timeout: 10000,
headers: { 'Content-Type': 'application/json' },
});
// 请求拦截器 - 添加Token
apiClient.interceptors.request.use((config) => {
const token = localStorage.getItem('token');
if (token) {
config.headers.Authorization = `Bearer ${token}`;
}
return config;
});
// 响应拦截器 - 统一错误处理
apiClient.interceptors.response.use(
(response) => response.data,
(error) => {
if (error.response?.status === 401) {
window.location.href = '/login';
}
return Promise.reject(error);
}
);
apiClient;
// src/stores/useAuthStore.ts
import { create } from 'zustand';
import { devtools, persist } from 'zustand/middleware';
interface AuthState {
user: User | null;
token: string | null;
isAuthenticated: boolean;
login: (credentials: LoginParams) => Promise<void>;
logout: () => void;
}
export const useAuthStore = create<AuthState>()(
devtools(
persist(
(set) => ({
user: null,
token: null,
isAuthenticated: false,
login: async ({ username, password }) => {
const { token, user } = await apiClient.post('/auth/login', { username, password });
set({ token, user, isAuthenticated: true });
},
logout: () => {
({ : , : , : });
},
}),
{ : , : ({ : state. }) }
)
)
);
// src/hooks/useUsers.ts
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { apiClient } from '@/api/client';
import type { User } from '@/types/user';
export function useUsers() {
return useQuery<User[]>({
queryKey: ['users'],
queryFn: () => apiClient.get('/users'),
});
}
export function useUser(id: string) {
return useQuery<User>({
queryKey: ['users', id],
queryFn: () => apiClient.get(`/users/${id}`),
enabled: !!id,
});
}
export function useCreateUser() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (data: Partial<>) => apiClient.(, data),
: {
queryClient.({ : [] });
},
});
}
// src/components/Button/__tests__/Button.test.tsx
import { render, screen, fireEvent } from '@testing-library/react';
import { describe, it, expect, vi } from 'vitest';
import { Button } from '../index';
describe('Button', () => {
it('renders with text', () => {
render(<Button>点击</Button>);
expect(screen.getByText('点击')).toBeInTheDocument();
});
it('calls onClick when clicked', () => {
const onClick = vi.fn();
render(<Button onClick={onClick}>点击</Button>);
fireEvent.click(screen.getByText('点击'));
expect(onClick).toHaveBeenCalledTimes(1);
});
it('does not call onClick when disabled', () => {
const onClick = vi.fn();
();
fireEvent.(screen.());
(onClick)..();
});
(, {
();
(screen.()).();
});
});
# React + Vite + TypeScript
npm create vite@latest my-app -- --template react-ts
# Next.js
npx create-next-app@latest my-app --typescript --tailwind --eslint
# Vue + Vite
npm create vite@latest my-app -- --template vue-ts
# Nuxt
npx nuxi init my-app
# 状态管理
npm install zustand
npm install @tanstack/react-query
# UI库
npm install antd @ant-design/icons
npm install element-plus # Vue
# HTTP
npm install axios
# 样式
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
# 测试
npm install -D vitest @testing-library/react @testing-library/jest-dom
npm install -D @playwright/test
npx playwright install
# 代码质量
npm install -D eslint prettier eslint-config-prettier
npm install -D husky lint-staged
npx husky init
software-architect — 软件架构师Agent(出方案、画架构图、写ADR、技术选型)backend-developer — 后端开发工程师Agent(API开发、数据库、部署运维)arch-c4-diagram — C4架构图生成arch-adr — 架构决策记录arch-tech-evaluation — 技术选型评估mobile-engineer — 移动端工程师Agent(iOS/Android/Flutter/React Native开发)chinese-pdf-generation — 将技能内容/报告输出为PDF文档(参考本文档:~/.hermes/skills/software-engineering/frontend-developer/references/skill-pdf-documentation.md)