用途:该技能应用于 regle 单仓库的每次拉取请求审查,作为强制性的预提交校验。所有检查均为阻断性,未全部通过或作者未处理失败前不得批准 PR。
主要能力与检查项:1)提交信息:对每个提交执行 printf '%s' "$MSG" | pnpm exec commitlint,失败时给出阻断评论与修复建议;2)工作区:执行 test -f node_modules/.modules.yaml,失败时要求运行 pnpm install;3)Lint:执行 pnpm run lint,失败时建议 pnpm run lint:fix;4)格式:执行 pnpm run fmt:check,失败时建议 pnpm run fmt。所有命令需在 pnpm install 后从仓库根目录运行。
提交信息规范:每个提交须遵循 commitlint.config.ts(@commitlint/config-conventional)的 Conventional Commits,格式为 type(optional-scope): imperative subject,可附说明原因的正文。允许类型:feat、fix、docs、style、refactor、perf、test、chore、ci、build。主题需小写、祈使语气、无结尾句号;有正文时标题与正文间留空行。
自动修复循环:依次运行 pnpm run lint:fix、pnpm run fmt、pnpm run lint、pnpm run fmt:check。
常见 commitlint 失败与修复:type-empty / subject-empty 使用 type: subject 格式;type-enum 使用允许的常规类型;subject-case 保持主题小写;subject-full-stop 移除主题结尾的句号。
适用场景:regle 单仓库内针对 Copilot 代码审查的 PR 预提交验证。限制:资料未提供该技能在其他仓库的适用性、安装方式、收费或平台信息。