with one click
code-fix
// Use when: fixing code convention issues found in convention-audit reports. Triggers on: 自动修复, 整改偏差, 修复报告, 规范整改, 修复偏差, code fix, 整改规范.
// Use when: fixing code convention issues found in convention-audit reports. Triggers on: 自动修复, 整改偏差, 修复报告, 规范整改, 修复偏差, code fix, 整改规范.
| name | code-fix |
| description | Use when: fixing code convention issues found in convention-audit reports. Triggers on: 自动修复, 整改偏差, 修复报告, 规范整改, 修复偏差, code fix, 整改规范. |
读取 reports/规范审查报告.md 中的偏差条目,在用户确认 diff 后执行单条或分组修复。
前置:必须先运行
convention-audit生成审计报告,code-fix 依赖其输出。
范围:仅修复 🟡 / 🟢 等级偏差;🔴 严重偏差必须人工或 page-codegen 重新生成。
reports/规范审查报告.md(convention-audit 输出)
│
▼
[1] 用户从报告挑选 issueId(或 issueGroup),或说"列出可修复项"
│
▼
[2] 解析 issue → 定位文件 + 行号 + 偏差类型
│
▼
[3] 选择修复策略:
├─ rule-based(如缺 :scoped、缺 cid 等)→ 直接按规则生成 patch
└─ ai-based(语义性偏差)→ AI 生成 patch
│
▼
[4] Pre-flight 输出 diff 预览(人读,必须等待确认)
│
▼
[5] 用户 yes → 写入文件 + 在报告中标记该条目为 ✅ 已修复
用户 no → 跳过该 issue,回到挑选界面
| 原则 | 说明 |
|---|---|
| 不修 🔴 | 严重偏差必须人工或 page-codegen 处理,code-fix 不介入 |
| 不破坏功能 | 只改报告点名的行,不顺手"重构"周边代码 |
| 不批量盲改 | 每个文件都先 diff 预览,禁止跳过用户确认 |
| 不生成新逻辑 | 只修偏差,不做功能补全(那是 page-codegen 的职责) |
| 范围明确 | 若用户引导修改业务逻辑,必须拒绝并说明原因 |
| 偏差类型 | 来源 standards | 策略 |
|---|---|---|
| EColumn 缺 cid | standards/12-base-table.md | rule-based |
列级 cid 只用缩写前缀(如 mca-steelCode) | standards/12-base-table.md | rule-based |
scss 文件缺 :scoped 包裹 | standards/02-code-structure.md | rule-based |
| import 路径不规范 | standards/04-coding-basics.md | rule-based |
any 滥用(> 3 处/页) | standards/09-typescript.md | ai-based |
| API_CONFIG URL 命名偏差 | api-contract.md | ai-based |
| 表格列定义与 api.md 字段不一致 | api-contract + data-ts | ai-based |
| 业务语义偏差(流程不对) | 多 standards 综合 | 不修复,标记人工 |
"修复 reports/规范审查报告.md 中的 issue#3" → 单条修复
"修复 reports/规范审查报告.md 中所有 scss 偏差" → 分组修复
"修复全部 rule-based 偏差,跳过 ai-based" → 受控批量
"列出可修复的 issue" → 仅列清单,不动任何文件
🚀 已触发技能 ops/code-fix/SKILL.md → 受控自动修复偏差
✅ 已读取 reports/规范审查报告.md → 找到 12 条偏差(rule-based 8 条,ai-based 4 条)
✅ 当前目标:issue#3(EColumn 缺 cid)→ 文件 src/views/sale/order/data.ts L42
⚠️ 以下操作会修改文件,请在 diff 预览后确认
| Skill | 关系 |
|---|---|
| convention-audit | 前置:必须先有审计报告,code-fix 才有输入 |
| page-codegen | 互斥:生成新页面用 codegen,不用 fix |
| template-extract | 无直接关系 |
Use when: auditing project source code against the 14 modular standards in .github/standards/. Outputs deviation report and component-extraction suggestions to reports/. Triggers on: 规范审计, 规范检查, 代码审计, 对齐规范, 规范偏差, 接手新项目, 存量代码分析, 项目体检, audit code, check conventions, onboard project.
Use when: analyzing Axure exported HTML prototype files to extract page inventory, classify interaction patterns, identify reusable components, and produce a structured page checklist for Vue development. Also supports NON-standard detailed design documents (free-form MD/Word) or natural language descriptions as input. DO NOT use for standard requirement-spec documents produced by wl-skills-design (path contains docs/spec/, has function codes like PMMB001, IPO tables, flow five-elements) — route those to spec-doc-parse instead. Triggers on: prototype analysis, axure scan, page inventory, 原型解析, 页面清单, axure转vue, 口述需求, 自然语言建页面, natural language page request, 建个页面, 写个页面, 口头描述页面.
Use when: parsing STANDARD requirement-design specification documents produced by wl-skills-design (path contains docs/spec/, files like ch1-3.md / 4.x-{module}.md / 4.N-data-report.md, with function codes like PMMB001, IPO tables containing 处理逻辑, and flow descriptions with five-elements) into the SAME page-spec JSON consumed by page-codegen. This is the 规范线 (spec line) counterpart to prototype-scan (原型线). Self-validating, self-correcting, report-producing. Triggers on: 解析说明书, 解析需求文档, 解析详设, 规范文档转页面, 根据说明书生成, spec doc parse, IPO 转页面, docs/spec, 功能编码, 需求设计说明书.
Use when: generating complete Vue 3 page code (index.vue + data.ts + modal components + api.md + pages.ts registration) from a prototype page inventory and API contract, strictly following the cx-ui-produce project conventions. Read SKILL.md first (rules+constraints), then read the matching TPL-*.md for the template code. Triggers on: generate page, create page, code generation, 生成页面, 页面代码, 代码生成, vue页面, 按原型生成, 口述需求, 建个页面, 写个页面, 帮我生成, natural language page generation.
Use when: managing roles, authorizing menus to roles, attaching action buttons (type=A) to page menus, or wiring permission field in data.ts toolbar config. Triggers on: 创建角色, 角色管理, 角色授权, 给角色分配菜单, 挂动作, 添加动作按钮, 同步权限, 权限码注册, role assign, permission sync.
Use when: syncing data dictionary entries to the backend, pulling the current online dictionary baseline, or checking which dictionaries used in data.ts are missing from the system. Triggers on: 同步字典, 创建字典, 刷新字典基线, 字典对比, 字典审计, dict sync, create dict.