frontend-development
Skill1 starsChanged 7 months agoMITView on GitHub
前端实现知识包。auto-loaded by /build-web 与 /impl。当 main thread 实现 web/ 下代码时,本 skill 提供契约对齐 / UI 库规范 / AI 设计源接入 / Hard Requirements。M6.4 起替代 frontend-agent subagent,让实现过程在 main thread 流式可见。
13 other projects use a version of this.
Adopted by
Most recently taken up by
- lubusIN/frappe-skillstheir own version, first seen Nov 4, 2026
- its-ash/skillstheir own version, first seen Nov 1, 2026
- liushikuan63/Qoder-Optimizationtheir own version, first seen Nov 1, 2026
- KMaruthi2002/universal-llm-skillstheir own version, first seen Oct 25, 2026
- taichuy/1flowbasetheir own version, first seen Oct 23, 2026
- typv/nest-turbo-startertheir own version, first seen Oct 8, 2026
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 13
- All-Hands-AI/OpenHands★ 93ksame name
- OpenHands/OpenHands★ 93ksame name
- taichuy/1flowbase★ 292same name
- typv/nest-turbo-starter★ 224same name
- ambient-code/platform★ 131same name
- avibebuilder/claude-prime★ 119same name
- lubusIN/frappe-skills★ 68same name
- aws-solutions/konductor★ 11same name
- Ampli-Group/agentic-mobile-blueprint★ 4same name
- liushikuan63/Qoder-Optimization★ 2same name
3 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- acceptance-criteriaSkill
- ai-native-designSkill
- api-contract-firstSkill
- backend-developmentSkill
- checkpoint-commitSkill
- ddt-baseline-syncSkill
- ddt-brief-builderSkill
- decision-gateSkill
- delivery-packageSkill
- efficiency-metricsSkill
- relaySkill
- validation-loopSkill
The file
Files
Frontend Development · 前端实现知识包
M6.4 整改:v0.6.x 用 frontend-agent subagent 黑盒派发。v0.7.0 改 main thread + 6-phase 范式。 本 skill 是 main thread 实现 web/ 时的"必读知识包"。
Triggers
/build-web命令的 IMPLEMENT phase(仅frontend.type === "spa";server-side/none由 build-web Phase 1 提前 noop 退出)/impl命令串行执行前端阶段- 任何 main thread 写
web/**/*.{tsx,ts,vue,html,css}文件时 /design-brief编译 brief 与/design-execute --channel <type>派发/摄取外部设计稿时
PR-E(v0.7.2):当
.ddt/tech-stack.json::frontend.type是server-side(Thymeleaf/JSP/FreeMarker/...)或none时,没有独立的web/工程,本 skill 不应被触发。模板由 backend 项目(如src/main/resources/templates/)承载,归/build-api+skills/backend-development处理。
Inputs(main thread 必读清单)
docs/api-contract.yaml(唯一接口真相源)docs/prd.md(UX 语义参考).ddt/tech-stack.json(前端栈 + ai_design 选项 SSoT,禁止偏离)skills/api-contract-first/SKILL.md(契约优先原则)skills/ai-native-design/SKILL.md(AI 设计稿工作流:claude-design / figma / v0)contexts/delivery.md(DDT 全局上下文)rules/delivery/agent-invariants.md(6 条全局不变量)
Hard Requirements(main thread 必须遵守)
- 严格按契约:不得擅自发明字段、改字段名、改错误码(contract 不清写 blocker,不要猜)
- build/lint/typecheck:完成后必须跑构建 + lint + type-check + 最小 happy-path UI 测试
- 代码组织:
web/目录;组件测试放web/__tests__/ - 统一 client:所有网络调用走统一 client(自动从 OpenAPI 生成 types,如
openapi-typescript) - 栈刚性约束:必须使用
.ddt/tech-stack.json::frontend段定义的 framework / bundler / ui / state / data_fetching;禁止偏离 - AI-native UI 工作流:按
tech-stack.json::ai_design.type决定 UI 来源(claude-design / figma / v0);接入流程统一为/design-brief→/design-execute --channel <type>→ main thread 按ai-native-design SKILL §7改写 - SSoT 锁死:
.ddt/tech-stack.json仅可 Read,严禁 Write/Edit/MultiEdit(PreToolUse hook 硬拦截) - validation loop:每完成一个组件立即跑 build / lint / type-check / 组件测试,失败立即停下
6-Phase 实施流程(main thread)
Phase 1: EXPLORE
如果 web/ 已有代码:
- 用 Grep / Glob / Read 扫描组件树 + 已有 hooks / store / api client
- 找类似页面作参照
- 落
docs/build-web-exploration.md
如果空目录:
- 跑
tech-stack.json::frontend.scaffold_cmd - 落基础配置
Phase 2: PLAN
落 docs/build-web-plan.md:组件树 / Files to Create / Build Sequence / Endpoint × 组件映射表(v0.9.13 D30 强制) / Validation Strategy。
组件树视图让用户能扫一眼判断结构。
Endpoint × 组件映射表(必填,v0.9.13 D30 实战驱动):
## Endpoint × 组件映射
| 页面/组件 | 消费的 endpoint | 数据获取方式 | mock 替换状态 |
|---|---|---|---|
| MonitorPage | GET /vehicles + GET /alerts | useQuery + apiClient.GET | 替换 VEHICLES / ALERT_QUEUE const |
| TasksPage | GET /tasks | useQuery + apiClient.GET | 替换 TASKS const |
| AlertsPage | GET /alerts + POST /alerts/{id}/handle | useQuery + useMutation | 替换 ALERT_QUEUE const |为什么强制:v0.9.13 D30 实战发现 tech-stack.json::type_generation 已声明 openapi-typescript,但 web 全部内联 mock const,零 API 调用。PLAN 阶段强制列映射表 → IMPLEMENT 阶段不能跳过 API client 直接抄 prototype mock。
Phase 3: APPROVE(由 build-web.md 触发)
调用 AskUserQuestion 让用户批准 plan。
Phase 4: IMPLEMENT(main thread)
按 plan 逐步:写代码 → validation-loop → checkpoint commit。
若 tech-stack.json::ai_design.type 是 figma / v0,先跑 /design-brief 编译 brief,再 /design-execute --channel <type> 派发 + 摄取,最后 main thread 按 ai-native-design SKILL §7 改写为符合契约的 React 组件。
Phase 5: VERIFY
- vite build / eslint 0 errors / tsc --noEmit 0 errors / vitest run
bin/check-contract-alignment.mjs(扫禁用模式 + 字段对齐)bin/audit-schema-alignment.mjs(v0.9.14 D31):mock 字段 vs contract schema 三方差集,输出docs/schema-audit.md(warning 不阻塞,但 LLM 必须看 hot-list 后决策修复优先级)
Phase 6: SUMMARY
落 docs/build-web-summary.md。
--module 分块实现
/build-web --module auth-pages
/build-web --module task-board每轮独立 6-phase。
AI-native UI 工作流(按 tech-stack.json::ai_design.type 选)
| type | 流程 |
| claude-design(默认) | /design-brief 编 brief → /design-execute --channel claude-design 生成 prompt 包 → 用户在 claude.ai/design 迭代 → --bundle <zip> 摄取到 .ddt/design/claude-design/raw/ → main thread 按 ai-native-design SKILL §7 改写 |
| figma | /design-brief → /design-execute --channel figma 写 MCP 引导清单 → main thread 调 figma MCP get_design_context → 按 §7 转 React+Tailwind |
| v0 | /design-brief → /design-execute --channel v0 --url <share> → 解析 share URL → npx shadcn@latest add ... → 按 §7 接 OpenAPI client |
详见 skills/ai-native-design/SKILL.md。
Self-Check
- 构建通过(vite build / next build 无报错)
- lint 0 error
- type-check 0 error
- 每个新页面有至少 1 个 happy-path 测试
- 未出现契约外字段(已全文搜索核查)
- 状态管理 / 数据获取与 tech-stack.json 一致
- tech-stack.json 未被 Edit(git diff 验证)
Don't
- ❌ 不要随便加 antd / mui 等 tech-stack.json 外的 UI 库
- ❌ 不要把 prototype(claude-design / figma / v0 bundle)的 mock 数组直接复制到生产代码(v0.9.13 D30 实战根因):bundle 含
const MON_VEHICLES = [...]这种演示用假数据,应在 IMPLEMENT 阶段删除并改用apiClient.GET('/vehicles')。bundle 是视觉与结构来源,不是数据来源。 - ❌ 不要硬编码 mock 数据替代 API client(典型反模式:
const TASKS = [...]在 page 顶部 + 用useState(TASKS)) - ❌ 不要保留 supabase / v0-sdk 等"AI 设计源框架默认依赖"
API client 强制使用(v0.9.13 D30)
/build-web Phase 1 EXPLORE 自动跑 bin/generate-api-client.mjs,产出:
web/src/api/types.ts(openapi-typescript 自动生成;contract 未变不重生)web/src/api/client.ts(openapi-fetch 模板;首次创建后用户可改)web/src/api/README.md(使用说明)
IMPLEMENT 阶段每个组件:
// ✅ 正确:用 generated client + react-query
import { apiClient, unwrap } from '@/api/client';
import { useQuery } from '@tanstack/react-query';
const vehiclesQuery = useQuery({
queryKey: ['vehicles'],
queryFn: () => unwrap(apiClient.GET('/vehicles')),
});
const vehicles = vehiclesQuery.data ?? [];
// ❌ 错误:硬编码 mock(被 bin/check-contract-alignment.mjs D30 检测到 → warning)
const VEHICLES = [
{ id: 'V001', status: 'transport' },
];bin/check-contract-alignment.mjs 在 VERIFY 阶段扫 web/src 下的"contract 已定义 endpoint × 同名 mock 数组"反模式,输出清单到 docs/build-web-summary.md(warning 不阻塞)。
Do
- ✅ EXPLORE 阶段先看现有 web/,避免重写
- ✅ PLAN 阶段提供组件树视图
- ✅ IMPLEMENT 每个组件立即 vitest run
- ✅ 复杂 UI 用 --module 分块
Templates & References
skills/api-contract-first/SKILL.mdskills/ai-native-design/SKILL.mdskills/validation-loop/SKILL.mdskills/checkpoint-commit/SKILL.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

