Housekeeping
Generic, portable housekeeping sweep for any checkout. A read-only audit of dirty trees, diverged or deleted branches, forgotten stashes, stale worktrees, temp debris, leftover processes, disk pressure, and stuck tracker claims, plus explicitly-gated cleanup methods that dry-run by default. Project-agnostic: projectDir defaults to ., with .beads/ and .swamp/ awareness layered on when present.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| projectDir? | string | Repository root to audit. Defaults to the current directory so the model stays portable. |
| defaultBranch? | string | Branch to treat as the mainline. Auto-detected from origin/HEAD, then main, then master. |
| bdBin? | string | Beads CLI binary name or path |
| staleClaimDays? | number | Age (days) after which an in-progress tracker claim is reported stale even when its lease has not expired |
| staleTempHours? | number | Age (hours) after which matched temp debris is reported stale |
| tempGlobs? | array | Glob patterns matched (one level deep) under the temp roots |
| tempRoots? | array | Directories scanned for temp debris. Empty means $TMPDIR and projectDir. |
| processPatterns? | array | pgrep patterns for leftover processes. Empty disables the process check. |
| includeBeads? | boolean | Run tracker hygiene checks when .beads/ is present |
| includeTemp? | boolean | Scan for temp debris, leftover processes, and disk pressure |
| Argument | Type | Description |
|---|---|---|
| dryRun? | boolean | |
| verbose? | boolean |
| Argument | Type | Description |
|---|---|---|
| dryRun? | boolean | |
| force? | boolean | Pass --force to release another actor's claim |
| reason? | string |
| Argument | Type | Description |
|---|---|---|
| dryRun? | boolean | |
| force? | boolean | Remove directories recursively; without it only files are removed |
Resources
Files
Run the read-only housekeeping sweep and refresh the markdown report. Requires a model instance named `housekeeping` created from @maphew/housekeeping.
Adversarial-review fixes: entry logging in every method; warn (instead of silently skip) on a missing bd binary and on bd JSON parse failure; report when the default branch cannot be resolved for merged-branch detection; add trunk/develop to default-branch candidates.
Packaging fix 2: quote the bundled workflow name so the scoped @maphew/housekeeping identifier parses as YAML (an unquoted @ is a reserved YAML indicator). The workflow now registers. No behavior changes.
Added 1 workflows
Packaging fix: the bundled workflow is now listed by basename so it extracts to extension/workflows/workflow-housekeeping.yaml and registers as @maphew/housekeeping. No behavior changes.
Initial release. Read-only generic housekeeping sweep: git (dirty/detached/diverged/gone/merged/stash), worktrees (stale/prunable/locked), temp debris + leftover processes + disk pressure, and tracker hygiene (bd version drift, expired/idle claims, stale/orphans/doctor). Cleanup methods (pruneWorktrees, unclaimStaleBeads, cleanTemp) dry-run by default. Bundled @maphew/housekeeping workflow.
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
Spawns a subprocess with Deno.Command().
- models/src/housekeeping.ts:214 — no reason given