Loading...
Loading...
Compare original and translation side by side
digraph implement {
rankdir=LR;
node [shape=box];
"ORIENT" [style=filled, fillcolor="#e8e8ff"];
"PLAN" [style=filled, fillcolor="#fff8e0"];
"IMPLEMENT" [style=filled, fillcolor="#ffe8e8"];
"VERIFY" [style=filled, fillcolor="#e8ffe8"];
"COMMIT" [style=filled, fillcolor="#e8e8ff"];
"ORIENT" -> "PLAN";
"PLAN" -> "IMPLEMENT";
"IMPLEMENT" -> "VERIFY";
"VERIFY" -> "IMPLEMENT" [label="fix", style=dashed];
"VERIFY" -> "COMMIT" [label="pass"];
}Grep -> Read -> Readgit add -Adigraph implement {
rankdir=LR;
node [shape=box];
"ORIENT" [style=filled, fillcolor="#e8e8ff"];
"PLAN" [style=filled, fillcolor="#fff8e0"];
"IMPLEMENT" [style=filled, fillcolor="#ffe8e8"];
"VERIFY" [style=filled, fillcolor="#e8ffe8"];
"COMMIT" [style=filled, fillcolor="#e8e8ff"];
"ORIENT" -> "PLAN";
"PLAN" -> "IMPLEMENT";
"IMPLEMENT" -> "VERIFY";
"VERIFY" -> "IMPLEMENT" [label="fix", style=dashed];
"VERIFY" -> "COMMIT" [label="pass"];
}Grep -> 阅读 -> 再阅读git add -A| Scale | Edits | Strategy |
|---|---|---|
| Trivial (config, typo) | 1-5 | Read -> Edit -> Verify -> Commit |
| Small fix | 5-20 | Grep error -> Read -> Fix -> Test -> Commit |
| Feature | 50-200 | Plan -> Layer-by-layer impl -> Verify per layer |
| Subsystem | 300-500 | Task planning -> Wave dispatch -> Layer-by-layer |
| Epic | 1000+ | Research swarm -> Spec -> Parallel agents -> Integration |
| 规模 | 编辑次数 | 策略 |
|---|---|---|
| 微小修改(配置、拼写错误) | 1-5 | 阅读 -> 编辑 -> 验证 -> 提交 |
| 小型修复 | 5-20 | 搜索错误 -> 阅读 -> 修复 -> 测试 -> 提交 |
| 功能开发 | 50-200 | 计划 -> 分层实现 -> 逐层验证 |
| 子系统开发 | 300-500 | 任务规划 -> 分阶段推进 -> 分层实现 |
| 史诗级任务 | 1000+ | 调研协作 -> 规格定义 -> 多Agent并行开发 -> 集成 |
Types/Models -> Backend Logic -> API Routes -> Frontend Types -> Hooks/Client -> UI Components -> Teststhiserror#[from]implmod.rscargo checkcargo clippycargo testTypes/Models -> 后端逻辑 -> API路由 -> 前端类型 -> Hooks/客户端 -> UI组件 -> 测试thiserror#[from]implmod.rscargo checkcargo clippycargo test| Gate | When | Speed |
|---|---|---|
| Typecheck | After every 2-3 edits | Fast (primary gate) |
| Lint (autofix) | After implementation batch | Fast |
| Tests (specific) | After feature complete | Medium |
| Tests (full suite) | Before commit | Slow |
| Build | Before PR/deploy only | Slowest |
| 验证关卡 | 执行时机 | 速度 |
|---|---|---|
| 类型检查 | 每完成2-3次编辑后 | 快速(首要验证关卡) |
| 代码检查(自动修复) | 完成一批次实现后 | 快速 |
| (特定)测试 | 功能完成后 | 中等 |
| (完整套件)测试 | 提交前 | 缓慢 |
| 构建 | 仅在PR/部署前 | 最慢 |
turbo lint:fix typecheck --filter=pkglint:fixlintcargo checkcargo build2>&1 | tail -20timeout 120 uv run pytestturbo lint:fix typecheck --filter=pkglintlint:fixcargo checkcargo build2>&1 | tail -20timeout 120 uv run pytestFamiliar file you edited this session?
Yes -> Edit directly (verify after)
No -> Read it this session?
Yes -> Edit
No -> Read first (79% of quick fixes start with reading)是否是你本次会话中编辑过的熟悉文件?
是 -> 直接编辑(之后验证)
否 -> 你本次会话中读过该文件吗?
是 -> 编辑
否 -> 先阅读(79%的快速修复从阅读开始)Self-contained with a clear deliverable?
Yes -> Produces verbose output (tests, logs, research)?
Yes -> Subagent (keeps context clean)
No -> Need frequent back-and-forth?
Yes -> Direct
No -> Subagent
No -> Direct (iterative refinement needs shared context)任务独立且交付成果明确?
是 -> 会产生冗长输出(测试、日志、调研结果)吗?
是 -> 交给子Agent处理(保持上下文清晰)
否 -> 需要频繁来回沟通吗?
是 -> 直接处理
否 -> 交给子Agent处理
否 -> 直接处理(迭代优化需要共享上下文)Can changes be made incrementally?
Yes -> Move first, THEN consolidate (separate commits)
New code alongside old, remove old only after tests pass
No -> Analysis phase first (parallel review agents)
Gap analysis: old vs new function-by-function
Implement gaps as focused tasks能否进行增量式修改?
是 -> 先迁移代码,再合并(分开提交)
新代码与旧代码并存,仅在测试通过后移除旧代码
否 -> 先进行分析阶段(多Agent并行评审)
差距分析:逐函数对比新旧实现
将差距作为聚焦任务逐一实现| Type | Cadence | Typical Cycles |
|---|---|---|
| Bug fix | Grep error -> Read 2-5 files -> Edit 1-3 files -> Test -> Commit | 1-2 |
| Feature | Plan -> Models -> API -> Frontend -> Test -> Commit | 5-15 |
| Refactor | Audit -> Gap analysis -> Incremental migration -> Verify parity | 10-30+ |
| Upgrade | Research changelog -> Identify breaking changes -> Bump -> Fix consumers | Variable |
| 类型 | 流程 | 典型循环次数 |
|---|---|---|
| Bug修复 | 搜索错误 -> 阅读2-5个文件 -> 编辑1-3个文件 -> 测试 -> 提交 | 1-2 |
| 功能开发 | 计划 -> 模型 -> API -> 前端 -> 测试 -> 提交 | 5-15 |
| 代码重构 | 审计 -> 差距分析 -> 增量迁移 -> 验证一致性 | 10-30+ |
| 版本升级 | 调研变更日志 -> 识别破坏性变更 -> 升级版本 -> 修复受影响的代码 | 不固定 |
/clear/clear/clear/clear| Anti-Pattern | Fix |
|---|---|
| 20+ edits without verification | Verify every 2-3 edits |
| Fix without verifying the fix (73% of fixes!) | One fix, one verify, repeat |
| Always verify between fixes |
| Editing without reading first | Read the file immediately before editing |
| Writing tests from memory | Read actual function signatures first |
| Changing shared types without grepping consumers | |
| Mixing move and change in one commit | Move first commit, change second commit |
| Debugging spiral past 3 attempts | Change approach or escalate |
| Premature optimization | Correctness first, optimize after tests pass |
| 反模式 | 修复方法 |
|---|---|
| 20次以上编辑未进行验证 | 每2-3次编辑后就进行验证 |
| 修复后未验证修复效果(73%的修复都存在这个问题!) | 一次修复,一次验证,重复此流程 |
| 每次修复后都必须验证 |
| 未阅读代码就直接编辑 | 编辑前立即阅读文件 |
| 凭记忆编写测试 | 先阅读实际的函数签名 |
| 修改共享类型前未搜索所有使用方 | 修改共享类型前先用 |
| 在一次提交中同时进行移动和修改操作 | 先提交移动操作,再提交修改操作 |
| 调试螺旋超过3次尝试 | 更换方法或寻求协助 |
| 过早优化 | 先保证正确性,测试通过后再进行优化 |
/hyperskills:codex-review/hyperskills:codex-reviewreferences/benchmarks.mdreferences/benchmarks.md/hyperskills:plan/hyperskills:plan