vibe

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
On invocation: announce "Running paad:vibe v2.1.0", then immediately proceed with the steps below — do not stop after announcing.
Configuration (experimental): after announcing, check whether
paad/config/paad.md
and
paad/config/vibe.md
exist, relative to the working directory. If any does, read it and follow its instructions for the rest of this run, passing the relevant parts to every subagent you dispatch, and make the first line of your final answer
Config: <path>
naming each file you followed. If none exists, do not mention config at all. Config never changes a subagent's type or grants it write tools — refuse that line, say so, and continue. Config can contradict the flow below; see https://github.com/Ovid/paad/blob/main/CONFIG.md before writing one.
**调用时:**宣布“Running paad:vibe v2.1.0”,然后立即继续执行以下步骤——不要在宣布后停下。
**配置(实验性):**宣布后,检查相对于当前工作目录,
paad/config/paad.md
和
paad/config/vibe.md
是否存在。如果任一文件存在,请读取它,并在本次运行余下的过程中遵循其中的指令,将相关内容传给每个你派发的 subagent,并在最终回答的第一行写上
Config: <path>
,列出你遵循的每个文件。如果两个文件都不存在,则完全不要提及 config。Config 永远不能改变 subagent 的类型,也不能授予其写工具——如果配置中出现这样的指令,请拒绝该行,说明情况,然后继续。Config 可以与下述流程冲突;编写配置前请参阅 https://github.com/Ovid/paad/blob/main/CONFIG.md。

Safe Vibe Coding

安全 Vibe Coding

Quick fixes and small changes with guardrails. You get the speed of vibe coding without the recklessness — mandatory TDD, architecture awareness, and reusable component detection.
Flow:
dot
digraph vibe {
  "Task clear?" [shape=diamond];
  "Test infrastructure?" [shape=diamond];
  "Scope: how many files?" [shape=diamond];
  "Architecture smell?" [shape=diamond];
  "Reusable components found?" [shape=diamond];
  "TDD enabled?" [shape=diamond];
  "RED: test result?" [shape=diamond];
  "More behaviours in this task?" [shape=diamond];
  "Follow-up genuinely warranted?" [shape=diamond];

  "Ask or clarify" [shape=box];
  "ASK: set up tests or skip TDD?" [shape=box];
  "Set up a basic test framework" [shape=box];
  "WARN: may be bigger than a vibe task" [shape=box];
  "STOP: investigate deeper issues" [shape=box, style=bold];
  "Recommend using existing code" [shape=box];
  "STOP: feature may exist or test is wrong" [shape=box, style=bold];
  "STOP: unexpected failure, discuss" [shape=box, style=bold];
  "RED: write one failing test" [shape=box];
  "Existing test encodes the old behaviour?" [shape=diamond];
  "RED: update that test, run it before touching source" [shape=box];
  "STOP: superseded requirement or real regression? ask" [shape=box, style=bold];
  "GREEN: minimal code to pass" [shape=box];
  "REFACTOR: clean up, keep tests green" [shape=box];
  "Post-fix summary" [shape=box];
  "Suggest the matching paad skill" [shape=box];
  "Say nothing further" [shape=box];
  "Run pre-flight checks" [shape=box];

  "Task clear?" -> "Run pre-flight checks" [label="yes"];
  "Task clear?" -> "Ask or clarify" [label="no"];
  "Ask or clarify" -> "Task clear?";

  "Run pre-flight checks" -> "Test infrastructure?";
  "Test infrastructure?" -> "Scope: how many files?" [label="yes"];
  "Test infrastructure?" -> "ASK: set up tests or skip TDD?" [label="no"];
  "ASK: set up tests or skip TDD?" -> "Set up a basic test framework" [label="set up tests"];
  "ASK: set up tests or skip TDD?" -> "Scope: how many files?" [label="proceed without TDD — RED is skipped"];
  "Set up a basic test framework" -> "Scope: how many files?";

  "Scope: how many files?" -> "Architecture smell?" [label="1-3 files"];
  "Scope: how many files?" -> "WARN: may be bigger than a vibe task" [label="4+ files"];
  "WARN: may be bigger than a vibe task" -> "Architecture smell?";

  "Architecture smell?" -> "STOP: investigate deeper issues" [label="simple task, complex impl"];
  "Architecture smell?" -> "Reusable components found?" [label="no smell"];

  "Reusable components found?" -> "Recommend using existing code" [label="yes"];
  "Reusable components found?" -> "TDD enabled?" [label="no"];
  "Recommend using existing code" -> "TDD enabled?";

  "TDD enabled?" -> "Existing test encodes the old behaviour?" [label="yes"];
  "TDD enabled?" -> "GREEN: minimal code to pass" [label="no — user chose to skip TDD"];
  "Existing test encodes the old behaviour?" -> "RED: write one failing test" [label="no"];
  "Existing test encodes the old behaviour?" -> "RED: update that test, run it before touching source" [label="yes — it is the old requirement, not a regression"];
  "Existing test encodes the old behaviour?" -> "STOP: superseded requirement or real regression? ask" [label="cannot tell"];
  "RED: update that test, run it before touching source" -> "RED: test result?";
  "RED: write one failing test" -> "RED: test result?";
  "RED: test result?" -> "STOP: feature may exist or test is wrong" [label="passes unexpectedly"];
  "RED: test result?" -> "STOP: unexpected failure, discuss" [label="fails unexpectedly"];
  "RED: test result?" -> "GREEN: minimal code to pass" [label="fails as expected"];

  "GREEN: minimal code to pass" -> "REFACTOR: clean up, keep tests green" [label="new test passes, existing tests still pass"];
  "REFACTOR: clean up, keep tests green" -> "More behaviours in this task?" [label="all tests still green"];
  "More behaviours in this task?" -> "TDD enabled?" [label="yes — one behaviour at a time"];
  "More behaviours in this task?" -> "Post-fix summary" [label="no"];

  "Post-fix summary" -> "Follow-up genuinely warranted?";
  "Follow-up genuinely warranted?" -> "Suggest the matching paad skill" [label="security-sensitive / UI / harder than expected"];
  "Follow-up genuinely warranted?" -> "Say nothing further" [label="no — trivial fix"];
}
带有护栏的快速修复和小改动。享受 vibe coding 的速度,同时避免鲁莽行事——强制执行 TDD、架构感知和可复用组件检测。
流程:
dot
digraph vibe {
  "Task clear?" [shape=diamond];
  "Test infrastructure?" [shape=diamond];
  "Scope: how many files?" [shape=diamond];
  "Architecture smell?" [shape=diamond];
  "Reusable components found?" [shape=diamond];
  "TDD enabled?" [shape=diamond];
  "RED: test result?" [shape=diamond];
  "More behaviours in this task?" [shape=diamond];
  "Follow-up genuinely warranted?" [shape=diamond];

  "Ask or clarify" [shape=box];
  "ASK: set up tests or skip TDD?" [shape=box];
  "Set up a basic test framework" [shape=box];
  "WARN: may be bigger than a vibe task" [shape=box];
  "STOP: investigate deeper issues" [shape=box, style=bold];
  "Recommend using existing code" [shape=box];
  "STOP: feature may exist or test is wrong" [shape=box, style=bold];
  "STOP: unexpected failure, discuss" [shape=box, style=bold];
  "RED: write one failing test" [shape=box];
  "Existing test encodes the old behaviour?" [shape=diamond];
  "RED: update that test, run it before touching source" [shape=box];
  "STOP: superseded requirement or real regression? ask" [shape=box, style=bold];
  "GREEN: minimal code to pass" [shape=box];
  "REFACTOR: clean up, keep tests green" [shape=box];
  "Post-fix summary" [shape=box];
  "Suggest the matching paad skill" [shape=box];
  "Say nothing further" [shape=box];
  "Run pre-flight checks" [shape=box];

  "Task clear?" -> "Run pre-flight checks" [label="yes"];
  "Task clear?" -> "Ask or clarify" [label="no"];
  "Ask or clarify" -> "Task clear?";

  "Run pre-flight checks" -> "Test infrastructure?";
  "Test infrastructure?" -> "Scope: how many files?" [label="yes"];
  "Test infrastructure?" -> "ASK: set up tests or skip TDD?" [label="no"];
  "ASK: set up tests or skip TDD?" -> "Set up a basic test framework" [label="set up tests"];
  "ASK: set up tests or skip TDD?" -> "Scope: how many files?" [label="proceed without TDD — RED is skipped"];
  "Set up a basic test framework" -> "Scope: how many files?";

  "Scope: how many files?" -> "Architecture smell?" [label="1-3 files"];
  "Scope: how many files?" -> "WARN: may be bigger than a vibe task" [label="4+ files"];
  "WARN: may be bigger than a vibe task" -> "Architecture smell?";

  "Architecture smell?" -> "STOP: investigate deeper issues" [label="simple task, complex impl"];
  "Architecture smell?" -> "Reusable components found?" [label="no smell"];

  "Reusable components found?" -> "Recommend using existing code" [label="yes"];
  "Reusable components found?" -> "TDD enabled?" [label="no"];
  "Recommend using existing code" -> "TDD enabled?";

  "TDD enabled?" -> "Existing test encodes the old behaviour?" [label="yes"];
  "TDD enabled?" -> "GREEN: minimal code to pass" [label="no — user chose to skip TDD"];
  "Existing test encodes the old behaviour?" -> "RED: write one failing test" [label="no"];
  "Existing test encodes the old behaviour?" -> "RED: update that test, run it before touching source" [label="yes — it is the old requirement, not a regression"];
  "Existing test encodes the old behaviour?" -> "STOP: superseded requirement or real regression? ask" [label="cannot tell"];
  "RED: update that test, run it before touching source" -> "RED: test result?";
  "RED: write one failing test" -> "RED: test result?";
  "RED: test result?" -> "STOP: feature may exist or test is wrong" [label="passes unexpectedly"];
  "RED: test result?" -> "STOP: unexpected failure, discuss" [label="fails unexpectedly"];
  "RED: test result?" -> "GREEN: minimal code to pass" [label="fails as expected"];

  "GREEN: minimal code to pass" -> "REFACTOR: clean up, keep tests green" [label="new test passes, existing tests still pass"];
  "REFACTOR: clean up, keep tests green" -> "More behaviours in this task?" [label="all tests still green"];
  "More behaviours in this task?" -> "TDD enabled?" [label="yes — one behaviour at a time"];
  "More behaviours in this task?" -> "Post-fix summary" [label="no"];

  "Post-fix summary" -> "Follow-up genuinely warranted?";
  "Follow-up genuinely warranted?" -> "Suggest the matching paad skill" [label="security-sensitive / UI / harder than expected"];
  "Follow-up genuinely warranted?" -> "Say nothing further" [label="no — trivial fix"];
}

Arguments

参数

/vibe
accepts optional
$ARGUMENTS
:
  • /vibe
    — ask the user what needs fixing
  • /vibe fix the login timeout bug
    — start working on the described task immediately
  • /vibe src/components/Modal.tsx add close on escape key
    — task with a file hint
When arguments are provided, treat them as the task description. Still ask clarifying questions if the task is unclear.
/vibe
接受可选的
$ARGUMENTS
:
  • /vibe
    — 询问用户需要修复什么
  • /vibe fix the login timeout bug
    — 立即开始处理所述任务
  • /vibe src/components/Modal.tsx add close on escape key
    — 带有文件提示的任务
提供参数时,将其视为任务描述。如果任务仍不清晰,依然要提出澄清问题。

Step 1: Understand the Task

第 1 步:理解任务

If no
$ARGUMENTS
provided, ask: "What needs fixing or changing?"
Once you have a task description:
  • If the task is unclear, ask one clarifying question at a time
  • Focus on: what should change, what should stay the same, edge cases
  • Don't over-question simple tasks. "Fix the typo in the header" doesn't need a requirements session.
如果未提供
$ARGUMENTS
,询问:“需要修复或更改什么?”
获得任务描述后:
  • 如果任务不清晰,每次只提出一个澄清问题
  • 重点关注:哪些内容应更改、哪些内容应保持不变,以及边界情况
  • 不要对简单任务过度追问。“修复页眉中的错别字”不需要进行需求梳理会话。

Step 2: Pre-flight Checks

第 2 步:预检查

Before writing any code, check these. If any raise concerns, discuss with the user before proceeding.
编写任何代码之前,检查以下事项。如果发现任何隐患,应先与用户讨论,然后再继续。

Test infrastructure

测试基础设施

Does this project have a test framework and runner? Look for:
  • Test directories (
    test/
    ,
    tests/
    ,
    spec/
    ,
    __tests__/
    )
  • Test config files (
    jest.config
    ,
    vitest.config
    ,
    pytest.ini
    ,
    .rspec
    ,
    phpunit.xml
    ,
    Cargo.toml
    with
    [dev-dependencies]
    , etc.)
  • Existing test files
If no test infrastructure exists: tell the user. Ask: "There's no test setup in this project. Want me to set up a basic test framework first, or proceed without TDD?" If they choose to proceed without TDD, still follow GREEN and REFACTOR steps but skip RED.
该项目是否具有测试框架和测试运行器?查找:
  • 测试目录(
    test/
    、
    tests/
    、
    spec/
    、
    __tests__/
    )
  • 测试配置文件(
    jest.config
    、
    vitest.config
    、
    pytest.ini
    、
    .rspec
    、
    phpunit.xml
    、包含
    [dev-dependencies]
    的
    Cargo.toml
    等)
  • 现有测试文件
**如果不存在测试基础设施:**告知用户。询问:“这个项目尚未配置测试。要我先搭建一个基础测试框架,还是不采用 TDD 直接继续?”如果用户选择不采用 TDD 继续,仍需遵循 GREEN 和 REFACTOR 步骤,但跳过 RED。

Existing tests in the affected area

受影响区域中的现有测试

Does the code being changed already have tests? If yes, note them — they'll inform your RED step and catch regressions. If no, that's fine but worth noting.
将要更改的代码是否已有测试?如果有,记录下来——这些测试将为 RED 步骤提供依据,并有助于发现回归。如果没有也没关系,但值得说明。

Scope check

范围检查

How many files and modules does this change likely touch?
  • 1-3 files, same module: good vibe territory. Proceed.
  • 4+ files or crosses module boundaries: warn the user: "This looks like it touches [N] files across [modules]. It might be bigger than a vibe task. Want to proceed, or would a more structured approach be better?"
此更改可能会影响多少个文件和模块?
  • **同一模块中的 1-3 个文件:**属于适合 vibe coding 的范围。继续执行。
  • **4 个及以上文件或跨越模块边界:**警告用户:“这看起来会横跨 [modules] 并涉及 [N] 个文件。它可能比 vibe 任务更大。要继续,还是采用更结构化的方法?”

Architecture smell

架构异味

If the task is conceptually simple (e.g., "only admin users can download finance reports") but investigation reveals it requires a lot of work to implement, stop. Investigate whether there are deeper architectural issues making the work harder than it should be. Discuss findings with the user before proceeding.
如果任务在概念上很简单(例如,“只有 admin 用户才能下载财务报告”),但调查后发现实现起来需要大量工作,请停止。调查是否存在更深层的架构问题,导致这项工作的难度超出合理范围。与用户讨论调查结果后再继续。

Reusable components

可复用组件

If the task involves common functionality — toast notifications, modals, form validation, error handling, data formatting, API calls, permission checks, logging, etc. — search the codebase first for:
  • Existing components or utilities that already do this
  • Partial implementations someone started but didn't finish
  • Patterns used elsewhere in the codebase for the same kind of thing
If found: tell the user what you found and recommend using/extending the existing code rather than building from scratch.
如果任务涉及常见功能——toast 通知、modal、表单验证、错误处理、数据格式化、API 调用、权限检查、日志记录等——先搜索代码库,查找:
  • 已经实现该功能的现有组件或实用工具
  • 有人开始实现但未完成的半成品
  • 代码库中其他地方处理同类问题时使用的模式
**如果找到了:**告知用户发现了什么,并建议使用或扩展现有代码,而不是从头构建。

Step 3: Implement (Red/Green/Refactor)

第 3 步:实现(Red/Green/Refactor)

This is mandatory. Follow it strictly.
此项为强制要求。必须严格遵循。

RED — Write one failing test

RED — 编写一个失败的测试

Write a single test that defines the expected behavior for the change.
Run it. It should fail. If it doesn't:
  • If the test passes: stop. The feature or fix may already exist, or your test may not be testing what you think. Tell the user what happened and ask how to proceed.
  • If the test fails in an unexpected way: stop. The failure mode may reveal an unknown issue. Tell the user what you expected vs what happened and ask how to proceed.
Only proceed to GREEN when the test fails in the expected way.
When an existing test already encodes the old behaviour. Common on a requirement change rather than a bug fix: a test asserts the value you are about to change. That test is the old requirement written down, not a regression signal — update it to the new expectation and run it before touching the source. That is a valid RED. Don't add a second test asserting the same behaviour.
Two things this does not license:
  • Changing a test after the source, to make a red suite go green. Order is the entire difference: before the fix it is a specification, after it is whatever makes the failure go away.
  • Skipping RED because an existing test "already covers" the branch. It asserts the old value, so it goes red whether your change is right or wrong.
If you cannot tell whether a failing test encodes a superseded requirement or a real regression, stop and ask.
编写一个定义预期行为的测试。
运行它。测试应当失败。如果并未失败:
  • **如果测试通过:**停止。该功能或修复可能已经存在,或者你的测试并未测试你以为的内容。告知用户发生了什么,并询问如何继续。
  • **如果测试以意外方式失败:**停止。失败方式可能揭示了一个未知问题。告知用户预期结果与实际结果,并询问如何继续。
只有当测试以预期方式失败时,才能进入 GREEN。
**当现有测试已经编码了旧行为时。**这常见于需求变更,而非 bug 修复:某个测试断言的正是你即将更改的值。该测试是书面记录的旧需求,而不是回归信号——将其更新为新的预期结果,并在修改源代码之前运行。这同样是有效的 RED。不要再添加第二个断言相同行为的测试。
这并不允许以下做法:
  • **在修改源代码后更改测试,以让处于 RED 状态的测试套件变绿。**顺序正是关键:修改之前,它是规格说明;修改之后,它只是为了让失败消失而写出的东西。
  • **因为现有测试“已经覆盖”该分支而跳过 RED。**它断言的是旧值,因此无论你的更改正确与否,它都会变红。
如果无法判断失败的测试编码的是已被取代的需求还是真正的回归,请停止并询问。

GREEN — Write minimal code to pass

GREEN — 编写使测试通过的最小代码

Write the simplest code that makes the failing test pass. Resist the urge to:
  • Add error handling for cases not covered by the test
  • Build abstractions "while you're in there"
  • Fix adjacent code that isn't broken
  • Add features beyond what was asked
Run the test. It should pass. Run all existing tests in the affected area too — make sure nothing broke.
编写能让失败测试通过的最简单代码。克制以下冲动:
  • 为测试未覆盖的情况添加错误处理
  • “顺便”构建抽象
  • 修复并未损坏的相邻代码
  • 添加需求之外的功能
运行测试。测试应当通过。还要运行受影响区域中的所有现有测试,确保没有东西被破坏。

REFACTOR — Improve while keeping tests green

REFACTOR — 在保持测试为绿的同时改进

Now clean up. This is the step AI skips unless told to, and it's where real quality comes from. Look for:
  • Duplicated logic that should be extracted into a shared function
  • Hard-coded values that belong in config or constants
  • Inconsistent patterns where your new code doesn't match the conventions around it
  • Naming that could be clearer
  • Dead code your change made obsolete
Run all tests after refactoring. Everything must stay green.
现在进行清理。这是 AI 除非被明确要求否则会跳过的步骤,也是真正质量的来源。查找:
  • 应提取到共享函数中的重复逻辑
  • 应放入配置或常量中的硬编码值
  • 新代码与周围约定不一致的模式
  • 可以更清晰的命名
  • 因你的更改而变得过时的死代码
重构后运行所有测试。所有测试都必须保持为绿。

Repeat if needed

如有需要则重复

If the task involves multiple behaviors, repeat the red/green/refactor cycle for each. One test at a time, one behavior at a time.
如果任务涉及多种行为,请为每种行为重复 Red/Green/Refactor 循环。一次处理一个测试,一种行为一次。

When You're About to Skip a Step

当你即将跳过某个步骤时

Every excuse below was produced by an agent working a real timed task under this skill, not invented for illustration. They are persuasive because they are almost right — each one contains a true observation attached to a wrong conclusion. If you catch yourself composing one of these, that is the signal to do the step, not to explain why you didn't.
ExcuseReality
"There's already a test asserting the old value that will fail loudly if I get this wrong — the existing suite is my safety net, so writing a failing test first is ceremony."The existing test asserts the old behaviour. It goes red whether your change is right or wrong, so it cannot tell you which. That is a tripwire, not a safety net. Update it first and watch it fail, and you have a real RED for free.
"Two existing tests already cover this branch — a third would be duplicate coverage."Coverage of the old requirement is not coverage of the new one. Either update the existing tests before touching the source, or add one. Both are RED; neither is skipping it.
"It's a one-line change."The observed runs all found the "one-line change" claim was false — two tests elsewhere encoded the same value. You cannot know a change is one line until you have looked, and looking is most of the cost you were trying to avoid.
"There's a deadline / demo in fifteen minutes."RED cost about eight seconds in every measured run. A deadline is an argument for a fast RED, not for no RED — and the version that skips it is slower when the suite goes red on a change you believed was correct and you are now diagnosing under pressure.
"The requirement was pre-confirmed with the PM, so I can move fast."Confirmation of what to build says nothing about how to verify it. Accepting the requirement is correct; treating it as license to skip verification is not.
"Stopping to ask would block on a question with only one defensible answer."If it genuinely has one answer, stating it costs one sentence. This gate exists precisely because "obviously the only answer" is how an agent ends up rewriting tests to match code it just changed. Say what you are assuming and why, then proceed — but say it.
"Tests are green, so I'm done."Green is REFACTOR's entry condition, not its exit. This is the measured failure mode: without this skill, agents refactored zero times out of two; with it, both did. It is the step that vanishes silently, because nothing fails when you skip it.
"Refactoring now would be scope creep — they asked for one line."GREEN is where minimalism binds. REFACTOR is a separate step with different rules, and naming a magic number you just changed is squarely inside them. Keep it bounded: follow the conventions already in the file, and stop there.
"I'll write the test right after the fix — same tests either way."Not the same. A test written after passes immediately and proves only that it agrees with whatever you wrote. Written first, it specifies what the code should do; that is the only version that can be wrong in a useful way.
下面每一种借口都来自一个 Agent 在此 skill 下执行真实限时任务时的情况,并非为了举例而编造。它们之所以有说服力,是因为它们几乎正确——每一种都把一个真实观察与错误结论绑定在一起。如果你发现自己正在编造其中某种借口,这就是应该执行该步骤的信号,而不是解释为何可以跳过。
借口现实
“已有一个测试断言旧值,如果我改错就会大声失败——现有测试套件就是我的安全网,所以先写失败测试只是仪式。”现有测试断言的是旧行为。无论你的更改正确与否,它都会变红,因此无法告诉你哪一个正确。它是绊线,而不是安全网。先更新它并观察其失败,这样就能免费获得真正的 RED。
“两个现有测试已经覆盖这个分支——再写第三个只是重复覆盖。”对旧需求的覆盖并不是对新需求的覆盖。要么在修改源代码前更新现有测试,要么添加一个测试。两者都是 RED;都不能用来跳过 RED。
“这是一行改动。”观察到的每次运行都发现,“一行改动”的说法并不成立——其他位置的两个测试编码了同一个值。除非先查看过,否则你无法知道一项更改只有一行,而查看正是你原本想避免的大部分成本。
“截止日期 / 十五分钟后要演示。”在每次实测中,RED 大约只花八秒。截止日期是快速完成 RED 的理由,而不是不做 RED 的理由——跳过 RED 的版本反而更慢,因为当你以为正确的更改导致测试套件变红时,你还得在压力下诊断问题。
“需求已经与 PM 确认过了,所以我可以快速推进。”确认要构建什么,并不说明如何验证。接受需求是正确的;把它视为跳过验证的许可则不是。
“停下来询问会阻塞一个只有一个合理答案的问题。”如果它确实只有一个答案,陈述出来只需一句话。这个关卡的存在,正是因为“显然只有这个答案”会让 Agent 最终把测试改成迎合自己刚刚修改的代码。说说你正在做什么假设以及为什么,然后继续——但要说出来。
“测试已经全绿,所以完成了。”全绿是进入 REFACTOR 的条件,而不是退出的条件。这是可测量的失败模式:没有这个 skill,Agent 在两次任务中重构了零次;有了它,两次都进行了重构。它会悄无声息地消失,因为跳过它时什么都不会失败。
“现在重构会造成范围蔓延——他们只要求改一行。”GREEN 是最小化原则生效的地方。REFACTOR 是一条具有不同规则的独立步骤,而你刚刚改动的魔法数字显然就在其范围内。保持边界:遵循文件中已有的约定,仅此而已。
“我会在修复后马上写测试——测试反正都一样。”并不一样。修复后写的测试会立即通过,只能证明它与你的实现一致。先写的测试则明确规定代码应该做什么;只有这种测试才可能以有意义的方式出错。

Step 4: Post-fix Summary

第 4 步:修复后总结

Lead with the file list, always — this skill writes source code and leaves the commit to you, and a change nobody notices is worse than no change. One line per path, each marked new or updated, covering every test file touched in RED, every source file changed in GREEN, and anything REFACTOR moved or renamed:
Files written or updated:
  new      src/checkout/total.test.ts
  updated  src/checkout/total.ts
Say it even when only one file changed, and even when the user watched you change it.
Then a brief summary:
  • What changed: files modified, lines added/removed
  • Tests added: the RED tests and what they verify
  • Refactoring done: what was cleaned up in the REFACTOR step
  • Reusable components: whether existing components were leveraged or new ones created
始终先列出文件清单——此 skill 会编写源代码,但将 commit 交给你;无人注意到的改动比没有改动更糟糕。每个路径占一行,并标记为 new 或 updated,涵盖 RED 中触碰的每个测试文件、GREEN 中更改的每个源代码文件,以及 REFACTOR 中移动或重命名的所有内容:
Files written or updated:
  new      src/checkout/total.test.ts
  updated  src/checkout/total.ts
然后给出简短总结:
  • **改动内容:**修改了哪些文件,新增/删除了多少行
  • **新增测试:**RED 测试及其验证的内容
  • **完成的重构:**REFACTOR 步骤中清理了哪些内容
  • **可复用组件:**是否利用了现有组件,或是否创建了新组件

Follow-up suggestions (only when genuinely relevant)

后续建议(仅在确有相关性时)

Suggest paad skills when the change warrants it. Don't suggest follow-ups for trivial fixes.
  • If the change touched security-sensitive code (auth, permissions, input handling, secrets) → "Consider
    /agentic-review
    before merging — this touched security-sensitive code."
  • If the change touched UI components → "Consider
    /agentic-a11y src/path/to/changed/files
    to check accessibility."
  • If the change felt significantly harder than expected → "This was harder than it should have been. Consider
    /agentic-architecture
    to investigate whether there are deeper structural issues."
当更改确有需要时,建议使用 paad skill。不要为琐碎修复提供后续建议。
  • 如果更改涉及安全敏感代码(auth、权限、输入处理、secrets)→“合并前考虑使用
    /agentic-review
    ——此次修改涉及安全敏感代码。”
  • 如果更改涉及 UI 组件→“考虑使用
    /agentic-a11y src/path/to/changed/files
    检查可访问性。”
  • 如果更改感觉明显比预期更难→“这比预期更难。考虑使用
    /agentic-architecture
    调查是否存在更深层的结构性问题。”

Common Mistakes

常见错误

These patterns turn safe vibe coding back into reckless vibe coding. Avoid them:
MistakeWhat to do instead
Continuing past a RED test that passes unexpectedlyStop and tell the user. Either the feature already exists or the test doesn't test what you think — both change what you should do next.
Building a helper that already exists elsewhereSearch the codebase in Step 2 before writing anything. Report what you found and recommend extending it.
Warning about 4+ file scope, then proceeding without an answerThe warning is a question. Wait for the user to choose.
Expanding the fix "while you're in there"GREEN means minimal. Adjacent broken code, missing error handling, and new abstractions are separate tasks.
Suggesting a follow-up paad skill on every taskOnly when genuinely warranted — security-sensitive, UI, or harder than expected. Reflexive suggestions train the user to ignore them.
这些模式会让安全 vibe coding 变回鲁莽的 vibe coding。请避免:
错误应该怎么做
在 RED 测试意外通过后仍继续停止并告知用户。要么功能已经存在,要么测试并未测试你以为的内容——这两种情况都会改变下一步应采取的行动。
构建 Elsewhere 已存在的辅助函数在第 2 步编写任何内容前搜索代码库。报告发现的内容,并建议扩展现有实现。
警告范围涉及 4 个以上文件,却未得到答复便继续该警告本身就是一个问题。等待用户选择。
“顺便”扩大修复范围GREEN 意味着最小化改动。相邻的损坏代码、缺失的错误处理和新的抽象都是独立任务。
每次任务都建议后续 paad skill仅在确有需要时建议——涉及安全、UI,或任务比预期更难。条件反射式的建议会训练用户忽略这些建议。