所有涉及互选平台(fe_free_trade)的用户请求都从这里进入。本 skill 负责:
> 知识分层:通用流水线与 ODN 设计知识位于 shared/p1-design-analyst、shared/p1-design-spec、shared/p2-one-design、shared/p3-page-implement、shared/p4-audit、shared/p4-polish。本目录只放互选专属知识:SKILL.md、p2-page-catalog、p2-block-catalog、references/。
shared/p3-page-implement/GUIDE.md#单次-writeedit-的物理限制)。历史 trace 多次出现 1700 行 Write 被截断 → 重写又截断 → 浪费 40% 时间。huxuan-project-delivery 自带 echarts-for-react 依赖,不要它就别复制。constraints.md#错误排查铁律)。互选平台 Layout 组件:HuxuanLayout(one-design-next 已导出)。
HuxuanLayout 是完整顶栏 + 内容区方案:
DEFAULT_NAV 6 项导航:home、creator(含 4 子项:creator-finder / creator-mp / creator-weapp / creator-qq)、trending、mcn、calendar、manage(含 5 子项:manage-order / manage-report / manage-promotion / manage-recruitment / manage-project)DEFAULT_ACTIONS 2 项:recruitment(发布招募任务,子菜单 recruitment-finder / recruitment-mp)、collection(达人名单 popup)#f1f2f6)禁止用 RuyiLayout 套互选页面,不要自己写顶栏。
互选 workshop 只依赖 one-design-next(公网 npm)+ 自有 blocks/ 目录下的独立区块。
npm install one-design-next
# 或
pnpm add one-design-next
各页面用的 block:
huxuan-home:blocks/dhx-show-case-card(营销案例卡)huxuan-calendar:blocks/dhx-marketing-calendar(营销活动日历)huxuan-selection-list:blocks/card-tabs + blocks/check-tags(卡片式 Tab + 标签多选)**当用户请求匹配任何子 skill 时,必须立即加载该 skill 的 GUIDE.md 并按其流程执行。
不要直接回答用户问题。**
| 用户说了什么 | 加载的 skill / 知识包 | 路径 |
|---|---|---|
| --- | --- | --- |
| 「修这个错」/「报错了帮我看下」/「修正以上错误」/「ts 报错」/「编译失败」 | constraints「错误排查铁律」(先跑 tsc 拿真实报错,禁止读散文猜) | constraints.md#错误排查铁律 |
| 贴了截图 / 草稿图 / 线框图 | design-analyst | shared/p1-design-analyst/GUIDE.md |
| "做一个互选页面"、"搭建 XX"、"开发 XX 功能" | design-analyst | shared/p1-design-analyst/GUIDE.md |
| 给了结构化需求文档 / 设计 Prompt | design-spec | shared/p1-design-spec/GUIDE.md |
| "实现页面"、"生成页面代码"、"把设计稿转成代码" | page-implement | shared/p3-page-implement/GUIDE.md |
| "审查"、"检查"、"review"、"合规检查" | audit | shared/p4-audit/GUIDE.md |
| "精修"、"polish"、"优化细节"、"发布前" | polish | shared/p4-polish/GUIDE.md |
| "查互选页面"、"互选有哪些页面"、"XX 页面用了什么"、改某个 huxuan workshop | page-catalog | p2-page-catalog/GUIDE.md |
| "有没有现成区块"、"互选有哪些 block"、"自定义列表 block"、"复用区块" | block-catalog | p2-block-catalog/GUIDE.md |
| "有哪些组件"、"怎么用 XX"、"设计规范"、"颜色"、"图标" | 本 skill 直接答 | 见下方「知识查询」 |
| "创建项目"、"新建项目"、"初始化"、"scaffold"、"template"、"starter" | 本 skill 直接处理 | 见下方「创建项目」 |
| 贴了 huxuan.qq.com 链接、"还原互选 XX"、"从 fe_free_trade 还原" | 项目内维护流程 | .cursor/skills/p5-fe-free-trade-restore/GUIDE.md(仅本仓库内可用) |
"您想要 (A) 创建新互选项目、(B) 改已有的 huxuan workshop 页、(C) 做新页面/区块、(D) 审查代码、(E) 查组件用法、(F) 还原现网页面?"
在执行 design-analyst / design-spec / page-implement 之前,先检查:
package.json 且 dependencies 含 one-design-next?继承 ODN 全局铁律,见 shared/p2-one-design/rules/design-paradigm.md。
互选专属补充(与全局铁律同级):
| 禁止 | 替代 |
|---|---|
| --- | --- |
| 自己写白色顶栏 + Logo + 导航 Tabs + 账号下拉 | |
用 RuyiLayout 套互选页面 | HuxuanLayout |
| 把"创作者广场"、"管理中心"等一级导航做成普通 Button | 通过 HuxuanLayout 的 navItems,或直接用 DEFAULT_NAV |
互选所有 workshop demo 之间应能通过 HuxuanLayout 顶栏互相跳转。每个 demo 文件内置:
// 头部导航跳转映射(workshop demo 间跳转,无对应页的 key 不跳)
const NAV_PAGE_MAP: Record<string, string> = {
home: 'huxuan-home',
creator: 'huxuan-selection-list',
'creator-finder': 'huxuan-selection-list',
'creator-mp': 'huxuan-selection-list',
'creator-weapp': 'huxuan-selection-list',
'creator-qq': 'huxuan-selection-list',
manage: 'huxuan-project-manage',
'manage-project': 'huxuan-project-manage',
'manage-order': 'huxuan-finder-manage',
calendar: 'huxuan-calendar',
};
const CURRENT_SLUG = 'huxuan-<本页 slug>';
function goToWorkshopDemo(slug: string) {
if (typeof window === 'undefined') return;
const { pathname, search } = window.location;
const target = new RegExp(`/${CURRENT_SLUG}/?$`);
const nextPath = target.test(pathname)
? pathname.replace(target, `/${slug}`)
: `/${slug}`;
window.location.href = `${nextPath}${search}`;
}
// HuxuanLayout 上:
<HuxuanLayout
activeNav="<本页 nav key>"
onNavChange={(key) => {
const slug = NAV_PAGE_MAP[key];
if (slug && slug !== CURRENT_SLUG) goToWorkshopDemo(slug);
}}
>
...
</HuxuanLayout>
> dumi 文档站路由是 /workshop/,独立模板路由是 /。goToWorkshopDemo 同时兼容这两种环境。
互选所有接口都需要 Account_id HTTP header(不是 cookie),光有 cookie 调用会报 ret: 100012。
curl -H "Cookie: <cookie>" \
-H "Account_id: <账号id>" \
-H "Referer: https://huxuan.qq.com/trade/<...>" \
-H "Origin: https://huxuan.qq.com" \
"https://huxuan.qq.com/cgi-bin/<path>"
/cgi-bin//advertiser/marketing_activity/map)/advertiser/marketing_activity/list_published_marketing_activities)ret: 100005 = 未登录,ret: 100012 = 登录态变化(缺 Account_id、cookie 失效或 IP 变化)当用户只是提问(不是要创建/审查/修复),本 skill 直接回答,不转发。
| 用户问题类型 | 读取的文件 |
|---|---|
| --- | --- |
| 组件用法("Button 怎么用") | shared/p2-one-design/GUIDE.md + 对应 rules/ 文件 |
| 组件列表 | shared/p2-one-design/references/component-list.md |
| 设计规范 / 颜色 / Token | shared/p2-one-design/rules/design-tokens.md |
| 图标 | shared/p2-one-design/rules/icons.md |
| 已有 huxuan workshop 页(slug、改某页、对齐某页) | p2-page-catalog/GUIDE.md + p2-page-catalog/rules.md |
| 已有 huxuan block 区块(自定义列表 / 表格区块化等) | p2-block-catalog/GUIDE.md + p2-block-catalog/rules.md |
| HuxuanLayout 用法 / 子菜单结构 | 本文件「产品 Layout」+ p2-page-catalog/rules.md 各 slug 章节 |
slug 与文件名一一对应(都以 huxuan- 前缀),见 references/workshop/workshopModules.ts:
| slug | 文件 | 中文名 |
|---|---|---|
| --- | --- | --- |
huxuan-home | workshop/huxuan-home.tsx | 互选首页 |
huxuan-selection-list | workshop/huxuan-selection-list.tsx | 创作者广场(视频号) |
huxuan-finder-manage | workshop/huxuan-finder-manage.tsx | 互选订单管理(视频号) |
huxuan-project-manage | workshop/huxuan-project-manage.tsx | 营销项目管理 |
huxuan-project-detail | workshop/huxuan-project-detail.tsx | 营销项目详情 |
huxuan-project-delivery | workshop/huxuan-project-delivery.tsx | 营销项目投后数据 |
huxuan-calendar | workshop/huxuan-calendar.tsx | 营销活动日历 |
huxuan-trending | workshop/huxuan-trending.tsx | 互选趋势 |
huxuan-mcn | workshop/huxuan-mcn.tsx | MCN广场 |
huxuan-detail | workshop/huxuan-detail.tsx | 创作者详情 |
huxuan-recruitment-create | workshop/huxuan-recruitment-create.tsx | 招募任务创建 |
每个页面完全自包含:内置 HuxuanLayout + 业务内容 + mock 数据(小数据 inline / 大数据 CDN fetch)。详见 p2-page-catalog/GUIDE.md。
当用户意图为创建新项目时,从 references/ 目录组装一个基于 one-design-next 的完整项目。
**强制规则:必须使用 Vite + React + TypeScript + Tailwind CSS + one-design-next。
所有互选页面必须以 HuxuanLayout 组件为页面壳。**
Read references/MANIFEST.json,里面有完整的 scaffold / pages / requiredDeps 清单huxuan-app),无法推断时用 huxuan-apppnpm install(只需公网 npm,无腾讯内部源依赖)npm run dev 启动http://localhost:5173/(如 /huxuan-home)references/workshop/huxuan-*.tsx → src/workshop/references/workshop/workshopModules.ts → src/workshop/references/blocks/ → src/blocks/(CardTabs / CheckTags / DhxShowCaseCard / DhxMarketingCalendar / CustomColumnDrawer)SKILLS_DIR="<skills目录路径>/huxuan"
cp "$SKILLS_DIR/references/scaffold/vite.config.ts" .
cat > .npmrc << 'EOF'
auto-install-peers=true
strict-peer-dependencies=false
EOF
mkdir -p src/pages src/workshop src/blocks
cp "$SKILLS_DIR/references/scaffold/main.tsx" src/
cp "$SKILLS_DIR/references/scaffold/app.css" src/
cp "$SKILLS_DIR/references/scaffold/App.tsx" src/
cp "$SKILLS_DIR/references/scaffold/vite-env.d.ts" src/
cp "$SKILLS_DIR/references/scaffold/pages/"*.tsx src/pages/
cp "$SKILLS_DIR/references/workshop/"*.tsx src/workshop/
cp "$SKILLS_DIR/references/workshop/"*.ts src/workshop/
cp "$SKILLS_DIR/references/blocks/"*.tsx src/blocks/
references/MANIFEST.json → 找到 pages.huxuan-workshop/huxuan-.tsx pages..usesBlocks 复制对应 block 到 src/blocks/workshopModules.ts 只保留这个 slug> 互选页面间互不依赖,删一个不影响别的。
| slug | 必复制 workshop | 必复制 block | 额外 npm 依赖 | 备注 |
|---|---|---|---|---|
| --- | --- | --- | --- | --- |
huxuan-home | huxuan-home.tsx | - | - | 用了 blocks/dhx-show-case-card |
huxuan-selection-list | huxuan-selection-list.tsx | custom-column-drawer.tsx | - | 用了 blocks/card-tabs + blocks/check-tags |
huxuan-project-detail | huxuan-project-detail.tsx | custom-column-drawer.tsx | - | - |
huxuan-project-manage | huxuan-project-manage.tsx | - | - | - |
huxuan-project-delivery | huxuan-project-delivery.tsx | - | echarts-for-react | ⚠️ 不要它就别复制——多个 ECharts 依赖会拖慢首装 |
huxuan-finder-manage | huxuan-finder-manage.tsx | - | - | - |
huxuan-calendar | huxuan-calendar.tsx | - | - | 用了 blocks/dhx-marketing-calendar |
huxuan-trending | huxuan-trending.tsx | - | - | - |
huxuan-mcn | huxuan-mcn.tsx | - | - | - |
huxuan-detail | huxuan-detail.tsx | - | - | - |
huxuan-recruitment-create | huxuan-recruitment-create.tsx | - | - | 招募任务创建表单页 |
> ⚠️ 不要"为保险全拷"——历史 trace 多次出现「cp 全部 7 个 workshop → echarts-for-react 没装 → vite 启动失败 → kill 重启 → 删文件 → 再启动」的循环,浪费 3+ 分钟。
> 用户明确只要某 slug 时,按表精准 cp。
每个 skill 完成后,报告以下状态之一:
| 状态 | 含义 |
|---|---|
| --- | --- |
| DONE | 全部步骤完成。给出证据(tsc 0 error / 预览跑起来 / 用户确认)。 |
| DONE_PENDING_VERIFICATION | 改完了但当前环境装不上依赖、跑不了 tsc,需用户在自己环境验证。 |
| DONE_WITH_CONCERNS | 完成了,但有问题需要用户知道。列出每个问题。 |
| BLOCKED | 无法继续。说明原因和已尝试的方法。 |
| NEEDS_CONTEXT | 缺少信息。明确说需要什么。 |
| NEEDS_VERIFICATION | 用户要求纯静态 review(明确说"不要跑"),代码改完但未跑过 tsc/预览。 |
涉及代码产出时的强约束 + 熔断机制 + 错误处理详见 constraints.md。
共 1 个版本