Files to Review
2026-09-06 23:54:13作者:范垣楠Rhoda
Files to Review
BEFORE analyzing, read these files:
- [List specific files that changed in the diff]
- [Files referenced by changes but not modified]
Use Read tool to load each file.
If you cannot find a file:
- Check exact path from diff
- Try alternate locations
- Report: "Cannot locate [path] - please verify file exists"
DO NOT proceed with review until you've read the actual code.
显式指令直接消解了问题 6 中的"文件不存在"误报。这一机制的演进形态可以在当前仓库的 [code-reviewer.md 模板](https://gitcode.com/GitHub_Trending/su/superpowers/blob/44c9b2d6e889982ac18c27d05a19fefe335194e1/skills/requesting-code-review/code-reviewer.md?utm_source=gitcode_repo_files) 中看到:模板现在明确要求审查基于 `git diff` 范围进行,并规定"Give feedback on code you didn't actually read"是 DON'T 清单中的行为——"只评论你真正读过的代码"已被写进审查纪律。
### 改进 6:testing-anti-patterns 增加"Mock 源自实现"反模式
针对问题 5,新增 Anti-Pattern 6:**Mocks Derived from Implementation(从实现推导的 Mock)**。错误形态与问题 5 相同:Mock 编码了 bug(mock 有 `cleanup()`、接口定义的是 `close()`),测试通过正是因为代码和 Mock 一起错。修复方式是**从接口推导 Mock**:
```typescript
// ✅ GOOD: Derive mock from interface
// Step 1: Open interface definition (PlatformAdapter)
// Step 2: List methods defined there (close, initialize, etc.)
// Step 3: Mock EXACTLY those methods
const mock = {
initialize: vi.fn().mockResolvedValue(undefined),
close: vi.fn().mockResolvedValue(undefined), // From interface!
};
// Now test FAILS because code calls cleanup() which doesn't exist
// That failure reveals the bug BEFORE runtime
配套的 Gate Function 把顺序固化下来:
BEFORE writing any mock:
1. STOP - Do NOT look at the code under test yet
2. FIND: The interface/type definition for the dependency
3. READ: The interface file
4. LIST: Methods defined in the interface
5. MOCK: ONLY those methods with EXACTLY those names
6. DO NOT: Look at what your code calls
IF your test fails because code calls something not in mock:
✅ GOOD - The test found a bug in your code
Fix the code to call the correct interface method
NOT the mock
Red flags:
- "I'll mock what the code calls"
- Copying method names from implementation
- Mock written without reading interface
- "The test is failing so I'll add this method to the mock"
还附带了检测路径:当出现"测试通过但运行时报 X is not a function"时,检查 X 是否被 Mock、比对 Mock 方法与接口方法、寻找方法名不匹配。
改进 7:subagent-driven-development 强制测试类 subagent 读取技能
当任务涉及测试时,提示词模板中加入强制项:
BEFORE writing any tests:
1. Read testing-anti-patterns skill:
Use Skill tool: superpowers:testing-anti-patterns
2. Apply gate functions from that skill when:
- Writing mocks
- Adding methods to production classes
- Mocking dependencies
This is NOT optional. Tests that violate anti-patterns will be rejected in review.
设计意图是"确保技能被真正使用,而不只是存在";权衡是每个任务多花时间,但能拦截一整类 bug。
改进 8:允许实施者修复自己发现的问题
修改 Step 2 的回报协议,消除问题 7 的多余往返:
Subagent performs self-reflection, then:
IF self-reflection identifies fixable issues:
1. Fix the issues
2. Re-run verification
3. Report: "Initial implementation + self-reflection fix"
ELSE:
Report: "Implementation complete"
Include in report:
- Self-reflection findings
- Whether fixes were applied
- Final verification results
登录后查看全文
热门项目推荐
相关项目推荐
atomcodeClaude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get StartedRust0624
Hy4-previewHy4 preview 是由腾讯混元团队研发的新一代混合专家(MoE)旗舰模型。模型总参数量 770B,每个 token 激活 49B,主干共包含78层,第一层采用标准 FFN,其余 77 层均为 MoE 结构,每层包含 256 个路由专家与 1 个共享专家,每个 token 激活 top-8 路由专家及共享专家。主干之外原生内置 1 层 MTP(总参数量 10B,激活 0.7B)以支持投机解码。Python00
GLM-5.3GLM-5.3 与 GLM-5.2 使用相同的基座模型——所有提升均来自后训练。与 GLM-5.2 相比,它在复杂编程和长程任务上的表现显著提升。Jinja00
GLM-5.3-FlashGLM-5.3-Flash (320B-A18B),是GLM-5系列的首个原生多模态模型。320B总参数,能力超过GLM-5.2Jinja00
Spark-X2.5-4BSpark-X2.5-4B 旨在让强大的 AI 更实用、更高效、更易获得。在广泛日常任务中表现强劲,涵盖对话、写作、翻译、推理、编码、工具调用以及智能体工作流,并在同等规模的开源模型中取得领先成绩。Spark-X2.5 将面向效率的架构与最高 1M tokens 的原生上下文窗口相结合,并支持 200 多种语言。Python00
Spark-X2.5-1.7BSpark-X2.5-1.7B 旨在让强大的 AI 更加实用、高效且易于获取。这些模型在广泛的日常任务中表现出色,涵盖对话、写作、翻译、推理、编程、工具调用和智能体工作流,并在同等规模的开源模型中取得领先结果。Spark-X2.5 将面向效率的架构与最高 1M tokens 的原生上下文窗口相结合,并支持 200 多种语言。Python00
最新内容推荐
LobeHub deep-review 对抗式验证子代理:逐条证伪代码审查发现的设计与实现Go 项目目录布局详解:project-layout 标准目录结构的设计原则与实操指南深入 goccy/go-yaml:lazydocker 的 YAML 编解码、Anchor/Alias 与 YAMLPath 实现解析Supabase pm-the-docs:文档创作 Frame/Shape 阶段的决策支持技能——受众、产品阶段与跨仓库范围判定Headroom 贡献指南全解:从 PR 工作流、Real behavior proof 到本地开发环境与架构原则Axios 请求别名方法详解:request、get/post 到 query 与 Form 简写的完整机制Material UI Transitions 主题机制详解:用 theme.transitions 定制一致的 CSS 过渡动画Svelte `<svelte:document>` 详解:Document 级事件监听、属性绑定与 Attachments 用法freeCodeCamp 课程本地化挑战夹具详解:以 challenge-js-comments.md 看挑战文件结构与校验机制Open Interpreter 的 check-kimi-code-docs:以“文档优先”回答 Kimi Code 产品问题的内建 Skill
项目优选
收起
deepin linux kernel
C
33
18
作为 Ascend for PyTorch 社区的核心组件,TorchNPU 是昇腾专为 PyTorch 打造的深度学习适配插件,使 PyTorch 框架能够直接调用昇腾 NPU,为开发者提供昇腾 AI 处理器的超强算力。
Python
855
1.34 K
openEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。
C
528
589
🔥LeetCode solutions in any programming language | 多种编程语言实现 LeetCode、《剑指 Offer(第 2 版)》、《程序员面试金典(第 6 版)》题解
Markdown
77
23
本项目是CANN提供的transformer类大模型算子库,实现网络在NPU上加速计算。
C++
1.13 K
2.73 K
暂无描述
Markdown
895
5.79 K
JiuwenSwarm 是一款基于openJiuwen开发的智能AI Agent,它能够将大语言模型的强大能力,通过你日常使用的各类通讯应用,直接延伸至你的指尖。
Python
3.56 K
1.01 K
CANN 学习中心仓,支持在线互动运行、边学边练,提供教程、示例与优化方案,一站式助力昇腾开发者快速上手。
Jupyter Notebook
998
511
本项目是CANN提供的神经网络类计算算子库,实现网络在NPU上加速计算。
C++
908
1.83 K
openGauss kernel ~ openGauss is an open source relational database management system
C++
213
313