WU Prep Workflow
As of WU-1223, completing a Work Unit is a two-step process. This guide explains the new workflow.
Why Two Steps?
Section titled “Why Two Steps?”The previous single-step wu:done ran gates on main, which could cause issues with worktree isolation. The new workflow:
wu:prepruns gates in the worktree (where your changes are)wu:donedoes merge and cleanup from main
This ensures gates validate your actual changes, not stale main code.
The Workflow
Section titled “The Workflow”-
Work in your worktree
Complete your implementation, write tests, commit changes.
-
Run wu:prep from worktree
This command:
- Validates you’re in a worktree
- Runs quality gates
- Prints a copy-paste instruction for the next step
-
Run wu:done from main (copy-paste)
Copy the command printed by
wu:prep:This command:
- Validates you’re in main checkout
- Fast-forward merges your changes
- Creates completion stamp
- Removes the worktree
Command Reference
Section titled “Command Reference”wu:prep
Section titled “wu:prep”Prepares a WU for completion by running gates in the worktree.
| Flag | Description |
|---|---|
--id | WU ID (required) |
--docs-only | Run docs-only gates (format, spec-linter) |
--full-tests | Disable tests.unit scoping and run the default incremental/full test gate behavior |
By default, wu:prep uses the current WU’s tests.unit entries to scope the test gate.
Must be run from worktree - errors if run from main.
wu:done
Section titled “wu:done”Completes a WU by merging and cleaning up.
| Flag | Description |
|---|---|
--id | WU ID (required) |
--skip-gates | Skip gates (emergency only, requires —reason) |
Must be run from main - errors if run from worktree.
Error Messages
Section titled “Error Messages”Migration Notes
Section titled “Migration Notes”Before WU-1223
Section titled “Before WU-1223”After WU-1223
Section titled “After WU-1223”Escalation Resolution
Section titled “Escalation Resolution”If a WU has escalation_triggers (e.g., sensitive_data, security_p0), wu:done blocks until the escalation is resolved. Use wu:escalate to check status or resolve:
| Flag | Description |
|---|---|
--id | WU ID (required) |
--resolve | Resolve the escalation |
--resolver | Override resolver email (defaults to git config) |
After resolving, wu:done will succeed for escalation-triggered WUs.
Can I skip wu:prep?
Section titled “Can I skip wu:prep?”No. If you run wu:done from main without running wu:prep first, gates won’t have run in the worktree where your changes are. The previous behavior of running gates on main has been removed.
What if gates fail in wu:prep?
Section titled “What if gates fail in wu:prep?”Fix the issues in your worktree, then run wu:prep again. The workflow prevents partial completions.
Does this change skip-gates?
Section titled “Does this change skip-gates?”If you need to use --skip-gates, run wu:done directly from main with the --reason flag. This is for emergency use only when pre-existing failures block completion.