一键导入
hf-regression-gate
适用于 traceability review 通过后需回归验证、用户要求 regression check 的场景。不适用于判断任务完成(→ hf-completion-gate)、状态收尾(→ hf-finalize)、阶段不清(→ hf-workflow-router)。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
适用于 traceability review 通过后需回归验证、用户要求 regression check 的场景。不适用于判断任务完成(→ hf-completion-gate)、状态收尾(→ hf-finalize)、阶段不清(→ hf-workflow-router)。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when starting an existing-code bug audit on a repository or large directory tree. First detects project language + architecture (e.g. C/C++ embedded SOA, Python web service, frontend SPA), proposes a tailored review checklist (scenario-specific bug categories) for user confirmation, then slices the codebase into modules within a per-module token budget. Produces plan.json with profile + review_checklist + modules that downstream audit-reviewer consumes module-by-module. Not for PR diff review (use hf-code-review) or for actually finding bugs (use audit-reviewer).
Use as the FINAL stage of the code-audit pipeline. Reads confirmed.json (output of audit-verifier) and renders a self-contained single-file HTML report (always) and optionally an Excel workbook. The HTML contains summary stats by severity/category/module, filterable finding cards with code snippets and audit trails (reviewer + verifier). Not for emitting findings (use audit-reviewer) or verifying findings (use audit-verifier).
Use when scanning an existing-code module for bugs and emitting finding drafts. Reads source files within one module from the plan.json produced by audit-planner, walks files line-by-line, emits findings/<module>.json with file path, line numbers, category, severity, confidence, code snippet evidence, and reasoning. The set of allowed finding categories is sourced from plan.json's review_checklist (scenario preset such as c-cpp-embedded-soa / python-web-service / frontend-spa / generic) rather than a fixed taxonomy — keep findings scoped to the user-confirmed checklist. This is the PRIMARY (first-stage) reviewer in the two-agent confirmation pipeline; downstream audit-verifier independently confirms each finding. Not for PR diff review (use hf-code-review) or for verifying findings (use audit-verifier).
Use as the SECOND-STAGE independent confirmer in the two-agent code-audit pipeline. Reads finding drafts produced by audit-reviewer and independently re-examines each one against the actual source code, writes verifications/<module>.json with status (confirmed/rejected/upgrade/downgrade/needs_more_evidence), reason, and evidence_check. Operates with FRESH context — does not see reviewer's internal reasoning beyond what is recorded in the finding's description+evidence fields, to enable independent judgement. Not for emitting new findings (use audit-reviewer) or rendering the report (use audit-reporter).
Use when hf-test-driven-dev finishes GREEN on a frontend-touching active task whose spec declares a UI surface, and fresh browser runtime evidence (screenshot / console log / network trace) is required for downstream gates. Not for issuing verdicts (gates do that), not for replacing hf-test-review's test-quality review, not for backend-only tasks.
适用于 test review 通过后评审代码质量、用户要求 code review 的场景。不适用于评审测试(→ hf-test-review)、写/修代码(→ hf-test-driven-dev)、阶段不清(→ hf-workflow-router)。
| name | hf-regression-gate |
| description | 适用于 traceability review 通过后需回归验证、用户要求 regression check 的场景。不适用于判断任务完成(→ hf-completion-gate)、状态收尾(→ hf-finalize)、阶段不清(→ hf-workflow-router)。 |
防止"修好了本地但破坏了相邻模块"。在最小回归验证范围内收集 fresh evidence,判断回归面是否健康。运行在 traceability-review 之后。
不是 completion gate(判断当前任务完成),也不是 finalize(收尾)。
本 skill 融合以下已验证方法:
适用:traceability review 通过后需回归验证;用户要求 regression check。
不适用:判断任务完成 → hf-completion-gate;状态收尾 → hf-finalize;阶段不清 → hf-workflow-router。
确认当前 profile 必需的 review/gate 记录齐全且结论支持继续。
Profile-aware 回归范围:
full:traceability 识别的所有区域standard:直接相关模块lightweight:最小 build/test 入口Evidence-tier 回归范围(按当前 task / traceability 影响面叠加,不被 profile 降级覆盖):
| Evidence Tier | 可证明什么 | 不能证明什么 |
|---|---|---|
mocked-unit | 纯逻辑、局部函数、隔离组件行为 | 真实浏览器、真实 API、App 根配置、跨组件集成 |
component-integration | 真实子组件组合、provider / router / store 配置 | 真实浏览器网络栈、后端契约 |
api-contract | 前后端路径、method、status、DTO 字段、base URL / proxy 一致 | 浏览器渲染和用户交互 |
browser-runtime | DOM / Console / Network 三层真实浏览器行为 | 后端持久化完整性、非浏览器服务间流程 |
full-stack-smoke | 启动服务、健康检查、关键端到端用户流 | 大规模性能、全量业务覆盖 |
触发规则:
browser-runtime;若有后端交互,同时需要 api-contract 或 full-stack-smokebrowser-runtime 必须包含 UI conformance evidence:截图路由+viewport、DOM anchors、console/network 记录、与 UI Implementation Contract 的匹配结论api-contractfull-stack-smokehappy-dom / jsdom / mock fetch / mocked provider 只能归为 mocked-unit 或 component-integration,不得写成 browser-runtime 或 api-contract检查:上游 review / traceability 记录是否齐全、实现交接块是否稳定、worktree 状态与当前验证位置是否一致。
阻塞,下一步 hf-workflow-routerWorktree Path → 阻塞,下一步 hf-regression-gate明确回归覆盖:哪些模块/命令/测试套。不覆盖什么要显式写出。
运行完整回归命令。不用更弱证据替代。
检查退出码、失败数量、输出是否支持"回归通过"结论、结果是否属于当前代码。
先把当前信号映射到一类回归结论,再写 record。不要只说“测试大致没问题”。
| 信号 | 最少需要的 fresh evidence | conclusion | next_action_or_recommended_skill |
|---|---|---|---|
| build / typecheck / lint 失败 | 失败命令、退出码、关键报错摘录 | 需修改 | hf-test-driven-dev |
| 测试通过但覆盖率低于 项目级覆盖率门槛或当前任务门槛 | 覆盖率命令、实际结果、门槛来源 | 需修改 | hf-test-driven-dev |
| UI / API / full-stack 影响面缺少对应 evidence tier | 影响面、缺失 tier、已有 weaker evidence、DoD / 项目约定来源 | 需修改;若工具链 / 环境不可用且无降级许可 → 阻塞 | hf-test-driven-dev 或 hf-regression-gate |
| UI conformance claim 缺少截图 / DOM anchors / console-network evidence,或截图未对照 UI Implementation Contract | UI surface、缺失证据、contract anchor、已有 weaker evidence | 需修改;若环境不可用且无降级许可 → 阻塞 | hf-test-driven-dev 或 hf-regression-gate |
| 记录把 happy-dom / jsdom / mock fetch 称作真实浏览器或真实 API 集成 | 测试环境、mock 边界、错误分类的证据摘录 | 需修改 | hf-test-driven-dev |
lightweight 且仅文档 / 配置类变更 | 最小相关验证(如 docs build、lint、config parse)+ 明确未覆盖区域 | 结果驱动 | 通过时 hf-completion-gate,否则 hf-test-driven-dev |
| 强制集成 / e2e 验证因环境不可用而未跑 | 项目约定 / DoD 是否允许降级;若允许,给出替代验证结果;若不允许,写明阻塞原因 | 无降级许可 → 阻塞;有许可则按结果判断 | 无降级许可 → hf-regression-gate |
worktree-active 但证据来自其他目录或旧代码状态 | 当前 Worktree Path、证据来源路径 / 时间锚点 | 阻塞 | hf-regression-gate |
| 上游 review/gate 缺失,或 route / stage / profile 冲突 | 缺失项或冲突项清单 | 阻塞 | hf-workflow-router |
补充规则:
lightweight、文档-only 或环境问题而缩小回归范围,先检查 项目约定 / DoD 是否明文允许interactive:无明文允许时,先展示“建议缩减到什么 / 为什么 / 未覆盖什么”,等真人确认auto:无明文允许时不得自行降级,直接 阻塞记录:回归面定义、命令、退出码、结果摘要、新鲜度锚点、覆盖边界、未覆盖区域。
若项目未覆写格式,默认把 evidence bundle 映射到本 skill 模板 references/verification-record-template.md 的这些字段:
Metadata:Verification Type=regression-gate、Scope、Record Path、Worktree Path / Branch(若适用)Upstream Evidence Consumed:已消费的 traceability / review / handoff / task-progress 记录Verification Scope:Included Coverage、Uncovered AreasEvidence Tier Coverage:列出 mocked-unit / component-integration / api-contract / browser-runtime / full-stack-smoke 的 required / provided / N/A 状态UI Conformance Evidence:列出 screenshots、viewports、DOM anchors、console/network assertions、UI contract anchors、visual drift / token bypass 检查结果Commands And Results:命令、退出码、Summary、Notable OutputFreshness Anchor:为什么这些结果锚定当前代码状态Conclusion:通过 / 需修改 / 阻塞 + 唯一 Next Action Or Recommended Skill通过 → hf-completion-gate需修改 → hf-test-driven-dev阻塞(环境) → 重试 hf-regression-gate阻塞(上游) → hf-workflow-router记录保存到 项目声明的 verification 路径;若无项目覆写,默认使用 features/<active>/verification/regression-YYYY-MM-DD.md(如需对应到具体任务,可写 regression-task-NNN.md)。若项目无专用格式,默认使用本 skill 模板 references/verification-record-template.md。
最少应包含:
| 文件 | 用途 |
|---|---|
references/verification-record-template.md | regression verification record 模板(与 hf-completion-gate 同形态) |
references/runtime-smoke-profile.md | 项目侧 runtime smoke / health check / API contract / browser routes 声明模板 |
references/ui-conformance-evidence-profile.md | UI 截图、viewport、DOM/console/network 与 design contract 对照声明模板 |
| 借口 | 反驳 / Hard rule |
|---|---|
| "影响面分析跳过,直接看 CI 绿。" | Hard Gates: impact-based regression 要求基于 design + code change 显式列影响面;CI 绿不等于覆盖到位。 |
| "evidence bundle 里少一条 trace 不影响结论。" | Workflow stop rule: bundle 任一必需证据缺失即判 fail,不允许"不影响"裁量。 |
| "我先放过这次,下次回归再补全。" | Hard Gates (soul.md): gate 不能替用户降低门禁;补全才能 pass。 |
progress.md 已同步