Skip to content
Back to skills

Lane Cleanup

ASecurity

Safely audit and remove completed or abandoned Domios lane worktrees and Windows filesystem residue. Use when git worktree removal fails, a lane directory remains after cleanup, Windows reports access denied, reserved names such as NUL may exist, worktree pressure is high, or a completed task needs tab/worktree/branch cleanup without losing dirty or unmerged work.

  • 58 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 22, 2026
ai-agentsshellnodegit

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 22, 2026

npx -y skills add domios-dev/domios --skill lane-cleanup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lane Cleanup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lane Cleanup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/domios-dev-lane-cleanup/badge)](https://www.skillsdirectory.com/skills/domios-dev-lane-cleanup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lane-cleanup
description: Safely audit and remove completed or abandoned Domios lane worktrees and Windows filesystem residue. Use when git worktree removal fails, a lane directory remains after cleanup, Windows reports access denied, reserved names such as NUL may exist, worktree pressure is high, or a completed task needs tab/worktree/branch cleanup without losing dirty or unmerged work.
---

# Lane Cleanup

For Plan-wide cleanup, preview with `domios plan lanes <plan> --clean`, then
execute with `--confirm`. The live Plan Orchestrator may run this from a Team
utility shell it created. Keep the shell's own tab id and launch nonce; never
copy the parent's session or binding. The daemon checks recorded ownership and
the live Plan owner. Dirty, unmerged and occupied lanes remain protected.

The preview also inventories unregistered residue under the lane root. Confirm
removes only artifact directories without `.git` or tracked source, and checks
registration and live holders again immediately before deletion. Unknown content
stays protected. Removal unlinks reparse points without following their targets,
uses extended Windows paths, verifies absence and reports exact failed paths
with Windows holder evidence when available.

Acceptance defers cleanup while the Worker is live and retries when it closes.
Clean merged lanes lose their worktree and branch (`git branch -d`). Cancellation
may remove a clean unmerged worktree while retaining its branch for recovery.
Dirty lanes stay intact; reminders retain cleanup debt and its exact command.
`build.sh gc` trims expired lane `target`, `src-tauri/target` and `cli/target`
outputs using the configured build-cache retention, protecting recent artifacts,
tracked content and the calling checkout.

Use the bundled PowerShell script from the canonical checkout:

```powershell
& .\.agents\skills\lane-cleanup\scripts\cleanup-lane.ps1 `
  -LanePath 'D:\Developer\codeterm-worktrees\pl-example-task-example' `
  -Branch 'lane/pl-example-task-example' `
  -TabId 'deadbeef'
```

The script must prove all of these before deletion:

1. The resolved lane is inside the configured worktree root.
2. The lane is clean.
3. Its HEAD is an ancestor of canonical HEAD.
4. Any owning Domios tab supplied by the caller is closed first.
5. Windows reserved-name artifacts are removed through exact extended paths.

Before recursive deletion, the script walks real directories explicitly and
unlinks every reparse point without entering its target. Never recursively
delete through a lane's `node_modules` junction: it may target canonical.

Never use this skill on the canonical checkout, a dirty lane, an unmerged lane,
or an unknown directory. Do not kill processes by name. If deletion still fails,
report the exact path and holder evidence; preserve the branch and task cleanup
state until the handle is released.

For a directory already unregistered by Git, require the caller to re-check the
task's recorded ancestry/cleanup evidence and pass `-AllowUnregisteredResidue`.

After successful deletion, remove the merged branch with `git branch -d` and
record task cleanup as done. Use `-PlanId` and `-TaskId` to let the script record
that state automatically.

When you do not already know which tab owns the lane, prefer the daemon-side verb
`domios plan lane-remove <worktree> --branch <branch>`: it names the live tab
holding the directory and refuses before anything is deleted.

Files in this skill

  • SKILL.md3.4 KB
  • agents/openai.yaml236 B
  • scripts/cleanup-lane.ps14.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.