원클릭으로
frontend-dev-lessons
cryptotrading 项目专用前端开发技能。用户提及前端开发相关问题时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
cryptotrading 项目专用前端开发技能。用户提及前端开发相关问题时使用。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
在当前会话中执行包含若干独立任务的实现计划时使用
Kimi WebBridge lets AI control the user's real browser — navigate, click, type, read, screenshot, and interact with any website using the user's actual login sessions. Use this skill whenever the user wants to interact with websites, automate browser tasks, scrape web content, or perform any action requiring a real browser. Also use when the user mentions "browser", "webpage", "open URL", "screenshot", or asks to read/interact with any website. Use even for simple-sounding browser requests — the daemon handles all complexity.
对 PostgreSQL 数据库执行只读检查时使用。优先读 doc/db/quick-guide 匹配场景,表结构按需 docker exec psql 查询;查库后评估是否沉淀 quick-guide。触发词:查数据库、检查表、行数、数据覆盖、schema、docker exec psql、DB 状态、doc/db、快捷检索指南、quick-guide。
在进行任何创意性工作之前必须使用此技能 — 创建功能、构建组件、添加功能、实现需求或修改行为。在实现前探索用户意图、需求和设计。用户说"头脑风暴"或类似的表达时,应触发此技能。
调用 DeepSeek API(/chat/completions)的强制查阅规范,覆盖思考模式(reasoning_content / thinking / reasoning_effort)与多轮对话上下文拼接。**任何**涉及 DeepSeek API 的代码编写、修改、排错前必须先调用本 skill。触发词:DeepSeek、deepseek、deepseek-v4-pro、reasoning_content、思考模式、thinking mode、reasoning_effort、deepseek 多轮、deepseek chat completions、api.deepseek.com。
当面临 2 个以上可独立执行、无共享状态或顺序依赖的任务时使用
| name | frontend-dev-lessons |
| description | cryptotrading 项目专用前端开发技能。用户提及前端开发相关问题时使用。 |
在 apps/web 做任何前端修改时,先读取本技能。项目技术栈是 Vue 3 + TypeScript + Vite + Naive UI + Vue Router,样式体系以 apps/web/src/styles/design-system.css 和 apps/web/src/styles/tokens 为准。
修改前先看相邻实现,优先沿用既有 component、composable、API client、Naive UI 组件和设计系统。单文件接近 500 行时先拆分职责,避免继续堆逻辑。
.prompts/misc/DESIGN-binance.md;K 线相关参考 apps/web/src/components/backtest/KlineChartModal.vue 和 apps/web/src/components/kline/KlineChart.vue,不要从零重建。cd apps/web; pnpm exec vue-tsc --noEmit
项目已有 filter 命令时也可以运行:
corepack pnpm --filter @cryptotrading/web type-check
PowerShell 中不要使用 &&。除非用户明确要求,不要启动 Vite preview。
any,用 unknown 加类型收窄。arr[i] || {} 后再读属性;这会让缺失数据变成空对象并掩盖类型/运行时问题。encoding='utf-8'。<meta charset="UTF-8">。.vue、.ts、.css 中不要手写 #xxxxxx 或 rgba(...) 颜色值;必须从 apps/web/src/styles/tokens 或设计系统中引用。apps/web/src/styles/design-system.css。n-modal 可能 teleport,scoped CSS 未必能约束真实 card。需要控制 card 尺寸时,优先在 n-modal 上直接绑定 style:
<n-modal
v-model:show="showModal"
preset="card"
:style="{ width: 'min(480px, calc(100vw - 32px))' }"
/>
Condition/filter modals 的默认经验:
480px。calc(100vw - 32px)。max-height 和 overflow-y: auto。不要猜 Naive UI 是否导出某个类型。需要 NSelect option typing 时,检查 apps/web/node_modules/naive-ui 下的本地声明,或者使用本地联合类型。
Grouped options 形如:
{
type: 'group',
label: 'Group label',
key: 'stable-key',
children: [{ label: 'Field', value: 'field' }],
}
多个 panels 都需要 numeric conditions 时,通常只抽取 condition editor:
interface NumericCondition {
field: string
op: 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | 'neq'
value: number
}
Shared component 可以负责打开/关闭 Modal、编辑单个 condition、添加/删除/清空 conditions、展示 active count。
Parent feature component 仍负责 search text、market/industry selectors、interval selectors、field options、labels、API request timing、reset/apply semantics。除非两个页面拥有几乎相同的业务字段,否则不要抽取完整 business filter bar。
表格的分页、表头排序、筛选都走后端;筛选与排序必须基于全量数据,不能只处理当前页。表头排序使用 n-data-table 内置能力,但请求和排序结果由后端负责。
添加 advanced filters 时:
对于 A-share technical filters,latest-row list filtering 应 join 最新的 quote/metric/indicator rows,并通过 CONDITION_COL_MAP 这类 whitelist 映射每个允许字段。
操作 列。[10, 20, 50],默认 10。render 实现:如果颜色、文本状态、徽标等由当前单元格值决定,优先在列定义里计算并绑定到 render 输出,避免依赖父组件 scoped/:deep() 样式去覆盖 n-data-table 内部 DOM。colors.success.DEFAULT / colors.error.DEFAULT)或 CSS token,不要手写颜色值;保留语义 class 可以用于复用,但关键视觉结果不要只依赖跨组件 CSS 覆盖。sortOrder 恒为 false,避免默认排序假高亮;请求仍可带默认 sortBy/sortOrder。explicitSort 区分默认排序和用户点击。用户点击了与默认同列同向的排序,也应视为显式并高亮。explicitSort=false;仅修改筛选不应改变 explicitSort。runId 缓存如果保存表格状态,必须包含 explicitSort。n-data-table remote 不会接管数据或分页状态,调用方必须完整控制:
@update:page 和 @update:page-size,在回调中更新 page、pageSize 并重新加载。pagination computed 必须包含 itemCount: total.value。:data 必须是后端分页后的当前页数据;remote 模式不会自动 slice。page/pageSize 或 skip/take,并返回 { rows, total, page, pageSize }。SymbolsView.vue、BacktestDetail.vue、candle-log.controller.ts、symbols.service.ts。Custom series 的 data 不能包含 null 项。ECharts 仍会对 null 调用 renderItem,api.value(n) 可能返回 0,导致 y=0 幽灵柱并破坏 yAxis 自动量程。
正确做法:
flatMap() 过滤无效项,只保留有效数据。idx 存入 data 第 0 维。renderItem 中用 api.value(0) 取原始 x 坐标。params.dataIndex,它是过滤后数组的局部索引。position: 'right' 叠加。新增或重排 Kline chart panes 时,必须同步更新所有耦合结构:
gridxAxisyAxisxAxisIndex / yAxisIndexdataZoom.xAxisIndexaxisPointer.linkK 线图或副图修改优先参考现有实现,不要从零设计。
删除可见 UI modules 时,移除完整 usage chain:
最后运行前端 type-check,捕获遗漏的 template/script references。