feat(build,vbrief): Milestone 0 safety-net gate before refactoring — verify tests exist around critical paths before implementation begins
Summary
Directive's build skill starts implementation from an active scope vBRIEF without checking whether tests exist around the code paths the change will touch. For refactoring-type vBRIEFs this creates a regression risk: the refactor proceeds, task check catches failures at the end, but there is no baseline safety net that would have caught them during the work.
The Milestone 0 concept (from a widely-bookmarked repo audit prompt, 2,419 bookmarks) names this as a required milestone that must complete before any refactoring begins: ensure tests exist around critical paths, CI gates are active, and the change can be safely undone.
The principle
Milestone 0 / Safety net: anything needed before refactoring safely (tests around critical paths, CI gates, backups). This milestone must complete before Milestone 1 (critical fixes) begins.
This is the test-first-for-modification principle stated as a required gate, not a guideline. The distinction matters: the existing task check gate applies at the end of implementation. The safety-net gate applies at the start, before the agent writes any code.
Proposed changes
skills/deft-directive-build/SKILL.md -- add a safety-net check step before implementation begins on any scope vBRIEF tagged as refactor, restructure, or migration. The check asks: do tests exist that cover the critical paths this change will touch? If not, write them first and get them passing before proceeding. The scope vBRIEF moves to active only after the safety net passes.
main.md -- add the Milestone 0 principle to the decision-making section: for any change that modifies existing behavior, a safety net (tests around affected paths) must exist before implementation begins.
vbrief/vbrief.md -- document a safetyNetStatus field or equivalent note on refactoring-type scope vBRIEFs indicating whether the safety net step has been completed.
Acceptance criteria
- deft-directive-build has an explicit safety-net step that runs before implementation on refactoring/restructuring tasks
- The step checks for test coverage of affected paths and requires new tests if coverage is absent
- The step is skipped for greenfield (new code only) tasks where no existing behavior is being modified
- main.md states the Milestone 0 principle
- task check continues to be the post-implementation gate; this is the pre-implementation gate
Related
Source
@meta_alchemist repo audit prompt (https://x.com/meta_alchemist/status/2064431279383433646, 2,419 bookmarks, June 9 2026). Milestone 0 definition: "Safety net: anything needed before refactoring safely (tests around critical paths, CI gates, backups)."
feat(build,vbrief): Milestone 0 safety-net gate before refactoring — verify tests exist around critical paths before implementation begins
Summary
Directive's build skill starts implementation from an active scope vBRIEF without checking whether tests exist around the code paths the change will touch. For refactoring-type vBRIEFs this creates a regression risk: the refactor proceeds, task check catches failures at the end, but there is no baseline safety net that would have caught them during the work.
The Milestone 0 concept (from a widely-bookmarked repo audit prompt, 2,419 bookmarks) names this as a required milestone that must complete before any refactoring begins: ensure tests exist around critical paths, CI gates are active, and the change can be safely undone.
The principle
Milestone 0 / Safety net: anything needed before refactoring safely (tests around critical paths, CI gates, backups). This milestone must complete before Milestone 1 (critical fixes) begins.
This is the test-first-for-modification principle stated as a required gate, not a guideline. The distinction matters: the existing task check gate applies at the end of implementation. The safety-net gate applies at the start, before the agent writes any code.
Proposed changes
skills/deft-directive-build/SKILL.md -- add a safety-net check step before implementation begins on any scope vBRIEF tagged as refactor, restructure, or migration. The check asks: do tests exist that cover the critical paths this change will touch? If not, write them first and get them passing before proceeding. The scope vBRIEF moves to active only after the safety net passes.
main.md -- add the Milestone 0 principle to the decision-making section: for any change that modifies existing behavior, a safety net (tests around affected paths) must exist before implementation begins.
vbrief/vbrief.md -- document a safetyNetStatus field or equivalent note on refactoring-type scope vBRIEFs indicating whether the safety net step has been completed.
Acceptance criteria
Related
Source
@meta_alchemist repo audit prompt (https://x.com/meta_alchemist/status/2064431279383433646, 2,419 bookmarks, June 9 2026). Milestone 0 definition: "Safety net: anything needed before refactoring safely (tests around critical paths, CI gates, backups)."