agentsclimarketplace

Teardown

Skill edlovesjava/workspace-skills/skills/teardown

Tear down a branch-based virtual-monorepo workspace once a JIRA branch is merged or abandoned. Refuses to remove worktrees with uncommitted or unpushed work unless --force is given. Use when the user says "teardown workspace", "clean up JIRA-123 worktrees", "remove the workspace for ABC-42", or similar.From its SKILL.md

Install
npx -y skills add edlovesjava/workspace-skills --skill teardown

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.3 KB, as published. Nobody here has run it

virtual-monorepo:teardown

Remove every worktree in a branch-based workspace and delete the per-branch directory under the worktree root. Main clones in the root workspace are left intact.

This implements the virtual-monorepo:teardown <jira-id> skill from Pattern 4 of Managing Claude Code Across Multiple Repositories: "Clean up worktrees and temporary workspace structure once the work is complete."

When to use

  • "teardown workspace JIRA-123"
  • "remove the worktrees for ABC-42"
  • "the PR merged, clean up FOO-9"

Inputs

  • <branch> (required, positional): the workspace key.
  • --force (optional): proceed even if some worktree has uncommitted changes or unpushed commits.
  • --root=… / --repos=… / --workspace-dir=… / --worktree-root=… — same as virtual-monorepo:init.

What it does

  1. For each repo's worktree under <worktree_root>/<branch>/<repo>:
    • Verifies it is clean: no git status changes, no commits ahead of upstream.
    • If anything is dirty/unpushed and --force is not set, aborts before removing anything.
  2. Calls git worktree remove --force <path> for each repo (the --force here just bypasses the lock-file check; cleanliness is enforced by step 1).
  3. Removes the empty <worktree_root>/<branch> directory.
  4. Leaves main clones in <main_clones_dir> untouched.

Safety

The skill is non-destructive by default. If any repo would lose work, nothing is removed. The user must explicitly opt into --force to discard local-only commits or uncommitted edits.

Branches in the main clones are not deleted automatically — local branches in .main/<repo> may still reference the JIRA branch. The skill prints a hint at the end so the user can prune if they want.

How to invoke

bash "$CLAUDE_PROJECT_DIR/skills/teardown/teardown.sh" <branch> [--force] [other flags…]

Examples

bash skills/teardown/teardown.sh JIRA-123
bash skills/teardown/teardown.sh JIRA-123 --force

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.